diff --git a/.editorconfig b/.editorconfig
new file mode 100644
index 000000000..cf2bb0aab
--- /dev/null
+++ b/.editorconfig
@@ -0,0 +1,7 @@
+root = true
+
+[*.cs]
+indent_style = space
+indent_size = 4
+insert_final_newline = true
+trim_trailing_whitespace = true
diff --git a/.gitattributes b/.gitattributes
index 5b4f894c0..b8a09ccc9 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -10,4 +10,5 @@
*.exe filter=lfs diff=lfs merge=lfs -text
*.meta -text
*.asset -text
-*.unity -text
\ No newline at end of file
+*.unity -text
+*.bundle filter=lfs diff=lfs merge=lfs -text
diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md
index 3b7df1cb5..c17e1dc1c 100644
--- a/.github/ISSUE_TEMPLATE.md
+++ b/.github/ISSUE_TEMPLATE.md
@@ -9,7 +9,8 @@ Have you read GitHub for Unity's Code of Conduct? By filing an Issue, you are ex
- Be sure to run with tracing enabled to capture runtime details in the log file
- Include the log file in the PR.
- On Windows, the extension log file is at `%LOCALAPPDATA%\GitHubUnity\github-unity.log`
- - On macOS, the extension log file is at `~/.local/share/GitHubUnity/github-unity.log`
+ - On macOS, the extension log file is at `~/Library/Logs/GitHubUnity/github-unity.log`
+ - On linux, the extension log file is at `~/.local/share/GitHubUnity/github-unity.log`
### Description
diff --git a/.gitignore b/.gitignore
index bcd8c5dcd..7fc38bf13 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,9 +1,11 @@
.vs/
.idea/
+.vscode/
packages/
_NCrunch_GitHub.Unity
*.user
.DS_Store
build/
TestResult.xml
-submodules/
\ No newline at end of file
+*.stackdump
+*.lastcodeanalysissucceeded
\ No newline at end of file
diff --git a/.gitmodules b/.gitmodules
index d9e14a3e9..8ecda521f 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -1,3 +1,6 @@
[submodule "script"]
path = script
url = git@github.com:github-for-unity/UnityBuildScripts
+[submodule "submodules/packaging"]
+ path = submodules/packaging
+ url = https://github.com/github-for-unity/packaging
diff --git a/GitHub.Unity.OctokitDebugging.sln b/GitHub.Unity.OctokitDebugging.sln
deleted file mode 100644
index 8d9cef6c2..000000000
--- a/GitHub.Unity.OctokitDebugging.sln
+++ /dev/null
@@ -1,132 +0,0 @@
-
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 14
-VisualStudioVersion = 14.0.25420.1
-MinimumVisualStudioVersion = 10.0.40219.1
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GitHub.Unity", "src\UnityExtension\Assets\Editor\GitHub.Unity\GitHub.Unity.csproj", "{ADD7A18B-DD2A-4C22-A2C1-488964EFF30A}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GitHub.Api", "src\GitHub.Api\GitHub.Api.csproj", "{B389ADAF-62CC-486E-85B4-2D8B078DF763}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GitHub.Logging", "src\GitHub.Logging\GitHub.Logging.csproj", "{BB6A8EDA-15D8-471B-A6ED-EE551E0B3BA0}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CopyLibrariesToDevelopmentFolder", "src\packaging\CopyLibrariesToDevelopmentFolder\CopyLibrariesToDevelopmentFolder.csproj", "{44257C81-EE4A-4817-9AF4-A26C02AA6DD4}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UnitTests", "src\tests\UnitTests\UnitTests.csproj", "{69F13D9D-AD56-4EEC-AE10-D528EE23E1A9}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IntegrationTests", "src\tests\IntegrationTests\IntegrationTests.csproj", "{1AC3F82E-AEAE-4C84-825C-207BB264FCFA}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{D17F1B4C-42DC-4E78-BCEF-9F239A084C4D}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "packaging", "packaging", "{B50B646C-3B86-4BDA-9F2B-766F96608CE0}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CopyLibrariesToPackageProject", "src\packaging\CopyLibrariesToPackageProject\CopyLibrariesToPackageProject.csproj", "{7DEF4226-7740-457F-9199-34174C49A978}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestUtils", "src\tests\TestUtils\TestUtils.csproj", "{66A1D219-F61D-4AE4-9BD7-AAEB97276FFF}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TaskSystem", "src\tests\TaskSystemIntegrationTests\TaskSystem.csproj", "{1A382F40-FD9E-43E1-89C1-320073F35CE9}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestApp", "src\tests\TestApp\TestApp.csproj", "{08B87D2A-8CF1-4211-B7AA-5209F00F72F8}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "dotnet-httpclient35", "dotnet-httpclient35", "{C6854BB9-D594-46B0-9E10-72607CC97E77}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "octokit", "octokit", "{5C9C1D3B-0740-4EF3-A374-CCCD67FB6E48}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Octokit-35", "..\octokit.net\Octokit\Octokit-35.csproj", "{49EF16A2-5ED1-480F-80A1-D1D05D6C1BE4}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Net.Http-net_3_5", "..\dotnet-httpclient35\System.Net.Http\System.Net.Http-net_3_5.csproj", "{9862694D-E4FA-418B-8692-A0280FEDDF36}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Any CPU = Debug|Any CPU
- dev|Any CPU = dev|Any CPU
- Release|Any CPU = Release|Any CPU
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {ADD7A18B-DD2A-4C22-A2C1-488964EFF30A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {ADD7A18B-DD2A-4C22-A2C1-488964EFF30A}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {ADD7A18B-DD2A-4C22-A2C1-488964EFF30A}.dev|Any CPU.ActiveCfg = dev|Any CPU
- {ADD7A18B-DD2A-4C22-A2C1-488964EFF30A}.dev|Any CPU.Build.0 = dev|Any CPU
- {ADD7A18B-DD2A-4C22-A2C1-488964EFF30A}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {ADD7A18B-DD2A-4C22-A2C1-488964EFF30A}.Release|Any CPU.Build.0 = Release|Any CPU
- {B389ADAF-62CC-486E-85B4-2D8B078DF763}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {B389ADAF-62CC-486E-85B4-2D8B078DF763}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {B389ADAF-62CC-486E-85B4-2D8B078DF763}.dev|Any CPU.ActiveCfg = dev|Any CPU
- {B389ADAF-62CC-486E-85B4-2D8B078DF763}.dev|Any CPU.Build.0 = dev|Any CPU
- {B389ADAF-62CC-486E-85B4-2D8B078DF763}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {B389ADAF-62CC-486E-85B4-2D8B078DF763}.Release|Any CPU.Build.0 = Release|Any CPU
- {BB6A8EDA-15D8-471B-A6ED-EE551E0B3BA0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {BB6A8EDA-15D8-471B-A6ED-EE551E0B3BA0}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {BB6A8EDA-15D8-471B-A6ED-EE551E0B3BA0}.dev|Any CPU.ActiveCfg = dev|Any CPU
- {BB6A8EDA-15D8-471B-A6ED-EE551E0B3BA0}.dev|Any CPU.Build.0 = dev|Any CPU
- {BB6A8EDA-15D8-471B-A6ED-EE551E0B3BA0}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {BB6A8EDA-15D8-471B-A6ED-EE551E0B3BA0}.Release|Any CPU.Build.0 = Release|Any CPU
- {44257C81-EE4A-4817-9AF4-A26C02AA6DD4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {44257C81-EE4A-4817-9AF4-A26C02AA6DD4}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {44257C81-EE4A-4817-9AF4-A26C02AA6DD4}.dev|Any CPU.ActiveCfg = Debug|Any CPU
- {44257C81-EE4A-4817-9AF4-A26C02AA6DD4}.dev|Any CPU.Build.0 = Debug|Any CPU
- {44257C81-EE4A-4817-9AF4-A26C02AA6DD4}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {44257C81-EE4A-4817-9AF4-A26C02AA6DD4}.Release|Any CPU.Build.0 = Release|Any CPU
- {69F13D9D-AD56-4EEC-AE10-D528EE23E1A9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {69F13D9D-AD56-4EEC-AE10-D528EE23E1A9}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {69F13D9D-AD56-4EEC-AE10-D528EE23E1A9}.dev|Any CPU.ActiveCfg = Debug|Any CPU
- {69F13D9D-AD56-4EEC-AE10-D528EE23E1A9}.dev|Any CPU.Build.0 = Debug|Any CPU
- {69F13D9D-AD56-4EEC-AE10-D528EE23E1A9}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {69F13D9D-AD56-4EEC-AE10-D528EE23E1A9}.Release|Any CPU.Build.0 = Release|Any CPU
- {1AC3F82E-AEAE-4C84-825C-207BB264FCFA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {1AC3F82E-AEAE-4C84-825C-207BB264FCFA}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {1AC3F82E-AEAE-4C84-825C-207BB264FCFA}.dev|Any CPU.ActiveCfg = Debug|Any CPU
- {1AC3F82E-AEAE-4C84-825C-207BB264FCFA}.dev|Any CPU.Build.0 = Debug|Any CPU
- {1AC3F82E-AEAE-4C84-825C-207BB264FCFA}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {1AC3F82E-AEAE-4C84-825C-207BB264FCFA}.Release|Any CPU.Build.0 = Release|Any CPU
- {7DEF4226-7740-457F-9199-34174C49A978}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {7DEF4226-7740-457F-9199-34174C49A978}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {7DEF4226-7740-457F-9199-34174C49A978}.dev|Any CPU.ActiveCfg = Debug|Any CPU
- {7DEF4226-7740-457F-9199-34174C49A978}.dev|Any CPU.Build.0 = Debug|Any CPU
- {7DEF4226-7740-457F-9199-34174C49A978}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {7DEF4226-7740-457F-9199-34174C49A978}.Release|Any CPU.Build.0 = Release|Any CPU
- {66A1D219-F61D-4AE4-9BD7-AAEB97276FFF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {66A1D219-F61D-4AE4-9BD7-AAEB97276FFF}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {66A1D219-F61D-4AE4-9BD7-AAEB97276FFF}.dev|Any CPU.ActiveCfg = Debug|Any CPU
- {66A1D219-F61D-4AE4-9BD7-AAEB97276FFF}.dev|Any CPU.Build.0 = Debug|Any CPU
- {66A1D219-F61D-4AE4-9BD7-AAEB97276FFF}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {66A1D219-F61D-4AE4-9BD7-AAEB97276FFF}.Release|Any CPU.Build.0 = Release|Any CPU
- {1A382F40-FD9E-43E1-89C1-320073F35CE9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {1A382F40-FD9E-43E1-89C1-320073F35CE9}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {1A382F40-FD9E-43E1-89C1-320073F35CE9}.dev|Any CPU.ActiveCfg = Debug|Any CPU
- {1A382F40-FD9E-43E1-89C1-320073F35CE9}.dev|Any CPU.Build.0 = Debug|Any CPU
- {1A382F40-FD9E-43E1-89C1-320073F35CE9}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {1A382F40-FD9E-43E1-89C1-320073F35CE9}.Release|Any CPU.Build.0 = Release|Any CPU
- {08B87D2A-8CF1-4211-B7AA-5209F00F72F8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {08B87D2A-8CF1-4211-B7AA-5209F00F72F8}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {08B87D2A-8CF1-4211-B7AA-5209F00F72F8}.dev|Any CPU.ActiveCfg = Debug|Any CPU
- {08B87D2A-8CF1-4211-B7AA-5209F00F72F8}.dev|Any CPU.Build.0 = Debug|Any CPU
- {08B87D2A-8CF1-4211-B7AA-5209F00F72F8}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {08B87D2A-8CF1-4211-B7AA-5209F00F72F8}.Release|Any CPU.Build.0 = Release|Any CPU
- {49EF16A2-5ED1-480F-80A1-D1D05D6C1BE4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {49EF16A2-5ED1-480F-80A1-D1D05D6C1BE4}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {49EF16A2-5ED1-480F-80A1-D1D05D6C1BE4}.dev|Any CPU.ActiveCfg = Debug|Any CPU
- {49EF16A2-5ED1-480F-80A1-D1D05D6C1BE4}.dev|Any CPU.Build.0 = Debug|Any CPU
- {49EF16A2-5ED1-480F-80A1-D1D05D6C1BE4}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {49EF16A2-5ED1-480F-80A1-D1D05D6C1BE4}.Release|Any CPU.Build.0 = Release|Any CPU
- {9862694D-E4FA-418B-8692-A0280FEDDF36}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {9862694D-E4FA-418B-8692-A0280FEDDF36}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {9862694D-E4FA-418B-8692-A0280FEDDF36}.dev|Any CPU.ActiveCfg = Debug|Any CPU
- {9862694D-E4FA-418B-8692-A0280FEDDF36}.dev|Any CPU.Build.0 = Debug|Any CPU
- {9862694D-E4FA-418B-8692-A0280FEDDF36}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {9862694D-E4FA-418B-8692-A0280FEDDF36}.Release|Any CPU.Build.0 = Release|Any CPU
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
- GlobalSection(NestedProjects) = preSolution
- {44257C81-EE4A-4817-9AF4-A26C02AA6DD4} = {B50B646C-3B86-4BDA-9F2B-766F96608CE0}
- {69F13D9D-AD56-4EEC-AE10-D528EE23E1A9} = {D17F1B4C-42DC-4E78-BCEF-9F239A084C4D}
- {1AC3F82E-AEAE-4C84-825C-207BB264FCFA} = {D17F1B4C-42DC-4E78-BCEF-9F239A084C4D}
- {7DEF4226-7740-457F-9199-34174C49A978} = {B50B646C-3B86-4BDA-9F2B-766F96608CE0}
- {66A1D219-F61D-4AE4-9BD7-AAEB97276FFF} = {D17F1B4C-42DC-4E78-BCEF-9F239A084C4D}
- {1A382F40-FD9E-43E1-89C1-320073F35CE9} = {D17F1B4C-42DC-4E78-BCEF-9F239A084C4D}
- {08B87D2A-8CF1-4211-B7AA-5209F00F72F8} = {D17F1B4C-42DC-4E78-BCEF-9F239A084C4D}
- {49EF16A2-5ED1-480F-80A1-D1D05D6C1BE4} = {5C9C1D3B-0740-4EF3-A374-CCCD67FB6E48}
- {9862694D-E4FA-418B-8692-A0280FEDDF36} = {C6854BB9-D594-46B0-9E10-72607CC97E77}
- EndGlobalSection
-EndGlobal
diff --git a/GitHub.Unity.sln b/GitHub.Unity.sln
index e5ce29f0a..0707a70fa 100644
--- a/GitHub.Unity.sln
+++ b/GitHub.Unity.sln
@@ -5,8 +5,12 @@ VisualStudioVersion = 14.0.25420.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GitHub.Unity", "src\UnityExtension\Assets\Editor\GitHub.Unity\GitHub.Unity.csproj", "{ADD7A18B-DD2A-4C22-A2C1-488964EFF30A}"
EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GitHub.Unity.45", "src\UnityExtension\Assets\Editor\GitHub.Unity\GitHub.Unity.45.csproj", "{ADD7A18B-DD2A-4C22-A2C1-488964EFF30B}"
+EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GitHub.Api", "src\GitHub.Api\GitHub.Api.csproj", "{B389ADAF-62CC-486E-85B4-2D8B078DF763}"
EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GitHub.Api.45", "src\GitHub.Api\GitHub.Api.45.csproj", "{B389ADAF-62CC-486E-85B4-2D8B078DF76B}"
+EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GitHub.Logging", "src\GitHub.Logging\GitHub.Logging.csproj", "{BB6A8EDA-15D8-471B-A6ED-EE551E0B3BA0}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CopyLibrariesToDevelopmentFolder", "src\packaging\CopyLibrariesToDevelopmentFolder\CopyLibrariesToDevelopmentFolder.csproj", "{44257C81-EE4A-4817-9AF4-A26C02AA6DD4}"
@@ -25,75 +29,148 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestUtils", "src\tests\Test
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TaskSystem", "src\tests\TaskSystemIntegrationTests\TaskSystem.csproj", "{1A382F40-FD9E-43E1-89C1-320073F35CE9}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestApp", "src\tests\TestApp\TestApp.csproj", "{08B87D2A-8CF1-4211-B7AA-5209F00F72F8}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CommandLine", "src\tests\CommandLine\CommandLine.csproj", "{08B87D2A-8CF1-4211-B7AA-5209F00F72F8}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestWebServer", "src\tests\TestWebServer\TestWebServer.csproj", "{3DD3451C-30FA-4294-A3A9-1E080342F867}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UnityTests", "src\UnityExtension\Assets\Editor\UnityTests\UnityTests.csproj", "{462CDBD4-0DDA-4854-1B13-CFDACBFB66F5}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ExtensionLoader", "src\UnityExtension\Assets\Editor\GitHub.Unity\ExtensionLoader\ExtensionLoader.csproj", "{6B0EAB30-511A-44C1-87FE-D9AB7E34D115}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UnityShim", "src\UnityShim\UnityShim.csproj", "{F94F8AE1-C171-4A83-89E8-6557CA91A188}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
+ DebugNoUnity|Any CPU = DebugNoUnity|Any CPU
dev|Any CPU = dev|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{ADD7A18B-DD2A-4C22-A2C1-488964EFF30A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{ADD7A18B-DD2A-4C22-A2C1-488964EFF30A}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {ADD7A18B-DD2A-4C22-A2C1-488964EFF30A}.DebugNoUnity|Any CPU.ActiveCfg = Debug|Any CPU
{ADD7A18B-DD2A-4C22-A2C1-488964EFF30A}.dev|Any CPU.ActiveCfg = dev|Any CPU
{ADD7A18B-DD2A-4C22-A2C1-488964EFF30A}.dev|Any CPU.Build.0 = dev|Any CPU
{ADD7A18B-DD2A-4C22-A2C1-488964EFF30A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{ADD7A18B-DD2A-4C22-A2C1-488964EFF30A}.Release|Any CPU.Build.0 = Release|Any CPU
+ {ADD7A18B-DD2A-4C22-A2C1-488964EFF30B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {ADD7A18B-DD2A-4C22-A2C1-488964EFF30B}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {ADD7A18B-DD2A-4C22-A2C1-488964EFF30B}.DebugNoUnity|Any CPU.ActiveCfg = Debug|Any CPU
+ {ADD7A18B-DD2A-4C22-A2C1-488964EFF30B}.dev|Any CPU.ActiveCfg = dev|Any CPU
+ {ADD7A18B-DD2A-4C22-A2C1-488964EFF30B}.dev|Any CPU.Build.0 = dev|Any CPU
+ {ADD7A18B-DD2A-4C22-A2C1-488964EFF30B}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {ADD7A18B-DD2A-4C22-A2C1-488964EFF30B}.Release|Any CPU.Build.0 = Release|Any CPU
{B389ADAF-62CC-486E-85B4-2D8B078DF763}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B389ADAF-62CC-486E-85B4-2D8B078DF763}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {B389ADAF-62CC-486E-85B4-2D8B078DF763}.DebugNoUnity|Any CPU.ActiveCfg = Debug|Any CPU
+ {B389ADAF-62CC-486E-85B4-2D8B078DF763}.DebugNoUnity|Any CPU.Build.0 = Debug|Any CPU
{B389ADAF-62CC-486E-85B4-2D8B078DF763}.dev|Any CPU.ActiveCfg = dev|Any CPU
{B389ADAF-62CC-486E-85B4-2D8B078DF763}.dev|Any CPU.Build.0 = dev|Any CPU
{B389ADAF-62CC-486E-85B4-2D8B078DF763}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B389ADAF-62CC-486E-85B4-2D8B078DF763}.Release|Any CPU.Build.0 = Release|Any CPU
+ {B389ADAF-62CC-486E-85B4-2D8B078DF76B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {B389ADAF-62CC-486E-85B4-2D8B078DF76B}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {B389ADAF-62CC-486E-85B4-2D8B078DF76B}.DebugNoUnity|Any CPU.ActiveCfg = Debug|Any CPU
+ {B389ADAF-62CC-486E-85B4-2D8B078DF76B}.DebugNoUnity|Any CPU.Build.0 = Debug|Any CPU
+ {B389ADAF-62CC-486E-85B4-2D8B078DF76B}.dev|Any CPU.ActiveCfg = dev|Any CPU
+ {B389ADAF-62CC-486E-85B4-2D8B078DF76B}.dev|Any CPU.Build.0 = dev|Any CPU
+ {B389ADAF-62CC-486E-85B4-2D8B078DF76B}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {B389ADAF-62CC-486E-85B4-2D8B078DF76B}.Release|Any CPU.Build.0 = Release|Any CPU
{BB6A8EDA-15D8-471B-A6ED-EE551E0B3BA0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BB6A8EDA-15D8-471B-A6ED-EE551E0B3BA0}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {BB6A8EDA-15D8-471B-A6ED-EE551E0B3BA0}.DebugNoUnity|Any CPU.ActiveCfg = Debug|Any CPU
+ {BB6A8EDA-15D8-471B-A6ED-EE551E0B3BA0}.DebugNoUnity|Any CPU.Build.0 = Debug|Any CPU
{BB6A8EDA-15D8-471B-A6ED-EE551E0B3BA0}.dev|Any CPU.ActiveCfg = dev|Any CPU
{BB6A8EDA-15D8-471B-A6ED-EE551E0B3BA0}.dev|Any CPU.Build.0 = dev|Any CPU
{BB6A8EDA-15D8-471B-A6ED-EE551E0B3BA0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BB6A8EDA-15D8-471B-A6ED-EE551E0B3BA0}.Release|Any CPU.Build.0 = Release|Any CPU
{44257C81-EE4A-4817-9AF4-A26C02AA6DD4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{44257C81-EE4A-4817-9AF4-A26C02AA6DD4}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {44257C81-EE4A-4817-9AF4-A26C02AA6DD4}.DebugNoUnity|Any CPU.ActiveCfg = Debug|Any CPU
+ {44257C81-EE4A-4817-9AF4-A26C02AA6DD4}.DebugNoUnity|Any CPU.Build.0 = Debug|Any CPU
{44257C81-EE4A-4817-9AF4-A26C02AA6DD4}.dev|Any CPU.ActiveCfg = Debug|Any CPU
{44257C81-EE4A-4817-9AF4-A26C02AA6DD4}.dev|Any CPU.Build.0 = Debug|Any CPU
{44257C81-EE4A-4817-9AF4-A26C02AA6DD4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{44257C81-EE4A-4817-9AF4-A26C02AA6DD4}.Release|Any CPU.Build.0 = Release|Any CPU
{69F13D9D-AD56-4EEC-AE10-D528EE23E1A9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{69F13D9D-AD56-4EEC-AE10-D528EE23E1A9}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {69F13D9D-AD56-4EEC-AE10-D528EE23E1A9}.DebugNoUnity|Any CPU.ActiveCfg = Debug|Any CPU
+ {69F13D9D-AD56-4EEC-AE10-D528EE23E1A9}.DebugNoUnity|Any CPU.Build.0 = Debug|Any CPU
{69F13D9D-AD56-4EEC-AE10-D528EE23E1A9}.dev|Any CPU.ActiveCfg = Debug|Any CPU
{69F13D9D-AD56-4EEC-AE10-D528EE23E1A9}.dev|Any CPU.Build.0 = Debug|Any CPU
{69F13D9D-AD56-4EEC-AE10-D528EE23E1A9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{69F13D9D-AD56-4EEC-AE10-D528EE23E1A9}.Release|Any CPU.Build.0 = Release|Any CPU
{1AC3F82E-AEAE-4C84-825C-207BB264FCFA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1AC3F82E-AEAE-4C84-825C-207BB264FCFA}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {1AC3F82E-AEAE-4C84-825C-207BB264FCFA}.DebugNoUnity|Any CPU.ActiveCfg = Debug|Any CPU
+ {1AC3F82E-AEAE-4C84-825C-207BB264FCFA}.DebugNoUnity|Any CPU.Build.0 = Debug|Any CPU
{1AC3F82E-AEAE-4C84-825C-207BB264FCFA}.dev|Any CPU.ActiveCfg = Debug|Any CPU
{1AC3F82E-AEAE-4C84-825C-207BB264FCFA}.dev|Any CPU.Build.0 = Debug|Any CPU
{1AC3F82E-AEAE-4C84-825C-207BB264FCFA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1AC3F82E-AEAE-4C84-825C-207BB264FCFA}.Release|Any CPU.Build.0 = Release|Any CPU
{7DEF4226-7740-457F-9199-34174C49A978}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7DEF4226-7740-457F-9199-34174C49A978}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {7DEF4226-7740-457F-9199-34174C49A978}.DebugNoUnity|Any CPU.ActiveCfg = Debug|Any CPU
{7DEF4226-7740-457F-9199-34174C49A978}.dev|Any CPU.ActiveCfg = Debug|Any CPU
{7DEF4226-7740-457F-9199-34174C49A978}.dev|Any CPU.Build.0 = Debug|Any CPU
{7DEF4226-7740-457F-9199-34174C49A978}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7DEF4226-7740-457F-9199-34174C49A978}.Release|Any CPU.Build.0 = Release|Any CPU
{66A1D219-F61D-4AE4-9BD7-AAEB97276FFF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{66A1D219-F61D-4AE4-9BD7-AAEB97276FFF}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {66A1D219-F61D-4AE4-9BD7-AAEB97276FFF}.DebugNoUnity|Any CPU.ActiveCfg = Debug|Any CPU
+ {66A1D219-F61D-4AE4-9BD7-AAEB97276FFF}.DebugNoUnity|Any CPU.Build.0 = Debug|Any CPU
{66A1D219-F61D-4AE4-9BD7-AAEB97276FFF}.dev|Any CPU.ActiveCfg = Debug|Any CPU
{66A1D219-F61D-4AE4-9BD7-AAEB97276FFF}.dev|Any CPU.Build.0 = Debug|Any CPU
{66A1D219-F61D-4AE4-9BD7-AAEB97276FFF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{66A1D219-F61D-4AE4-9BD7-AAEB97276FFF}.Release|Any CPU.Build.0 = Release|Any CPU
{1A382F40-FD9E-43E1-89C1-320073F35CE9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1A382F40-FD9E-43E1-89C1-320073F35CE9}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {1A382F40-FD9E-43E1-89C1-320073F35CE9}.DebugNoUnity|Any CPU.ActiveCfg = Debug|Any CPU
+ {1A382F40-FD9E-43E1-89C1-320073F35CE9}.DebugNoUnity|Any CPU.Build.0 = Debug|Any CPU
{1A382F40-FD9E-43E1-89C1-320073F35CE9}.dev|Any CPU.ActiveCfg = Debug|Any CPU
{1A382F40-FD9E-43E1-89C1-320073F35CE9}.dev|Any CPU.Build.0 = Debug|Any CPU
{1A382F40-FD9E-43E1-89C1-320073F35CE9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1A382F40-FD9E-43E1-89C1-320073F35CE9}.Release|Any CPU.Build.0 = Release|Any CPU
{08B87D2A-8CF1-4211-B7AA-5209F00F72F8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{08B87D2A-8CF1-4211-B7AA-5209F00F72F8}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {08B87D2A-8CF1-4211-B7AA-5209F00F72F8}.DebugNoUnity|Any CPU.ActiveCfg = Debug|Any CPU
+ {08B87D2A-8CF1-4211-B7AA-5209F00F72F8}.DebugNoUnity|Any CPU.Build.0 = Debug|Any CPU
{08B87D2A-8CF1-4211-B7AA-5209F00F72F8}.dev|Any CPU.ActiveCfg = Debug|Any CPU
{08B87D2A-8CF1-4211-B7AA-5209F00F72F8}.dev|Any CPU.Build.0 = Debug|Any CPU
{08B87D2A-8CF1-4211-B7AA-5209F00F72F8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{08B87D2A-8CF1-4211-B7AA-5209F00F72F8}.Release|Any CPU.Build.0 = Release|Any CPU
+ {3DD3451C-30FA-4294-A3A9-1E080342F867}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {3DD3451C-30FA-4294-A3A9-1E080342F867}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {3DD3451C-30FA-4294-A3A9-1E080342F867}.DebugNoUnity|Any CPU.ActiveCfg = Debug|Any CPU
+ {3DD3451C-30FA-4294-A3A9-1E080342F867}.DebugNoUnity|Any CPU.Build.0 = Debug|Any CPU
+ {3DD3451C-30FA-4294-A3A9-1E080342F867}.dev|Any CPU.ActiveCfg = Debug|Any CPU
+ {3DD3451C-30FA-4294-A3A9-1E080342F867}.dev|Any CPU.Build.0 = Debug|Any CPU
+ {3DD3451C-30FA-4294-A3A9-1E080342F867}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {3DD3451C-30FA-4294-A3A9-1E080342F867}.Release|Any CPU.Build.0 = Release|Any CPU
+ {462CDBD4-0DDA-4854-1B13-CFDACBFB66F5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {462CDBD4-0DDA-4854-1B13-CFDACBFB66F5}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {462CDBD4-0DDA-4854-1B13-CFDACBFB66F5}.DebugNoUnity|Any CPU.ActiveCfg = Debug|Any CPU
+ {462CDBD4-0DDA-4854-1B13-CFDACBFB66F5}.dev|Any CPU.ActiveCfg = Debug|Any CPU
+ {462CDBD4-0DDA-4854-1B13-CFDACBFB66F5}.dev|Any CPU.Build.0 = Debug|Any CPU
+ {462CDBD4-0DDA-4854-1B13-CFDACBFB66F5}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {462CDBD4-0DDA-4854-1B13-CFDACBFB66F5}.Release|Any CPU.Build.0 = Release|Any CPU
+ {6B0EAB30-511A-44C1-87FE-D9AB7E34D115}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {6B0EAB30-511A-44C1-87FE-D9AB7E34D115}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {6B0EAB30-511A-44C1-87FE-D9AB7E34D115}.DebugNoUnity|Any CPU.ActiveCfg = Debug|Any CPU
+ {6B0EAB30-511A-44C1-87FE-D9AB7E34D115}.DebugNoUnity|Any CPU.Build.0 = Debug|Any CPU
+ {6B0EAB30-511A-44C1-87FE-D9AB7E34D115}.dev|Any CPU.ActiveCfg = dev|Any CPU
+ {6B0EAB30-511A-44C1-87FE-D9AB7E34D115}.dev|Any CPU.Build.0 = dev|Any CPU
+ {6B0EAB30-511A-44C1-87FE-D9AB7E34D115}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {6B0EAB30-511A-44C1-87FE-D9AB7E34D115}.Release|Any CPU.Build.0 = Release|Any CPU
+ {F94F8AE1-C171-4A83-89E8-6557CA91A188}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {F94F8AE1-C171-4A83-89E8-6557CA91A188}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {F94F8AE1-C171-4A83-89E8-6557CA91A188}.DebugNoUnity|Any CPU.ActiveCfg = Debug|Any CPU
+ {F94F8AE1-C171-4A83-89E8-6557CA91A188}.DebugNoUnity|Any CPU.Build.0 = Debug|Any CPU
+ {F94F8AE1-C171-4A83-89E8-6557CA91A188}.dev|Any CPU.ActiveCfg = dev|Any CPU
+ {F94F8AE1-C171-4A83-89E8-6557CA91A188}.dev|Any CPU.Build.0 = dev|Any CPU
+ {F94F8AE1-C171-4A83-89E8-6557CA91A188}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {F94F8AE1-C171-4A83-89E8-6557CA91A188}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -106,5 +183,10 @@ Global
{66A1D219-F61D-4AE4-9BD7-AAEB97276FFF} = {D17F1B4C-42DC-4E78-BCEF-9F239A084C4D}
{1A382F40-FD9E-43E1-89C1-320073F35CE9} = {D17F1B4C-42DC-4E78-BCEF-9F239A084C4D}
{08B87D2A-8CF1-4211-B7AA-5209F00F72F8} = {D17F1B4C-42DC-4E78-BCEF-9F239A084C4D}
+ {3DD3451C-30FA-4294-A3A9-1E080342F867} = {D17F1B4C-42DC-4E78-BCEF-9F239A084C4D}
+ {462CDBD4-0DDA-4854-1B13-CFDACBFB66F5} = {D17F1B4C-42DC-4E78-BCEF-9F239A084C4D}
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {66BD4D50-3779-4912-9596-2C838BF24911}
EndGlobalSection
EndGlobal
diff --git a/GitHub.Unity.sln.DotSettings b/GitHub.Unity.sln.DotSettings
index ee988de68..2166c735a 100644
--- a/GitHub.Unity.sln.DotSettings
+++ b/GitHub.Unity.sln.DotSettings
@@ -22,8 +22,11 @@
END_OF_LINE
1
1
+ False
+ False
False
True
+ NEVER
False
True
False
@@ -335,10 +338,20 @@
</TypePattern>
</Patterns>
ID
+ MD
SSH
<Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" />
<Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" />
+ True
+ True
+ True
+ True
True
True
+ True
True
- True
\ No newline at end of file
+ True
+ True
+ False
+ x64
+
\ No newline at end of file
diff --git a/LICENSE b/LICENSE
index 32e3acbc9..a306528ee 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,6 +1,6 @@
MIT License
-Copyright (c) 2016 GitHub
+Copyright (c) 2016-2019 GitHub
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/README.md b/README.md
index e52b33699..1cd67b951 100644
--- a/README.md
+++ b/README.md
@@ -1,175 +1,36 @@
# [GitHub for Unity](https://unity.github.com)
-
+## NOTICE OF DEPRECATION
-[](https://gitter.im/github-for-unity/Unity?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
-[](https://discord.gg/5zH8hVx)
-[](https://www.twitch.tv/sh4na)
+This project is dead y'all! Remove GitHub for Unity from your project, then go to https://github.com/spoiledcat/git-for-unity and install Git for Unity from the instructions there.
+# What is it
The GitHub for Unity extension brings [Git](https://git-scm.com/) and GitHub into [Unity](https://unity3d.com/), integrating source control into your work with friendly and accessible tools and workflows.
-**Please note:** this software is currently alpha quality. Please refer to the [list of known issues](https://github.com/github-for-unity/Unity/issues?q=is%3Aissue+is%3Aopen+label%3Abug), and make sure you have backups of your work before trying it out.
+You can reach the team right here by opening a [new issue](https://github.com/github-for-unity/Unity/issues/new). You can also tweet at [@GitHubUnity](https://twitter.com/GitHubUnity)
-#### Table Of Contents
+[](https://ci.appveyor.com/project/github-windows/unity)
-[Installing GitHub for Unity](#installing-github-for-unity)
- * [Requirements](#requirements)
- * [Git on macOS](#git-on-macos)
- * [Git on Windows](#git-on-windows)
- * [Installation](#installation)
- * [Log files](#log-files)
- * [Windows](#windows)
- * [macOS](#macos)
+## Notices
-[Building and Contributing](#building-and-contributing)
+Please refer to the [list of known issues](https://github.com/github-for-unity/Unity/issues?q=is%3Aissue+is%3Aopen+label%3Abug), and make sure you have backups of your work before trying it out.
-[Quick Guide to GitHub for Unity](#quick-guide-to-github-for-unity)
- * [Opening the GitHub window](#opening-the-github-window)
- * [Initialize Repository](#initialize-repository)
- * [Authentication](#authentication)
- * [Publish a new repository](#publish-a-new-repository)
- * [Commiting your work - Changes tab](#commiting-your-work---changes-tab)
- * [Pushing/pulling your work - History tab](#pushingpulling-your-work---history-tab)
- * [Branches tab](#branches-tab)
- * [Settings tab](#settings-tab)
-
-[More Resources](#more-resources)
-
-[License](#license)
-
-## Installing GitHub for Unity
-
-### Requirements
-
-- Unity 5.4-5.6
- - We've only tested the extension so far on Unity 5.4 to 5.6. There's currently an blocker issue opened for 5.3 support, so we know it doesn't run there. There are some issues for 2017.x, so it may or may not run well on that version. Personal edition is fine.
-- Git and Git LFS 2.x
-
-#### Git on macOS
-
-The current release has limited macOS support. macOS users will need to install the latest [Git](https://git-scm.com/downloads) and [Git LFS](https://git-lfs.github.com/) manually, and make sure these are on the path. You can configure the Git location in the Settings tab on the GitHub window.
-
-The easiest way of installing git and git lfs is to install [Homebrew](https://brew.sh/) and then do `brew install git git-lfs`.
-
-Make sure a Git user and email address are set in the `~/.gitconfig` file before you initialize a repository for the first time. You can set these values by opening your `~/.gitconfig` file and adding the following section, if it doesn't exist yet:
-
-```
-[user]
- name = Your Name
- email = Your Email
-```
-
-#### Git on Windows
-
-The GitHub for Unity extension ships with a bundle of Git and Git LFS, to ensure that you have the correct version. These will be installed into `%LOCALAPPDATA%\GitHubUnity` when the extension runs for the first time.
-
-Make sure a Git user and email address are set in the `%HOME%\.gitconfig` file before you initialize a repository for the first time. You can set these values by opening your `%HOME%\.gitconfig` file and adding the following section, if it doesn't exist yet:
-
-```
-[user]
- name = Your Name
- email = Your Email
-```
-
-Once the extension is installed, you can open a command line with the same Git and Git LFS version that the extension uses by going to the `GitHub` -> `Command line` menu in Unity.
-
-### Installation
-
-To install the extension, download the latest package from [the releases page](https://github.com/github-for-unity/Unity/releases) and double click on it.
-
-#### Log files
-
-##### macOS
-
-The extension log file can be found at `~/.local/share/GitHubUnityDebug/github-unity.log`. This is a temporary location and will be changed in the future.
-
-##### Windows
-
-The extension log file can be found at `%LOCALAPPDATA%\GitHubUnity\github-unity.log`
+From version 0.19 onwards, the location of the plugin has moved to `Assets/Plugins/GitHub`. If you have version 0.18 or lower, you need to delete the `Assets/Editor/GitHub` folder before you install newer versions. You should exit Unity and delete the folder from Explorer/Finder, as Unity will not unload native libraries while it's running. Also, remember to update your `.gitignore` file.
## Building and Contributing
-The [CONTRIBUTING.md](CONTRIBUTING.md) document will help you get setup and familiar with the source. The [documentation](docs/) folder also contains more resources relevant to the project.
-
Please read the [How to Build](docs/contributing/how-to-build.md) document for information on how to build GitHub for Unity.
-If you're looking for something to work on, check out the [up-for-grabs](https://github.com/github-for-unity/Unity/issues?q=is%3Aopen+is%3Aissue+label%3Aup-for-grabs) label.
-
-
-## I have a problem with GitHub for Unity
-
-First, please search the [open issues](https://github.com/github-for-unity/Unity/issues?q=is%3Aopen)
-and [closed issues](https://github.com/github-for-unity/Unity/issues?q=is%3Aclosed)
-to see if your issue hasn't already been reported (it may also be fixed).
-
-If you can't find an issue that matches what you're seeing, open a [new issue](https://github.com/github-for-unity/Unity/issues/new)
-and fill out the template to provide us with enough information to investigate
-further.
-
-## Quick Guide to GitHub for Unity
-
-### Opening the GitHub window
-
-You can access the GitHub window by going to Windows -> GitHub. The window opens by default next to the Inspector window.
-
-### Initialize Repository
-
-
-
-If the current Unity project is not in a Git repository, the GitHub for Unity extension will offer to initialize the repository for you. This will:
-
-- Initialize a git repository at the Unity project root via `git init`
-- Initialize git-lfs via `git lfs install`
-- Set up a `.gitignore` file at the Unity project root.
-- Set up a `.gitattributes` file at the Unity project root with a large list of known binary filetypes (images, audio, etc) that should be tracked by LFS
-- Configure the project to serialize meta files as text
-- Create an initial commit with the `.gitignore` and `.gitattributes` file.
-
-### Authentication
-
-To set up credentials in Git so you can push and pull, you can sign in to GitHub by going to `Window` -> `GitHub` -> `Account` -> `Sign in`. You only have to sign in successfully once, your credentials will remain on the system for all Git operations in Unity and outside of it. If you've already signed in once but the Account dropdown still says `Sign in`, ignore it, it's a bug.
-
-
-
-### Publish a new repository
-
-1. Go to [github.com](https://github.com) and create a new empty repository - do not add a license, readme or other files during the creation process.
-2. Copy the **https** URL shown in the creation page
-3. In Unity, go to `Windows` -> `GitHub` -> `Settings` and paste the url into the `Remote` textbox.
-3. Click `Save repository`.
-4. Go to the `History` tab and click `Push`.
-
-### Commiting your work - Changes tab
-
-You can see which files have been changed and commit them through the Changes tab. `.meta` files will show up in relation to their files on the tree, so you can select a file for comitting and automatically have their `.meta`
-
-
-
-### Pushing/pulling your work - History tab
-
-The history tab includes a `Push` button to push your work to the server. Make sure you have a remote url configured in the `Settings` tab so that you can push and pull your work.
-
-To receive updates from the server by clicking on the `Pull` button. You cannot pull if you have local changes, so commit your changes before pulling.
-
-
-
-### Branches tab
-
-
-
-### Settings tab
-
-You can configure your user data in the Settings tab, along with the path to the Git installation.
+The [CONTRIBUTING.md](CONTRIBUTING.md) document will help you get setup and familiar with the source. The [documentation](docs/) folder also contains more resources relevant to the project.
-Locked files will appear in a list in the Settings tab. You can see who has locked a file and release file locks after you've pushed your work.
+If you're looking for something to work on, check out the [up-for-grabs](https://github.com/github-for-unity/Unity/issues?q=is%3Aopen+is%3Aissue+label%3Aup-for-grabs) label.
-
+## How to use
-## More Resources
+The [quick guide to GitHub for Unity](docs/using/quick-guide.md)
-See [unity.github.com](https://unity.github.com) for more product-oriented
-information about GitHub for Unity.
+More [in-depth information](docs/readme.md)
## License
@@ -179,6 +40,6 @@ The MIT license grant is not for GitHub's trademarks, which include the logo
designs. GitHub reserves all trademark and copyright rights in and to all
GitHub trademarks. GitHub's logos include, for instance, the stylized
Invertocat designs that include "logo" in the file title in the following
-folder: [IconsAndLogos](https://github.com/github-for-unity/Unity/tree/master/src/UnityExtension/Assets/Editor/GitHub.Unity/IconsAndLogos).
+folder: [IconsAndLogos](src/UnityExtension/Assets/Editor/GitHub.Unity/IconsAndLogos).
-Copyright 2015 - 2017 GitHub, Inc.
+Copyright 2015 - 2018 GitHub, Inc.
diff --git a/appveyor.yml b/appveyor.yml
index 7aa679d51..bfb3e1b77 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -1,35 +1,28 @@
-version: '{build}.{branch}'
environment:
GHFU_KEY:
secure: KFcQA1VOCEMGUgy2dxH8G5O7C9DsAtQrnc6LakFpd9BRFtNnt2E8RSadPoJwQ9gztWaLS8vQLdU7cV5Ivt01LOnPI2kU1fQd2SHtKwJFve8ppvK/yZ/luhiXvIdGeEAiXQyuc1WUwuECoJVA6n7/uQKr1Q+eHniMitHuFpyQ7OqnwF6f+4TeBS6D78fKd3QoeP4XDdxCjNWPNmLv7BvWFMm5CuTK9aAWhOy8em/nVIED8qt36uHnncsDn+DH7uunj+VwmhVS+4yhuKHHz5naiUAHHIziZ4wBW6Q8rcf7xYEeISjlfxJ6TXs4Wwp406AO+n3v1DZaxSXwvoxplfopeGyb6imJfbwdTU/MHf2uj9wXobR8UhDarcrugVW+J3bqZyvkg20HfSe80gfQUBlK5OdMAp58dhWkddvJSO5TnzqmLlo/60gZxjheIbjdLaavSKcM4xOALXQlBbJJgVQrB/F6tYf7pRK3BlS8VoakyOGjJRzsSNdssSVrLVW3rwANORbH6Z1ZYvQw2ObP6/EBMceer0+JV4y9zB5q9C68erlr1NtJB0xKUp9/7I5GQj4lJ+pDsaFdsj40SyyD4yazSZf/3VIhZi/rQTJm0Ft0ifTZGSxnNTOVMZ5fsoJmUL0bn75Xt9q59cKYzK041HtEzRSElnBeuTf+Sm/MLLV28P1sonwntMhcYQ5ZPIuGmKa8jAJ0kxPXyT56MPJpwbNrbCOw2t9hXg5QbYv/+0RcoRoJ7P/5OY3M6mj8Emtu8N0SFKD6lfv9KNLFAyBuF6Ml7RyOs5RRogIdEapegTY7jwGH7igibrP0lt6HYshM7hKQrRYm2saokBV9TfgV9qnPyGs5/zyTTUGW4y0LavxiXl/vQIpxwCg4liCf1Dgw4Zrxvh40bziKGc3X06RJcysJ8cskOi6gB8eK8VTbAy6/Ufgv+pyjIns1iJxmdVbl8MrlgPXmOephdRPYZJDiFd4ynw0Slm1mqbzPWHdQ/mtMGxNRcysIOPKzKaKvK7Syor5SNtv4HU097dyjVQyW9krHaX/DSnx++dMDCIZJEDYxFw7LmTvl6AFWU4C3HM7+26cHBuBMBYS1PwcRijG+hwsHiXIomVuVglcxp5HC2eFbtBF9h1g030/tCeIBhZIVdSVO78319CsL1+aVtI5WjeQglH1OcTS42OF1Nb/4EjaN4I/w6yRJU5dmK7Q+rHQ+7NnPT4n5flQV6oe1XNbLen0raDuGos6v+aaoOQ50HlCSMMBJ3liapVXIAQ+Z/XM/cNZZa1TB6/C363Hjrts6Uq3IjKXmomhA33je+Wl6mTZqBucXUJs76p+ZgKubWvfzK/e6tORJggAgFNoa9Y56r3t7J8UdUolt301I1cCVz9CvYMUsWTmjKTR5SpssbbcuRcFUhgkHrhsSq0rBef/dfn5VEP8sateiqbpMne5iWO4Wc0Qx2/fJfx2zf9oqO3MihAyYDwPI7JCrmccJY9cHV89YlrytZuh87aBQ8d+T5ELdeG3bbYGYbKJ/yOGxMo8cRSomWUp2809Ea/lgu6WjyY1SdEjh20fwONOTRd/AA3h3XIMU7NY999YOEy1zj3yeP+awozDWQU8GSojA/ceLU5HT0U/RT2XJgkzUFb/u8wanNG6InPqvZy01bLR8JZmqXZl/4XgNpEsbzwPxjzuZJP6O4f2Usq1ZmHUfwlouXLWuHTv5/DPYJ9kO91wjzAH46IsoadmQkRDomHYCDPRCnYoS2zBkmBNukCgCKWsSwD5Msw/tpgIorMi5AAFhIOeWt/7tcKZ5nslbbnmZFtDkOBriPEiOjrAziRqFNAdBjecMrckRQrlkYjkpJG/pXZXYq219/8Sy1/HdNrWTCdq7nc947Fvq41CfumT4c2TqhVc/oflJ9SaxIl2A1Vtbw5LkmQKL08vOitsyZgRupcbqLcSYGo2dG+ks0gK5o2rvNp1nyN3ADh7JFmtD7/og55zlsAj7wP6rLEZ44h+dk7+Sh96WoCPfzSJnchg2vsydTpK6sG3Cp5qjEk0Tps88nX0SPvEPxwEpBL08+XIlg5OVxiTIYI0NSeEjAxwip2ptgaeI4c0yPB5SahMArEw/8YeEflWhiDyjoG4Bw0O1v9fRSSYiFhcYwrkr6yBK81hx6uH6DzqDqtKOxwJ3kKhapfwZXStmeOt4AwiSUHO8TiX1t0i7Jqwl7mRduz3LfmqGCeEsNxnLuhc6MPeEva8LO8ILCEcVz8bHlwUMWqabdZRm9UtbWtZp/u8ffPSBbgNFna2kKFr/F7dmXiv18CpNHOGxb/rSdmIaov1nXJR7XUyKPRO548PHE6iNxuNjWjcuFw1L0IUCNEeVUs7tvNHUTYOXRvfXNm3DbhjFnGix2JVCB2xz6QhDV4Hh6y0/rJl0b2dW25iM5HZdwCBGwgGM+9HyD7r+OBiRn+rd996c81+JsWL4jsa//16uwcbEpsF3tAB7b0by4qHbeZ+Gs3M06Sje4UVpLgKQVHSd/hfo4M70v3APhyz0WFBhLLZyouz0OdazKZ4W+HGBcunAPw/sYdMYZLe4ZmA6B+wxtSzojNKFaCFWoh3S5vLClZTraj7Mhh02PPsY0fmo15ceHBwKjMfGZ0pXt8uiPL29ECUstxSLVnPv6M4uXPJa7k+0lvj7XdB7aJ/LzexPAa/Z1+hsr2sO9An5qPnKM5Tp5zj9Xq2T7WBiDObYLxYZX5ez32jKfSYgv3cpIo5HnhKB3rZL3Alp6iJ2NFsDiB6pIUc2YQ3UU8wiMU90ifA83ORttzRDdLCuH1lYCHPk8rcVqeydgNrI4pRVrdIah3wm6hHc7YjSSnjIOhcl286iVtYgn10RUKxcs//ElgoGm0IkefKRy2WcDDL+10ZifpSWxRu0yrpwlxd0uHCAhrkOEnvaamn+0TSu/6s9VxoUyn9ZJhY7Jgnb6Z9Qxi4C+u2vXf6lOQvzl4AawnD9DW+w2L6hr2njGhvgjj2VLIHM/GIOV/OaYW97AiW0NBuEGDyBiuj8TxIUL7IuVj+QZVfyUzZHHL0c0Hy4jlQ+sh2nFzOAGWVZwEdAvLl9JCCs46iA9DHtBSrHxit7lytyspp7q8TYfE1lA0pIwkx20E3t+4CNdUQAr/IJaZJxhdfKAyW3UipP4LdRbweyYHZYFkoN0gEDMrzE0yB7XFNw5ddm/+o8KIuSUl44UVFcp2j0KPfuXadx7Pz1aa5HKpVUdc5CfJOjqgPJFn/MQU702YdUaV0qD+EHDOiVv313gUHdy9kpieQ3s2LDSh0qBkPdxLAdYXKLP24Mj3V+A2lyHU1WtLrIEVP37eCAFSYPf6Lz6TW4zrEBpHF4nwlE8M+0jQ/oB4lINxnkCa3YKYLFMiZ3dAmqGzVElesgymmB21xvdfrHgB1Z5OtQqYT8PPAw6llujXv6Pj9CqDGGS4U8UeW5GCFi/qyV6+hdg2IUsWtSzkbLJ5n8cfafEYeRBRgzK/B6qlTmoOrRl+bzmjVCJX29P+38KCpu7srnSQ+T0fR6t0OWyHGfC/39iMzATnhpiIXdnngVV9Cypgod5we44C2Rb4Or/nr5mdEidElIIthDiD7GHPNSeMXrdxs+ow76rh42DiY7x0L0SMRWyUEz0seL1JdBCdNn/7LuSn4CVpggqZD8anf9n+IUjrJtqQ+AvaogfuxM65byhGK4iVIijrogfBHb4nGywXxeEKe03JJ8nOWWN2ndyNhMW1dfNGraHvAt7DWL+/tp4qKCA89VFaZjwsqINANF1VVwh96SB6qT4tlKJjaPD3YpawT6Jfs+cg3pMj36FIPzHoNd/r+LwCBZ0WiA5xZiO0DX6WhwTfJVStsz4i9VXElCmWF2dpf5kTEC0T62Y1VCc++M1cTfwX34mdHPvdsm1Vi1qpqz4HTez8ateFukyj1FIN7++eYWoBJBoclhb3y/VUFwepORi84pz1fXUSSl8Fpg2U7NRyj+gcM5v/VAC1FGR4CJVpODIdROF7mCrLTbPzLn8Fv7EJHgHKNeU/sIT13+5V/UJSZPAxWcaUKhRWWuShSVb/1U13LjiWkHvmuH7SVLHbJDO5C5lA589rz4weTMd1OSymPuNB/xj2d2YrJUwqB3olsaxwm8w/bs2ot4GF4HFAdx3l0ESiR8jkBNAvr6vwRcXv+7nfXRpx2Mo5QU2YaunbqZxibmtNCQZBH8ZpQyUZOek4A5qDh6HW2VyJqKXeE8u1fbtOzB9xDYxgTrlVFhCw==
-clone_script:
-- ps: >-
- if(-not $env:appveyor_pull_request_number) {
- git lfs clone -q -n --branch=$env:appveyor_repo_branch https://github.com/$env:appveyor_repo_name.git $env:appveyor_build_folder
- git checkout -qf $env:appveyor_repo_commit
- } else {
- git lfs clone -q -n https://github.com/$env:appveyor_repo_name.git $env:appveyor_build_folder
- git fetch -q origin +refs/pull/$env:appveyor_pull_request_number/merge:
- git lfs fetch origin FETCH_HEAD
- git checkout -qf FETCH_HEAD
- }
-
- Set-Location $env:appveyor_build_folder
+ matrix:
+ - node_version: '8'
install:
- ps: >-
+ $full_build = Test-Path env:GHFU_KEY
+
+ $package = $full_build
+
git submodule sync
git submodule init
- $full_build = Test-Path env:GHFU_KEY
-
if ($full_build) {
+ $env:BUILD_TYPE="full"
$fileContent = "-----BEGIN RSA PRIVATE KEY-----`n"
$fileContent += $env:GHFU_KEY.Replace(' ', "`n")
$fileContent += "`n-----END RSA PRIVATE KEY-----`n"
Set-Content c:\users\appveyor\.ssh\id_rsa $fileContent
+ Install-Product node $env:node_version
} else {
+ $env:BUILD_TYPE="partial"
git submodule deinit script
$destdir = Join-Path $env:appveyor_build_folder 'lib'
$destfile = Join-Path $destdir 'deps.zip'
@@ -42,15 +35,73 @@ install:
git submodule update
nuget restore GitHub.Unity.sln
+
+ Set-Location $env:appveyor_build_folder
+
+ $version = Get-Content "$($env:appveyor_build_folder)\common\SolutionInfo.cs" | %{ $regex = "const string GitHubForUnityVersion = `"([^`"]*)`""; if ($_ -match $regex) { $matches[1] } }
+
+ $env:package_version="$($version).$($env:APPVEYOR_BUILD_NUMBER)"
+
+ Update-AppveyorBuild -Version $env:package_version
+
+ $message = "Building "
+
+ if ($package) { $message += "and packaging "}
+
+ if ($full_build) { $message += "(full build)" } else { $message += "(partial build)" }
+
+ $message += " version " + $env:package_version + " "
+
+ Write-Host $message
+
+assembly_info:
+ patch: false
+ file: common\SolutionInfo.cs
+ assembly_informational_version: "{version}"
+
+configuration: Release
build:
project: GitHub.Unity.sln
verbosity: minimal
test:
+ assemblies:
+ except:
+ - '**\*.TestRunner.dll'
+ - '**\*.TestUtils.dll'
categories:
except:
- DoNotRunOnAppVeyor
- - TimeSensitive
-artifacts:
-- path: unity\TestProject\Assets\Editor\*.dll
-- path: unity\TestProject\Assets\Editor\*.pdb
-- path: build\*.log
+on_success:
+- ps: |
+ if ($package) {
+ $rootdir=$env:appveyor_build_folder
+ Set-Location $rootdir
+ $sourcedir="$rootdir\unity\PackageProject"
+ $packagename="github-for-unity-$($env:package_version)"
+ $packagefile="$rootdir\$($packagename).unitypackage"
+ $commitfile="$sourcedir\commit"
+ $zipfile="$rootdir\PackageProject-$($env:package_version).zip"
+
+ # generate mdb files
+ Write-Output "Generating mdb files"
+ Get-ChildItem -Recurse "$($sourcedir)\*.pdb" | foreach { $_.fullname.substring(0, $_.fullname.length - $_.extension.length) } | foreach { Write-Output "Generating $($_).mdb"; & 'lib\pdb2mdb.exe' "$($_).dll" }
+
+ # generate unitypackage
+ Write-Output "Generating $packagefile"
+ submodules\packaging\unitypackage\run.ps1 -PathToPackage:$sourcedir -OutputFolder:$rootdir -PackageName:$packagename
+
+ # save commit
+ Add-Content $commitfile $appveyor_repo_commit
+
+ Write-Output "Zipping $sourcedir to $zipfile"
+ 7z a $zipfile $sourcedir
+
+ Write-Output "Uploading $zipfile"
+ Push-AppveyorArtifact $zipfile -DeploymentName source
+ Push-AppveyorArtifact $packagefile -DeploymentName package
+ Push-AppveyorArtifact "$($packagefile).md5" -DeploymentName package
+ }
+on_finish:
+- ps: |
+ Set-Location $env:appveyor_build_folder
+ Get-ChildItem $env:appveyor_build_folder\build\*.log | % { Push-AppveyorArtifact $_.FullName -FileName $_.Name -DeploymentName logs }
diff --git a/build.cmd b/build.cmd
index 49ce3cbaf..af6f8fab7 100644
--- a/build.cmd
+++ b/build.cmd
@@ -12,30 +12,34 @@ if not %2.==. (
)
if %Target%==Rebuild (
- del /Q unity\PackageProject\Assets\Editor\GitHub\*.dll
- del /Q unity\PackageProject\Assets\Editor\GitHub\*.mdb
- del /Q unity\PackageProject\Assets\Editor\GitHub\*.pdb
-
- if exist "..\github-unity-test\GitHubExtensionProject\Assets\Editor\GitHub" (
- del /Q ..\github-unity-test\GitHubExtensionProject\Assets\Editor\GitHub\*.dll
- del /Q ..\github-unity-test\GitHubExtensionProject\Assets\Editor\GitHub\*.mdb
- del /Q ..\github-unity-test\GitHubExtensionProject\Assets\Editor\GitHub\*.pdb
+ del /Q unity\PackageProject\Assets\Plugins\GitHub\Editor\*.dll
+ del /Q unity\PackageProject\Assets\Plugins\GitHub\Editor\*.mdb
+ del /Q unity\PackageProject\Assets\Plugins\GitHub\Editor\*.pdb
+
+ if exist "..\github-unity-test\GitHubExtensionProject\Assets\Plugins\GitHub\Editor" (
+ del /Q ..\github-unity-test\GitHubExtensionProject\Assets\Plugins\GitHub\Editor\*.dll
+ del /Q ..\github-unity-test\GitHubExtensionProject\Assets\Plugins\GitHub\Editor\*.mdb
+ del /Q ..\github-unity-test\GitHubExtensionProject\Assets\Plugins\GitHub\Editor\*.pdb
)
)
call common\nuget.exe restore GitHub.Unity.sln
+
echo xbuild GitHub.Unity.sln /verbosity:normal /property:Configuration=%Configuration% /target:%Target%
call xbuild GitHub.Unity.sln /verbosity:normal /property:Configuration=%Configuration% /target:%Target%
-echo xcopy /C /H /R /S /Y /Q unity\PackageProject\Assets\Editor\GitHub ..\github-unity-test\GitHubExtensionProject\Assets\Editor
-call xcopy /C /H /R /S /Y /Q unity\PackageProject\Assets\Editor\GitHub ..\github-unity-test\GitHubExtensionProject\Assets\Editor
+del /Q unity\PackageProject\Assets\Plugins\GitHub\Editor\deleteme*
+del /Q unity\PackageProject\Assets\Plugins\GitHub\Editor\deleteme*
+del /Q unity\PackageProject\Assets\Plugins\GitHub\Editor\*.xml
+
+echo xcopy /C /H /R /S /Y /Q unity\PackageProject\Assets\Plugins\GitHub ..\github-unity-test\GitHubExtensionProject\Assets\Plugins\
+call xcopy /C /H /R /S /Y /Q unity\PackageProject\Assets\Plugins\GitHub ..\github-unity-test\GitHubExtensionProject\Assets\Plugins\
-del /Q unity\PackageProject\Assets\Editor\GitHub\deleteme*
-del /Q unity\PackageProject\Assets\Editor\GitHub\deleteme*
-del /Q unity\PackageProject\Assets\Editor\GitHub\*.xml
+echo xcopy /C /H /R /Y /Q unity\PackageProject\Assets\Plugins\GitHub.meta ..\github-unity-test\GitHubExtensionProject\Assets\Plugins\
+call xcopy /C /H /R /Y /Q unity\PackageProject\Assets\Plugins\GitHub.meta ..\github-unity-test\GitHubExtensionProject\Assets\Plugins\
-if exist ..\github-unity-test\GitHubExtensionProject\Assets\Editor\GitHub (
- del /Q ..\github-unity-test\GitHubExtensionProject\Assets\Editor\GitHub\deleteme*
- del /Q ..\github-unity-test\GitHubExtensionProject\Assets\Editor\GitHub\deleteme*
- del /Q ..\github-unity-test\GitHubExtensionProject\Assets\Editor\GitHub\*.xml
+if exist ..\github-unity-test\GitHubExtensionProject\Assets\Plugins\GitHub\Editor (
+ del /Q ..\github-unity-test\GitHubExtensionProject\Assets\Plugins\GitHub\Editor\deleteme*
+ del /Q ..\github-unity-test\GitHubExtensionProject\Assets\Plugins\GitHub\Editor\deleteme*
+ del /Q ..\github-unity-test\GitHubExtensionProject\Assets\Plugins\GitHub\Editor\*.xml
)
\ No newline at end of file
diff --git a/build.sh b/build.sh
index 222965357..900c994f7 100755
--- a/build.sh
+++ b/build.sh
@@ -1,4 +1,4 @@
-#!/bin/sh -eux
+#!/bin/sh -eu
Configuration="dev"
if [ $# -gt 0 ]; then
Configuration=$1
@@ -10,14 +10,14 @@ if [ $# -gt 1 ]; then
fi
if [ x"$Target" == x"Rebuild" ]; then
- rm -f unity/PackageProject/Assets/Editor/GitHub/*.dll
- rm -f unity/PackageProject/Assets/Editor/GitHub/*.mdb
- rm -f unity/PackageProject/Assets/Editor/GitHub/*.pdb
-
- if [ -e ../github-unity-test/GitHubExtensionProject/Assets/Editor/GitHub ]; then
- rm -f ../github-unity-test/GitHubExtensionProject/Assets/Editor/GitHub/*.dll
- rm -f ../github-unity-test/GitHubExtensionProject/Assets/Editor/GitHub/*.mdb
- rm -f ../github-unity-test/GitHubExtensionProject/Assets/Editor/GitHub/*.pdb
+ rm -f unity/PackageProject/Assets/Plugins/GitHub/Editor/*.dll
+ rm -f unity/PackageProject/Assets/Plugins/GitHub/Editor/*.mdb
+ rm -f unity/PackageProject/Assets/Plugins/GitHub/Editor/*.pdb
+
+ if [ -e ../github-unity-test/GitHubExtensionProject/Assets/Plugins/GitHub/Editor ]; then
+ rm -f ../github-unity-test/GitHubExtensionProject/Assets/Plugins/GitHub/Editor/*.dll
+ rm -f ../github-unity-test/GitHubExtensionProject/Assets/Plugins/GitHub/Editor/*.mdb
+ rm -f ../github-unity-test/GitHubExtensionProject/Assets/Plugins/GitHub/Editor/*.pdb
fi
fi
@@ -29,19 +29,21 @@ fi
if [ x"$OS" == x"Windows" ]; then
common/nuget restore GitHub.Unity.sln
else
- nuget restore GitHub.Unity.sln
+ mono common/nuget.exe restore GitHub.Unity.sln
fi
-xbuild GitHub.Unity.sln /verbosity:normal /property:Configuration=$Configuration /target:$Target || true
+xbuild GitHub.Unity.sln /verbosity:minimal /property:Configuration=$Configuration /target:$Target || true
-cp -r unity/PackageProject/Assets/Editor/GitHub ../github-unity-test/GitHubExtensionProject/Assets/Editor || true
+rm -f unity/PackageProject/Assets/Plugins/GitHub/Editor/deleteme*
+rm -f unity/PackageProject/Assets/Plugins/GitHub/Editor/deleteme*
+rm -f unity/PackageProject/Assets/Plugins/GitHub/Editor/*.xml
-rm -f unity/PackageProject/Assets/Editor/GitHub/deleteme*
-rm -f unity/PackageProject/Assets/Editor/GitHub/deleteme*
-rm -f unity/PackageProject/Assets/Editor/GitHub/*.xml
+cp -r unity/PackageProject/Assets/Plugins/GitHub ../github-unity-test/GitHubExtensionProject/Assets/Plugins/ || true
+cp -r unity/PackageProject/Assets/Plugins/GitHub.meta ../github-unity-test/GitHubExtensionProject/Assets/Plugins/ || true
-if [ -e ../github-unity-test/GitHubExtensionProject/Assets/Editor/GitHub ]; then
- rm -f ../github-unity-test/GitHubExtensionProject/Assets/Editor/GitHub/deleteme*
- rm -f ../github-unity-test/GitHubExtensionProject/Assets/Editor/GitHub/deleteme*
- rm -f ../github-unity-test/GitHubExtensionProject/Assets/Editor/GitHub/*.xml
+
+if [ -e ../github-unity-test/GitHubExtensionProject/Assets/Plugins/GitHub/Editor ]; then
+ rm -f ../github-unity-test/GitHubExtensionProject/Assets/Plugins/GitHub/Editor/deleteme*
+ rm -f ../github-unity-test/GitHubExtensionProject/Assets/Plugins/GitHub/Editor/deleteme*
+ rm -f ../github-unity-test/GitHubExtensionProject/Assets/Plugins/GitHub/Editor/*.xml
fi
\ No newline at end of file
diff --git a/common/SolutionInfo.cs b/common/SolutionInfo.cs
index b183db8b2..eb95db6a0 100644
--- a/common/SolutionInfo.cs
+++ b/common/SolutionInfo.cs
@@ -6,12 +6,12 @@
using System.Runtime.InteropServices;
[assembly: AssemblyProduct("GitHub for Unity")]
-[assembly: AssemblyVersion(System.AssemblyVersionInformation.Version)]
-[assembly: AssemblyFileVersion(System.AssemblyVersionInformation.Version)]
+[assembly: AssemblyVersion(System.AssemblyVersionInformation.VersionForAssembly)]
+[assembly: AssemblyFileVersion(System.AssemblyVersionInformation.VersionForAssembly)]
[assembly: AssemblyInformationalVersion(System.AssemblyVersionInformation.Version)]
[assembly: ComVisible(false)]
[assembly: AssemblyCompany("GitHub, Inc.")]
-[assembly: AssemblyCopyright("Copyright GitHub, Inc. 2017")]
+[assembly: AssemblyCopyright("Copyright GitHub, Inc. 2016-2019")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
@@ -31,6 +31,10 @@
namespace System
{
internal static class AssemblyVersionInformation {
- internal const string Version = "0.17.0.0";
+ private const string GitHubForUnityVersion = "1.4.0";
+ internal const string VersionForAssembly = GitHubForUnityVersion;
+
+ // If this is an alpha, beta or other pre-release, mark it as such as shown below
+ internal const string Version = GitHubForUnityVersion; // GitHubForUnityVersion + "-beta1"
}
}
diff --git a/common/build.targets b/common/build.targets
index cb88330c3..163a071a8 100644
--- a/common/build.targets
+++ b/common/build.targets
@@ -5,40 +5,22 @@
Properties\SolutionInfo.cs
-
- Properties\GitHub.ruleset
+
+ Properties\codeanalysis-release.ruleset
+
+
+ Properties\codeanalysis-debug.ruleset
-
-
-
-
- {9862694d-e4fa-418b-8692-a0280feddf36}
- System.Net.Http-net_3_5
-
-
- {49ef16a2-5ed1-480f-80a1-d1d05d6c1be4}
- Octokit-35
-
-
-
-
-
-
- $(SolutionDir)lib\octokit.net\Octokit.dll
-
-
- $(SolutionDir)lib\dotnet-httpclient35\System.Net.Http.dll
-
-
-
-
-
- Location of Unity dlls is not set. You'll need to install Unity in a known location (the default installation directory for your system), or copy UnityEngine.dll and UnityEditor.dll to the {0}lib folder
+ The location of Unity dlls is not set. You'll need to install Unity in a known location (the default installation directory for your system), or:
+ - Copy UnityEngine.dll and UnityEditor.dll to the {0}lib\Managed folder
+ - Copy UnityEngine.TestRunner.dll to the {0}lib\UnityExtensions/Unity/TestRunner folder
+ - Copy UnityEditor.TestRunner.dll to the {0}lib\UnityExtensions/Unity/TestRunner/Editor folder
+
To build the OctokitDebugging solution you need to have https://github.com/github-for-unity/octokit.net checked out in {0}
To build the OctokitDebugging solution you need to have https://github.com/github-for-unity/dotnet-httpclient35 checked out in {0}
diff --git a/common/codeanalysis-small.ruleset b/common/codeanalysis-debug.ruleset
similarity index 84%
rename from common/codeanalysis-small.ruleset
rename to common/codeanalysis-debug.ruleset
index b380093ab..5aba57f2b 100644
--- a/common/codeanalysis-small.ruleset
+++ b/common/codeanalysis-debug.ruleset
@@ -1,5 +1,5 @@
-
+
@@ -86,7 +86,6 @@
-
@@ -94,6 +93,26 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/common/codeanalysis-full.ruleset b/common/codeanalysis-release.ruleset
similarity index 83%
rename from common/codeanalysis-full.ruleset
rename to common/codeanalysis-release.ruleset
index 0985eed76..c93efbfa4 100644
--- a/common/codeanalysis-full.ruleset
+++ b/common/codeanalysis-release.ruleset
@@ -80,6 +80,28 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/common/nativelibraries.props b/common/nativelibraries.props
new file mode 100644
index 000000000..8809c736d
--- /dev/null
+++ b/common/nativelibraries.props
@@ -0,0 +1,49 @@
+
+
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ x64\sfw_x64.dll
+ PreserveNewest
+
+
+ x64\sfw_x64.dll.meta
+ PreserveNewest
+
+
+ x64\pthreadVC2.dll
+ PreserveNewest
+
+
+ x64\pthreadVC2.dll.meta
+ PreserveNewest
+
+
+ x86\sfw_x86.dll
+ PreserveNewest
+
+
+ x86\sfw_x86.dll.meta
+ PreserveNewest
+
+
+ x86\pthreadVC2.dll
+ PreserveNewest
+
+
+ x86\pthreadVC2.dll.meta
+ PreserveNewest
+
+
+
\ No newline at end of file
diff --git a/common/packaging.targets b/common/packaging.targets
index b19e8dbf8..a5ddd41a5 100644
--- a/common/packaging.targets
+++ b/common/packaging.targets
@@ -2,13 +2,14 @@
- $(SolutionDir)\unity\PackageProject\Assets\Editor\GitHub
- $(SolutionDir)..\github-unity-test\GitHubExtensionProject\Assets\Editor\GitHub
+ $(SolutionDir)\unity\PackageProject\Assets\Plugins\GitHub\Editor
+ $(SolutionDir)..\github-unity-test\GitHubExtensionProject\Assets\Plugins\GitHub\Editor
@@ -22,16 +23,16 @@
+ Condition="!$([System.String]::Copy('%(Filename)').Contains('deleteme')) and !$([System.String]::Copy('%(Extension)').Contains('xml'))" />
-
+
-
+
diff --git a/common/properties.props b/common/properties.props
index 21be6dba0..8316329ed 100644
--- a/common/properties.props
+++ b/common/properties.props
@@ -2,13 +2,27 @@
- OctokitDebugging
Internal
+ ENABLE_METRICS
+ $(BuildDefs);ENABLE_MONO
- $(SolutionDir)\script\lib\
- $(SolutionDir)\lib\
+ $(SolutionDir)script\lib\
+ $(SolutionDir)lib\
+ C:\Program Files\Unity\Editor\Data\
C:\Program Files (x86)\Unity\Editor\Data\Managed\
- \Applications\Unity\Unity.app\Contents\Managed\
- Debug
+ \Applications\Unity\Unity.app\Contents\
+ Debug
+ $(Configuration)
+
+
+ $(SolutionDir)\common\codeanalysis-debug.ruleset
+
+
+ $(SolutionDir)\common\codeanalysis-release.ruleset
+
+
+ $(SolutionDir)\common\codeanalysis-debug.ruleset
+
+
\ No newline at end of file
diff --git a/create-octorun-zip.sh b/create-octorun-zip.sh
new file mode 100755
index 000000000..4eb568d33
--- /dev/null
+++ b/create-octorun-zip.sh
@@ -0,0 +1,3 @@
+#!/bin/sh -eu
+DIR=$(pwd)
+submodules/packaging/octorun/run.sh --path $DIR/octorun --out $DIR/src/GitHub.Api/Resources --source $DIR/src/GitHub.Api/Installer
diff --git a/create-unitypackage.sh b/create-unitypackage.sh
new file mode 100755
index 000000000..333f7cb90
--- /dev/null
+++ b/create-unitypackage.sh
@@ -0,0 +1,9 @@
+#!/bin/sh -eu
+DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+
+version=$(sed -En 's,.*GitHubForUnityVersion = "(.*)".*,\1,p' common/SolutionInfo.cs)
+commitcount=$(git rev-list --count HEAD)
+commit=$(git log -n1 --pretty=format:%h)
+version="${version}.${commitcount}-${commit}"
+
+$DIR/submodules/packaging/unitypackage/run.sh --path $DIR/unity/PackageProject --out $DIR --file github-for-unity-$version
diff --git a/CREDITS.txt b/credits.txt
similarity index 88%
rename from CREDITS.txt
rename to credits.txt
index e7137d888..b8fb5d7e1 100644
--- a/CREDITS.txt
+++ b/credits.txt
@@ -1,31 +1,5 @@
===============================================================================
-Port of Mono's System.Net.Http (https://github.com/shana/dotnet-httpclient35)
-===============================================================================
-
-Copyright (c) 2001, 2002, 2003 Ximian, Inc and the individuals listed
-on the ChangeLog entries.
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-===============================================================================
-Port of Axosoft's NSFW (https://github.com/StanleyGoldman/sfw)
+Port of Axosoft's NSFW (https://github.com/github-for-unity/sfw)
===============================================================================
The MIT License (MIT)
@@ -50,29 +24,6 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
-===============================================================================
-Octokit.NET (https://github.com/editor-tools/octokit.net/tree/net3.5)
-===============================================================================
-
-Copyright (c) 2012 GitHub, Inc.
-
-Permission is hereby granted, free of charge, to any person obtaining a copy of
-this software and associated documentation files (the "Software"), to deal in
-the Software without restriction, including without limitation the rights to
-use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
-the Software, and to permit persons to whom the Software is furnished to do so,
-subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
-FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
-COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
-IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
===============================================================================
AsyncBridge (https://github.com/OmerMor/AsyncBridge)
===============================================================================
diff --git a/docs/contributing/how-to-build.md b/docs/contributing/how-to-build.md
index 597a624aa..13ef8c2fa 100644
--- a/docs/contributing/how-to-build.md
+++ b/docs/contributing/how-to-build.md
@@ -6,17 +6,17 @@ This repository is LFS-enabled. To clone it, you should use a git client that su
### Windows
-- Visual Studio 2015+ or Mono 4.x + bash shell (git bash).
+- Visual Studio 2015+ or [Mono 4.x](https://download.mono-project.com/archive/4.8.1/windows-installer/) + bash shell (git bash).
- Mono 5.x will not work
- `UnityEngine.dll` and `UnityEditor.dll`.
- - If you've installed Unity in the default location of `C:\Program Files\Unity` or `C:\Program Files (x86)\Unity`, the build will be able to reference these DLLs automatically. Otherwise, you'll need to copy these DLLs from your Unity installation into the `lib` directory in order for the build to work
+ - If you've installed Unity in the default location of `C:\Program Files\Unity` or `C:\Program Files (x86)\Unity`, the build will be able to reference these DLLs automatically. Otherwise, you'll need to copy these DLLs from `[Unity installation path]\Unity\Editor\Data\Managed` into the `lib` directory in order for the build to work
### MacOS
-- Mono 4.x required.
+- [Mono 4.x](https://download.mono-project.com/archive/4.8.1/macos-10-universal/) required. You can install it via brew with `brew tap shana/mono && brew install mono@4.8`
- Mono 5.x will not work
- `UnityEngine.dll` and `UnityEditor.dll`.
- - If you've installed Unity in the default location of `/Applications/Unity`, the build will be able to reference these DLLs automatically. Otherwise, you'll need to copy these DLLs from your Unity installation into the `lib` directory in order for the build to work
+ - If you've installed Unity in the default location of `/Applications/Unity`, the build will be able to reference these DLLs automatically. Otherwise, you'll need to copy these DLLs from `[Unity installation path]/Unity.app/Contents/Managed` into the `lib` directory in order for the build to work
## How to Build
@@ -35,20 +35,33 @@ git submodule deinit script
### Important pre-build steps
-To be able to authenticate in GitHub for Unity, you'll need to:
+The build needs to reference `UnityEngine.dll` and `UnityEditor.dll`. These DLLs are included with Unity. If you've installed Unity in the default location, the build will be able to find them automatically. If not, copy these DLLs from `[your Unity installation path]\Unity\Editor\Data\Managed` into the `lib` directory in order for the build to work.
+
+#### Developer OAuth app
+
+Because GitHub for Unity uses OAuth web application flow to interact with the GitHub API and perform actions on behalf of a user, it needs to be bundled with a Client ID and Secret.
+
+For external contributors, we have bundled a developer OAuth application in the source so that you can complete the sign in flow locally without needing to configure your own application.
+
+These are listed in `src/GitHub.Api/Application/ApplicationInfo.cs`
+
+DO NOT TRUST THIS CLIENT ID AND SECRET! THIS IS ONLY FOR TESTING PURPOSES!!
+
+The limitation with this developer application is that this will not work with GitHub Enterprise. You will see sign-in will fail on the OAuth callback due to the credentials not being present there.
+
+To provide your own Client ID and Client Secret:
- [Register a new developer application](https://github.com/settings/developers) in your profile.
- Copy [common/ApplicationInfo_Local.cs-example](../../common/ApplicationInfo_Local.cs-example) to `common/ApplicationInfo_Local.cs` and fill out the clientId/clientSecret fields for your application.
-The build needs to reference `UnityEngine.dll` and `UnityEditor.dll`. These DLLs are included with Unity. If you've installed Unity in the default location, the build will be able to find them automatically. If not, copy these DLLs from your Unity installation into the `lib` directory in order for the build to work.
### Visual Studio
-To build with Visual Studio 2015 open the solution file `GitHub.Unity.sln`. Select `Build Solution` in the `Build` menu.
+To build with Visual Studio 2015+, open the solution file `GitHub.Unity.sln`. Select `Build Solution` in the `Build` menu.
### Mono and Bash (windows and mac)
-To build with Mono 4.x and Bash execute `build.sh` in a bash shell.
+To build with Mono 4.x and Bash, first ensure Mono is added to PATH. Mono installs to `C:\Program Files\Mono\bin\` by default. Then execute `build.sh` in a bash shell.
## Build Output
@@ -56,21 +69,14 @@ Once you've built the solution for the first time, you can open `src/UnityExtens
The build also creates a Unity test project called `GitHubExtension` inside a directory called `github-unity-test` next to your local clone. For instance, if the repository is located at `c:\Projects\Unity` the test project will be at `c:\Projects\github-unity-test\GitHubExtension`. You can use this project to test binary builds of the extension in a clean environment (all needed DLLs will be copied to it every time you build).
-Note: some files might be locked by Unity if have one of the build output projects open when you compile from VS or the command line. This is expected and shouldn't cause issues with your builds.
+Note: some files might be locked by Unity if have one of the build output projects open when you compile from VS or the command line. This is expected and shouldn't cause issues with your builds.
## Solution organization
The `GitHub.Unity.sln` solution includes several projects:
-- dotnet-httpclient35 and octokit: external dependencies for threading and github api support, respectively. These are the submodules.
- packaging: empty projects with build rules that copy DLLs to various locations for testing
- Tests: unit and integration test projects
- GitHub.Logging: A logging helper library
- GitHub.Api: The core of the extension. This project is C#6 and includes async/await threading and other features that Unity cannot currently compile.
- GitHub.Unity: Unity-specific code. This project is compilable by Unity
-
-## Other solutions
-
-Octokit is normally included as a prebuilt DLL (in the `lib` directory), but when updating Octokit or debugging issues with the 3.5 backport, it can sometimes be handy to reference the project directly. The `GitHub.Unity.OctokitDebugging.sln` solution is a helper solution that includes Octokit and dotnet-httpclient35 as referenced projects instead of prebuilt dlls.
-
-This solution requires a clone of [https://github.com/github-for-unity/octokit.net](https://github.com/github-for-unity/octokit.net) and [https://github.com/github-for-unity/dotnet-httpclient35](https://github.com/github-for-unity/dotnet-httpclient35) to exist next to your GitHub for Unity checkout.
diff --git a/docs/contributing/how-to-test.md b/docs/contributing/how-to-test.md
new file mode 100644
index 000000000..fd29a20b1
--- /dev/null
+++ b/docs/contributing/how-to-test.md
@@ -0,0 +1,10 @@
+
+Unit and Integration tests for Unity can be found under `src/tests/`.
+
+## Testing requirements
+Tests currently run with NUnit 2.6.4.
+
+## Running tests
+Tests can be run after building the Unity project. To run the tests execute `test.cmd` on Windows or `test.sh` on Mac.
+
+We use [Appveyor](https://ci.appveyor.com/project/github-windows/unity/build/tests) as the CI for this project to run tests, but it is also necessary to run tests locally when making code changes.
diff --git a/docs/process/release-process.md b/docs/process/release-process.md
new file mode 100644
index 000000000..1f4b2581d
--- /dev/null
+++ b/docs/process/release-process.md
@@ -0,0 +1,68 @@
+# Release process
+
+## Release information
+
+### Tag name format
+
+***Alpha releases***: `v[major].[minor]-alpha`
+
+***Beta releases***: `v[major].[minor]-beta`
+
+***Releases***: `v[major].[minor]`
+
+## The process
+
+#### TL;DR
+
+1. Dev branches to a release branch every week, create draft release with release notes
+2. QA tests release branch for up to a week
+3. Dev continues work on master
+4. Dev fixes shipblockers on release branch and updates build on draft release page, and makes sure fixes are also sent to master
+5. QA publishes release by tagging the release branch and hitting "Publish"
+6. Goto 1
+
+#### The long explanation
+
+Every week:
+
+1. Create a release branch from master with the name `release/[Major].[Minor]`, where `[Major].[Minor]` are the current major and minor parts of the version set on master.
+1. Bump the version on master
+1. Create a draft release with the release notes, following the format below
+1. Upload a build created from the release branch
+1. QA tests the release and logs any issues found in it. Issues are fixed on the next release unless they are related to the issues that are reported as fixed in the current release, and they are shipblockers.
+1. If the release requires fixes:
+ 1. If the fix is reverting a PR, that doesn't have to be done on master, only on the release branch. Otherwise:
+ 1. Create a branch from the release branch fork point (the commit that the release branch is based on)
+ 1. Push the fix to this branch and create a PR targetting the release branch
+ 1. Upload a new build from the release branch
+ 1. Create another branch from master, merge the fix branch into it and create a PR targetting master
+1. QA approves release by:
+ 1. Filling out the tag name, in the format shown above
+ 1. Selecting the release branch corresponding to the build
+ 1. Clicking `Publish release`
+
+
+## Template for release notes
+
+The https://github.com/github-for-unity/unity-release-notes node project generates draft release notes by outputting all issues labeled `Feature`, `Enhancement` and `Bug` closed since the last release in the correct format for release notes, and also outputs all PRs closed since the last release, in case some issues might not have been correctly labeled and/or created.
+
+The markdown format for release notes is below. This is what the project above generates (more or less).
+
+```
+# Release notes
+
+[any special notes and/or funny/relevant image for the release here, if needed]
+
+## Features
+
+- #XXX - Title of issue (adjust for user consumption if needed)
+
+## Enhancements
+
+- #XXX - Title of issue (adjust for user consumption if needed)
+
+## Fixes
+
+- #XXX - Title of issue (adjust for user consumption if needed)
+
+```
diff --git a/docs/process/roadmap.md b/docs/process/roadmap.md
index e69de29bb..80a958e7f 100644
--- a/docs/process/roadmap.md
+++ b/docs/process/roadmap.md
@@ -0,0 +1,51 @@
+# The roadmap
+
+## The road to 1.0
+
+### 1.0-RC ETA
+
+March 2018
+
+### 1.0 ETA
+
+May 2018
+
+### Feature list
+
+- Windows and Mac support
+ - Unity 5.4 and above
+- Initialize new repository in existing project
+ - Configure yaml merge tool
+ - Configure project serialization for source control
+ - Configure git and lfs
+- Publish to GitHub
+- Authentication
+ - Login with user/password and 2FA if needed
+ - Invoked when doing git operations
+ - https support
+- Local repository management
+ - List changed files
+ - Commit selectively
+ - Discard file changes
+- Repository history and network operations
+ - List of commits
+ - Individual commit detail
+ - Revert commit
+ - List of local branches
+ - List of remote branches
+ - Create branch
+ - Delete branch
+ - Fetch
+ - Push
+ - Pull
+- File locking
+ - Lock and unlock files
+ - Visual locking indicators in file UIs
+ - List locked files
+ - Notification when file is locked by someone else
+- Git management
+ - User and email configuration
+ - Git remote configuration
+ - Git installation path configuration
+- Misc
+ - Notification of new releases
diff --git a/docs/readme.md b/docs/readme.md
index 62c9ebaa6..d73e8e840 100644
--- a/docs/readme.md
+++ b/docs/readme.md
@@ -24,10 +24,14 @@ Details about how the team is organizing and shipping GitHub for Unity:
- **[Issue Triage](process/issue-triage.md)** - how we address issues reported
by users
- - **[Review Process](process/reviews.md)** - how we review contributions
+ - **[Review](process/reviews.md)** - how we review contributions
- **[Roadmap](process/roadmap.md)** - how we plan for the future
+ - **[Release](process/release-process.md)** - how we review contributions
-## Technical
+## Using
-These documents contain more details about the internals of GitHub for Unity
-and how things work:
+[Quick Guide](using/quick-guide.md)
+
+These documents contain more details on how to use the GitHub for Unity plugin:
+- **[Installing and Updating the GitHub for Unity package](using/how-to-install-and-update.md)**
+- **[Getting Started with the GitHub for Unity package](using/getting-started.md)**
diff --git a/docs/using/authenticating-to-github.md b/docs/using/authenticating-to-github.md
new file mode 100644
index 000000000..203a3473d
--- /dev/null
+++ b/docs/using/authenticating-to-github.md
@@ -0,0 +1,37 @@
+# Authenticating to GitHub
+
+## How to sign in to GitHub
+
+1. Open the **GitHub** window by going to the top level **Window** menu and selecting **GitHub**, as shown below.
+
+
+
+1. Click the **Sign in** button at the top right of the window.
+
+
+
+1. In the **Authenticate** dialog, enter your username or email and password
+
+
+
+ If your account requires Two Factor Authentication, you will be prompted for your auth code.
+
+
+
+You will need to create a GitHub account before you can sign in, if you don't have one already.
+
+- For more information on creating a GitHub account, see "[Signing up for a new GitHub account](https://help.github.com/articles/signing-up-for-a-new-github-account/)".
+
+### Personal access tokens
+
+If the sign in operation above fails, you can manually create a personal access token and use it as your password.
+
+The scopes for the personal access token are: `user`, `repo`.
+- *user* scope: Grants access to the user profile data. We currently use this to display your avatar and check whether your plans lets you publish private repositories.
+- *repo* scope: Grants read/write access to code, commit statuses, invitations, collaborators, adding team memberships, and deployment statuses for public and private repositories and organizations. This is needed for all git network operations (push, pull, fetch), and for getting information about the repository you're currently working on.
+
+***Note:*** *Some older versions of the plugin ask for `gist` and `write:public_key`.*
+
+For more information on creating personal access tokens, see "[Creating a personal access token for the command line](https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line).
+
+For more information on authenticating with SAML single sign-on, see "[About authentication with SAML single sign-on](https://help.github.com/articles/about-authentication-with-saml-single-sign-on)."
diff --git a/docs/using/getting-started.md b/docs/using/getting-started.md
new file mode 100644
index 000000000..4c5892a96
--- /dev/null
+++ b/docs/using/getting-started.md
@@ -0,0 +1,28 @@
+# Getting Started with GitHub for Unity
+There are often three states that you might be in when you are setting up your GitHub for Unity package with your Unity project:
+- [Setting up a brand new repository](#setting-up-a-new-repository): You do not currently have your Unity project in a repository and you want to publish it to one.
+- [Connecting to an existing respository](#connecting-to-an-existing-repository): Your Unity project is already in a repository, but you do not have the GitHub for Unity package installed within it yet.
+- [Opening a Unity project that already has the GitHub for Unity package](#connecting-to-an-existing-repository-that-already-has-the-github-for-unity-package): Your Unity project is already in a repository and it already has the GitHub for Unity package and you are trying to setup a new machine.
+
+# Setting up a New Repository
+If you have a Unity project (new or existing) that is not yet connected to any remote repository, you can use the GitHub for Unity package to quickly intialize the repository and publish to a repository.
+
+1. If your Unity project doesn't yet have the GitHub plugin installed, follow [these](https://github.com/github-for-unity/Unity/blob/master/docs/using/how-to-install-and-update.md) instructions for installing it.
+2. Click on the `Initialize a git repository for this project` button
+
+And you should see the GitHub spinner:
+
+3. The GitHub tab should reload with the following buttons:
+ - Publish: Publish this repository to GitHub (Creating a new GitHub repository)
+ - Account: Login to your GitHub account | Logout from your GitHub account or visit your profile on GitHub.com
+ - Changes: Local changes that are not yet committed, with a dialog to commit those changes
+ - History: A history of commits with title, time stamp, and commit author
+ - Branches: A list of local and remote branches with the ability to create new branches, switch branches, or checkout remote branches
+ - Settings: your git configuration (pulled from your local git credentials if they have been previously set), your repository configuration (you can manually put the URL to any remote repository here instead of using the Publish button to publish to GitHub), a list of locked files, your git installation details, and general settings to help us better help you if you get stuck
+
+# Cloning an Existing Repository
+GitHub for Unity does not have the functionality to clone projects (yet!).
+1. Clone the repository (either through command line or with GitHub Desktop https://desktop.github.com/).
+2. Open the project in Unity.
+3. Install GitHub for Unity if it is not already installed.
+4. The GitHub plugin should load with all functionality enabled.
\ No newline at end of file
diff --git a/docs/using/how-to-install-and-update.md b/docs/using/how-to-install-and-update.md
new file mode 100644
index 000000000..fb9dd93d8
--- /dev/null
+++ b/docs/using/how-to-install-and-update.md
@@ -0,0 +1,51 @@
+# Installation and Updating Guide
+[Installing from a Downloaded Package File](#installing-from-a-package-file)
+[Installing from the Unity Asset Store](#installing-from-the-asset-store)
+[Updating a Previously Installed Version](#updating-the-github-for-unity-package)
+
+_Note: If your Unity project already has the GitHub for Unity plugin installed, see our [Getting Started](https://github.com/github-for-unity/Unity/blob/master/docs/using/getting-started.md) docs before continuing_
+
+
+# Installing from a Package File
+You can download the latest release from the repository at [https://github.com/github-for-unity/Unity/releases](https://github.com/github-for-unity/Unity/releases) or from the website at [https://unity.github.com/](https://unity.github.com/).
+
+Once you've downloaded the package file, you can quickly install it within Unity.
+1. Open a new Unity Project
+
+2. Go to `Assets -> Import Package -> Custom Package`
+
+3. Find and open the GitHub for Unity Asset Package
+
+4. Click `Import` when the dialog pops up
+
+5. After the package finishes importing, go to `Window -> GitHub` to open the GitHub window
+
+6. You should see the GitHub window in your Unity project, with a button to initialize your repository
+
+
+# Installing from the Asset Store
+1. Open a new Unity Project
+
+2. Go to `Window -> Asset Store`
+
+3. Search for "GitHub" in the search bar
+
+4. Click on the GitHub for Unity Package
+
+5. Click `Download` then `Install`
+
+
+6. Click `Import` when the dialog pops up
+
+7. After the package finishes importing, go to `Window -> GitHub` to open the GitHub window
+
+8. You should see the GitHub window in your Unity project, with a button to initialize your repository
+
+
+# Updating the GitHub for Unity Package
+
+- If you are running Unity and wish to update GitHub for Unity (unless explicitly stated), be sure that the files in `x64` and `x86` are not selected.
+
+ 
+
+- Otherwise, it's best to stop Unity and delete GitHub for Unity from your project. Startup Unity and run the package installer like normal. Allowing it to restore everything.
diff --git a/docs/using/images/branches-initial-view.png b/docs/using/images/branches-initial-view.png
new file mode 100644
index 000000000..811bcf724
--- /dev/null
+++ b/docs/using/images/branches-initial-view.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:558821e67ea26955434da0485785e9240b6c15c44a3790b642fdcd37382e56a2
+size 59798
diff --git a/docs/using/images/changes-view.png b/docs/using/images/changes-view.png
new file mode 100644
index 000000000..23000f8ef
--- /dev/null
+++ b/docs/using/images/changes-view.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:2ac4637a222a06e6ab57f23082b8e8b2f5cb9e35b9b99776c112ddcebb923dec
+size 61918
diff --git a/docs/using/images/confirm-pull-changes.png b/docs/using/images/confirm-pull-changes.png
new file mode 100644
index 000000000..722bbd639
--- /dev/null
+++ b/docs/using/images/confirm-pull-changes.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:4b0e1aa1d8d86cb0264c9ca569a5c8e71b0aba73a2eb6611c06ec47670037d7d
+size 21478
diff --git a/docs/using/images/confirm-push-changes.png b/docs/using/images/confirm-push-changes.png
new file mode 100644
index 000000000..ff1ca1cd0
--- /dev/null
+++ b/docs/using/images/confirm-push-changes.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:9e2e136027b03609f344bfde0c777d8e915544a5e9920f1268e4cc3abc5b1481
+size 18676
diff --git a/docs/using/images/confirm-revert.png b/docs/using/images/confirm-revert.png
new file mode 100644
index 000000000..cbf5d1566
--- /dev/null
+++ b/docs/using/images/confirm-revert.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:ba990ce12403bfb53fb387ca3f3e2c447b21814ed6cd7e6f88d968463a5253a8
+size 21973
diff --git a/docs/using/images/create-new-branch-view.png b/docs/using/images/create-new-branch-view.png
new file mode 100644
index 000000000..34c69d1ea
--- /dev/null
+++ b/docs/using/images/create-new-branch-view.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:f0239a51f611501dc63c828de206f35d412493871f65e712983666e67dbfc231
+size 62046
diff --git a/docs/using/images/delete-dialog.png b/docs/using/images/delete-dialog.png
new file mode 100644
index 000000000..574489f7c
--- /dev/null
+++ b/docs/using/images/delete-dialog.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:99d7cd8ef4957614cc844a08a632159157295414dc4675c1394f3209e30ffa58
+size 76315
diff --git a/docs/using/images/github-authenticate.png b/docs/using/images/github-authenticate.png
new file mode 100644
index 000000000..188121d97
--- /dev/null
+++ b/docs/using/images/github-authenticate.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:31ca0f7c4fc5c737a3db2da6eeb3deaa862d27e2cf3d1aa78fa14555b7cac750
+size 5927
diff --git a/docs/using/images/github-menu-item.png b/docs/using/images/github-menu-item.png
new file mode 100644
index 000000000..44f3f9458
--- /dev/null
+++ b/docs/using/images/github-menu-item.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:c423766a70230c245f4bcdb1e33d9e76f267bf789876ecf9050016f9c8671735
+size 19651
diff --git a/docs/using/images/github-sign-in-button.png b/docs/using/images/github-sign-in-button.png
new file mode 100644
index 000000000..cb6132c24
--- /dev/null
+++ b/docs/using/images/github-sign-in-button.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:79bea09964bcf1964d4d1e1fb9712fe9fc67dc8ffe11f936534c9f2be63fd777
+size 9318
diff --git a/docs/using/images/github-two-factor.png b/docs/using/images/github-two-factor.png
new file mode 100644
index 000000000..7a3286616
--- /dev/null
+++ b/docs/using/images/github-two-factor.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:aba2174f780ea52a7cf7bbfd5144527bb7b29c3ce6a3200b6b6f8c69b2d6fb48
+size 9665
diff --git a/docs/using/images/locked-scene.png b/docs/using/images/locked-scene.png
new file mode 100644
index 000000000..7a839141d
--- /dev/null
+++ b/docs/using/images/locked-scene.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:bbc246b18cbd173c19f392fe7ab85bffb8a97a7616ef99e7e37496e307924e49
+size 51983
diff --git a/docs/using/images/locks-view-right-click.png b/docs/using/images/locks-view-right-click.png
new file mode 100644
index 000000000..0ee14312c
--- /dev/null
+++ b/docs/using/images/locks-view-right-click.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:590dae09b3c029e48c3703d6c85a6774b062ebea46f11c2c062d97fedcb436df
+size 27251
diff --git a/docs/using/images/locks-view.png b/docs/using/images/locks-view.png
new file mode 100644
index 000000000..e8790d74e
--- /dev/null
+++ b/docs/using/images/locks-view.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:118f2b2e1bb82b598107eaa73db9a077374ff4f9601e47677eca7296353b1bc3
+size 23274
diff --git a/docs/using/images/name-branch.png b/docs/using/images/name-branch.png
new file mode 100644
index 000000000..9926c06db
--- /dev/null
+++ b/docs/using/images/name-branch.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:08232fa5cfd41a41c8091197ac27f433fdfa865c4996388dd0c731ac75176442
+size 59599
diff --git a/docs/using/images/new-branch-created.png b/docs/using/images/new-branch-created.png
new file mode 100644
index 000000000..2a37a9aeb
--- /dev/null
+++ b/docs/using/images/new-branch-created.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:8543da247ee23364c15abec87e4e3de3e62b85a470e7d3d090ade18fb321072c
+size 64045
diff --git a/docs/using/images/post-commit-view.png b/docs/using/images/post-commit-view.png
new file mode 100644
index 000000000..81fc7d135
--- /dev/null
+++ b/docs/using/images/post-commit-view.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:91e26123236bdd3e692ca7d30ff0d6477311fe739d8008ba19fd543ee3506176
+size 21345
diff --git a/docs/using/images/post-push-history-view.png b/docs/using/images/post-push-history-view.png
new file mode 100644
index 000000000..0d2ed767a
--- /dev/null
+++ b/docs/using/images/post-push-history-view.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:c0c2d5ccaddc88d3268e0d57f02229525240ecc71bded951e23171456560268b
+size 22485
diff --git a/docs/using/images/pull-view.png b/docs/using/images/pull-view.png
new file mode 100644
index 000000000..842ff9660
--- /dev/null
+++ b/docs/using/images/pull-view.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:feb83a46ebdd34ff46db3a38e8829f5adec5b10824bf69a8c56c9ba6fbd603ff
+size 25054
diff --git a/docs/using/images/push-view.png b/docs/using/images/push-view.png
new file mode 100644
index 000000000..42bef651a
--- /dev/null
+++ b/docs/using/images/push-view.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:ab87bae0916af3681b7528891a359c77597fa3ea57f13eb6924f1cbcf2f2ab7d
+size 14581
diff --git a/docs/using/images/release-lock.png b/docs/using/images/release-lock.png
new file mode 100644
index 000000000..545b81c8a
--- /dev/null
+++ b/docs/using/images/release-lock.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:0f6e05a714d270016d1f8ad4e018a895ed2b023fe59bd34a28df8d315c065649
+size 140913
diff --git a/docs/using/images/request-lock.png b/docs/using/images/request-lock.png
new file mode 100644
index 000000000..b877e1d8f
--- /dev/null
+++ b/docs/using/images/request-lock.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:3f25877141bed2dcbdc4324edcbd802b6f216771e80de704f20dc99a3fdc718b
+size 136078
diff --git a/docs/using/images/revert-commit.png b/docs/using/images/revert-commit.png
new file mode 100644
index 000000000..daad75c8c
--- /dev/null
+++ b/docs/using/images/revert-commit.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:b7711f428f3e04ea056c47b5d43109f3941761f4c286360d3616e0598d2d7b75
+size 26119
diff --git a/docs/using/images/revert.png b/docs/using/images/revert.png
new file mode 100644
index 000000000..326071a28
--- /dev/null
+++ b/docs/using/images/revert.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:dea7b36eec8e2d99e1906b6cbc9cd22f52d2db09cc1a0cf34563585720b6649d
+size 25141
diff --git a/docs/using/images/success-pull-changes.png b/docs/using/images/success-pull-changes.png
new file mode 100644
index 000000000..a246da405
--- /dev/null
+++ b/docs/using/images/success-pull-changes.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:e0407ab83ca311f319ff7feac0dac84b862935e2b50353ff82c067bdadf80e16
+size 16888
diff --git a/docs/using/images/success-push-changes.png b/docs/using/images/success-push-changes.png
new file mode 100644
index 000000000..8fba1f506
--- /dev/null
+++ b/docs/using/images/success-push-changes.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:cfd290cb1e52b0acb5503642a3aaef164bf343735729325484e25d8b99293d7e
+size 13262
diff --git a/docs/using/images/switch-confirmation.png b/docs/using/images/switch-confirmation.png
new file mode 100644
index 000000000..92d623d6c
--- /dev/null
+++ b/docs/using/images/switch-confirmation.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:4ed80f5cf2fab5fd256dd7cd093ad505c966edb95bdc5a15c3f1ace042bec7f6
+size 73947
diff --git a/docs/using/images/switch-or-delete.png b/docs/using/images/switch-or-delete.png
new file mode 100644
index 000000000..deab6badf
--- /dev/null
+++ b/docs/using/images/switch-or-delete.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:8c0d171b2e8f7e212f2446b416235c6232c57c9b4927cfa41891bffa1940ae9d
+size 73828
diff --git a/docs/using/images/switched-branches.png b/docs/using/images/switched-branches.png
new file mode 100644
index 000000000..c185d25c5
--- /dev/null
+++ b/docs/using/images/switched-branches.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:542806a8dcc012cdfadadaf9cdab3cf4871bbbbee2c8d73834946df4ed249aec
+size 64281
diff --git a/docs/using/locking-files.md b/docs/using/locking-files.md
new file mode 100644
index 000000000..f90c8e7a3
--- /dev/null
+++ b/docs/using/locking-files.md
@@ -0,0 +1,30 @@
+# Locking files
+
+## Request locks
+
+From the Project tab, right-click on a file to open the context menu and select `Request Lock`.
+
+
+An additional way to lock a file is by selecting it and going to `Assets` -> `Request Lock`.
+
+## View locks
+
+After requesting a lock, a lock icon appears in the bottom right-hand corner of the file.
+
+
+A list of all locked files will appear in the **Locks** view in the GitHub tab.
+
+
+## Release locks
+
+There are three ways to release locks:
+
+1. From the Project tab, right-click on the locked file to open the context menu and select the option to `Release Lock`.
+
+
+2. From the GitHub tab under the **Locks** view, right-click to open the context menu and select to `Release Lock`.
+
+
+3. Select the file to unlock and go to select the menu option `Assets` -> `Release Lock`.
+
+Note: There are also two options for how to release a lock on a file. Always choose the `Release Lock` option first. The `Release Lock (forced)` option can be used to remove someone else's lock.
diff --git a/docs/using/managing-branches.md b/docs/using/managing-branches.md
new file mode 100644
index 000000000..13fa9c1bd
--- /dev/null
+++ b/docs/using/managing-branches.md
@@ -0,0 +1,38 @@
+# Managing branches
+
+Initial **Branches** view
+
+
+
+## Create branch
+
+1. From the **Branches** view, click on `master` under local branches to enable the `New Branch` button and be able to create a new branch from master.
+2. Click on `New Branch`.
+
+
+3. Enter a name for the branch and click `Create`.
+
+
+4. The new branch will be created from master.
+
+
+## Checkout branch
+
+1. Right-click on a local branch and select `Switch` or double-click on the branch to switch to it.
+
+
+2. A dialog will appear asking `Switch branch to 'branch name'?`. Select `Switch`.
+
+
+The branch will be checked out.
+
+
+## Delete branches
+
+1. Click on the branch name to be deleted and the `Delete` button becomes enabled.
+2. Right-click on a local branch and select `Delete` or click the `Delete` button above the Local branches list.
+
+
+3. A dialog appears asking `Are you sure you want to delete the branch: 'branch name'?`. Select `Delete`.
+
+The branch will be deleted.
diff --git a/docs/using/quick-guide.md b/docs/using/quick-guide.md
new file mode 100644
index 000000000..2011ee40f
--- /dev/null
+++ b/docs/using/quick-guide.md
@@ -0,0 +1,164 @@
+# Quick Guide
+
+## More resources
+
+These documents contain more details on how to use the GitHub for Unity plugin:
+- **[Installing and Updating the GitHub for Unity package](https://github.com/github-for-unity/Unity/blob/master/docs/using/how-to-install-and-update.md)**
+- **[Getting Started with the GitHub for Unity package](https://github.com/github-for-unity/Unity/blob/master/docs/using/getting-started.md)**
+- **[Authenticating to GitHub](https://github.com/github-for-unity/Unity/blob/master/docs/using/authenticating-to-github.md)**
+- **[Managing Branches](https://github.com/github-for-unity/Unity/blob/master/docs/using/managing-branches.md)**
+- **[Locking Files](https://github.com/github-for-unity/Unity/blob/master/docs/using/locking-files.md)**
+- **[Working with Changes](https://github.com/github-for-unity/Unity/blob/master/docs/using/working-with-changes.md)**
+- **[Using the Api](https://github.com/github-for-unity/Unity/blob/master/docs/using/using-the-api.md)**
+
+## Table of Contents
+
+[Installing GitHub for Unity](#installing-github-for-unity)
+
+- [Requirements](#requirements)
+ - [Git on macOS](#git-on-macos)
+ - [Git on Windows](#git-on-windows)
+- [Installation](#installation)
+- [Log files](#log-files)
+ - [Windows](#windows)
+ - [macOS](#macos)
+
+[Quick Guide to GitHub for Unity](#quick-guide-to-github-for-unity)
+
+- [Opening the GitHub window](#opening-the-github-window)
+- [Initialize Repository](#initialize-repository)
+- [Authentication](#authentication)
+- [Publish a new repository](#publish-a-new-repository)
+- [Commiting your work - Changes tab](#commiting-your-work---changes-tab)
+- [Pushing/pulling your work - History tab](#pushingpulling-your-work---history-tab)
+- [Branches tab](#branches-tab)
+- [Settings tab](#settings-tab)
+
+## Installing GitHub for Unity
+
+### Requirements
+
+- Unity 5.4 or higher
+ - There's currently a blocker issue opened for 5.3 support, so we know it doesn't run there. Personal edition is fine.
+- Git and Git LFS 2.x
+
+#### Git on macOS
+
+The current release has limited macOS support. macOS users will need to install the latest [Git](https://git-scm.com/downloads) and [Git LFS](https://git-lfs.github.com/) manually, and make sure these are on the path. You can configure the Git location in the `Settings` tab on the GitHub window.
+
+The easiest way of installing git and git lfs is to install [Homebrew](https://brew.sh/) and then do `brew install git git-lfs`.
+
+Make sure a Git user and email address are set in the `~/.gitconfig` file before you initialize a repository for the first time. You can set these values by opening your `~/.gitconfig` file and adding the following section, if it doesn't exist yet:
+
+```
+[user]
+ name = Your Name
+ email = Your Email
+```
+
+#### Git on Windows
+
+The GitHub for Unity extension ships with a bundle of Git and Git LFS, to ensure that you have the correct version. These will be installed into `%LOCALAPPDATA%\GitHubUnity` when the extension runs for the first time.
+
+Make sure a Git user and email address are set in the `%HOME%\.gitconfig` file before you initialize a repository for the first time. You can set these values by opening your `%HOME%\.gitconfig` file and adding the following section, if it doesn't exist yet:
+
+```
+[user]
+ name = Your Name
+ email = Your Email
+```
+
+Once the extension is installed, you can open a command line with the same Git and Git LFS version that the extension uses by going to `Window` -> `GitHub Command Line` in Unity.
+
+### Installation
+
+This extensions needs to be installed (and updated) for each Unity project that you want to version control.
+First step is to download the latest package from [the releases page](https://github.com/github-for-unity/Unity/releases); it will be saved as a file with the extension `.unitypackage`.
+To install it, open Unity, then open the project you want to version control, and then double click on the downloaded package.
+Alternatively, import the package by clicking `Assets`, `Import Package`, `Custom Package`, then select the downloaded package.
+
+#### Log files
+
+##### macOS
+
+The extension log file can be found at `~/Library/Logs/GitHubUnity/github-unity.log`
+
+##### Windows
+
+The extension log file can be found at `%LOCALAPPDATA%\GitHubUnity\github-unity.log`
+
+## I have a problem with GitHub for Unity
+
+First, please search the [open issues](https://github.com/github-for-unity/Unity/issues?q=is%3Aopen)
+and [closed issues](https://github.com/github-for-unity/Unity/issues?q=is%3Aclosed)
+to see if your issue hasn't already been reported (it may also be fixed).
+
+If you can't find an issue that matches what you're seeing, open a [new issue](https://github.com/github-for-unity/Unity/issues/new)
+and fill out the template to provide us with enough information to investigate
+further.
+
+## Quick Guide to GitHub for Unity
+
+### Opening the GitHub window
+
+You can access the GitHub window by going to `Windows` -> `GitHub`. The window opens by default next to the Inspector window.
+
+### Initialize Repository
+
+
+
+If the current Unity project is not in a Git repository, the GitHub for Unity extension will offer to initialize the repository for you. This will:
+
+- Initialize a git repository at the Unity project root via `git init`
+- Initialize git-lfs via `git lfs install`
+- Set up a `.gitignore` file at the Unity project root.
+- Set up a `.gitattributes` file at the Unity project root with a large list of known binary filetypes (images, audio, etc) that should be tracked by LFS
+- Configure the project to serialize meta files as text
+- Create an initial commit with the `.gitignore` and `.gitattributes` file.
+
+### Authentication
+
+To set up credentials in Git so you can push and pull, you can sign in to GitHub by going to `Window` -> `GitHub` -> `Account` -> `Sign in`. You only have to sign in successfully once, your credentials will remain on the system for all Git operations in Unity and outside of it. If you've already signed in once but the Account dropdown still says `Sign in`, ignore it, it's a bug.
+
+
+
+For more information on Authentication: - **[Authenticating to GitHub](https://github.com/github-for-unity/Unity/blob/master/docs/using/authenticating-to-github.md)**
+
+### Publish a new repository
+
+1. Go to [github.com](https://github.com) and create a new empty repository - do not add a license, readme or other files during the creation process.
+2. Copy the **https** URL shown in the creation page
+3. In Unity, go to `Windows` -> `GitHub` -> `Settings` and paste the url into the `Remote` textbox.
+4. Click `Save repository`.
+5. Go to the `History` tab and click `Push`.
+
+### Commiting your work - Changes tab
+
+You can see which files have been changed and commit them through the `Changes` tab. `.meta` files will show up in relation to their files on the tree, so you can select a file for comitting and automatically have their `.meta`
+
+
+
+For more information on working with changes: - **[Working with Changes](https://github.com/github-for-unity/Unity/blob/master/docs/using/working-with-changes.md#commit-changes)**
+
+### Pushing/pulling your work - History tab
+
+The history tab includes a `Push` button to push your work to the server. Make sure you have a remote url configured in the `Settings` tab so that you can push and pull your work.
+
+To receive updates from the server by clicking on the `Pull` button. You cannot pull if you have local changes, so commit your changes before pulling.
+
+
+
+
+For more information on working with changes: - **[Working with Changes](https://github.com/github-for-unity/Unity/blob/master/docs/using/working-with-changes.md#pulling-changes)**
+
+### Branches tab
+
+
+
+### Settings tab
+
+You can configure your user data in the `Settings` tab, along with the path to the Git installation.
+
+Locked files will appear in a list in the Settings tab. You can see who has locked a file and release file locks after you've pushed your work.
+
+
diff --git a/docs/using/using-the-api.md b/docs/using/using-the-api.md
new file mode 100644
index 000000000..ab75cab55
--- /dev/null
+++ b/docs/using/using-the-api.md
@@ -0,0 +1,75 @@
+# Using the API
+
+GitHub for Unity provides access to a git client to help users create their own tools to assist in their workflow.
+
+Users can separate the user interface from the API by removing `GitHub.Unity.dll`. All other libraries are required by the API.
+
+## Creating an instance of `GitClient`
+```cs
+var defaultEnvironment = new DefaultEnvironment();
+defaultEnvironment.Initialize(null, NPath.Default, NPath.Default, NPath.Default, Application.dataPath.ToNPath());
+
+var processEnvironment = new ProcessEnvironment(defaultEnvironment);
+var processManager = new ProcessManager(defaultEnvironment, processEnvironment, TaskManager.Instance.Token);
+
+var gitClient = new GitClient(defaultEnvironment, processManager, TaskManager.Instance.Token);
+```
+
+## Full Example
+This example creates a window that has a single button which commits all changes.
+```cs
+using System;
+using System.Globalization;
+using GitHub.Unity;
+using UnityEditor;
+using UnityEngine;
+
+public class CustomGitEditor : EditorWindow
+{
+ [MenuItem("Window/Custom Git")]
+ public static void ShowWindow()
+ {
+ EditorWindow.GetWindow(typeof(CustomGitEditor));
+ }
+
+ [NonSerialized] private GitClient gitClient;
+
+ public void OnEnable()
+ {
+ InitGitClient();
+ }
+
+ private void InitGitClient()
+ {
+ if (gitClient != null) return;
+
+ Debug.Log("Init GitClient");
+
+ var defaultEnvironment = new DefaultEnvironment();
+ defaultEnvironment.Initialize(null, NPath.Default, NPath.Default,
+ NPath.Default, Application.dataPath.ToNPath());
+
+ var processEnvironment = new ProcessEnvironment(defaultEnvironment);
+ var processManager = new ProcessManager(defaultEnvironment, processEnvironment, TaskManager.Instance.Token);
+
+ gitClient = new GitClient(defaultEnvironment, processManager, TaskManager.Instance.Token);
+ }
+
+ void OnGUI()
+ {
+ GUILayout.Label("Custom Git Window", EditorStyles.boldLabel);
+
+ if (GUILayout.Button("Commit Stuff"))
+ {
+ var message = DateTime.Now.ToString(CultureInfo.InvariantCulture);
+ var body = string.Empty;
+
+ gitClient.AddAll()
+ .Then(gitClient.Commit(message, body))
+ .Start();
+ }
+ }
+}
+```
+
+
diff --git a/docs/using/working-with-changes.md b/docs/using/working-with-changes.md
new file mode 100644
index 000000000..228e4bd3f
--- /dev/null
+++ b/docs/using/working-with-changes.md
@@ -0,0 +1,53 @@
+# Working with changes
+
+## Commit changes
+
+All changes made to a repository will show up under the **Changes** view.
+
+1. Select the changes to be committed. Can choose the All/None options, or select directories or files individually.
+2. Enter a Commit summary which describes the purpose of the commit. An optional Commit description can also be entered.
+3. Click the button `Commit to [branch name]`.
+
+
+The commit will not be shown under the **History** view. On the top bar the button `Push (1)` indicates that there is 1 commit to push.
+
+
+
+## Push changes to GitHub
+
+1. Click `Push` once ready to push a commit to GitHub.
+
+
+2. A dialog will appear asking `Would you like to push changes to remote 'branch name'?` Select `Push`.
+
+
+3. Another dialog will appear when the push to GitHub is complete saying `Branch pushed`. Select `ok`.
+
+
+## Revert changes
+
+1. From the **History** view, right-click on a commit in the commit list. A `Revert` option will appear.
+2. Click `Revert`.
+
+
+3. A dialog will appear asking `Are you sure you want to revert the following commit: "commit message"?`. Select `Revert`.
+
+
+4. A new commit appears titled `Revert "commit summary"` and the view indicates that there is 1 commit to push.
+
+
+5. Follow the steps to push the reverted commit to GitHub.
+
+## Pulling changes
+
+1. Click the `Fetch` button to get all the latest branches and tags for the repository. The `Pull` button will then show the number of commits to pull from GitHub.
+2. Click `Pull`.
+
+
+3. A dialog will appear asking `Would you like to pull changes from remote 'branch name'?`. Select `Pull`.
+
+
+4. Another dialog appears saying `Local branch is up to date with 'branch name'`. Select `ok`.
+
+
+
diff --git a/EULA.txt b/eula.txt
similarity index 100%
rename from EULA.txt
rename to eula.txt
diff --git a/generate-package.sh b/generate-package.sh
new file mode 100755
index 000000000..e9ef73a4a
--- /dev/null
+++ b/generate-package.sh
@@ -0,0 +1,91 @@
+#!/bin/sh -eu
+DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+
+URL="http://ghfvs-installer.github.com"
+GIT=0
+LFS=0
+GHU=0
+FILE=""
+VERSION=""
+RN=""
+MSG=""
+OS=""
+
+while [[ $# -gt 0 ]]
+do
+key="$1"
+
+case $key in
+ -h)
+ URL="$2"
+ shift
+ shift
+ ;;
+ -p)
+ FILE="--path $2"
+ shift
+ shift
+ ;;
+ -v)
+ VERSION="--version $2"
+ shift
+ shift
+ ;;
+ -r)
+ RN="--rn $2"
+ shift
+ shift
+ ;;
+ -m)
+ MSG="--msg $2"
+ shift
+ shift
+ ;;
+ -git)
+ GIT=1
+ shift # past value
+ ;;
+ -lfs)
+ LFS=1
+ shift # past value
+ ;;
+ -ghu)
+ GHU=1
+ shift # past value
+ ;;
+ -windows)
+ OS="windows"
+ shift # past value
+ ;;
+ -mac)
+ OS="mac"
+ shift # past value
+ ;;
+ -linux)
+ OS="linux"
+ shift # past value
+ ;;
+esac
+done
+
+if [ x"$GIT" = "x0" -a x"$LFS" = "x0" -a x"$GHU" = "x0" ]; then
+ echo "Usage: generate-package.sh [-git|-lfs|-ghu] [-windows|-mac|-linux only if -git or -lfs] [-v version] [-p path to file] [-h host url (optional)] [-r release notes file (optional)] [-m message file (optional)]"
+ exit 1
+fi
+
+if [ x"$GHU" = x"1" ]; then
+ URL="--url $URL/unity/releases"
+else
+ URL="--url $URL/unity/git/$OS"
+fi
+
+EXEC=
+if [ ! -e "/c/" ]; then
+ EXEC=mono
+fi
+
+if [ ! -e "build/CommandLine/CommandLine.exe" ]; then
+ >&2 xbuild /target:CommandLine "$DIR/GitHub.Unity.sln" /verbosity:minimal
+fi
+
+$EXEC build/CommandLine/CommandLine.exe --gen-package $VERSION $FILE $URL $RN $MSG
diff --git a/lib/.gitignore b/lib/.gitignore
index 1ea843a1c..9432a8bee 100644
--- a/lib/.gitignore
+++ b/lib/.gitignore
@@ -1 +1,2 @@
-Unity*
\ No newline at end of file
+Managed
+UnityExtensions
\ No newline at end of file
diff --git a/lib/ICSharpCode.NRefactory.dll b/lib/ICSharpCode.NRefactory.dll
deleted file mode 100644
index f11688c6c..000000000
--- a/lib/ICSharpCode.NRefactory.dll
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:2e28e35172498877c7e4a33253b0c5df172bce5655b2ab933a922d6777ae5e6d
-size 528384
diff --git a/lib/ICSharpCode.SharpZipLib.dll b/lib/ICSharpCode.SharpZipLib.dll
deleted file mode 100644
index 108abfd2a..000000000
--- a/lib/ICSharpCode.SharpZipLib.dll
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:fbace48694fbfff69ff99ff7aefbde67965f7723092df9c13ff537d2a319f410
-size 192000
diff --git a/src/GitHub.Api/PlatformResources/linux/.placeholder b/lib/Managed/.gitignore
similarity index 100%
rename from src/GitHub.Api/PlatformResources/linux/.placeholder
rename to lib/Managed/.gitignore
diff --git a/lib/Mono.Security.dll b/lib/Mono.Security.dll
deleted file mode 100644
index a7a97c141..000000000
--- a/lib/Mono.Security.dll
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:71ba4944619044e35abf7970e23e9c6b87acd2700dcae8d6655f39c53bcf40e1
-size 294912
diff --git a/lib/TunnelVisionLabs.Threading.2.0.0-unity.nupkg b/lib/TunnelVisionLabs.Threading.2.0.0-unity.nupkg
deleted file mode 100644
index 24376117f..000000000
Binary files a/lib/TunnelVisionLabs.Threading.2.0.0-unity.nupkg and /dev/null differ
diff --git a/lib/TunnelVisionLabs.Threading.2.0.0-unity.symbols.nupkg b/lib/TunnelVisionLabs.Threading.2.0.0-unity.symbols.nupkg
deleted file mode 100644
index e652c34b2..000000000
Binary files a/lib/TunnelVisionLabs.Threading.2.0.0-unity.symbols.nupkg and /dev/null differ
diff --git a/lib/UnityExtensions/Unity/TestRunner/Editor/.gitignore b/lib/UnityExtensions/Unity/TestRunner/Editor/.gitignore
new file mode 100644
index 000000000..e69de29bb
diff --git a/lib/dotnet-httpClient35/System.Net.Http.dll b/lib/dotnet-httpClient35/System.Net.Http.dll
deleted file mode 100644
index 69fee1021..000000000
--- a/lib/dotnet-httpClient35/System.Net.Http.dll
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:5fd1e590c79fa453c5722bd645ef037d5f7748177bab14bd794981adc11a06a0
-size 123904
diff --git a/lib/dotnet-httpClient35/System.Net.Http.dll.mdb b/lib/dotnet-httpClient35/System.Net.Http.dll.mdb
deleted file mode 100644
index 5f13b0ccb..000000000
--- a/lib/dotnet-httpClient35/System.Net.Http.dll.mdb
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:df057b70add2c6488614a273236cb07d5b971026de36c5b9a3f044a547af75f2
-size 47752
diff --git a/lib/dotnet-httpClient35/md5sums.txt b/lib/dotnet-httpClient35/md5sums.txt
deleted file mode 100644
index e99ef3233..000000000
--- a/lib/dotnet-httpClient35/md5sums.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-e15a0894ef162ec53566fa9c8211e583 *System.Net.Http.dll
-161847a9a61eb3cdab7a7706e83265a1 *System.Net.Http.dll.mdb
diff --git a/lib/dotnet-httpClient35/version.txt b/lib/dotnet-httpClient35/version.txt
deleted file mode 100644
index 38dcf35fb..000000000
--- a/lib/dotnet-httpClient35/version.txt
+++ /dev/null
@@ -1 +0,0 @@
-3.5.0.0 3.5.22000.2-gfu 43d89b670547006521c95fc150d9b79506c208ca
\ No newline at end of file
diff --git a/lib/octokit.net/Octokit.dll b/lib/octokit.net/Octokit.dll
deleted file mode 100644
index 9ecfd9fce..000000000
--- a/lib/octokit.net/Octokit.dll
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:003fb61b6517b43d4ce412070bede800af20a161bcf8cb9cbcbac38aed1075da
-size 741888
diff --git a/lib/octokit.net/Octokit.dll.mdb b/lib/octokit.net/Octokit.dll.mdb
deleted file mode 100644
index 041f8dd04..000000000
--- a/lib/octokit.net/Octokit.dll.mdb
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:fe50d2c5d38b8dd9407a9053f46b4cec638959637d690ff169cf7aea2db4a187
-size 288546
diff --git a/lib/octokit.net/md5sums.txt b/lib/octokit.net/md5sums.txt
deleted file mode 100644
index 60441e277..000000000
--- a/lib/octokit.net/md5sums.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-ecb6930236469c41a36dee6d84fcab7a *Octokit.dll
-2a41d96c1ad9229d8ff2f46b8847ec6a *Octokit.dll.mdb
diff --git a/lib/octokit.net/version.txt b/lib/octokit.net/version.txt
deleted file mode 100644
index 1024bde64..000000000
--- a/lib/octokit.net/version.txt
+++ /dev/null
@@ -1 +0,0 @@
-0.23.0.1 0.23.0.2-gfu 9784094cdd6192887dc97180918565c036c6b62c
\ No newline at end of file
diff --git a/lib/pdb2mdb.exe b/lib/pdb2mdb.exe
new file mode 100644
index 000000000..72547bf3c
--- /dev/null
+++ b/lib/pdb2mdb.exe
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:a72425f98bdb5923704946c4010485d471ce9e35611264f394637fb185424619
+size 369664
diff --git a/lib/sfw.net/Debug/sfw.net.dll b/lib/sfw.net/Debug/sfw.net.dll
deleted file mode 100644
index f8062e0c4..000000000
--- a/lib/sfw.net/Debug/sfw.net.dll
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:551ba5aa30ed990e3e9754d70ead24abcaf4ac001dceb6706221de7a48c8529a
-size 7680
diff --git a/lib/sfw.net/Debug/sfw.net.dll.mdb b/lib/sfw.net/Debug/sfw.net.dll.mdb
deleted file mode 100644
index 9f6e6d841..000000000
--- a/lib/sfw.net/Debug/sfw.net.dll.mdb
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:23235b5737c749c7121fd786a969fb414dfd3820088fb0776415a4fee6f5a503
-size 2017
diff --git a/lib/sfw.net/Release/sfw.net.dll b/lib/sfw.net/Release/sfw.net.dll
deleted file mode 100644
index cbac695cd..000000000
--- a/lib/sfw.net/Release/sfw.net.dll
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:5507d90f6a9477d0422a2d7f8d269c109a8b061c3e5a32a9c820cedab3679c75
-size 7168
diff --git a/lib/sfw.net/Release/sfw.net.dll.mdb b/lib/sfw.net/Release/sfw.net.dll.mdb
deleted file mode 100644
index 86f1101da..000000000
--- a/lib/sfw.net/Release/sfw.net.dll.mdb
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:731efe4fa6ad106a1388caed09c3b8b1252fb3695b6e863f94e469efa16e3f9c
-size 1819
diff --git a/lib/sfw.net/linux/sfw.so b/lib/sfw.net/linux/sfw.so
deleted file mode 100755
index 1fbf51ea2..000000000
--- a/lib/sfw.net/linux/sfw.so
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:0b773221dff8f19ccd82c9f9c8eaee1744aeff40acaed8f67e5f7c1f59d89a24
-size 700312
diff --git a/lib/sfw.net/win/x64/Debug/sfw_x64.dll b/lib/sfw.net/win/x64/Debug/sfw_x64.dll
deleted file mode 100644
index 6f610effb..000000000
--- a/lib/sfw.net/win/x64/Debug/sfw_x64.dll
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:37dca0323c0fa10a494bcd352bc41024c97b4c3d74636f48398dbe2d3410e4a0
-size 1838592
diff --git a/lib/sfw.net/win/x64/Debug/sfw_x64.pdb b/lib/sfw.net/win/x64/Debug/sfw_x64.pdb
deleted file mode 100644
index f7dd82649..000000000
--- a/lib/sfw.net/win/x64/Debug/sfw_x64.pdb
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:937bbc1db4ad6d9f44fbc0e136ec0f9cd7c9deb2bfb3c0beade53e7282eb6167
-size 8073216
diff --git a/lib/sfw.net/win/x64/Release/pthreadVC2.dll b/lib/sfw.net/win/x64/Release/pthreadVC2.dll
deleted file mode 100644
index 3636fecc4..000000000
--- a/lib/sfw.net/win/x64/Release/pthreadVC2.dll
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:0e6af724609ef6846982ef717013426c359c455fff324e906d8d55c8bb88d16e
-size 82944
diff --git a/lib/sfw.net/win/x64/Release/sfw_x64.dll b/lib/sfw.net/win/x64/Release/sfw_x64.dll
deleted file mode 100644
index 84a7d354e..000000000
--- a/lib/sfw.net/win/x64/Release/sfw_x64.dll
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:034362371c8c201aee86d07e4a47880d0dd946395e1c22a3ef1b4dcd452d19d2
-size 220160
diff --git a/lib/sfw.net/win/x64/Release/sfw_x64.pdb b/lib/sfw.net/win/x64/Release/sfw_x64.pdb
deleted file mode 100644
index 9e2529417..000000000
--- a/lib/sfw.net/win/x64/Release/sfw_x64.pdb
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:ed197f05de4d9233c373b73f1eb29300bee8b8b03289ea21f5e72e09345d9aa0
-size 4354048
diff --git a/lib/sfw.net/win/x86/Debug/sfw_x86.dll b/lib/sfw.net/win/x86/Debug/sfw_x86.dll
deleted file mode 100644
index 2a5eec2a9..000000000
--- a/lib/sfw.net/win/x86/Debug/sfw_x86.dll
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:cf1667b852d258aec6c6a010d875e8e8c411a2ec476e9924a7f280e50f98a76e
-size 1400320
diff --git a/lib/sfw.net/win/x86/Debug/sfw_x86.pdb b/lib/sfw.net/win/x86/Debug/sfw_x86.pdb
deleted file mode 100644
index b0a8830eb..000000000
--- a/lib/sfw.net/win/x86/Debug/sfw_x86.pdb
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:fb8dba3aea410cf09ab6a315c384ee67df5e458ea561fef935cb7d878ae15115
-size 7901184
diff --git a/lib/sfw.net/win/x86/Release/pthreadVC2.dll b/lib/sfw.net/win/x86/Release/pthreadVC2.dll
deleted file mode 100644
index b90ff168f..000000000
--- a/lib/sfw.net/win/x86/Release/pthreadVC2.dll
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:bac4472990c1dc2f037019791bd18888e78a3ae86605f3aae86f812a4d7d4f60
-size 55808
diff --git a/lib/sfw.net/win/x86/Release/sfw_x86.dll b/lib/sfw.net/win/x86/Release/sfw_x86.dll
deleted file mode 100644
index a5b5f7bc6..000000000
--- a/lib/sfw.net/win/x86/Release/sfw_x86.dll
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:17d4b38c5bf3d186b09a89968ff3b73d3ef5a085b6f52cde3c745895ad983fc4
-size 182784
diff --git a/lib/sfw.net/win/x86/Release/sfw_x86.pdb b/lib/sfw.net/win/x86/Release/sfw_x86.pdb
deleted file mode 100644
index 6bbdb0bd1..000000000
--- a/lib/sfw.net/win/x86/Release/sfw_x86.pdb
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:333ab03287e0d87e1cc70353b657a1fed893b030b3cc086690a7ab18ba0f2b0a
-size 4517888
diff --git a/lib/sfw/linux/libsfw.so b/lib/sfw/linux/libsfw.so
new file mode 100755
index 000000000..1b35db8d8
--- /dev/null
+++ b/lib/sfw/linux/libsfw.so
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:58b22b85b527a7ae2df8aeea6a961a65d40198f3c92be0ae6bc48ef2c1eb17c5
+size 638138
diff --git a/lib/sfw/linux/libsfw.so.meta b/lib/sfw/linux/libsfw.so.meta
new file mode 100644
index 000000000..af2f46c79
--- /dev/null
+++ b/lib/sfw/linux/libsfw.so.meta
@@ -0,0 +1,106 @@
+fileFormatVersion: 2
+guid: 21206c65839f84d0e9ae14bc1fdc68db
+timeCreated: 1503931807
+licenseType: Pro
+PluginImporter:
+ serializedVersion: 2
+ iconMap: {}
+ executionOrder: {}
+ isPreloaded: 0
+ isOverridable: 0
+ platformData:
+ data:
+ first:
+ '': Any
+ second:
+ enabled: 0
+ settings:
+ Exclude Editor: 0
+ Exclude Linux: 1
+ Exclude Linux64: 1
+ Exclude LinuxUniversal: 1
+ Exclude OSXIntel: 1
+ Exclude OSXIntel64: 1
+ Exclude OSXUniversal: 1
+ Exclude Win: 1
+ Exclude Win64: 1
+ data:
+ first:
+ '': Editor
+ second:
+ enabled: 0
+ settings:
+ CPU: AnyCPU
+ OS: Linux
+ data:
+ first:
+ Any:
+ second:
+ enabled: 0
+ settings: {}
+ data:
+ first:
+ Editor: Editor
+ second:
+ enabled: 1
+ settings:
+ DefaultValueInitialized: true
+ data:
+ first:
+ Facebook: Win
+ second:
+ enabled: 0
+ settings:
+ CPU: AnyCPU
+ data:
+ first:
+ Facebook: Win64
+ second:
+ enabled: 0
+ settings:
+ CPU: AnyCPU
+ data:
+ first:
+ Standalone: Linux
+ second:
+ enabled: 0
+ settings:
+ CPU: x86
+ data:
+ first:
+ Standalone: Linux64
+ second:
+ enabled: 0
+ settings:
+ CPU: x86_64
+ data:
+ first:
+ Standalone: OSXIntel
+ second:
+ enabled: 0
+ settings:
+ CPU: AnyCPU
+ data:
+ first:
+ Standalone: OSXIntel64
+ second:
+ enabled: 0
+ settings:
+ CPU: AnyCPU
+ data:
+ first:
+ Standalone: Win
+ second:
+ enabled: 0
+ settings:
+ CPU: AnyCPU
+ data:
+ first:
+ Standalone: Win64
+ second:
+ enabled: 0
+ settings:
+ CPU: AnyCPU
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/lib/sfw/linux/version b/lib/sfw/linux/version
new file mode 100644
index 000000000..c1f8f3bff
--- /dev/null
+++ b/lib/sfw/linux/version
@@ -0,0 +1 @@
+362b801
\ No newline at end of file
diff --git a/lib/sfw/mac/libsfw.bundle b/lib/sfw/mac/libsfw.bundle
new file mode 100755
index 000000000..5dd99180d
--- /dev/null
+++ b/lib/sfw/mac/libsfw.bundle
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:499af15a02a7c9090694f9e7e9dd6d8abd01c5bb1a5e925547cfa42da7aec78c
+size 54180
diff --git a/lib/sfw/mac/libsfw.bundle.meta b/lib/sfw/mac/libsfw.bundle.meta
new file mode 100644
index 000000000..bb4f8fabf
--- /dev/null
+++ b/lib/sfw/mac/libsfw.bundle.meta
@@ -0,0 +1,106 @@
+fileFormatVersion: 2
+guid: 636d33ae594884e7d80b569f429d245d
+timeCreated: 1503667182
+licenseType: Free
+PluginImporter:
+ serializedVersion: 2
+ iconMap: {}
+ executionOrder: {}
+ isPreloaded: 0
+ isOverridable: 0
+ platformData:
+ data:
+ first:
+ '': Any
+ second:
+ enabled: 0
+ settings:
+ Exclude Editor: 0
+ Exclude Linux: 1
+ Exclude Linux64: 1
+ Exclude LinuxUniversal: 1
+ Exclude OSXIntel: 1
+ Exclude OSXIntel64: 1
+ Exclude OSXUniversal: 1
+ Exclude Win: 1
+ Exclude Win64: 1
+ data:
+ first:
+ '': Editor
+ second:
+ enabled: 0
+ settings:
+ CPU: AnyCPU
+ OS: OSX
+ data:
+ first:
+ Any:
+ second:
+ enabled: 0
+ settings: {}
+ data:
+ first:
+ Editor: Editor
+ second:
+ enabled: 1
+ settings:
+ DefaultValueInitialized: true
+ data:
+ first:
+ Facebook: Win
+ second:
+ enabled: 0
+ settings:
+ CPU: AnyCPU
+ data:
+ first:
+ Facebook: Win64
+ second:
+ enabled: 0
+ settings:
+ CPU: AnyCPU
+ data:
+ first:
+ Standalone: Linux
+ second:
+ enabled: 0
+ settings:
+ CPU: x86
+ data:
+ first:
+ Standalone: Linux64
+ second:
+ enabled: 0
+ settings:
+ CPU: x86_64
+ data:
+ first:
+ Standalone: OSXIntel
+ second:
+ enabled: 0
+ settings:
+ CPU: AnyCPU
+ data:
+ first:
+ Standalone: OSXIntel64
+ second:
+ enabled: 0
+ settings:
+ CPU: AnyCPU
+ data:
+ first:
+ Standalone: Win
+ second:
+ enabled: 0
+ settings:
+ CPU: AnyCPU
+ data:
+ first:
+ Standalone: Win64
+ second:
+ enabled: 0
+ settings:
+ CPU: AnyCPU
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/lib/sfw/mac/version b/lib/sfw/mac/version
new file mode 100644
index 000000000..c1f8f3bff
--- /dev/null
+++ b/lib/sfw/mac/version
@@ -0,0 +1 @@
+362b801
\ No newline at end of file
diff --git a/lib/sfw/sfw.net.dll b/lib/sfw/sfw.net.dll
new file mode 100755
index 000000000..2f49945d3
--- /dev/null
+++ b/lib/sfw/sfw.net.dll
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:21feeaa73e42bf03e86525bc5e1b954f4b9a2f16eed58a87c69e576509231480
+size 7168
diff --git a/lib/sfw/sfw.net.dll.mdb b/lib/sfw/sfw.net.dll.mdb
new file mode 100644
index 000000000..60c3740b6
--- /dev/null
+++ b/lib/sfw/sfw.net.dll.mdb
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:9b338de30fd729ffaa83c9ddf3c90a03ad9bdaa3367580316fef3649594a5217
+size 1924
diff --git a/lib/sfw.net/win/.gitignore b/lib/sfw/win/.gitignore
similarity index 100%
rename from lib/sfw.net/win/.gitignore
rename to lib/sfw/win/.gitignore
diff --git a/lib/sfw/win/version b/lib/sfw/win/version
new file mode 100644
index 000000000..c1f8f3bff
--- /dev/null
+++ b/lib/sfw/win/version
@@ -0,0 +1 @@
+362b801
\ No newline at end of file
diff --git a/lib/sfw.net/win/x64/Debug/pthreadVC2.dll b/lib/sfw/win/x64/pthreadVC2.dll
similarity index 100%
rename from lib/sfw.net/win/x64/Debug/pthreadVC2.dll
rename to lib/sfw/win/x64/pthreadVC2.dll
diff --git a/lib/sfw/win/x64/pthreadVC2.dll.meta b/lib/sfw/win/x64/pthreadVC2.dll.meta
new file mode 100644
index 000000000..300bad52a
--- /dev/null
+++ b/lib/sfw/win/x64/pthreadVC2.dll.meta
@@ -0,0 +1,165 @@
+fileFormatVersion: 2
+guid: 868fbb4c41814baebc00f96e24ede2f8
+timeCreated: 1491391266
+licenseType: Pro
+PluginImporter:
+ serializedVersion: 2
+ iconMap: {}
+ executionOrder: {}
+ isPreloaded: 0
+ isOverridable: 0
+ platformData:
+ data:
+ first:
+ '': Any
+ second:
+ enabled: 0
+ settings:
+ Exclude Editor: 0
+ Exclude Linux: 1
+ Exclude Linux64: 1
+ Exclude LinuxUniversal: 1
+ Exclude OSXIntel: 1
+ Exclude OSXIntel64: 1
+ Exclude OSXUniversal: 1
+ Exclude Win: 1
+ Exclude Win64: 1
+ data:
+ first:
+ '': Editor
+ second:
+ enabled: 0
+ settings:
+ CPU: x86_64
+ OS: Windows
+ data:
+ first:
+ Android: Android
+ second:
+ enabled: 0
+ settings:
+ CPU: ARMv7
+ data:
+ first:
+ Any:
+ second:
+ enabled: 0
+ settings:
+ Exclude Android: 1
+ Exclude Editor: 0
+ Exclude Linux: 1
+ Exclude Linux64: 1
+ Exclude LinuxUniversal: 1
+ Exclude OSXIntel: 1
+ Exclude OSXIntel64: 1
+ Exclude OSXUniversal: 1
+ Exclude SamsungTV: 1
+ Exclude Tizen: 1
+ Exclude WebGL: 1
+ Exclude Win: 1
+ Exclude Win64: 1
+ Exclude WindowsStoreApps: 1
+ Exclude iOS: 1
+ Exclude tvOS: 1
+ data:
+ first:
+ Editor: Editor
+ second:
+ enabled: 1
+ settings:
+ CPU: x86_64
+ DefaultValueInitialized: true
+ OS: Windows
+ data:
+ first:
+ Facebook: Win
+ second:
+ enabled: 0
+ settings:
+ CPU: AnyCPU
+ data:
+ first:
+ Facebook: Win64
+ second:
+ enabled: 0
+ settings:
+ CPU: AnyCPU
+ data:
+ first:
+ Samsung TV: SamsungTV
+ second:
+ enabled: 0
+ settings:
+ STV_MODEL: STANDARD_15
+ data:
+ first:
+ Standalone: Linux
+ second:
+ enabled: 0
+ settings:
+ CPU: x86
+ data:
+ first:
+ Standalone: Linux64
+ second:
+ enabled: 0
+ settings:
+ CPU: x86_64
+ data:
+ first:
+ Standalone: OSXIntel
+ second:
+ enabled: 0
+ settings:
+ CPU: AnyCPU
+ data:
+ first:
+ Standalone: OSXIntel64
+ second:
+ enabled: 0
+ settings:
+ CPU: AnyCPU
+ data:
+ first:
+ Standalone: Win
+ second:
+ enabled: 0
+ settings:
+ CPU: AnyCPU
+ data:
+ first:
+ Standalone: Win64
+ second:
+ enabled: 0
+ settings:
+ CPU: AnyCPU
+ data:
+ first:
+ Windows Store Apps: WindowsStoreApps
+ second:
+ enabled: 0
+ settings:
+ CPU: AnyCPU
+ DontProcess: False
+ PlaceholderPath:
+ SDK: AnySDK
+ ScriptingBackend: AnyScriptingBackend
+ data:
+ first:
+ iPhone: iOS
+ second:
+ enabled: 0
+ settings:
+ CompileFlags:
+ FrameworkDependencies:
+ data:
+ first:
+ tvOS: tvOS
+ second:
+ enabled: 0
+ settings:
+ CompileFlags:
+ FrameworkDependencies:
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/lib/sfw/win/x64/sfw_x64.dll b/lib/sfw/win/x64/sfw_x64.dll
new file mode 100644
index 000000000..be2245fc1
--- /dev/null
+++ b/lib/sfw/win/x64/sfw_x64.dll
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:4f8d586e00ddbe3cfa0cd2446bdd416a65e6c12ef31e7f451af14867b880c0dc
+size 182784
diff --git a/lib/sfw/win/x64/sfw_x64.dll.meta b/lib/sfw/win/x64/sfw_x64.dll.meta
new file mode 100644
index 000000000..d8980a7f1
--- /dev/null
+++ b/lib/sfw/win/x64/sfw_x64.dll.meta
@@ -0,0 +1,165 @@
+fileFormatVersion: 2
+guid: fe5abeadcbe591e4fa9107fbc02f3998
+timeCreated: 1493304330
+licenseType: Pro
+PluginImporter:
+ serializedVersion: 2
+ iconMap: {}
+ executionOrder: {}
+ isPreloaded: 0
+ isOverridable: 0
+ platformData:
+ data:
+ first:
+ '': Any
+ second:
+ enabled: 0
+ settings:
+ Exclude Editor: 0
+ Exclude Linux: 1
+ Exclude Linux64: 1
+ Exclude LinuxUniversal: 1
+ Exclude OSXIntel: 1
+ Exclude OSXIntel64: 1
+ Exclude OSXUniversal: 1
+ Exclude Win: 1
+ Exclude Win64: 1
+ data:
+ first:
+ '': Editor
+ second:
+ enabled: 0
+ settings:
+ CPU: AnyCPU
+ OS: Windows
+ data:
+ first:
+ Android: Android
+ second:
+ enabled: 0
+ settings:
+ CPU: ARMv7
+ data:
+ first:
+ Any:
+ second:
+ enabled: 0
+ settings:
+ Exclude Android: 1
+ Exclude Editor: 0
+ Exclude Linux: 1
+ Exclude Linux64: 1
+ Exclude LinuxUniversal: 1
+ Exclude OSXIntel: 1
+ Exclude OSXIntel64: 1
+ Exclude OSXUniversal: 1
+ Exclude SamsungTV: 1
+ Exclude Tizen: 1
+ Exclude WebGL: 1
+ Exclude Win: 1
+ Exclude Win64: 1
+ Exclude WindowsStoreApps: 1
+ Exclude iOS: 1
+ Exclude tvOS: 1
+ data:
+ first:
+ Editor: Editor
+ second:
+ enabled: 1
+ settings:
+ CPU: x86_64
+ DefaultValueInitialized: true
+ OS: Windows
+ data:
+ first:
+ Facebook: Win
+ second:
+ enabled: 0
+ settings:
+ CPU: AnyCPU
+ data:
+ first:
+ Facebook: Win64
+ second:
+ enabled: 0
+ settings:
+ CPU: AnyCPU
+ data:
+ first:
+ Samsung TV: SamsungTV
+ second:
+ enabled: 0
+ settings:
+ STV_MODEL: STANDARD_15
+ data:
+ first:
+ Standalone: Linux
+ second:
+ enabled: 0
+ settings:
+ CPU: x86
+ data:
+ first:
+ Standalone: Linux64
+ second:
+ enabled: 0
+ settings:
+ CPU: x86_64
+ data:
+ first:
+ Standalone: OSXIntel
+ second:
+ enabled: 0
+ settings:
+ CPU: AnyCPU
+ data:
+ first:
+ Standalone: OSXIntel64
+ second:
+ enabled: 0
+ settings:
+ CPU: AnyCPU
+ data:
+ first:
+ Standalone: Win
+ second:
+ enabled: 0
+ settings:
+ CPU: AnyCPU
+ data:
+ first:
+ Standalone: Win64
+ second:
+ enabled: 0
+ settings:
+ CPU: AnyCPU
+ data:
+ first:
+ Windows Store Apps: WindowsStoreApps
+ second:
+ enabled: 0
+ settings:
+ CPU: AnyCPU
+ DontProcess: False
+ PlaceholderPath:
+ SDK: AnySDK
+ ScriptingBackend: AnyScriptingBackend
+ data:
+ first:
+ iPhone: iOS
+ second:
+ enabled: 0
+ settings:
+ CompileFlags:
+ FrameworkDependencies:
+ data:
+ first:
+ tvOS: tvOS
+ second:
+ enabled: 0
+ settings:
+ CompileFlags:
+ FrameworkDependencies:
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/lib/sfw/win/x64/sfw_x64.pdb b/lib/sfw/win/x64/sfw_x64.pdb
new file mode 100644
index 000000000..1ffdeebf2
--- /dev/null
+++ b/lib/sfw/win/x64/sfw_x64.pdb
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:1c90bee7ba508dc622df48d50aa503e7d4df78f085781dba078fbc61c4a37e4a
+size 2149376
diff --git a/lib/sfw.net/win/x86/Debug/pthreadVC2.dll b/lib/sfw/win/x86/pthreadVC2.dll
similarity index 100%
rename from lib/sfw.net/win/x86/Debug/pthreadVC2.dll
rename to lib/sfw/win/x86/pthreadVC2.dll
diff --git a/lib/sfw/win/x86/pthreadVC2.dll.meta b/lib/sfw/win/x86/pthreadVC2.dll.meta
new file mode 100644
index 000000000..ee3f3dc0f
--- /dev/null
+++ b/lib/sfw/win/x86/pthreadVC2.dll.meta
@@ -0,0 +1,165 @@
+fileFormatVersion: 2
+guid: 151a1d946b98deb4b98445400983ba92
+timeCreated: 1493300307
+licenseType: Pro
+PluginImporter:
+ serializedVersion: 2
+ iconMap: {}
+ executionOrder: {}
+ isPreloaded: 0
+ isOverridable: 0
+ platformData:
+ data:
+ first:
+ '': Any
+ second:
+ enabled: 0
+ settings:
+ Exclude Editor: 0
+ Exclude Linux: 1
+ Exclude Linux64: 1
+ Exclude LinuxUniversal: 1
+ Exclude OSXIntel: 1
+ Exclude OSXIntel64: 1
+ Exclude OSXUniversal: 1
+ Exclude Win: 1
+ Exclude Win64: 1
+ data:
+ first:
+ '': Editor
+ second:
+ enabled: 0
+ settings:
+ CPU: x86
+ OS: Windows
+ data:
+ first:
+ Android: Android
+ second:
+ enabled: 0
+ settings:
+ CPU: ARMv7
+ data:
+ first:
+ Any:
+ second:
+ enabled: 0
+ settings:
+ Exclude Android: 1
+ Exclude Editor: 0
+ Exclude Linux: 1
+ Exclude Linux64: 1
+ Exclude LinuxUniversal: 1
+ Exclude OSXIntel: 1
+ Exclude OSXIntel64: 1
+ Exclude OSXUniversal: 1
+ Exclude SamsungTV: 1
+ Exclude Tizen: 1
+ Exclude WebGL: 1
+ Exclude Win: 1
+ Exclude Win64: 1
+ Exclude WindowsStoreApps: 1
+ Exclude iOS: 1
+ Exclude tvOS: 1
+ data:
+ first:
+ Editor: Editor
+ second:
+ enabled: 1
+ settings:
+ CPU: x86
+ DefaultValueInitialized: true
+ OS: Windows
+ data:
+ first:
+ Facebook: Win
+ second:
+ enabled: 0
+ settings:
+ CPU: AnyCPU
+ data:
+ first:
+ Facebook: Win64
+ second:
+ enabled: 0
+ settings:
+ CPU: AnyCPU
+ data:
+ first:
+ Samsung TV: SamsungTV
+ second:
+ enabled: 0
+ settings:
+ STV_MODEL: STANDARD_15
+ data:
+ first:
+ Standalone: Linux
+ second:
+ enabled: 0
+ settings:
+ CPU: x86
+ data:
+ first:
+ Standalone: Linux64
+ second:
+ enabled: 0
+ settings:
+ CPU: x86_64
+ data:
+ first:
+ Standalone: OSXIntel
+ second:
+ enabled: 0
+ settings:
+ CPU: AnyCPU
+ data:
+ first:
+ Standalone: OSXIntel64
+ second:
+ enabled: 0
+ settings:
+ CPU: AnyCPU
+ data:
+ first:
+ Standalone: Win
+ second:
+ enabled: 0
+ settings:
+ CPU: AnyCPU
+ data:
+ first:
+ Standalone: Win64
+ second:
+ enabled: 0
+ settings:
+ CPU: AnyCPU
+ data:
+ first:
+ Windows Store Apps: WindowsStoreApps
+ second:
+ enabled: 0
+ settings:
+ CPU: AnyCPU
+ DontProcess: False
+ PlaceholderPath:
+ SDK: AnySDK
+ ScriptingBackend: AnyScriptingBackend
+ data:
+ first:
+ iPhone: iOS
+ second:
+ enabled: 0
+ settings:
+ CompileFlags:
+ FrameworkDependencies:
+ data:
+ first:
+ tvOS: tvOS
+ second:
+ enabled: 0
+ settings:
+ CompileFlags:
+ FrameworkDependencies:
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/lib/sfw/win/x86/sfw_x86.dll b/lib/sfw/win/x86/sfw_x86.dll
new file mode 100644
index 000000000..89f9ff3a0
--- /dev/null
+++ b/lib/sfw/win/x86/sfw_x86.dll
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:843682e312df272a4222e2ba85f4feebfb0195524f101ef9f636f56ae0e0af21
+size 179200
diff --git a/lib/sfw/win/x86/sfw_x86.dll.meta b/lib/sfw/win/x86/sfw_x86.dll.meta
new file mode 100644
index 000000000..02ec3bd8c
--- /dev/null
+++ b/lib/sfw/win/x86/sfw_x86.dll.meta
@@ -0,0 +1,165 @@
+fileFormatVersion: 2
+guid: a83159a46d87d2a4f8cec651049b9231
+timeCreated: 1493304330
+licenseType: Pro
+PluginImporter:
+ serializedVersion: 2
+ iconMap: {}
+ executionOrder: {}
+ isPreloaded: 0
+ isOverridable: 0
+ platformData:
+ data:
+ first:
+ '': Any
+ second:
+ enabled: 0
+ settings:
+ Exclude Editor: 0
+ Exclude Linux: 1
+ Exclude Linux64: 1
+ Exclude LinuxUniversal: 1
+ Exclude OSXIntel: 1
+ Exclude OSXIntel64: 1
+ Exclude OSXUniversal: 1
+ Exclude Win: 1
+ Exclude Win64: 1
+ data:
+ first:
+ '': Editor
+ second:
+ enabled: 0
+ settings:
+ CPU: x86
+ OS: Windows
+ data:
+ first:
+ Android: Android
+ second:
+ enabled: 0
+ settings:
+ CPU: ARMv7
+ data:
+ first:
+ Any:
+ second:
+ enabled: 0
+ settings:
+ Exclude Android: 1
+ Exclude Editor: 0
+ Exclude Linux: 1
+ Exclude Linux64: 1
+ Exclude LinuxUniversal: 1
+ Exclude OSXIntel: 1
+ Exclude OSXIntel64: 1
+ Exclude OSXUniversal: 1
+ Exclude SamsungTV: 1
+ Exclude Tizen: 1
+ Exclude WebGL: 1
+ Exclude Win: 1
+ Exclude Win64: 1
+ Exclude WindowsStoreApps: 1
+ Exclude iOS: 1
+ Exclude tvOS: 1
+ data:
+ first:
+ Editor: Editor
+ second:
+ enabled: 1
+ settings:
+ CPU: x86
+ DefaultValueInitialized: true
+ OS: Windows
+ data:
+ first:
+ Facebook: Win
+ second:
+ enabled: 0
+ settings:
+ CPU: AnyCPU
+ data:
+ first:
+ Facebook: Win64
+ second:
+ enabled: 0
+ settings:
+ CPU: AnyCPU
+ data:
+ first:
+ Samsung TV: SamsungTV
+ second:
+ enabled: 0
+ settings:
+ STV_MODEL: STANDARD_15
+ data:
+ first:
+ Standalone: Linux
+ second:
+ enabled: 0
+ settings:
+ CPU: x86
+ data:
+ first:
+ Standalone: Linux64
+ second:
+ enabled: 0
+ settings:
+ CPU: x86_64
+ data:
+ first:
+ Standalone: OSXIntel
+ second:
+ enabled: 0
+ settings:
+ CPU: AnyCPU
+ data:
+ first:
+ Standalone: OSXIntel64
+ second:
+ enabled: 0
+ settings:
+ CPU: AnyCPU
+ data:
+ first:
+ Standalone: Win
+ second:
+ enabled: 0
+ settings:
+ CPU: AnyCPU
+ data:
+ first:
+ Standalone: Win64
+ second:
+ enabled: 0
+ settings:
+ CPU: AnyCPU
+ data:
+ first:
+ Windows Store Apps: WindowsStoreApps
+ second:
+ enabled: 0
+ settings:
+ CPU: AnyCPU
+ DontProcess: False
+ PlaceholderPath:
+ SDK: AnySDK
+ ScriptingBackend: AnyScriptingBackend
+ data:
+ first:
+ iPhone: iOS
+ second:
+ enabled: 0
+ settings:
+ CompileFlags:
+ FrameworkDependencies:
+ data:
+ first:
+ tvOS: tvOS
+ second:
+ enabled: 0
+ settings:
+ CompileFlags:
+ FrameworkDependencies:
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/lib/sfw/win/x86/sfw_x86.pdb b/lib/sfw/win/x86/sfw_x86.pdb
new file mode 100644
index 000000000..3092b0721
--- /dev/null
+++ b/lib/sfw/win/x86/sfw_x86.pdb
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:905d1919802d2d9af782d652baf620d2ec85ed1dea82a9d8b089230eb076b2ea
+size 2239488
diff --git a/nuget.config b/nuget.config
index 1a5bd9cf3..bad252e01 100644
--- a/nuget.config
+++ b/nuget.config
@@ -1,7 +1,7 @@
-
+
diff --git a/octorun/.env.template b/octorun/.env.template
new file mode 100644
index 000000000..a42e21c4a
--- /dev/null
+++ b/octorun/.env.template
@@ -0,0 +1,5 @@
+OCTOKIT_CLIENT_ID=
+OCTOKIT_CLIENT_SECRET=
+OCTOKIT_USER_AGENT=
+OCTORUN_USER=
+OCTORUN_TOKEN=
\ No newline at end of file
diff --git a/octorun/.gitignore b/octorun/.gitignore
new file mode 100644
index 000000000..ef4fcce9d
--- /dev/null
+++ b/octorun/.gitignore
@@ -0,0 +1,3 @@
+.env
+node_modules
+npm-debug.log
diff --git a/octorun/bin/octorun b/octorun/bin/octorun
new file mode 100644
index 000000000..b6623d43e
--- /dev/null
+++ b/octorun/bin/octorun
@@ -0,0 +1,3 @@
+#!/usr/bin/env node
+
+require('../src/bin/app.js');
diff --git a/octorun/bin/octorun-login b/octorun/bin/octorun-login
new file mode 100644
index 000000000..f74f2b860
--- /dev/null
+++ b/octorun/bin/octorun-login
@@ -0,0 +1,3 @@
+#!/usr/bin/env node
+
+require('../src/bin/app-login.js');
diff --git a/octorun/bin/octorun-meta b/octorun/bin/octorun-meta
new file mode 100644
index 000000000..1d2d3a7c9
--- /dev/null
+++ b/octorun/bin/octorun-meta
@@ -0,0 +1,3 @@
+#!/usr/bin/env node
+
+require('../src/bin/app-meta.js');
diff --git a/octorun/bin/octorun-organizations b/octorun/bin/octorun-organizations
new file mode 100644
index 000000000..bf6c9f558
--- /dev/null
+++ b/octorun/bin/octorun-organizations
@@ -0,0 +1,3 @@
+#!/usr/bin/env node
+
+require('../src/bin/app-organizations.js');
diff --git a/octorun/bin/octorun-publish b/octorun/bin/octorun-publish
new file mode 100644
index 000000000..c95bdbb44
--- /dev/null
+++ b/octorun/bin/octorun-publish
@@ -0,0 +1,3 @@
+#!/usr/bin/env node
+
+require('../src/bin/app-publish.js');
diff --git a/octorun/bin/octorun-token b/octorun/bin/octorun-token
new file mode 100644
index 000000000..3ea7b1500
--- /dev/null
+++ b/octorun/bin/octorun-token
@@ -0,0 +1,3 @@
+#!/usr/bin/env node
+
+require('../src/bin/app-token.js');
diff --git a/octorun/bin/octorun-usage b/octorun/bin/octorun-usage
new file mode 100644
index 000000000..8366ae34e
--- /dev/null
+++ b/octorun/bin/octorun-usage
@@ -0,0 +1,3 @@
+#!/usr/bin/env node
+
+require('../src/bin/app-usage.js');
diff --git a/octorun/bin/octorun-validate b/octorun/bin/octorun-validate
new file mode 100644
index 000000000..e81615852
--- /dev/null
+++ b/octorun/bin/octorun-validate
@@ -0,0 +1,3 @@
+#!/usr/bin/env node
+
+require('../src/bin/app-validate.js');
diff --git a/octorun/node_modules/commander/CHANGELOG.md b/octorun/node_modules/commander/CHANGELOG.md
new file mode 100644
index 000000000..29f0707c6
--- /dev/null
+++ b/octorun/node_modules/commander/CHANGELOG.md
@@ -0,0 +1,350 @@
+
+2.14.1 / 2018-02-07
+==================
+
+ * Fix typing of help function
+
+2.14.0 / 2018-02-05
+==================
+
+ * only register the option:version event once
+ * Fixes issue #727: Passing empty string for option on command is set to undefined
+ * enable eqeqeq rule
+ * resolves #754 add linter configuration to project
+ * resolves #560 respect custom name for version option
+ * document how to override the version flag
+ * document using options per command
+
+2.13.0 / 2018-01-09
+==================
+
+ * Do not print default for --no-
+ * remove trailing spaces in command help
+ * Update CI's Node.js to LTS and latest version
+ * typedefs: Command and Option types added to commander namespace
+
+2.12.2 / 2017-11-28
+==================
+
+ * fix: typings are not shipped
+
+2.12.1 / 2017-11-23
+==================
+
+ * Move @types/node to dev dependency
+
+2.12.0 / 2017-11-22
+==================
+
+ * add attributeName() method to Option objects
+ * Documentation updated for options with --no prefix
+ * typings: `outputHelp` takes a string as the first parameter
+ * typings: use overloads
+ * feat(typings): update to match js api
+ * Print default value in option help
+ * Fix translation error
+ * Fail when using same command and alias (#491)
+ * feat(typings): add help callback
+ * fix bug when description is add after command with options (#662)
+ * Format js code
+ * Rename History.md to CHANGELOG.md (#668)
+ * feat(typings): add typings to support TypeScript (#646)
+ * use current node
+
+2.11.0 / 2017-07-03
+==================
+
+ * Fix help section order and padding (#652)
+ * feature: support for signals to subcommands (#632)
+ * Fixed #37, --help should not display first (#447)
+ * Fix translation errors. (#570)
+ * Add package-lock.json
+ * Remove engines
+ * Upgrade package version
+ * Prefix events to prevent conflicts between commands and options (#494)
+ * Removing dependency on graceful-readlink
+ * Support setting name in #name function and make it chainable
+ * Add .vscode directory to .gitignore (Visual Studio Code metadata)
+ * Updated link to ruby commander in readme files
+
+2.10.0 / 2017-06-19
+==================
+
+ * Update .travis.yml. drop support for older node.js versions.
+ * Fix require arguments in README.md
+ * On SemVer you do not start from 0.0.1
+ * Add missing semi colon in readme
+ * Add save param to npm install
+ * node v6 travis test
+ * Update Readme_zh-CN.md
+ * Allow literal '--' to be passed-through as an argument
+ * Test subcommand alias help
+ * link build badge to master branch
+ * Support the alias of Git style sub-command
+ * added keyword commander for better search result on npm
+ * Fix Sub-Subcommands
+ * test node.js stable
+ * Fixes TypeError when a command has an option called `--description`
+ * Update README.md to make it beginner friendly and elaborate on the difference between angled and square brackets.
+ * Add chinese Readme file
+
+2.9.0 / 2015-10-13
+==================
+
+ * Add option `isDefault` to set default subcommand #415 @Qix-
+ * Add callback to allow filtering or post-processing of help text #434 @djulien
+ * Fix `undefined` text in help information close #414 #416 @zhiyelee
+
+2.8.1 / 2015-04-22
+==================
+
+ * Back out `support multiline description` Close #396 #397
+
+2.8.0 / 2015-04-07
+==================
+
+ * Add `process.execArg` support, execution args like `--harmony` will be passed to sub-commands #387 @DigitalIO @zhiyelee
+ * Fix bug in Git-style sub-commands #372 @zhiyelee
+ * Allow commands to be hidden from help #383 @tonylukasavage
+ * When git-style sub-commands are in use, yet none are called, display help #382 @claylo
+ * Add ability to specify arguments syntax for top-level command #258 @rrthomas
+ * Support multiline descriptions #208 @zxqfox
+
+2.7.1 / 2015-03-11
+==================
+
+ * Revert #347 (fix collisions when option and first arg have same name) which causes a bug in #367.
+
+2.7.0 / 2015-03-09
+==================
+
+ * Fix git-style bug when installed globally. Close #335 #349 @zhiyelee
+ * Fix collisions when option and first arg have same name. Close #346 #347 @tonylukasavage
+ * Add support for camelCase on `opts()`. Close #353 @nkzawa
+ * Add node.js 0.12 and io.js to travis.yml
+ * Allow RegEx options. #337 @palanik
+ * Fixes exit code when sub-command failing. Close #260 #332 @pirelenito
+ * git-style `bin` files in $PATH make sense. Close #196 #327 @zhiyelee
+
+2.6.0 / 2014-12-30
+==================
+
+ * added `Command#allowUnknownOption` method. Close #138 #318 @doozr @zhiyelee
+ * Add application description to the help msg. Close #112 @dalssoft
+
+2.5.1 / 2014-12-15
+==================
+
+ * fixed two bugs incurred by variadic arguments. Close #291 @Quentin01 #302 @zhiyelee
+
+2.5.0 / 2014-10-24
+==================
+
+ * add support for variadic arguments. Closes #277 @whitlockjc
+
+2.4.0 / 2014-10-17
+==================
+
+ * fixed a bug on executing the coercion function of subcommands option. Closes #270
+ * added `Command.prototype.name` to retrieve command name. Closes #264 #266 @tonylukasavage
+ * added `Command.prototype.opts` to retrieve all the options as a simple object of key-value pairs. Closes #262 @tonylukasavage
+ * fixed a bug on subcommand name. Closes #248 @jonathandelgado
+ * fixed function normalize doesn’t honor option terminator. Closes #216 @abbr
+
+2.3.0 / 2014-07-16
+==================
+
+ * add command alias'. Closes PR #210
+ * fix: Typos. Closes #99
+ * fix: Unused fs module. Closes #217
+
+2.2.0 / 2014-03-29
+==================
+
+ * add passing of previous option value
+ * fix: support subcommands on windows. Closes #142
+ * Now the defaultValue passed as the second argument of the coercion function.
+
+2.1.0 / 2013-11-21
+==================
+
+ * add: allow cflag style option params, unit test, fixes #174
+
+2.0.0 / 2013-07-18
+==================
+
+ * remove input methods (.prompt, .confirm, etc)
+
+1.3.2 / 2013-07-18
+==================
+
+ * add support for sub-commands to co-exist with the original command
+
+1.3.1 / 2013-07-18
+==================
+
+ * add quick .runningCommand hack so you can opt-out of other logic when running a sub command
+
+1.3.0 / 2013-07-09
+==================
+
+ * add EACCES error handling
+ * fix sub-command --help
+
+1.2.0 / 2013-06-13
+==================
+
+ * allow "-" hyphen as an option argument
+ * support for RegExp coercion
+
+1.1.1 / 2012-11-20
+==================
+
+ * add more sub-command padding
+ * fix .usage() when args are present. Closes #106
+
+1.1.0 / 2012-11-16
+==================
+
+ * add git-style executable subcommand support. Closes #94
+
+1.0.5 / 2012-10-09
+==================
+
+ * fix `--name` clobbering. Closes #92
+ * fix examples/help. Closes #89
+
+1.0.4 / 2012-09-03
+==================
+
+ * add `outputHelp()` method.
+
+1.0.3 / 2012-08-30
+==================
+
+ * remove invalid .version() defaulting
+
+1.0.2 / 2012-08-24
+==================
+
+ * add `--foo=bar` support [arv]
+ * fix password on node 0.8.8. Make backward compatible with 0.6 [focusaurus]
+
+1.0.1 / 2012-08-03
+==================
+
+ * fix issue #56
+ * fix tty.setRawMode(mode) was moved to tty.ReadStream#setRawMode() (i.e. process.stdin.setRawMode())
+
+1.0.0 / 2012-07-05
+==================
+
+ * add support for optional option descriptions
+ * add defaulting of `.version()` to package.json's version
+
+0.6.1 / 2012-06-01
+==================
+
+ * Added: append (yes or no) on confirmation
+ * Added: allow node.js v0.7.x
+
+0.6.0 / 2012-04-10
+==================
+
+ * Added `.prompt(obj, callback)` support. Closes #49
+ * Added default support to .choose(). Closes #41
+ * Fixed the choice example
+
+0.5.1 / 2011-12-20
+==================
+
+ * Fixed `password()` for recent nodes. Closes #36
+
+0.5.0 / 2011-12-04
+==================
+
+ * Added sub-command option support [itay]
+
+0.4.3 / 2011-12-04
+==================
+
+ * Fixed custom help ordering. Closes #32
+
+0.4.2 / 2011-11-24
+==================
+
+ * Added travis support
+ * Fixed: line-buffered input automatically trimmed. Closes #31
+
+0.4.1 / 2011-11-18
+==================
+
+ * Removed listening for "close" on --help
+
+0.4.0 / 2011-11-15
+==================
+
+ * Added support for `--`. Closes #24
+
+0.3.3 / 2011-11-14
+==================
+
+ * Fixed: wait for close event when writing help info [Jerry Hamlet]
+
+0.3.2 / 2011-11-01
+==================
+
+ * Fixed long flag definitions with values [felixge]
+
+0.3.1 / 2011-10-31
+==================
+
+ * Changed `--version` short flag to `-V` from `-v`
+ * Changed `.version()` so it's configurable [felixge]
+
+0.3.0 / 2011-10-31
+==================
+
+ * Added support for long flags only. Closes #18
+
+0.2.1 / 2011-10-24
+==================
+
+ * "node": ">= 0.4.x < 0.7.0". Closes #20
+
+0.2.0 / 2011-09-26
+==================
+
+ * Allow for defaults that are not just boolean. Default peassignment only occurs for --no-*, optional, and required arguments. [Jim Isaacs]
+
+0.1.0 / 2011-08-24
+==================
+
+ * Added support for custom `--help` output
+
+0.0.5 / 2011-08-18
+==================
+
+ * Changed: when the user enters nothing prompt for password again
+ * Fixed issue with passwords beginning with numbers [NuckChorris]
+
+0.0.4 / 2011-08-15
+==================
+
+ * Fixed `Commander#args`
+
+0.0.3 / 2011-08-15
+==================
+
+ * Added default option value support
+
+0.0.2 / 2011-08-15
+==================
+
+ * Added mask support to `Command#password(str[, mask], fn)`
+ * Added `Command#password(str, fn)`
+
+0.0.1 / 2010-01-03
+==================
+
+ * Initial release
diff --git a/octorun/node_modules/commander/LICENSE b/octorun/node_modules/commander/LICENSE
new file mode 100644
index 000000000..10f997ab1
--- /dev/null
+++ b/octorun/node_modules/commander/LICENSE
@@ -0,0 +1,22 @@
+(The MIT License)
+
+Copyright (c) 2011 TJ Holowaychuk
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+'Software'), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/octorun/node_modules/commander/Readme.md b/octorun/node_modules/commander/Readme.md
new file mode 100644
index 000000000..6a21b9009
--- /dev/null
+++ b/octorun/node_modules/commander/Readme.md
@@ -0,0 +1,408 @@
+# Commander.js
+
+
+[](http://travis-ci.org/tj/commander.js)
+[](https://www.npmjs.org/package/commander)
+[](https://www.npmjs.org/package/commander)
+[](https://gitter.im/tj/commander.js?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
+
+ The complete solution for [node.js](http://nodejs.org) command-line interfaces, inspired by Ruby's [commander](https://github.com/commander-rb/commander).
+ [API documentation](http://tj.github.com/commander.js/)
+
+
+## Installation
+
+ $ npm install commander --save
+
+## Option parsing
+
+Options with commander are defined with the `.option()` method, also serving as documentation for the options. The example below parses args and options from `process.argv`, leaving remaining args as the `program.args` array which were not consumed by options.
+
+```js
+#!/usr/bin/env node
+
+/**
+ * Module dependencies.
+ */
+
+var program = require('commander');
+
+program
+ .version('0.1.0')
+ .option('-p, --peppers', 'Add peppers')
+ .option('-P, --pineapple', 'Add pineapple')
+ .option('-b, --bbq-sauce', 'Add bbq sauce')
+ .option('-c, --cheese [type]', 'Add the specified type of cheese [marble]', 'marble')
+ .parse(process.argv);
+
+console.log('you ordered a pizza with:');
+if (program.peppers) console.log(' - peppers');
+if (program.pineapple) console.log(' - pineapple');
+if (program.bbqSauce) console.log(' - bbq');
+console.log(' - %s cheese', program.cheese);
+```
+
+Short flags may be passed as a single arg, for example `-abc` is equivalent to `-a -b -c`. Multi-word options such as "--template-engine" are camel-cased, becoming `program.templateEngine` etc.
+
+Note that multi-word options starting with `--no` prefix negate the boolean value of the following word. For example, `--no-sauce` sets the value of `program.sauce` to false.
+
+```js
+#!/usr/bin/env node
+
+/**
+ * Module dependencies.
+ */
+
+var program = require('commander');
+
+program
+ .option('--no-sauce', 'Remove sauce')
+ .parse(process.argv);
+
+console.log('you ordered a pizza');
+if (program.sauce) console.log(' with sauce');
+else console.log(' without sauce');
+```
+
+## Version option
+
+Calling the `version` implicitly adds the `-V` and `--version` options to the command.
+When either of these options is present, the command prints the version number and exits.
+
+ $ ./examples/pizza -V
+ 0.0.1
+
+If you want your program to respond to the `-v` option instead of the `-V` option, simply pass custom flags to the `version` method using the same syntax as the `option` method.
+
+```js
+program
+ .version('0.0.1', '-v, --version')
+```
+
+The version flags can be named anything, but the long option is required.
+
+## Command-specific options
+
+You can attach options to a command.
+
+```js
+#!/usr/bin/env node
+
+var program = require('commander');
+
+program
+ .command('rm ')
+ .option('-r, --recursive', 'Remove recursively')
+ .action(function (dir, cmd) {
+ console.log('remove ' + dir + (cmd.recursive ? ' recursively' : ''))
+ })
+
+program.parse(process.argv)
+```
+
+A command's options are validated when the command is used. Any unknown options will be reported as an error. However, if an action-based command does not define an action, then the options are not validated.
+
+## Coercion
+
+```js
+function range(val) {
+ return val.split('..').map(Number);
+}
+
+function list(val) {
+ return val.split(',');
+}
+
+function collect(val, memo) {
+ memo.push(val);
+ return memo;
+}
+
+function increaseVerbosity(v, total) {
+ return total + 1;
+}
+
+program
+ .version('0.1.0')
+ .usage('[options] ')
+ .option('-i, --integer ', 'An integer argument', parseInt)
+ .option('-f, --float ', 'A float argument', parseFloat)
+ .option('-r, --range ..', 'A range', range)
+ .option('-l, --list ', 'A list', list)
+ .option('-o, --optional [value]', 'An optional value')
+ .option('-c, --collect [value]', 'A repeatable value', collect, [])
+ .option('-v, --verbose', 'A value that can be increased', increaseVerbosity, 0)
+ .parse(process.argv);
+
+console.log(' int: %j', program.integer);
+console.log(' float: %j', program.float);
+console.log(' optional: %j', program.optional);
+program.range = program.range || [];
+console.log(' range: %j..%j', program.range[0], program.range[1]);
+console.log(' list: %j', program.list);
+console.log(' collect: %j', program.collect);
+console.log(' verbosity: %j', program.verbose);
+console.log(' args: %j', program.args);
+```
+
+## Regular Expression
+```js
+program
+ .version('0.1.0')
+ .option('-s --size ', 'Pizza size', /^(large|medium|small)$/i, 'medium')
+ .option('-d --drink [drink]', 'Drink', /^(coke|pepsi|izze)$/i)
+ .parse(process.argv);
+
+console.log(' size: %j', program.size);
+console.log(' drink: %j', program.drink);
+```
+
+## Variadic arguments
+
+ The last argument of a command can be variadic, and only the last argument. To make an argument variadic you have to
+ append `...` to the argument name. Here is an example:
+
+```js
+#!/usr/bin/env node
+
+/**
+ * Module dependencies.
+ */
+
+var program = require('commander');
+
+program
+ .version('0.1.0')
+ .command('rmdir [otherDirs...]')
+ .action(function (dir, otherDirs) {
+ console.log('rmdir %s', dir);
+ if (otherDirs) {
+ otherDirs.forEach(function (oDir) {
+ console.log('rmdir %s', oDir);
+ });
+ }
+ });
+
+program.parse(process.argv);
+```
+
+ An `Array` is used for the value of a variadic argument. This applies to `program.args` as well as the argument passed
+ to your action as demonstrated above.
+
+## Specify the argument syntax
+
+```js
+#!/usr/bin/env node
+
+var program = require('commander');
+
+program
+ .version('0.1.0')
+ .arguments(' [env]')
+ .action(function (cmd, env) {
+ cmdValue = cmd;
+ envValue = env;
+ });
+
+program.parse(process.argv);
+
+if (typeof cmdValue === 'undefined') {
+ console.error('no command given!');
+ process.exit(1);
+}
+console.log('command:', cmdValue);
+console.log('environment:', envValue || "no environment given");
+```
+Angled brackets (e.g. ``) indicate required input. Square brackets (e.g. `[env]`) indicate optional input.
+
+## Git-style sub-commands
+
+```js
+// file: ./examples/pm
+var program = require('commander');
+
+program
+ .version('0.1.0')
+ .command('install [name]', 'install one or more packages')
+ .command('search [query]', 'search with optional query')
+ .command('list', 'list packages installed', {isDefault: true})
+ .parse(process.argv);
+```
+
+When `.command()` is invoked with a description argument, no `.action(callback)` should be called to handle sub-commands, otherwise there will be an error. This tells commander that you're going to use separate executables for sub-commands, much like `git(1)` and other popular tools.
+The commander will try to search the executables in the directory of the entry script (like `./examples/pm`) with the name `program-command`, like `pm-install`, `pm-search`.
+
+Options can be passed with the call to `.command()`. Specifying `true` for `opts.noHelp` will remove the option from the generated help output. Specifying `true` for `opts.isDefault` will run the subcommand if no other subcommand is specified.
+
+If the program is designed to be installed globally, make sure the executables have proper modes, like `755`.
+
+### `--harmony`
+
+You can enable `--harmony` option in two ways:
+* Use `#! /usr/bin/env node --harmony` in the sub-commands scripts. Note some os version don’t support this pattern.
+* Use the `--harmony` option when call the command, like `node --harmony examples/pm publish`. The `--harmony` option will be preserved when spawning sub-command process.
+
+## Automated --help
+
+ The help information is auto-generated based on the information commander already knows about your program, so the following `--help` info is for free:
+
+```
+ $ ./examples/pizza --help
+
+ Usage: pizza [options]
+
+ An application for pizzas ordering
+
+ Options:
+
+ -h, --help output usage information
+ -V, --version output the version number
+ -p, --peppers Add peppers
+ -P, --pineapple Add pineapple
+ -b, --bbq Add bbq sauce
+ -c, --cheese Add the specified type of cheese [marble]
+ -C, --no-cheese You do not want any cheese
+
+```
+
+## Custom help
+
+ You can display arbitrary `-h, --help` information
+ by listening for "--help". Commander will automatically
+ exit once you are done so that the remainder of your program
+ does not execute causing undesired behaviours, for example
+ in the following executable "stuff" will not output when
+ `--help` is used.
+
+```js
+#!/usr/bin/env node
+
+/**
+ * Module dependencies.
+ */
+
+var program = require('commander');
+
+program
+ .version('0.1.0')
+ .option('-f, --foo', 'enable some foo')
+ .option('-b, --bar', 'enable some bar')
+ .option('-B, --baz', 'enable some baz');
+
+// must be before .parse() since
+// node's emit() is immediate
+
+program.on('--help', function(){
+ console.log(' Examples:');
+ console.log('');
+ console.log(' $ custom-help --help');
+ console.log(' $ custom-help -h');
+ console.log('');
+});
+
+program.parse(process.argv);
+
+console.log('stuff');
+```
+
+Yields the following help output when `node script-name.js -h` or `node script-name.js --help` are run:
+
+```
+
+Usage: custom-help [options]
+
+Options:
+
+ -h, --help output usage information
+ -V, --version output the version number
+ -f, --foo enable some foo
+ -b, --bar enable some bar
+ -B, --baz enable some baz
+
+Examples:
+
+ $ custom-help --help
+ $ custom-help -h
+
+```
+
+## .outputHelp(cb)
+
+Output help information without exiting.
+Optional callback cb allows post-processing of help text before it is displayed.
+
+If you want to display help by default (e.g. if no command was provided), you can use something like:
+
+```js
+var program = require('commander');
+var colors = require('colors');
+
+program
+ .version('0.1.0')
+ .command('getstream [url]', 'get stream URL')
+ .parse(process.argv);
+
+if (!process.argv.slice(2).length) {
+ program.outputHelp(make_red);
+}
+
+function make_red(txt) {
+ return colors.red(txt); //display the help text in red on the console
+}
+```
+
+## .help(cb)
+
+ Output help information and exit immediately.
+ Optional callback cb allows post-processing of help text before it is displayed.
+
+## Examples
+
+```js
+var program = require('commander');
+
+program
+ .version('0.1.0')
+ .option('-C, --chdir ', 'change the working directory')
+ .option('-c, --config ', 'set config path. defaults to ./deploy.conf')
+ .option('-T, --no-tests', 'ignore test hook');
+
+program
+ .command('setup [env]')
+ .description('run setup commands for all envs')
+ .option("-s, --setup_mode [mode]", "Which setup mode to use")
+ .action(function(env, options){
+ var mode = options.setup_mode || "normal";
+ env = env || 'all';
+ console.log('setup for %s env(s) with %s mode', env, mode);
+ });
+
+program
+ .command('exec ')
+ .alias('ex')
+ .description('execute the given remote cmd')
+ .option("-e, --exec_mode ", "Which exec mode to use")
+ .action(function(cmd, options){
+ console.log('exec "%s" using %s mode', cmd, options.exec_mode);
+ }).on('--help', function() {
+ console.log(' Examples:');
+ console.log();
+ console.log(' $ deploy exec sequential');
+ console.log(' $ deploy exec async');
+ console.log();
+ });
+
+program
+ .command('*')
+ .action(function(env){
+ console.log('deploying "%s"', env);
+ });
+
+program.parse(process.argv);
+```
+
+More Demos can be found in the [examples](https://github.com/tj/commander.js/tree/master/examples) directory.
+
+## License
+
+MIT
diff --git a/octorun/node_modules/commander/index.js b/octorun/node_modules/commander/index.js
new file mode 100644
index 000000000..c467b10f7
--- /dev/null
+++ b/octorun/node_modules/commander/index.js
@@ -0,0 +1,1157 @@
+/**
+ * Module dependencies.
+ */
+
+var EventEmitter = require('events').EventEmitter;
+var spawn = require('child_process').spawn;
+var path = require('path');
+var dirname = path.dirname;
+var basename = path.basename;
+var fs = require('fs');
+
+/**
+ * Inherit `Command` from `EventEmitter.prototype`.
+ */
+
+require('util').inherits(Command, EventEmitter);
+
+/**
+ * Expose the root command.
+ */
+
+exports = module.exports = new Command();
+
+/**
+ * Expose `Command`.
+ */
+
+exports.Command = Command;
+
+/**
+ * Expose `Option`.
+ */
+
+exports.Option = Option;
+
+/**
+ * Initialize a new `Option` with the given `flags` and `description`.
+ *
+ * @param {String} flags
+ * @param {String} description
+ * @api public
+ */
+
+function Option(flags, description) {
+ this.flags = flags;
+ this.required = ~flags.indexOf('<');
+ this.optional = ~flags.indexOf('[');
+ this.bool = !~flags.indexOf('-no-');
+ flags = flags.split(/[ ,|]+/);
+ if (flags.length > 1 && !/^[[<]/.test(flags[1])) this.short = flags.shift();
+ this.long = flags.shift();
+ this.description = description || '';
+}
+
+/**
+ * Return option name.
+ *
+ * @return {String}
+ * @api private
+ */
+
+Option.prototype.name = function() {
+ return this.long
+ .replace('--', '')
+ .replace('no-', '');
+};
+
+/**
+ * Return option name, in a camelcase format that can be used
+ * as a object attribute key.
+ *
+ * @return {String}
+ * @api private
+ */
+
+Option.prototype.attributeName = function() {
+ return camelcase(this.name());
+};
+
+/**
+ * Check if `arg` matches the short or long flag.
+ *
+ * @param {String} arg
+ * @return {Boolean}
+ * @api private
+ */
+
+Option.prototype.is = function(arg) {
+ return this.short === arg || this.long === arg;
+};
+
+/**
+ * Initialize a new `Command`.
+ *
+ * @param {String} name
+ * @api public
+ */
+
+function Command(name) {
+ this.commands = [];
+ this.options = [];
+ this._execs = {};
+ this._allowUnknownOption = false;
+ this._args = [];
+ this._name = name || '';
+}
+
+/**
+ * Add command `name`.
+ *
+ * The `.action()` callback is invoked when the
+ * command `name` is specified via __ARGV__,
+ * and the remaining arguments are applied to the
+ * function for access.
+ *
+ * When the `name` is "*" an un-matched command
+ * will be passed as the first arg, followed by
+ * the rest of __ARGV__ remaining.
+ *
+ * Examples:
+ *
+ * program
+ * .version('0.0.1')
+ * .option('-C, --chdir ', 'change the working directory')
+ * .option('-c, --config ', 'set config path. defaults to ./deploy.conf')
+ * .option('-T, --no-tests', 'ignore test hook')
+ *
+ * program
+ * .command('setup')
+ * .description('run remote setup commands')
+ * .action(function() {
+ * console.log('setup');
+ * });
+ *
+ * program
+ * .command('exec ')
+ * .description('run the given remote command')
+ * .action(function(cmd) {
+ * console.log('exec "%s"', cmd);
+ * });
+ *
+ * program
+ * .command('teardown [otherDirs...]')
+ * .description('run teardown commands')
+ * .action(function(dir, otherDirs) {
+ * console.log('dir "%s"', dir);
+ * if (otherDirs) {
+ * otherDirs.forEach(function (oDir) {
+ * console.log('dir "%s"', oDir);
+ * });
+ * }
+ * });
+ *
+ * program
+ * .command('*')
+ * .description('deploy the given env')
+ * .action(function(env) {
+ * console.log('deploying "%s"', env);
+ * });
+ *
+ * program.parse(process.argv);
+ *
+ * @param {String} name
+ * @param {String} [desc] for git-style sub-commands
+ * @return {Command} the new command
+ * @api public
+ */
+
+Command.prototype.command = function(name, desc, opts) {
+ if (typeof desc === 'object' && desc !== null) {
+ opts = desc;
+ desc = null;
+ }
+ opts = opts || {};
+ var args = name.split(/ +/);
+ var cmd = new Command(args.shift());
+
+ if (desc) {
+ cmd.description(desc);
+ this.executables = true;
+ this._execs[cmd._name] = true;
+ if (opts.isDefault) this.defaultExecutable = cmd._name;
+ }
+ cmd._noHelp = !!opts.noHelp;
+ this.commands.push(cmd);
+ cmd.parseExpectedArgs(args);
+ cmd.parent = this;
+
+ if (desc) return this;
+ return cmd;
+};
+
+/**
+ * Define argument syntax for the top-level command.
+ *
+ * @api public
+ */
+
+Command.prototype.arguments = function(desc) {
+ return this.parseExpectedArgs(desc.split(/ +/));
+};
+
+/**
+ * Add an implicit `help [cmd]` subcommand
+ * which invokes `--help` for the given command.
+ *
+ * @api private
+ */
+
+Command.prototype.addImplicitHelpCommand = function() {
+ this.command('help [cmd]', 'display help for [cmd]');
+};
+
+/**
+ * Parse expected `args`.
+ *
+ * For example `["[type]"]` becomes `[{ required: false, name: 'type' }]`.
+ *
+ * @param {Array} args
+ * @return {Command} for chaining
+ * @api public
+ */
+
+Command.prototype.parseExpectedArgs = function(args) {
+ if (!args.length) return;
+ var self = this;
+ args.forEach(function(arg) {
+ var argDetails = {
+ required: false,
+ name: '',
+ variadic: false
+ };
+
+ switch (arg[0]) {
+ case '<':
+ argDetails.required = true;
+ argDetails.name = arg.slice(1, -1);
+ break;
+ case '[':
+ argDetails.name = arg.slice(1, -1);
+ break;
+ }
+
+ if (argDetails.name.length > 3 && argDetails.name.slice(-3) === '...') {
+ argDetails.variadic = true;
+ argDetails.name = argDetails.name.slice(0, -3);
+ }
+ if (argDetails.name) {
+ self._args.push(argDetails);
+ }
+ });
+ return this;
+};
+
+/**
+ * Register callback `fn` for the command.
+ *
+ * Examples:
+ *
+ * program
+ * .command('help')
+ * .description('display verbose help')
+ * .action(function() {
+ * // output help here
+ * });
+ *
+ * @param {Function} fn
+ * @return {Command} for chaining
+ * @api public
+ */
+
+Command.prototype.action = function(fn) {
+ var self = this;
+ var listener = function(args, unknown) {
+ // Parse any so-far unknown options
+ args = args || [];
+ unknown = unknown || [];
+
+ var parsed = self.parseOptions(unknown);
+
+ // Output help if necessary
+ outputHelpIfNecessary(self, parsed.unknown);
+
+ // If there are still any unknown options, then we simply
+ // die, unless someone asked for help, in which case we give it
+ // to them, and then we die.
+ if (parsed.unknown.length > 0) {
+ self.unknownOption(parsed.unknown[0]);
+ }
+
+ // Leftover arguments need to be pushed back. Fixes issue #56
+ if (parsed.args.length) args = parsed.args.concat(args);
+
+ self._args.forEach(function(arg, i) {
+ if (arg.required && args[i] == null) {
+ self.missingArgument(arg.name);
+ } else if (arg.variadic) {
+ if (i !== self._args.length - 1) {
+ self.variadicArgNotLast(arg.name);
+ }
+
+ args[i] = args.splice(i);
+ }
+ });
+
+ // Always append ourselves to the end of the arguments,
+ // to make sure we match the number of arguments the user
+ // expects
+ if (self._args.length) {
+ args[self._args.length] = self;
+ } else {
+ args.push(self);
+ }
+
+ fn.apply(self, args);
+ };
+ var parent = this.parent || this;
+ var name = parent === this ? '*' : this._name;
+ parent.on('command:' + name, listener);
+ if (this._alias) parent.on('command:' + this._alias, listener);
+ return this;
+};
+
+/**
+ * Define option with `flags`, `description` and optional
+ * coercion `fn`.
+ *
+ * The `flags` string should contain both the short and long flags,
+ * separated by comma, a pipe or space. The following are all valid
+ * all will output this way when `--help` is used.
+ *
+ * "-p, --pepper"
+ * "-p|--pepper"
+ * "-p --pepper"
+ *
+ * Examples:
+ *
+ * // simple boolean defaulting to false
+ * program.option('-p, --pepper', 'add pepper');
+ *
+ * --pepper
+ * program.pepper
+ * // => Boolean
+ *
+ * // simple boolean defaulting to true
+ * program.option('-C, --no-cheese', 'remove cheese');
+ *
+ * program.cheese
+ * // => true
+ *
+ * --no-cheese
+ * program.cheese
+ * // => false
+ *
+ * // required argument
+ * program.option('-C, --chdir ', 'change the working directory');
+ *
+ * --chdir /tmp
+ * program.chdir
+ * // => "/tmp"
+ *
+ * // optional argument
+ * program.option('-c, --cheese [type]', 'add cheese [marble]');
+ *
+ * @param {String} flags
+ * @param {String} description
+ * @param {Function|*} [fn] or default
+ * @param {*} [defaultValue]
+ * @return {Command} for chaining
+ * @api public
+ */
+
+Command.prototype.option = function(flags, description, fn, defaultValue) {
+ var self = this,
+ option = new Option(flags, description),
+ oname = option.name(),
+ name = option.attributeName();
+
+ // default as 3rd arg
+ if (typeof fn !== 'function') {
+ if (fn instanceof RegExp) {
+ var regex = fn;
+ fn = function(val, def) {
+ var m = regex.exec(val);
+ return m ? m[0] : def;
+ };
+ } else {
+ defaultValue = fn;
+ fn = null;
+ }
+ }
+
+ // preassign default value only for --no-*, [optional], or
+ if (!option.bool || option.optional || option.required) {
+ // when --no-* we make sure default is true
+ if (!option.bool) defaultValue = true;
+ // preassign only if we have a default
+ if (defaultValue !== undefined) {
+ self[name] = defaultValue;
+ option.defaultValue = defaultValue;
+ }
+ }
+
+ // register the option
+ this.options.push(option);
+
+ // when it's passed assign the value
+ // and conditionally invoke the callback
+ this.on('option:' + oname, function(val) {
+ // coercion
+ if (val !== null && fn) {
+ val = fn(val, self[name] === undefined ? defaultValue : self[name]);
+ }
+
+ // unassigned or bool
+ if (typeof self[name] === 'boolean' || typeof self[name] === 'undefined') {
+ // if no value, bool true, and we have a default, then use it!
+ if (val == null) {
+ self[name] = option.bool
+ ? defaultValue || true
+ : false;
+ } else {
+ self[name] = val;
+ }
+ } else if (val !== null) {
+ // reassign
+ self[name] = val;
+ }
+ });
+
+ return this;
+};
+
+/**
+ * Allow unknown options on the command line.
+ *
+ * @param {Boolean} arg if `true` or omitted, no error will be thrown
+ * for unknown options.
+ * @api public
+ */
+Command.prototype.allowUnknownOption = function(arg) {
+ this._allowUnknownOption = arguments.length === 0 || arg;
+ return this;
+};
+
+/**
+ * Parse `argv`, settings options and invoking commands when defined.
+ *
+ * @param {Array} argv
+ * @return {Command} for chaining
+ * @api public
+ */
+
+Command.prototype.parse = function(argv) {
+ // implicit help
+ if (this.executables) this.addImplicitHelpCommand();
+
+ // store raw args
+ this.rawArgs = argv;
+
+ // guess name
+ this._name = this._name || basename(argv[1], '.js');
+
+ // github-style sub-commands with no sub-command
+ if (this.executables && argv.length < 3 && !this.defaultExecutable) {
+ // this user needs help
+ argv.push('--help');
+ }
+
+ // process argv
+ var parsed = this.parseOptions(this.normalize(argv.slice(2)));
+ var args = this.args = parsed.args;
+
+ var result = this.parseArgs(this.args, parsed.unknown);
+
+ // executable sub-commands
+ var name = result.args[0];
+
+ var aliasCommand = null;
+ // check alias of sub commands
+ if (name) {
+ aliasCommand = this.commands.filter(function(command) {
+ return command.alias() === name;
+ })[0];
+ }
+
+ if (this._execs[name] && typeof this._execs[name] !== 'function') {
+ return this.executeSubCommand(argv, args, parsed.unknown);
+ } else if (aliasCommand) {
+ // is alias of a subCommand
+ args[0] = aliasCommand._name;
+ return this.executeSubCommand(argv, args, parsed.unknown);
+ } else if (this.defaultExecutable) {
+ // use the default subcommand
+ args.unshift(this.defaultExecutable);
+ return this.executeSubCommand(argv, args, parsed.unknown);
+ }
+
+ return result;
+};
+
+/**
+ * Execute a sub-command executable.
+ *
+ * @param {Array} argv
+ * @param {Array} args
+ * @param {Array} unknown
+ * @api private
+ */
+
+Command.prototype.executeSubCommand = function(argv, args, unknown) {
+ args = args.concat(unknown);
+
+ if (!args.length) this.help();
+ if (args[0] === 'help' && args.length === 1) this.help();
+
+ // --help
+ if (args[0] === 'help') {
+ args[0] = args[1];
+ args[1] = '--help';
+ }
+
+ // executable
+ var f = argv[1];
+ // name of the subcommand, link `pm-install`
+ var bin = basename(f, '.js') + '-' + args[0];
+
+ // In case of globally installed, get the base dir where executable
+ // subcommand file should be located at
+ var baseDir,
+ link = fs.lstatSync(f).isSymbolicLink() ? fs.readlinkSync(f) : f;
+
+ // when symbolink is relative path
+ if (link !== f && link.charAt(0) !== '/') {
+ link = path.join(dirname(f), link);
+ }
+ baseDir = dirname(link);
+
+ // prefer local `./` to bin in the $PATH
+ var localBin = path.join(baseDir, bin);
+
+ // whether bin file is a js script with explicit `.js` extension
+ var isExplicitJS = false;
+ if (exists(localBin + '.js')) {
+ bin = localBin + '.js';
+ isExplicitJS = true;
+ } else if (exists(localBin)) {
+ bin = localBin;
+ }
+
+ args = args.slice(1);
+
+ var proc;
+ if (process.platform !== 'win32') {
+ if (isExplicitJS) {
+ args.unshift(bin);
+ // add executable arguments to spawn
+ args = (process.execArgv || []).concat(args);
+
+ proc = spawn(process.argv[0], args, { stdio: 'inherit', customFds: [0, 1, 2] });
+ } else {
+ proc = spawn(bin, args, { stdio: 'inherit', customFds: [0, 1, 2] });
+ }
+ } else {
+ args.unshift(bin);
+ proc = spawn(process.execPath, args, { stdio: 'inherit' });
+ }
+
+ var signals = ['SIGUSR1', 'SIGUSR2', 'SIGTERM', 'SIGINT', 'SIGHUP'];
+ signals.forEach(function(signal) {
+ process.on(signal, function() {
+ if (proc.killed === false && proc.exitCode === null) {
+ proc.kill(signal);
+ }
+ });
+ });
+ proc.on('close', process.exit.bind(process));
+ proc.on('error', function(err) {
+ if (err.code === 'ENOENT') {
+ console.error('\n %s(1) does not exist, try --help\n', bin);
+ } else if (err.code === 'EACCES') {
+ console.error('\n %s(1) not executable. try chmod or run with root\n', bin);
+ }
+ process.exit(1);
+ });
+
+ // Store the reference to the child process
+ this.runningCommand = proc;
+};
+
+/**
+ * Normalize `args`, splitting joined short flags. For example
+ * the arg "-abc" is equivalent to "-a -b -c".
+ * This also normalizes equal sign and splits "--abc=def" into "--abc def".
+ *
+ * @param {Array} args
+ * @return {Array}
+ * @api private
+ */
+
+Command.prototype.normalize = function(args) {
+ var ret = [],
+ arg,
+ lastOpt,
+ index;
+
+ for (var i = 0, len = args.length; i < len; ++i) {
+ arg = args[i];
+ if (i > 0) {
+ lastOpt = this.optionFor(args[i - 1]);
+ }
+
+ if (arg === '--') {
+ // Honor option terminator
+ ret = ret.concat(args.slice(i));
+ break;
+ } else if (lastOpt && lastOpt.required) {
+ ret.push(arg);
+ } else if (arg.length > 1 && arg[0] === '-' && arg[1] !== '-') {
+ arg.slice(1).split('').forEach(function(c) {
+ ret.push('-' + c);
+ });
+ } else if (/^--/.test(arg) && ~(index = arg.indexOf('='))) {
+ ret.push(arg.slice(0, index), arg.slice(index + 1));
+ } else {
+ ret.push(arg);
+ }
+ }
+
+ return ret;
+};
+
+/**
+ * Parse command `args`.
+ *
+ * When listener(s) are available those
+ * callbacks are invoked, otherwise the "*"
+ * event is emitted and those actions are invoked.
+ *
+ * @param {Array} args
+ * @return {Command} for chaining
+ * @api private
+ */
+
+Command.prototype.parseArgs = function(args, unknown) {
+ var name;
+
+ if (args.length) {
+ name = args[0];
+ if (this.listeners('command:' + name).length) {
+ this.emit('command:' + args.shift(), args, unknown);
+ } else {
+ this.emit('command:*', args);
+ }
+ } else {
+ outputHelpIfNecessary(this, unknown);
+
+ // If there were no args and we have unknown options,
+ // then they are extraneous and we need to error.
+ if (unknown.length > 0) {
+ this.unknownOption(unknown[0]);
+ }
+ }
+
+ return this;
+};
+
+/**
+ * Return an option matching `arg` if any.
+ *
+ * @param {String} arg
+ * @return {Option}
+ * @api private
+ */
+
+Command.prototype.optionFor = function(arg) {
+ for (var i = 0, len = this.options.length; i < len; ++i) {
+ if (this.options[i].is(arg)) {
+ return this.options[i];
+ }
+ }
+};
+
+/**
+ * Parse options from `argv` returning `argv`
+ * void of these options.
+ *
+ * @param {Array} argv
+ * @return {Array}
+ * @api public
+ */
+
+Command.prototype.parseOptions = function(argv) {
+ var args = [],
+ len = argv.length,
+ literal,
+ option,
+ arg;
+
+ var unknownOptions = [];
+
+ // parse options
+ for (var i = 0; i < len; ++i) {
+ arg = argv[i];
+
+ // literal args after --
+ if (literal) {
+ args.push(arg);
+ continue;
+ }
+
+ if (arg === '--') {
+ literal = true;
+ continue;
+ }
+
+ // find matching Option
+ option = this.optionFor(arg);
+
+ // option is defined
+ if (option) {
+ // requires arg
+ if (option.required) {
+ arg = argv[++i];
+ if (arg == null) return this.optionMissingArgument(option);
+ this.emit('option:' + option.name(), arg);
+ // optional arg
+ } else if (option.optional) {
+ arg = argv[i + 1];
+ if (arg == null || (arg[0] === '-' && arg !== '-')) {
+ arg = null;
+ } else {
+ ++i;
+ }
+ this.emit('option:' + option.name(), arg);
+ // bool
+ } else {
+ this.emit('option:' + option.name());
+ }
+ continue;
+ }
+
+ // looks like an option
+ if (arg.length > 1 && arg[0] === '-') {
+ unknownOptions.push(arg);
+
+ // If the next argument looks like it might be
+ // an argument for this option, we pass it on.
+ // If it isn't, then it'll simply be ignored
+ if ((i + 1) < argv.length && argv[i + 1][0] !== '-') {
+ unknownOptions.push(argv[++i]);
+ }
+ continue;
+ }
+
+ // arg
+ args.push(arg);
+ }
+
+ return { args: args, unknown: unknownOptions };
+};
+
+/**
+ * Return an object containing options as key-value pairs
+ *
+ * @return {Object}
+ * @api public
+ */
+Command.prototype.opts = function() {
+ var result = {},
+ len = this.options.length;
+
+ for (var i = 0; i < len; i++) {
+ var key = this.options[i].attributeName();
+ result[key] = key === this._versionOptionName ? this._version : this[key];
+ }
+ return result;
+};
+
+/**
+ * Argument `name` is missing.
+ *
+ * @param {String} name
+ * @api private
+ */
+
+Command.prototype.missingArgument = function(name) {
+ console.error();
+ console.error(" error: missing required argument `%s'", name);
+ console.error();
+ process.exit(1);
+};
+
+/**
+ * `Option` is missing an argument, but received `flag` or nothing.
+ *
+ * @param {String} option
+ * @param {String} flag
+ * @api private
+ */
+
+Command.prototype.optionMissingArgument = function(option, flag) {
+ console.error();
+ if (flag) {
+ console.error(" error: option `%s' argument missing, got `%s'", option.flags, flag);
+ } else {
+ console.error(" error: option `%s' argument missing", option.flags);
+ }
+ console.error();
+ process.exit(1);
+};
+
+/**
+ * Unknown option `flag`.
+ *
+ * @param {String} flag
+ * @api private
+ */
+
+Command.prototype.unknownOption = function(flag) {
+ if (this._allowUnknownOption) return;
+ console.error();
+ console.error(" error: unknown option `%s'", flag);
+ console.error();
+ process.exit(1);
+};
+
+/**
+ * Variadic argument with `name` is not the last argument as required.
+ *
+ * @param {String} name
+ * @api private
+ */
+
+Command.prototype.variadicArgNotLast = function(name) {
+ console.error();
+ console.error(" error: variadic arguments must be last `%s'", name);
+ console.error();
+ process.exit(1);
+};
+
+/**
+ * Set the program version to `str`.
+ *
+ * This method auto-registers the "-V, --version" flag
+ * which will print the version number when passed.
+ *
+ * @param {String} str
+ * @param {String} [flags]
+ * @return {Command} for chaining
+ * @api public
+ */
+
+Command.prototype.version = function(str, flags) {
+ if (arguments.length === 0) return this._version;
+ this._version = str;
+ flags = flags || '-V, --version';
+ var versionOption = new Option(flags, 'output the version number');
+ this._versionOptionName = versionOption.long.substr(2) || 'version';
+ this.options.push(versionOption);
+ this.on('option:' + this._versionOptionName, function() {
+ process.stdout.write(str + '\n');
+ process.exit(0);
+ });
+ return this;
+};
+
+/**
+ * Set the description to `str`.
+ *
+ * @param {String} str
+ * @return {String|Command}
+ * @api public
+ */
+
+Command.prototype.description = function(str) {
+ if (arguments.length === 0) return this._description;
+ this._description = str;
+ return this;
+};
+
+/**
+ * Set an alias for the command
+ *
+ * @param {String} alias
+ * @return {String|Command}
+ * @api public
+ */
+
+Command.prototype.alias = function(alias) {
+ var command = this;
+ if (this.commands.length !== 0) {
+ command = this.commands[this.commands.length - 1];
+ }
+
+ if (arguments.length === 0) return command._alias;
+
+ if (alias === command._name) throw new Error('Command alias can\'t be the same as its name');
+
+ command._alias = alias;
+ return this;
+};
+
+/**
+ * Set / get the command usage `str`.
+ *
+ * @param {String} str
+ * @return {String|Command}
+ * @api public
+ */
+
+Command.prototype.usage = function(str) {
+ var args = this._args.map(function(arg) {
+ return humanReadableArgName(arg);
+ });
+
+ var usage = '[options]' +
+ (this.commands.length ? ' [command]' : '') +
+ (this._args.length ? ' ' + args.join(' ') : '');
+
+ if (arguments.length === 0) return this._usage || usage;
+ this._usage = str;
+
+ return this;
+};
+
+/**
+ * Get or set the name of the command
+ *
+ * @param {String} str
+ * @return {String|Command}
+ * @api public
+ */
+
+Command.prototype.name = function(str) {
+ if (arguments.length === 0) return this._name;
+ this._name = str;
+ return this;
+};
+
+/**
+ * Return the largest option length.
+ *
+ * @return {Number}
+ * @api private
+ */
+
+Command.prototype.largestOptionLength = function() {
+ return this.options.reduce(function(max, option) {
+ return Math.max(max, option.flags.length);
+ }, 0);
+};
+
+/**
+ * Return help for options.
+ *
+ * @return {String}
+ * @api private
+ */
+
+Command.prototype.optionHelp = function() {
+ var width = this.largestOptionLength();
+
+ // Append the help information
+ return this.options.map(function(option) {
+ return pad(option.flags, width) + ' ' + option.description +
+ ((option.bool && option.defaultValue !== undefined) ? ' (default: ' + option.defaultValue + ')' : '');
+ }).concat([pad('-h, --help', width) + ' ' + 'output usage information'])
+ .join('\n');
+};
+
+/**
+ * Return command help documentation.
+ *
+ * @return {String}
+ * @api private
+ */
+
+Command.prototype.commandHelp = function() {
+ if (!this.commands.length) return '';
+
+ var commands = this.commands.filter(function(cmd) {
+ return !cmd._noHelp;
+ }).map(function(cmd) {
+ var args = cmd._args.map(function(arg) {
+ return humanReadableArgName(arg);
+ }).join(' ');
+
+ return [
+ cmd._name +
+ (cmd._alias ? '|' + cmd._alias : '') +
+ (cmd.options.length ? ' [options]' : '') +
+ (args ? ' ' + args : ''),
+ cmd._description
+ ];
+ });
+
+ var width = commands.reduce(function(max, command) {
+ return Math.max(max, command[0].length);
+ }, 0);
+
+ return [
+ '',
+ ' Commands:',
+ '',
+ commands.map(function(cmd) {
+ var desc = cmd[1] ? ' ' + cmd[1] : '';
+ return (desc ? pad(cmd[0], width) : cmd[0]) + desc;
+ }).join('\n').replace(/^/gm, ' '),
+ ''
+ ].join('\n');
+};
+
+/**
+ * Return program help documentation.
+ *
+ * @return {String}
+ * @api private
+ */
+
+Command.prototype.helpInformation = function() {
+ var desc = [];
+ if (this._description) {
+ desc = [
+ ' ' + this._description,
+ ''
+ ];
+ }
+
+ var cmdName = this._name;
+ if (this._alias) {
+ cmdName = cmdName + '|' + this._alias;
+ }
+ var usage = [
+ '',
+ ' Usage: ' + cmdName + ' ' + this.usage(),
+ ''
+ ];
+
+ var cmds = [];
+ var commandHelp = this.commandHelp();
+ if (commandHelp) cmds = [commandHelp];
+
+ var options = [
+ '',
+ ' Options:',
+ '',
+ '' + this.optionHelp().replace(/^/gm, ' '),
+ ''
+ ];
+
+ return usage
+ .concat(desc)
+ .concat(options)
+ .concat(cmds)
+ .join('\n');
+};
+
+/**
+ * Output help information for this command
+ *
+ * @api public
+ */
+
+Command.prototype.outputHelp = function(cb) {
+ if (!cb) {
+ cb = function(passthru) {
+ return passthru;
+ };
+ }
+ process.stdout.write(cb(this.helpInformation()));
+ this.emit('--help');
+};
+
+/**
+ * Output help information and exit.
+ *
+ * @api public
+ */
+
+Command.prototype.help = function(cb) {
+ this.outputHelp(cb);
+ process.exit();
+};
+
+/**
+ * Camel-case the given `flag`
+ *
+ * @param {String} flag
+ * @return {String}
+ * @api private
+ */
+
+function camelcase(flag) {
+ return flag.split('-').reduce(function(str, word) {
+ return str + word[0].toUpperCase() + word.slice(1);
+ });
+}
+
+/**
+ * Pad `str` to `width`.
+ *
+ * @param {String} str
+ * @param {Number} width
+ * @return {String}
+ * @api private
+ */
+
+function pad(str, width) {
+ var len = Math.max(0, width - str.length);
+ return str + Array(len + 1).join(' ');
+}
+
+/**
+ * Output help information if necessary
+ *
+ * @param {Command} command to output help for
+ * @param {Array} array of options to search for -h or --help
+ * @api private
+ */
+
+function outputHelpIfNecessary(cmd, options) {
+ options = options || [];
+ for (var i = 0; i < options.length; i++) {
+ if (options[i] === '--help' || options[i] === '-h') {
+ cmd.outputHelp();
+ process.exit(0);
+ }
+ }
+}
+
+/**
+ * Takes an argument an returns its human readable equivalent for help usage.
+ *
+ * @param {Object} arg
+ * @return {String}
+ * @api private
+ */
+
+function humanReadableArgName(arg) {
+ var nameOutput = arg.name + (arg.variadic === true ? '...' : '');
+
+ return arg.required
+ ? '<' + nameOutput + '>'
+ : '[' + nameOutput + ']';
+}
+
+// for versions before node v0.8 when there weren't `fs.existsSync`
+function exists(file) {
+ try {
+ if (fs.statSync(file).isFile()) {
+ return true;
+ }
+ } catch (e) {
+ return false;
+ }
+}
diff --git a/octorun/node_modules/commander/package.json b/octorun/node_modules/commander/package.json
new file mode 100644
index 000000000..b33979d03
--- /dev/null
+++ b/octorun/node_modules/commander/package.json
@@ -0,0 +1,114 @@
+{
+ "_args": [
+ [
+ "commander@^2.14.1",
+ "C:\\Users\\Spade\\Projects\\GitHub\\Unity\\octorun"
+ ]
+ ],
+ "_from": "commander@>=2.14.1 <3.0.0",
+ "_id": "commander@2.14.1",
+ "_inCache": true,
+ "_location": "/commander",
+ "_nodeVersion": "9.4.0",
+ "_npmOperationalInternal": {
+ "host": "s3://npm-registry-packages",
+ "tmp": "tmp/commander_2.14.1_1517989378540_0.7122613806538618"
+ },
+ "_npmUser": {
+ "email": "abe@enzou.tokyo",
+ "name": "abetomo"
+ },
+ "_npmVersion": "5.6.0",
+ "_phantomChildren": {},
+ "_requested": {
+ "name": "commander",
+ "raw": "commander@^2.14.1",
+ "rawSpec": "^2.14.1",
+ "scope": null,
+ "spec": ">=2.14.1 <3.0.0",
+ "type": "range"
+ },
+ "_requiredBy": [
+ "/"
+ ],
+ "_resolved": "https://registry.npmjs.org/commander/-/commander-2.14.1.tgz",
+ "_shasum": "2235123e37af8ca3c65df45b026dbd357b01b9aa",
+ "_shrinkwrap": null,
+ "_spec": "commander@^2.14.1",
+ "_where": "C:\\Users\\Spade\\Projects\\GitHub\\Unity\\octorun",
+ "author": {
+ "email": "tj@vision-media.ca",
+ "name": "TJ Holowaychuk"
+ },
+ "bugs": {
+ "url": "https://github.com/tj/commander.js/issues"
+ },
+ "dependencies": {},
+ "description": "the complete solution for node.js command-line programs",
+ "devDependencies": {
+ "@types/node": "^7.0.52",
+ "eslint": "^3.19.0",
+ "should": "^11.2.1",
+ "sinon": "^2.4.1",
+ "standard": "^10.0.3",
+ "typescript": "^2.7.1"
+ },
+ "directories": {},
+ "dist": {
+ "fileCount": 6,
+ "integrity": "sha512-+YR16o3rK53SmWHU3rEM3tPAh2rwb1yPcQX5irVn7mb0gXbwuCCrnkbV5+PBfETdfg1vui07nM6PCG1zndcjQw==",
+ "shasum": "2235123e37af8ca3c65df45b026dbd357b01b9aa",
+ "tarball": "https://registry.npmjs.org/commander/-/commander-2.14.1.tgz",
+ "unpackedSize": 58015
+ },
+ "files": [
+ "index.js",
+ "typings/index.d.ts"
+ ],
+ "gitHead": "6b026a5c88a2c7f67db70831c015e9d11c7babca",
+ "homepage": "https://github.com/tj/commander.js#readme",
+ "installable": true,
+ "keywords": [
+ "command",
+ "commander",
+ "option",
+ "parser"
+ ],
+ "license": "MIT",
+ "main": "index",
+ "maintainers": [
+ {
+ "email": "abe@enzou.tokyo",
+ "name": "abetomo"
+ },
+ {
+ "email": "rkoutnik@gmail.com",
+ "name": "somekittens"
+ },
+ {
+ "email": "tj@vision-media.ca",
+ "name": "tjholowaychuk"
+ },
+ {
+ "email": "romain.vanesyan@gmail.com",
+ "name": "vanesyan"
+ },
+ {
+ "email": "zhiyelee@gmail.com",
+ "name": "zhiyelee"
+ }
+ ],
+ "name": "commander",
+ "optionalDependencies": {},
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/tj/commander.js.git"
+ },
+ "scripts": {
+ "lint": "eslint index.js",
+ "test": "make test && npm run test-typings",
+ "test-typings": "node_modules/typescript/bin/tsc -p tsconfig.json"
+ },
+ "typings": "typings/index.d.ts",
+ "version": "2.14.1"
+}
diff --git a/octorun/node_modules/commander/typings/index.d.ts b/octorun/node_modules/commander/typings/index.d.ts
new file mode 100644
index 000000000..483076741
--- /dev/null
+++ b/octorun/node_modules/commander/typings/index.d.ts
@@ -0,0 +1,309 @@
+// Type definitions for commander 2.11
+// Project: https://github.com/visionmedia/commander.js
+// Definitions by: Alan Agius , Marcelo Dezem , vvakame , Jules Randolph
+// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
+
+declare namespace local {
+
+ class Option {
+ flags: string;
+ required: boolean;
+ optional: boolean;
+ bool: boolean;
+ short?: string;
+ long: string;
+ description: string;
+
+ /**
+ * Initialize a new `Option` with the given `flags` and `description`.
+ *
+ * @param {string} flags
+ * @param {string} [description]
+ */
+ constructor(flags: string, description?: string);
+ }
+
+ class Command extends NodeJS.EventEmitter {
+ [key: string]: any;
+
+ args: string[];
+
+ /**
+ * Initialize a new `Command`.
+ *
+ * @param {string} [name]
+ */
+ constructor(name?: string);
+
+ /**
+ * Set the program version to `str`.
+ *
+ * This method auto-registers the "-V, --version" flag
+ * which will print the version number when passed.
+ *
+ * @param {string} str
+ * @param {string} [flags]
+ * @returns {Command} for chaining
+ */
+ version(str: string, flags?: string): Command;
+
+ /**
+ * Add command `name`.
+ *
+ * The `.action()` callback is invoked when the
+ * command `name` is specified via __ARGV__,
+ * and the remaining arguments are applied to the
+ * function for access.
+ *
+ * When the `name` is "*" an un-matched command
+ * will be passed as the first arg, followed by
+ * the rest of __ARGV__ remaining.
+ *
+ * @example
+ * program
+ * .version('0.0.1')
+ * .option('-C, --chdir ', 'change the working directory')
+ * .option('-c, --config ', 'set config path. defaults to ./deploy.conf')
+ * .option('-T, --no-tests', 'ignore test hook')
+ *
+ * program
+ * .command('setup')
+ * .description('run remote setup commands')
+ * .action(function() {
+ * console.log('setup');
+ * });
+ *
+ * program
+ * .command('exec ')
+ * .description('run the given remote command')
+ * .action(function(cmd) {
+ * console.log('exec "%s"', cmd);
+ * });
+ *
+ * program
+ * .command('teardown [otherDirs...]')
+ * .description('run teardown commands')
+ * .action(function(dir, otherDirs) {
+ * console.log('dir "%s"', dir);
+ * if (otherDirs) {
+ * otherDirs.forEach(function (oDir) {
+ * console.log('dir "%s"', oDir);
+ * });
+ * }
+ * });
+ *
+ * program
+ * .command('*')
+ * .description('deploy the given env')
+ * .action(function(env) {
+ * console.log('deploying "%s"', env);
+ * });
+ *
+ * program.parse(process.argv);
+ *
+ * @param {string} name
+ * @param {string} [desc] for git-style sub-commands
+ * @param {CommandOptions} [opts] command options
+ * @returns {Command} the new command
+ */
+ command(name: string, desc?: string, opts?: commander.CommandOptions): Command;
+
+ /**
+ * Define argument syntax for the top-level command.
+ *
+ * @param {string} desc
+ * @returns {Command} for chaining
+ */
+ arguments(desc: string): Command;
+
+ /**
+ * Parse expected `args`.
+ *
+ * For example `["[type]"]` becomes `[{ required: false, name: 'type' }]`.
+ *
+ * @param {string[]} args
+ * @returns {Command} for chaining
+ */
+ parseExpectedArgs(args: string[]): Command;
+
+ /**
+ * Register callback `fn` for the command.
+ *
+ * @example
+ * program
+ * .command('help')
+ * .description('display verbose help')
+ * .action(function() {
+ * // output help here
+ * });
+ *
+ * @param {(...args: any[]) => void} fn
+ * @returns {Command} for chaining
+ */
+ action(fn: (...args: any[]) => void): Command;
+
+ /**
+ * Define option with `flags`, `description` and optional
+ * coercion `fn`.
+ *
+ * The `flags` string should contain both the short and long flags,
+ * separated by comma, a pipe or space. The following are all valid
+ * all will output this way when `--help` is used.
+ *
+ * "-p, --pepper"
+ * "-p|--pepper"
+ * "-p --pepper"
+ *
+ * @example
+ * // simple boolean defaulting to false
+ * program.option('-p, --pepper', 'add pepper');
+ *
+ * --pepper
+ * program.pepper
+ * // => Boolean
+ *
+ * // simple boolean defaulting to true
+ * program.option('-C, --no-cheese', 'remove cheese');
+ *
+ * program.cheese
+ * // => true
+ *
+ * --no-cheese
+ * program.cheese
+ * // => false
+ *
+ * // required argument
+ * program.option('-C, --chdir ', 'change the working directory');
+ *
+ * --chdir /tmp
+ * program.chdir
+ * // => "/tmp"
+ *
+ * // optional argument
+ * program.option('-c, --cheese [type]', 'add cheese [marble]');
+ *
+ * @param {string} flags
+ * @param {string} [description]
+ * @param {((arg1: any, arg2: any) => void) | RegExp} [fn] function or default
+ * @param {*} [defaultValue]
+ * @returns {Command} for chaining
+ */
+ option(flags: string, description?: string, fn?: ((arg1: any, arg2: any) => void) | RegExp, defaultValue?: any): Command;
+ option(flags: string, description?: string, defaultValue?: any): Command;
+
+ /**
+ * Allow unknown options on the command line.
+ *
+ * @param {boolean} [arg] if `true` or omitted, no error will be thrown for unknown options.
+ * @returns {Command} for chaining
+ */
+ allowUnknownOption(arg?: boolean): Command;
+
+ /**
+ * Parse `argv`, settings options and invoking commands when defined.
+ *
+ * @param {string[]} argv
+ * @returns {Command} for chaining
+ */
+ parse(argv: string[]): Command;
+
+ /**
+ * Parse options from `argv` returning `argv` void of these options.
+ *
+ * @param {string[]} argv
+ * @returns {ParseOptionsResult}
+ */
+ parseOptions(argv: string[]): commander.ParseOptionsResult;
+
+ /**
+ * Return an object containing options as key-value pairs
+ *
+ * @returns {{[key: string]: string}}
+ */
+ opts(): { [key: string]: string };
+
+ /**
+ * Set the description to `str`.
+ *
+ * @param {string} str
+ * @return {(Command | string)}
+ */
+ description(str: string): Command;
+ description(): string;
+
+ /**
+ * Set an alias for the command.
+ *
+ * @param {string} alias
+ * @return {(Command | string)}
+ */
+ alias(alias: string): Command;
+ alias(): string;
+
+ /**
+ * Set or get the command usage.
+ *
+ * @param {string} str
+ * @return {(Command | string)}
+ */
+ usage(str: string): Command;
+ usage(): string;
+
+ /**
+ * Set the name of the command.
+ *
+ * @param {string} str
+ * @return {Command}
+ */
+ name(str: string): Command;
+
+ /**
+ * Get the name of the command.
+ *
+ * @return {string}
+ */
+ name(): string;
+
+ /**
+ * Output help information for this command.
+ *
+ * @param {(str: string) => string} [cb]
+ */
+ outputHelp(cb?: (str: string) => string): void;
+
+ /** Output help information and exit.
+ *
+ * @param {(str: string) => string} [cb]
+ */
+ help(cb?: (str: string) => string): void;
+ }
+
+}
+
+declare namespace commander {
+
+ type Command = local.Command
+
+ type Option = local.Option
+
+ interface CommandOptions {
+ noHelp?: boolean;
+ isDefault?: boolean;
+ }
+
+ interface ParseOptionsResult {
+ args: string[];
+ unknown: string[];
+ }
+
+ interface CommanderStatic extends Command {
+ Command: typeof local.Command;
+ Option: typeof local.Option;
+ CommandOptions: CommandOptions;
+ ParseOptionsResult: ParseOptionsResult;
+ }
+
+}
+
+declare const commander: commander.CommanderStatic;
+export = commander;
diff --git a/octorun/node_modules/dotenv/.editorconfig b/octorun/node_modules/dotenv/.editorconfig
new file mode 100644
index 000000000..5d1263484
--- /dev/null
+++ b/octorun/node_modules/dotenv/.editorconfig
@@ -0,0 +1,13 @@
+# editorconfig.org
+root = true
+
+[*]
+indent_style = space
+indent_size = 2
+end_of_line = lf
+charset = utf-8
+trim_trailing_whitespace = true
+insert_final_newline = true
+
+[*.md]
+trim_trailing_whitespace = false
diff --git a/octorun/node_modules/dotenv/.npmignore b/octorun/node_modules/dotenv/.npmignore
new file mode 100644
index 000000000..519e4f277
--- /dev/null
+++ b/octorun/node_modules/dotenv/.npmignore
@@ -0,0 +1,12 @@
+# Coverage directory used by tools like istanbul
+coverage
+
+# Dependency directory
+# Commenting this out is preferred by some people, see
+# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git-
+node_modules
+
+# Users Environment Variables
+.lock-wscript
+
+.DS_Store
diff --git a/octorun/node_modules/dotenv/.travis.yml b/octorun/node_modules/dotenv/.travis.yml
new file mode 100644
index 000000000..ba0b1445c
--- /dev/null
+++ b/octorun/node_modules/dotenv/.travis.yml
@@ -0,0 +1,6 @@
+language: node_js
+
+node_js:
+ - iojs
+ - 0.12
+ - 0.10
diff --git a/octorun/node_modules/dotenv/Contributing.md b/octorun/node_modules/dotenv/Contributing.md
new file mode 100644
index 000000000..04552a9e0
--- /dev/null
+++ b/octorun/node_modules/dotenv/Contributing.md
@@ -0,0 +1,25 @@
+# Contributing
+
+1. Fork it
+2. `npm install`
+3. Create your feature branch (`git checkout -b my-new-feature`)
+4. Commit your changes (`git commit -am 'Added some feature'`)
+5. `npm test`
+6. Push to the branch (`git push origin my-new-feature`)
+7. Create new Pull Request
+
+## Testing
+
+We use [lab](https://github.com/hapijs/lab) and [should](https://github.com/shouldjs/should.js) to write BDD test. Run our test suite with this command:
+
+```
+npm test
+```
+
+## Code Style
+
+We use [standard](https://www.npmjs.com/package/standard) and [editorconfig](http://editorconfig.org) to maintain code style and best practices. Please make sure your PR adheres to the guides by running:
+
+```
+npm run lint
+```
diff --git a/octorun/node_modules/dotenv/README.md b/octorun/node_modules/dotenv/README.md
new file mode 100644
index 000000000..de324261a
--- /dev/null
+++ b/octorun/node_modules/dotenv/README.md
@@ -0,0 +1,198 @@
+# dotenv
+
+
+
+Dotenv loads environment variables from `.env` into `ENV` (process.env).
+
+[](https://travis-ci.org/motdotla/dotenv)
+[](https://www.npmjs.com/package/dotenv)
+[](https://github.com/feross/standard)
+
+> "Storing [configuration in the environment](http://www.12factor.net/config)
+> is one of the tenets of a [twelve-factor app](http://www.12factor.net/).
+> Anything that is likely to change between deployment environments–such as
+> resource handles for databases or credentials for external services–should be
+> extracted from the code into environment variables.
+>
+> But it is not always practical to set environment variables on development
+> machines or continuous integration servers where multiple projects are run.
+> Dotenv loads variables from a `.env` file into ENV when the environment is
+> bootstrapped."
+>
+> [Brandon Keepers' Dotenv in Ruby](https://github.com/bkeepers/dotenv)
+
+## Install
+
+```bash
+npm install dotenv --save
+```
+
+## Usage
+
+As early as possible in your application, require and load dotenv.
+
+```javascript
+require('dotenv').load();
+```
+
+Create a `.env` file in the root directory of your project. Add
+environment-specific variables on new lines in the form of `NAME=VALUE`.
+For example:
+
+```
+DB_HOST=localhost
+DB_USER=root
+DB_PASS=s1mpl3
+```
+
+That's it.
+
+`process.env` now has the keys and values you defined in your `.env` file.
+
+```javascript
+db.connect({
+ host: process.env.DB_HOST,
+ username: process.env.DB_USER,
+ password: process.env.DB_PASS
+});
+```
+
+### Preload
+
+If you are using iojs-v1.6.0 or later, you can use the `--require` (`-r`) command line option to preload dotenv. By doing this, you do not need to require and load dotenv in your application code.
+
+
+```bash
+$ node -r dotenv/config your_script.js
+```
+
+The configuration options below are supported as command line arguments in the format `dotenv_config_=value`
+
+```bash
+$ node -r dotenv/config your_script.js dotenv_config_path=/custom/path/to/your/env/vars
+```
+
+## Config
+
+`config` will read your .env file, parse the contents, and assign it to
+`process.env` - just like `load` does. You can additionally, pass options to
+`config`.
+
+Note: `config` and `load` are synonyms. You can pass options to either.
+
+### Options
+
+#### Silent
+
+Default: `false`
+
+Dotenv outputs a warning to your console if missing a `.env` file. Suppress
+this warning using silent.
+
+```js
+require('dotenv').config({silent: true});
+```
+
+#### Path
+
+Default: `.env`
+
+You can specify a custom path if your file containing environment variables is
+named or located differently.
+
+```js
+require('dotenv').config({path: '/custom/path/to/your/env/vars'});
+```
+
+#### Encoding
+
+Default: `utf8`
+
+You may specify the encoding of your file containing environment variables
+using this option.
+
+```js
+require('dotenv').config({encoding: 'base64'});
+```
+
+## Parse
+
+The engine which parses the contents of your file containing environment
+variables is available to use. It accepts a String or Buffer and will return
+an Object with the parsed keys and values.
+
+```js
+var dotenv = require('dotenv');
+var buf = new Buffer('BASIC=basic');
+var config = dotenv.parse(buf); // will return an object
+console.log(typeof config, config) // object { BASIC : 'basic' }
+```
+
+### Rules
+
+The parsing engine currently supports the following rules:
+
+- `BASIC=basic` becomes `{BASIC: 'basic'}`
+- empty lines are skipped
+- lines beginning with `#` are treated as comments
+- empty values become empty strings (`EMPTY=` becomes `{EMPTY: ''}`)
+- single and double quoted values are escaped (`SINGLE_QUOTE='quoted'` becomes `{SINGLE_QUOTE: "quoted"}`)
+- new lines are expanded if in double quotes (`MULTILINE="new\nline"` becomes
+
+```
+{MULTILINE: 'new
+line'}
+```
+- inner quotes are maintained (think JSON) (`JSON={"foo": "bar"}` becomes `{JSON:"{\"foo\": \"bar\"}"`)
+
+#### Expanding Variables
+
+Basic variable expansion is supported.
+
+```
+BASIC=basic
+TEST=$BASIC
+```
+
+Parsing that would result in `{BASIC: 'basic', TEST: 'basic'}`. You can escape
+variables by quoting or beginning with `\` (e.g. `TEST=\$BASIC`). If the
+variable is not found in the file, `process.env` is checked. Missing variables
+result in an empty string.
+
+```
+BASIC=basic
+TEST=$TEST
+DNE=$DNE
+```
+
+```bash
+TEST=example node -e 'require("dotenv").config();'
+```
+
+- `process.env.BASIC` would equal `basic`
+- `process.env.TEST` would equal `example`
+- `process.env.DNE` would equal `""`
+
+## FAQ
+
+### Should I commit my .env file?
+
+No. We **strongly** recommend against committing your .env file to version
+control. It should only include environment-specific values such as database
+passwords or API keys. Your production database should have a different
+password than your development database.
+
+## Contributing
+
+See [Contributing Guide](Contributing.md)
+
+## Who's using dotenv
+
+Here's just a few of many repositories using dotenv:
+
+* [npm](https://github.com/npm/newww)
+* [sendgrid-nodejs](https://github.com/sendgrid/sendgrid-nodejs)
+* [handshake.js](https://github.com/handshakejs/handshakejs-api)
+* [google-oauth2-service-account](https://github.com/jacoblwe20/google-oauth2-service-account)
+* [kibble](https://github.com/motdotla/kibble)
+* [github-streaker](https://github.com/motdotla/github-streaker)
diff --git a/octorun/node_modules/dotenv/config.js b/octorun/node_modules/dotenv/config.js
new file mode 100644
index 000000000..86d6fa5fa
--- /dev/null
+++ b/octorun/node_modules/dotenv/config.js
@@ -0,0 +1,11 @@
+(function () {
+ var options = {}
+ process.argv.forEach(function (val, idx, arr) {
+ var matches = val.match(/^dotenv_config_(.+)=(.+)/)
+ if (matches) {
+ options[matches[1]] = matches[2]
+ }
+ })
+
+ require('./lib/main').config(options)
+})()
diff --git a/octorun/node_modules/dotenv/dotenv.png b/octorun/node_modules/dotenv/dotenv.png
new file mode 100644
index 000000000..debb58cae
--- /dev/null
+++ b/octorun/node_modules/dotenv/dotenv.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:14042edf6ba2b5b00490c9b23ef38b93fd36dff8a4e06b775cec97a15af76fd7
+size 5009
diff --git a/octorun/node_modules/dotenv/lib/main.js b/octorun/node_modules/dotenv/lib/main.js
new file mode 100644
index 000000000..edf05ba31
--- /dev/null
+++ b/octorun/node_modules/dotenv/lib/main.js
@@ -0,0 +1,92 @@
+'use strict'
+
+var fs = require('fs')
+
+module.exports = {
+ /*
+ * Main entry point into dotenv. Allows configuration before loading .env and .env.$NODE_ENV
+ * @param {Object} options - valid options: path ('.env'), encoding ('utf8')
+ * @returns {Boolean}
+ */
+ config: function (options) {
+ var path = '.env'
+ var encoding = 'utf8'
+ var silent = false
+
+ if (options) {
+ if (options.silent) {
+ silent = options.silent
+ }
+ if (options.path) {
+ path = options.path
+ }
+ if (options.encoding) {
+ encoding = options.encoding
+ }
+ }
+
+ try {
+ // specifying an encoding returns a string instead of a buffer
+ var parsedObj = this.parse(fs.readFileSync(path, { encoding: encoding }))
+
+ Object.keys(parsedObj).forEach(function (key) {
+ process.env[key] = process.env[key] || parsedObj[key]
+ })
+
+ return true
+ } catch(e) {
+ if (!silent) {
+ console.error(e)
+ }
+ return false
+ }
+ },
+
+ /*
+ * Parses a string or buffer into an object
+ * @param {String|Buffer} src - source to be parsed
+ * @returns {Object}
+ */
+ parse: function (src) {
+ var obj = {}
+
+ // convert Buffers before splitting into lines and processing
+ src.toString().split('\n').forEach(function (line) {
+ // matching "KEY' and 'VAL' in 'KEY=VAL'
+ var keyValueArr = line.match(/^\s*([\w\.\-]+)\s*=\s*(.*)?\s*$/)
+ // matched?
+ if (keyValueArr != null) {
+ var key = keyValueArr[1]
+
+ // default undefined or missing values to empty string
+ var value = keyValueArr[2] ? keyValueArr[2] : ''
+
+ // expand newlines in quoted values
+ var len = value ? value.length : 0
+ if (len > 0 && value.charAt(0) === '\"' && value.charAt(len - 1) === '\"') {
+ value = value.replace(/\\n/gm, '\n')
+ }
+
+ // remove any surrounding quotes and extra spaces
+ value = value.replace(/(^['"]|['"]$)/g, '').trim()
+
+ // is this value a variable?
+ if (value.charAt(0) === '$') {
+ var possibleVar = value.substring(1)
+ value = obj[possibleVar] || process.env[possibleVar] || ''
+ }
+ // varaible can be escaped with a \$
+ if (value.substring(0, 2) === '\\$') {
+ value = value.substring(1)
+ }
+
+ obj[key] = value
+ }
+ })
+
+ return obj
+ }
+
+}
+
+module.exports.load = module.exports.config
diff --git a/octorun/node_modules/dotenv/package.json b/octorun/node_modules/dotenv/package.json
new file mode 100644
index 000000000..1b6ba7497
--- /dev/null
+++ b/octorun/node_modules/dotenv/package.json
@@ -0,0 +1,94 @@
+{
+ "_args": [
+ [
+ "dotenv@^1.0.0",
+ "C:\\Users\\Spade\\Projects\\GitHub\\Unity\\octorun"
+ ]
+ ],
+ "_from": "dotenv@>=1.0.0 <2.0.0",
+ "_id": "dotenv@1.2.0",
+ "_inCache": true,
+ "_location": "/dotenv",
+ "_nodeVersion": "1.2.0",
+ "_npmUser": {
+ "email": "jacoblowe2.0@gmail.com",
+ "name": "jcblw"
+ },
+ "_npmVersion": "2.10.1",
+ "_phantomChildren": {},
+ "_requested": {
+ "name": "dotenv",
+ "raw": "dotenv@^1.0.0",
+ "rawSpec": "^1.0.0",
+ "scope": null,
+ "spec": ">=1.0.0 <2.0.0",
+ "type": "range"
+ },
+ "_requiredBy": [
+ "/"
+ ],
+ "_resolved": "https://registry.npmjs.org/dotenv/-/dotenv-1.2.0.tgz",
+ "_shasum": "7cd73e16e07f057c8072147a5bc3a8677f0ab5c6",
+ "_shrinkwrap": null,
+ "_spec": "dotenv@^1.0.0",
+ "_where": "C:\\Users\\Spade\\Projects\\GitHub\\Unity\\octorun",
+ "author": {
+ "name": "scottmotte"
+ },
+ "bugs": {
+ "url": "https://github.com/motdotla/dotenv/issues"
+ },
+ "dependencies": {},
+ "description": "Loads environment variables from .env file",
+ "devDependencies": {
+ "lab": "^5.3.0",
+ "semver": "^4.3.6",
+ "should": "4.4.2",
+ "sinon": "1.12.2",
+ "standard": "^2.10.0"
+ },
+ "directories": {},
+ "dist": {
+ "shasum": "7cd73e16e07f057c8072147a5bc3a8677f0ab5c6",
+ "tarball": "https://registry.npmjs.org/dotenv/-/dotenv-1.2.0.tgz"
+ },
+ "gitHead": "940d101b4df66157cf752b611fd2292060878b44",
+ "homepage": "https://github.com/motdotla/dotenv#readme",
+ "installable": true,
+ "keywords": [
+ ".env",
+ "config",
+ "dotenv",
+ "env",
+ "environment",
+ "settings",
+ "variables"
+ ],
+ "license": "BSD-2-Clause",
+ "main": "lib/main.js",
+ "maintainers": [
+ {
+ "name": "scottmotte",
+ "email": "scott@scottmotte.com"
+ },
+ {
+ "name": "jcblw",
+ "email": "jacoblowe2.0@gmail.com"
+ },
+ {
+ "name": "motdotla",
+ "email": "mot@mot.la"
+ }
+ ],
+ "name": "dotenv",
+ "optionalDependencies": {},
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/motdotla/dotenv.git"
+ },
+ "scripts": {
+ "lint": "standard",
+ "test": "lab test/* --coverage && standard"
+ },
+ "version": "1.2.0"
+}
diff --git a/octorun/node_modules/dotenv/test/config.js b/octorun/node_modules/dotenv/test/config.js
new file mode 100644
index 000000000..1f96300b5
--- /dev/null
+++ b/octorun/node_modules/dotenv/test/config.js
@@ -0,0 +1,38 @@
+'use strict'
+
+require('should')
+var child_process = require('child_process')
+var semver = require('semver')
+// var sinon = require('sinon')
+var Lab = require('lab')
+var lab = exports.lab = Lab.script()
+var describe = lab.experiment
+// var before = lab.before
+// var beforeEach = lab.beforeEach
+// var afterEach = lab.afterEach
+var it = lab.test
+var nodeBinary = process.argv[0]
+
+describe('config', function () {
+ describe('preload', function () {
+ it('loads .env', function (done) {
+ // preloading was introduced in v1.6.0 so skip test for other environments
+ if (semver.lt(process.env.npm_config_node_version, '1.6.0')) {
+ return done()
+ }
+
+ child_process.exec(
+ nodeBinary + ' -r ../config -e "console.log(process.env.BASIC)" dotenv_config_path=./test/.env',
+ function (err, stdout, stderr) {
+ if (err) {
+ return done(err)
+ }
+
+ stdout.trim().should.eql('basic')
+
+ done()
+ }
+ )
+ })
+ })
+})
diff --git a/octorun/node_modules/dotenv/test/main.js b/octorun/node_modules/dotenv/test/main.js
new file mode 100644
index 000000000..8d539d0a9
--- /dev/null
+++ b/octorun/node_modules/dotenv/test/main.js
@@ -0,0 +1,204 @@
+'use strict'
+
+require('should')
+var sinon = require('sinon')
+var Lab = require('lab')
+var lab = exports.lab = Lab.script()
+var describe = lab.experiment
+var before = lab.before
+var beforeEach = lab.beforeEach
+var afterEach = lab.afterEach
+var it = lab.test
+var fs = require('fs')
+var dotenv = require('../lib/main')
+var s
+
+describe('dotenv', function () {
+ beforeEach(function (done) {
+ s = sinon.sandbox.create()
+ done()
+ })
+
+ afterEach(function (done) {
+ s.restore()
+ done()
+ })
+
+ describe('config', function () {
+ var readFileSyncStub, parseStub
+
+ beforeEach(function (done) {
+ readFileSyncStub = s.stub(fs, 'readFileSync').returns('test=val')
+ parseStub = s.stub(dotenv, 'parse').returns({test: 'val'})
+ done()
+ })
+
+ it('takes option for path', function (done) {
+ var testPath = 'test/.env'
+ dotenv.config({path: testPath})
+
+ readFileSyncStub.args[0][0].should.eql(testPath)
+ done()
+ })
+
+ it('takes option for encoding', function (done) {
+ var testEncoding = 'base64'
+ dotenv.config({encoding: testEncoding})
+
+ readFileSyncStub.args[0][1].should.have.property('encoding', testEncoding)
+ done()
+ })
+
+ it('reads path with encoding, parsing output to process.env', function (done) {
+ dotenv.config()
+
+ readFileSyncStub.callCount.should.eql(1)
+ parseStub.callCount.should.eql(1)
+ done()
+ })
+
+ it('makes load a synonym of config', function (done) {
+ dotenv.load()
+
+ readFileSyncStub.callCount.should.eql(1)
+ parseStub.callCount.should.eql(1)
+ done()
+ })
+
+ it('does not write over keys already in process.env', function (done) {
+ process.env.TEST = 'test'
+ // 'val' returned as value in `beforeEach`. should keep this 'test'
+ dotenv.config()
+
+ process.env.TEST.should.eql('test')
+ done()
+ })
+
+ it('catches any errors thrown from reading file or parsing', function (done) {
+ var errorStub = s.stub(console, 'error')
+ readFileSyncStub.throws()
+
+ dotenv.config().should.eql(false)
+ errorStub.callCount.should.eql(1)
+ done()
+ })
+
+ it('takes option for silencing errors', function (done) {
+ var errorStub = s.stub(console, 'error')
+ readFileSyncStub.throws()
+
+ dotenv.config({silent: true}).should.eql(false)
+ errorStub.called.should.be.false
+ done()
+ })
+
+ })
+
+ describe('parse', function () {
+ var parsed
+ before(function (done) {
+ process.env.TEST = 'test'
+ parsed = dotenv.parse(fs.readFileSync('test/.env', {encoding: 'utf8'}))
+ done()
+ })
+
+ it('should return an object', function (done) {
+ parsed.should.be.an.instanceOf(Object)
+ done()
+ })
+
+ it('should parse a buffer from a file into an object', function (done) {
+ var buffer = new Buffer('BASIC=basic')
+
+ var payload = dotenv.parse(buffer)
+ payload.should.have.property('BASIC', 'basic')
+ done()
+ })
+
+ it('sets basic environment variable', function (done) {
+ parsed.BASIC.should.eql('basic')
+ done()
+ })
+
+ it('reads after a skipped line', function (done) {
+ parsed.AFTER_LINE.should.eql('after_line')
+ done()
+ })
+
+ describe('expanding variables', function () {
+ before(function (done) {
+ process.env.BASIC = 'should_not_be_chosen_because_exists_in_local_env'
+ done()
+ })
+
+ it('expands environment variables like $BASIC', function (done) {
+ parsed.BASIC_EXPAND.should.eql('basic')
+ done()
+ })
+
+ it('prioritizes .env file value (if exists)', function (done) {
+ parsed.BASIC_EXPAND.should.eql('basic')
+ done()
+ })
+
+ it('defers to process.env', function (done) {
+ // from `before`
+ parsed.TEST_EXPAND.should.eql('test')
+ done()
+ })
+
+ it('defaults missing variables to an empty string', function (done) {
+ parsed.UNDEFINED_EXPAND.should.eql('')
+ done()
+ })
+
+ it('does not expand escaped variables', function (done) {
+ parsed.ESCAPED_EXPAND.should.equal('$ESCAPED')
+ done()
+ })
+ })
+
+ it('defaults empty values to empty string', function (done) {
+ parsed.EMPTY.should.eql('')
+ done()
+ })
+
+ it('escapes double quoted values', function (done) {
+ parsed.DOUBLE_QUOTES.should.eql('double_quotes')
+ done()
+ })
+
+ it('escapes single quoted values', function (done) {
+ parsed.SINGLE_QUOTES.should.eql('single_quotes')
+ done()
+ })
+
+ it('expands newlines but only if double quoted', function (done) {
+ parsed.EXPAND_NEWLINES.should.eql('expand\nnewlines')
+ parsed.DONT_EXPAND_NEWLINES_1.should.eql('dontexpand\\nnewlines')
+ parsed.DONT_EXPAND_NEWLINES_2.should.eql('dontexpand\\nnewlines')
+ done()
+ })
+
+ it('ignores commented lines', function (done) {
+ parsed.should.not.have.property('COMMENTS')
+ done()
+ })
+
+ it('respects equals signs in values', function (done) {
+ parsed.EQUAL_SIGNS.should.eql('equals==')
+ done()
+ })
+
+ it('retains inner quotes', function (done) {
+ parsed.RETAIN_INNER_QUOTES.should.eql('{\"foo\": \"bar\"}')
+ parsed.RETAIN_INNER_QUOTES_AS_STRING.should.eql('{\"foo\": \"bar\"}')
+ done()
+ })
+
+ it('retains spaces in string', function (done) {
+ parsed.INCLUDE_SPACE.should.eql('some spaced out string')
+ done()
+ })
+ })
+})
diff --git a/octorun/node_modules/octokit-rest-for-node-v0.12/.travis.yml b/octorun/node_modules/octokit-rest-for-node-v0.12/.travis.yml
new file mode 100644
index 000000000..80f68c488
--- /dev/null
+++ b/octorun/node_modules/octokit-rest-for-node-v0.12/.travis.yml
@@ -0,0 +1,16 @@
+language: node_js
+node_js: lts/*
+cache:
+ directories:
+ - ~/.npm
+
+# Trigger a push build on master and greenkeeper branches + PRs build on every branches
+# Avoid double build on PRs (See https://github.com/travis-ci/travis-ci/issues/1147)
+branches:
+only:
+- master
+- /^greenkeeper.*$/
+
+before_script: npm run build
+script: npx node@0.12 test.js
+after_success: npm run semantic-release
diff --git a/octorun/node_modules/octokit-rest-for-node-v0.12/LICENSE.md b/octorun/node_modules/octokit-rest-for-node-v0.12/LICENSE.md
new file mode 100644
index 000000000..ff6354043
--- /dev/null
+++ b/octorun/node_modules/octokit-rest-for-node-v0.12/LICENSE.md
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2018 Gregor Martynus
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/octorun/node_modules/octokit-rest-for-node-v0.12/README.md b/octorun/node_modules/octokit-rest-for-node-v0.12/README.md
new file mode 100644
index 000000000..869619eba
--- /dev/null
+++ b/octorun/node_modules/octokit-rest-for-node-v0.12/README.md
@@ -0,0 +1,31 @@
+# @octokit/rest for Node v0.12
+
+[](https://travis-ci.org/gr2m/octokit-rest-for-node-v0.12) [](https://greenkeeper.io/)
+
+⚠️ This is for an internal project, don’t ask ¯\\\_(ツ)\_/¯ Use at your own risk
+
+## Build
+
+```
+npm run build
+```
+
+This creates `build.js`
+
+## Run tests
+
+Run test in Node v0.12 with
+
+```
+GH_TOKEN=... node test.js
+```
+
+Or using `npx`
+
+```
+GH_TOKEN=... npx node@0.12 test.js
+```
+
+## License
+
+[MIT](LICENSE.md)
diff --git a/octorun/node_modules/octokit-rest-for-node-v0.12/build.js b/octorun/node_modules/octokit-rest-for-node-v0.12/build.js
new file mode 100644
index 000000000..06ea80373
--- /dev/null
+++ b/octorun/node_modules/octokit-rest-for-node-v0.12/build.js
@@ -0,0 +1,30518 @@
+"use strict";
+var _createClass = (function() {
+ function defineProperties(target, props) {
+ for (var i = 0; i < props.length; i++) {
+ var descriptor = props[i];
+ descriptor.enumerable = descriptor.enumerable || false;
+ descriptor.configurable = true;
+ if ("value" in descriptor) descriptor.writable = true;
+ Object.defineProperty(target, descriptor.key, descriptor);
+ }
+ }
+ return function(Constructor, protoProps, staticProps) {
+ if (protoProps) defineProperties(Constructor.prototype, protoProps);
+ if (staticProps) defineProperties(Constructor, staticProps);
+ return Constructor;
+ };
+})();
+var _extends =
+ Object.assign ||
+ function(target) {
+ for (var i = 1; i < arguments.length; i++) {
+ var source = arguments[i];
+ for (var key in source) {
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
+ target[key] = source[key];
+ }
+ }
+ }
+ return target;
+ };
+var _typeof =
+ typeof Symbol === "function" && typeof Symbol.iterator === "symbol"
+ ? function(obj) {
+ return typeof obj;
+ }
+ : function(obj) {
+ return obj &&
+ typeof Symbol === "function" &&
+ obj.constructor === Symbol &&
+ obj !== Symbol.prototype
+ ? "symbol"
+ : typeof obj;
+ };
+function _classCallCheck(instance, Constructor) {
+ if (!(instance instanceof Constructor)) {
+ throw new TypeError("Cannot call a class as a function");
+ }
+}
+function _possibleConstructorReturn(self, call) {
+ if (!self) {
+ throw new ReferenceError(
+ "this hasn't been initialised - super() hasn't been called"
+ );
+ }
+ return call && (typeof call === "object" || typeof call === "function")
+ ? call
+ : self;
+}
+function _inherits(subClass, superClass) {
+ if (typeof superClass !== "function" && superClass !== null) {
+ throw new TypeError(
+ "Super expression must either be null or a function, not " +
+ typeof superClass
+ );
+ }
+ subClass.prototype = Object.create(superClass && superClass.prototype, {
+ constructor: {
+ value: subClass,
+ enumerable: false,
+ writable: true,
+ configurable: true
+ }
+ });
+ if (superClass)
+ Object.setPrototypeOf
+ ? Object.setPrototypeOf(subClass, superClass)
+ : (subClass.__proto__ = superClass);
+}
+(function(f) {
+ if (
+ (typeof exports === "undefined" ? "undefined" : _typeof(exports)) ===
+ "object" &&
+ typeof module !== "undefined"
+ ) {
+ module.exports = f();
+ } else if (typeof define === "function" && define.amd) {
+ define([], f);
+ } else {
+ var g;
+ if (typeof window !== "undefined") {
+ g = window;
+ } else if (typeof global !== "undefined") {
+ g = global;
+ } else if (typeof self !== "undefined") {
+ g = self;
+ } else {
+ g = this;
+ }
+ g.Octokit = f();
+ }
+})(function() {
+ var define, module, exports;
+ return (function() {
+ function e(t, n, r) {
+ function s(o, u) {
+ if (!n[o]) {
+ if (!t[o]) {
+ var a = typeof require == "function" && require;
+ if (!u && a) return a(o, !0);
+ if (i) return i(o, !0);
+ var f = new Error("Cannot find module '" + o + "'");
+ throw ((f.code = "MODULE_NOT_FOUND"), f);
+ }
+ var l = (n[o] = { exports: {} });
+ t[o][0].call(
+ l.exports,
+ function(e) {
+ var n = t[o][1][e];
+ return s(n ? n : e);
+ },
+ l,
+ l.exports,
+ e,
+ t,
+ n,
+ r
+ );
+ }
+ return n[o].exports;
+ }
+ var i = typeof require == "function" && require;
+ for (var o = 0; o < r.length; o++) {
+ s(r[o]);
+ }
+ return s;
+ }
+ return e;
+ })()(
+ {
+ 1: [
+ function(require, module, exports) {
+ // Buffer.from polyfill
+ if (!Buffer.from) {
+ Buffer.from = function(data, encoding, length) {
+ return new Buffer(data, encoding, length);
+ };
+ }
+ module.exports = require("@octokit/rest");
+ },
+ { "@octokit/rest": 2 }
+ ],
+ 2: [
+ function(require, module, exports) {
+ module.exports = GitHubApi;
+ var defaultsDeep = require("lodash/defaultsDeep");
+ var Hook = require("before-after-hook");
+ var parseClientOptions = require("./lib/parse-client-options");
+ var _request = require("./lib/request");
+ var ENDPOINT_DEFAULTS = require("./lib/endpoint").DEFAULTS;
+ var PLUGINS = [
+ require("./lib/plugins/authentication"),
+ require("./lib/plugins/endpoint-methods"),
+ require("./lib/plugins/pagination")
+ ];
+ function GitHubApi(options) {
+ var defaults = defaultsDeep(
+ parseClientOptions(options),
+ ENDPOINT_DEFAULTS
+ );
+ var hook = new Hook();
+ var api = {
+ // NOTE: github.hook, github.plugin and github.request are experimental APIs
+ // at this point and can change at any time
+ hook: hook,
+ plugin: function plugin(pluginFunction) {
+ return pluginFunction(api);
+ },
+ request: function request(options) {
+ return api.hook(
+ "request",
+ defaultsDeep(options, defaults),
+ _request
+ );
+ }
+ };
+ PLUGINS.forEach(api.plugin);
+ return api;
+ }
+ },
+ {
+ "./lib/endpoint": 7,
+ "./lib/parse-client-options": 8,
+ "./lib/plugins/authentication": 11,
+ "./lib/plugins/endpoint-methods": 13,
+ "./lib/plugins/pagination": 26,
+ "./lib/request": 28,
+ "before-after-hook": 32,
+ "lodash/defaultsDeep": 128
+ }
+ ],
+ 3: [
+ function(require, module, exports) {
+ module.exports = {
+ ca: undefined,
+ family: undefined, // 4 for v4, 6 for v6
+ headers: {},
+ host: "api.github.com",
+ pathPrefix: "", // for GitHub Enterprise
+ port: undefined,
+ protocol: "https",
+ proxy: undefined,
+ rejectUnauthorized: true,
+ requestMedia: "application/vnd.github.v3+json",
+ timeout: 0
+ };
+ },
+ {}
+ ],
+ 4: [
+ function(require, module, exports) {
+ module.exports = addQueryParameters;
+ function addQueryParameters(url, parameters) {
+ var separator = /\?/.test(url) ? "&" : "?";
+ var names = Object.keys(parameters);
+ if (names.length === 0) {
+ return url;
+ }
+ return (
+ url +
+ separator +
+ names
+ .map(function(name) {
+ if (name === "q") {
+ return (
+ "q=" +
+ parameters.q
+ .split("+")
+ .map(encodeURIComponent)
+ .join("+")
+ );
+ }
+ return name + "=" + encodeURIComponent(parameters[name]);
+ })
+ .join("&")
+ );
+ }
+ },
+ {}
+ ],
+ 5: [
+ function(require, module, exports) {
+ var pkg = require("../../package.json");
+ module.exports = {
+ method: "get",
+ baseUrl: "https://api.github.com",
+ headers: {
+ accept: "application/vnd.github.v3+json",
+ "user-agent": "octokit/rest.js v" + pkg.version
+ },
+ request: {}
+ };
+ },
+ { "../../package.json": 31 }
+ ],
+ 6: [
+ function(require, module, exports) {
+ module.exports = extractUrlVariableName;
+ var _ = require("lodash");
+ var urlVariableRegex = /\{[^}]+\}/g;
+ function extractUrlVariableName(url) {
+ var matches = url.match(urlVariableRegex);
+ if (!matches) {
+ return [];
+ }
+ return _.flatten(matches.map(removeNonChars));
+ }
+ function removeNonChars(variableName) {
+ return variableName.replace(/^\W+|\W+$/g, "").split(/,/);
+ }
+ },
+ { lodash: 144 }
+ ],
+ 7: [
+ function(require, module, exports) {
+ "use strict";
+ module.exports = restEndpoint;
+ var _ = require("lodash");
+ var urlTemplate = require("url-template");
+ var addQueryParameters = require("./add-query-parameters");
+ var extractUrlVariableNames = require("./extract-url-variable-names");
+ var DEFAULTS = (module.exports.DEFAULTS = require("./defaults"));
+ var NON_PARAMETERS = ["request", "baseUrl"];
+ function restEndpoint(options) {
+ options = _.defaultsDeep({}, options, DEFAULTS);
+ var method = options.method;
+ var baseUrl = options.baseUrl;
+ var url = options.url;
+ var body = options.body;
+ var headers = options.headers;
+ var remainingOptions = _.omit(options, [
+ "method",
+ "baseUrl",
+ "url",
+ "headers"
+ ]);
+ method = method.toLowerCase();
+ headers = _.mapKeys(headers, function(value, key) {
+ return key.toLowerCase();
+ }); // replace :varname with {varname} to make it RFC 6570 compatible
+ url = url.replace(/:(\w+)/g, "{+$1}"); // extract variable names from URL to calculate remaining variables later
+ var urlVariableNames = extractUrlVariableNames(url);
+ url = urlTemplate.parse(url).expand(remainingOptions);
+ if (!/^http/.test(url)) {
+ url = baseUrl + url;
+ }
+ var requestOptions = remainingOptions.request;
+ remainingOptions = _.omit(
+ remainingOptions,
+ _.intersection(Object.keys(options), urlVariableNames).concat(
+ NON_PARAMETERS
+ )
+ );
+ if (method === "get" || method === "head") {
+ url = addQueryParameters(url, remainingOptions);
+ } else {
+ if ("input" in remainingOptions) {
+ body = remainingOptions.input;
+ } else {
+ body = Object.keys(remainingOptions).length
+ ? remainingOptions
+ : undefined;
+ }
+ }
+ return _extends(requestOptions, {
+ method: method,
+ url: url,
+ headers: headers,
+ body: body
+ });
+ }
+ },
+ {
+ "./add-query-parameters": 4,
+ "./defaults": 5,
+ "./extract-url-variable-names": 6,
+ lodash: 144,
+ "url-template": 152
+ }
+ ],
+ 8: [
+ function(require, module, exports) {
+ module.exports = parseOptions;
+ var _ = require("lodash");
+ var DEFAULTS = require("./defaults");
+ var OPTION_NAMES = [
+ "timeout",
+ "host",
+ "pathPrefix",
+ "protocol",
+ "port",
+ "proxy",
+ "ca",
+ "headers",
+ "requestMedia",
+ "rejectUnauthorized",
+ "family"
+ ];
+ function parseOptions(options) {
+ if (!options) {
+ options = {};
+ }
+ if ("followRedirects" in options) {
+ console.warn(
+ "DEPRECATED: followRedirects option is no longer supported. All redirects are followed correctly"
+ );
+ }
+ if ("Promise" in options) {
+ console.warn(
+ "DEPRECATED: Promise option is no longer supported. The native Promise API is used"
+ );
+ }
+ options = _.defaults(_.pick(options, OPTION_NAMES), DEFAULTS);
+ var defaults = {
+ headers: options.headers,
+ request: {
+ ca: options.ca,
+ family: options.family,
+ proxy: options.proxy,
+ rejectUnauthorized: options.rejectUnauthorized,
+ timeout: options.timeout
+ }
+ };
+ defaults.baseUrl = options.protocol + "://" + options.host;
+ if (options.port) {
+ defaults.baseUrl += ":" + options.port;
+ } // Check if a prefix is passed in the options and strip any leading or trailing slashes from it.
+ if (options.pathPrefix) {
+ defaults.baseUrl +=
+ "/" + options.pathPrefix.replace(/(^[/]+|[/]+$)/g, "");
+ }
+ return defaults;
+ }
+ },
+ { "./defaults": 3, lodash: 144 }
+ ],
+ 9: [
+ function(require, module, exports) {
+ module.exports = authenticate;
+ function authenticate(state, options) {
+ if (!options) {
+ state.auth = false;
+ return;
+ }
+ switch (options.type) {
+ case "basic":
+ if (!options.username || !options.password) {
+ throw new Error(
+ "Basic authentication requires both a username and password to be set"
+ );
+ }
+ break;
+ case "oauth":
+ if (!options.token && !(options.key && options.secret)) {
+ throw new Error(
+ "OAuth2 authentication requires a token or key & secret to be set"
+ );
+ }
+ break;
+ case "token":
+ case "integration":
+ if (!options.token) {
+ throw new Error(
+ "Token authentication requires a token to be set"
+ );
+ }
+ break;
+ default:
+ throw new Error(
+ "Invalid authentication type, must be 'basic', 'integration', or 'oauth'"
+ );
+ }
+ state.auth = options;
+ }
+ },
+ {}
+ ],
+ 10: [
+ function(require, module, exports) {
+ module.exports = authenticationBeforeRequest;
+ function authenticationBeforeRequest(state, options) {
+ if (!state.auth.type) {
+ return;
+ }
+ if (state.auth.type === "basic") {
+ var hash = Buffer.from(
+ state.auth.username + ":" + state.auth.password,
+ "ascii"
+ ).toString("base64");
+ options.headers["authorization"] = "Basic " + hash;
+ return;
+ }
+ if (state.auth.type === "token") {
+ options.headers["authorization"] = "token " + state.auth.token;
+ return;
+ }
+ if (state.auth.type === "integration") {
+ options.headers["authorization"] = "Bearer " + state.auth.token;
+ options.headers["accept"] =
+ "application/vnd.github.machine-man-preview+json";
+ return;
+ }
+ options.url += options.url.indexOf("?") === -1 ? "?" : "&";
+ if (state.auth.token) {
+ options.url +=
+ "access_token=" + encodeURIComponent(state.auth.token);
+ return;
+ }
+ var key = encodeURIComponent(state.auth.key);
+ var secret = encodeURIComponent(state.auth.secret);
+ options.url += "client_id=" + key + "&client_secret=" + secret;
+ }
+ },
+ {}
+ ],
+ 11: [
+ function(require, module, exports) {
+ module.exports = authenticationPlugin;
+ var authenticate = require("./authenticate");
+ var beforeRequest = require("./before-request");
+ function authenticationPlugin(octokit) {
+ var state = { auth: false };
+ octokit.authenticate = authenticate.bind(null, state);
+ octokit.hook.before("request", beforeRequest.bind(null, state));
+ }
+ },
+ { "./authenticate": 9, "./before-request": 10 }
+ ],
+ 12: [
+ function(require, module, exports) {
+ module.exports = deprecate;
+ function deprecate(func, message) {
+ return function() {
+ var caller = new Error().stack.split("\n")[2];
+ console.warn("DEPRECATED: " + message);
+ console.warn(caller);
+ return func.apply(null, arguments);
+ };
+ }
+ },
+ {}
+ ],
+ 13: [
+ function(require, module, exports) {
+ module.exports = apiPlugin;
+ var _ = require("lodash");
+ var method = require("./method");
+ var deprecate = require("./deprecate");
+ var ENDPOINT_DEFAULTS = require("../../routes.json");
+ function apiPlugin(octokit) {
+ Object.keys(ENDPOINT_DEFAULTS).forEach(function(namespaceName) {
+ octokit[namespaceName] = {};
+ Object.keys(ENDPOINT_DEFAULTS[namespaceName]).forEach(function(
+ apiName
+ ) {
+ var apiOptions = ENDPOINT_DEFAULTS[namespaceName][apiName];
+ var endpointDefaults = _.pick(apiOptions, [
+ "method",
+ "url",
+ "headers",
+ "request"
+ ]);
+ octokit[namespaceName][apiName] = method.bind(
+ null,
+ octokit,
+ endpointDefaults,
+ apiOptions.params
+ ); // log deprecation warning for APIs flagged as deprecated
+ if (apiOptions.deprecated) {
+ octokit[namespaceName][apiName] = deprecate(
+ octokit[namespaceName][apiName],
+ apiOptions.deprecated
+ );
+ }
+ });
+ });
+ }
+ },
+ {
+ "../../routes.json": 30,
+ "./deprecate": 12,
+ "./method": 14,
+ lodash: 144
+ }
+ ],
+ 14: [
+ function(require, module, exports) {
+ module.exports = apiMethod;
+ var defaultsDeep = require("lodash/defaultsDeep");
+ var validate = require("./validate");
+ function apiMethod(
+ octokit,
+ endpointDefaults,
+ endpointParams,
+ options,
+ callback
+ ) {
+ var endpointOptions = defaultsDeep(options, endpointDefaults);
+ var promise = Promise.resolve(endpointOptions)
+ .then(validate.bind(null, endpointParams))
+ .then(octokit.request);
+ if (callback) {
+ promise.then(callback.bind(null, null), callback);
+ return;
+ }
+ return promise;
+ }
+ },
+ { "./validate": 15, "lodash/defaultsDeep": 128 }
+ ],
+ 15: [
+ function(require, module, exports) {
+ "use strict";
+ module.exports = validate;
+ var set = require("lodash/set");
+ var HttpError = require("../../request/http-error");
+ function validate(endpointParams, options) {
+ Object.keys(endpointParams).forEach(function(parameterName) {
+ var parameter = endpointParams[parameterName];
+ var expectedType = parameter.type;
+ var value = options[parameterName];
+ var paramIsPresent = parameterName in options;
+ var paramIsNull = value === null;
+ if (!parameter.required && !paramIsPresent) {
+ return;
+ }
+ if (parameter["allow-null"] === true && paramIsNull) {
+ return;
+ }
+ if (
+ (parameter.required && !paramIsPresent) ||
+ (parameter["allow-null"] === false && paramIsNull)
+ ) {
+ throw new HttpError(
+ "Empty value for parameter '" + parameterName + "': " + value,
+ 400
+ );
+ }
+ if (parameter.enum) {
+ if (parameter.enum.indexOf(value) === -1) {
+ throw new HttpError(
+ "Invalid value for parameter '" +
+ parameterName +
+ "': " +
+ value,
+ 400
+ );
+ }
+ }
+ if (parameter.validation) {
+ var regex = new RegExp(parameter.validation);
+ if (!regex.test(value)) {
+ throw new HttpError(
+ "Invalid value for parameter '" +
+ parameterName +
+ "': " +
+ value,
+ 400
+ );
+ }
+ }
+ if (expectedType === "number") {
+ value = parseInt(value, 10);
+ if (isNaN(value)) {
+ throw new HttpError(
+ "Invalid value for parameter '" +
+ parameterName +
+ "': " +
+ options[parameterName] +
+ " is NaN",
+ 400
+ );
+ }
+ }
+ if (expectedType === "json" && typeof value === "string") {
+ try {
+ value = JSON.parse(value);
+ } catch (exception) {
+ throw new HttpError(
+ "JSON parse error of value for parameter '" +
+ parameterName +
+ "': " +
+ value,
+ 400
+ );
+ }
+ }
+ set(options, parameter.mapTo || parameterName, value);
+ });
+ return options;
+ }
+ },
+ { "../../request/http-error": 27, "lodash/set": 147 }
+ ],
+ 16: [
+ function(require, module, exports) {
+ module.exports = getFirstPage;
+ var getPage = require("./get-page");
+ function getFirstPage(octokit, link, headers, callback) {
+ return getPage(octokit, link, "first", headers, callback);
+ }
+ },
+ { "./get-page": 20 }
+ ],
+ 17: [
+ function(require, module, exports) {
+ module.exports = getLastPage;
+ var getPage = require("./get-page");
+ function getLastPage(octokit, link, headers, callback) {
+ return getPage(octokit, link, "last", headers, callback);
+ }
+ },
+ { "./get-page": 20 }
+ ],
+ 18: [
+ function(require, module, exports) {
+ module.exports = getNextPage;
+ var getPage = require("./get-page");
+ function getNextPage(octokit, link, headers, callback) {
+ return getPage(octokit, link, "next", headers, callback);
+ }
+ },
+ { "./get-page": 20 }
+ ],
+ 19: [
+ function(require, module, exports) {
+ module.exports = getPageLinks;
+ function getPageLinks(link) {
+ link = link.link || link.meta.link || "";
+ var links = {}; // link format:
+ // '; rel="next", ; rel="last"'
+ link.replace(/<([^>]*)>;\s*rel="([\w]*)"/g, function(m, uri, type) {
+ links[type] = uri;
+ });
+ return links;
+ }
+ },
+ {}
+ ],
+ 20: [
+ function(require, module, exports) {
+ module.exports = getPage;
+ var HttpError = require("../../request/http-error");
+ var getPageLinks = require("./get-page-links");
+ function getPage(octokit, link, which, headers, callback) {
+ if (typeof headers === "function") {
+ callback = headers;
+ headers = null;
+ }
+ var url = getPageLinks(link)[which];
+ if (!url) {
+ var urlError = new HttpError("No " + which + " page found", 404);
+ if (callback) {
+ return callback(urlError);
+ }
+ return Promise.reject(urlError);
+ }
+ var requestOptions = {
+ url: url,
+ headers: applyAcceptHeader(link, headers)
+ };
+ var promise = octokit.request(requestOptions);
+ if (callback) {
+ promise.then(callback.bind(null, null), callback);
+ return;
+ }
+ return promise;
+ }
+ function applyAcceptHeader(res, headers) {
+ var previous = res.meta && res.meta["x-github-media-type"];
+ if (!previous || (headers && headers.accept)) {
+ return headers;
+ }
+ headers = headers || {};
+ headers.accept =
+ "application/vnd." + previous.replace("; format=", "+");
+ return headers;
+ }
+ },
+ { "../../request/http-error": 27, "./get-page-links": 19 }
+ ],
+ 21: [
+ function(require, module, exports) {
+ module.exports = getPreviousPage;
+ var getPage = require("./get-page");
+ function getPreviousPage(octokit, link, headers, callback) {
+ return getPage(octokit, link, "prev", headers, callback);
+ }
+ },
+ { "./get-page": 20 }
+ ],
+ 22: [
+ function(require, module, exports) {
+ module.exports = hasFirstPage;
+ var getPageLinks = require("./get-page-links");
+ function hasFirstPage(link) {
+ return getPageLinks(link).first;
+ }
+ },
+ { "./get-page-links": 19 }
+ ],
+ 23: [
+ function(require, module, exports) {
+ module.exports = hasLastPage;
+ var getPageLinks = require("./get-page-links");
+ function hasLastPage(link) {
+ return getPageLinks(link).last;
+ }
+ },
+ { "./get-page-links": 19 }
+ ],
+ 24: [
+ function(require, module, exports) {
+ module.exports = hasNextPage;
+ var getPageLinks = require("./get-page-links");
+ function hasNextPage(link) {
+ return getPageLinks(link).next;
+ }
+ },
+ { "./get-page-links": 19 }
+ ],
+ 25: [
+ function(require, module, exports) {
+ module.exports = hasPreviousPage;
+ var getPageLinks = require("./get-page-links");
+ function hasPreviousPage(link) {
+ return getPageLinks(link).prev;
+ }
+ },
+ { "./get-page-links": 19 }
+ ],
+ 26: [
+ function(require, module, exports) {
+ module.exports = paginationPlugin;
+ function paginationPlugin(octokit) {
+ octokit.getFirstPage = require("./get-first-page").bind(
+ null,
+ octokit
+ );
+ octokit.getLastPage = require("./get-last-page").bind(
+ null,
+ octokit
+ );
+ octokit.getNextPage = require("./get-next-page").bind(
+ null,
+ octokit
+ );
+ octokit.getPreviousPage = require("./get-previous-page").bind(
+ null,
+ octokit
+ );
+ octokit.hasFirstPage = require("./has-first-page");
+ octokit.hasLastPage = require("./has-last-page");
+ octokit.hasNextPage = require("./has-next-page");
+ octokit.hasPreviousPage = require("./has-previous-page");
+ }
+ },
+ {
+ "./get-first-page": 16,
+ "./get-last-page": 17,
+ "./get-next-page": 18,
+ "./get-previous-page": 21,
+ "./has-first-page": 22,
+ "./has-last-page": 23,
+ "./has-next-page": 24,
+ "./has-previous-page": 25
+ }
+ ],
+ 27: [
+ function(require, module, exports) {
+ "use strict";
+ var STATUS_CODES = {
+ 304: "Not Modified", // See PR #673 (https://github.com/octokit/rest.js/pull/673)
+ 400: "Bad Request",
+ 404: "Not Found",
+ 500: "Internal Server Error",
+ 504: "Gateway Timeout"
+ };
+ module.exports = (function(_Error) {
+ _inherits(HttpError, _Error);
+ function HttpError(message, code, headers) {
+ _classCallCheck(this, HttpError);
+ var _this = _possibleConstructorReturn(
+ this,
+ (HttpError.__proto__ || Object.getPrototypeOf(HttpError)).call(
+ this,
+ message
+ )
+ );
+ Error.captureStackTrace(_this, _this.constructor);
+ _this.name = "HttpError";
+ _this.code = code;
+ _this.status = STATUS_CODES[code];
+ _this.headers = headers;
+ return _this;
+ }
+ _createClass(HttpError, [
+ {
+ key: "toString",
+ value: function toString() {
+ return this.message;
+ }
+ },
+ {
+ key: "toJSON",
+ value: function toJSON() {
+ return {
+ code: this.code,
+ status: this.status,
+ message: this.message
+ };
+ }
+ }
+ ]);
+ return HttpError;
+ })(Error);
+ },
+ {}
+ ],
+ 28: [
+ function(require, module, exports) {
+ module.exports = restRequest;
+ var restEndpoint = require("../endpoint");
+ var request = require("./request");
+ function restRequest(endpointOptions) {
+ var requestOptions = restEndpoint(endpointOptions);
+ return request(requestOptions);
+ }
+ },
+ { "../endpoint": 7, "./request": 29 }
+ ],
+ 29: [
+ function(require, module, exports) {
+ "use strict";
+ module.exports = httpRequest;
+ var url = require("url");
+ var http = require("http");
+ var https = require("https");
+ var _ = require("lodash");
+ var debug = require("debug")("octokit:rest");
+ var isArrayBuffer = require("is-array-buffer");
+ var isStream = require("is-stream");
+ var HttpError = require("./http-error");
+ function httpRequest(requestOptions) {
+ requestOptions = _extends(
+ url.parse(requestOptions.url),
+ _.pick(
+ requestOptions,
+ "method",
+ "body",
+ "headers",
+ "ca",
+ "family",
+ "proxy",
+ "rejectUnauthorized",
+ "timeout"
+ )
+ );
+ debug("REQUEST:", requestOptions); // calculate content length unless body is a stream, in which case the
+ // content length is already set per option
+ if (requestOptions.body && !isStream(requestOptions.body)) {
+ // stringify body unless it’s an ArrayBuffer
+ if (
+ !isArrayBuffer(requestOptions.body) &&
+ !Buffer.isBuffer(requestOptions.body) &&
+ typeof requestOptions.body !== "string"
+ ) {
+ requestOptions.body = JSON.stringify(requestOptions.body);
+ }
+ _.defaults(requestOptions.headers, {
+ "content-type": "application/json; charset=utf-8",
+ "content-length": Buffer.byteLength(requestOptions.body, "utf8")
+ });
+ } // GitHub expects "content-length: 0" header for PUT/PATCH requests without body
+ if (
+ ["patch", "put"].indexOf(requestOptions.method) >= 0 &&
+ !requestOptions.headers["content-length"]
+ ) {
+ requestOptions.headers["content-length"] = 0;
+ }
+ if ("content-length" in requestOptions.headers) {
+ requestOptions.headers["content-length"] = parseInt(
+ requestOptions.headers["content-length"],
+ 10
+ );
+ }
+ var reqModule = requestOptions.protocol === "http:" ? http : https;
+ delete requestOptions.protocol;
+ return new Promise(function(resolve, reject) {
+ var request = reqModule.request(requestOptions, function(
+ response
+ ) {
+ debug("STATUS: " + response.statusCode);
+ debug("HEADERS: " + JSON.stringify(response.headers));
+ response.setEncoding("utf8");
+ var data = "";
+ response.on("data", function(chunk) {
+ data += chunk;
+ });
+ /* istanbul ignore next */ response.on("error", function(
+ error
+ ) {
+ reject(new HttpError(error.message, 500));
+ });
+ response.on("end", function() {
+ if (
+ response.statusCode !== 304 &&
+ response.statusCode >= 301 &&
+ response.statusCode <= 307
+ ) {
+ requestOptions.url = response.headers.location;
+ httpRequest(requestOptions).then(resolve, reject);
+ return;
+ }
+ if (
+ response.statusCode === 304 ||
+ response.statusCode >= 400 ||
+ response.statusCode < 10
+ ) {
+ reject(
+ new HttpError(data, response.statusCode, response.headers)
+ );
+ return;
+ }
+ var contentType = response.headers["content-type"];
+ if (
+ contentType &&
+ contentType.indexOf("application/json") !== -1
+ ) {
+ data = data && JSON.parse(data);
+ }
+ resolve({ meta: response.headers, data: data });
+ });
+ });
+ var aborted = void 0;
+ request.on("error", function(error) {
+ if (aborted) return;
+ debug("REQUEST ERROR: " + error.message);
+ reject(new HttpError(error.message, 500));
+ });
+ if (requestOptions.timeout) {
+ request.setTimeout(requestOptions.timeout);
+ }
+ request.on("timeout", function() {
+ debug("REQUEST ERROR: timed out");
+ request.abort();
+ aborted = true;
+ reject(new HttpError("Request timeout", 504));
+ });
+ if (requestOptions.body) {
+ if (isStream(requestOptions.body)) {
+ return requestOptions.body.pipe(request);
+ }
+ request.write(Buffer.from(requestOptions.body));
+ }
+ request.end();
+ });
+ }
+ },
+ {
+ "./http-error": 27,
+ debug: 36,
+ http: undefined,
+ https: undefined,
+ "is-array-buffer": 38,
+ "is-stream": 39,
+ lodash: 144,
+ url: undefined
+ }
+ ],
+ 30: [
+ function(require, module, exports) {
+ module.exports = {
+ authorization: {
+ get: {
+ url: "/authorizations/:id",
+ method: "GET",
+ params: { id: { type: "string", required: true } },
+ description: "Get a single authorization."
+ },
+ create: {
+ url: "/authorizations",
+ method: "POST",
+ params: {
+ scopes: {
+ type: "string[]",
+ description:
+ "A list of scopes that this authorization is in."
+ },
+ note: {
+ type: "string",
+ description:
+ "A note to remind you what the OAuth token is for."
+ },
+ note_url: {
+ type: "string",
+ description:
+ "A URL to remind you what app the OAuth token is for."
+ },
+ client_id: {
+ type: "string",
+ description:
+ "The 20 character OAuth app client key for which to create the token."
+ },
+ client_secret: {
+ type: "string",
+ description:
+ "The 40 character OAuth app client secret for which to create the token."
+ },
+ fingerprint: {
+ type: "string",
+ description:
+ "A unique string to distinguish an authorization from others created for the same client ID and user."
+ }
+ },
+ description: "Create a new authorization."
+ },
+ update: {
+ url: "/authorizations/:id",
+ method: "PATCH",
+ params: {
+ id: { type: "string", required: true },
+ scopes: {
+ type: "string[]",
+ description:
+ "A list of scopes that this authorization is in."
+ },
+ add_scopes: {
+ type: "string[]",
+ description:
+ "A list of scopes to add to this authorization."
+ },
+ remove_scopes: {
+ type: "string[]",
+ description:
+ "A list of scopes to remove from this authorization."
+ },
+ note: {
+ type: "string",
+ description:
+ "A note to remind you what the OAuth token is for."
+ },
+ note_url: {
+ type: "string",
+ description:
+ "A URL to remind you what app the OAuth token is for."
+ },
+ fingerprint: {
+ type: "string",
+ description:
+ "A unique string to distinguish an authorization from others created for the same client ID and user."
+ }
+ },
+ description: "Update an existing authorization."
+ },
+ delete: {
+ url: "/authorizations/:id",
+ method: "DELETE",
+ params: { id: { type: "string", required: true } },
+ description: "Delete an authorization."
+ },
+ check: {
+ url: "/applications/:client_id/tokens/:access_token",
+ method: "GET",
+ params: {
+ client_id: {
+ type: "string",
+ description:
+ "The 20 character OAuth app client key for which to create the token."
+ },
+ access_token: {
+ type: "string",
+ required: true,
+ description: "OAuth token"
+ }
+ },
+ description: "Check an authorization"
+ },
+ reset: {
+ url: "/applications/:client_id/tokens/:access_token",
+ method: "POST",
+ params: {
+ client_id: {
+ type: "string",
+ description:
+ "The 20 character OAuth app client key for which to create the token."
+ },
+ access_token: {
+ type: "string",
+ required: true,
+ description: "OAuth token"
+ }
+ },
+ description: "Reset an authorization"
+ },
+ revoke: {
+ url: "/applications/:client_id/tokens/:access_token",
+ method: "DELETE",
+ params: {
+ client_id: {
+ type: "string",
+ description:
+ "The 20 character OAuth app client key for which to create the token."
+ },
+ access_token: {
+ type: "string",
+ required: true,
+ description: "OAuth token"
+ }
+ },
+ description: "Revoke an authorization for an application"
+ },
+ getGrants: {
+ url: "/applications/grants",
+ method: "GET",
+ params: {
+ page: {
+ type: "number",
+ description: "Page number of the results to fetch."
+ },
+ per_page: {
+ type: "number",
+ default: "30",
+ description: "A custom page size up to 100. Default is 30."
+ }
+ },
+ description: "List your grants."
+ },
+ getGrant: {
+ url: "/applications/grants/:id",
+ method: "GET",
+ params: {
+ id: { type: "string", required: true },
+ page: {
+ type: "number",
+ description: "Page number of the results to fetch."
+ },
+ per_page: {
+ type: "number",
+ default: "30",
+ description: "A custom page size up to 100. Default is 30."
+ }
+ },
+ description: "Get a single grant."
+ },
+ deleteGrant: {
+ url: "/applications/grants/:id",
+ method: "DELETE",
+ params: { id: { type: "string", required: true } },
+ description: "Delete a grant."
+ },
+ getAll: {
+ url: "/authorizations",
+ method: "GET",
+ params: {
+ page: {
+ type: "number",
+ description: "Page number of the results to fetch."
+ },
+ per_page: {
+ type: "number",
+ default: "30",
+ description: "A custom page size up to 100. Default is 30."
+ }
+ },
+ description: "List your authorizations."
+ },
+ getOrCreateAuthorizationForApp: {
+ url: "/authorizations/clients/:client_id",
+ method: "PUT",
+ params: {
+ client_id: {
+ type: "string",
+ description:
+ "The 20 character OAuth app client key for which to create the token."
+ },
+ client_secret: {
+ type: "string",
+ required: true,
+ description:
+ "The 40 character OAuth app client secret associated with the client ID specified in the URL."
+ },
+ scopes: {
+ type: "string[]",
+ description:
+ "A list of scopes that this authorization is in."
+ },
+ note: {
+ type: "string",
+ description:
+ "A note to remind you what the OAuth token is for."
+ },
+ note_url: {
+ type: "string",
+ description:
+ "A URL to remind you what app the OAuth token is for."
+ },
+ fingerprint: {
+ type: "string",
+ description:
+ "A unique string to distinguish an authorization from others created for the same client ID and user."
+ }
+ },
+ description:
+ "Get or create an authorization for a specific app."
+ },
+ getOrCreateAuthorizationForAppAndFingerprint: {
+ url: "/authorizations/clients/:client_id/:fingerprint",
+ method: "PUT",
+ params: {
+ client_id: {
+ type: "string",
+ description:
+ "The 20 character OAuth app client key for which to create the token."
+ },
+ fingerprint: {
+ type: "string",
+ description:
+ "A unique string to distinguish an authorization from others created for the same client ID and user."
+ },
+ client_secret: {
+ type: "string",
+ required: true,
+ description:
+ "The 40 character OAuth app client secret associated with the client ID specified in the URL."
+ },
+ scopes: {
+ type: "string[]",
+ description:
+ "A list of scopes that this authorization is in."
+ },
+ note: {
+ type: "string",
+ description:
+ "A note to remind you what the OAuth token is for."
+ },
+ note_url: {
+ type: "string",
+ description:
+ "A URL to remind you what app the OAuth token is for."
+ }
+ },
+ description:
+ "Get or create an authorization for a specific app and fingerprint."
+ },
+ revokeGrant: {
+ url: "/applications/:client_id/grants/:access_token",
+ method: "DELETE",
+ params: {
+ client_id: {
+ type: "string",
+ description:
+ "The 20 character OAuth app client key for which to create the token."
+ },
+ access_token: {
+ type: "string",
+ required: true,
+ description: "OAuth token"
+ }
+ },
+ description: "Revoke a grant for an application"
+ }
+ },
+ activity: {
+ getEvents: {
+ url: "/events",
+ method: "GET",
+ params: {
+ page: {
+ type: "number",
+ description: "Page number of the results to fetch."
+ },
+ per_page: {
+ type: "number",
+ default: "30",
+ description: "A custom page size up to 100. Default is 30."
+ }
+ },
+ description: "List public events"
+ },
+ getEventsForRepo: {
+ url: "/repos/:owner/:repo/events",
+ method: "GET",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ page: {
+ type: "number",
+ description: "Page number of the results to fetch."
+ },
+ per_page: {
+ type: "number",
+ default: "30",
+ description: "A custom page size up to 100. Default is 30."
+ }
+ },
+ description: "List repository events"
+ },
+ getEventsForRepoIssues: {
+ url: "/repos/:owner/:repo/issues/events",
+ method: "GET",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ page: {
+ type: "number",
+ description: "Page number of the results to fetch."
+ },
+ per_page: {
+ type: "number",
+ default: "30",
+ description: "A custom page size up to 100. Default is 30."
+ }
+ },
+ description: "List issue events for a repository"
+ },
+ getEventsForRepoNetwork: {
+ url: "/networks/:owner/:repo/events",
+ method: "GET",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ page: {
+ type: "number",
+ description: "Page number of the results to fetch."
+ },
+ per_page: {
+ type: "number",
+ default: "30",
+ description: "A custom page size up to 100. Default is 30."
+ }
+ },
+ description: "List public events for a network of repositories"
+ },
+ getEventsForOrg: {
+ url: "/orgs/:org/events",
+ method: "GET",
+ params: {
+ org: { type: "string", required: true },
+ page: {
+ type: "number",
+ description: "Page number of the results to fetch."
+ },
+ per_page: {
+ type: "number",
+ default: "30",
+ description: "A custom page size up to 100. Default is 30."
+ }
+ },
+ description: "List public events for an organization"
+ },
+ getEventsReceived: {
+ url: "/users/:username/received_events",
+ method: "GET",
+ params: {
+ username: { type: "string", required: true },
+ page: {
+ type: "number",
+ description: "Page number of the results to fetch."
+ },
+ per_page: {
+ type: "number",
+ default: "30",
+ description: "A custom page size up to 100. Default is 30."
+ }
+ },
+ description: "List events that a user has received"
+ },
+ getEventsReceivedPublic: {
+ url: "/users/:username/received_events/public",
+ method: "GET",
+ params: {
+ username: { type: "string", required: true },
+ page: {
+ type: "number",
+ description: "Page number of the results to fetch."
+ },
+ per_page: {
+ type: "number",
+ default: "30",
+ description: "A custom page size up to 100. Default is 30."
+ }
+ },
+ description: "List public events that a user has received"
+ },
+ getEventsForUser: {
+ url: "/users/:username/events",
+ method: "GET",
+ params: {
+ username: { type: "string", required: true },
+ page: {
+ type: "number",
+ description: "Page number of the results to fetch."
+ },
+ per_page: {
+ type: "number",
+ default: "30",
+ description: "A custom page size up to 100. Default is 30."
+ }
+ },
+ description: "List events performed by a user"
+ },
+ getEventsForUserPublic: {
+ url: "/users/:username/events/public",
+ method: "GET",
+ params: {
+ username: { type: "string", required: true },
+ page: {
+ type: "number",
+ description: "Page number of the results to fetch."
+ },
+ per_page: {
+ type: "number",
+ default: "30",
+ description: "A custom page size up to 100. Default is 30."
+ }
+ },
+ description: "List public events performed by a user"
+ },
+ getEventsForUserOrg: {
+ url: "/users/:username/events/orgs/:org",
+ method: "GET",
+ params: {
+ username: { type: "string", required: true },
+ org: { type: "string", required: true },
+ page: {
+ type: "number",
+ description: "Page number of the results to fetch."
+ },
+ per_page: {
+ type: "number",
+ default: "30",
+ description: "A custom page size up to 100. Default is 30."
+ }
+ },
+ description: "List events for a user's organization"
+ },
+ getFeeds: {
+ url: "/feeds",
+ method: "GET",
+ params: {},
+ description:
+ "Get all feeds available for the authenticated user."
+ },
+ getNotifications: {
+ url: "/notifications",
+ method: "GET",
+ params: {
+ all: {
+ type: "boolean",
+ default: "false",
+ description:
+ "If true, show notifications marked as read. Default: false"
+ },
+ participating: {
+ type: "boolean",
+ default: "false",
+ description:
+ "If true, only shows notifications in which the user is directly participating or mentioned. Default: false"
+ },
+ since: {
+ type: "date",
+ description:
+ "Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ"
+ },
+ before: {
+ type: "string",
+ description:
+ "Only show notifications updated before the given time. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ."
+ }
+ },
+ description:
+ "Get all notifications for the current user, grouped by repository."
+ },
+ getNotificationsForUser: {
+ url: "/repos/:owner/:repo/notifications",
+ method: "GET",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ all: {
+ type: "boolean",
+ default: "false",
+ description:
+ "If true, show notifications marked as read. Default: false"
+ },
+ participating: {
+ type: "boolean",
+ default: "false",
+ description:
+ "If true, only shows notifications in which the user is directly participating or mentioned. Default: false"
+ },
+ since: {
+ type: "date",
+ description:
+ "Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ"
+ },
+ before: {
+ type: "string",
+ description:
+ "Only show notifications updated before the given time. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ."
+ }
+ },
+ description: "Get all notifications for the given user."
+ },
+ markNotificationsAsRead: {
+ url: "/notifications",
+ method: "PUT",
+ params: {
+ last_read_at: {
+ type: "string",
+ default: "Time.now",
+ description:
+ "Describes the last point that notifications were checked. Anything updated since this time will not be updated. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ. Default: Time.now"
+ }
+ },
+ description:
+ "Mark notifications as read for authenticated user."
+ },
+ markNotificationsAsReadForRepo: {
+ url: "/repos/:owner/:repo/notifications",
+ method: "PUT",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ last_read_at: {
+ type: "string",
+ default: "Time.now",
+ description:
+ "Describes the last point that notifications were checked. Anything updated since this time will not be updated. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ. Default: Time.now"
+ }
+ },
+ description: "Mark notifications in a repo as read."
+ },
+ getNotificationThread: {
+ url: "/notifications/threads/:id",
+ method: "GET",
+ params: { id: { type: "string", required: true } },
+ description: "View a single notification thread."
+ },
+ markNotificationThreadAsRead: {
+ url: "/notifications/threads/:id",
+ method: "PATCH",
+ params: { id: { type: "string", required: true } },
+ description: "Mark a notification thread as read."
+ },
+ checkNotificationThreadSubscription: {
+ url: "/notifications/threads/:id/subscription",
+ method: "GET",
+ params: { id: { type: "string", required: true } },
+ description:
+ "Check to see if the current user is subscribed to a thread."
+ },
+ setNotificationThreadSubscription: {
+ url: "/notifications/threads/:id/subscription",
+ method: "PUT",
+ params: {
+ id: { type: "string", required: true },
+ subscribed: {
+ type: "boolean",
+ description:
+ "Determines if notifications should be received from this thread"
+ },
+ ignored: {
+ type: "boolean",
+ description:
+ "Determines if all notifications should be blocked from this thread"
+ }
+ },
+ description:
+ "This lets you subscribe or unsubscribe from a conversation. Unsubscribing from a conversation mutes all future notifications (until you comment or get @mentioned once more)."
+ },
+ deleteNotificationThreadSubscription: {
+ url: "/notifications/threads/:id/subscription",
+ method: "DELETE",
+ params: { id: { type: "string", required: true } },
+ description: "Delete a notification thread subscription."
+ },
+ getStargazersForRepo: {
+ url: "/repos/:owner/:repo/stargazers",
+ method: "GET",
+ headers: { accept: "application/vnd.github.v3.star+json" },
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ page: {
+ type: "number",
+ description: "Page number of the results to fetch."
+ },
+ per_page: {
+ type: "number",
+ default: "30",
+ description: "A custom page size up to 100. Default is 30."
+ }
+ },
+ description: "List Stargazers"
+ },
+ getStarredReposForUser: {
+ url: "/users/:username/starred",
+ method: "GET",
+ headers: { accept: "application/vnd.github.v3.star+json" },
+ params: {
+ username: { type: "string", required: true },
+ sort: {
+ type: "string",
+ enum: ["created", "updated"],
+ default: "created"
+ },
+ direction: {
+ type: "string",
+ enum: ["asc", "desc"],
+ default: "desc"
+ },
+ page: {
+ type: "number",
+ description: "Page number of the results to fetch."
+ },
+ per_page: {
+ type: "number",
+ default: "30",
+ description: "A custom page size up to 100. Default is 30."
+ }
+ },
+ description: "List repositories being starred by a user"
+ },
+ getStarredRepos: {
+ url: "/user/starred",
+ method: "GET",
+ headers: { accept: "application/vnd.github.v3.star+json" },
+ params: {
+ sort: {
+ type: "string",
+ enum: ["created", "updated"],
+ default: "created"
+ },
+ direction: {
+ type: "string",
+ enum: ["asc", "desc"],
+ default: "desc"
+ },
+ page: {
+ type: "number",
+ description: "Page number of the results to fetch."
+ },
+ per_page: {
+ type: "number",
+ default: "30",
+ description: "A custom page size up to 100. Default is 30."
+ }
+ },
+ description:
+ "List repositories being starred by the authenticated user"
+ },
+ checkStarringRepo: {
+ url: "/user/starred/:owner/:repo",
+ method: "GET",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ page: {
+ type: "number",
+ description: "Page number of the results to fetch."
+ },
+ per_page: {
+ type: "number",
+ default: "30",
+ description: "A custom page size up to 100. Default is 30."
+ }
+ },
+ description: "Check if you are starring a repository"
+ },
+ starRepo: {
+ url: "/user/starred/:owner/:repo",
+ method: "PUT",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true }
+ },
+ description: "Star a repository"
+ },
+ unstarRepo: {
+ url: "/user/starred/:owner/:repo",
+ method: "DELETE",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true }
+ },
+ description: "Unstar a repository"
+ },
+ getWatchersForRepo: {
+ url: "/repos/:owner/:repo/subscribers",
+ method: "GET",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ page: {
+ type: "number",
+ description: "Page number of the results to fetch."
+ },
+ per_page: {
+ type: "number",
+ default: "30",
+ description: "A custom page size up to 100. Default is 30."
+ }
+ },
+ description: "Get watchers for repository."
+ },
+ getWatchedReposForUser: {
+ url: "/users/:username/subscriptions",
+ method: "GET",
+ params: {
+ username: { type: "string", required: true },
+ page: {
+ type: "number",
+ description: "Page number of the results to fetch."
+ },
+ per_page: {
+ type: "number",
+ default: "30",
+ description: "A custom page size up to 100. Default is 30."
+ }
+ },
+ description: "List repositories being watched by a user."
+ },
+ getWatchedRepos: {
+ url: "/user/subscriptions",
+ method: "GET",
+ params: {
+ page: {
+ type: "number",
+ description: "Page number of the results to fetch."
+ },
+ per_page: {
+ type: "number",
+ default: "30",
+ description: "A custom page size up to 100. Default is 30."
+ }
+ },
+ description:
+ "List repositories being watched by the authenticated user."
+ },
+ getRepoSubscription: {
+ url: "/repos/:owner/:repo/subscription",
+ method: "GET",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ page: {
+ type: "number",
+ description: "Page number of the results to fetch."
+ },
+ per_page: {
+ type: "number",
+ default: "30",
+ description: "A custom page size up to 100. Default is 30."
+ }
+ },
+ description: "Get a Repository Subscription."
+ },
+ setRepoSubscription: {
+ url: "/repos/:owner/:repo/subscription",
+ method: "PUT",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ subscribed: {
+ type: "boolean",
+ description:
+ "Determines if notifications should be received from this repository."
+ },
+ ignored: {
+ type: "boolean",
+ description:
+ "Determines if all notifications should be blocked from this repository."
+ }
+ },
+ description: "Set a Repository Subscription"
+ },
+ unwatchRepo: {
+ url: "/repos/:owner/:repo/subscription",
+ method: "DELETE",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true }
+ },
+ description: "Unwatch a repository."
+ }
+ },
+ gists: {
+ get: {
+ url: "/gists/:id",
+ method: "GET",
+ params: { id: { type: "string", required: true } },
+ description: "Get a single gist"
+ },
+ create: {
+ url: "/gists",
+ method: "POST",
+ params: {
+ files: {
+ type: "json",
+ required: true,
+ description:
+ "Files that make up this gist. The key of which should be a required string filename and the value another required hash with parameters: 'content'"
+ },
+ description: { type: "string" },
+ public: { type: "boolean", required: true }
+ },
+ description: "Create a gist"
+ },
+ edit: {
+ url: "/gists/:id",
+ method: "PATCH",
+ params: {
+ id: { type: "string", required: true },
+ description: { type: "string" },
+ files: {
+ type: "json",
+ required: true,
+ description:
+ "Files that make up this gist. The key of which should be a required string filename and the value another required hash with parameters: 'content'"
+ },
+ content: {
+ type: "string",
+ description: "Updated file contents."
+ },
+ filename: {
+ type: "string",
+ description: "New name for this file."
+ }
+ },
+ description: "Edit a gist"
+ },
+ star: {
+ url: "/gists/:id/star",
+ method: "PUT",
+ params: { id: { type: "string", required: true } },
+ description: "Star a gist"
+ },
+ unstar: {
+ url: "/gists/:id/star",
+ method: "DELETE",
+ params: { id: { type: "string", required: true } },
+ description: "Unstar a gist"
+ },
+ fork: {
+ url: "/gists/:id/forks",
+ method: "POST",
+ params: { id: { type: "string", required: true } },
+ description: "Fork a gist"
+ },
+ delete: {
+ url: "/gists/:id",
+ method: "DELETE",
+ params: { id: { type: "string", required: true } },
+ description: "Delete a gist"
+ },
+ getForUser: {
+ url: "/users/:username/gists",
+ method: "GET",
+ params: {
+ username: { type: "string", required: true },
+ since: {
+ type: "date",
+ description:
+ "Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ"
+ },
+ page: {
+ type: "number",
+ description: "Page number of the results to fetch."
+ },
+ per_page: {
+ type: "number",
+ default: "30",
+ description: "A custom page size up to 100. Default is 30."
+ }
+ },
+ description: "List a user's gists"
+ },
+ getAll: {
+ url: "/gists",
+ method: "GET",
+ params: {
+ since: {
+ type: "date",
+ description:
+ "Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ"
+ },
+ page: {
+ type: "number",
+ description: "Page number of the results to fetch."
+ },
+ per_page: {
+ type: "number",
+ default: "30",
+ description: "A custom page size up to 100. Default is 30."
+ }
+ },
+ description:
+ "List the authenticated user's gists or if called anonymously, this will return all public gists"
+ },
+ getPublic: {
+ url: "/gists/public",
+ method: "GET",
+ params: {
+ since: {
+ type: "date",
+ description:
+ "Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ"
+ }
+ },
+ description: "List all public gists"
+ },
+ getStarred: {
+ url: "/gists/starred",
+ method: "GET",
+ params: {
+ since: {
+ type: "date",
+ description:
+ "Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ"
+ }
+ },
+ description: "List the authenticated user's starred gists"
+ },
+ getRevision: {
+ url: "/gists/:id/:sha",
+ method: "GET",
+ params: {
+ id: { type: "string", required: true },
+ sha: { type: "string", required: true }
+ },
+ description: "Get a specific revision of a gist"
+ },
+ getCommits: {
+ url: "/gists/:id/commits",
+ method: "GET",
+ params: { id: { type: "string", required: true } },
+ description: "List gist commits"
+ },
+ checkStar: {
+ url: "/gists/:id/star",
+ method: "GET",
+ params: { id: { type: "string", required: true } },
+ description: "Check if a gist is starred"
+ },
+ getForks: {
+ url: "/gists/:id/forks",
+ method: "GET",
+ params: {
+ id: { type: "string", required: true },
+ page: {
+ type: "number",
+ description: "Page number of the results to fetch."
+ },
+ per_page: {
+ type: "number",
+ default: "30",
+ description: "A custom page size up to 100. Default is 30."
+ }
+ },
+ description: "List gist forks"
+ },
+ getComments: {
+ url: "/gists/:gist_id/comments",
+ method: "GET",
+ params: {
+ gist_id: {
+ type: "string",
+ required: true,
+ description: "Id (SHA1 hash) of the gist."
+ }
+ },
+ description: "List comments on a gist"
+ },
+ getComment: {
+ url: "/gists/:gist_id/comments/:id",
+ method: "GET",
+ params: {
+ gist_id: {
+ type: "string",
+ required: true,
+ description: "Id (SHA1 hash) of the gist."
+ },
+ id: { type: "string", required: true }
+ },
+ description: "Get a single comment"
+ },
+ createComment: {
+ url: "/gists/:gist_id/comments",
+ method: "POST",
+ params: {
+ gist_id: {
+ type: "string",
+ required: true,
+ description: "Id (SHA1 hash) of the gist."
+ },
+ body: { type: "string", required: true }
+ },
+ description: "Create a comment"
+ },
+ editComment: {
+ url: "/gists/:gist_id/comments/:id",
+ method: "PATCH",
+ params: {
+ gist_id: {
+ type: "string",
+ required: true,
+ description: "Id (SHA1 hash) of the gist."
+ },
+ id: { type: "string", required: true },
+ body: { type: "string", required: true }
+ },
+ description: "Edit a comment"
+ },
+ deleteComment: {
+ url: "/gists/:gist_id/comments/:id",
+ method: "DELETE",
+ params: {
+ gist_id: {
+ type: "string",
+ required: true,
+ description: "Id (SHA1 hash) of the gist."
+ },
+ id: { type: "string", required: true }
+ },
+ description: "Delete a comment"
+ }
+ },
+ gitdata: {
+ getBlob: {
+ url: "/repos/:owner/:repo/git/blobs/:sha",
+ method: "GET",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ sha: { type: "string", required: true },
+ page: {
+ type: "number",
+ description: "Page number of the results to fetch."
+ },
+ per_page: {
+ type: "number",
+ default: "30",
+ description: "A custom page size up to 100. Default is 30."
+ }
+ },
+ description: "Get a Blob"
+ },
+ createBlob: {
+ url: "/repos/:owner/:repo/git/blobs",
+ method: "POST",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ content: {
+ type: "string",
+ required: true,
+ "allow-empty": true
+ },
+ encoding: { type: "string", required: true }
+ },
+ description: "Create a Blob"
+ },
+ getCommit: {
+ url: "/repos/:owner/:repo/git/commits/:sha",
+ method: "GET",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ sha: { type: "string", required: true }
+ },
+ description: "Get a Commit"
+ },
+ createCommit: {
+ url: "/repos/:owner/:repo/git/commits",
+ method: "POST",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ message: {
+ type: "string",
+ required: true,
+ description: "String of the commit message"
+ },
+ tree: {
+ type: "string",
+ required: true,
+ description:
+ "String of the SHA of the tree object this commit points to"
+ },
+ parents: {
+ type: "string[]",
+ required: true,
+ description:
+ "Array of the SHAs of the commits that were the parents of this commit. If omitted or empty, the commit will be written as a root commit. For a single parent, an array of one SHA should be provided, for a merge commit, an array of more than one should be provided."
+ },
+ author: { type: "json" },
+ committer: { type: "json" }
+ },
+ description: "Create a Commit"
+ },
+ getCommitSignatureVerification: {
+ url: "/repos/:owner/:repo/git/commits/:sha",
+ method: "GET",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ sha: { type: "string", required: true }
+ },
+ description:
+ "Get a Commit Signature Verification. (In preview period. See README.)"
+ },
+ getReference: {
+ url: "/repos/:owner/:repo/git/refs/:ref",
+ method: "GET",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ ref: {
+ type: "string",
+ required: true,
+ "allow-empty": true,
+ description:
+ "String of the name of the fully qualified reference (ie: heads/master). If it doesn’t have at least one slash, it will be rejected."
+ }
+ },
+ description: "Get a Reference"
+ },
+ getReferences: {
+ url: "/repos/:owner/:repo/git/refs",
+ method: "GET",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ page: {
+ type: "number",
+ description: "Page number of the results to fetch."
+ },
+ per_page: {
+ type: "number",
+ default: "30",
+ description: "A custom page size up to 100. Default is 30."
+ }
+ },
+ description: "Get all References"
+ },
+ getTags: {
+ url: "/repos/:owner/:repo/git/refs/tags",
+ method: "GET",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ page: {
+ type: "number",
+ description: "Page number of the results to fetch."
+ },
+ per_page: {
+ type: "number",
+ default: "30",
+ description: "A custom page size up to 100. Default is 30."
+ }
+ },
+ description: "Get all tag References"
+ },
+ createReference: {
+ url: "/repos/:owner/:repo/git/refs",
+ method: "POST",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ ref: {
+ type: "string",
+ required: true,
+ description:
+ "The name of the fully qualified reference (ie: refs/heads/master). If it doesn't start with 'refs' and have at least two slashes, it will be rejected. NOTE: After creating the reference, on calling (get|update|delete)Reference, drop the leading 'refs/' when providing the 'ref' param."
+ },
+ sha: { type: "string", required: true }
+ },
+ description: "Create a Reference"
+ },
+ updateReference: {
+ url: "/repos/:owner/:repo/git/refs/:ref",
+ method: "PATCH",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ ref: {
+ type: "string",
+ required: true,
+ "allow-empty": true,
+ description:
+ "String of the name of the fully qualified reference (ie: heads/master). If it doesn’t have at least one slash, it will be rejected."
+ },
+ sha: { type: "string", required: true },
+ force: {
+ type: "boolean",
+ default: "false",
+ description:
+ "Boolean indicating whether to force the update or to make sure the update is a fast-forward update. The default is false, so leaving this out or setting it to false will make sure you’re not overwriting work."
+ }
+ },
+ description: "Update a Reference"
+ },
+ deleteReference: {
+ url: "/repos/:owner/:repo/git/refs/:ref",
+ method: "DELETE",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ ref: {
+ type: "string",
+ required: true,
+ "allow-empty": true,
+ description:
+ "String of the name of the fully qualified reference (ie: heads/master). If it doesn’t have at least one slash, it will be rejected."
+ }
+ },
+ description: "Delete a Reference"
+ },
+ getTag: {
+ url: "/repos/:owner/:repo/git/tags/:sha",
+ method: "GET",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ sha: { type: "string", required: true }
+ },
+ description: "Get a Tag"
+ },
+ createTag: {
+ url: "/repos/:owner/:repo/git/tags",
+ method: "POST",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ tag: {
+ type: "string",
+ required: true,
+ description: "String of the tag"
+ },
+ message: {
+ type: "string",
+ required: true,
+ description: "String of the tag message"
+ },
+ object: {
+ type: "string",
+ required: true,
+ description:
+ "String of the SHA of the git object this is tagging"
+ },
+ type: {
+ type: "string",
+ required: true,
+ description:
+ "String of the type of the object we’re tagging. Normally this is a commit but it can also be a tree or a blob."
+ },
+ tagger: {
+ type: "json",
+ required: true,
+ description:
+ "JSON object that contains the following keys: `name` - String of the name of the author of the tag, `email` - String of the email of the author of the tag, `date` - Timestamp of when this object was tagged"
+ }
+ },
+ description: "Create a Tag Object"
+ },
+ getTagSignatureVerification: {
+ url: "/repos/:owner/:repo/git/tags/:sha",
+ method: "GET",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ sha: { type: "string", required: true }
+ },
+ description:
+ "Get a Tag Signature Verification. (In preview period. See README.)"
+ },
+ getTree: {
+ url: "/repos/:owner/:repo/git/trees/:sha",
+ method: "GET",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ sha: { type: "string", required: true },
+ recursive: { type: "boolean" }
+ },
+ description: "Get a Tree"
+ },
+ createTree: {
+ url: "/repos/:owner/:repo/git/trees",
+ method: "POST",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ tree: {
+ type: "json",
+ required: true,
+ description:
+ "Array of Hash objects (of path, mode, type and sha) specifying a tree structure"
+ },
+ base_tree: {
+ type: "string",
+ description:
+ "String of the SHA1 of the tree you want to update with new data"
+ }
+ },
+ description: "Create a Tree"
+ }
+ },
+ integrations: {
+ getInstallations: {
+ url: "/app/installations",
+ method: "GET",
+ deprecated: "`integrations` has been renamed to `apps`",
+ headers: {
+ accept: "application/vnd.github.machine-man-preview"
+ },
+ params: {
+ page: {
+ type: "number",
+ description: "Page number of the results to fetch."
+ },
+ per_page: {
+ type: "number",
+ default: "30",
+ description: "A custom page size up to 100. Default is 30."
+ }
+ },
+ description:
+ "List the app's installations. (In preview period. See README.)"
+ },
+ createInstallationToken: {
+ url: "/installations/:installation_id/access_tokens",
+ method: "POST",
+ deprecated: "`integrations` has been renamed to `apps`",
+ headers: {
+ accept: "application/vnd.github.machine-man-preview"
+ },
+ params: {
+ installation_id: { type: "string", required: true },
+ user_id: {
+ type: "string",
+ description:
+ "The id of the user for whom the app is acting on behalf of."
+ }
+ },
+ description:
+ "Create a new installation token. (In preview period. See README.)"
+ },
+ getInstallationRepositories: {
+ url: "/installation/repositories",
+ method: "GET",
+ deprecated: "`integrations` has been renamed to `apps`",
+ headers: {
+ accept: "application/vnd.github.machine-man-preview"
+ },
+ params: {
+ user_id: {
+ type: "string",
+ description:
+ "The integer ID of a user, to filter results to repositories that are visible to both the installation and the given user."
+ }
+ },
+ description:
+ "List repositories that are accessible to the authenticated installation. (In preview period. See README.)"
+ },
+ addRepoToInstallation: {
+ url:
+ "/installations/:installation_id/repositories/:repository_id",
+ method: "PUT",
+ deprecated: "`integrations` has been renamed to `apps`",
+ headers: {
+ accept: "application/vnd.github.machine-man-preview"
+ },
+ params: {
+ installation_id: { type: "string", required: true },
+ repository_id: { type: "string", required: true }
+ },
+ description:
+ "Add a single repository to an installation. (In preview period. See README.)"
+ },
+ removeRepoFromInstallation: {
+ url:
+ "/installations/:installation_id/repositories/:repository_id",
+ method: "DELETE",
+ deprecated: "`integrations` has been renamed to `apps`",
+ headers: {
+ accept: "application/vnd.github.machine-man-preview"
+ },
+ params: {
+ installation_id: { type: "string", required: true },
+ repository_id: { type: "string", required: true }
+ },
+ description:
+ "Remove a single repository from an installation. (In preview period. See README.)"
+ }
+ },
+ apps: {
+ get: {
+ url: "/app",
+ method: "GET",
+ params: {},
+ description:
+ "Get the authenticated GitHub App. (In preview period. See README.)"
+ },
+ getForSlug: {
+ url: "/apps/:app_slug",
+ method: "GET",
+ headers: {
+ accept: "application/vnd.github.machine-man-preview"
+ },
+ params: {
+ app_slug: {
+ type: "string",
+ required: true,
+ description:
+ "The URL-friendly name of your GitHub App. You can find this on the settings page for your GitHub App (e.g., https://github.com/settings/apps/:app_slug)."
+ }
+ },
+ description:
+ "Get a single GitHub App. (In preview period. See README.)"
+ },
+ getInstallations: {
+ url: "/app/installations",
+ method: "GET",
+ headers: {
+ accept: "application/vnd.github.machine-man-preview"
+ },
+ params: {
+ page: {
+ type: "number",
+ description: "Page number of the results to fetch."
+ },
+ per_page: {
+ type: "number",
+ default: "30",
+ description: "A custom page size up to 100. Default is 30."
+ }
+ },
+ description:
+ "List the app's installations. (In preview period. See README.)"
+ },
+ getInstallation: {
+ url: "/app/installations/:installation_id",
+ method: "GET",
+ headers: {
+ accept: "application/vnd.github.machine-man-preview"
+ },
+ params: { installation_id: { type: "string", required: true } },
+ description:
+ "Get a single installation. (In preview period. See README.)"
+ },
+ createInstallationToken: {
+ url: "/installations/:installation_id/access_tokens",
+ method: "POST",
+ headers: {
+ accept: "application/vnd.github.machine-man-preview"
+ },
+ params: {
+ installation_id: { type: "string", required: true },
+ user_id: {
+ type: "string",
+ description:
+ "The id of the user for whom the app is acting on behalf of."
+ }
+ },
+ description:
+ "Create a new installation token. (In preview period. See README.)"
+ },
+ getInstallationRepositories: {
+ url: "/installation/repositories",
+ method: "GET",
+ headers: {
+ accept: "application/vnd.github.machine-man-preview"
+ },
+ params: {
+ user_id: {
+ type: "string",
+ description:
+ "The integer ID of a user, to filter results to repositories that are visible to both the installation and the given user."
+ }
+ },
+ description:
+ "List repositories that are accessible to the authenticated installation. (In preview period. See README.)"
+ },
+ addRepoToInstallation: {
+ url:
+ "/installations/:installation_id/repositories/:repository_id",
+ method: "PUT",
+ headers: {
+ accept: "application/vnd.github.machine-man-preview"
+ },
+ params: {
+ installation_id: { type: "string", required: true },
+ repository_id: { type: "string", required: true }
+ },
+ description:
+ "Add a single repository to an installation. (In preview period. See README.)"
+ },
+ removeRepoFromInstallation: {
+ url:
+ "/installations/:installation_id/repositories/:repository_id",
+ method: "DELETE",
+ headers: {
+ accept: "application/vnd.github.machine-man-preview"
+ },
+ params: {
+ installation_id: { type: "string", required: true },
+ repository_id: { type: "string", required: true }
+ },
+ description:
+ "Remove a single repository from an installation. (In preview period. See README.)"
+ },
+ getMarketplaceListingPlans: {
+ url: "/marketplace_listing/plans",
+ method: "GET",
+ headers: {
+ accept: "application/vnd.github.valkyrie-preview+json"
+ },
+ params: {
+ page: {
+ type: "number",
+ description: "Page number of the results to fetch."
+ },
+ per_page: {
+ type: "number",
+ default: "30",
+ description: "A custom page size up to 100. Default is 30."
+ }
+ },
+ description:
+ "List all plans for your Marketplace listing. (In preview period. See README.)"
+ },
+ getMarketplaceListingStubbedPlans: {
+ url: "/marketplace_listing/stubbed/plans",
+ method: "GET",
+ headers: {
+ accept: "application/vnd.github.valkyrie-preview+json"
+ },
+ params: {
+ page: {
+ type: "number",
+ description: "Page number of the results to fetch."
+ },
+ per_page: {
+ type: "number",
+ default: "30",
+ description: "A custom page size up to 100. Default is 30."
+ }
+ },
+ description:
+ "List all stubbed plans for your Marketplace listing. (In preview period. See README.)"
+ },
+ getMarketplaceListingPlanAccounts: {
+ url: "/marketplace_listing/plans/:id/accounts",
+ method: "GET",
+ headers: {
+ accept: "application/vnd.github.valkyrie-preview+json"
+ },
+ params: {
+ id: { type: "string", required: true },
+ page: {
+ type: "number",
+ description: "Page number of the results to fetch."
+ },
+ per_page: {
+ type: "number",
+ default: "30",
+ description: "A custom page size up to 100. Default is 30."
+ }
+ },
+ description:
+ "List all GitHub accounts (user or organization) on a specific plan. (In preview period. See README.)"
+ },
+ getMarketplaceListingStubbedPlanAccounts: {
+ url: "/marketplace_listing/stubbed/plans/:id/accounts",
+ method: "GET",
+ headers: {
+ accept: "application/vnd.github.valkyrie-preview+json"
+ },
+ params: {
+ id: { type: "string", required: true },
+ page: {
+ type: "number",
+ description: "Page number of the results to fetch."
+ },
+ per_page: {
+ type: "number",
+ default: "30",
+ description: "A custom page size up to 100. Default is 30."
+ }
+ },
+ description:
+ "List all GitHub accounts (user or organization) on a specific stubbed plan. (In preview period. See README.)"
+ },
+ checkMarketplaceListingAccount: {
+ url: "/marketplace_listing/accounts/:id",
+ method: "GET",
+ headers: {
+ accept: "application/vnd.github.valkyrie-preview+json"
+ },
+ params: { id: { type: "string", required: true } },
+ description:
+ "Check if a GitHub account is associated with any Marketplace listing. (In preview period. See README.)"
+ },
+ checkMarketplaceListingStubbedAccount: {
+ url: "/marketplace_listing/stubbed/accounts/:id",
+ method: "GET",
+ headers: {
+ accept: "application/vnd.github.valkyrie-preview+json"
+ },
+ params: { id: { type: "string", required: true } },
+ description:
+ "Check if a stubbed GitHub account is associated with any Marketplace listing. (In preview period. See README.)"
+ }
+ },
+ issues: {
+ get: {
+ url: "/repos/:owner/:repo/issues/:number",
+ method: "GET",
+ headers: {
+ accept: "application/vnd.github.squirrel-girl-preview"
+ },
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ number: { type: "number", required: true }
+ },
+ description: "Get a single issue"
+ },
+ create: {
+ url: "/repos/:owner/:repo/issues",
+ method: "POST",
+ headers: {
+ accept: "application/vnd.github.squirrel-girl-preview"
+ },
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ title: { type: "string", required: true },
+ body: { type: "string" },
+ assignee: {
+ type: "string",
+ description:
+ "Login for the user that this issue should be assigned to."
+ },
+ milestone: {
+ type: "number",
+ description: "Milestone to associate this issue with."
+ },
+ labels: {
+ type: "string[]",
+ description:
+ "Array of strings - Labels to associate with this issue."
+ },
+ assignees: {
+ type: "string[]",
+ description:
+ "Logins for Users to assign to this issue. NOTE: Only users with push access can set assignees for new issues. Assignees are silently dropped otherwise."
+ }
+ },
+ description: "Create an issue"
+ },
+ edit: {
+ url: "/repos/:owner/:repo/issues/:number",
+ method: "PATCH",
+ headers: {
+ accept: "application/vnd.github.squirrel-girl-preview"
+ },
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ number: { type: "number", required: true },
+ title: { type: "string" },
+ body: { type: "string" },
+ assignee: {
+ type: "string",
+ description:
+ "Login for the user that this issue should be assigned to."
+ },
+ state: {
+ type: "string",
+ enum: ["open", "closed"],
+ default: "open",
+ description: "open or closed"
+ },
+ milestone: {
+ type: "number",
+ description: "Milestone to associate this issue with."
+ },
+ labels: {
+ type: "string[]",
+ description:
+ "Array of strings - Labels to associate with this issue."
+ },
+ assignees: {
+ type: "string[]",
+ description:
+ "Logins for Users to assign to this issue. NOTE: Only users with push access can set assignees for new issues. Assignees are silently dropped otherwise."
+ }
+ },
+ description: "Edit an issue"
+ },
+ lock: {
+ url: "/repos/:owner/:repo/issues/:number/lock",
+ method: "PUT",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ number: { type: "number", required: true }
+ },
+ description:
+ "Users with push access can lock an issue's conversation."
+ },
+ unlock: {
+ url: "/repos/:owner/:repo/issues/:number/lock",
+ method: "DELETE",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ number: { type: "number", required: true }
+ },
+ description:
+ "Users with push access can unlock an issue's conversation."
+ },
+ getAll: {
+ url: "/issues",
+ method: "GET",
+ headers: {
+ accept: "application/vnd.github.squirrel-girl-preview"
+ },
+ params: {
+ filter: {
+ type: "string",
+ enum: [
+ "all",
+ "assigned",
+ "created",
+ "mentioned",
+ "subscribed"
+ ]
+ },
+ state: {
+ type: "string",
+ enum: ["open", "closed", "all"],
+ default: "open",
+ description: "open, closed, or all"
+ },
+ labels: {
+ type: "string",
+ description:
+ "String list of comma separated Label names. Example: bug,ui,@high"
+ },
+ sort: {
+ type: "string",
+ enum: ["created", "updated", "comments"],
+ default: "created"
+ },
+ direction: {
+ type: "string",
+ enum: ["asc", "desc"],
+ default: "desc"
+ },
+ since: {
+ type: "date",
+ description:
+ "Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ"
+ },
+ page: {
+ type: "number",
+ description: "Page number of the results to fetch."
+ },
+ per_page: {
+ type: "number",
+ default: "30",
+ description: "A custom page size up to 100. Default is 30."
+ }
+ },
+ description:
+ "List all issues across all the authenticated user's visible repositories including owned repositories, member repositories, and organization repositories"
+ },
+ getForUser: {
+ url: "/user/issues",
+ method: "GET",
+ headers: {
+ accept: "application/vnd.github.squirrel-girl-preview"
+ },
+ params: {
+ filter: {
+ type: "string",
+ enum: [
+ "all",
+ "assigned",
+ "created",
+ "mentioned",
+ "subscribed"
+ ]
+ },
+ state: {
+ type: "string",
+ enum: ["open", "closed", "all"],
+ default: "open",
+ description: "open, closed, or all"
+ },
+ labels: {
+ type: "string",
+ description:
+ "String list of comma separated Label names. Example: bug,ui,@high"
+ },
+ sort: {
+ type: "string",
+ enum: ["created", "updated", "comments"],
+ default: "created"
+ },
+ direction: {
+ type: "string",
+ enum: ["asc", "desc"],
+ default: "desc"
+ },
+ since: {
+ type: "date",
+ description:
+ "Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ"
+ },
+ page: {
+ type: "number",
+ description: "Page number of the results to fetch."
+ },
+ per_page: {
+ type: "number",
+ default: "30",
+ description: "A custom page size up to 100. Default is 30."
+ }
+ },
+ description:
+ "List all issues across owned and member repositories for the authenticated user"
+ },
+ getForOrg: {
+ url: "/orgs/:org/issues",
+ method: "GET",
+ headers: {
+ accept: "application/vnd.github.squirrel-girl-preview"
+ },
+ params: {
+ org: { type: "string", required: true },
+ filter: {
+ type: "string",
+ enum: [
+ "all",
+ "assigned",
+ "created",
+ "mentioned",
+ "subscribed"
+ ]
+ },
+ state: {
+ type: "string",
+ enum: ["open", "closed", "all"],
+ default: "open",
+ description: "open, closed, or all"
+ },
+ labels: {
+ type: "string",
+ description:
+ "String list of comma separated Label names. Example: bug,ui,@high"
+ },
+ sort: {
+ type: "string",
+ enum: ["created", "updated", "comments"],
+ default: "created"
+ },
+ direction: {
+ type: "string",
+ enum: ["asc", "desc"],
+ default: "desc"
+ },
+ since: {
+ type: "date",
+ description:
+ "Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ"
+ },
+ page: {
+ type: "number",
+ description: "Page number of the results to fetch."
+ },
+ per_page: {
+ type: "number",
+ default: "30",
+ description: "A custom page size up to 100. Default is 30."
+ }
+ },
+ description:
+ "List all issues for a given organization for the authenticated user"
+ },
+ getForRepo: {
+ url: "/repos/:owner/:repo/issues",
+ method: "GET",
+ headers: {
+ accept: "application/vnd.github.squirrel-girl-preview"
+ },
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ milestone: {
+ type: "string",
+ validation: "^([0-9]+|none|\\*)$"
+ },
+ state: {
+ type: "string",
+ enum: ["open", "closed", "all"],
+ default: "open",
+ description: "open, closed, or all"
+ },
+ assignee: {
+ type: "string",
+ description:
+ "String User login, `none` for Issues with no assigned User. `*` for Issues with any assigned User."
+ },
+ creator: {
+ type: "string",
+ description: "The user that created the issue."
+ },
+ mentioned: {
+ type: "string",
+ description: "String User login."
+ },
+ labels: {
+ type: "string",
+ description:
+ "String list of comma separated Label names. Example: bug,ui,@high"
+ },
+ sort: {
+ type: "string",
+ enum: ["created", "updated", "comments"],
+ default: "created"
+ },
+ direction: {
+ type: "string",
+ enum: ["asc", "desc"],
+ default: "desc"
+ },
+ since: {
+ type: "date",
+ description:
+ "Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ"
+ },
+ page: {
+ type: "number",
+ description: "Page number of the results to fetch."
+ },
+ per_page: {
+ type: "number",
+ default: "30",
+ description: "A custom page size up to 100. Default is 30."
+ }
+ },
+ description: "List issues for a repository"
+ },
+ getAssignees: {
+ url: "/repos/:owner/:repo/assignees",
+ method: "GET",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true }
+ },
+ description: "List assignees"
+ },
+ checkAssignee: {
+ url: "/repos/:owner/:repo/assignees/:assignee",
+ method: "GET",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ assignee: {
+ type: "string",
+ required: true,
+ description:
+ "Login for the user that this issue should be assigned to."
+ }
+ },
+ description: "Check assignee"
+ },
+ addAssigneesToIssue: {
+ url: "/repos/:owner/:repo/issues/:number/assignees",
+ method: "POST",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ number: { type: "number", required: true },
+ assignees: {
+ type: "string[]",
+ required: true,
+ description:
+ "Logins for the users that should be added to the issue."
+ }
+ },
+ description: "Add assignees to an issue."
+ },
+ removeAssigneesFromIssue: {
+ url: "/repos/:owner/:repo/issues/:number/assignees",
+ method: "DELETE",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ number: { type: "number", required: true },
+ body: { type: "json", required: true }
+ },
+ description: "Remove assignees from an issue."
+ },
+ getComments: {
+ url: "/repos/:owner/:repo/issues/:number/comments",
+ method: "GET",
+ headers: {
+ accept: "application/vnd.github.squirrel-girl-preview"
+ },
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ number: { type: "number", required: true },
+ since: {
+ type: "date",
+ description:
+ "Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ"
+ },
+ page: {
+ type: "number",
+ description: "Page number of the results to fetch."
+ },
+ per_page: {
+ type: "number",
+ default: "30",
+ description: "A custom page size up to 100. Default is 30."
+ }
+ },
+ description: "List comments on an issue"
+ },
+ getCommentsForRepo: {
+ url: "/repos/:owner/:repo/issues/comments",
+ method: "GET",
+ headers: {
+ accept: "application/vnd.github.squirrel-girl-preview"
+ },
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ sort: {
+ type: "string",
+ enum: ["created", "updated"],
+ default: "created"
+ },
+ direction: {
+ type: "string",
+ enum: ["asc", "desc"],
+ default: "desc"
+ },
+ since: {
+ type: "date",
+ description:
+ "Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ"
+ },
+ page: {
+ type: "number",
+ description: "Page number of the results to fetch."
+ },
+ per_page: {
+ type: "number",
+ default: "30",
+ description: "A custom page size up to 100. Default is 30."
+ }
+ },
+ description: "List comments in a repository"
+ },
+ getComment: {
+ url: "/repos/:owner/:repo/issues/comments/:id",
+ method: "GET",
+ headers: {
+ accept: "application/vnd.github.squirrel-girl-preview"
+ },
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ id: { type: "string", required: true }
+ },
+ description: "Get a single comment"
+ },
+ createComment: {
+ url: "/repos/:owner/:repo/issues/:number/comments",
+ method: "POST",
+ headers: {
+ accept: "application/vnd.github.squirrel-girl-preview"
+ },
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ number: { type: "number", required: true },
+ body: { type: "string", required: true }
+ },
+ description: "Create a comment"
+ },
+ editComment: {
+ url: "/repos/:owner/:repo/issues/comments/:id",
+ method: "PATCH",
+ headers: {
+ accept: "application/vnd.github.squirrel-girl-preview"
+ },
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ id: { type: "string", required: true },
+ body: { type: "string", required: true }
+ },
+ description: "Edit a comment"
+ },
+ deleteComment: {
+ url: "/repos/:owner/:repo/issues/comments/:id",
+ method: "DELETE",
+ headers: {
+ accept: "application/vnd.github.squirrel-girl-preview"
+ },
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ id: { type: "string", required: true }
+ },
+ description: "Delete a comment"
+ },
+ getEvents: {
+ url: "/repos/:owner/:repo/issues/:issue_number/events",
+ method: "GET",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ issue_number: { type: "number", required: true },
+ page: {
+ type: "number",
+ description: "Page number of the results to fetch."
+ },
+ per_page: {
+ type: "number",
+ default: "30",
+ description: "A custom page size up to 100. Default is 30."
+ }
+ },
+ description: "List events for an issue"
+ },
+ getEventsForRepo: {
+ url: "/repos/:owner/:repo/issues/events",
+ method: "GET",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ page: {
+ type: "number",
+ description: "Page number of the results to fetch."
+ },
+ per_page: {
+ type: "number",
+ default: "30",
+ description: "A custom page size up to 100. Default is 30."
+ }
+ },
+ description: "List events for a repository"
+ },
+ getEvent: {
+ url: "/repos/:owner/:repo/issues/events/:id",
+ method: "GET",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ id: { type: "string", required: true }
+ },
+ description: "Get a single event"
+ },
+ getLabels: {
+ url: "/repos/:owner/:repo/labels",
+ method: "GET",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ page: {
+ type: "number",
+ description: "Page number of the results to fetch."
+ },
+ per_page: {
+ type: "number",
+ default: "30",
+ description: "A custom page size up to 100. Default is 30."
+ }
+ },
+ description: "List all labels for this repository"
+ },
+ getLabel: {
+ url: "/repos/:owner/:repo/labels/:name",
+ method: "GET",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ name: { type: "string", required: true }
+ },
+ description: "Get a single label"
+ },
+ createLabel: {
+ url: "/repos/:owner/:repo/labels",
+ method: "POST",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ name: { type: "string", required: true },
+ color: {
+ type: "string",
+ required: true,
+ description: "6 character hex code, without a leading #."
+ }
+ },
+ description: "Create a label"
+ },
+ updateLabel: {
+ url: "/repos/:owner/:repo/labels/:oldname",
+ method: "PATCH",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ oldname: {
+ type: "string",
+ required: true,
+ description: "The old name of the label."
+ },
+ name: {
+ type: "string",
+ required: true,
+ description: "The new name of the label."
+ },
+ color: {
+ type: "string",
+ required: true,
+ description: "6 character hex code, without a leading #."
+ }
+ },
+ description: "Update a label"
+ },
+ deleteLabel: {
+ url: "/repos/:owner/:repo/labels/:name",
+ method: "DELETE",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ name: { type: "string", required: true }
+ },
+ description: "Delete a label"
+ },
+ getIssueLabels: {
+ url: "/repos/:owner/:repo/issues/:number/labels",
+ method: "GET",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ number: { type: "number", required: true }
+ },
+ description: "List labels on an issue"
+ },
+ addLabels: {
+ url: "/repos/:owner/:repo/issues/:number/labels",
+ method: "POST",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ number: { type: "number", required: true },
+ labels: { type: "string[]", required: true, mapTo: "input" }
+ },
+ description: "Add labels to an issue"
+ },
+ removeLabel: {
+ url: "/repos/:owner/:repo/issues/:number/labels/:name",
+ method: "DELETE",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ number: { type: "number", required: true },
+ name: { type: "string", required: true }
+ },
+ description: "Remove a label from an issue"
+ },
+ replaceAllLabels: {
+ url: "/repos/:owner/:repo/issues/:number/labels",
+ method: "PUT",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ number: { type: "number", required: true },
+ labels: {
+ type: "string[]",
+ required: true,
+ mapTo: "input",
+ description:
+ "Sending an empty array ([]) will remove all Labels from the Issue."
+ }
+ },
+ description: "Replace all labels for an issue"
+ },
+ removeAllLabels: {
+ url: "/repos/:owner/:repo/issues/:number/labels",
+ method: "DELETE",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ number: { type: "number", required: true }
+ },
+ description: "Remove all labels from an issue"
+ },
+ getMilestoneLabels: {
+ url: "/repos/:owner/:repo/milestones/:number/labels",
+ method: "GET",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ number: { type: "number", required: true }
+ },
+ description: "Get labels for every issue in a milestone"
+ },
+ getMilestones: {
+ url: "/repos/:owner/:repo/milestones",
+ method: "GET",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ state: {
+ type: "string",
+ enum: ["open", "closed", "all"],
+ default: "open"
+ },
+ sort: {
+ type: "string",
+ enum: ["due_on", "completeness"],
+ default: "due_on",
+ description: "due_on, completeness, default: due_on"
+ },
+ direction: {
+ type: "string",
+ enum: ["asc", "desc"],
+ default: "asc"
+ },
+ page: {
+ type: "number",
+ description: "Page number of the results to fetch."
+ },
+ per_page: {
+ type: "number",
+ default: "30",
+ description: "A custom page size up to 100. Default is 30."
+ }
+ },
+ description: "List milestones for a repository"
+ },
+ getMilestone: {
+ url: "/repos/:owner/:repo/milestones/:number",
+ method: "GET",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ number: { type: "number", required: true }
+ },
+ description: "Get a single milestone"
+ },
+ createMilestone: {
+ url: "/repos/:owner/:repo/milestones",
+ method: "POST",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ title: { type: "string", required: true },
+ state: {
+ type: "string",
+ enum: ["open", "closed", "all"],
+ default: "open"
+ },
+ description: { type: "string" },
+ due_on: {
+ type: "date",
+ description:
+ "Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ"
+ }
+ },
+ description: "Create a milestone"
+ },
+ updateMilestone: {
+ url: "/repos/:owner/:repo/milestones/:number",
+ method: "PATCH",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ number: { type: "number", required: true },
+ title: { type: "string", required: true },
+ state: {
+ type: "string",
+ enum: ["open", "closed", "all"],
+ default: "open"
+ },
+ description: { type: "string" },
+ due_on: {
+ type: "date",
+ description:
+ "Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ"
+ }
+ },
+ description: "Update a milestone"
+ },
+ deleteMilestone: {
+ url: "/repos/:owner/:repo/milestones/:number",
+ method: "DELETE",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ number: { type: "number", required: true }
+ },
+ description: "Delete a milestone"
+ },
+ getEventsTimeline: {
+ url: "/repos/:owner/:repo/issues/:issue_number/timeline",
+ method: "GET",
+ headers: {
+ accept: "application/vnd.github.mockingbird-preview"
+ },
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ issue_number: { type: "number", required: true },
+ page: {
+ type: "number",
+ description: "Page number of the results to fetch."
+ },
+ per_page: {
+ type: "number",
+ default: "30",
+ description: "A custom page size up to 100. Default is 30."
+ }
+ },
+ description:
+ "List events for an issue. (In preview period. See README.)"
+ }
+ },
+ migrations: {
+ startMigration: {
+ url: "/orgs/:org/migrations",
+ method: "POST",
+ headers: {
+ accept: "application/vnd.github.wyandotte-preview+json"
+ },
+ params: {
+ org: { type: "string", required: true },
+ repositories: {
+ type: "string[]",
+ required: true,
+ description:
+ "A list of arrays indicating which repositories should be migrated."
+ },
+ lock_repositories: {
+ type: "boolean",
+ default: "false",
+ description:
+ "Indicates whether repositories should be locked (to prevent manipulation) while migrating data. Default: false."
+ },
+ exclude_attachments: {
+ type: "boolean",
+ default: "false",
+ description:
+ "Indicates whether attachments should be excluded from the migration (to reduce migration archive file size). Default: false."
+ }
+ },
+ description:
+ "Start a migration. (In preview period. See README.)"
+ },
+ getMigrations: {
+ url: "/orgs/:org/migrations",
+ method: "GET",
+ headers: {
+ accept: "application/vnd.github.wyandotte-preview+json"
+ },
+ params: {
+ org: { type: "string", required: true },
+ page: {
+ type: "number",
+ description: "Page number of the results to fetch."
+ },
+ per_page: {
+ type: "number",
+ default: "30",
+ description: "A custom page size up to 100. Default is 30."
+ }
+ },
+ description:
+ "Get a list of migrations. (In preview period. See README.)"
+ },
+ getMigrationStatus: {
+ url: "/orgs/:org/migrations/:id",
+ method: "GET",
+ headers: {
+ accept: "application/vnd.github.wyandotte-preview+json"
+ },
+ params: {
+ org: { type: "string", required: true },
+ id: { type: "string", required: true }
+ },
+ description:
+ "Get the status of a migration. (In preview period. See README.)"
+ },
+ getMigrationArchiveLink: {
+ url: "/orgs/:org/migrations/:id/archive",
+ method: "GET",
+ headers: {
+ accept: "application/vnd.github.wyandotte-preview+json"
+ },
+ params: {
+ org: { type: "string", required: true },
+ id: { type: "string", required: true }
+ },
+ description:
+ "Get the URL to a migration archive. (In preview period. See README.)"
+ },
+ deleteMigrationArchive: {
+ url: "/orgs/:org/migrations/:id/archive",
+ method: "DELETE",
+ headers: {
+ accept: "application/vnd.github.wyandotte-preview+json"
+ },
+ params: {
+ org: { type: "string", required: true },
+ id: { type: "string", required: true }
+ },
+ description:
+ "Delete a migration archive. (In preview period. See README.)"
+ },
+ unlockRepoLockedForMigration: {
+ url: "/orgs/:org/migrations/:id/repos/:repo_name/lock",
+ method: "DELETE",
+ headers: {
+ accept: "application/vnd.github.wyandotte-preview+json"
+ },
+ params: {
+ org: { type: "string", required: true },
+ id: { type: "string", required: true },
+ repo_name: { type: "string", required: true }
+ },
+ description:
+ "Unlock a repository that was locked for migration. (In preview period. See README.)"
+ },
+ startImport: {
+ url: "/repos/:owner/:repo/import",
+ method: "PUT",
+ headers: {
+ accept: "application/vnd.github.barred-rock-preview"
+ },
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ vcs_url: {
+ type: "string",
+ required: true,
+ description: "The URL of the originating repository."
+ },
+ vcs: {
+ type: "string",
+ enum: ["subversion", "git", "mercurial", "tfvc"],
+ description:
+ "The originating VCS type. Please be aware that without this parameter, the import job will take additional time to detect the VCS type before beginning the import. This detection step will be reflected in the response."
+ },
+ vcs_username: {
+ type: "string",
+ description:
+ "If authentication is required, the username to provide to vcs_url."
+ },
+ vcs_password: {
+ type: "string",
+ description:
+ "If authentication is required, the password to provide to vcs_url."
+ },
+ tfvc_project: {
+ type: "string",
+ description:
+ "For a tfvc import, the name of the project that is being imported."
+ }
+ },
+ description: "Start an import. (In preview period. See README.)"
+ },
+ getImportProgress: {
+ url: "/repos/:owner/:repo/import",
+ method: "GET",
+ headers: {
+ accept: "application/vnd.github.barred-rock-preview"
+ },
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true }
+ },
+ description:
+ "Get import progress. (In preview period. See README.)"
+ },
+ updateImport: {
+ url: "/repos/:owner/:repo/import",
+ method: "PATCH",
+ headers: {
+ accept: "application/vnd.github.barred-rock-preview"
+ },
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ vcs_username: {
+ type: "string",
+ description:
+ "The username to provide to the originating repository."
+ },
+ vcs_password: {
+ type: "string",
+ description:
+ "The password to provide to the originating repository."
+ }
+ },
+ description:
+ "Update existing import. (In preview period. See README.)"
+ },
+ getImportCommitAuthors: {
+ url: "/repos/:owner/:repo/import/authors",
+ method: "GET",
+ headers: {
+ accept: "application/vnd.github.barred-rock-preview"
+ },
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ since: {
+ type: "string",
+ description:
+ "Only authors found after this id are returned. Provide the highest author ID you've seen so far. New authors may be added to the list at any point while the importer is performing the raw step."
+ }
+ },
+ description:
+ "Get import commit authors. (In preview period. See README.)"
+ },
+ mapImportCommitAuthor: {
+ url: "/repos/:owner/:repo/import/authors/:author_id",
+ method: "PATCH",
+ headers: {
+ accept: "application/vnd.github.barred-rock-preview"
+ },
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ author_id: {
+ type: "string",
+ required: true,
+ description: "The commit author id."
+ },
+ email: {
+ type: "string",
+ description: "The new Git author email."
+ },
+ name: {
+ type: "string",
+ description: "The new Git author name."
+ }
+ },
+ description:
+ "Map a commit author. (In preview period. See README.)"
+ },
+ setImportLfsPreference: {
+ url: "/:owner/:name/import/lfs",
+ method: "PATCH",
+ headers: {
+ accept: "application/vnd.github.barred-rock-preview"
+ },
+ params: {
+ owner: { type: "string", required: true },
+ name: { type: "string", required: true },
+ use_lfs: {
+ type: "string",
+ required: true,
+ description:
+ "Can be one of `opt_in` (large files will be stored using Git LFS) or `opt_out` (large files will be removed during the import)."
+ }
+ },
+ description:
+ "Set import LFS preference. (In preview period. See README.)"
+ },
+ getLargeImportFiles: {
+ url: "/:owner/:name/import/large_files",
+ method: "GET",
+ headers: {
+ accept: "application/vnd.github.barred-rock-preview"
+ },
+ params: {
+ owner: { type: "string", required: true },
+ name: { type: "string", required: true }
+ },
+ description:
+ "List files larger than 100MB found during the import. (In preview period. See README.)"
+ },
+ cancelImport: {
+ url: "/repos/:owner/:repo/import",
+ method: "DELETE",
+ headers: {
+ accept: "application/vnd.github.barred-rock-preview"
+ },
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true }
+ },
+ description:
+ "Cancel an import. (In preview period. See README.)"
+ }
+ },
+ misc: {
+ getCodesOfConduct: {
+ url: "/codes_of_conduct",
+ method: "GET",
+ headers: {
+ accept: "application/vnd.github.scarlet-witch-preview+json"
+ },
+ params: {},
+ description:
+ "List all codes of conduct. (In preview period. See README.)"
+ },
+ getCodeOfConduct: {
+ url: "/codes_of_conduct/:key",
+ method: "GET",
+ headers: {
+ accept: "application/vnd.github.scarlet-witch-preview+json"
+ },
+ params: {
+ key: {
+ type: "string",
+ required: true,
+ description: "Ex: contributor_covenant"
+ }
+ },
+ description:
+ "Get an code of conduct. (In preview period. See README.)"
+ },
+ getRepoCodeOfConduct: {
+ url: "/repos/:owner/:repo/community/code_of_conduct",
+ method: "GET",
+ headers: {
+ accept: "application/vnd.github.scarlet-witch-preview+json"
+ },
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true }
+ },
+ description:
+ "Get the contents of a repository's code of conduct. (In preview period. See README.)"
+ },
+ getEmojis: {
+ url: "/emojis",
+ method: "GET",
+ params: {},
+ description: "Lists all the emojis available to use on GitHub."
+ },
+ getGitignoreTemplates: {
+ url: "/gitignore/templates",
+ method: "GET",
+ params: {},
+ description: "Lists available gitignore templates"
+ },
+ getGitignoreTemplate: {
+ url: "/gitignore/templates/:name",
+ method: "GET",
+ params: {
+ name: {
+ type: "string",
+ required: true,
+ description:
+ "The name of the .gitignore template to get e.g. 'C'"
+ }
+ },
+ description: "Get a single gitignore template"
+ },
+ getLicenses: {
+ url: "/licenses",
+ method: "GET",
+ headers: { accept: "application/vnd.github.drax-preview+json" },
+ params: {},
+ description:
+ "List all licenses. (In preview period. See README.)"
+ },
+ getLicense: {
+ url: "/licenses/:license",
+ method: "GET",
+ headers: { accept: "application/vnd.github.drax-preview+json" },
+ params: {
+ license: {
+ type: "string",
+ required: true,
+ description: "Ex: /licenses/mit"
+ }
+ },
+ description:
+ "Get an individual license. (In preview period. See README.)"
+ },
+ getRepoLicense: {
+ url: "/repos/:owner/:repo/license",
+ method: "GET",
+ headers: { accept: "application/vnd.github.drax-preview+json" },
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true }
+ },
+ description:
+ "Get the contents of a repository's license. (In preview period. See README.)"
+ },
+ renderMarkdown: {
+ url: "/markdown",
+ method: "POST",
+ params: {
+ text: {
+ type: "string",
+ required: true,
+ description: "The Markdown text to render"
+ },
+ mode: {
+ type: "string",
+ enum: ["markdown", "gfm"],
+ default: "markdown",
+ description:
+ "The rendering mode, `markdown` to render a document as plain Markdown, just like README files are rendered. `gfm` to render a document as user-content, e.g. like user comments or issues are rendered. In GFM mode, hard line breaks are always taken into account, and issue and user mentions are linked accordingly."
+ },
+ context: {
+ type: "string",
+ description:
+ "The repository context. Only taken into account when rendering as `gfm`"
+ }
+ },
+ description: "Render an arbitrary Markdown document"
+ },
+ renderMarkdownRaw: {
+ url: "/markdown/raw",
+ method: "POST",
+ headers: { "content-type": "text/plain; charset=utf-8" },
+ params: {
+ data: {
+ type: "string",
+ required: true,
+ mapTo: "input",
+ description: "Raw data to send as the body of the request"
+ }
+ },
+ description: "Render a Markdown document in raw mode"
+ },
+ getMeta: {
+ url: "/meta",
+ method: "GET",
+ params: {},
+ description:
+ "This endpoint provides information about GitHub.com, the service. Or, if you access this endpoint on your organization's GitHub Enterprise installation, this endpoint provides information about that installation."
+ },
+ getRateLimit: {
+ url: "/rate_limit",
+ method: "GET",
+ params: {},
+ description: "Get your current rate limit status"
+ }
+ },
+ orgs: {
+ get: {
+ url: "/orgs/:org",
+ method: "GET",
+ params: {
+ org: { type: "string", required: true },
+ page: {
+ type: "number",
+ description: "Page number of the results to fetch."
+ },
+ per_page: {
+ type: "number",
+ default: "30",
+ description: "A custom page size up to 100. Default is 30."
+ }
+ },
+ description: "Get an organization"
+ },
+ update: {
+ url: "/orgs/:org",
+ method: "PATCH",
+ params: {
+ org: { type: "string", required: true },
+ billing_email: {
+ type: "string",
+ description:
+ "Billing email address. This address is not publicized."
+ },
+ company: { type: "string", description: "The company name." },
+ email: {
+ type: "string",
+ description: "The publicly visible email address."
+ },
+ location: { type: "string", description: "The location." },
+ name: {
+ type: "string",
+ description: "The shorthand name of the company."
+ },
+ description: {
+ type: "string",
+ description: "The description of the company."
+ },
+ default_repository_permission: {
+ type: "string",
+ enum: ["read", "write", "admin", "none"],
+ default: "read",
+ description:
+ "Default permission level members have for organization repositories."
+ },
+ members_can_create_repositories: {
+ type: "boolean",
+ default: true,
+ description:
+ "Toggles ability of non-admin organization members to create repositories."
+ }
+ },
+ description: "Edit an organization"
+ },
+ getAll: {
+ url: "/organizations",
+ method: "GET",
+ params: {
+ since: {
+ type: "string",
+ description:
+ "The integer ID of the last Organization that you've seen."
+ },
+ page: {
+ type: "number",
+ description: "Page number of the results to fetch."
+ },
+ per_page: {
+ type: "number",
+ default: "30",
+ description: "A custom page size up to 100. Default is 30."
+ }
+ },
+ description: "List all organizations"
+ },
+ getForUser: {
+ url: "/users/:username/orgs",
+ method: "GET",
+ params: {
+ username: { type: "string", required: true },
+ page: {
+ type: "number",
+ description: "Page number of the results to fetch."
+ },
+ per_page: {
+ type: "number",
+ default: "30",
+ description: "A custom page size up to 100. Default is 30."
+ }
+ },
+ description:
+ "List public organization memberships for the specified user."
+ },
+ getMembers: {
+ url: "/orgs/:org/members",
+ method: "GET",
+ params: {
+ org: { type: "string", required: true },
+ filter: {
+ type: "string",
+ enum: ["all", "2fa_disabled"],
+ default: "all",
+ description: "Filter members returned in the list."
+ },
+ role: {
+ type: "string",
+ enum: ["all", "admin", "member"],
+ default: "all",
+ description: "Filter members returned by their role."
+ },
+ page: {
+ type: "number",
+ description: "Page number of the results to fetch."
+ },
+ per_page: {
+ type: "number",
+ default: "30",
+ description: "A custom page size up to 100. Default is 30."
+ }
+ },
+ description: "Members list"
+ },
+ checkMembership: {
+ url: "/orgs/:org/members/:username",
+ method: "GET",
+ params: {
+ org: { type: "string", required: true },
+ username: { type: "string", required: true }
+ },
+ description: "Check membership"
+ },
+ removeMember: {
+ url: "/orgs/:org/members/:username",
+ method: "DELETE",
+ params: {
+ org: { type: "string", required: true },
+ username: { type: "string", required: true }
+ },
+ description: "Remove a member"
+ },
+ getPublicMembers: {
+ url: "/orgs/:org/public_members",
+ method: "GET",
+ params: { org: { type: "string", required: true } },
+ description: "Public members list"
+ },
+ checkPublicMembership: {
+ url: "/orgs/:org/public_members/:username",
+ method: "GET",
+ params: {
+ org: { type: "string", required: true },
+ username: { type: "string", required: true }
+ },
+ description: "Check public membership"
+ },
+ publicizeMembership: {
+ url: "/orgs/:org/public_members/:username",
+ method: "PUT",
+ params: {
+ org: { type: "string", required: true },
+ username: { type: "string", required: true }
+ },
+ description: "Publicize a user's membership"
+ },
+ concealMembership: {
+ url: "/orgs/:org/public_members/:username",
+ method: "DELETE",
+ params: {
+ org: { type: "string", required: true },
+ username: { type: "string", required: true }
+ },
+ description: "Conceal a user's membership"
+ },
+ getOrgMembership: {
+ url: "/orgs/:org/memberships/:username",
+ method: "GET",
+ params: {
+ org: { type: "string", required: true },
+ username: { type: "string", required: true }
+ },
+ description: "Get organization membership"
+ },
+ addOrgMembership: {
+ url: "/orgs/:org/memberships/:username",
+ method: "PUT",
+ params: {
+ org: { type: "string", required: true },
+ username: { type: "string", required: true },
+ role: {
+ type: "string",
+ required: true,
+ enum: ["admin", "member"],
+ default: "member",
+ description:
+ "The role to give the user in the organization."
+ }
+ },
+ description: "Add or update organization membership"
+ },
+ removeOrgMembership: {
+ url: "/orgs/:org/memberships/:username",
+ method: "DELETE",
+ params: {
+ org: { type: "string", required: true },
+ username: { type: "string", required: true }
+ },
+ description: "Remove organization membership"
+ },
+ getPendingOrgInvites: {
+ url: "/orgs/:org/invitations",
+ method: "GET",
+ params: { org: { type: "string", required: true } },
+ description: "List pending organization invites."
+ },
+ getOutsideCollaborators: {
+ url: "/orgs/:org/outside_collaborators",
+ method: "GET",
+ params: {
+ org: { type: "string", required: true },
+ filter: {
+ type: "string",
+ enum: ["all", "2fa_disabled"],
+ default: "all",
+ description: "Filter the list of outside collaborators."
+ },
+ page: {
+ type: "number",
+ description: "Page number of the results to fetch."
+ },
+ per_page: {
+ type: "number",
+ default: "30",
+ description: "A custom page size up to 100. Default is 30."
+ }
+ },
+ description:
+ "List all users who are outside collaborators of an organization."
+ },
+ removeOutsideCollaborator: {
+ url: "/orgs/:org/outside_collaborators/:username",
+ method: "DELETE",
+ params: {
+ org: { type: "string", required: true },
+ username: { type: "string", required: true }
+ },
+ description: "Remove outside collaborator."
+ },
+ convertMemberToOutsideCollaborator: {
+ url: "/orgs/:org/outside_collaborators/:username",
+ method: "PUT",
+ params: {
+ org: { type: "string", required: true },
+ username: { type: "string", required: true }
+ },
+ description: "Convert member to outside collaborator."
+ },
+ getTeams: {
+ url: "/orgs/:org/teams",
+ method: "GET",
+ headers: {
+ accept: "application/vnd.github.hellcat-preview+json"
+ },
+ params: {
+ org: { type: "string", required: true },
+ page: {
+ type: "number",
+ description: "Page number of the results to fetch."
+ },
+ per_page: {
+ type: "number",
+ default: "30",
+ description: "A custom page size up to 100. Default is 30."
+ }
+ },
+ description: "List teams"
+ },
+ getTeam: {
+ url: "/teams/:id",
+ method: "GET",
+ headers: {
+ accept: "application/vnd.github.hellcat-preview+json"
+ },
+ params: { id: { type: "string", required: true } },
+ description: "Get team"
+ },
+ createTeam: {
+ url: "/orgs/:org/teams",
+ method: "POST",
+ headers: {
+ accept: "application/vnd.github.hellcat-preview+json"
+ },
+ params: {
+ org: { type: "string", required: true },
+ name: { type: "string", required: true },
+ description: {
+ type: "string",
+ description: "The description of the team."
+ },
+ maintainers: {
+ type: "string[]",
+ description:
+ "The logins of organization members to add as maintainers of the team."
+ },
+ repo_names: {
+ type: "string[]",
+ description:
+ 'The full name (e.g., "organization-name/repository-name") of repositories to add the team to.'
+ },
+ privacy: {
+ type: "string",
+ enum: ["secret", "closed"],
+ default: "secret",
+ description: "The level of privacy this team should have."
+ },
+ parent_team_id: {
+ type: "string",
+ description: "The ID of a team to set as the parent team."
+ }
+ },
+ description: "Create team"
+ },
+ editTeam: {
+ url: "/teams/:id",
+ method: "PATCH",
+ headers: {
+ accept: "application/vnd.github.hellcat-preview+json"
+ },
+ params: {
+ id: { type: "string", required: true },
+ name: { type: "string", required: true },
+ description: {
+ type: "string",
+ description: "The description of the team."
+ },
+ privacy: {
+ type: "string",
+ enum: ["secret", "closed"],
+ default: "secret",
+ description: "The level of privacy this team should have."
+ },
+ parent_team_id: {
+ type: "string",
+ description: "The ID of a team to set as the parent team."
+ }
+ },
+ description: "Edit team"
+ },
+ deleteTeam: {
+ url: "/teams/:id",
+ method: "DELETE",
+ headers: {
+ accept: "application/vnd.github.hellcat-preview+json"
+ },
+ params: { id: { type: "string", required: true } },
+ description: "Delete team"
+ },
+ getTeamMembers: {
+ url: "/teams/:id/members",
+ method: "GET",
+ headers: {
+ accept: "application/vnd.github.hellcat-preview+json"
+ },
+ params: {
+ id: { type: "string", required: true },
+ role: {
+ type: "string",
+ enum: ["member", "maintainer", "all"],
+ default: "all",
+ description:
+ "Filters members returned by their role in the team."
+ },
+ page: {
+ type: "number",
+ description: "Page number of the results to fetch."
+ },
+ per_page: {
+ type: "number",
+ default: "30",
+ description: "A custom page size up to 100. Default is 30."
+ }
+ },
+ description: "List team members"
+ },
+ getChildTeams: {
+ url: "/teams/:id/teams",
+ method: "GET",
+ headers: {
+ accept: "application/vnd.github.hellcat-preview+json"
+ },
+ params: {
+ id: { type: "string", required: true },
+ page: {
+ type: "number",
+ description: "Page number of the results to fetch."
+ },
+ per_page: {
+ type: "number",
+ default: "30",
+ description: "A custom page size up to 100. Default is 30."
+ }
+ },
+ description: "List child teams"
+ },
+ getTeamMembership: {
+ url: "/teams/:id/memberships/:username",
+ method: "GET",
+ headers: {
+ accept: "application/vnd.github.hellcat-preview+json"
+ },
+ params: {
+ id: { type: "string", required: true },
+ username: { type: "string", required: true }
+ },
+ description: "Get team membership"
+ },
+ addTeamMembership: {
+ url: "/teams/:id/memberships/:username",
+ method: "PUT",
+ headers: {
+ accept: "application/vnd.github.hellcat-preview+json"
+ },
+ params: {
+ id: { type: "string", required: true },
+ username: { type: "string", required: true },
+ role: {
+ type: "string",
+ enum: ["member", "maintainer"],
+ default: "member",
+ description:
+ "The role that this user should have in the team."
+ }
+ },
+ description: "Add team membership"
+ },
+ removeTeamMembership: {
+ url: "/teams/:id/memberships/:username",
+ method: "DELETE",
+ headers: {
+ accept: "application/vnd.github.hellcat-preview+json"
+ },
+ params: {
+ id: { type: "string", required: true },
+ username: { type: "string", required: true }
+ },
+ description: "Remove team membership"
+ },
+ getTeamRepos: {
+ url: "/teams/:id/repos",
+ method: "GET",
+ headers: {
+ accept: "application/vnd.github.hellcat-preview+json"
+ },
+ params: {
+ id: { type: "string", required: true },
+ page: {
+ type: "number",
+ description: "Page number of the results to fetch."
+ },
+ per_page: {
+ type: "number",
+ default: "30",
+ description: "A custom page size up to 100. Default is 30."
+ }
+ },
+ description: "Get team repos"
+ },
+ getPendingTeamInvites: {
+ url: "/teams/:id/invitations",
+ method: "GET",
+ params: {
+ id: { type: "string", required: true },
+ page: {
+ type: "number",
+ description: "Page number of the results to fetch."
+ },
+ per_page: {
+ type: "number",
+ default: "30",
+ description: "A custom page size up to 100. Default is 30."
+ }
+ },
+ description: "List pending team invitations."
+ },
+ checkTeamRepo: {
+ url: "/teams/:id/repos/:owner/:repo",
+ method: "GET",
+ headers: {
+ accept: "application/vnd.github.hellcat-preview+json"
+ },
+ params: {
+ id: { type: "string", required: true },
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true }
+ },
+ description: "Check if a team manages a repository"
+ },
+ addTeamRepo: {
+ url: "/teams/:id/repos/:org/:repo",
+ method: "PUT",
+ headers: {
+ accept: "application/vnd.github.hellcat-preview+json"
+ },
+ params: {
+ id: { type: "string", required: true },
+ org: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ permission: {
+ type: "string",
+ enum: ["pull", "push", "admin"],
+ description:
+ "`pull` - team members can pull, but not push or administer this repository, `push` - team members can pull and push, but not administer this repository, `admin` - team members can pull, push and administer this repository."
+ }
+ },
+ description: "Add team repository"
+ },
+ deleteTeamRepo: {
+ url: "/teams/:id/repos/:owner/:repo",
+ method: "DELETE",
+ headers: {
+ accept: "application/vnd.github.hellcat-preview+json"
+ },
+ params: {
+ id: { type: "string", required: true },
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true }
+ },
+ description: "Remove team repository"
+ },
+ getHooks: {
+ url: "/orgs/:org/hooks",
+ method: "GET",
+ params: {
+ org: { type: "string", required: true },
+ page: {
+ type: "number",
+ description: "Page number of the results to fetch."
+ },
+ per_page: {
+ type: "number",
+ default: "30",
+ description: "A custom page size up to 100. Default is 30."
+ }
+ },
+ description: "List hooks"
+ },
+ getHook: {
+ url: "/orgs/:org/hooks/:id",
+ method: "GET",
+ params: {
+ org: { type: "string", required: true },
+ id: { type: "string", required: true }
+ },
+ description: "Get single hook"
+ },
+ createHook: {
+ url: "/orgs/:org/hooks",
+ method: "POST",
+ params: {
+ org: { type: "string", required: true },
+ name: {
+ type: "string",
+ required: true,
+ description: 'Must be passed as "web".'
+ },
+ config: {
+ type: "json",
+ required: true,
+ description:
+ "Key/value pairs to provide settings for this webhook"
+ },
+ events: {
+ type: "string[]",
+ default: '["push"]',
+ description:
+ 'Determines what events the hook is triggered for. Default: ["push"].'
+ },
+ active: {
+ type: "boolean",
+ description:
+ "Determines whether the hook is actually triggered on pushes."
+ }
+ },
+ description: "Create a hook"
+ },
+ editHook: {
+ url: "/orgs/:org/hooks/:id",
+ method: "PATCH",
+ params: {
+ org: { type: "string", required: true },
+ id: { type: "string", required: true },
+ config: {
+ type: "json",
+ required: true,
+ description:
+ "Key/value pairs to provide settings for this webhook"
+ },
+ events: {
+ type: "string[]",
+ default: '["push"]',
+ description:
+ 'Determines what events the hook is triggered for. Default: ["push"].'
+ },
+ active: {
+ type: "boolean",
+ description:
+ "Determines whether the hook is actually triggered on pushes."
+ }
+ },
+ description: "Edit a hook"
+ },
+ pingHook: {
+ url: "/orgs/:org/hooks/:id/pings",
+ method: "POST",
+ params: {
+ org: { type: "string", required: true },
+ id: { type: "string", required: true }
+ },
+ description: "Ping a hook"
+ },
+ deleteHook: {
+ url: "/orgs/:org/hooks/:id",
+ method: "DELETE",
+ params: {
+ org: { type: "string", required: true },
+ id: { type: "string", required: true }
+ },
+ description: "Delete a hook"
+ },
+ getBlockedUsers: {
+ url: "/orgs/:org/blocks",
+ method: "GET",
+ headers: {
+ accept:
+ "application/vnd.github.giant-sentry-fist-preview+json"
+ },
+ params: {
+ org: { type: "string", required: true },
+ page: {
+ type: "number",
+ description: "Page number of the results to fetch."
+ },
+ per_page: {
+ type: "number",
+ default: "30",
+ description: "A custom page size up to 100. Default is 30."
+ }
+ },
+ description:
+ "List blocked users. (In preview period. See README.)"
+ },
+ checkBlockedUser: {
+ url: "/orgs/:org/blocks/:username",
+ method: "GET",
+ headers: {
+ accept:
+ "application/vnd.github.giant-sentry-fist-preview+json"
+ },
+ params: {
+ org: { type: "string", required: true },
+ username: { type: "string", required: true }
+ },
+ description:
+ "Check whether you've blocked a user. (In preview period. See README.)"
+ },
+ blockUser: {
+ url: "/orgs/:org/blocks/:username",
+ method: "PUT",
+ headers: {
+ accept:
+ "application/vnd.github.giant-sentry-fist-preview+json"
+ },
+ params: {
+ org: { type: "string", required: true },
+ username: { type: "string", required: true }
+ },
+ description: "Block a user. (In preview period. See README.)"
+ },
+ unblockUser: {
+ url: "/orgs/:org/blocks/:username",
+ method: "DELETE",
+ headers: {
+ accept:
+ "application/vnd.github.giant-sentry-fist-preview+json"
+ },
+ params: {
+ org: { type: "string", required: true },
+ username: { type: "string", required: true }
+ },
+ description: "Unblock a user. (In preview period. See README.)"
+ }
+ },
+ projects: {
+ getRepoProjects: {
+ url: "/repos/:owner/:repo/projects",
+ method: "GET",
+ headers: {
+ accept: "application/vnd.github.inertia-preview+json"
+ },
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ state: {
+ type: "string",
+ enum: ["open", "closed", "all"],
+ default: "open"
+ }
+ },
+ description:
+ "List repository projects. (In preview period. See README.)"
+ },
+ getOrgProjects: {
+ url: "/orgs/:org/projects",
+ method: "GET",
+ headers: {
+ accept: "application/vnd.github.inertia-preview+json"
+ },
+ params: {
+ org: { type: "string", required: true },
+ state: {
+ type: "string",
+ enum: ["open", "closed", "all"],
+ default: "open"
+ }
+ },
+ description:
+ "List organization projects. (In preview period. See README.)"
+ },
+ getProject: {
+ url: "/projects/:id",
+ method: "GET",
+ headers: {
+ accept: "application/vnd.github.inertia-preview+json"
+ },
+ params: { id: { type: "string", required: true } },
+ description: "Get a project. (In preview period. See README.)"
+ },
+ createRepoProject: {
+ url: "/repos/:owner/:repo/projects",
+ method: "POST",
+ headers: {
+ accept: "application/vnd.github.inertia-preview+json"
+ },
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ name: { type: "string", required: true },
+ body: { type: "string" }
+ },
+ description:
+ "Create a repository project. (In preview period. See README.)"
+ },
+ createOrgProject: {
+ url: "/orgs/:org/projects",
+ method: "POST",
+ headers: {
+ accept: "application/vnd.github.inertia-preview+json"
+ },
+ params: {
+ org: { type: "string", required: true },
+ name: { type: "string", required: true },
+ body: { type: "string" }
+ },
+ description:
+ "Create an organization project. (In preview period. See README.)"
+ },
+ updateProject: {
+ url: "/projects/:id",
+ method: "PATCH",
+ headers: {
+ accept: "application/vnd.github.inertia-preview+json"
+ },
+ params: {
+ id: { type: "string", required: true },
+ name: { type: "string", required: true },
+ body: { type: "string" },
+ state: {
+ type: "string",
+ enum: ["open", "closed", "all"],
+ default: "open"
+ }
+ },
+ description:
+ "Update a project. (In preview period. See README.)"
+ },
+ deleteProject: {
+ url: "/projects/:id",
+ method: "DELETE",
+ headers: {
+ accept: "application/vnd.github.inertia-preview+json"
+ },
+ params: { id: { type: "string", required: true } },
+ description:
+ "Delete a project. (In preview period. See README.)"
+ },
+ getProjectCards: {
+ url: "/projects/columns/:column_id/cards",
+ method: "GET",
+ headers: {
+ accept: "application/vnd.github.inertia-preview+json"
+ },
+ params: { column_id: { type: "string", required: true } },
+ description:
+ "List project cards. (In preview period. See README.)"
+ },
+ getProjectCard: {
+ url: "/projects/columns/cards/:id",
+ method: "GET",
+ headers: {
+ accept: "application/vnd.github.inertia-preview+json"
+ },
+ params: { id: { type: "string", required: true } },
+ description:
+ "Get project card. (In preview period. See README.)"
+ },
+ createProjectCard: {
+ url: "/projects/columns/:column_id/cards",
+ method: "POST",
+ headers: {
+ accept: "application/vnd.github.inertia-preview+json"
+ },
+ params: {
+ column_id: { type: "string", required: true },
+ note: {
+ type: "string",
+ description: "The note of the card."
+ },
+ content_id: {
+ type: "string",
+ description:
+ "The id of the Issue or Pull Request to associate with this card."
+ },
+ content_type: {
+ type: "string",
+ description:
+ "The type of content to associate with this card. Can be either 'Issue' or 'PullRequest'."
+ }
+ },
+ description:
+ "Create a project card. (In preview period. See README.)"
+ },
+ updateProjectCard: {
+ url: "/projects/columns/cards/:id",
+ method: "PATCH",
+ headers: {
+ accept: "application/vnd.github.inertia-preview+json"
+ },
+ params: {
+ id: { type: "string", required: true },
+ note: { type: "string", description: "The note of the card." }
+ },
+ description:
+ "Update a project card. (In preview period. See README.)"
+ },
+ deleteProjectCard: {
+ url: "/projects/columns/cards/:id",
+ method: "DELETE",
+ headers: {
+ accept: "application/vnd.github.inertia-preview+json"
+ },
+ params: { id: { type: "string", required: true } },
+ description:
+ "Delete a project card. (In preview period. See README.)"
+ },
+ moveProjectCard: {
+ url: "/projects/columns/cards/:id/moves",
+ method: "POST",
+ headers: {
+ accept: "application/vnd.github.inertia-preview+json"
+ },
+ params: {
+ id: { type: "string", required: true },
+ position: {
+ type: "string",
+ required: true,
+ validation: "^(top|bottom|after:\\d+)$",
+ description:
+ "Can be one of top, bottom, or after:, where is the id value of a card in the same project."
+ },
+ column_id: {
+ type: "string",
+ description: "The id value of a column in the same project."
+ }
+ },
+ description:
+ "Move a project card. (In preview period. See README.)"
+ },
+ getProjectColumns: {
+ url: "/projects/:project_id/columns",
+ method: "GET",
+ headers: {
+ accept: "application/vnd.github.inertia-preview+json"
+ },
+ params: { project_id: { type: "string", required: true } },
+ description:
+ "List project columns. (In preview period. See README.)"
+ },
+ getProjectColumn: {
+ url: "/projects/columns/:id",
+ method: "GET",
+ headers: {
+ accept: "application/vnd.github.inertia-preview+json"
+ },
+ params: { id: { type: "string", required: true } },
+ description:
+ "Get a project column. (In preview period. See README.)"
+ },
+ createProjectColumn: {
+ url: "/projects/:project_id/columns",
+ method: "POST",
+ headers: {
+ accept: "application/vnd.github.inertia-preview+json"
+ },
+ params: {
+ project_id: { type: "string", required: true },
+ name: { type: "string", required: true }
+ },
+ description:
+ "Create a project column. (In preview period. See README.)"
+ },
+ updateProjectColumn: {
+ url: "/projects/columns/:id",
+ method: "PATCH",
+ headers: {
+ accept: "application/vnd.github.inertia-preview+json"
+ },
+ params: {
+ id: { type: "string", required: true },
+ name: { type: "string", required: true }
+ },
+ description:
+ "Update a project column. (In preview period. See README.)"
+ },
+ deleteProjectColumn: {
+ url: "/projects/columns/:id",
+ method: "DELETE",
+ headers: {
+ accept: "application/vnd.github.inertia-preview+json"
+ },
+ params: { id: { type: "string", required: true } },
+ description:
+ "Delete a project column. (In preview period. See README.)"
+ },
+ moveProjectColumn: {
+ url: "/projects/columns/:id/moves",
+ method: "POST",
+ headers: {
+ accept: "application/vnd.github.inertia-preview+json"
+ },
+ params: {
+ id: { type: "string", required: true },
+ position: {
+ type: "string",
+ required: true,
+ validation: "^(first|last|after:\\d+)$",
+ description:
+ "Can be one of first, last, or after:, where is the id value of a column in the same project."
+ }
+ },
+ description:
+ "Move a project column. (In preview period. See README.)"
+ }
+ },
+ pullRequests: {
+ get: {
+ url: "/repos/:owner/:repo/pulls/:number",
+ method: "GET",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ number: { type: "number", required: true }
+ },
+ description: "Get a single pull request"
+ },
+ create: {
+ url: "/repos/:owner/:repo/pulls",
+ method: "POST",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ head: {
+ type: "string",
+ required: true,
+ description:
+ "The branch (or git ref) where your changes are implemented."
+ },
+ base: {
+ type: "string",
+ required: true,
+ description:
+ "The branch (or git ref) you want your changes pulled into. This should be an existing branch on the current repository. You cannot submit a pull request to one repo that requests a merge to a base of another repo."
+ }
+ },
+ description: "Create a pull request"
+ },
+ update: {
+ url: "/repos/:owner/:repo/pulls/:number",
+ method: "PATCH",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ number: { type: "number", required: true },
+ title: {
+ type: "string",
+ description: "The title of the pull request."
+ },
+ body: {
+ type: "string",
+ description: "The contents of the pull request."
+ },
+ state: {
+ type: "string",
+ enum: ["open", "closed"],
+ description: "open or closed"
+ },
+ base: {
+ type: "string",
+ description:
+ "The branch (or git ref) you want your changes pulled into. This should be an existing branch on the current repository. You cannot submit a pull request to one repo that requests a merge to a base of another repo."
+ },
+ maintainer_can_modify: {
+ type: "boolean",
+ default: "true",
+ description:
+ "Indicates whether maintainers can modify the pull request."
+ }
+ },
+ description: "Update a pull request"
+ },
+ merge: {
+ url: "/repos/:owner/:repo/pulls/:number/merge",
+ method: "PUT",
+ headers: { accept: "application/vnd.github.polaris-preview" },
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ number: { type: "number", required: true },
+ commit_title: {
+ type: "string",
+ description:
+ "Title for the automatic commit message. (In preview period. See README.)"
+ },
+ commit_message: {
+ type: "string",
+ description:
+ "Extra detail to append to automatic commit message."
+ },
+ sha: {
+ type: "string",
+ description:
+ "SHA that pull request head must match to allow merge"
+ },
+ merge_method: {
+ type: "string",
+ enum: ["merge", "squash", "rebase"],
+ default: "merge",
+ description:
+ "Merge method to use. Possible values are `merge`, `squash`, or `rebase`. (In preview period. See README.)"
+ }
+ },
+ description: "Merge a pull request (Merge Button)"
+ },
+ getAll: {
+ url: "/repos/:owner/:repo/pulls",
+ method: "GET",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ state: {
+ type: "string",
+ enum: ["open", "closed", "all"],
+ default: "open"
+ },
+ head: {
+ type: "string",
+ description:
+ "Filter pulls by head user and branch name in the format of user:ref-name. Example: github:new-script-format."
+ },
+ base: {
+ type: "string",
+ description:
+ "Filter pulls by base branch name. Example: gh-pages."
+ },
+ sort: {
+ type: "string",
+ enum: ["created", "updated", "popularity", "long-running"],
+ default: "created",
+ description:
+ "Possible values are: `created`, `updated`, `popularity`, `long-running`, Default: `created`"
+ },
+ direction: {
+ type: "string",
+ enum: ["asc", "desc"],
+ default: "desc"
+ },
+ page: {
+ type: "number",
+ description: "Page number of the results to fetch."
+ },
+ per_page: {
+ type: "number",
+ default: "30",
+ description: "A custom page size up to 100. Default is 30."
+ }
+ },
+ description: "List pull requests"
+ },
+ createFromIssue: {
+ url: "/repos/:owner/:repo/pulls",
+ method: "POST",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ issue: {
+ type: "number",
+ required: true,
+ description:
+ "The issue number in this repository to turn into a Pull Request."
+ },
+ head: {
+ type: "string",
+ required: true,
+ description:
+ "The branch (or git ref) where your changes are implemented."
+ },
+ base: {
+ type: "string",
+ required: true,
+ description:
+ "The branch (or git ref) you want your changes pulled into. This should be an existing branch on the current repository. You cannot submit a pull request to one repo that requests a merge to a base of another repo."
+ }
+ },
+ description: "Create a pull request from an existing issue"
+ },
+ getCommits: {
+ url: "/repos/:owner/:repo/pulls/:number/commits",
+ method: "GET",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ number: { type: "number", required: true },
+ page: {
+ type: "number",
+ description: "Page number of the results to fetch."
+ },
+ per_page: {
+ type: "number",
+ default: "30",
+ description: "A custom page size up to 100. Default is 30."
+ }
+ },
+ description: "List commits on a pull request"
+ },
+ getFiles: {
+ url: "/repos/:owner/:repo/pulls/:number/files",
+ method: "GET",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ number: { type: "number", required: true },
+ page: {
+ type: "number",
+ description: "Page number of the results to fetch."
+ },
+ per_page: {
+ type: "number",
+ default: "30",
+ description: "A custom page size up to 100. Default is 30."
+ }
+ },
+ description: "List pull requests files"
+ },
+ checkMerged: {
+ url: "/repos/:owner/:repo/pulls/:number/merge",
+ method: "GET",
+ headers: { accept: "application/vnd.github.polaris-preview" },
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ number: { type: "number", required: true },
+ page: {
+ type: "number",
+ description: "Page number of the results to fetch."
+ },
+ per_page: {
+ type: "number",
+ default: "30",
+ description: "A custom page size up to 100. Default is 30."
+ }
+ },
+ description: "Get if a pull request has been merged"
+ },
+ getReviews: {
+ url: "/repos/:owner/:repo/pulls/:number/reviews",
+ method: "GET",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ number: { type: "number", required: true },
+ page: {
+ type: "number",
+ description: "Page number of the results to fetch."
+ },
+ per_page: {
+ type: "number",
+ default: "30",
+ description: "A custom page size up to 100. Default is 30."
+ }
+ },
+ description: "List reviews on a pull request."
+ },
+ getReview: {
+ url: "/repos/:owner/:repo/pulls/:number/reviews/:id",
+ method: "GET",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ number: { type: "number", required: true },
+ id: { type: "string", required: true }
+ },
+ description: "Get a single pull request review."
+ },
+ deletePendingReview: {
+ url: "/repos/:owner/:repo/pulls/:number/reviews/:id",
+ method: "DELETE",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ number: { type: "number", required: true },
+ id: { type: "string", required: true }
+ },
+ description: "Delete a pending pull request review."
+ },
+ getReviewComments: {
+ url: "/repos/:owner/:repo/pulls/:number/reviews/:id/comments",
+ method: "GET",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ number: { type: "number", required: true },
+ id: { type: "string", required: true },
+ page: {
+ type: "number",
+ description: "Page number of the results to fetch."
+ },
+ per_page: {
+ type: "number",
+ default: "30",
+ description: "A custom page size up to 100. Default is 30."
+ }
+ },
+ description: "Get comments for a pull request review."
+ },
+ createReview: {
+ url: "/repos/:owner/:repo/pulls/:number/reviews",
+ method: "POST",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ number: { type: "number", required: true },
+ commit_id: {
+ type: "string",
+ description: "Sha of the commit to comment on."
+ },
+ body: {
+ type: "string",
+ description: "The body text of the pull request review."
+ },
+ event: {
+ type: "string",
+ enum: ["APPROVE", "REQUEST_CHANGES", "COMMENT", "PENDING"],
+ default: "PENDING",
+ description:
+ "The event to perform on the review upon submission, can be one of APPROVE, REQUEST_CHANGES, or COMMENT. If left blank, the review will be in the PENDING state."
+ },
+ comments: {
+ type: "string[]",
+ description:
+ "An array of draft review comment objects. Draft review comments must include a `path`, `position`, and `body`."
+ }
+ },
+ description: "Create a pull request review."
+ },
+ submitReview: {
+ url: "/repos/:owner/:repo/pulls/:number/reviews/:id/events",
+ method: "POST",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ number: { type: "number", required: true },
+ id: { type: "string", required: true },
+ body: {
+ type: "string",
+ description: "The body text of the pull request review."
+ },
+ event: {
+ type: "string",
+ enum: ["APPROVE", "REQUEST_CHANGES", "COMMENT", "PENDING"],
+ default: "PENDING",
+ description:
+ "The event to perform on the review upon submission, can be one of APPROVE, REQUEST_CHANGES, or COMMENT. If left blank, the review will be in the PENDING state."
+ }
+ },
+ description: "Submit a pull request review."
+ },
+ dismissReview: {
+ url: "/repos/:owner/:repo/pulls/:number/reviews/:id/dismissals",
+ method: "PUT",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ number: { type: "number", required: true },
+ id: { type: "string", required: true },
+ message: {
+ type: "string",
+ description:
+ "The message for the pull request review dismissal."
+ },
+ page: {
+ type: "number",
+ description: "Page number of the results to fetch."
+ },
+ per_page: {
+ type: "number",
+ default: "30",
+ description: "A custom page size up to 100. Default is 30."
+ }
+ },
+ description: "Dismiss a pull request review."
+ },
+ getComments: {
+ url: "/repos/:owner/:repo/pulls/:number/comments",
+ method: "GET",
+ headers: {
+ accept: "application/vnd.github.squirrel-girl-preview"
+ },
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ number: { type: "number", required: true },
+ page: {
+ type: "number",
+ description: "Page number of the results to fetch."
+ },
+ per_page: {
+ type: "number",
+ default: "30",
+ description: "A custom page size up to 100. Default is 30."
+ }
+ },
+ description: "List comments on a pull request"
+ },
+ getCommentsForRepo: {
+ url: "/repos/:owner/:repo/pulls/comments",
+ method: "GET",
+ headers: {
+ accept: "application/vnd.github.squirrel-girl-preview"
+ },
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ sort: {
+ type: "string",
+ enum: ["created", "updated"],
+ default: "created",
+ description:
+ "Possible values are: `created`, `updated`, Default: `created`"
+ },
+ direction: {
+ type: "string",
+ enum: ["asc", "desc"],
+ default: "desc"
+ },
+ since: {
+ type: "date",
+ description:
+ "Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ"
+ },
+ page: {
+ type: "number",
+ description: "Page number of the results to fetch."
+ },
+ per_page: {
+ type: "number",
+ default: "30",
+ description: "A custom page size up to 100. Default is 30."
+ }
+ },
+ description: "List comments in a repository"
+ },
+ getComment: {
+ url: "/repos/:owner/:repo/pulls/comments/:id",
+ method: "GET",
+ headers: {
+ accept: "application/vnd.github.squirrel-girl-preview"
+ },
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ id: { type: "string", required: true }
+ },
+ description: "Get a single comment"
+ },
+ createComment: {
+ url: "/repos/:owner/:repo/pulls/:number/comments",
+ method: "POST",
+ headers: {
+ accept: "application/vnd.github.squirrel-girl-preview"
+ },
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ number: { type: "number", required: true },
+ body: { type: "string", required: true }
+ },
+ description: "Create a comment"
+ },
+ createCommentReply: {
+ url: "/repos/:owner/:repo/pulls/:number/comments",
+ method: "POST",
+ headers: {
+ accept: "application/vnd.github.squirrel-girl-preview"
+ },
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ number: { type: "number", required: true },
+ body: { type: "string", required: true },
+ in_reply_to: {
+ type: "number",
+ required: true,
+ description: "The comment id to reply to."
+ }
+ },
+ description: "Reply to existing pull request comment"
+ },
+ editComment: {
+ url: "/repos/:owner/:repo/pulls/comments/:id",
+ method: "PATCH",
+ headers: {
+ accept: "application/vnd.github.squirrel-girl-preview"
+ },
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ id: { type: "string", required: true },
+ body: { type: "string", required: true }
+ },
+ description: "Edit a comment"
+ },
+ deleteComment: {
+ url: "/repos/:owner/:repo/pulls/comments/:id",
+ method: "DELETE",
+ headers: {
+ accept: "application/vnd.github.squirrel-girl-preview"
+ },
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ id: { type: "string", required: true }
+ },
+ description: "Delete a comment"
+ },
+ getReviewRequests: {
+ url: "/repos/:owner/:repo/pulls/:number/requested_reviewers",
+ method: "GET",
+ headers: { accept: "application/vnd.github.thor-preview+json" },
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ number: { type: "number", required: true },
+ page: {
+ type: "number",
+ description: "Page number of the results to fetch."
+ },
+ per_page: {
+ type: "number",
+ default: "30",
+ description: "A custom page size up to 100. Default is 30."
+ }
+ },
+ description:
+ "List review requests. (In preview period. See README.)"
+ },
+ createReviewRequest: {
+ url: "/repos/:owner/:repo/pulls/:number/requested_reviewers",
+ method: "POST",
+ headers: { accept: "application/vnd.github.thor-preview+json" },
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ number: { type: "number", required: true },
+ reviewers: {
+ type: "string[]",
+ description:
+ "An array of user logins that will be requested."
+ },
+ team_reviewers: {
+ type: "string[]",
+ description:
+ "An array of team slugs that will be requested."
+ }
+ },
+ description:
+ "Create a review request. (In preview period. See README.)"
+ },
+ deleteReviewRequest: {
+ url: "/repos/:owner/:repo/pulls/:number/requested_reviewers",
+ method: "DELETE",
+ headers: { accept: "application/vnd.github.thor-preview+json" },
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ number: { type: "number", required: true },
+ reviewers: {
+ type: "string[]",
+ description:
+ "An array of user logins that will be requested."
+ },
+ team_reviewers: {
+ type: "string[]",
+ description:
+ "An array of team slugs that will be requested."
+ }
+ },
+ description:
+ "Delete a review request. (In preview period. See README.)"
+ }
+ },
+ reactions: {
+ delete: {
+ url: "/reactions/:id",
+ method: "DELETE",
+ headers: {
+ accept: "application/vnd.github.squirrel-girl-preview"
+ },
+ params: { id: { type: "string", required: true } },
+ description:
+ "Delete a reaction. (In preview period. See README.)"
+ },
+ getForCommitComment: {
+ url: "/repos/:owner/:repo/comments/:id/reactions",
+ method: "GET",
+ headers: {
+ accept: "application/vnd.github.squirrel-girl-preview"
+ },
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ id: { type: "string", required: true },
+ content: {
+ type: "string",
+ enum: ["+1", "-1", "laugh", "confused", "heart", "hooray"],
+ description: "Indicates which type of reaction to return."
+ }
+ },
+ description:
+ "List reactions for a commit comment. (In preview period. See README.)"
+ },
+ createForCommitComment: {
+ url: "/repos/:owner/:repo/comments/:id/reactions",
+ method: "POST",
+ headers: {
+ accept: "application/vnd.github.squirrel-girl-preview"
+ },
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ id: { type: "string", required: true },
+ content: {
+ type: "string",
+ required: true,
+ enum: ["+1", "-1", "laugh", "confused", "heart", "hooray"],
+ description: "The reaction type."
+ }
+ },
+ description:
+ "Create reaction for a commit comment. (In preview period. See README.)"
+ },
+ getForIssue: {
+ url: "/repos/:owner/:repo/issues/:number/reactions",
+ method: "GET",
+ headers: {
+ accept: "application/vnd.github.squirrel-girl-preview"
+ },
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ number: { type: "number", required: true },
+ content: {
+ type: "string",
+ enum: ["+1", "-1", "laugh", "confused", "heart", "hooray"],
+ description: "Indicates which type of reaction to return."
+ }
+ },
+ description:
+ "List reactions for an issue. (In preview period. See README.)"
+ },
+ createForIssue: {
+ url: "/repos/:owner/:repo/issues/:number/reactions",
+ method: "POST",
+ headers: {
+ accept: "application/vnd.github.squirrel-girl-preview"
+ },
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ number: { type: "number", required: true },
+ content: {
+ type: "string",
+ required: true,
+ enum: ["+1", "-1", "laugh", "confused", "heart", "hooray"],
+ description: "The reaction type."
+ }
+ },
+ description:
+ "Create reaction for an issue. (In preview period. See README.)"
+ },
+ getForIssueComment: {
+ url: "/repos/:owner/:repo/issues/comments/:id/reactions",
+ method: "GET",
+ headers: {
+ accept: "application/vnd.github.squirrel-girl-preview"
+ },
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ id: { type: "string", required: true },
+ content: {
+ type: "string",
+ enum: ["+1", "-1", "laugh", "confused", "heart", "hooray"],
+ description: "Indicates which type of reaction to return."
+ }
+ },
+ description:
+ "List reactions for an issue comment. (In preview period. See README.)"
+ },
+ createForIssueComment: {
+ url: "/repos/:owner/:repo/issues/comments/:id/reactions",
+ method: "POST",
+ headers: {
+ accept: "application/vnd.github.squirrel-girl-preview"
+ },
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ id: { type: "string", required: true },
+ content: {
+ type: "string",
+ required: true,
+ enum: ["+1", "-1", "laugh", "confused", "heart", "hooray"],
+ description: "The reaction type."
+ }
+ },
+ description:
+ "Create reaction for an issue comment. (In preview period. See README.)"
+ },
+ getForPullRequestReviewComment: {
+ url: "/repos/:owner/:repo/pulls/comments/:id/reactions",
+ method: "GET",
+ headers: {
+ accept: "application/vnd.github.squirrel-girl-preview"
+ },
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ id: { type: "string", required: true },
+ content: {
+ type: "string",
+ enum: ["+1", "-1", "laugh", "confused", "heart", "hooray"],
+ description: "Indicates which type of reaction to return."
+ }
+ },
+ description:
+ "List reactions for a pull request review comment. (In preview period. See README.)"
+ },
+ createForPullRequestReviewComment: {
+ url: "/repos/:owner/:repo/pulls/comments/:id/reactions",
+ method: "POST",
+ headers: {
+ accept: "application/vnd.github.squirrel-girl-preview"
+ },
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ id: { type: "string", required: true },
+ content: {
+ type: "string",
+ required: true,
+ enum: ["+1", "-1", "laugh", "confused", "heart", "hooray"],
+ description: "The reaction type."
+ }
+ },
+ description:
+ "Create reaction for a pull request review comment. (In preview period. See README.)"
+ }
+ },
+ repos: {
+ create: {
+ url: "/user/repos",
+ method: "POST",
+ params: {
+ name: { type: "string", required: true },
+ description: { type: "string" },
+ homepage: { type: "string" },
+ private: {
+ type: "boolean",
+ default: "false",
+ description:
+ "True to create a private repository, false to create a public one. Creating private repositories requires a paid GitHub account. Default is false."
+ },
+ has_issues: {
+ type: "boolean",
+ default: "true",
+ description:
+ "True to enable issues for this repository, false to disable them. Default is true."
+ },
+ has_projects: {
+ type: "boolean",
+ default: "true",
+ description:
+ "True to enable projects for this repository, false to disable them. Default is true."
+ },
+ has_wiki: {
+ type: "boolean",
+ default: "true",
+ description:
+ "True to enable the wiki for this repository, false to disable it. Default is true."
+ },
+ team_id: {
+ type: "number",
+ description:
+ "The id of the team that will be granted access to this repository. This is only valid when creating a repository in an organization."
+ },
+ auto_init: {
+ type: "boolean",
+ default: "false",
+ description:
+ "True to create an initial commit with empty README. Default is false"
+ },
+ gitignore_template: {
+ type: "string",
+ description:
+ "Desired language or platform .gitignore template to apply. Ignored if auto_init parameter is not provided."
+ },
+ license_template: {
+ type: "string",
+ description:
+ 'Desired LICENSE template to apply. Use the name of the template without the extension. For example, "mit" or "mozilla".'
+ },
+ allow_squash_merge: {
+ type: "boolean",
+ default: "true",
+ description:
+ "Either true to allow squash-merging pull requests, or false to prevent squash-merging. Default: true. (In preview period. See README.)"
+ },
+ allow_merge_commit: {
+ type: "boolean",
+ default: "true",
+ description:
+ "Either true to allow merging pull requests with a merge commit, or false to prevent merging pull requests with merge commits. Default: true. (In preview period. See README.)"
+ },
+ allow_rebase_merge: {
+ type: "boolean",
+ default: "true",
+ description:
+ "Either true to allow rebase-merging pull requests, or false to prevent rebase-merging. Default: true. (In preview period. See README.)"
+ }
+ },
+ description:
+ "Create a new repository for the authenticated user."
+ },
+ get: {
+ url: "/repos/:owner/:repo",
+ method: "GET",
+ headers: { accept: "application/vnd.github.drax-preview+json" },
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true }
+ },
+ description: "Get a repo for a user."
+ },
+ edit: {
+ url: "/repos/:owner/:repo",
+ method: "PATCH",
+ headers: { accept: "application/vnd.github.drax-preview+json" },
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ name: { type: "string", required: true },
+ description: { type: "string" },
+ homepage: { type: "string" },
+ private: {
+ type: "boolean",
+ default: "false",
+ description:
+ "True to create a private repository, false to create a public one. Creating private repositories requires a paid GitHub account. Default is false."
+ },
+ has_issues: {
+ type: "boolean",
+ default: "true",
+ description:
+ "True to enable issues for this repository, false to disable them. Default is true."
+ },
+ has_projects: {
+ type: "boolean",
+ default: "true",
+ description:
+ "True to enable projects for this repository, false to disable them. Default is true."
+ },
+ has_wiki: {
+ type: "boolean",
+ default: "true",
+ description:
+ "True to enable the wiki for this repository, false to disable it. Default is true."
+ },
+ default_branch: {
+ type: "string",
+ description:
+ "Updates the default branch for this repository."
+ },
+ allow_squash_merge: {
+ type: "boolean",
+ default: "true",
+ description:
+ "Either true to allow squash-merging pull requests, or false to prevent squash-merging. Default: true. (In preview period. See README.)"
+ },
+ allow_merge_commit: {
+ type: "boolean",
+ default: "true",
+ description:
+ "Either true to allow merging pull requests with a merge commit, or false to prevent merging pull requests with merge commits. Default: true. (In preview period. See README.)"
+ },
+ allow_rebase_merge: {
+ type: "boolean",
+ default: "true",
+ description:
+ "Either true to allow rebase-merging pull requests, or false to prevent rebase-merging. Default: true. (In preview period. See README.)"
+ }
+ },
+ description: "Update a repo."
+ },
+ delete: {
+ url: "/repos/:owner/:repo",
+ method: "DELETE",
+ headers: { accept: "application/vnd.github.drax-preview+json" },
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true }
+ },
+ description: "Delete a repository."
+ },
+ fork: {
+ url: "/repos/:owner/:repo/forks",
+ method: "POST",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ organization: {
+ type: "string",
+ description:
+ "Optional parameter to specify the organization name if forking into an organization."
+ }
+ },
+ description: "Create a fork."
+ },
+ merge: {
+ url: "/repos/:owner/:repo/merges",
+ method: "POST",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ base: {
+ type: "string",
+ required: true,
+ description:
+ "The branch (or git ref) you want your changes pulled into. This should be an existing branch on the current repository. You cannot submit a pull request to one repo that requests a merge to a base of another repo."
+ },
+ head: {
+ type: "string",
+ required: true,
+ description:
+ "The branch (or git ref) where your changes are implemented."
+ },
+ commit_message: {
+ type: "string",
+ description:
+ "Commit message to use for the merge commit. If omitted, a default message will be used."
+ }
+ },
+ description: "Perform a merge."
+ },
+ getAll: {
+ url: "/user/repos",
+ method: "GET",
+ params: {
+ visibility: {
+ type: "string",
+ enum: ["all", "public", "private"],
+ default: "all",
+ description:
+ "Can be one of `all`, `public`, or `private`. Default: `all`."
+ },
+ affiliation: {
+ type: "string",
+ default: "owner,collaborator,organization_member",
+ description:
+ "Comma-separated list of values. Can include: `owner`, `collaborator`, `organization_member`."
+ },
+ type: {
+ type: "string",
+ enum: ["all", "owner", "public", "private", "member"],
+ default: "all",
+ description:
+ "Possible values: `all`, `owner`, `public`, `private`, `member`. Default: `all`."
+ },
+ sort: {
+ type: "string",
+ enum: ["created", "updated", "pushed", "full_name"],
+ default: "full_name",
+ description:
+ "Possible values: `created`, `updated`, `pushed`, `full_name`. Default: `full_name`."
+ },
+ direction: {
+ type: "string",
+ enum: ["asc", "desc"],
+ default: "desc"
+ },
+ page: {
+ type: "number",
+ description: "Page number of the results to fetch."
+ },
+ per_page: {
+ type: "number",
+ default: "30",
+ description: "A custom page size up to 100. Default is 30."
+ }
+ },
+ description: "List your repositories"
+ },
+ getForUser: {
+ url: "/users/:username/repos",
+ method: "GET",
+ params: {
+ username: { type: "string", required: true },
+ type: {
+ type: "string",
+ enum: ["all", "owner", "member"],
+ default: "owner",
+ description:
+ "Possible values: `all`, `owner`, `member`. Default: `owner`."
+ },
+ sort: {
+ type: "string",
+ enum: ["created", "updated", "pushed", "full_name"],
+ default: "full_name",
+ description:
+ "Possible values: `created`, `updated`, `pushed`, `full_name`. Default: `full_name`."
+ },
+ direction: {
+ type: "string",
+ enum: ["asc", "desc"],
+ default: "desc"
+ },
+ page: {
+ type: "number",
+ description: "Page number of the results to fetch."
+ },
+ per_page: {
+ type: "number",
+ default: "30",
+ description: "A custom page size up to 100. Default is 30."
+ }
+ },
+ description: "List public repositories for the specified user."
+ },
+ getForOrg: {
+ url: "/orgs/:org/repos",
+ method: "GET",
+ params: {
+ org: { type: "string", required: true },
+ type: {
+ type: "string",
+ enum: [
+ "all",
+ "public",
+ "private",
+ "forks",
+ "sources",
+ "member"
+ ],
+ default: "all",
+ description:
+ "Possible values: `all`, `public`, `private`, `forks`, `sources`, `member`. Default: `all`."
+ },
+ page: {
+ type: "number",
+ description: "Page number of the results to fetch."
+ },
+ per_page: {
+ type: "number",
+ default: "30",
+ description: "A custom page size up to 100. Default is 30."
+ }
+ },
+ description: "List repositories for the specified org."
+ },
+ getPublic: {
+ url: "/repositories",
+ method: "GET",
+ params: {
+ since: {
+ type: "string",
+ description:
+ "The integer ID of the last Repository that you've seen."
+ },
+ page: {
+ type: "number",
+ description: "Page number of the results to fetch."
+ },
+ per_page: {
+ type: "number",
+ default: "30",
+ description: "A custom page size up to 100. Default is 30."
+ }
+ },
+ description: "List all public repositories"
+ },
+ createForOrg: {
+ url: "/orgs/:org/repos",
+ method: "POST",
+ params: {
+ org: { type: "string", required: true },
+ name: { type: "string", required: true },
+ description: { type: "string" },
+ homepage: { type: "string" },
+ private: {
+ type: "boolean",
+ default: "false",
+ description:
+ "True to create a private repository, false to create a public one. Creating private repositories requires a paid GitHub account. Default is false."
+ },
+ has_issues: {
+ type: "boolean",
+ default: "true",
+ description:
+ "True to enable issues for this repository, false to disable them. Default is true."
+ },
+ has_projects: {
+ type: "boolean",
+ default: "true",
+ description:
+ "True to enable projects for this repository, false to disable them. Default is true."
+ },
+ has_wiki: {
+ type: "boolean",
+ default: "true",
+ description:
+ "True to enable the wiki for this repository, false to disable it. Default is true."
+ },
+ team_id: {
+ type: "number",
+ description:
+ "The id of the team that will be granted access to this repository. This is only valid when creating a repository in an organization."
+ },
+ auto_init: {
+ type: "boolean",
+ default: "false",
+ description:
+ "True to create an initial commit with empty README. Default is false"
+ },
+ gitignore_template: {
+ type: "string",
+ description:
+ "Desired language or platform .gitignore template to apply. Ignored if auto_init parameter is not provided."
+ },
+ license_template: {
+ type: "string",
+ description:
+ 'Desired LICENSE template to apply. Use the name of the template without the extension. For example, "mit" or "mozilla".'
+ },
+ allow_squash_merge: {
+ type: "boolean",
+ default: "true",
+ description:
+ "Either true to allow squash-merging pull requests, or false to prevent squash-merging. Default: true. (In preview period. See README.)"
+ },
+ allow_merge_commit: {
+ type: "boolean",
+ default: "true",
+ description:
+ "Either true to allow merging pull requests with a merge commit, or false to prevent merging pull requests with merge commits. Default: true. (In preview period. See README.)"
+ },
+ allow_rebase_merge: {
+ type: "boolean",
+ default: "true",
+ description:
+ "Either true to allow rebase-merging pull requests, or false to prevent rebase-merging. Default: true. (In preview period. See README.)"
+ }
+ },
+ description: "Create a new repository for an organization."
+ },
+ getById: {
+ url: "/repositories/:id",
+ method: "GET",
+ params: {
+ id: {
+ type: "string",
+ required: true,
+ description: "Numerical ID of the repository."
+ }
+ },
+ description: "Get a single repo by id."
+ },
+ getTopics: {
+ url: "/repos/:owner/:repo/topics",
+ method: "GET",
+ headers: {
+ accept: "application/vnd.github.mercy-preview+json"
+ },
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ page: {
+ type: "number",
+ description: "Page number of the results to fetch."
+ },
+ per_page: {
+ type: "number",
+ default: "30",
+ description: "A custom page size up to 100. Default is 30."
+ }
+ },
+ description:
+ "List all topics for a repository. (In preview period. See README.)"
+ },
+ replaceTopics: {
+ url: "/repos/:owner/:repo/topics",
+ method: "PUT",
+ headers: {
+ accept: "application/vnd.github.mercy-preview+json"
+ },
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ names: {
+ type: "string[]",
+ required: true,
+ description:
+ "An array of topics to add to the repository. Pass one or more topics to replace the set of existing topics. Send an empty array ([]) to clear all topics from the repository."
+ }
+ },
+ description:
+ "Replace all topics for a repository. (In preview period. See README.)"
+ },
+ getContributors: {
+ url: "/repos/:owner/:repo/contributors",
+ method: "GET",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ anon: {
+ type: "boolean",
+ description:
+ "Set to 1 or true to include anonymous contributors in results."
+ },
+ page: {
+ type: "number",
+ description: "Page number of the results to fetch."
+ },
+ per_page: {
+ type: "number",
+ default: "30",
+ description: "A custom page size up to 100. Default is 30."
+ }
+ },
+ description: "Get contributors for the specified repository."
+ },
+ getLanguages: {
+ url: "/repos/:owner/:repo/languages",
+ method: "GET",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ page: {
+ type: "number",
+ description: "Page number of the results to fetch."
+ },
+ per_page: {
+ type: "number",
+ default: "30",
+ description: "A custom page size up to 100. Default is 30."
+ }
+ },
+ description: "Get languages for the specified repository."
+ },
+ getTeams: {
+ url: "/repos/:owner/:repo/teams",
+ method: "GET",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ page: {
+ type: "number",
+ description: "Page number of the results to fetch."
+ },
+ per_page: {
+ type: "number",
+ default: "30",
+ description: "A custom page size up to 100. Default is 30."
+ }
+ },
+ description: "Get teams for the specified repository."
+ },
+ getTags: {
+ url: "/repos/:owner/:repo/tags",
+ method: "GET",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ page: {
+ type: "number",
+ description: "Page number of the results to fetch."
+ },
+ per_page: {
+ type: "number",
+ default: "30",
+ description: "A custom page size up to 100. Default is 30."
+ }
+ },
+ description: "Get tags for the specified repository."
+ },
+ getBranches: {
+ url: "/repos/:owner/:repo/branches",
+ method: "GET",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ protected: {
+ type: "boolean",
+ description: "Set to true to only return protected branches"
+ },
+ page: {
+ type: "number",
+ description: "Page number of the results to fetch."
+ },
+ per_page: {
+ type: "number",
+ default: "30",
+ description: "A custom page size up to 100. Default is 30."
+ }
+ },
+ description: "List branches."
+ },
+ getBranch: {
+ url: "/repos/:owner/:repo/branches/:branch",
+ method: "GET",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ branch: { type: "string", required: true },
+ page: {
+ type: "number",
+ description: "Page number of the results to fetch."
+ },
+ per_page: {
+ type: "number",
+ default: "30",
+ description: "A custom page size up to 100. Default is 30."
+ }
+ },
+ description: "Get branch."
+ },
+ getBranchProtection: {
+ url: "/repos/:owner/:repo/branches/:branch/protection",
+ method: "GET",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ branch: { type: "string", required: true },
+ page: {
+ type: "number",
+ description: "Page number of the results to fetch."
+ },
+ per_page: {
+ type: "number",
+ default: "30",
+ description: "A custom page size up to 100. Default is 30."
+ }
+ },
+ description: "Get branch protection."
+ },
+ updateBranchProtection: {
+ url: "/repos/:owner/:repo/branches/:branch/protection",
+ method: "PUT",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ branch: { type: "string", required: true },
+ required_status_checks: {
+ type: "json",
+ required: true,
+ "allow-null": true,
+ description:
+ "JSON object that contains the following keys: `include_admins` - Enforce required status checks for repository administrators, `strict` - Require branches to be up to date before merging, `contexts` - The list of status checks to require in order to merge into this branch. This object can have the value of `null` for disabled."
+ },
+ required_pull_request_reviews: {
+ type: "json",
+ required: true,
+ "allow-null": true,
+ description:
+ "JSON object that contains the following keys: `include_admins` - Enforce required status checks for repository administrators."
+ },
+ dismissal_restrictions: {
+ type: "json",
+ "allow-null": true,
+ description:
+ "JSON object that contains the following keys: `users` - The list of user logins with dismissal access, `teams` - The list of team slugs with dismissal access. This object can have the value of `null` for disabled."
+ },
+ restrictions: {
+ type: "json",
+ required: true,
+ "allow-null": true,
+ description:
+ "JSON object that contains the following keys: `users` - The list of user logins with push access, `teams` - The list of team slugs with push access. This object can have the value of `null` for disabled."
+ },
+ enforce_admins: {
+ type: "boolean",
+ required: true,
+ "allow-null": false,
+ description:
+ "Enforces required status checks for repository administrators."
+ },
+ page: {
+ type: "number",
+ description: "Page number of the results to fetch."
+ },
+ per_page: {
+ type: "number",
+ default: "30",
+ description: "A custom page size up to 100. Default is 30."
+ }
+ },
+ description: "Update branch protection."
+ },
+ removeBranchProtection: {
+ url: "/repos/:owner/:repo/branches/:branch/protection",
+ method: "DELETE",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ branch: { type: "string", required: true }
+ },
+ description: "Remove branch protection."
+ },
+ getProtectedBranchRequiredStatusChecks: {
+ url:
+ "/repos/:owner/:repo/branches/:branch/protection/required_status_checks",
+ method: "GET",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ branch: { type: "string", required: true },
+ page: {
+ type: "number",
+ description: "Page number of the results to fetch."
+ },
+ per_page: {
+ type: "number",
+ default: "30",
+ description: "A custom page size up to 100. Default is 30."
+ }
+ },
+ description: "Get required status checks of protected branch."
+ },
+ updateProtectedBranchRequiredStatusChecks: {
+ url:
+ "/repos/:owner/:repo/branches/:branch/protection/required_status_checks",
+ method: "PATCH",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ branch: { type: "string", required: true },
+ strict: {
+ type: "boolean",
+ description:
+ "Require branches to be up to date before merging."
+ },
+ contexts: {
+ type: "string[]",
+ description:
+ "The list of status checks to require in order to merge into this branch."
+ }
+ },
+ description:
+ "Update required status checks of protected branch."
+ },
+ removeProtectedBranchRequiredStatusChecks: {
+ url:
+ "/repos/:owner/:repo/branches/:branch/protection/required_status_checks",
+ method: "DELETE",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ branch: { type: "string", required: true }
+ },
+ description:
+ "Remove required status checks of protected branch."
+ },
+ getProtectedBranchRequiredStatusChecksContexts: {
+ url:
+ "/repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts",
+ method: "GET",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ branch: { type: "string", required: true },
+ page: {
+ type: "number",
+ description: "Page number of the results to fetch."
+ },
+ per_page: {
+ type: "number",
+ default: "30",
+ description: "A custom page size up to 100. Default is 30."
+ }
+ },
+ description:
+ "List required status checks contexts of protected branch."
+ },
+ replaceProtectedBranchRequiredStatusChecksContexts: {
+ url:
+ "/repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts",
+ method: "PUT",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ branch: { type: "string", required: true },
+ contexts: {
+ type: "string[]",
+ required: true,
+ mapTo: "input",
+ description:
+ "An array of protected branch required status checks contexts (e.g. continuous-integration/jenkins)."
+ }
+ },
+ description:
+ "Replace required status checks contexts of protected branch."
+ },
+ addProtectedBranchRequiredStatusChecksContexts: {
+ url:
+ "/repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts",
+ method: "POST",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ branch: { type: "string", required: true },
+ contexts: {
+ type: "string[]",
+ required: true,
+ mapTo: "input",
+ description:
+ "An array of protected branch required status checks contexts (e.g. continuous-integration/jenkins)."
+ }
+ },
+ description:
+ "Add required status checks contexts of protected branch."
+ },
+ removeProtectedBranchRequiredStatusChecksContexts: {
+ url:
+ "/repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts",
+ method: "DELETE",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ branch: { type: "string", required: true },
+ contexts: {
+ type: "string[]",
+ required: true,
+ mapTo: "input",
+ description:
+ "An array of protected branch required status checks contexts (e.g. continuous-integration/jenkins)."
+ }
+ },
+ description:
+ "Remove required status checks contexts of protected branch."
+ },
+ getProtectedBranchPullRequestReviewEnforcement: {
+ url:
+ "/repos/:owner/:repo/branches/:branch/protection/required_pull_request_reviews",
+ method: "GET",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ branch: { type: "string", required: true },
+ page: {
+ type: "number",
+ description: "Page number of the results to fetch."
+ },
+ per_page: {
+ type: "number",
+ default: "30",
+ description: "A custom page size up to 100. Default is 30."
+ }
+ },
+ description:
+ "Get pull request review enforcement of protected branch."
+ },
+ updateProtectedBranchPullRequestReviewEnforcement: {
+ url:
+ "/repos/:owner/:repo/branches/:branch/protection/required_pull_request_reviews",
+ method: "PATCH",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ branch: { type: "string", required: true },
+ dismissal_restrictions: {
+ type: "json",
+ "allow-null": true,
+ description:
+ "JSON object that contains the following keys: `users` - The list of user logins with dismissal access, `teams` - The list of team slugs with dismissal access. This object can have the value of `null` for disabled."
+ },
+ dismiss_stale_reviews: {
+ type: "boolean",
+ description:
+ "Dismiss approved reviews automatically when a new commit is pushed."
+ },
+ require_code_owner_reviews: {
+ type: "boolean",
+ description: "Blocks merge until code owners have reviewed."
+ }
+ },
+ description:
+ "Update pull request review enforcement of protected branch."
+ },
+ removeProtectedBranchPullRequestReviewEnforcement: {
+ url:
+ "/repos/:owner/:repo/branches/:branch/protection/required_pull_request_reviews",
+ method: "DELETE",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ branch: { type: "string", required: true }
+ },
+ description:
+ "Remove pull request review enforcement of protected branch."
+ },
+ getProtectedBranchAdminEnforcement: {
+ url:
+ "/repos/:owner/:repo/branches/:branch/protection/enforce_admins",
+ method: "GET",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ branch: { type: "string", required: true },
+ page: {
+ type: "number",
+ description: "Page number of the results to fetch."
+ },
+ per_page: {
+ type: "number",
+ default: "30",
+ description: "A custom page size up to 100. Default is 30."
+ }
+ },
+ description: "Get admin enforcement of protected branch."
+ },
+ addProtectedBranchAdminEnforcement: {
+ url:
+ "/repos/:owner/:repo/branches/:branch/protection/enforce_admins",
+ method: "POST",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ branch: { type: "string", required: true },
+ page: {
+ type: "number",
+ description: "Page number of the results to fetch."
+ },
+ per_page: {
+ type: "number",
+ default: "30",
+ description: "A custom page size up to 100. Default is 30."
+ }
+ },
+ description: "Add admin enforcement of protected branch."
+ },
+ removeProtectedBranchAdminEnforcement: {
+ url:
+ "/repos/:owner/:repo/branches/:branch/protection/enforce_admins",
+ method: "DELETE",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ branch: { type: "string", required: true }
+ },
+ description: "Remove admin enforcement of protected branch."
+ },
+ getProtectedBranchRestrictions: {
+ url:
+ "/repos/:owner/:repo/branches/:branch/protection/restrictions",
+ method: "GET",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ branch: { type: "string", required: true },
+ page: {
+ type: "number",
+ description: "Page number of the results to fetch."
+ },
+ per_page: {
+ type: "number",
+ default: "30",
+ description: "A custom page size up to 100. Default is 30."
+ }
+ },
+ description: "Get restrictions of protected branch."
+ },
+ removeProtectedBranchRestrictions: {
+ url:
+ "/repos/:owner/:repo/branches/:branch/protection/restrictions",
+ method: "DELETE",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ branch: { type: "string", required: true }
+ },
+ description: "Remove restrictions of protected branch."
+ },
+ getProtectedBranchTeamRestrictions: {
+ url:
+ "/repos/:owner/:repo/branches/:branch/protection/restrictions/teams",
+ method: "GET",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ branch: { type: "string", required: true },
+ page: {
+ type: "number",
+ description: "Page number of the results to fetch."
+ },
+ per_page: {
+ type: "number",
+ default: "30",
+ description: "A custom page size up to 100. Default is 30."
+ }
+ },
+ description: "List team restrictions of protected branch."
+ },
+ replaceProtectedBranchTeamRestrictions: {
+ url:
+ "/repos/:owner/:repo/branches/:branch/protection/restrictions/teams",
+ method: "PUT",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ branch: { type: "string", required: true },
+ teams: {
+ type: "string[]",
+ required: true,
+ mapTo: "input",
+ description: "An array of team slugs (e.g. justice-league)."
+ }
+ },
+ description: "Replace team restrictions of protected branch."
+ },
+ addProtectedBranchTeamRestrictions: {
+ url:
+ "/repos/:owner/:repo/branches/:branch/protection/restrictions/teams",
+ method: "POST",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ branch: { type: "string", required: true },
+ teams: {
+ type: "string[]",
+ required: true,
+ mapTo: "input",
+ description: "An array of team slugs (e.g. justice-league)."
+ }
+ },
+ description: "Add team restrictions of protected branch."
+ },
+ removeProtectedBranchTeamRestrictions: {
+ url:
+ "/repos/:owner/:repo/branches/:branch/protection/restrictions/teams",
+ method: "DELETE",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ branch: { type: "string", required: true },
+ teams: {
+ type: "string[]",
+ required: true,
+ mapTo: "input",
+ description: "An array of team slugs (e.g. justice-league)."
+ }
+ },
+ description: "Remove team restrictions of protected branch."
+ },
+ getProtectedBranchUserRestrictions: {
+ url:
+ "/repos/:owner/:repo/branches/:branch/protection/restrictions/users",
+ method: "GET",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ branch: { type: "string", required: true },
+ page: {
+ type: "number",
+ description: "Page number of the results to fetch."
+ },
+ per_page: {
+ type: "number",
+ default: "30",
+ description: "A custom page size up to 100. Default is 30."
+ }
+ },
+ description: "List user restrictions of protected branch."
+ },
+ replaceProtectedBranchUserRestrictions: {
+ url:
+ "/repos/:owner/:repo/branches/:branch/protection/restrictions/users",
+ method: "PUT",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ branch: { type: "string", required: true },
+ users: {
+ type: "string[]",
+ required: true,
+ mapTo: "input",
+ description: "An array of team slugs (e.g. justice-league)."
+ }
+ },
+ description: "Replace user restrictions of protected branch."
+ },
+ addProtectedBranchUserRestrictions: {
+ url:
+ "/repos/:owner/:repo/branches/:branch/protection/restrictions/users",
+ method: "POST",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ branch: { type: "string", required: true },
+ users: {
+ type: "string[]",
+ required: true,
+ mapTo: "input",
+ description: "An array of team slugs (e.g. justice-league)."
+ }
+ },
+ description: "Add user restrictions of protected branch."
+ },
+ removeProtectedBranchUserRestrictions: {
+ url:
+ "/repos/:owner/:repo/branches/:branch/protection/restrictions/users",
+ method: "DELETE",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ branch: { type: "string", required: true },
+ users: {
+ type: "string[]",
+ required: true,
+ mapTo: "input",
+ description: "An array of team slugs (e.g. justice-league)."
+ }
+ },
+ description: "Remove user restrictions of protected branch."
+ },
+ getCollaborators: {
+ url: "/repos/:owner/:repo/collaborators",
+ method: "GET",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ affiliation: {
+ type: "string",
+ enum: ["outside", "all", "direct"],
+ default: "all",
+ description:
+ "Filter collaborators returned by their affiliation."
+ },
+ page: {
+ type: "number",
+ description: "Page number of the results to fetch."
+ },
+ per_page: {
+ type: "number",
+ default: "30",
+ description: "A custom page size up to 100. Default is 30."
+ }
+ },
+ description: "List collaborators"
+ },
+ checkCollaborator: {
+ url: "/repos/:owner/:repo/collaborators/:username",
+ method: "GET",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ username: { type: "string", required: true }
+ },
+ description: "Check if user is a collaborator."
+ },
+ reviewUserPermissionLevel: {
+ url: "/repos/:owner/:repo/collaborators/:username/permission",
+ method: "GET",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ username: { type: "string", required: true }
+ },
+ description: "Review a user's permission level."
+ },
+ addCollaborator: {
+ url: "/repos/:owner/:repo/collaborators/:username",
+ method: "PUT",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ username: { type: "string", required: true },
+ permission: {
+ type: "string",
+ enum: ["pull", "push", "admin"],
+ default: "push",
+ description:
+ "`pull` - can pull, but not push to or administer this repository, `push` - can pull and push, but not administer this repository, `admin` - can pull, push and administer this repository."
+ }
+ },
+ description: "Add user as a collaborator"
+ },
+ removeCollaborator: {
+ url: "/repos/:owner/:repo/collaborators/:username",
+ method: "DELETE",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ username: { type: "string", required: true }
+ },
+ description: "Remove user as a collaborator."
+ },
+ getAllCommitComments: {
+ url: "/repos/:owner/:repo/comments",
+ method: "GET",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ page: {
+ type: "number",
+ description: "Page number of the results to fetch."
+ },
+ per_page: {
+ type: "number",
+ default: "30",
+ description: "A custom page size up to 100. Default is 30."
+ }
+ },
+ description: "List commit comments for a repository."
+ },
+ getCommitComments: {
+ url: "/repos/:owner/:repo/commits/:ref/comments",
+ method: "GET",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ ref: { type: "string", required: true },
+ page: {
+ type: "number",
+ description: "Page number of the results to fetch."
+ },
+ per_page: {
+ type: "number",
+ default: "30",
+ description: "A custom page size up to 100. Default is 30."
+ }
+ },
+ description: "List comments for a single commit."
+ },
+ createCommitComment: {
+ url: "/repos/:owner/:repo/commits/:sha/comments",
+ method: "POST",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ sha: { type: "string", required: true },
+ body: { type: "string", required: true },
+ path: {
+ type: "string",
+ description: "Relative path of the file to comment on."
+ },
+ position: {
+ type: "number",
+ description: "Line index in the diff to comment on."
+ }
+ },
+ description: "Create a commit comment."
+ },
+ getCommitComment: {
+ url: "/repos/:owner/:repo/comments/:id",
+ method: "GET",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ id: { type: "string", required: true }
+ },
+ description: "Get a single commit comment."
+ },
+ updateCommitComment: {
+ url: "/repos/:owner/:repo/comments/:id",
+ method: "PATCH",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ id: { type: "string", required: true },
+ body: { type: "string", required: true }
+ },
+ description: "Update a commit comment."
+ },
+ deleteCommitComment: {
+ url: "/repos/:owner/:repo/comments/:id",
+ method: "DELETE",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ id: { type: "string", required: true }
+ },
+ description: "Delete a commit comment."
+ },
+ getCommunityProfileMetrics: {
+ url: "/repos/:owner/:name/community/profile",
+ method: "GET",
+ headers: {
+ accept: "application/vnd.github.black-panther-preview+json"
+ },
+ params: {
+ owner: { type: "string", required: true },
+ name: { type: "string", required: true }
+ },
+ description: "Retrieve community profile metrics."
+ },
+ getCommits: {
+ url: "/repos/:owner/:repo/commits",
+ method: "GET",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ sha: {
+ type: "string",
+ description: "Sha or branch to start listing commits from."
+ },
+ path: {
+ type: "string",
+ description:
+ "Only commits containing this file path will be returned."
+ },
+ author: {
+ type: "string",
+ description:
+ "GitHub login or email address by which to filter by commit author."
+ },
+ since: {
+ type: "date",
+ description:
+ "Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ"
+ },
+ until: {
+ type: "date",
+ description:
+ "Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ"
+ },
+ page: {
+ type: "number",
+ description: "Page number of the results to fetch."
+ },
+ per_page: {
+ type: "number",
+ default: "30",
+ description: "A custom page size up to 100. Default is 30."
+ }
+ },
+ description: "List commits on a repository."
+ },
+ getCommit: {
+ url: "/repos/:owner/:repo/commits/:sha",
+ method: "GET",
+ headers: {
+ accept: "application/vnd.github.cryptographer-preview"
+ },
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ sha: { type: "string", required: true }
+ },
+ description: "Get a single commit."
+ },
+ getShaOfCommitRef: {
+ url: "/repos/:owner/:repo/commits/:ref",
+ method: "GET",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ ref: {
+ type: "string",
+ required: true,
+ "allow-empty": true,
+ description:
+ "String of the name of the fully qualified reference (ie: heads/master). If it doesn’t have at least one slash, it will be rejected."
+ }
+ },
+ description: "Get the SHA-1 of a commit reference."
+ },
+ compareCommits: {
+ url: "/repos/:owner/:repo/compare/:base...:head",
+ method: "GET",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ base: {
+ type: "string",
+ required: true,
+ description:
+ "The branch (or git ref) you want your changes pulled into. This should be an existing branch on the current repository. You cannot submit a pull request to one repo that requests a merge to a base of another repo."
+ },
+ head: {
+ type: "string",
+ required: true,
+ description:
+ "The branch (or git ref) where your changes are implemented."
+ }
+ },
+ description: "Compare two commits."
+ },
+ getReadme: {
+ url: "/repos/:owner/:repo/readme",
+ method: "GET",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ ref: {
+ type: "string",
+ description:
+ "The name of the commit/branch/tag. Default: the repository’s default branch (usually master)"
+ }
+ },
+ description: "Get the README for the given repository."
+ },
+ getContent: {
+ url: "/repos/:owner/:repo/contents/:path",
+ method: "GET",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ path: {
+ type: "string",
+ required: true,
+ "allow-empty": true,
+ description: "The content path."
+ },
+ ref: {
+ type: "string",
+ description:
+ "The String name of the Commit/Branch/Tag. Defaults to master."
+ }
+ },
+ description:
+ "Get the contents of a file or directory in a repository."
+ },
+ createFile: {
+ url: "/repos/:owner/:repo/contents/:path",
+ method: "PUT",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ path: {
+ type: "string",
+ required: true,
+ description: "The content path."
+ },
+ message: {
+ type: "string",
+ required: true,
+ description: "The commit message."
+ },
+ content: {
+ type: "string",
+ required: true,
+ description: "The new file content, Base64 encoded."
+ },
+ branch: {
+ type: "string",
+ description:
+ "The branch name. If not provided, uses the repository’s default branch (usually master)."
+ },
+ committer: { type: "json" },
+ author: { type: "json" }
+ },
+ description: "Create a new file in the given repository."
+ },
+ updateFile: {
+ url: "/repos/:owner/:repo/contents/:path",
+ method: "PUT",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ path: {
+ type: "string",
+ required: true,
+ description: "The content path."
+ },
+ message: {
+ type: "string",
+ required: true,
+ description: "The commit message."
+ },
+ content: {
+ type: "string",
+ required: true,
+ description: "The updated file content, Base64 encoded."
+ },
+ sha: {
+ type: "string",
+ required: true,
+ description: "The blob SHA of the file being replaced."
+ },
+ branch: {
+ type: "string",
+ description:
+ "The branch name. If not provided, uses the repository’s default branch (usually master)."
+ },
+ committer: { type: "json" },
+ author: { type: "json" }
+ },
+ description: "Update a file."
+ },
+ deleteFile: {
+ url: "/repos/:owner/:repo/contents/:path",
+ method: "DELETE",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ path: {
+ type: "string",
+ required: true,
+ description: "The content path."
+ },
+ message: {
+ type: "string",
+ required: true,
+ description: "The commit message."
+ },
+ sha: {
+ type: "string",
+ required: true,
+ description: "The blob SHA of the file being removed."
+ },
+ branch: {
+ type: "string",
+ description:
+ "The branch name. If not provided, uses the repository’s default branch (usually master)."
+ },
+ committer: { type: "json" },
+ author: { type: "json" }
+ },
+ description: "Delete a file."
+ },
+ getArchiveLink: {
+ url: "/repos/:owner/:repo/:archive_format/:ref",
+ method: "GET",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ archive_format: {
+ type: "string",
+ required: true,
+ enum: ["tarball", "zipball"],
+ default: "tarball",
+ description: "Either tarball or zipball, Deafult: tarball."
+ },
+ ref: {
+ type: "string",
+ description:
+ "A valid Git reference. Default: the repository’s default branch (usually master)."
+ }
+ },
+ description: "Get archive link."
+ },
+ getDeployKeys: {
+ url: "/repos/:owner/:repo/keys",
+ method: "GET",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ page: {
+ type: "number",
+ description: "Page number of the results to fetch."
+ },
+ per_page: {
+ type: "number",
+ default: "30",
+ description: "A custom page size up to 100. Default is 30."
+ }
+ },
+ description: "List deploy keys."
+ },
+ getDeployKey: {
+ url: "/repos/:owner/:repo/keys/:id",
+ method: "GET",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ id: { type: "string", required: true }
+ },
+ description: "Get a deploy key."
+ },
+ addDeployKey: {
+ url: "/repos/:owner/:repo/keys",
+ method: "POST",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ title: { type: "string", required: true },
+ key: { type: "string", required: true },
+ read_only: {
+ type: "boolean",
+ description:
+ "If true, the key will only be able to read repository contents. Otherwise, the key will be able to read and write."
+ }
+ },
+ description: "Add a new deploy key."
+ },
+ deleteDeployKey: {
+ url: "/repos/:owner/:repo/keys/:id",
+ method: "DELETE",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ id: { type: "string", required: true }
+ },
+ description: "Remove a deploy key."
+ },
+ getDeployments: {
+ url: "/repos/:owner/:repo/deployments",
+ method: "GET",
+ headers: {
+ accept: "application/vnd.github.ant-man-preview+json"
+ },
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ sha: {
+ type: "string",
+ default: "none",
+ description:
+ "The short or long sha that was recorded at creation time. Default: none."
+ },
+ ref: {
+ type: "string",
+ default: "none",
+ description:
+ "The name of the ref. This can be a branch, tag, or sha. Default: none."
+ },
+ task: {
+ type: "string",
+ default: "none",
+ description:
+ "The name of the task for the deployment. e.g. deploy or deploy:migrations. Default: none."
+ },
+ environment: {
+ type: "string",
+ default: "none",
+ description:
+ "The name of the environment that was deployed to. e.g. staging or production. Default: none."
+ },
+ page: {
+ type: "number",
+ description: "Page number of the results to fetch."
+ },
+ per_page: {
+ type: "number",
+ default: "30",
+ description: "A custom page size up to 100. Default is 30."
+ }
+ },
+ description: "List deployments."
+ },
+ getDeployment: {
+ url: "/repos/:owner/:repo/deployments/:deployment_id",
+ method: "GET",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ deployment_id: {
+ type: "string",
+ required: true,
+ description: "The deployment id."
+ }
+ },
+ description:
+ "Get a single Deployment. (In preview period. See README.)"
+ },
+ createDeployment: {
+ url: "/repos/:owner/:repo/deployments",
+ method: "POST",
+ headers: {
+ accept: "application/vnd.github.ant-man-preview+json"
+ },
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ ref: {
+ type: "string",
+ required: true,
+ description:
+ "The ref to deploy. This can be a branch, tag, or sha."
+ },
+ task: {
+ type: "string",
+ default: "deploy",
+ description:
+ "The named task to execute. e.g. deploy or deploy:migrations. Default: deploy"
+ },
+ auto_merge: {
+ type: "boolean",
+ default: "true",
+ description:
+ "Optional parameter to merge the default branch into the requested ref if it is behind the default branch. Default: true"
+ },
+ required_contexts: {
+ type: "string[]",
+ description:
+ "Optional array of status contexts verified against commit status checks. If this parameter is omitted from the parameters then all unique contexts will be verified before a deployment is created. To bypass checking entirely pass an empty array. Defaults to all unique contexts."
+ },
+ payload: {
+ type: "string",
+ default: '""',
+ description:
+ 'Optional JSON payload with extra information about the deployment. Default: ""'
+ },
+ environment: {
+ type: "string",
+ default: "none",
+ description:
+ "The name of the environment that was deployed to. e.g. staging or production. Default: none."
+ },
+ description: {
+ type: "string",
+ default: '""',
+ description: 'Optional short description. Default: ""'
+ },
+ transient_environment: {
+ type: "boolean",
+ default: false,
+ description:
+ "Specifies if the given environment is specific to the deployment and will no longer exist at some point in the future. Default: false. (In preview period. See README.)"
+ },
+ production_environment: {
+ type: "boolean",
+ description:
+ "Specifies if the given environment is a one that end-users directly interact with. Default: true when environment is `production` and false otherwise. (In preview period. See README.)"
+ }
+ },
+ description:
+ "Create a deployment. (In preview period. See README.)"
+ },
+ getDeploymentStatuses: {
+ url: "/repos/:owner/:repo/deployments/:id/statuses",
+ method: "GET",
+ headers: {
+ accept: "application/vnd.github.ant-man-preview+json"
+ },
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ id: { type: "string", required: true }
+ },
+ description:
+ "List deployment statuses. (In preview period. See README.)"
+ },
+ getDeploymentStatus: {
+ url: "/repos/:owner/:repo/deployments/:id/statuses/:status_id",
+ method: "GET",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ id: {
+ type: "string",
+ required: true,
+ description: "The Deployment ID to list the statuses from."
+ },
+ status_id: {
+ type: "string",
+ required: true,
+ description: "The Deployment Status ID."
+ }
+ },
+ description:
+ "List deployment statuses. (In preview period. See README.)"
+ },
+ createDeploymentStatus: {
+ url: "/repos/:owner/:repo/deployments/:id/statuses",
+ method: "POST",
+ headers: {
+ accept: "application/vnd.github.ant-man-preview+json"
+ },
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ id: { type: "string", required: true },
+ state: {
+ type: "string",
+ description:
+ "The state of the status. Can be one of pending, success, error, or failure."
+ },
+ target_url: {
+ type: "string",
+ default: '""',
+ description:
+ 'The target URL to associate with this status. This URL should contain output to keep the user updated while the task is running or serve as historical information for what happened in the deployment. Default: ""'
+ },
+ log_url: {
+ type: "string",
+ default: '""',
+ description:
+ 'Functionally equivalent to target_url. Default: "". (In preview period. See README.)'
+ },
+ description: {
+ type: "string",
+ default: '""',
+ description:
+ 'A short description of the status. Default: ""'
+ },
+ environment_url: {
+ type: "string",
+ default: '""',
+ description:
+ 'URL for accessing the deployment environment. Default: "". (In preview period. See README.)'
+ },
+ auto_inactive: {
+ type: "boolean",
+ default: true,
+ description:
+ "When true the new `inactive` status is added to all other non-transient, non-production environment deployments with the same repository and environment name as the created status's deployment. Default: true. (In preview period. See README.)"
+ }
+ },
+ description:
+ "Create a deployment status. (In preview period. See README.)"
+ },
+ getDownloads: {
+ url: "/repos/:owner/:repo/downloads",
+ method: "GET",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ page: {
+ type: "number",
+ description: "Page number of the results to fetch."
+ },
+ per_page: {
+ type: "number",
+ default: "30",
+ description: "A custom page size up to 100. Default is 30."
+ }
+ },
+ description: "List downloads for a repository."
+ },
+ getDownload: {
+ url: "/repos/:owner/:repo/downloads/:id",
+ method: "GET",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ id: { type: "string", required: true }
+ },
+ description: "Get a single download."
+ },
+ deleteDownload: {
+ url: "/repos/:owner/:repo/downloads/:id",
+ method: "DELETE",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ id: { type: "string", required: true }
+ },
+ description: "Delete a download."
+ },
+ getForks: {
+ url: "/repos/:owner/:repo/forks",
+ method: "GET",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ sort: {
+ type: "string",
+ enum: ["newest", "oldest", "stargazers"],
+ default: "newest",
+ description:
+ "Possible values: `newest`, `oldest`, `stargazers`, default: `newest`."
+ },
+ page: {
+ type: "number",
+ description: "Page number of the results to fetch."
+ },
+ per_page: {
+ type: "number",
+ default: "30",
+ description: "A custom page size up to 100. Default is 30."
+ }
+ },
+ description: "List forks."
+ },
+ getInvites: {
+ url: "/repos/:owner/:repo/invitations",
+ method: "GET",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true }
+ },
+ description: "List invitations for a repository."
+ },
+ deleteInvite: {
+ url: "/repos/:owner/:repo/invitations/:invitation_id",
+ method: "DELETE",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ invitation_id: { type: "string", required: true }
+ },
+ description: "Delete a repository invitation."
+ },
+ updateInvite: {
+ url: "/repos/:owner/:repo/invitations/:invitation_id",
+ method: "PATCH",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ invitation_id: { type: "string", required: true },
+ permissions: {
+ type: "string",
+ enum: ["read", "write", "admin"],
+ description:
+ "The permissions that the associated user will have on the repository."
+ }
+ },
+ description: "Update a repository invitation."
+ },
+ getPages: {
+ url: "/repos/:owner/:repo/pages",
+ method: "GET",
+ headers: {
+ accept: "application/vnd.github.mister-fantastic-preview+json"
+ },
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ page: {
+ type: "number",
+ description: "Page number of the results to fetch."
+ },
+ per_page: {
+ type: "number",
+ default: "30",
+ description: "A custom page size up to 100. Default is 30."
+ }
+ },
+ description:
+ "Get information about a Pages site. (In preview period. See README.)"
+ },
+ requestPageBuild: {
+ url: "/repos/:owner/:repo/pages/builds",
+ method: "POST",
+ headers: {
+ accept: "application/vnd.github.mister-fantastic-preview+json"
+ },
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true }
+ },
+ description:
+ "Request a page build. (In preview period. See README.)"
+ },
+ getPagesBuilds: {
+ url: "/repos/:owner/:repo/pages/builds",
+ method: "GET",
+ headers: {
+ accept: "application/vnd.github.mister-fantastic-preview+json"
+ },
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ page: {
+ type: "number",
+ description: "Page number of the results to fetch."
+ },
+ per_page: {
+ type: "number",
+ default: "30",
+ description: "A custom page size up to 100. Default is 30."
+ }
+ },
+ description:
+ "List Pages builds. (In preview period. See README.)"
+ },
+ getLatestPagesBuild: {
+ url: "/repos/:owner/:repo/pages/builds/latest",
+ method: "GET",
+ headers: {
+ accept: "application/vnd.github.mister-fantastic-preview+json"
+ },
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true }
+ },
+ description:
+ "Get latest Pages build. (In preview period. See README.)"
+ },
+ getPagesBuild: {
+ url: "/repos/:owner/:repo/pages/builds/:id",
+ method: "GET",
+ headers: {
+ accept: "application/vnd.github.mister-fantastic-preview+json"
+ },
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ id: { type: "string", required: true }
+ },
+ description:
+ "Get a specific Pages build. (In preview period. See README.)"
+ },
+ getReleases: {
+ url: "/repos/:owner/:repo/releases",
+ method: "GET",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ page: {
+ type: "number",
+ description: "Page number of the results to fetch."
+ },
+ per_page: {
+ type: "number",
+ default: "30",
+ description: "A custom page size up to 100. Default is 30."
+ }
+ },
+ description: "List releases for a repository."
+ },
+ getRelease: {
+ url: "/repos/:owner/:repo/releases/:id",
+ method: "GET",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ id: { type: "string", required: true }
+ },
+ description: "Get a single release."
+ },
+ getLatestRelease: {
+ url: "/repos/:owner/:repo/releases/latest",
+ method: "GET",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true }
+ },
+ description: "Get the latest release."
+ },
+ getReleaseByTag: {
+ url: "/repos/:owner/:repo/releases/tags/:tag",
+ method: "GET",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ tag: {
+ type: "string",
+ required: true,
+ description: "String of the tag"
+ }
+ },
+ description: "Get a release by tag name."
+ },
+ createRelease: {
+ url: "/repos/:owner/:repo/releases",
+ method: "POST",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ tag_name: {
+ type: "string",
+ required: true,
+ description: "String of the tag"
+ },
+ target_commitish: {
+ type: "string",
+ description:
+ "Specifies the commitish value that determines where the Git tag is created from. Can be any branch or commit SHA. Unused if the Git tag already exists. Default: the repository's default branch (usually master)."
+ },
+ name: { type: "string" },
+ body: { type: "string" },
+ draft: {
+ type: "boolean",
+ default: "false",
+ description:
+ "true to create a draft (unpublished) release, false to create a published one. Default: false"
+ },
+ prerelease: {
+ type: "boolean",
+ default: "false",
+ description:
+ "true to identify the release as a prerelease. false to identify the release as a full release. Default: false"
+ }
+ },
+ description: "Create a release."
+ },
+ editRelease: {
+ url: "/repos/:owner/:repo/releases/:id",
+ method: "PATCH",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ id: { type: "string", required: true },
+ tag_name: {
+ type: "string",
+ required: true,
+ description: "String of the tag"
+ },
+ target_commitish: {
+ type: "string",
+ description:
+ "Specifies the commitish value that determines where the Git tag is created from. Can be any branch or commit SHA. Unused if the Git tag already exists. Default: the repository's default branch (usually master)."
+ },
+ name: { type: "string" },
+ body: { type: "string" },
+ draft: {
+ type: "boolean",
+ default: "false",
+ description:
+ "true to create a draft (unpublished) release, false to create a published one. Default: false"
+ },
+ prerelease: {
+ type: "boolean",
+ default: "false",
+ description:
+ "true to identify the release as a prerelease. false to identify the release as a full release. Default: false"
+ }
+ },
+ description: "Edit a release."
+ },
+ deleteRelease: {
+ url: "/repos/:owner/:repo/releases/:id",
+ method: "DELETE",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ id: { type: "string", required: true }
+ },
+ description: "Delete a release"
+ },
+ getAssets: {
+ url: "/repos/:owner/:repo/releases/:id/assets",
+ method: "GET",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ id: { type: "string", required: true }
+ },
+ description: "List assets for a release."
+ },
+ uploadAsset: {
+ method: "POST",
+ url: ":url",
+ params: {
+ url: {
+ type: "string",
+ required: true,
+ description:
+ "This endpoint makes use of a Hypermedia relation (https://developer.github.com/v3/#hypermedia) to determine which URL to access. This endpoint is provided by a URI template in the release's API response (https://developer.github.com/v3/repos/releases/#get-a-single-release). You need to use an HTTP client which supports SNI (https://en.wikipedia.org/wiki/Server_Name_Indication) to make calls to this endpoint."
+ },
+ file: {
+ type: "string | object",
+ required: true,
+ mapTo: "input",
+ description: "A file read stream, a String or a Buffer."
+ },
+ contentType: {
+ type: "string",
+ required: true,
+ mapTo: "headers.content-type",
+ description:
+ "The content type of the asset. This should be set in the Header. Example: 'application/zip'. For a list of acceptable types, refer this list of media types (https://www.iana.org/assignments/media-types/media-types.xhtml)"
+ },
+ contentLength: {
+ type: "number",
+ required: true,
+ mapTo: "headers.content-length",
+ description: "File size in bytes."
+ },
+ name: {
+ type: "string",
+ required: true,
+ description:
+ "The file name of the asset. This should be set in a URI query parameter."
+ },
+ label: {
+ type: "string",
+ description:
+ "An alternate short description of the asset. Used in place of the filename. This should be set in a URI query parameter."
+ }
+ },
+ description: "Upload a release asset."
+ },
+ getAsset: {
+ url: "/repos/:owner/:repo/releases/assets/:id",
+ method: "GET",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ id: { type: "string", required: true }
+ },
+ description: "Get a single release asset."
+ },
+ editAsset: {
+ url: "/repos/:owner/:repo/releases/assets/:id",
+ method: "PATCH",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ id: { type: "string", required: true },
+ name: { type: "string", required: true },
+ label: {
+ type: "string",
+ description:
+ "An alternate short description of the asset. Used in place of the filename."
+ }
+ },
+ description: "Edit a release asset."
+ },
+ deleteAsset: {
+ url: "/repos/:owner/:repo/releases/assets/:id",
+ method: "DELETE",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ id: { type: "string", required: true }
+ },
+ description: "Delete a release asset."
+ },
+ getStatsContributors: {
+ url: "/repos/:owner/:repo/stats/contributors",
+ method: "GET",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true }
+ },
+ description:
+ "Get contributors list with additions, deletions, and commit counts."
+ },
+ getStatsCommitActivity: {
+ url: "/repos/:owner/:repo/stats/commit_activity",
+ method: "GET",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true }
+ },
+ description: "Get the last year of commit activity data."
+ },
+ getStatsCodeFrequency: {
+ url: "/repos/:owner/:repo/stats/code_frequency",
+ method: "GET",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true }
+ },
+ description:
+ "Get the number of additions and deletions per week."
+ },
+ getStatsParticipation: {
+ url: "/repos/:owner/:repo/stats/participation",
+ method: "GET",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true }
+ },
+ description:
+ "Get the weekly commit count for the repository owner and everyone else."
+ },
+ getStatsPunchCard: {
+ url: "/repos/:owner/:repo/stats/punch_card",
+ method: "GET",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true }
+ },
+ description: "Get the number of commits per hour in each day."
+ },
+ createStatus: {
+ url: "/repos/:owner/:repo/statuses/:sha",
+ method: "POST",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ sha: { type: "string", required: true },
+ state: {
+ type: "string",
+ required: true,
+ enum: ["pending", "success", "error", "failure"],
+ description:
+ "State of the status - can be one of pending, success, error, or failure."
+ },
+ target_url: {
+ type: "string",
+ description:
+ "Target url to associate with this status. This URL will be linked from the GitHub UI to allow users to easily see the ‘source’ of the Status."
+ },
+ description: {
+ type: "string",
+ description: "Short description of the status."
+ },
+ context: {
+ type: "string",
+ description:
+ "A string label to differentiate this status from the status of other systems."
+ }
+ },
+ description: "Create a status."
+ },
+ getStatuses: {
+ url: "/repos/:owner/:repo/commits/:ref/statuses",
+ method: "GET",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ ref: {
+ type: "string",
+ required: true,
+ description:
+ "Ref to list the statuses from. It can be a SHA, a branch name, or a tag name."
+ },
+ page: {
+ type: "number",
+ description: "Page number of the results to fetch."
+ },
+ per_page: {
+ type: "number",
+ default: "30",
+ description: "A custom page size up to 100. Default is 30."
+ }
+ },
+ description: "List statuses for a specfic ref."
+ },
+ getCombinedStatusForRef: {
+ url: "/repos/:owner/:repo/commits/:ref/status",
+ method: "GET",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ ref: {
+ type: "string",
+ required: true,
+ description:
+ "Ref to fetch the status for. It can be a SHA, a branch name, or a tag name."
+ },
+ page: {
+ type: "number",
+ description: "Page number of the results to fetch."
+ },
+ per_page: {
+ type: "number",
+ default: "30",
+ description: "A custom page size up to 100. Default is 30."
+ }
+ },
+ description: "Get the combined status for a specific ref."
+ },
+ getReferrers: {
+ url: "/repos/:owner/:repo/traffic/popular/referrers",
+ method: "GET",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ page: {
+ type: "number",
+ description: "Page number of the results to fetch."
+ },
+ per_page: {
+ type: "number",
+ default: "30",
+ description: "A custom page size up to 100. Default is 30."
+ }
+ },
+ description: "Get the top 10 referrers over the last 14 days."
+ },
+ getPaths: {
+ url: "/repos/:owner/:repo/traffic/popular/paths",
+ method: "GET",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ page: {
+ type: "number",
+ description: "Page number of the results to fetch."
+ },
+ per_page: {
+ type: "number",
+ default: "30",
+ description: "A custom page size up to 100. Default is 30."
+ }
+ },
+ description:
+ "Get the top 10 popular contents over the last 14 days."
+ },
+ getViews: {
+ url: "/repos/:owner/:repo/traffic/views",
+ method: "GET",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ page: {
+ type: "number",
+ description: "Page number of the results to fetch."
+ },
+ per_page: {
+ type: "number",
+ default: "30",
+ description: "A custom page size up to 100. Default is 30."
+ }
+ },
+ description:
+ "Get the total number of views and breakdown per day or week for the last 14 days."
+ },
+ getClones: {
+ url: "/repos/:owner/:repo/traffic/clones",
+ method: "GET",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ page: {
+ type: "number",
+ description: "Page number of the results to fetch."
+ },
+ per_page: {
+ type: "number",
+ default: "30",
+ description: "A custom page size up to 100. Default is 30."
+ }
+ },
+ description:
+ "Get the total number of clones and breakdown per day or week for the last 14 days."
+ },
+ getHooks: {
+ url: "/repos/:owner/:repo/hooks",
+ method: "GET",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ page: {
+ type: "number",
+ description: "Page number of the results to fetch."
+ },
+ per_page: {
+ type: "number",
+ default: "30",
+ description: "A custom page size up to 100. Default is 30."
+ }
+ },
+ description: "List hooks."
+ },
+ getHook: {
+ url: "/repos/:owner/:repo/hooks/:id",
+ method: "GET",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ id: { type: "string", required: true }
+ },
+ description: "Get single hook."
+ },
+ createHook: {
+ url: "/repos/:owner/:repo/hooks",
+ method: "POST",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ name: { type: "string", required: true },
+ config: {
+ type: "json",
+ required: true,
+ description:
+ "A Hash containing key/value pairs to provide settings for this hook. These settings vary between the services and are defined in the github-services repo. Booleans are stored internally as `1` for true, and `0` for false. Any JSON true/false values will be converted automatically."
+ },
+ events: {
+ type: "string[]",
+ default: '["push"]',
+ description:
+ "Determines what events the hook is triggered for. Default: `['push']`."
+ },
+ active: {
+ type: "boolean",
+ description:
+ "Determines whether the hook is actually triggered on pushes."
+ }
+ },
+ description: "Create a hook."
+ },
+ editHook: {
+ url: "/repos/:owner/:repo/hooks/:id",
+ method: "PATCH",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ id: { type: "string", required: true },
+ name: { type: "string", required: true },
+ config: {
+ type: "json",
+ required: true,
+ description:
+ "A Hash containing key/value pairs to provide settings for this hook. Modifying this will replace the entire config object. These settings vary between the services and are defined in the github-services repo. Booleans are stored internally as `1` for true, and `0` for false. Any JSON true/false values will be converted automatically."
+ },
+ events: {
+ type: "string[]",
+ default: '["push"]',
+ description:
+ "Determines what events the hook is triggered for. This replaces the entire array of events. Default: `['push']`."
+ },
+ add_events: {
+ type: "string[]",
+ description:
+ "Determines a list of events to be added to the list of events that the Hook triggers for."
+ },
+ remove_events: {
+ type: "string[]",
+ description:
+ "Determines a list of events to be removed from the list of events that the Hook triggers for."
+ },
+ active: {
+ type: "boolean",
+ description:
+ "Determines whether the hook is actually triggered on pushes."
+ }
+ },
+ description: "Edit a hook."
+ },
+ testHook: {
+ url: "/repos/:owner/:repo/hooks/:id/tests",
+ method: "POST",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ id: { type: "string", required: true }
+ },
+ description: "Test a [push] hook."
+ },
+ pingHook: {
+ url: "/repos/:owner/:repo/hooks/:id/pings",
+ method: "POST",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ id: { type: "string", required: true }
+ },
+ description: "Ping a hook."
+ },
+ deleteHook: {
+ url: "/repos/:owner/:repo/hooks/:id",
+ method: "DELETE",
+ params: {
+ owner: { type: "string", required: true },
+ repo: { type: "string", required: true },
+ id: { type: "string", required: true }
+ },
+ description: "Deleate a hook."
+ }
+ },
+ search: {
+ repos: {
+ url: "/search/repositories",
+ method: "GET",
+ headers: {
+ accept: "application/vnd.github.mercy-preview+json"
+ },
+ params: {
+ q: {
+ type: "string",
+ required: true,
+ description: "Search Term"
+ },
+ sort: {
+ type: "string",
+ enum: ["stars", "forks", "updated"],
+ description: "stars, forks, or updated"
+ },
+ order: {
+ type: "string",
+ enum: ["asc", "desc"],
+ default: "desc",
+ description: "asc or desc"
+ },
+ page: {
+ type: "number",
+ description: "Page number of the results to fetch."
+ },
+ per_page: {
+ type: "number",
+ default: "30",
+ description: "A custom page size up to 100. Default is 30."
+ }
+ },
+ description: "Search repositories."
+ },
+ code: {
+ url: "/search/code",
+ method: "GET",
+ params: {
+ q: {
+ type: "string",
+ required: true,
+ description: "Search Term"
+ },
+ sort: {
+ type: "string",
+ enum: ["indexed"],
+ description:
+ "The sort field. Can only be indexed, which indicates how recently a file has been indexed by the GitHub search infrastructure. Default: results are sorted by best match."
+ },
+ order: {
+ type: "string",
+ enum: ["asc", "desc"],
+ default: "desc",
+ description: "asc or desc"
+ },
+ page: {
+ type: "number",
+ description: "Page number of the results to fetch."
+ },
+ per_page: {
+ type: "number",
+ default: "30",
+ description: "A custom page size up to 100. Default is 30."
+ }
+ },
+ description: "Search code."
+ },
+ commits: {
+ url: "/search/commits",
+ method: "GET",
+ headers: {
+ accept: "application/vnd.github.cloak-preview+json"
+ },
+ params: {
+ q: {
+ type: "string",
+ required: true,
+ description: "Search Term"
+ },
+ sort: {
+ type: "string",
+ enum: ["author-date", "committer-date"],
+ description:
+ "The sort field. Can be author-date or committer-date. Default: best match."
+ },
+ order: {
+ type: "string",
+ enum: ["asc", "desc"],
+ default: "desc",
+ description: "asc or desc"
+ },
+ page: {
+ type: "number",
+ description: "Page number of the results to fetch."
+ },
+ per_page: {
+ type: "number",
+ default: "30",
+ description: "A custom page size up to 100. Default is 30."
+ }
+ },
+ description: "Search commits. (In preview period. See README.)"
+ },
+ issues: {
+ url: "/search/issues",
+ method: "GET",
+ params: {
+ q: {
+ type: "string",
+ required: true,
+ description: "Search Term"
+ },
+ sort: {
+ type: "string",
+ enum: ["comments", "created", "updated"],
+ description:
+ "The sort field. Can be comments, created, or updated. Default: results are sorted by best match."
+ },
+ order: {
+ type: "string",
+ enum: ["asc", "desc"],
+ default: "desc",
+ description: "asc or desc"
+ },
+ page: {
+ type: "number",
+ description: "Page number of the results to fetch."
+ },
+ per_page: {
+ type: "number",
+ default: "30",
+ description: "A custom page size up to 100. Default is 30."
+ }
+ },
+ description: "Search issues."
+ },
+ users: {
+ url: "/search/users",
+ method: "GET",
+ params: {
+ q: {
+ type: "string",
+ required: true,
+ description: "Search Term"
+ },
+ sort: {
+ type: "string",
+ enum: ["followers", "repositories", "joined"],
+ description:
+ "The sort field. Can be followers, repositories, or joined. Default: results are sorted by best match."
+ },
+ order: {
+ type: "string",
+ enum: ["asc", "desc"],
+ default: "desc",
+ description: "asc or desc"
+ },
+ page: {
+ type: "number",
+ description: "Page number of the results to fetch."
+ },
+ per_page: {
+ type: "number",
+ default: "30",
+ description: "A custom page size up to 100. Default is 30."
+ }
+ },
+ description: "Search users."
+ },
+ email: {
+ url: "/legacy/user/email/:email",
+ method: "GET",
+ params: {
+ email: {
+ type: "string",
+ required: true,
+ description: "The email address"
+ }
+ },
+ description: "Search against public email addresses."
+ }
+ },
+ users: {
+ get: {
+ url: "/user",
+ method: "GET",
+ params: {},
+ description: "Get the authenticated user"
+ },
+ update: {
+ url: "/user",
+ method: "PATCH",
+ params: {
+ name: {
+ type: "string",
+ description: "The new name of the user"
+ },
+ email: {
+ type: "string",
+ description: "Publicly visible email address."
+ },
+ blog: {
+ type: "string",
+ description: "The new blog URL of the user."
+ },
+ company: {
+ type: "string",
+ description: "The new company of the user."
+ },
+ location: {
+ type: "string",
+ description: "The new location of the user."
+ },
+ hireable: {
+ type: "boolean",
+ description: "The new hiring availability of the user."
+ },
+ bio: {
+ type: "string",
+ description: "The new short biography of the user."
+ }
+ },
+ description: "Update the authenticated user"
+ },
+ promote: {
+ url: "/users/:username/site_admin",
+ method: "PUT",
+ params: { username: { type: "string", required: true } },
+ description: "Promote an ordinary user to a site administrator"
+ },
+ demote: {
+ url: "/users/:username/site_admin",
+ method: "DELETE",
+ params: { username: { type: "string", required: true } },
+ description: "Demote a site administrator to an ordinary user"
+ },
+ suspend: {
+ url: "/users/:username/suspended",
+ method: "PUT",
+ params: { username: { type: "string", required: true } },
+ description: "Suspend a user"
+ },
+ unsuspend: {
+ url: "/users/:username/suspended",
+ method: "DELETE",
+ params: { username: { type: "string", required: true } },
+ description: "Unsuspend a user"
+ },
+ getForUser: {
+ url: "/users/:username",
+ method: "GET",
+ params: { username: { type: "string", required: true } },
+ description: "Get a single user"
+ },
+ getById: {
+ url: "/user/:id",
+ method: "GET",
+ params: {
+ id: {
+ type: "string",
+ required: true,
+ description: "Numerical ID of the user."
+ }
+ },
+ description:
+ "Get a single user by GitHub ID. This method uses numerical user ID. Use users.getForUser method if you need to get a user by username."
+ },
+ getAll: {
+ url: "/users",
+ method: "GET",
+ params: {
+ since: {
+ type: "number",
+ description:
+ "The integer ID of the last User that you’ve seen."
+ }
+ },
+ description: "Get all users"
+ },
+ getOrgs: {
+ url: "/user/orgs",
+ method: "GET",
+ params: {
+ page: {
+ type: "number",
+ description: "Page number of the results to fetch."
+ },
+ per_page: {
+ type: "number",
+ default: "30",
+ description: "A custom page size up to 100. Default is 30."
+ }
+ },
+ description: "List organizations for the authenticated user."
+ },
+ getOrgMemberships: {
+ url: "/user/memberships/orgs",
+ method: "GET",
+ params: {
+ state: {
+ type: "string",
+ enum: ["active", "pending"],
+ description:
+ "Indicates the state of the memberships to return. Can be either active or pending. If not specified, both active and pending memberships are returned."
+ }
+ },
+ description: "List your organization memberships"
+ },
+ getOrgMembership: {
+ url: "/user/memberships/orgs/:org",
+ method: "GET",
+ params: { org: { type: "string", required: true } },
+ description: "Get your organization membership"
+ },
+ editOrgMembership: {
+ url: "/user/memberships/orgs/:org",
+ method: "PATCH",
+ params: {
+ org: { type: "string", required: true },
+ state: {
+ type: "string",
+ required: true,
+ enum: ["active"],
+ description:
+ 'The state that the membership should be in. Only "active" will be accepted.'
+ }
+ },
+ description: "Edit your organization membership."
+ },
+ getTeams: {
+ url: "/user/teams",
+ method: "GET",
+ headers: {
+ accept: "application/vnd.github.hellcat-preview+json"
+ },
+ params: {
+ page: {
+ type: "number",
+ description: "Page number of the results to fetch."
+ },
+ per_page: {
+ type: "number",
+ default: "30",
+ description: "A custom page size up to 100. Default is 30."
+ }
+ },
+ description: "Get your teams."
+ },
+ getEmails: {
+ url: "/user/emails",
+ method: "GET",
+ params: {
+ page: {
+ type: "number",
+ description: "Page number of the results to fetch."
+ },
+ per_page: {
+ type: "number",
+ default: "30",
+ description: "A custom page size up to 100. Default is 30."
+ }
+ },
+ description: "List email addresses for a user."
+ },
+ getPublicEmails: {
+ url: "/user/public_emails",
+ method: "GET",
+ params: {
+ page: {
+ type: "number",
+ description: "Page number of the results to fetch."
+ },
+ per_page: {
+ type: "number",
+ default: "30",
+ description: "A custom page size up to 100. Default is 30."
+ }
+ },
+ description: "List public email addresses for a user."
+ },
+ addEmails: {
+ url: "/user/emails",
+ method: "POST",
+ params: {
+ emails: {
+ type: "string[]",
+ required: true,
+ mapTo: "input",
+ description:
+ "You can post a single email address or an array of addresses."
+ }
+ },
+ description: "Add email address(es)."
+ },
+ deleteEmails: {
+ url: "/user/emails",
+ method: "DELETE",
+ params: {
+ emails: {
+ type: "string[]",
+ required: true,
+ mapTo: "input",
+ description:
+ "You can post a single email address or an array of addresses."
+ }
+ },
+ description: "Delete email address(es)."
+ },
+ togglePrimaryEmailVisibility: {
+ url: "/user/email/visibility",
+ method: "PATCH",
+ params: {},
+ description: "Toggle primary email visibility."
+ },
+ getFollowersForUser: {
+ url: "/users/:username/followers",
+ method: "GET",
+ params: {
+ username: { type: "string", required: true },
+ page: {
+ type: "number",
+ description: "Page number of the results to fetch."
+ },
+ per_page: {
+ type: "number",
+ default: "30",
+ description: "A custom page size up to 100. Default is 30."
+ }
+ },
+ description: "List a user's followers"
+ },
+ getFollowers: {
+ url: "/user/followers",
+ method: "GET",
+ params: {
+ page: {
+ type: "number",
+ description: "Page number of the results to fetch."
+ },
+ per_page: {
+ type: "number",
+ default: "30",
+ description: "A custom page size up to 100. Default is 30."
+ }
+ },
+ description: "List the authenticated user's followers"
+ },
+ getFollowingForUser: {
+ url: "/users/:username/following",
+ method: "GET",
+ params: {
+ username: { type: "string", required: true },
+ page: {
+ type: "number",
+ description: "Page number of the results to fetch."
+ },
+ per_page: {
+ type: "number",
+ default: "30",
+ description: "A custom page size up to 100. Default is 30."
+ }
+ },
+ description: "List who a user is following"
+ },
+ getFollowing: {
+ url: "/user/following",
+ method: "GET",
+ params: {
+ page: {
+ type: "number",
+ description: "Page number of the results to fetch."
+ },
+ per_page: {
+ type: "number",
+ default: "30",
+ description: "A custom page size up to 100. Default is 30."
+ }
+ },
+ description: "List who the authenticated user is following"
+ },
+ checkFollowing: {
+ url: "/user/following/:username",
+ method: "GET",
+ params: { username: { type: "string", required: true } },
+ description: "Check if you are following a user"
+ },
+ checkIfOneFollowersOther: {
+ url: "/users/:username/following/:target_user",
+ method: "GET",
+ params: {
+ username: { type: "string", required: true },
+ target_user: { type: "string", required: true }
+ },
+ description: "Check if one user follows another"
+ },
+ followUser: {
+ url: "/user/following/:username",
+ method: "PUT",
+ params: { username: { type: "string", required: true } },
+ description: "Follow a user"
+ },
+ unfollowUser: {
+ url: "/user/following/:username",
+ method: "DELETE",
+ params: { username: { type: "string", required: true } },
+ description: "Unfollow a user"
+ },
+ getKeysForUser: {
+ url: "/users/:username/keys",
+ method: "GET",
+ params: {
+ username: { type: "string", required: true },
+ page: {
+ type: "number",
+ description: "Page number of the results to fetch."
+ },
+ per_page: {
+ type: "number",
+ default: "30",
+ description: "A custom page size up to 100. Default is 30."
+ }
+ },
+ description: "List public keys for a user"
+ },
+ getKeys: {
+ url: "/user/keys",
+ method: "GET",
+ params: {
+ page: {
+ type: "number",
+ description: "Page number of the results to fetch."
+ },
+ per_page: {
+ type: "number",
+ default: "30",
+ description: "A custom page size up to 100. Default is 30."
+ }
+ },
+ description: "List your public keys"
+ },
+ getKey: {
+ url: "/user/keys/:id",
+ method: "GET",
+ params: { id: { type: "string", required: true } },
+ description: "Get a single public key"
+ },
+ createKey: {
+ url: "/user/keys",
+ method: "POST",
+ params: {
+ title: { type: "string", required: true },
+ key: { type: "string", required: true }
+ },
+ description: "Create a public key"
+ },
+ deleteKey: {
+ url: "/user/keys/:id",
+ method: "DELETE",
+ params: { id: { type: "string", required: true } },
+ description: "Delete a public key"
+ },
+ getGpgKeysForUser: {
+ url: "/users/:username/gpg_keys",
+ method: "GET",
+ headers: {
+ accept: "application/vnd.github.cryptographer-preview"
+ },
+ params: {
+ username: { type: "string", required: true },
+ page: {
+ type: "number",
+ description: "Page number of the results to fetch."
+ },
+ per_page: {
+ type: "number",
+ default: "30",
+ description: "A custom page size up to 100. Default is 30."
+ }
+ },
+ description:
+ "Lists the GPG keys for a user. This information is accessible by anyone. (In preview period. See README.)"
+ },
+ getGpgKeys: {
+ url: "/user/gpg_keys",
+ method: "GET",
+ headers: {
+ accept: "application/vnd.github.cryptographer-preview"
+ },
+ params: {
+ page: {
+ type: "number",
+ description: "Page number of the results to fetch."
+ },
+ per_page: {
+ type: "number",
+ default: "30",
+ description: "A custom page size up to 100. Default is 30."
+ }
+ },
+ description:
+ "List your GPG keys. (In preview period. See README.)"
+ },
+ getGpgKey: {
+ url: "/user/gpg_keys/:id",
+ method: "GET",
+ headers: {
+ accept: "application/vnd.github.cryptographer-preview"
+ },
+ params: { id: { type: "string", required: true } },
+ description:
+ "Get a single GPG key. (In preview period. See README.)"
+ },
+ createGpgKey: {
+ url: "/user/gpg_keys",
+ method: "POST",
+ headers: {
+ accept: "application/vnd.github.cryptographer-preview"
+ },
+ params: {
+ armored_public_key: {
+ type: "string",
+ required: true,
+ description: "GPG key contents"
+ }
+ },
+ description:
+ "Create a GPG key. (In preview period. See README.)"
+ },
+ deleteGpgKey: {
+ url: "/user/gpg_keys/:id",
+ method: "DELETE",
+ headers: {
+ accept: "application/vnd.github.cryptographer-preview"
+ },
+ params: { id: { type: "string", required: true } },
+ description:
+ "Delete a GPG key. (In preview period. See README.)"
+ },
+ getBlockedUsers: {
+ url: "/user/blocks",
+ method: "GET",
+ headers: {
+ accept:
+ "application/vnd.github.giant-sentry-fist-preview+json"
+ },
+ params: {},
+ description:
+ "List blocked users. (In preview period. See README.)"
+ },
+ checkBlockedUser: {
+ url: "/user/blocks/:username",
+ method: "GET",
+ headers: {
+ accept:
+ "application/vnd.github.giant-sentry-fist-preview+json"
+ },
+ params: { username: { type: "string", required: true } },
+ description:
+ "Check whether you've blocked a user. (In preview period. See README.)"
+ },
+ blockUser: {
+ url: "/user/blocks/:username",
+ method: "PUT",
+ headers: {
+ accept:
+ "application/vnd.github.giant-sentry-fist-preview+json"
+ },
+ params: { username: { type: "string", required: true } },
+ description: "Block a user. (In preview period. See README.)"
+ },
+ unblockUser: {
+ url: "/user/blocks/:username",
+ method: "DELETE",
+ headers: {
+ accept:
+ "application/vnd.github.giant-sentry-fist-preview+json"
+ },
+ params: { username: { type: "string", required: true } },
+ description: "Unblock a user. (In preview period. See README.)"
+ },
+ getRepoInvites: {
+ url: "/user/repository_invitations",
+ method: "GET",
+ params: {},
+ description: "List a user's repository invitations."
+ },
+ acceptRepoInvite: {
+ url: "/user/repository_invitations/:invitation_id",
+ method: "PATCH",
+ params: { invitation_id: { type: "string", required: true } },
+ description: "Accept a repository invitation."
+ },
+ declineRepoInvite: {
+ url: "/user/repository_invitations/:invitation_id",
+ method: "DELETE",
+ params: { invitation_id: { type: "string", required: true } },
+ description: "Decline a repository invitation."
+ },
+ getInstallations: {
+ url: "/user/installations",
+ method: "GET",
+ headers: {
+ accept: "application/vnd.github.machine-man-preview"
+ },
+ params: {
+ page: {
+ type: "number",
+ description: "Page number of the results to fetch."
+ },
+ per_page: {
+ type: "number",
+ default: "30",
+ description: "A custom page size up to 100. Default is 30."
+ }
+ },
+ description:
+ "List installations. (In preview period. See README.)"
+ },
+ getInstallationRepos: {
+ url: "/user/installations/:installation_id/repositories",
+ method: "GET",
+ params: {
+ installation_id: { type: "string", required: true },
+ page: {
+ type: "number",
+ description: "Page number of the results to fetch."
+ },
+ per_page: {
+ type: "number",
+ default: "30",
+ description: "A custom page size up to 100. Default is 30."
+ }
+ },
+ description:
+ "List repositories accessible to the user for an installation. (In preview period. See README.)"
+ },
+ addRepoToInstallation: {
+ url:
+ "/user/installations/:installation_id/repositories/:repository_id",
+ method: "PUT",
+ headers: {
+ accept: "application/vnd.github.machine-man-preview"
+ },
+ params: {
+ installation_id: { type: "string", required: true },
+ repository_id: { type: "string", required: true }
+ },
+ description:
+ "Add a single repository to an installation. (In preview period. See README.)"
+ },
+ removeRepoFromInstallation: {
+ url:
+ "/user/installations/:installation_id/repositories/:repository_id",
+ method: "DELETE",
+ headers: {
+ accept: "application/vnd.github.machine-man-preview"
+ },
+ params: {
+ installation_id: { type: "string", required: true },
+ repository_id: { type: "string", required: true }
+ },
+ description:
+ "Remove a single repository from an installation. (In preview period. See README.)"
+ },
+ getMarketplacePurchases: {
+ url: "/user/marketplace_purchases",
+ method: "GET",
+ headers: {
+ accept: "application/vnd.github.valkyrie-preview+json"
+ },
+ params: {
+ page: {
+ type: "number",
+ description: "Page number of the results to fetch."
+ },
+ per_page: {
+ type: "number",
+ default: "30",
+ description: "A custom page size up to 100. Default is 30."
+ }
+ },
+ description:
+ "Get a user's Marketplace purchases. (In preview period. See README.)"
+ },
+ getMarketplaceStubbedPurchases: {
+ url: "/user/marketplace_purchases/stubbed",
+ method: "GET",
+ headers: {
+ accept: "application/vnd.github.valkyrie-preview+json"
+ },
+ params: {
+ page: {
+ type: "number",
+ description: "Page number of the results to fetch."
+ },
+ per_page: {
+ type: "number",
+ default: "30",
+ description: "A custom page size up to 100. Default is 30."
+ }
+ },
+ description:
+ "Get a user's stubbed Marketplace purchases. (In preview period. See README.)"
+ }
+ },
+ enterprise: {
+ stats: {
+ url: "/enterprise/stats/:type",
+ method: "GET",
+ params: {
+ type: {
+ type: "string",
+ required: true,
+ enum: [
+ "issues",
+ "hooks",
+ "milestones",
+ "orgs",
+ "comments",
+ "pages",
+ "users",
+ "gists",
+ "pulls",
+ "repos",
+ "all"
+ ],
+ description:
+ "Possible values: issues, hooks, milestones, orgs, comments, pages, users, gists, pulls, repos, all."
+ }
+ },
+ description: "Get statistics."
+ },
+ updateLdapForUser: {
+ url: "/admin/ldap/users/:username/mapping",
+ method: "PATCH",
+ params: {
+ username: { type: "string", required: true },
+ ldap_dn: {
+ type: "string",
+ required: true,
+ description: "LDAP DN for user"
+ }
+ },
+ description: "Update LDAP mapping for a user."
+ },
+ syncLdapForUser: {
+ url: "/admin/ldap/users/:username/sync",
+ method: "POST",
+ params: { username: { type: "string", required: true } },
+ description: "Sync LDAP mapping for a user."
+ },
+ updateLdapForTeam: {
+ url: "/admin/ldap/teams/:team_id/mapping",
+ method: "PATCH",
+ params: {
+ team_id: { type: "number", required: true },
+ ldap_dn: {
+ type: "string",
+ required: true,
+ description: "LDAP DN for user"
+ }
+ },
+ description: "Update LDAP mapping for a team."
+ },
+ syncLdapForTeam: {
+ url: "/admin/ldap/teams/:team_id/sync",
+ method: "POST",
+ params: { team_id: { type: "number", required: true } },
+ description: "Sync LDAP mapping for a team."
+ },
+ getLicense: {
+ url: "/enterprise/settings/license",
+ method: "GET",
+ params: {},
+ description: "Get license information"
+ },
+ getPreReceiveEnvironment: {
+ url: "/admin/pre-receive-environments/:id",
+ method: "GET",
+ headers: {
+ accept: "application/vnd.github.eye-scream-preview"
+ },
+ params: { id: { type: "string", required: true } },
+ description:
+ "Get a single pre-receive environment. (In preview period. See README.)"
+ },
+ getPreReceiveEnvironments: {
+ url: "/admin/pre_receive_environments",
+ method: "GET",
+ headers: {
+ accept: "application/vnd.github.eye-scream-preview"
+ },
+ params: {},
+ description:
+ "List pre-receive environments. (In preview period. See README.)"
+ },
+ createPreReceiveEnvironment: {
+ url: "/admin/pre_receive_environments",
+ method: "POST",
+ headers: {
+ accept: "application/vnd.github.eye-scream-preview"
+ },
+ params: {
+ name: {
+ type: "string",
+ required: true,
+ description: "The new pre-receive environment's name."
+ },
+ image_url: {
+ type: "string",
+ required: true,
+ description:
+ "URL from which to download a tarball of this environment."
+ }
+ },
+ description:
+ "Create a pre-receive environment. (In preview period. See README.)"
+ },
+ editPreReceiveEnvironment: {
+ url: "/admin/pre_receive_environments/:id",
+ method: "PATCH",
+ params: {
+ id: { type: "string", required: true },
+ name: {
+ type: "string",
+ required: true,
+ description: "This pre-receive environment's new name."
+ },
+ image_url: {
+ type: "string",
+ required: true,
+ description:
+ "URL from which to download a tarball of this environment."
+ }
+ },
+ description:
+ "Create a pre-receive environment. (In preview period. See README.)"
+ },
+ deletePreReceiveEnvironment: {
+ url: "/admin/pre_receive_environments/:id",
+ method: "DELETE",
+ params: { id: { type: "string", required: true } },
+ description:
+ "Delete a pre-receive environment. (In preview period. See README.)"
+ },
+ getPreReceiveEnvironmentDownloadStatus: {
+ url: "/admin/pre-receive-environments/:id/downloads/latest",
+ method: "GET",
+ headers: {
+ accept: "application/vnd.github.eye-scream-preview"
+ },
+ params: { id: { type: "string", required: true } },
+ description:
+ "Get a pre-receive environment's download status. (In preview period. See README.)"
+ },
+ triggerPreReceiveEnvironmentDownload: {
+ url: "/admin/pre_receive_environments/:id/downloads",
+ method: "POST",
+ headers: {
+ accept: "application/vnd.github.eye-scream-preview"
+ },
+ params: { id: { type: "string", required: true } },
+ description:
+ "Trigger a pre-receive environment download. (In preview period. See README.)"
+ },
+ getPreReceiveHook: {
+ url: "/admin/pre-receive-hooks/:id",
+ method: "GET",
+ headers: {
+ accept: "application/vnd.github.eye-scream-preview"
+ },
+ params: { id: { type: "string", required: true } },
+ description:
+ "Get a single pre-receive hook. (In preview period. See README.)"
+ },
+ getPreReceiveHooks: {
+ url: "/admin/pre-receive-hooks",
+ method: "GET",
+ headers: {
+ accept: "application/vnd.github.eye-scream-preview"
+ },
+ params: {},
+ description:
+ "List pre-receive hooks. (In preview period. See README.)"
+ },
+ createPreReceiveHook: {
+ url: "/admin/pre-receive-hooks",
+ method: "POST",
+ headers: {
+ accept: "application/vnd.github.eye-scream-preview"
+ },
+ params: {
+ name: {
+ type: "string",
+ required: true,
+ description: "The name of the hook."
+ },
+ script: {
+ type: "string",
+ required: true,
+ description: "The script that the hook runs."
+ },
+ script_repository: {
+ type: "json",
+ required: true,
+ description:
+ "The GitHub repository where the script is kept."
+ },
+ environment: {
+ type: "json",
+ required: true,
+ description:
+ "The pre-receive environment where the script is executed."
+ },
+ enforcement: {
+ type: "string",
+ default: "disabled",
+ description:
+ "The state of enforcement for this hook. default: disabled"
+ },
+ allow_downstream_configuration: {
+ type: "boolean",
+ default: "false",
+ description:
+ "Whether enforcement can be overridden at the org or repo level. default: false"
+ }
+ },
+ description:
+ "Create a pre-receive hook. (In preview period. See README.)"
+ },
+ editPreReceiveHook: {
+ url: "/admin/pre_receive_hooks/:id",
+ method: "PATCH",
+ params: {
+ id: { type: "string", required: true },
+ hook: {
+ type: "json",
+ required: true,
+ mapTo: "input",
+ description:
+ "JSON object that contains pre-receive hook info."
+ }
+ },
+ description:
+ "Edit a pre-receive hook. (In preview period. See README.)"
+ },
+ deletePreReceiveHook: {
+ url: "/admin/pre_receive_hooks/:id",
+ method: "DELETE",
+ params: { id: { type: "string", required: true } },
+ description:
+ "Delete a pre-receive hook. (In preview period. See README.)"
+ },
+ queueIndexingJob: {
+ url: "/staff/indexing_jobs",
+ method: "POST",
+ params: {
+ target: {
+ type: "string",
+ required: true,
+ description: "A string representing the item to index."
+ }
+ },
+ description: "Queue an indexing job"
+ },
+ createOrg: {
+ url: "/admin/organizations",
+ method: "POST",
+ params: {
+ login: {
+ type: "string",
+ required: true,
+ description: "The organization's username."
+ },
+ admin: {
+ type: "string",
+ required: true,
+ description:
+ "The login of the user who will manage this organization."
+ },
+ profile_name: {
+ type: "string",
+ description: "The organization's display name."
+ }
+ },
+ description: "Create an organization"
+ }
+ }
+ };
+ },
+ {}
+ ],
+ 31: [
+ function(require, module, exports) {
+ module.exports = {
+ _from: "@octokit/rest@14.0.9",
+ _id: "@octokit/rest@14.0.9",
+ _inBundle: false,
+ _integrity:
+ "sha512-irP9phKfTXEZIcW2R+VNCtGHZJrXMWmSYp6RRfFn4BtAqtDRXF5z9JxCEQlAhNBf6X1koNi5k49tIAAAEJNlVQ==",
+ _location: "/@octokit/rest",
+ _phantomChildren: {},
+ _requested: {
+ type: "version",
+ registry: true,
+ raw: "@octokit/rest@14.0.9",
+ name: "@octokit/rest",
+ escapedName: "@octokit%2frest",
+ scope: "@octokit",
+ rawSpec: "14.0.9",
+ saveSpec: null,
+ fetchSpec: "14.0.9"
+ },
+ _requiredBy: ["#DEV:/", "/@semantic-release/github"],
+ _resolved:
+ "https://registry.npmjs.org/@octokit/rest/-/rest-14.0.9.tgz",
+ _shasum: "d5e0a00dcb78901dd7b2ef852acfc0aea7c479ef",
+ _spec: "@octokit/rest@14.0.9",
+ _where: "/home/travis/build/gr2m/octokit-rest-for-node-v0.12",
+ apidoc: { template: { withCompare: false } },
+ author: { name: "Gregor Martynus", url: "https://github.com/gr2m" },
+ bugs: { url: "https://github.com/octokit/rest.js/issues" },
+ bundleDependencies: false,
+ contributors: [
+ { name: "Mike de Boer", email: "info@mikedeboer.nl" },
+ { name: "Fabian Jakobs", email: "fabian@c9.io" },
+ { name: "Joe Gallo", email: "joe@brassafrax.com" },
+ { name: "Gregor Martynus", url: "https://github.com/gr2m" }
+ ],
+ dependencies: {
+ "before-after-hook": "^1.1.0",
+ debug: "^3.1.0",
+ "is-array-buffer": "^1.0.0",
+ "is-stream": "^1.1.0",
+ lodash: "^4.17.4",
+ "url-template": "^2.0.8"
+ },
+ deprecated: false,
+ description: "GitHub REST API client for Node.js",
+ devDependencies: {
+ "@octokit/fixtures": "^6.0.0",
+ apidoc: "^0.17.6",
+ chai: "^4.1.2",
+ coveralls: "^3.0.0",
+ dotenv: "^5.0.0",
+ "gh-pages-with-token": "^1.0.0",
+ glob: "^7.1.2",
+ mkdirp: "^0.5.1",
+ mocha: "^5.0.0",
+ mustache: "^2.2.1",
+ nock: "^9.1.0",
+ "npm-run-all": "^4.1.1",
+ nyc: "^11.2.1",
+ proxyquire: "^1.8.0",
+ "semantic-release": "^12.2.2",
+ "simple-mock": "^0.8.0",
+ standard: "^10.0.3",
+ "standard-markdown": "^4.0.2",
+ "string-to-arraybuffer": "^1.0.0",
+ typescript: "^2.6.2"
+ },
+ engines: { node: ">=4" },
+ files: ["index.js", "index.d.ts", "index.js.flow", "lib"],
+ homepage: "https://github.com/octokit/rest.js#readme",
+ keywords: ["octokit", "github", "rest", "api-client"],
+ license: "MIT",
+ name: "@octokit/rest",
+ nyc: { ignore: ["examples", "test"] },
+ publishConfig: { access: "public" },
+ repository: {
+ type: "git",
+ url: "git+https://github.com/octokit/rest.js.git"
+ },
+ scripts: {
+ build: "npm-run-all build:*",
+ "build:docs": "node scripts/generate-api-docs",
+ "build:flow": "node scripts/generate-flow-types",
+ "build:ts": "node scripts/generate-typescript-types",
+ coverage:
+ "nyc report --reporter=html && open coverage/index.html",
+ "coverage:upload": "nyc report --reporter=text-lcov | coveralls",
+ "deploy-docs": "gh-pages-with-token -d doc",
+ "postbuild:docs": "apidoc -i doc/ -o doc/",
+ "prebuild:docs": "mkdirp doc/",
+ pretest: "standard && standard-markdown",
+ "prevalidate:ts": "npm run -s build:ts",
+ "semantic-release": "semantic-release",
+ test: "nyc mocha 'test/**/*-test.js'",
+ "test:examples": "node test/examples.js",
+ "validate:ts": "tsc --target es6 index.d.ts"
+ },
+ types: "index.d.ts",
+ version: "14.0.9"
+ };
+ },
+ {}
+ ],
+ 32: [
+ function(require, module, exports) {
+ module.exports = Hook;
+ var register = require("./lib/register");
+ var addHook = require("./lib/add");
+ var removeHook = require("./lib/remove");
+ function Hook() {
+ var state = { registry: {} };
+ var hook = register.bind(null, state);
+ hook.remove = {};
+ hook.api = { remove: {} };
+ ["before", "error", "after"].forEach(function(kind) {
+ hook[kind] = hook.api[kind] = addHook.bind(null, state, kind);
+ hook.remove[kind] = hook.api.remove[kind] = removeHook.bind(
+ null,
+ state,
+ kind
+ );
+ });
+ return hook;
+ }
+ },
+ { "./lib/add": 33, "./lib/register": 34, "./lib/remove": 35 }
+ ],
+ 33: [
+ function(require, module, exports) {
+ module.exports = addHook;
+ function addHook(state, kind, name, hook) {
+ if (!state.registry[name]) {
+ state.registry[name] = { before: [], error: [], after: [] };
+ }
+ state.registry[name][kind][kind === "before" ? "unshift" : "push"](
+ hook
+ );
+ }
+ },
+ {}
+ ],
+ 34: [
+ function(require, module, exports) {
+ module.exports = register;
+ function register(state, name, options, method) {
+ if (arguments.length === 3) {
+ method = options;
+ options = {};
+ }
+ if (typeof method !== "function") {
+ throw new Error("method for before hook must be a function");
+ }
+ if (
+ (typeof options === "undefined"
+ ? "undefined"
+ : _typeof(options)) !== "object"
+ ) {
+ throw new Error("options for before hook must be an object");
+ }
+ if (Array.isArray(name)) {
+ return name.reverse().reduce(function(callback, name) {
+ return register.bind(null, state, name, options, callback);
+ }, method)();
+ }
+ var hooks = state.registry[name];
+ if (!hooks) {
+ return invokeMethod(options, method);
+ }
+ var beforeHooks = hooks.before;
+ var errorHooks = hooks.error;
+ var afterHooks = hooks.after; // 1. run "before hooks" which may mutate options
+ return (
+ Promise.all(beforeHooks.map(invokeBeforeHook.bind(null, options))) // 2. Once all finish without error, call the method with the (mutated) options
+ .then(function() {
+ return method(options);
+ }) // 3. If an error occurs in 1. or 2. run the "error hooks" which may mutate
+ // the error object. If one of them does not return an error then set the
+ // result to that. Otherwise throw (mutated) error.
+ .catch(function(error) {
+ return Promise.all(
+ errorHooks.map(invokeErrorHook.bind(null, error, options))
+ ).then(function(results) {
+ var nonErrorResults = results.filter(isntError);
+ if (nonErrorResults.length) {
+ return nonErrorResults[0];
+ }
+ throw error;
+ });
+ }) // 4. Run the "after hooks". They may mutate the result
+ .then(function(result) {
+ return Promise.all(
+ afterHooks.map(invokeAfterHook.bind(null, result, options))
+ ).then(function() {
+ return result;
+ });
+ })
+ );
+ }
+ function invokeMethod(options, method) {
+ try {
+ return Promise.resolve(method(options));
+ } catch (error) {
+ return Promise.reject(error);
+ }
+ }
+ function invokeBeforeHook(options, method) {
+ try {
+ return method(options);
+ } catch (error) {
+ return Promise.reject(error);
+ }
+ }
+ function invokeErrorHook(result, options, errorHook) {
+ try {
+ return Promise.resolve(errorHook(result, options)).catch(function(
+ error
+ ) {
+ return error;
+ });
+ } catch (error) {
+ return Promise.resolve(error);
+ }
+ }
+ function invokeAfterHook(result, options, method) {
+ try {
+ return method(result, options);
+ } catch (error) {
+ return Promise.reject(error);
+ }
+ }
+ function isntError(result) {
+ return !(result instanceof Error);
+ }
+ },
+ {}
+ ],
+ 35: [
+ function(require, module, exports) {
+ module.exports = removeHook;
+ function removeHook(state, kind, name, method) {
+ if (!state.registry[name]) {
+ return;
+ }
+ var index = state.registry[name][kind].indexOf(method);
+ if (index === -1) {
+ return;
+ }
+ state.registry[name][kind].splice(index, 1);
+ }
+ },
+ {}
+ ],
+ 36: [
+ function(require, module, exports) {
+ /**
+ * This is the web browser implementation of `debug()`.
+ *
+ * Expose `debug()` as the module.
+ */ exports = module.exports = require("./debug");
+ exports.log = log;
+ exports.formatArgs = formatArgs;
+ exports.save = save;
+ exports.load = load;
+ exports.useColors = useColors;
+ exports.storage =
+ "undefined" != typeof chrome && "undefined" != typeof chrome.storage
+ ? chrome.storage.local
+ : localstorage();
+ /**
+ * Colors.
+ */ exports.colors = [
+ "#0000CC",
+ "#0000FF",
+ "#0033CC",
+ "#0033FF",
+ "#0066CC",
+ "#0066FF",
+ "#0099CC",
+ "#0099FF",
+ "#00CC00",
+ "#00CC33",
+ "#00CC66",
+ "#00CC99",
+ "#00CCCC",
+ "#00CCFF",
+ "#3300CC",
+ "#3300FF",
+ "#3333CC",
+ "#3333FF",
+ "#3366CC",
+ "#3366FF",
+ "#3399CC",
+ "#3399FF",
+ "#33CC00",
+ "#33CC33",
+ "#33CC66",
+ "#33CC99",
+ "#33CCCC",
+ "#33CCFF",
+ "#6600CC",
+ "#6600FF",
+ "#6633CC",
+ "#6633FF",
+ "#66CC00",
+ "#66CC33",
+ "#9900CC",
+ "#9900FF",
+ "#9933CC",
+ "#9933FF",
+ "#99CC00",
+ "#99CC33",
+ "#CC0000",
+ "#CC0033",
+ "#CC0066",
+ "#CC0099",
+ "#CC00CC",
+ "#CC00FF",
+ "#CC3300",
+ "#CC3333",
+ "#CC3366",
+ "#CC3399",
+ "#CC33CC",
+ "#CC33FF",
+ "#CC6600",
+ "#CC6633",
+ "#CC9900",
+ "#CC9933",
+ "#CCCC00",
+ "#CCCC33",
+ "#FF0000",
+ "#FF0033",
+ "#FF0066",
+ "#FF0099",
+ "#FF00CC",
+ "#FF00FF",
+ "#FF3300",
+ "#FF3333",
+ "#FF3366",
+ "#FF3399",
+ "#FF33CC",
+ "#FF33FF",
+ "#FF6600",
+ "#FF6633",
+ "#FF9900",
+ "#FF9933",
+ "#FFCC00",
+ "#FFCC33"
+ ];
+ /**
+ * Currently only WebKit-based Web Inspectors, Firefox >= v31,
+ * and the Firebug extension (any Firefox version) are known
+ * to support "%c" CSS customizations.
+ *
+ * TODO: add a `localStorage` variable to explicitly enable/disable colors
+ */ function useColors() {
+ // NB: In an Electron preload script, document will be defined but not fully
+ // initialized. Since we know we're in Chrome, we'll just detect this case
+ // explicitly
+ if (
+ typeof window !== "undefined" &&
+ window.process &&
+ window.process.type === "renderer"
+ ) {
+ return true;
+ } // Internet Explorer and Edge do not support colors.
+ if (
+ typeof navigator !== "undefined" &&
+ navigator.userAgent &&
+ navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)
+ ) {
+ return false;
+ } // is webkit? http://stackoverflow.com/a/16459606/376773
+ // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
+ return (
+ (typeof document !== "undefined" &&
+ document.documentElement &&
+ document.documentElement.style &&
+ document.documentElement.style.WebkitAppearance) || // is firebug? http://stackoverflow.com/a/398120/376773
+ (typeof window !== "undefined" &&
+ window.console &&
+ (window.console.firebug ||
+ (window.console.exception && window.console.table))) || // is firefox >= v31?
+ // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
+ (typeof navigator !== "undefined" &&
+ navigator.userAgent &&
+ navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) &&
+ parseInt(RegExp.$1, 10) >= 31) || // double check webkit in userAgent just in case we are in a worker
+ (typeof navigator !== "undefined" &&
+ navigator.userAgent &&
+ navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))
+ );
+ }
+ /**
+ * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.
+ */ exports.formatters.j = function(v) {
+ try {
+ return JSON.stringify(v);
+ } catch (err) {
+ return "[UnexpectedJSONParseError]: " + err.message;
+ }
+ };
+ /**
+ * Colorize log arguments if enabled.
+ *
+ * @api public
+ */ function formatArgs(args) {
+ var useColors = this.useColors;
+ args[0] =
+ (useColors ? "%c" : "") +
+ this.namespace +
+ (useColors ? " %c" : " ") +
+ args[0] +
+ (useColors ? "%c " : " ") +
+ "+" +
+ exports.humanize(this.diff);
+ if (!useColors) return;
+ var c = "color: " + this.color;
+ args.splice(1, 0, c, "color: inherit"); // the final "%c" is somewhat tricky, because there could be other
+ // arguments passed either before or after the %c, so we need to
+ // figure out the correct index to insert the CSS into
+ var index = 0;
+ var lastC = 0;
+ args[0].replace(/%[a-zA-Z%]/g, function(match) {
+ if ("%%" === match) return;
+ index++;
+ if ("%c" === match) {
+ // we only are interested in the *last* %c
+ // (the user may have provided their own)
+ lastC = index;
+ }
+ });
+ args.splice(lastC, 0, c);
+ }
+ /**
+ * Invokes `console.log()` when available.
+ * No-op when `console.log` is not a "function".
+ *
+ * @api public
+ */ function log() {
+ // this hackery is required for IE8/9, where
+ // the `console.log` function doesn't have 'apply'
+ return (
+ "object" ===
+ (typeof console === "undefined"
+ ? "undefined"
+ : _typeof(console)) &&
+ console.log &&
+ Function.prototype.apply.call(console.log, console, arguments)
+ );
+ }
+ /**
+ * Save `namespaces`.
+ *
+ * @param {String} namespaces
+ * @api private
+ */ function save(namespaces) {
+ try {
+ if (null == namespaces) {
+ exports.storage.removeItem("debug");
+ } else {
+ exports.storage.debug = namespaces;
+ }
+ } catch (e) {}
+ }
+ /**
+ * Load `namespaces`.
+ *
+ * @return {String} returns the previously persisted debug modes
+ * @api private
+ */ function load() {
+ var r;
+ try {
+ r = exports.storage.debug;
+ } catch (e) {} // If debug isn't set in LS, and we're in Electron, try to load $DEBUG
+ if (!r && typeof process !== "undefined" && "env" in process) {
+ r = process.env.DEBUG;
+ }
+ return r;
+ }
+ /**
+ * Enable namespaces listed in `localStorage.debug` initially.
+ */ exports.enable(load());
+ /**
+ * Localstorage attempts to return the localstorage.
+ *
+ * This is necessary because safari throws
+ * when a user disables cookies/localstorage
+ * and you attempt to access it.
+ *
+ * @return {LocalStorage}
+ * @api private
+ */ function localstorage() {
+ try {
+ return window.localStorage;
+ } catch (e) {}
+ }
+ },
+ { "./debug": 37 }
+ ],
+ 37: [
+ function(require, module, exports) {
+ /**
+ * This is the common logic for both the Node.js and web browser
+ * implementations of `debug()`.
+ *
+ * Expose `debug()` as the module.
+ */ exports = module.exports = createDebug.debug = createDebug[
+ "default"
+ ] = createDebug;
+ exports.coerce = coerce;
+ exports.disable = disable;
+ exports.enable = enable;
+ exports.enabled = enabled;
+ exports.humanize = require("ms");
+ /**
+ * Active `debug` instances.
+ */ exports.instances = [];
+ /**
+ * The currently active debug mode names, and names to skip.
+ */ exports.names = [];
+ exports.skips = [];
+ /**
+ * Map of special "%n" handling functions, for the debug "format" argument.
+ *
+ * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N".
+ */ exports.formatters = {};
+ /**
+ * Select a color.
+ * @param {String} namespace
+ * @return {Number}
+ * @api private
+ */ function selectColor(namespace) {
+ var hash = 0,
+ i;
+ for (i in namespace) {
+ hash = (hash << 5) - hash + namespace.charCodeAt(i);
+ hash |= 0; // Convert to 32bit integer
+ }
+ return exports.colors[Math.abs(hash) % exports.colors.length];
+ }
+ /**
+ * Create a debugger with the given `namespace`.
+ *
+ * @param {String} namespace
+ * @return {Function}
+ * @api public
+ */ function createDebug(namespace) {
+ var prevTime;
+ function debug() {
+ // disabled?
+ if (!debug.enabled) return;
+ var self = debug; // set `diff` timestamp
+ var curr = +new Date();
+ var ms = curr - (prevTime || curr);
+ self.diff = ms;
+ self.prev = prevTime;
+ self.curr = curr;
+ prevTime = curr; // turn the `arguments` into a proper Array
+ var args = new Array(arguments.length);
+ for (var i = 0; i < args.length; i++) {
+ args[i] = arguments[i];
+ }
+ args[0] = exports.coerce(args[0]);
+ if ("string" !== typeof args[0]) {
+ // anything else let's inspect with %O
+ args.unshift("%O");
+ } // apply any `formatters` transformations
+ var index = 0;
+ args[0] = args[0].replace(/%([a-zA-Z%])/g, function(
+ match,
+ format
+ ) {
+ // if we encounter an escaped % then don't increase the array index
+ if (match === "%%") return match;
+ index++;
+ var formatter = exports.formatters[format];
+ if ("function" === typeof formatter) {
+ var val = args[index];
+ match = formatter.call(self, val); // now we need to remove `args[index]` since it's inlined in the `format`
+ args.splice(index, 1);
+ index--;
+ }
+ return match;
+ }); // apply env-specific formatting (colors, etc.)
+ exports.formatArgs.call(self, args);
+ var logFn = debug.log || exports.log || console.log.bind(console);
+ logFn.apply(self, args);
+ }
+ debug.namespace = namespace;
+ debug.enabled = exports.enabled(namespace);
+ debug.useColors = exports.useColors();
+ debug.color = selectColor(namespace);
+ debug.destroy = destroy; // env-specific initialization logic for debug instances
+ if ("function" === typeof exports.init) {
+ exports.init(debug);
+ }
+ exports.instances.push(debug);
+ return debug;
+ }
+ function destroy() {
+ var index = exports.instances.indexOf(this);
+ if (index !== -1) {
+ exports.instances.splice(index, 1);
+ return true;
+ } else {
+ return false;
+ }
+ }
+ /**
+ * Enables a debug mode by namespaces. This can include modes
+ * separated by a colon and wildcards.
+ *
+ * @param {String} namespaces
+ * @api public
+ */ function enable(namespaces) {
+ exports.save(namespaces);
+ exports.names = [];
+ exports.skips = [];
+ var i;
+ var split = (typeof namespaces === "string"
+ ? namespaces
+ : ""
+ ).split(/[\s,]+/);
+ var len = split.length;
+ for (i = 0; i < len; i++) {
+ if (!split[i]) continue; // ignore empty strings
+ namespaces = split[i].replace(/\*/g, ".*?");
+ if (namespaces[0] === "-") {
+ exports.skips.push(
+ new RegExp("^" + namespaces.substr(1) + "$")
+ );
+ } else {
+ exports.names.push(new RegExp("^" + namespaces + "$"));
+ }
+ }
+ for (i = 0; i < exports.instances.length; i++) {
+ var instance = exports.instances[i];
+ instance.enabled = exports.enabled(instance.namespace);
+ }
+ }
+ /**
+ * Disable debug output.
+ *
+ * @api public
+ */ function disable() {
+ exports.enable("");
+ }
+ /**
+ * Returns true if the given mode name is enabled, false otherwise.
+ *
+ * @param {String} name
+ * @return {Boolean}
+ * @api public
+ */ function enabled(name) {
+ if (name[name.length - 1] === "*") {
+ return true;
+ }
+ var i, len;
+ for (i = 0, len = exports.skips.length; i < len; i++) {
+ if (exports.skips[i].test(name)) {
+ return false;
+ }
+ }
+ for (i = 0, len = exports.names.length; i < len; i++) {
+ if (exports.names[i].test(name)) {
+ return true;
+ }
+ }
+ return false;
+ }
+ /**
+ * Coerce `val`.
+ *
+ * @param {Mixed} val
+ * @return {Mixed}
+ * @api private
+ */ function coerce(val) {
+ if (val instanceof Error) return val.stack || val.message;
+ return val;
+ }
+ },
+ { ms: 151 }
+ ],
+ 38: [
+ function(require, module, exports) {
+ /*!
+ * isArrayBuffer v1.0.0
+ * https://github.com/fengyuanchen/is-array-buffer
+ *
+ * Copyright (c) 2015-2017 Chen Fengyuan
+ * Released under the MIT license
+ *
+ * Date: 2017-07-26T11:00:44.931Z
+ */ (function(
+ global,
+ factory
+ ) {
+ (typeof exports === "undefined"
+ ? "undefined"
+ : _typeof(exports)) === "object" && typeof module !== "undefined"
+ ? (module.exports = factory())
+ : typeof define === "function" && define.amd
+ ? define(factory)
+ : (global.isArrayBuffer = factory());
+ })(this, function() {
+ "use strict";
+ var hasArrayBuffer = typeof ArrayBuffer === "function";
+ var toString = Object.prototype.toString;
+ /**
+ * Check if the given value is an ArrayBuffer.
+ * @param {*} value - The value to check.
+ * @returns {boolean} Returns `true` if the given is an ArrayBuffer, else `false`.
+ * @example
+ * isArrayBuffer(new ArrayBuffer())
+ * // => true
+ * isArrayBuffer(new Array())
+ * // => false
+ */ function isArrayBuffer(value) {
+ return (
+ hasArrayBuffer &&
+ (value instanceof ArrayBuffer ||
+ toString.call(value) === "[object ArrayBuffer]")
+ );
+ }
+ return isArrayBuffer;
+ });
+ },
+ {}
+ ],
+ 39: [
+ function(require, module, exports) {
+ "use strict";
+ var isStream = (module.exports = function(stream) {
+ return (
+ stream !== null &&
+ (typeof stream === "undefined"
+ ? "undefined"
+ : _typeof(stream)) === "object" &&
+ typeof stream.pipe === "function"
+ );
+ });
+ isStream.writable = function(stream) {
+ return (
+ isStream(stream) &&
+ stream.writable !== false &&
+ typeof stream._write === "function" &&
+ _typeof(stream._writableState) === "object"
+ );
+ };
+ isStream.readable = function(stream) {
+ return (
+ isStream(stream) &&
+ stream.readable !== false &&
+ typeof stream._read === "function" &&
+ _typeof(stream._readableState) === "object"
+ );
+ };
+ isStream.duplex = function(stream) {
+ return isStream.writable(stream) && isStream.readable(stream);
+ };
+ isStream.transform = function(stream) {
+ return (
+ isStream.duplex(stream) &&
+ typeof stream._transform === "function" &&
+ _typeof(stream._transformState) === "object"
+ );
+ };
+ },
+ {}
+ ],
+ 40: [
+ function(require, module, exports) {
+ var hashClear = require("./_hashClear"),
+ hashDelete = require("./_hashDelete"),
+ hashGet = require("./_hashGet"),
+ hashHas = require("./_hashHas"),
+ hashSet = require("./_hashSet");
+ /**
+ * Creates a hash object.
+ *
+ * @private
+ * @constructor
+ * @param {Array} [entries] The key-value pairs to cache.
+ */ function Hash(entries) {
+ var index = -1,
+ length = entries == null ? 0 : entries.length;
+ this.clear();
+ while (++index < length) {
+ var entry = entries[index];
+ this.set(entry[0], entry[1]);
+ }
+ } // Add methods to `Hash`.
+ Hash.prototype.clear = hashClear;
+ Hash.prototype["delete"] = hashDelete;
+ Hash.prototype.get = hashGet;
+ Hash.prototype.has = hashHas;
+ Hash.prototype.set = hashSet;
+ module.exports = Hash;
+ },
+ {
+ "./_hashClear": 86,
+ "./_hashDelete": 87,
+ "./_hashGet": 88,
+ "./_hashHas": 89,
+ "./_hashSet": 90
+ }
+ ],
+ 41: [
+ function(require, module, exports) {
+ var listCacheClear = require("./_listCacheClear"),
+ listCacheDelete = require("./_listCacheDelete"),
+ listCacheGet = require("./_listCacheGet"),
+ listCacheHas = require("./_listCacheHas"),
+ listCacheSet = require("./_listCacheSet");
+ /**
+ * Creates an list cache object.
+ *
+ * @private
+ * @constructor
+ * @param {Array} [entries] The key-value pairs to cache.
+ */ function ListCache(entries) {
+ var index = -1,
+ length = entries == null ? 0 : entries.length;
+ this.clear();
+ while (++index < length) {
+ var entry = entries[index];
+ this.set(entry[0], entry[1]);
+ }
+ } // Add methods to `ListCache`.
+ ListCache.prototype.clear = listCacheClear;
+ ListCache.prototype["delete"] = listCacheDelete;
+ ListCache.prototype.get = listCacheGet;
+ ListCache.prototype.has = listCacheHas;
+ ListCache.prototype.set = listCacheSet;
+ module.exports = ListCache;
+ },
+ {
+ "./_listCacheClear": 98,
+ "./_listCacheDelete": 99,
+ "./_listCacheGet": 100,
+ "./_listCacheHas": 101,
+ "./_listCacheSet": 102
+ }
+ ],
+ 42: [
+ function(require, module, exports) {
+ var getNative = require("./_getNative"),
+ root = require("./_root");
+ /* Built-in method references that are verified to be native. */ var Map = getNative(
+ root,
+ "Map"
+ );
+ module.exports = Map;
+ },
+ { "./_getNative": 82, "./_root": 115 }
+ ],
+ 43: [
+ function(require, module, exports) {
+ var mapCacheClear = require("./_mapCacheClear"),
+ mapCacheDelete = require("./_mapCacheDelete"),
+ mapCacheGet = require("./_mapCacheGet"),
+ mapCacheHas = require("./_mapCacheHas"),
+ mapCacheSet = require("./_mapCacheSet");
+ /**
+ * Creates a map cache object to store key-value pairs.
+ *
+ * @private
+ * @constructor
+ * @param {Array} [entries] The key-value pairs to cache.
+ */ function MapCache(entries) {
+ var index = -1,
+ length = entries == null ? 0 : entries.length;
+ this.clear();
+ while (++index < length) {
+ var entry = entries[index];
+ this.set(entry[0], entry[1]);
+ }
+ } // Add methods to `MapCache`.
+ MapCache.prototype.clear = mapCacheClear;
+ MapCache.prototype["delete"] = mapCacheDelete;
+ MapCache.prototype.get = mapCacheGet;
+ MapCache.prototype.has = mapCacheHas;
+ MapCache.prototype.set = mapCacheSet;
+ module.exports = MapCache;
+ },
+ {
+ "./_mapCacheClear": 103,
+ "./_mapCacheDelete": 104,
+ "./_mapCacheGet": 105,
+ "./_mapCacheHas": 106,
+ "./_mapCacheSet": 107
+ }
+ ],
+ 44: [
+ function(require, module, exports) {
+ var ListCache = require("./_ListCache"),
+ stackClear = require("./_stackClear"),
+ stackDelete = require("./_stackDelete"),
+ stackGet = require("./_stackGet"),
+ stackHas = require("./_stackHas"),
+ stackSet = require("./_stackSet");
+ /**
+ * Creates a stack cache object to store key-value pairs.
+ *
+ * @private
+ * @constructor
+ * @param {Array} [entries] The key-value pairs to cache.
+ */ function Stack(entries) {
+ var data = (this.__data__ = new ListCache(entries));
+ this.size = data.size;
+ } // Add methods to `Stack`.
+ Stack.prototype.clear = stackClear;
+ Stack.prototype["delete"] = stackDelete;
+ Stack.prototype.get = stackGet;
+ Stack.prototype.has = stackHas;
+ Stack.prototype.set = stackSet;
+ module.exports = Stack;
+ },
+ {
+ "./_ListCache": 41,
+ "./_stackClear": 119,
+ "./_stackDelete": 120,
+ "./_stackGet": 121,
+ "./_stackHas": 122,
+ "./_stackSet": 123
+ }
+ ],
+ 45: [
+ function(require, module, exports) {
+ var root = require("./_root");
+ /** Built-in value references. */ var _Symbol = root.Symbol;
+ module.exports = _Symbol;
+ },
+ { "./_root": 115 }
+ ],
+ 46: [
+ function(require, module, exports) {
+ var root = require("./_root");
+ /** Built-in value references. */ var Uint8Array = root.Uint8Array;
+ module.exports = Uint8Array;
+ },
+ { "./_root": 115 }
+ ],
+ 47: [
+ function(require, module, exports) {
+ /**
+ * A faster alternative to `Function#apply`, this function invokes `func`
+ * with the `this` binding of `thisArg` and the arguments of `args`.
+ *
+ * @private
+ * @param {Function} func The function to invoke.
+ * @param {*} thisArg The `this` binding of `func`.
+ * @param {Array} args The arguments to invoke `func` with.
+ * @returns {*} Returns the result of `func`.
+ */ function apply(func, thisArg, args) {
+ switch (args.length) {
+ case 0:
+ return func.call(thisArg);
+ case 1:
+ return func.call(thisArg, args[0]);
+ case 2:
+ return func.call(thisArg, args[0], args[1]);
+ case 3:
+ return func.call(thisArg, args[0], args[1], args[2]);
+ }
+ return func.apply(thisArg, args);
+ }
+ module.exports = apply;
+ },
+ {}
+ ],
+ 48: [
+ function(require, module, exports) {
+ var baseTimes = require("./_baseTimes"),
+ isArguments = require("./isArguments"),
+ isArray = require("./isArray"),
+ isBuffer = require("./isBuffer"),
+ isIndex = require("./_isIndex"),
+ isTypedArray = require("./isTypedArray");
+ /** Used for built-in method references. */ var objectProto =
+ Object.prototype;
+ /** Used to check objects for own properties. */ var hasOwnProperty =
+ objectProto.hasOwnProperty;
+ /**
+ * Creates an array of the enumerable property names of the array-like `value`.
+ *
+ * @private
+ * @param {*} value The value to query.
+ * @param {boolean} inherited Specify returning inherited property names.
+ * @returns {Array} Returns the array of property names.
+ */ function arrayLikeKeys(value, inherited) {
+ var isArr = isArray(value),
+ isArg = !isArr && isArguments(value),
+ isBuff = !isArr && !isArg && isBuffer(value),
+ isType = !isArr && !isArg && !isBuff && isTypedArray(value),
+ skipIndexes = isArr || isArg || isBuff || isType,
+ result = skipIndexes ? baseTimes(value.length, String) : [],
+ length = result.length;
+ for (var key in value) {
+ if (
+ (inherited || hasOwnProperty.call(value, key)) &&
+ !(
+ skipIndexes && // Safari 9 has enumerable `arguments.length` in strict mode.
+ (key == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
+ (isBuff && (key == "offset" || key == "parent")) || // PhantomJS 2 has enumerable non-index properties on typed arrays.
+ (isType &&
+ (key == "buffer" ||
+ key == "byteLength" ||
+ key == "byteOffset")) || // Skip index properties.
+ isIndex(key, length))
+ )
+ ) {
+ result.push(key);
+ }
+ }
+ return result;
+ }
+ module.exports = arrayLikeKeys;
+ },
+ {
+ "./_baseTimes": 66,
+ "./_isIndex": 92,
+ "./isArguments": 131,
+ "./isArray": 132,
+ "./isBuffer": 135,
+ "./isTypedArray": 142
+ }
+ ],
+ 49: [
+ function(require, module, exports) {
+ /**
+ * A specialized version of `_.map` for arrays without support for iteratee
+ * shorthands.
+ *
+ * @private
+ * @param {Array} [array] The array to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @returns {Array} Returns the new mapped array.
+ */ function arrayMap(array, iteratee) {
+ var index = -1,
+ length = array == null ? 0 : array.length,
+ result = Array(length);
+ while (++index < length) {
+ result[index] = iteratee(array[index], index, array);
+ }
+ return result;
+ }
+ module.exports = arrayMap;
+ },
+ {}
+ ],
+ 50: [
+ function(require, module, exports) {
+ var baseAssignValue = require("./_baseAssignValue"),
+ eq = require("./eq");
+ /**
+ * This function is like `assignValue` except that it doesn't assign
+ * `undefined` values.
+ *
+ * @private
+ * @param {Object} object The object to modify.
+ * @param {string} key The key of the property to assign.
+ * @param {*} value The value to assign.
+ */ function assignMergeValue(object, key, value) {
+ if (
+ (value !== undefined && !eq(object[key], value)) ||
+ (value === undefined && !(key in object))
+ ) {
+ baseAssignValue(object, key, value);
+ }
+ }
+ module.exports = assignMergeValue;
+ },
+ { "./_baseAssignValue": 53, "./eq": 129 }
+ ],
+ 51: [
+ function(require, module, exports) {
+ var baseAssignValue = require("./_baseAssignValue"),
+ eq = require("./eq");
+ /** Used for built-in method references. */ var objectProto =
+ Object.prototype;
+ /** Used to check objects for own properties. */ var hasOwnProperty =
+ objectProto.hasOwnProperty;
+ /**
+ * Assigns `value` to `key` of `object` if the existing value is not equivalent
+ * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
+ * for equality comparisons.
+ *
+ * @private
+ * @param {Object} object The object to modify.
+ * @param {string} key The key of the property to assign.
+ * @param {*} value The value to assign.
+ */ function assignValue(object, key, value) {
+ var objValue = object[key];
+ if (
+ !(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
+ (value === undefined && !(key in object))
+ ) {
+ baseAssignValue(object, key, value);
+ }
+ }
+ module.exports = assignValue;
+ },
+ { "./_baseAssignValue": 53, "./eq": 129 }
+ ],
+ 52: [
+ function(require, module, exports) {
+ var eq = require("./eq");
+ /**
+ * Gets the index at which the `key` is found in `array` of key-value pairs.
+ *
+ * @private
+ * @param {Array} array The array to inspect.
+ * @param {*} key The key to search for.
+ * @returns {number} Returns the index of the matched value, else `-1`.
+ */ function assocIndexOf(array, key) {
+ var length = array.length;
+ while (length--) {
+ if (eq(array[length][0], key)) {
+ return length;
+ }
+ }
+ return -1;
+ }
+ module.exports = assocIndexOf;
+ },
+ { "./eq": 129 }
+ ],
+ 53: [
+ function(require, module, exports) {
+ var defineProperty = require("./_defineProperty");
+ /**
+ * The base implementation of `assignValue` and `assignMergeValue` without
+ * value checks.
+ *
+ * @private
+ * @param {Object} object The object to modify.
+ * @param {string} key The key of the property to assign.
+ * @param {*} value The value to assign.
+ */ function baseAssignValue(object, key, value) {
+ if (key == "__proto__" && defineProperty) {
+ defineProperty(object, key, {
+ configurable: true,
+ enumerable: true,
+ value: value,
+ writable: true
+ });
+ } else {
+ object[key] = value;
+ }
+ }
+ module.exports = baseAssignValue;
+ },
+ { "./_defineProperty": 79 }
+ ],
+ 54: [
+ function(require, module, exports) {
+ var isObject = require("./isObject");
+ /** Built-in value references. */ var objectCreate = Object.create;
+ /**
+ * The base implementation of `_.create` without support for assigning
+ * properties to the created object.
+ *
+ * @private
+ * @param {Object} proto The object to inherit from.
+ * @returns {Object} Returns the new object.
+ */ var baseCreate = (function() {
+ function object() {}
+ return function(proto) {
+ if (!isObject(proto)) {
+ return {};
+ }
+ if (objectCreate) {
+ return objectCreate(proto);
+ }
+ object.prototype = proto;
+ var result = new object();
+ object.prototype = undefined;
+ return result;
+ };
+ })();
+ module.exports = baseCreate;
+ },
+ { "./isObject": 138 }
+ ],
+ 55: [
+ function(require, module, exports) {
+ var createBaseFor = require("./_createBaseFor");
+ /**
+ * The base implementation of `baseForOwn` which iterates over `object`
+ * properties returned by `keysFunc` and invokes `iteratee` for each property.
+ * Iteratee functions may exit iteration early by explicitly returning `false`.
+ *
+ * @private
+ * @param {Object} object The object to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @param {Function} keysFunc The function to get the keys of `object`.
+ * @returns {Object} Returns `object`.
+ */ var baseFor = createBaseFor();
+ module.exports = baseFor;
+ },
+ { "./_createBaseFor": 77 }
+ ],
+ 56: [
+ function(require, module, exports) {
+ var _Symbol2 = require("./_Symbol"),
+ getRawTag = require("./_getRawTag"),
+ objectToString = require("./_objectToString");
+ /** `Object#toString` result references. */ var nullTag =
+ "[object Null]",
+ undefinedTag = "[object Undefined]";
+ /** Built-in value references. */ var symToStringTag = _Symbol2
+ ? _Symbol2.toStringTag
+ : undefined;
+ /**
+ * The base implementation of `getTag` without fallbacks for buggy environments.
+ *
+ * @private
+ * @param {*} value The value to query.
+ * @returns {string} Returns the `toStringTag`.
+ */ function baseGetTag(value) {
+ if (value == null) {
+ return value === undefined ? undefinedTag : nullTag;
+ }
+ return symToStringTag && symToStringTag in Object(value)
+ ? getRawTag(value)
+ : objectToString(value);
+ }
+ module.exports = baseGetTag;
+ },
+ { "./_Symbol": 45, "./_getRawTag": 84, "./_objectToString": 112 }
+ ],
+ 57: [
+ function(require, module, exports) {
+ var baseGetTag = require("./_baseGetTag"),
+ isObjectLike = require("./isObjectLike");
+ /** `Object#toString` result references. */ var argsTag =
+ "[object Arguments]";
+ /**
+ * The base implementation of `_.isArguments`.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is an `arguments` object,
+ */ function baseIsArguments(value) {
+ return isObjectLike(value) && baseGetTag(value) == argsTag;
+ }
+ module.exports = baseIsArguments;
+ },
+ { "./_baseGetTag": 56, "./isObjectLike": 139 }
+ ],
+ 58: [
+ function(require, module, exports) {
+ var isFunction = require("./isFunction"),
+ isMasked = require("./_isMasked"),
+ isObject = require("./isObject"),
+ toSource = require("./_toSource");
+ /**
+ * Used to match `RegExp`
+ * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
+ */ var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
+ /** Used to detect host constructors (Safari). */ var reIsHostCtor = /^\[object .+?Constructor\]$/;
+ /** Used for built-in method references. */ var funcProto =
+ Function.prototype,
+ objectProto = Object.prototype;
+ /** Used to resolve the decompiled source of functions. */ var funcToString =
+ funcProto.toString;
+ /** Used to check objects for own properties. */ var hasOwnProperty =
+ objectProto.hasOwnProperty;
+ /** Used to detect if a method is native. */ var reIsNative = RegExp(
+ "^" +
+ funcToString
+ .call(hasOwnProperty)
+ .replace(reRegExpChar, "\\$&")
+ .replace(
+ /hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,
+ "$1.*?"
+ ) +
+ "$"
+ );
+ /**
+ * The base implementation of `_.isNative` without bad shim checks.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a native function,
+ * else `false`.
+ */ function baseIsNative(value) {
+ if (!isObject(value) || isMasked(value)) {
+ return false;
+ }
+ var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
+ return pattern.test(toSource(value));
+ }
+ module.exports = baseIsNative;
+ },
+ {
+ "./_isMasked": 96,
+ "./_toSource": 126,
+ "./isFunction": 136,
+ "./isObject": 138
+ }
+ ],
+ 59: [
+ function(require, module, exports) {
+ var baseGetTag = require("./_baseGetTag"),
+ isLength = require("./isLength"),
+ isObjectLike = require("./isObjectLike");
+ /** `Object#toString` result references. */ var argsTag =
+ "[object Arguments]",
+ arrayTag = "[object Array]",
+ boolTag = "[object Boolean]",
+ dateTag = "[object Date]",
+ errorTag = "[object Error]",
+ funcTag = "[object Function]",
+ mapTag = "[object Map]",
+ numberTag = "[object Number]",
+ objectTag = "[object Object]",
+ regexpTag = "[object RegExp]",
+ setTag = "[object Set]",
+ stringTag = "[object String]",
+ weakMapTag = "[object WeakMap]";
+ var arrayBufferTag = "[object ArrayBuffer]",
+ dataViewTag = "[object DataView]",
+ float32Tag = "[object Float32Array]",
+ float64Tag = "[object Float64Array]",
+ int8Tag = "[object Int8Array]",
+ int16Tag = "[object Int16Array]",
+ int32Tag = "[object Int32Array]",
+ uint8Tag = "[object Uint8Array]",
+ uint8ClampedTag = "[object Uint8ClampedArray]",
+ uint16Tag = "[object Uint16Array]",
+ uint32Tag = "[object Uint32Array]";
+ /** Used to identify `toStringTag` values of typed arrays. */ var typedArrayTags = {};
+ typedArrayTags[float32Tag] = typedArrayTags[
+ float64Tag
+ ] = typedArrayTags[int8Tag] = typedArrayTags[
+ int16Tag
+ ] = typedArrayTags[int32Tag] = typedArrayTags[
+ uint8Tag
+ ] = typedArrayTags[uint8ClampedTag] = typedArrayTags[
+ uint16Tag
+ ] = typedArrayTags[uint32Tag] = true;
+ typedArrayTags[argsTag] = typedArrayTags[arrayTag] = typedArrayTags[
+ arrayBufferTag
+ ] = typedArrayTags[boolTag] = typedArrayTags[
+ dataViewTag
+ ] = typedArrayTags[dateTag] = typedArrayTags[
+ errorTag
+ ] = typedArrayTags[funcTag] = typedArrayTags[mapTag] = typedArrayTags[
+ numberTag
+ ] = typedArrayTags[objectTag] = typedArrayTags[
+ regexpTag
+ ] = typedArrayTags[setTag] = typedArrayTags[
+ stringTag
+ ] = typedArrayTags[weakMapTag] = false;
+ /**
+ * The base implementation of `_.isTypedArray` without Node.js optimizations.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
+ */ function baseIsTypedArray(value) {
+ return (
+ isObjectLike(value) &&
+ isLength(value.length) &&
+ !!typedArrayTags[baseGetTag(value)]
+ );
+ }
+ module.exports = baseIsTypedArray;
+ },
+ { "./_baseGetTag": 56, "./isLength": 137, "./isObjectLike": 139 }
+ ],
+ 60: [
+ function(require, module, exports) {
+ var isObject = require("./isObject"),
+ isPrototype = require("./_isPrototype"),
+ nativeKeysIn = require("./_nativeKeysIn");
+ /** Used for built-in method references. */ var objectProto =
+ Object.prototype;
+ /** Used to check objects for own properties. */ var hasOwnProperty =
+ objectProto.hasOwnProperty;
+ /**
+ * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
+ *
+ * @private
+ * @param {Object} object The object to query.
+ * @returns {Array} Returns the array of property names.
+ */ function baseKeysIn(object) {
+ if (!isObject(object)) {
+ return nativeKeysIn(object);
+ }
+ var isProto = isPrototype(object),
+ result = [];
+ for (var key in object) {
+ if (
+ !(
+ key == "constructor" &&
+ (isProto || !hasOwnProperty.call(object, key))
+ )
+ ) {
+ result.push(key);
+ }
+ }
+ return result;
+ }
+ module.exports = baseKeysIn;
+ },
+ { "./_isPrototype": 97, "./_nativeKeysIn": 110, "./isObject": 138 }
+ ],
+ 61: [
+ function(require, module, exports) {
+ var Stack = require("./_Stack"),
+ assignMergeValue = require("./_assignMergeValue"),
+ baseFor = require("./_baseFor"),
+ baseMergeDeep = require("./_baseMergeDeep"),
+ isObject = require("./isObject"),
+ keysIn = require("./keysIn"),
+ safeGet = require("./_safeGet");
+ /**
+ * The base implementation of `_.merge` without support for multiple sources.
+ *
+ * @private
+ * @param {Object} object The destination object.
+ * @param {Object} source The source object.
+ * @param {number} srcIndex The index of `source`.
+ * @param {Function} [customizer] The function to customize merged values.
+ * @param {Object} [stack] Tracks traversed source values and their merged
+ * counterparts.
+ */ function baseMerge(object, source, srcIndex, customizer, stack) {
+ if (object === source) {
+ return;
+ }
+ baseFor(
+ source,
+ function(srcValue, key) {
+ if (isObject(srcValue)) {
+ stack || (stack = new Stack());
+ baseMergeDeep(
+ object,
+ source,
+ key,
+ srcIndex,
+ baseMerge,
+ customizer,
+ stack
+ );
+ } else {
+ var newValue = customizer
+ ? customizer(
+ safeGet(object, key),
+ srcValue,
+ key + "",
+ object,
+ source,
+ stack
+ )
+ : undefined;
+ if (newValue === undefined) {
+ newValue = srcValue;
+ }
+ assignMergeValue(object, key, newValue);
+ }
+ },
+ keysIn
+ );
+ }
+ module.exports = baseMerge;
+ },
+ {
+ "./_Stack": 44,
+ "./_assignMergeValue": 50,
+ "./_baseFor": 55,
+ "./_baseMergeDeep": 62,
+ "./_safeGet": 116,
+ "./isObject": 138,
+ "./keysIn": 143
+ }
+ ],
+ 62: [
+ function(require, module, exports) {
+ var assignMergeValue = require("./_assignMergeValue"),
+ cloneBuffer = require("./_cloneBuffer"),
+ cloneTypedArray = require("./_cloneTypedArray"),
+ copyArray = require("./_copyArray"),
+ initCloneObject = require("./_initCloneObject"),
+ isArguments = require("./isArguments"),
+ isArray = require("./isArray"),
+ isArrayLikeObject = require("./isArrayLikeObject"),
+ isBuffer = require("./isBuffer"),
+ isFunction = require("./isFunction"),
+ isObject = require("./isObject"),
+ isPlainObject = require("./isPlainObject"),
+ isTypedArray = require("./isTypedArray"),
+ safeGet = require("./_safeGet"),
+ toPlainObject = require("./toPlainObject");
+ /**
+ * A specialized version of `baseMerge` for arrays and objects which performs
+ * deep merges and tracks traversed objects enabling objects with circular
+ * references to be merged.
+ *
+ * @private
+ * @param {Object} object The destination object.
+ * @param {Object} source The source object.
+ * @param {string} key The key of the value to merge.
+ * @param {number} srcIndex The index of `source`.
+ * @param {Function} mergeFunc The function to merge values.
+ * @param {Function} [customizer] The function to customize assigned values.
+ * @param {Object} [stack] Tracks traversed source values and their merged
+ * counterparts.
+ */ function baseMergeDeep(
+ object,
+ source,
+ key,
+ srcIndex,
+ mergeFunc,
+ customizer,
+ stack
+ ) {
+ var objValue = safeGet(object, key),
+ srcValue = safeGet(source, key),
+ stacked = stack.get(srcValue);
+ if (stacked) {
+ assignMergeValue(object, key, stacked);
+ return;
+ }
+ var newValue = customizer
+ ? customizer(objValue, srcValue, key + "", object, source, stack)
+ : undefined;
+ var isCommon = newValue === undefined;
+ if (isCommon) {
+ var isArr = isArray(srcValue),
+ isBuff = !isArr && isBuffer(srcValue),
+ isTyped = !isArr && !isBuff && isTypedArray(srcValue);
+ newValue = srcValue;
+ if (isArr || isBuff || isTyped) {
+ if (isArray(objValue)) {
+ newValue = objValue;
+ } else if (isArrayLikeObject(objValue)) {
+ newValue = copyArray(objValue);
+ } else if (isBuff) {
+ isCommon = false;
+ newValue = cloneBuffer(srcValue, true);
+ } else if (isTyped) {
+ isCommon = false;
+ newValue = cloneTypedArray(srcValue, true);
+ } else {
+ newValue = [];
+ }
+ } else if (isPlainObject(srcValue) || isArguments(srcValue)) {
+ newValue = objValue;
+ if (isArguments(objValue)) {
+ newValue = toPlainObject(objValue);
+ } else if (
+ !isObject(objValue) ||
+ (srcIndex && isFunction(objValue))
+ ) {
+ newValue = initCloneObject(srcValue);
+ }
+ } else {
+ isCommon = false;
+ }
+ }
+ if (isCommon) {
+ // Recursively merge objects and arrays (susceptible to call stack limits).
+ stack.set(srcValue, newValue);
+ mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
+ stack["delete"](srcValue);
+ }
+ assignMergeValue(object, key, newValue);
+ }
+ module.exports = baseMergeDeep;
+ },
+ {
+ "./_assignMergeValue": 50,
+ "./_cloneBuffer": 71,
+ "./_cloneTypedArray": 72,
+ "./_copyArray": 73,
+ "./_initCloneObject": 91,
+ "./_safeGet": 116,
+ "./isArguments": 131,
+ "./isArray": 132,
+ "./isArrayLikeObject": 134,
+ "./isBuffer": 135,
+ "./isFunction": 136,
+ "./isObject": 138,
+ "./isPlainObject": 140,
+ "./isTypedArray": 142,
+ "./toPlainObject": 149
+ }
+ ],
+ 63: [
+ function(require, module, exports) {
+ var identity = require("./identity"),
+ overRest = require("./_overRest"),
+ setToString = require("./_setToString");
+ /**
+ * The base implementation of `_.rest` which doesn't validate or coerce arguments.
+ *
+ * @private
+ * @param {Function} func The function to apply a rest parameter to.
+ * @param {number} [start=func.length-1] The start position of the rest parameter.
+ * @returns {Function} Returns the new function.
+ */ function baseRest(func, start) {
+ return setToString(overRest(func, start, identity), func + "");
+ }
+ module.exports = baseRest;
+ },
+ { "./_overRest": 114, "./_setToString": 117, "./identity": 130 }
+ ],
+ 64: [
+ function(require, module, exports) {
+ var assignValue = require("./_assignValue"),
+ castPath = require("./_castPath"),
+ isIndex = require("./_isIndex"),
+ isObject = require("./isObject"),
+ toKey = require("./_toKey");
+ /**
+ * The base implementation of `_.set`.
+ *
+ * @private
+ * @param {Object} object The object to modify.
+ * @param {Array|string} path The path of the property to set.
+ * @param {*} value The value to set.
+ * @param {Function} [customizer] The function to customize path creation.
+ * @returns {Object} Returns `object`.
+ */ function baseSet(object, path, value, customizer) {
+ if (!isObject(object)) {
+ return object;
+ }
+ path = castPath(path, object);
+ var index = -1,
+ length = path.length,
+ lastIndex = length - 1,
+ nested = object;
+ while (nested != null && ++index < length) {
+ var key = toKey(path[index]),
+ newValue = value;
+ if (index != lastIndex) {
+ var objValue = nested[key];
+ newValue = customizer
+ ? customizer(objValue, key, nested)
+ : undefined;
+ if (newValue === undefined) {
+ newValue = isObject(objValue)
+ ? objValue
+ : isIndex(path[index + 1]) ? [] : {};
+ }
+ }
+ assignValue(nested, key, newValue);
+ nested = nested[key];
+ }
+ return object;
+ }
+ module.exports = baseSet;
+ },
+ {
+ "./_assignValue": 51,
+ "./_castPath": 69,
+ "./_isIndex": 92,
+ "./_toKey": 125,
+ "./isObject": 138
+ }
+ ],
+ 65: [
+ function(require, module, exports) {
+ var constant = require("./constant"),
+ defineProperty = require("./_defineProperty"),
+ identity = require("./identity");
+ /**
+ * The base implementation of `setToString` without support for hot loop shorting.
+ *
+ * @private
+ * @param {Function} func The function to modify.
+ * @param {Function} string The `toString` result.
+ * @returns {Function} Returns `func`.
+ */ var baseSetToString = !defineProperty
+ ? identity
+ : function(func, string) {
+ return defineProperty(func, "toString", {
+ configurable: true,
+ enumerable: false,
+ value: constant(string),
+ writable: true
+ });
+ };
+ module.exports = baseSetToString;
+ },
+ { "./_defineProperty": 79, "./constant": 127, "./identity": 130 }
+ ],
+ 66: [
+ function(require, module, exports) {
+ /**
+ * The base implementation of `_.times` without support for iteratee shorthands
+ * or max array length checks.
+ *
+ * @private
+ * @param {number} n The number of times to invoke `iteratee`.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @returns {Array} Returns the array of results.
+ */ function baseTimes(n, iteratee) {
+ var index = -1,
+ result = Array(n);
+ while (++index < n) {
+ result[index] = iteratee(index);
+ }
+ return result;
+ }
+ module.exports = baseTimes;
+ },
+ {}
+ ],
+ 67: [
+ function(require, module, exports) {
+ var _Symbol3 = require("./_Symbol"),
+ arrayMap = require("./_arrayMap"),
+ isArray = require("./isArray"),
+ isSymbol = require("./isSymbol");
+ /** Used as references for various `Number` constants. */ var INFINITY =
+ 1 / 0;
+ /** Used to convert symbols to primitives and strings. */ var symbolProto = _Symbol3
+ ? _Symbol3.prototype
+ : undefined,
+ symbolToString = symbolProto ? symbolProto.toString : undefined;
+ /**
+ * The base implementation of `_.toString` which doesn't convert nullish
+ * values to empty strings.
+ *
+ * @private
+ * @param {*} value The value to process.
+ * @returns {string} Returns the string.
+ */ function baseToString(value) {
+ // Exit early for strings to avoid a performance hit in some environments.
+ if (typeof value == "string") {
+ return value;
+ }
+ if (isArray(value)) {
+ // Recursively convert values (susceptible to call stack limits).
+ return arrayMap(value, baseToString) + "";
+ }
+ if (isSymbol(value)) {
+ return symbolToString ? symbolToString.call(value) : "";
+ }
+ var result = value + "";
+ return result == "0" && 1 / value == -INFINITY ? "-0" : result;
+ }
+ module.exports = baseToString;
+ },
+ {
+ "./_Symbol": 45,
+ "./_arrayMap": 49,
+ "./isArray": 132,
+ "./isSymbol": 141
+ }
+ ],
+ 68: [
+ function(require, module, exports) {
+ /**
+ * The base implementation of `_.unary` without support for storing metadata.
+ *
+ * @private
+ * @param {Function} func The function to cap arguments for.
+ * @returns {Function} Returns the new capped function.
+ */ function baseUnary(func) {
+ return function(value) {
+ return func(value);
+ };
+ }
+ module.exports = baseUnary;
+ },
+ {}
+ ],
+ 69: [
+ function(require, module, exports) {
+ var isArray = require("./isArray"),
+ isKey = require("./_isKey"),
+ stringToPath = require("./_stringToPath"),
+ toString = require("./toString");
+ /**
+ * Casts `value` to a path array if it's not one.
+ *
+ * @private
+ * @param {*} value The value to inspect.
+ * @param {Object} [object] The object to query keys on.
+ * @returns {Array} Returns the cast property path array.
+ */ function castPath(value, object) {
+ if (isArray(value)) {
+ return value;
+ }
+ return isKey(value, object)
+ ? [value]
+ : stringToPath(toString(value));
+ }
+ module.exports = castPath;
+ },
+ {
+ "./_isKey": 94,
+ "./_stringToPath": 124,
+ "./isArray": 132,
+ "./toString": 150
+ }
+ ],
+ 70: [
+ function(require, module, exports) {
+ var Uint8Array = require("./_Uint8Array");
+ /**
+ * Creates a clone of `arrayBuffer`.
+ *
+ * @private
+ * @param {ArrayBuffer} arrayBuffer The array buffer to clone.
+ * @returns {ArrayBuffer} Returns the cloned array buffer.
+ */ function cloneArrayBuffer(arrayBuffer) {
+ var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
+ new Uint8Array(result).set(new Uint8Array(arrayBuffer));
+ return result;
+ }
+ module.exports = cloneArrayBuffer;
+ },
+ { "./_Uint8Array": 46 }
+ ],
+ 71: [
+ function(require, module, exports) {
+ var root = require("./_root");
+ /** Detect free variable `exports`. */ var freeExports =
+ (typeof exports === "undefined" ? "undefined" : _typeof(exports)) ==
+ "object" &&
+ exports &&
+ !exports.nodeType &&
+ exports;
+ /** Detect free variable `module`. */ var freeModule =
+ freeExports &&
+ (typeof module === "undefined" ? "undefined" : _typeof(module)) ==
+ "object" &&
+ module &&
+ !module.nodeType &&
+ module;
+ /** Detect the popular CommonJS extension `module.exports`. */ var moduleExports =
+ freeModule && freeModule.exports === freeExports;
+ /** Built-in value references. */ var Buffer = moduleExports
+ ? root.Buffer
+ : undefined,
+ allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined;
+ /**
+ * Creates a clone of `buffer`.
+ *
+ * @private
+ * @param {Buffer} buffer The buffer to clone.
+ * @param {boolean} [isDeep] Specify a deep clone.
+ * @returns {Buffer} Returns the cloned buffer.
+ */ function cloneBuffer(buffer, isDeep) {
+ if (isDeep) {
+ return buffer.slice();
+ }
+ var length = buffer.length,
+ result = allocUnsafe
+ ? allocUnsafe(length)
+ : new buffer.constructor(length);
+ buffer.copy(result);
+ return result;
+ }
+ module.exports = cloneBuffer;
+ },
+ { "./_root": 115 }
+ ],
+ 72: [
+ function(require, module, exports) {
+ var cloneArrayBuffer = require("./_cloneArrayBuffer");
+ /**
+ * Creates a clone of `typedArray`.
+ *
+ * @private
+ * @param {Object} typedArray The typed array to clone.
+ * @param {boolean} [isDeep] Specify a deep clone.
+ * @returns {Object} Returns the cloned typed array.
+ */ function cloneTypedArray(typedArray, isDeep) {
+ var buffer = isDeep
+ ? cloneArrayBuffer(typedArray.buffer)
+ : typedArray.buffer;
+ return new typedArray.constructor(
+ buffer,
+ typedArray.byteOffset,
+ typedArray.length
+ );
+ }
+ module.exports = cloneTypedArray;
+ },
+ { "./_cloneArrayBuffer": 70 }
+ ],
+ 73: [
+ function(require, module, exports) {
+ /**
+ * Copies the values of `source` to `array`.
+ *
+ * @private
+ * @param {Array} source The array to copy values from.
+ * @param {Array} [array=[]] The array to copy values to.
+ * @returns {Array} Returns `array`.
+ */ function copyArray(source, array) {
+ var index = -1,
+ length = source.length;
+ array || (array = Array(length));
+ while (++index < length) {
+ array[index] = source[index];
+ }
+ return array;
+ }
+ module.exports = copyArray;
+ },
+ {}
+ ],
+ 74: [
+ function(require, module, exports) {
+ var assignValue = require("./_assignValue"),
+ baseAssignValue = require("./_baseAssignValue");
+ /**
+ * Copies properties of `source` to `object`.
+ *
+ * @private
+ * @param {Object} source The object to copy properties from.
+ * @param {Array} props The property identifiers to copy.
+ * @param {Object} [object={}] The object to copy properties to.
+ * @param {Function} [customizer] The function to customize copied values.
+ * @returns {Object} Returns `object`.
+ */ function copyObject(source, props, object, customizer) {
+ var isNew = !object;
+ object || (object = {});
+ var index = -1,
+ length = props.length;
+ while (++index < length) {
+ var key = props[index];
+ var newValue = customizer
+ ? customizer(object[key], source[key], key, object, source)
+ : undefined;
+ if (newValue === undefined) {
+ newValue = source[key];
+ }
+ if (isNew) {
+ baseAssignValue(object, key, newValue);
+ } else {
+ assignValue(object, key, newValue);
+ }
+ }
+ return object;
+ }
+ module.exports = copyObject;
+ },
+ { "./_assignValue": 51, "./_baseAssignValue": 53 }
+ ],
+ 75: [
+ function(require, module, exports) {
+ var root = require("./_root");
+ /** Used to detect overreaching core-js shims. */ var coreJsData =
+ root["__core-js_shared__"];
+ module.exports = coreJsData;
+ },
+ { "./_root": 115 }
+ ],
+ 76: [
+ function(require, module, exports) {
+ var baseRest = require("./_baseRest"),
+ isIterateeCall = require("./_isIterateeCall");
+ /**
+ * Creates a function like `_.assign`.
+ *
+ * @private
+ * @param {Function} assigner The function to assign values.
+ * @returns {Function} Returns the new assigner function.
+ */ function createAssigner(assigner) {
+ return baseRest(function(object, sources) {
+ var index = -1,
+ length = sources.length,
+ customizer = length > 1 ? sources[length - 1] : undefined,
+ guard = length > 2 ? sources[2] : undefined;
+ customizer =
+ assigner.length > 3 && typeof customizer == "function"
+ ? (length--, customizer)
+ : undefined;
+ if (guard && isIterateeCall(sources[0], sources[1], guard)) {
+ customizer = length < 3 ? undefined : customizer;
+ length = 1;
+ }
+ object = Object(object);
+ while (++index < length) {
+ var source = sources[index];
+ if (source) {
+ assigner(object, source, index, customizer);
+ }
+ }
+ return object;
+ });
+ }
+ module.exports = createAssigner;
+ },
+ { "./_baseRest": 63, "./_isIterateeCall": 93 }
+ ],
+ 77: [
+ function(require, module, exports) {
+ /**
+ * Creates a base function for methods like `_.forIn` and `_.forOwn`.
+ *
+ * @private
+ * @param {boolean} [fromRight] Specify iterating from right to left.
+ * @returns {Function} Returns the new base function.
+ */ function createBaseFor(fromRight) {
+ return function(object, iteratee, keysFunc) {
+ var index = -1,
+ iterable = Object(object),
+ props = keysFunc(object),
+ length = props.length;
+ while (length--) {
+ var key = props[fromRight ? length : ++index];
+ if (iteratee(iterable[key], key, iterable) === false) {
+ break;
+ }
+ }
+ return object;
+ };
+ }
+ module.exports = createBaseFor;
+ },
+ {}
+ ],
+ 78: [
+ function(require, module, exports) {
+ var baseMerge = require("./_baseMerge"),
+ isObject = require("./isObject");
+ /**
+ * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source
+ * objects into destination objects that are passed thru.
+ *
+ * @private
+ * @param {*} objValue The destination value.
+ * @param {*} srcValue The source value.
+ * @param {string} key The key of the property to merge.
+ * @param {Object} object The parent object of `objValue`.
+ * @param {Object} source The parent object of `srcValue`.
+ * @param {Object} [stack] Tracks traversed source values and their merged
+ * counterparts.
+ * @returns {*} Returns the value to assign.
+ */ function customDefaultsMerge(
+ objValue,
+ srcValue,
+ key,
+ object,
+ source,
+ stack
+ ) {
+ if (isObject(objValue) && isObject(srcValue)) {
+ // Recursively merge objects and arrays (susceptible to call stack limits).
+ stack.set(srcValue, objValue);
+ baseMerge(
+ objValue,
+ srcValue,
+ undefined,
+ customDefaultsMerge,
+ stack
+ );
+ stack["delete"](srcValue);
+ }
+ return objValue;
+ }
+ module.exports = customDefaultsMerge;
+ },
+ { "./_baseMerge": 61, "./isObject": 138 }
+ ],
+ 79: [
+ function(require, module, exports) {
+ var getNative = require("./_getNative");
+ var defineProperty = (function() {
+ try {
+ var func = getNative(Object, "defineProperty");
+ func({}, "", {});
+ return func;
+ } catch (e) {}
+ })();
+ module.exports = defineProperty;
+ },
+ { "./_getNative": 82 }
+ ],
+ 80: [
+ function(require, module, exports) {
+ /** Detect free variable `global` from Node.js. */ var freeGlobal =
+ (typeof global === "undefined" ? "undefined" : _typeof(global)) ==
+ "object" &&
+ global &&
+ global.Object === Object &&
+ global;
+ module.exports = freeGlobal;
+ },
+ {}
+ ],
+ 81: [
+ function(require, module, exports) {
+ var isKeyable = require("./_isKeyable");
+ /**
+ * Gets the data for `map`.
+ *
+ * @private
+ * @param {Object} map The map to query.
+ * @param {string} key The reference key.
+ * @returns {*} Returns the map data.
+ */ function getMapData(map, key) {
+ var data = map.__data__;
+ return isKeyable(key)
+ ? data[typeof key == "string" ? "string" : "hash"]
+ : data.map;
+ }
+ module.exports = getMapData;
+ },
+ { "./_isKeyable": 95 }
+ ],
+ 82: [
+ function(require, module, exports) {
+ var baseIsNative = require("./_baseIsNative"),
+ getValue = require("./_getValue");
+ /**
+ * Gets the native function at `key` of `object`.
+ *
+ * @private
+ * @param {Object} object The object to query.
+ * @param {string} key The key of the method to get.
+ * @returns {*} Returns the function if it's native, else `undefined`.
+ */ function getNative(object, key) {
+ var value = getValue(object, key);
+ return baseIsNative(value) ? value : undefined;
+ }
+ module.exports = getNative;
+ },
+ { "./_baseIsNative": 58, "./_getValue": 85 }
+ ],
+ 83: [
+ function(require, module, exports) {
+ var overArg = require("./_overArg");
+ /** Built-in value references. */ var getPrototype = overArg(
+ Object.getPrototypeOf,
+ Object
+ );
+ module.exports = getPrototype;
+ },
+ { "./_overArg": 113 }
+ ],
+ 84: [
+ function(require, module, exports) {
+ var _Symbol4 = require("./_Symbol");
+ /** Used for built-in method references. */ var objectProto =
+ Object.prototype;
+ /** Used to check objects for own properties. */ var hasOwnProperty =
+ objectProto.hasOwnProperty;
+ /**
+ * Used to resolve the
+ * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
+ * of values.
+ */ var nativeObjectToString = objectProto.toString;
+ /** Built-in value references. */ var symToStringTag = _Symbol4
+ ? _Symbol4.toStringTag
+ : undefined;
+ /**
+ * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
+ *
+ * @private
+ * @param {*} value The value to query.
+ * @returns {string} Returns the raw `toStringTag`.
+ */ function getRawTag(value) {
+ var isOwn = hasOwnProperty.call(value, symToStringTag),
+ tag = value[symToStringTag];
+ try {
+ value[symToStringTag] = undefined;
+ var unmasked = true;
+ } catch (e) {}
+ var result = nativeObjectToString.call(value);
+ if (unmasked) {
+ if (isOwn) {
+ value[symToStringTag] = tag;
+ } else {
+ delete value[symToStringTag];
+ }
+ }
+ return result;
+ }
+ module.exports = getRawTag;
+ },
+ { "./_Symbol": 45 }
+ ],
+ 85: [
+ function(require, module, exports) {
+ /**
+ * Gets the value at `key` of `object`.
+ *
+ * @private
+ * @param {Object} [object] The object to query.
+ * @param {string} key The key of the property to get.
+ * @returns {*} Returns the property value.
+ */ function getValue(object, key) {
+ return object == null ? undefined : object[key];
+ }
+ module.exports = getValue;
+ },
+ {}
+ ],
+ 86: [
+ function(require, module, exports) {
+ var nativeCreate = require("./_nativeCreate");
+ /**
+ * Removes all key-value entries from the hash.
+ *
+ * @private
+ * @name clear
+ * @memberOf Hash
+ */ function hashClear() {
+ this.__data__ = nativeCreate ? nativeCreate(null) : {};
+ this.size = 0;
+ }
+ module.exports = hashClear;
+ },
+ { "./_nativeCreate": 109 }
+ ],
+ 87: [
+ function(require, module, exports) {
+ /**
+ * Removes `key` and its value from the hash.
+ *
+ * @private
+ * @name delete
+ * @memberOf Hash
+ * @param {Object} hash The hash to modify.
+ * @param {string} key The key of the value to remove.
+ * @returns {boolean} Returns `true` if the entry was removed, else `false`.
+ */ function hashDelete(key) {
+ var result = this.has(key) && delete this.__data__[key];
+ this.size -= result ? 1 : 0;
+ return result;
+ }
+ module.exports = hashDelete;
+ },
+ {}
+ ],
+ 88: [
+ function(require, module, exports) {
+ var nativeCreate = require("./_nativeCreate");
+ /** Used to stand-in for `undefined` hash values. */ var HASH_UNDEFINED =
+ "__lodash_hash_undefined__";
+ /** Used for built-in method references. */ var objectProto =
+ Object.prototype;
+ /** Used to check objects for own properties. */ var hasOwnProperty =
+ objectProto.hasOwnProperty;
+ /**
+ * Gets the hash value for `key`.
+ *
+ * @private
+ * @name get
+ * @memberOf Hash
+ * @param {string} key The key of the value to get.
+ * @returns {*} Returns the entry value.
+ */ function hashGet(key) {
+ var data = this.__data__;
+ if (nativeCreate) {
+ var result = data[key];
+ return result === HASH_UNDEFINED ? undefined : result;
+ }
+ return hasOwnProperty.call(data, key) ? data[key] : undefined;
+ }
+ module.exports = hashGet;
+ },
+ { "./_nativeCreate": 109 }
+ ],
+ 89: [
+ function(require, module, exports) {
+ var nativeCreate = require("./_nativeCreate");
+ /** Used for built-in method references. */ var objectProto =
+ Object.prototype;
+ /** Used to check objects for own properties. */ var hasOwnProperty =
+ objectProto.hasOwnProperty;
+ /**
+ * Checks if a hash value for `key` exists.
+ *
+ * @private
+ * @name has
+ * @memberOf Hash
+ * @param {string} key The key of the entry to check.
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
+ */ function hashHas(key) {
+ var data = this.__data__;
+ return nativeCreate
+ ? data[key] !== undefined
+ : hasOwnProperty.call(data, key);
+ }
+ module.exports = hashHas;
+ },
+ { "./_nativeCreate": 109 }
+ ],
+ 90: [
+ function(require, module, exports) {
+ var nativeCreate = require("./_nativeCreate");
+ /** Used to stand-in for `undefined` hash values. */ var HASH_UNDEFINED =
+ "__lodash_hash_undefined__";
+ /**
+ * Sets the hash `key` to `value`.
+ *
+ * @private
+ * @name set
+ * @memberOf Hash
+ * @param {string} key The key of the value to set.
+ * @param {*} value The value to set.
+ * @returns {Object} Returns the hash instance.
+ */ function hashSet(key, value) {
+ var data = this.__data__;
+ this.size += this.has(key) ? 0 : 1;
+ data[key] =
+ nativeCreate && value === undefined ? HASH_UNDEFINED : value;
+ return this;
+ }
+ module.exports = hashSet;
+ },
+ { "./_nativeCreate": 109 }
+ ],
+ 91: [
+ function(require, module, exports) {
+ var baseCreate = require("./_baseCreate"),
+ getPrototype = require("./_getPrototype"),
+ isPrototype = require("./_isPrototype");
+ /**
+ * Initializes an object clone.
+ *
+ * @private
+ * @param {Object} object The object to clone.
+ * @returns {Object} Returns the initialized clone.
+ */ function initCloneObject(object) {
+ return typeof object.constructor == "function" &&
+ !isPrototype(object)
+ ? baseCreate(getPrototype(object))
+ : {};
+ }
+ module.exports = initCloneObject;
+ },
+ { "./_baseCreate": 54, "./_getPrototype": 83, "./_isPrototype": 97 }
+ ],
+ 92: [
+ function(require, module, exports) {
+ /** Used as references for various `Number` constants. */ var MAX_SAFE_INTEGER = 9007199254740991;
+ /** Used to detect unsigned integer values. */ var reIsUint = /^(?:0|[1-9]\d*)$/;
+ /**
+ * Checks if `value` is a valid array-like index.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
+ * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
+ */ function isIndex(value, length) {
+ var type =
+ typeof value === "undefined" ? "undefined" : _typeof(value);
+ length = length == null ? MAX_SAFE_INTEGER : length;
+ return (
+ !!length &&
+ (type == "number" ||
+ (type != "symbol" && reIsUint.test(value))) &&
+ value > -1 &&
+ value % 1 == 0 &&
+ value < length
+ );
+ }
+ module.exports = isIndex;
+ },
+ {}
+ ],
+ 93: [
+ function(require, module, exports) {
+ var eq = require("./eq"),
+ isArrayLike = require("./isArrayLike"),
+ isIndex = require("./_isIndex"),
+ isObject = require("./isObject");
+ /**
+ * Checks if the given arguments are from an iteratee call.
+ *
+ * @private
+ * @param {*} value The potential iteratee value argument.
+ * @param {*} index The potential iteratee index or key argument.
+ * @param {*} object The potential iteratee object argument.
+ * @returns {boolean} Returns `true` if the arguments are from an iteratee call,
+ * else `false`.
+ */ function isIterateeCall(value, index, object) {
+ if (!isObject(object)) {
+ return false;
+ }
+ var type =
+ typeof index === "undefined" ? "undefined" : _typeof(index);
+ if (
+ type == "number"
+ ? isArrayLike(object) && isIndex(index, object.length)
+ : type == "string" && index in object
+ ) {
+ return eq(object[index], value);
+ }
+ return false;
+ }
+ module.exports = isIterateeCall;
+ },
+ {
+ "./_isIndex": 92,
+ "./eq": 129,
+ "./isArrayLike": 133,
+ "./isObject": 138
+ }
+ ],
+ 94: [
+ function(require, module, exports) {
+ var isArray = require("./isArray"),
+ isSymbol = require("./isSymbol");
+ /** Used to match property names within property paths. */ var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
+ reIsPlainProp = /^\w*$/;
+ /**
+ * Checks if `value` is a property name and not a property path.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @param {Object} [object] The object to query keys on.
+ * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
+ */ function isKey(value, object) {
+ if (isArray(value)) {
+ return false;
+ }
+ var type =
+ typeof value === "undefined" ? "undefined" : _typeof(value);
+ if (
+ type == "number" ||
+ type == "symbol" ||
+ type == "boolean" ||
+ value == null ||
+ isSymbol(value)
+ ) {
+ return true;
+ }
+ return (
+ reIsPlainProp.test(value) ||
+ !reIsDeepProp.test(value) ||
+ (object != null && value in Object(object))
+ );
+ }
+ module.exports = isKey;
+ },
+ { "./isArray": 132, "./isSymbol": 141 }
+ ],
+ 95: [
+ function(require, module, exports) {
+ /**
+ * Checks if `value` is suitable for use as unique object key.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
+ */ function isKeyable(value) {
+ var type =
+ typeof value === "undefined" ? "undefined" : _typeof(value);
+ return type == "string" ||
+ type == "number" ||
+ type == "symbol" ||
+ type == "boolean"
+ ? value !== "__proto__"
+ : value === null;
+ }
+ module.exports = isKeyable;
+ },
+ {}
+ ],
+ 96: [
+ function(require, module, exports) {
+ var coreJsData = require("./_coreJsData");
+ /** Used to detect methods masquerading as native. */ var maskSrcKey = (function() {
+ var uid = /[^.]+$/.exec(
+ (coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO) || ""
+ );
+ return uid ? "Symbol(src)_1." + uid : "";
+ })();
+ /**
+ * Checks if `func` has its source masked.
+ *
+ * @private
+ * @param {Function} func The function to check.
+ * @returns {boolean} Returns `true` if `func` is masked, else `false`.
+ */ function isMasked(func) {
+ return !!maskSrcKey && maskSrcKey in func;
+ }
+ module.exports = isMasked;
+ },
+ { "./_coreJsData": 75 }
+ ],
+ 97: [
+ function(require, module, exports) {
+ /** Used for built-in method references. */ var objectProto =
+ Object.prototype;
+ /**
+ * Checks if `value` is likely a prototype object.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
+ */ function isPrototype(value) {
+ var Ctor = value && value.constructor,
+ proto =
+ (typeof Ctor == "function" && Ctor.prototype) || objectProto;
+ return value === proto;
+ }
+ module.exports = isPrototype;
+ },
+ {}
+ ],
+ 98: [
+ function(require, module, exports) {
+ /**
+ * Removes all key-value entries from the list cache.
+ *
+ * @private
+ * @name clear
+ * @memberOf ListCache
+ */ function listCacheClear() {
+ this.__data__ = [];
+ this.size = 0;
+ }
+ module.exports = listCacheClear;
+ },
+ {}
+ ],
+ 99: [
+ function(require, module, exports) {
+ var assocIndexOf = require("./_assocIndexOf");
+ /** Used for built-in method references. */ var arrayProto =
+ Array.prototype;
+ /** Built-in value references. */ var splice = arrayProto.splice;
+ /**
+ * Removes `key` and its value from the list cache.
+ *
+ * @private
+ * @name delete
+ * @memberOf ListCache
+ * @param {string} key The key of the value to remove.
+ * @returns {boolean} Returns `true` if the entry was removed, else `false`.
+ */ function listCacheDelete(key) {
+ var data = this.__data__,
+ index = assocIndexOf(data, key);
+ if (index < 0) {
+ return false;
+ }
+ var lastIndex = data.length - 1;
+ if (index == lastIndex) {
+ data.pop();
+ } else {
+ splice.call(data, index, 1);
+ }
+ --this.size;
+ return true;
+ }
+ module.exports = listCacheDelete;
+ },
+ { "./_assocIndexOf": 52 }
+ ],
+ 100: [
+ function(require, module, exports) {
+ var assocIndexOf = require("./_assocIndexOf");
+ /**
+ * Gets the list cache value for `key`.
+ *
+ * @private
+ * @name get
+ * @memberOf ListCache
+ * @param {string} key The key of the value to get.
+ * @returns {*} Returns the entry value.
+ */ function listCacheGet(key) {
+ var data = this.__data__,
+ index = assocIndexOf(data, key);
+ return index < 0 ? undefined : data[index][1];
+ }
+ module.exports = listCacheGet;
+ },
+ { "./_assocIndexOf": 52 }
+ ],
+ 101: [
+ function(require, module, exports) {
+ var assocIndexOf = require("./_assocIndexOf");
+ /**
+ * Checks if a list cache value for `key` exists.
+ *
+ * @private
+ * @name has
+ * @memberOf ListCache
+ * @param {string} key The key of the entry to check.
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
+ */ function listCacheHas(key) {
+ return assocIndexOf(this.__data__, key) > -1;
+ }
+ module.exports = listCacheHas;
+ },
+ { "./_assocIndexOf": 52 }
+ ],
+ 102: [
+ function(require, module, exports) {
+ var assocIndexOf = require("./_assocIndexOf");
+ /**
+ * Sets the list cache `key` to `value`.
+ *
+ * @private
+ * @name set
+ * @memberOf ListCache
+ * @param {string} key The key of the value to set.
+ * @param {*} value The value to set.
+ * @returns {Object} Returns the list cache instance.
+ */ function listCacheSet(key, value) {
+ var data = this.__data__,
+ index = assocIndexOf(data, key);
+ if (index < 0) {
+ ++this.size;
+ data.push([key, value]);
+ } else {
+ data[index][1] = value;
+ }
+ return this;
+ }
+ module.exports = listCacheSet;
+ },
+ { "./_assocIndexOf": 52 }
+ ],
+ 103: [
+ function(require, module, exports) {
+ var Hash = require("./_Hash"),
+ ListCache = require("./_ListCache"),
+ Map = require("./_Map");
+ /**
+ * Removes all key-value entries from the map.
+ *
+ * @private
+ * @name clear
+ * @memberOf MapCache
+ */ function mapCacheClear() {
+ this.size = 0;
+ this.__data__ = {
+ hash: new Hash(),
+ map: new (Map || ListCache)(),
+ string: new Hash()
+ };
+ }
+ module.exports = mapCacheClear;
+ },
+ { "./_Hash": 40, "./_ListCache": 41, "./_Map": 42 }
+ ],
+ 104: [
+ function(require, module, exports) {
+ var getMapData = require("./_getMapData");
+ /**
+ * Removes `key` and its value from the map.
+ *
+ * @private
+ * @name delete
+ * @memberOf MapCache
+ * @param {string} key The key of the value to remove.
+ * @returns {boolean} Returns `true` if the entry was removed, else `false`.
+ */ function mapCacheDelete(key) {
+ var result = getMapData(this, key)["delete"](key);
+ this.size -= result ? 1 : 0;
+ return result;
+ }
+ module.exports = mapCacheDelete;
+ },
+ { "./_getMapData": 81 }
+ ],
+ 105: [
+ function(require, module, exports) {
+ var getMapData = require("./_getMapData");
+ /**
+ * Gets the map value for `key`.
+ *
+ * @private
+ * @name get
+ * @memberOf MapCache
+ * @param {string} key The key of the value to get.
+ * @returns {*} Returns the entry value.
+ */ function mapCacheGet(key) {
+ return getMapData(this, key).get(key);
+ }
+ module.exports = mapCacheGet;
+ },
+ { "./_getMapData": 81 }
+ ],
+ 106: [
+ function(require, module, exports) {
+ var getMapData = require("./_getMapData");
+ /**
+ * Checks if a map value for `key` exists.
+ *
+ * @private
+ * @name has
+ * @memberOf MapCache
+ * @param {string} key The key of the entry to check.
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
+ */ function mapCacheHas(key) {
+ return getMapData(this, key).has(key);
+ }
+ module.exports = mapCacheHas;
+ },
+ { "./_getMapData": 81 }
+ ],
+ 107: [
+ function(require, module, exports) {
+ var getMapData = require("./_getMapData");
+ /**
+ * Sets the map `key` to `value`.
+ *
+ * @private
+ * @name set
+ * @memberOf MapCache
+ * @param {string} key The key of the value to set.
+ * @param {*} value The value to set.
+ * @returns {Object} Returns the map cache instance.
+ */ function mapCacheSet(key, value) {
+ var data = getMapData(this, key),
+ size = data.size;
+ data.set(key, value);
+ this.size += data.size == size ? 0 : 1;
+ return this;
+ }
+ module.exports = mapCacheSet;
+ },
+ { "./_getMapData": 81 }
+ ],
+ 108: [
+ function(require, module, exports) {
+ var memoize = require("./memoize");
+ /** Used as the maximum memoize cache size. */ var MAX_MEMOIZE_SIZE = 500;
+ /**
+ * A specialized version of `_.memoize` which clears the memoized function's
+ * cache when it exceeds `MAX_MEMOIZE_SIZE`.
+ *
+ * @private
+ * @param {Function} func The function to have its output memoized.
+ * @returns {Function} Returns the new memoized function.
+ */ function memoizeCapped(func) {
+ var result = memoize(func, function(key) {
+ if (cache.size === MAX_MEMOIZE_SIZE) {
+ cache.clear();
+ }
+ return key;
+ });
+ var cache = result.cache;
+ return result;
+ }
+ module.exports = memoizeCapped;
+ },
+ { "./memoize": 145 }
+ ],
+ 109: [
+ function(require, module, exports) {
+ var getNative = require("./_getNative");
+ /* Built-in method references that are verified to be native. */ var nativeCreate = getNative(
+ Object,
+ "create"
+ );
+ module.exports = nativeCreate;
+ },
+ { "./_getNative": 82 }
+ ],
+ 110: [
+ function(require, module, exports) {
+ /**
+ * This function is like
+ * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
+ * except that it includes inherited enumerable properties.
+ *
+ * @private
+ * @param {Object} object The object to query.
+ * @returns {Array} Returns the array of property names.
+ */ function nativeKeysIn(object) {
+ var result = [];
+ if (object != null) {
+ for (var key in Object(object)) {
+ result.push(key);
+ }
+ }
+ return result;
+ }
+ module.exports = nativeKeysIn;
+ },
+ {}
+ ],
+ 111: [
+ function(require, module, exports) {
+ var freeGlobal = require("./_freeGlobal");
+ /** Detect free variable `exports`. */ var freeExports =
+ (typeof exports === "undefined" ? "undefined" : _typeof(exports)) ==
+ "object" &&
+ exports &&
+ !exports.nodeType &&
+ exports;
+ /** Detect free variable `module`. */ var freeModule =
+ freeExports &&
+ (typeof module === "undefined" ? "undefined" : _typeof(module)) ==
+ "object" &&
+ module &&
+ !module.nodeType &&
+ module;
+ /** Detect the popular CommonJS extension `module.exports`. */ var moduleExports =
+ freeModule && freeModule.exports === freeExports;
+ /** Detect free variable `process` from Node.js. */ var freeProcess =
+ moduleExports && freeGlobal.process;
+ /** Used to access faster Node.js helpers. */ var nodeUtil = (function() {
+ try {
+ return (
+ freeProcess &&
+ freeProcess.binding &&
+ freeProcess.binding("util")
+ );
+ } catch (e) {}
+ })();
+ module.exports = nodeUtil;
+ },
+ { "./_freeGlobal": 80 }
+ ],
+ 112: [
+ function(require, module, exports) {
+ /** Used for built-in method references. */ var objectProto =
+ Object.prototype;
+ /**
+ * Used to resolve the
+ * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
+ * of values.
+ */ var nativeObjectToString = objectProto.toString;
+ /**
+ * Converts `value` to a string using `Object.prototype.toString`.
+ *
+ * @private
+ * @param {*} value The value to convert.
+ * @returns {string} Returns the converted string.
+ */ function objectToString(value) {
+ return nativeObjectToString.call(value);
+ }
+ module.exports = objectToString;
+ },
+ {}
+ ],
+ 113: [
+ function(require, module, exports) {
+ /**
+ * Creates a unary function that invokes `func` with its argument transformed.
+ *
+ * @private
+ * @param {Function} func The function to wrap.
+ * @param {Function} transform The argument transform.
+ * @returns {Function} Returns the new function.
+ */ function overArg(func, transform) {
+ return function(arg) {
+ return func(transform(arg));
+ };
+ }
+ module.exports = overArg;
+ },
+ {}
+ ],
+ 114: [
+ function(require, module, exports) {
+ var apply = require("./_apply");
+ /* Built-in method references for those with the same name as other `lodash` methods. */ var nativeMax =
+ Math.max;
+ /**
+ * A specialized version of `baseRest` which transforms the rest array.
+ *
+ * @private
+ * @param {Function} func The function to apply a rest parameter to.
+ * @param {number} [start=func.length-1] The start position of the rest parameter.
+ * @param {Function} transform The rest array transform.
+ * @returns {Function} Returns the new function.
+ */ function overRest(func, start, transform) {
+ start = nativeMax(start === undefined ? func.length - 1 : start, 0);
+ return function() {
+ var args = arguments,
+ index = -1,
+ length = nativeMax(args.length - start, 0),
+ array = Array(length);
+ while (++index < length) {
+ array[index] = args[start + index];
+ }
+ index = -1;
+ var otherArgs = Array(start + 1);
+ while (++index < start) {
+ otherArgs[index] = args[index];
+ }
+ otherArgs[start] = transform(array);
+ return apply(func, this, otherArgs);
+ };
+ }
+ module.exports = overRest;
+ },
+ { "./_apply": 47 }
+ ],
+ 115: [
+ function(require, module, exports) {
+ var freeGlobal = require("./_freeGlobal");
+ /** Detect free variable `self`. */ var freeSelf =
+ (typeof self === "undefined" ? "undefined" : _typeof(self)) ==
+ "object" &&
+ self &&
+ self.Object === Object &&
+ self;
+ /** Used as a reference to the global object. */ var root =
+ freeGlobal || freeSelf || Function("return this")();
+ module.exports = root;
+ },
+ { "./_freeGlobal": 80 }
+ ],
+ 116: [
+ function(require, module, exports) {
+ /**
+ * Gets the value at `key`, unless `key` is "__proto__".
+ *
+ * @private
+ * @param {Object} object The object to query.
+ * @param {string} key The key of the property to get.
+ * @returns {*} Returns the property value.
+ */ function safeGet(object, key) {
+ return key == "__proto__" ? undefined : object[key];
+ }
+ module.exports = safeGet;
+ },
+ {}
+ ],
+ 117: [
+ function(require, module, exports) {
+ var baseSetToString = require("./_baseSetToString"),
+ shortOut = require("./_shortOut");
+ /**
+ * Sets the `toString` method of `func` to return `string`.
+ *
+ * @private
+ * @param {Function} func The function to modify.
+ * @param {Function} string The `toString` result.
+ * @returns {Function} Returns `func`.
+ */ var setToString = shortOut(baseSetToString);
+ module.exports = setToString;
+ },
+ { "./_baseSetToString": 65, "./_shortOut": 118 }
+ ],
+ 118: [
+ function(require, module, exports) {
+ /** Used to detect hot functions by number of calls within a span of milliseconds. */ var HOT_COUNT = 800,
+ HOT_SPAN = 16;
+ /* Built-in method references for those with the same name as other `lodash` methods. */ var nativeNow =
+ Date.now;
+ /**
+ * Creates a function that'll short out and invoke `identity` instead
+ * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`
+ * milliseconds.
+ *
+ * @private
+ * @param {Function} func The function to restrict.
+ * @returns {Function} Returns the new shortable function.
+ */ function shortOut(func) {
+ var count = 0,
+ lastCalled = 0;
+ return function() {
+ var stamp = nativeNow(),
+ remaining = HOT_SPAN - (stamp - lastCalled);
+ lastCalled = stamp;
+ if (remaining > 0) {
+ if (++count >= HOT_COUNT) {
+ return arguments[0];
+ }
+ } else {
+ count = 0;
+ }
+ return func.apply(undefined, arguments);
+ };
+ }
+ module.exports = shortOut;
+ },
+ {}
+ ],
+ 119: [
+ function(require, module, exports) {
+ var ListCache = require("./_ListCache");
+ /**
+ * Removes all key-value entries from the stack.
+ *
+ * @private
+ * @name clear
+ * @memberOf Stack
+ */ function stackClear() {
+ this.__data__ = new ListCache();
+ this.size = 0;
+ }
+ module.exports = stackClear;
+ },
+ { "./_ListCache": 41 }
+ ],
+ 120: [
+ function(require, module, exports) {
+ /**
+ * Removes `key` and its value from the stack.
+ *
+ * @private
+ * @name delete
+ * @memberOf Stack
+ * @param {string} key The key of the value to remove.
+ * @returns {boolean} Returns `true` if the entry was removed, else `false`.
+ */ function stackDelete(key) {
+ var data = this.__data__,
+ result = data["delete"](key);
+ this.size = data.size;
+ return result;
+ }
+ module.exports = stackDelete;
+ },
+ {}
+ ],
+ 121: [
+ function(require, module, exports) {
+ /**
+ * Gets the stack value for `key`.
+ *
+ * @private
+ * @name get
+ * @memberOf Stack
+ * @param {string} key The key of the value to get.
+ * @returns {*} Returns the entry value.
+ */ function stackGet(key) {
+ return this.__data__.get(key);
+ }
+ module.exports = stackGet;
+ },
+ {}
+ ],
+ 122: [
+ function(require, module, exports) {
+ /**
+ * Checks if a stack value for `key` exists.
+ *
+ * @private
+ * @name has
+ * @memberOf Stack
+ * @param {string} key The key of the entry to check.
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
+ */ function stackHas(key) {
+ return this.__data__.has(key);
+ }
+ module.exports = stackHas;
+ },
+ {}
+ ],
+ 123: [
+ function(require, module, exports) {
+ var ListCache = require("./_ListCache"),
+ Map = require("./_Map"),
+ MapCache = require("./_MapCache");
+ /** Used as the size to enable large array optimizations. */ var LARGE_ARRAY_SIZE = 200;
+ /**
+ * Sets the stack `key` to `value`.
+ *
+ * @private
+ * @name set
+ * @memberOf Stack
+ * @param {string} key The key of the value to set.
+ * @param {*} value The value to set.
+ * @returns {Object} Returns the stack cache instance.
+ */ function stackSet(key, value) {
+ var data = this.__data__;
+ if (data instanceof ListCache) {
+ var pairs = data.__data__;
+ if (!Map || pairs.length < LARGE_ARRAY_SIZE - 1) {
+ pairs.push([key, value]);
+ this.size = ++data.size;
+ return this;
+ }
+ data = this.__data__ = new MapCache(pairs);
+ }
+ data.set(key, value);
+ this.size = data.size;
+ return this;
+ }
+ module.exports = stackSet;
+ },
+ { "./_ListCache": 41, "./_Map": 42, "./_MapCache": 43 }
+ ],
+ 124: [
+ function(require, module, exports) {
+ var memoizeCapped = require("./_memoizeCapped");
+ /** Used to match property names within property paths. */ var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
+ /** Used to match backslashes in property paths. */ var reEscapeChar = /\\(\\)?/g;
+ /**
+ * Converts `string` to a property path array.
+ *
+ * @private
+ * @param {string} string The string to convert.
+ * @returns {Array} Returns the property path array.
+ */ var stringToPath = memoizeCapped(function(string) {
+ var result = [];
+ if (string.charCodeAt(0) === 46 /* . */) {
+ result.push("");
+ }
+ string.replace(rePropName, function(
+ match,
+ number,
+ quote,
+ subString
+ ) {
+ result.push(
+ quote ? subString.replace(reEscapeChar, "$1") : number || match
+ );
+ });
+ return result;
+ });
+ module.exports = stringToPath;
+ },
+ { "./_memoizeCapped": 108 }
+ ],
+ 125: [
+ function(require, module, exports) {
+ var isSymbol = require("./isSymbol");
+ /** Used as references for various `Number` constants. */ var INFINITY =
+ 1 / 0;
+ /**
+ * Converts `value` to a string key if it's not a string or symbol.
+ *
+ * @private
+ * @param {*} value The value to inspect.
+ * @returns {string|symbol} Returns the key.
+ */ function toKey(value) {
+ if (typeof value == "string" || isSymbol(value)) {
+ return value;
+ }
+ var result = value + "";
+ return result == "0" && 1 / value == -INFINITY ? "-0" : result;
+ }
+ module.exports = toKey;
+ },
+ { "./isSymbol": 141 }
+ ],
+ 126: [
+ function(require, module, exports) {
+ /** Used for built-in method references. */ var funcProto =
+ Function.prototype;
+ /** Used to resolve the decompiled source of functions. */ var funcToString =
+ funcProto.toString;
+ /**
+ * Converts `func` to its source code.
+ *
+ * @private
+ * @param {Function} func The function to convert.
+ * @returns {string} Returns the source code.
+ */ function toSource(func) {
+ if (func != null) {
+ try {
+ return funcToString.call(func);
+ } catch (e) {}
+ try {
+ return func + "";
+ } catch (e) {}
+ }
+ return "";
+ }
+ module.exports = toSource;
+ },
+ {}
+ ],
+ 127: [
+ function(require, module, exports) {
+ /**
+ * Creates a function that returns `value`.
+ *
+ * @static
+ * @memberOf _
+ * @since 2.4.0
+ * @category Util
+ * @param {*} value The value to return from the new function.
+ * @returns {Function} Returns the new constant function.
+ * @example
+ *
+ * var objects = _.times(2, _.constant({ 'a': 1 }));
+ *
+ * console.log(objects);
+ * // => [{ 'a': 1 }, { 'a': 1 }]
+ *
+ * console.log(objects[0] === objects[1]);
+ * // => true
+ */ function constant(value) {
+ return function() {
+ return value;
+ };
+ }
+ module.exports = constant;
+ },
+ {}
+ ],
+ 128: [
+ function(require, module, exports) {
+ var apply = require("./_apply"),
+ baseRest = require("./_baseRest"),
+ customDefaultsMerge = require("./_customDefaultsMerge"),
+ mergeWith = require("./mergeWith");
+ /**
+ * This method is like `_.defaults` except that it recursively assigns
+ * default properties.
+ *
+ * **Note:** This method mutates `object`.
+ *
+ * @static
+ * @memberOf _
+ * @since 3.10.0
+ * @category Object
+ * @param {Object} object The destination object.
+ * @param {...Object} [sources] The source objects.
+ * @returns {Object} Returns `object`.
+ * @see _.defaults
+ * @example
+ *
+ * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } });
+ * // => { 'a': { 'b': 2, 'c': 3 } }
+ */ var defaultsDeep = baseRest(function(args) {
+ args.push(undefined, customDefaultsMerge);
+ return apply(mergeWith, undefined, args);
+ });
+ module.exports = defaultsDeep;
+ },
+ {
+ "./_apply": 47,
+ "./_baseRest": 63,
+ "./_customDefaultsMerge": 78,
+ "./mergeWith": 146
+ }
+ ],
+ 129: [
+ function(require, module, exports) {
+ /**
+ * Performs a
+ * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
+ * comparison between two values to determine if they are equivalent.
+ *
+ * @static
+ * @memberOf _
+ * @since 4.0.0
+ * @category Lang
+ * @param {*} value The value to compare.
+ * @param {*} other The other value to compare.
+ * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
+ * @example
+ *
+ * var object = { 'a': 1 };
+ * var other = { 'a': 1 };
+ *
+ * _.eq(object, object);
+ * // => true
+ *
+ * _.eq(object, other);
+ * // => false
+ *
+ * _.eq('a', 'a');
+ * // => true
+ *
+ * _.eq('a', Object('a'));
+ * // => false
+ *
+ * _.eq(NaN, NaN);
+ * // => true
+ */ function eq(value, other) {
+ return value === other || (value !== value && other !== other);
+ }
+ module.exports = eq;
+ },
+ {}
+ ],
+ 130: [
+ function(require, module, exports) {
+ /**
+ * This method returns the first argument it receives.
+ *
+ * @static
+ * @since 0.1.0
+ * @memberOf _
+ * @category Util
+ * @param {*} value Any value.
+ * @returns {*} Returns `value`.
+ * @example
+ *
+ * var object = { 'a': 1 };
+ *
+ * console.log(_.identity(object) === object);
+ * // => true
+ */ function identity(value) {
+ return value;
+ }
+ module.exports = identity;
+ },
+ {}
+ ],
+ 131: [
+ function(require, module, exports) {
+ var baseIsArguments = require("./_baseIsArguments"),
+ isObjectLike = require("./isObjectLike");
+ /** Used for built-in method references. */ var objectProto =
+ Object.prototype;
+ /** Used to check objects for own properties. */ var hasOwnProperty =
+ objectProto.hasOwnProperty;
+ /** Built-in value references. */ var propertyIsEnumerable =
+ objectProto.propertyIsEnumerable;
+ /**
+ * Checks if `value` is likely an `arguments` object.
+ *
+ * @static
+ * @memberOf _
+ * @since 0.1.0
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is an `arguments` object,
+ * else `false`.
+ * @example
+ *
+ * _.isArguments(function() { return arguments; }());
+ * // => true
+ *
+ * _.isArguments([1, 2, 3]);
+ * // => false
+ */ var isArguments = baseIsArguments(
+ (function() {
+ return arguments;
+ })()
+ )
+ ? baseIsArguments
+ : function(value) {
+ return (
+ isObjectLike(value) &&
+ hasOwnProperty.call(value, "callee") &&
+ !propertyIsEnumerable.call(value, "callee")
+ );
+ };
+ module.exports = isArguments;
+ },
+ { "./_baseIsArguments": 57, "./isObjectLike": 139 }
+ ],
+ 132: [
+ function(require, module, exports) {
+ /**
+ * Checks if `value` is classified as an `Array` object.
+ *
+ * @static
+ * @memberOf _
+ * @since 0.1.0
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is an array, else `false`.
+ * @example
+ *
+ * _.isArray([1, 2, 3]);
+ * // => true
+ *
+ * _.isArray(document.body.children);
+ * // => false
+ *
+ * _.isArray('abc');
+ * // => false
+ *
+ * _.isArray(_.noop);
+ * // => false
+ */ var isArray = Array.isArray;
+ module.exports = isArray;
+ },
+ {}
+ ],
+ 133: [
+ function(require, module, exports) {
+ var isFunction = require("./isFunction"),
+ isLength = require("./isLength");
+ /**
+ * Checks if `value` is array-like. A value is considered array-like if it's
+ * not a function and has a `value.length` that's an integer greater than or
+ * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
+ *
+ * @static
+ * @memberOf _
+ * @since 4.0.0
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
+ * @example
+ *
+ * _.isArrayLike([1, 2, 3]);
+ * // => true
+ *
+ * _.isArrayLike(document.body.children);
+ * // => true
+ *
+ * _.isArrayLike('abc');
+ * // => true
+ *
+ * _.isArrayLike(_.noop);
+ * // => false
+ */ function isArrayLike(value) {
+ return (
+ value != null && isLength(value.length) && !isFunction(value)
+ );
+ }
+ module.exports = isArrayLike;
+ },
+ { "./isFunction": 136, "./isLength": 137 }
+ ],
+ 134: [
+ function(require, module, exports) {
+ var isArrayLike = require("./isArrayLike"),
+ isObjectLike = require("./isObjectLike");
+ /**
+ * This method is like `_.isArrayLike` except that it also checks if `value`
+ * is an object.
+ *
+ * @static
+ * @memberOf _
+ * @since 4.0.0
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is an array-like object,
+ * else `false`.
+ * @example
+ *
+ * _.isArrayLikeObject([1, 2, 3]);
+ * // => true
+ *
+ * _.isArrayLikeObject(document.body.children);
+ * // => true
+ *
+ * _.isArrayLikeObject('abc');
+ * // => false
+ *
+ * _.isArrayLikeObject(_.noop);
+ * // => false
+ */ function isArrayLikeObject(value) {
+ return isObjectLike(value) && isArrayLike(value);
+ }
+ module.exports = isArrayLikeObject;
+ },
+ { "./isArrayLike": 133, "./isObjectLike": 139 }
+ ],
+ 135: [
+ function(require, module, exports) {
+ var root = require("./_root"),
+ stubFalse = require("./stubFalse");
+ /** Detect free variable `exports`. */ var freeExports =
+ (typeof exports === "undefined" ? "undefined" : _typeof(exports)) ==
+ "object" &&
+ exports &&
+ !exports.nodeType &&
+ exports;
+ /** Detect free variable `module`. */ var freeModule =
+ freeExports &&
+ (typeof module === "undefined" ? "undefined" : _typeof(module)) ==
+ "object" &&
+ module &&
+ !module.nodeType &&
+ module;
+ /** Detect the popular CommonJS extension `module.exports`. */ var moduleExports =
+ freeModule && freeModule.exports === freeExports;
+ /** Built-in value references. */ var Buffer = moduleExports
+ ? root.Buffer
+ : undefined;
+ /* Built-in method references for those with the same name as other `lodash` methods. */ var nativeIsBuffer = Buffer
+ ? Buffer.isBuffer
+ : undefined;
+ /**
+ * Checks if `value` is a buffer.
+ *
+ * @static
+ * @memberOf _
+ * @since 4.3.0
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
+ * @example
+ *
+ * _.isBuffer(new Buffer(2));
+ * // => true
+ *
+ * _.isBuffer(new Uint8Array(2));
+ * // => false
+ */ var isBuffer = nativeIsBuffer || stubFalse;
+ module.exports = isBuffer;
+ },
+ { "./_root": 115, "./stubFalse": 148 }
+ ],
+ 136: [
+ function(require, module, exports) {
+ var baseGetTag = require("./_baseGetTag"),
+ isObject = require("./isObject");
+ /** `Object#toString` result references. */ var asyncTag =
+ "[object AsyncFunction]",
+ funcTag = "[object Function]",
+ genTag = "[object GeneratorFunction]",
+ proxyTag = "[object Proxy]";
+ /**
+ * Checks if `value` is classified as a `Function` object.
+ *
+ * @static
+ * @memberOf _
+ * @since 0.1.0
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a function, else `false`.
+ * @example
+ *
+ * _.isFunction(_);
+ * // => true
+ *
+ * _.isFunction(/abc/);
+ * // => false
+ */ function isFunction(value) {
+ if (!isObject(value)) {
+ return false;
+ } // The use of `Object#toString` avoids issues with the `typeof` operator
+ // in Safari 9 which returns 'object' for typed arrays and other constructors.
+ var tag = baseGetTag(value);
+ return (
+ tag == funcTag ||
+ tag == genTag ||
+ tag == asyncTag ||
+ tag == proxyTag
+ );
+ }
+ module.exports = isFunction;
+ },
+ { "./_baseGetTag": 56, "./isObject": 138 }
+ ],
+ 137: [
+ function(require, module, exports) {
+ /** Used as references for various `Number` constants. */ var MAX_SAFE_INTEGER = 9007199254740991;
+ /**
+ * Checks if `value` is a valid array-like length.
+ *
+ * **Note:** This method is loosely based on
+ * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
+ *
+ * @static
+ * @memberOf _
+ * @since 4.0.0
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
+ * @example
+ *
+ * _.isLength(3);
+ * // => true
+ *
+ * _.isLength(Number.MIN_VALUE);
+ * // => false
+ *
+ * _.isLength(Infinity);
+ * // => false
+ *
+ * _.isLength('3');
+ * // => false
+ */ function isLength(value) {
+ return (
+ typeof value == "number" &&
+ value > -1 &&
+ value % 1 == 0 &&
+ value <= MAX_SAFE_INTEGER
+ );
+ }
+ module.exports = isLength;
+ },
+ {}
+ ],
+ 138: [
+ function(require, module, exports) {
+ /**
+ * Checks if `value` is the
+ * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
+ * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
+ *
+ * @static
+ * @memberOf _
+ * @since 0.1.0
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is an object, else `false`.
+ * @example
+ *
+ * _.isObject({});
+ * // => true
+ *
+ * _.isObject([1, 2, 3]);
+ * // => true
+ *
+ * _.isObject(_.noop);
+ * // => true
+ *
+ * _.isObject(null);
+ * // => false
+ */ function isObject(value) {
+ var type =
+ typeof value === "undefined" ? "undefined" : _typeof(value);
+ return value != null && (type == "object" || type == "function");
+ }
+ module.exports = isObject;
+ },
+ {}
+ ],
+ 139: [
+ function(require, module, exports) {
+ /**
+ * Checks if `value` is object-like. A value is object-like if it's not `null`
+ * and has a `typeof` result of "object".
+ *
+ * @static
+ * @memberOf _
+ * @since 4.0.0
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
+ * @example
+ *
+ * _.isObjectLike({});
+ * // => true
+ *
+ * _.isObjectLike([1, 2, 3]);
+ * // => true
+ *
+ * _.isObjectLike(_.noop);
+ * // => false
+ *
+ * _.isObjectLike(null);
+ * // => false
+ */ function isObjectLike(value) {
+ return (
+ value != null &&
+ (typeof value === "undefined" ? "undefined" : _typeof(value)) ==
+ "object"
+ );
+ }
+ module.exports = isObjectLike;
+ },
+ {}
+ ],
+ 140: [
+ function(require, module, exports) {
+ var baseGetTag = require("./_baseGetTag"),
+ getPrototype = require("./_getPrototype"),
+ isObjectLike = require("./isObjectLike");
+ /** `Object#toString` result references. */ var objectTag =
+ "[object Object]";
+ /** Used for built-in method references. */ var funcProto =
+ Function.prototype,
+ objectProto = Object.prototype;
+ /** Used to resolve the decompiled source of functions. */ var funcToString =
+ funcProto.toString;
+ /** Used to check objects for own properties. */ var hasOwnProperty =
+ objectProto.hasOwnProperty;
+ /** Used to infer the `Object` constructor. */ var objectCtorString = funcToString.call(
+ Object
+ );
+ /**
+ * Checks if `value` is a plain object, that is, an object created by the
+ * `Object` constructor or one with a `[[Prototype]]` of `null`.
+ *
+ * @static
+ * @memberOf _
+ * @since 0.8.0
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
+ * @example
+ *
+ * function Foo() {
+ * this.a = 1;
+ * }
+ *
+ * _.isPlainObject(new Foo);
+ * // => false
+ *
+ * _.isPlainObject([1, 2, 3]);
+ * // => false
+ *
+ * _.isPlainObject({ 'x': 0, 'y': 0 });
+ * // => true
+ *
+ * _.isPlainObject(Object.create(null));
+ * // => true
+ */ function isPlainObject(value) {
+ if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
+ return false;
+ }
+ var proto = getPrototype(value);
+ if (proto === null) {
+ return true;
+ }
+ var Ctor =
+ hasOwnProperty.call(proto, "constructor") && proto.constructor;
+ return (
+ typeof Ctor == "function" &&
+ Ctor instanceof Ctor &&
+ funcToString.call(Ctor) == objectCtorString
+ );
+ }
+ module.exports = isPlainObject;
+ },
+ { "./_baseGetTag": 56, "./_getPrototype": 83, "./isObjectLike": 139 }
+ ],
+ 141: [
+ function(require, module, exports) {
+ var baseGetTag = require("./_baseGetTag"),
+ isObjectLike = require("./isObjectLike");
+ /** `Object#toString` result references. */ var symbolTag =
+ "[object Symbol]";
+ /**
+ * Checks if `value` is classified as a `Symbol` primitive or object.
+ *
+ * @static
+ * @memberOf _
+ * @since 4.0.0
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
+ * @example
+ *
+ * _.isSymbol(Symbol.iterator);
+ * // => true
+ *
+ * _.isSymbol('abc');
+ * // => false
+ */ function isSymbol(value) {
+ return (
+ (typeof value === "undefined" ? "undefined" : _typeof(value)) ==
+ "symbol" ||
+ (isObjectLike(value) && baseGetTag(value) == symbolTag)
+ );
+ }
+ module.exports = isSymbol;
+ },
+ { "./_baseGetTag": 56, "./isObjectLike": 139 }
+ ],
+ 142: [
+ function(require, module, exports) {
+ var baseIsTypedArray = require("./_baseIsTypedArray"),
+ baseUnary = require("./_baseUnary"),
+ nodeUtil = require("./_nodeUtil");
+ /* Node.js helper references. */ var nodeIsTypedArray =
+ nodeUtil && nodeUtil.isTypedArray;
+ /**
+ * Checks if `value` is classified as a typed array.
+ *
+ * @static
+ * @memberOf _
+ * @since 3.0.0
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
+ * @example
+ *
+ * _.isTypedArray(new Uint8Array);
+ * // => true
+ *
+ * _.isTypedArray([]);
+ * // => false
+ */ var isTypedArray = nodeIsTypedArray
+ ? baseUnary(nodeIsTypedArray)
+ : baseIsTypedArray;
+ module.exports = isTypedArray;
+ },
+ { "./_baseIsTypedArray": 59, "./_baseUnary": 68, "./_nodeUtil": 111 }
+ ],
+ 143: [
+ function(require, module, exports) {
+ var arrayLikeKeys = require("./_arrayLikeKeys"),
+ baseKeysIn = require("./_baseKeysIn"),
+ isArrayLike = require("./isArrayLike");
+ /**
+ * Creates an array of the own and inherited enumerable property names of `object`.
+ *
+ * **Note:** Non-object values are coerced to objects.
+ *
+ * @static
+ * @memberOf _
+ * @since 3.0.0
+ * @category Object
+ * @param {Object} object The object to query.
+ * @returns {Array} Returns the array of property names.
+ * @example
+ *
+ * function Foo() {
+ * this.a = 1;
+ * this.b = 2;
+ * }
+ *
+ * Foo.prototype.c = 3;
+ *
+ * _.keysIn(new Foo);
+ * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
+ */ function keysIn(object) {
+ return isArrayLike(object)
+ ? arrayLikeKeys(object, true)
+ : baseKeysIn(object);
+ }
+ module.exports = keysIn;
+ },
+ { "./_arrayLikeKeys": 48, "./_baseKeysIn": 60, "./isArrayLike": 133 }
+ ],
+ 144: [
+ function(require, module, exports) {
+ /**
+ * @license
+ * Lodash
+ * Copyright JS Foundation and other contributors
+ * Released under MIT license
+ * Based on Underscore.js 1.8.3
+ * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
+ */ (function() {
+ /** Used as a safe reference for `undefined` in pre-ES5 environments. */ var undefined;
+ /** Used as the semantic version number. */ var VERSION = "4.17.5";
+ /** Used as the size to enable large array optimizations. */ var LARGE_ARRAY_SIZE = 200;
+ /** Error message constants. */ var CORE_ERROR_TEXT =
+ "Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",
+ FUNC_ERROR_TEXT = "Expected a function";
+ /** Used to stand-in for `undefined` hash values. */ var HASH_UNDEFINED =
+ "__lodash_hash_undefined__";
+ /** Used as the maximum memoize cache size. */ var MAX_MEMOIZE_SIZE = 500;
+ /** Used as the internal argument placeholder. */ var PLACEHOLDER =
+ "__lodash_placeholder__";
+ /** Used to compose bitmasks for cloning. */ var CLONE_DEEP_FLAG = 1,
+ CLONE_FLAT_FLAG = 2,
+ CLONE_SYMBOLS_FLAG = 4;
+ /** Used to compose bitmasks for value comparisons. */ var COMPARE_PARTIAL_FLAG = 1,
+ COMPARE_UNORDERED_FLAG = 2;
+ /** Used to compose bitmasks for function metadata. */ var WRAP_BIND_FLAG = 1,
+ WRAP_BIND_KEY_FLAG = 2,
+ WRAP_CURRY_BOUND_FLAG = 4,
+ WRAP_CURRY_FLAG = 8,
+ WRAP_CURRY_RIGHT_FLAG = 16,
+ WRAP_PARTIAL_FLAG = 32,
+ WRAP_PARTIAL_RIGHT_FLAG = 64,
+ WRAP_ARY_FLAG = 128,
+ WRAP_REARG_FLAG = 256,
+ WRAP_FLIP_FLAG = 512;
+ /** Used as default options for `_.truncate`. */ var DEFAULT_TRUNC_LENGTH = 30,
+ DEFAULT_TRUNC_OMISSION = "...";
+ /** Used to detect hot functions by number of calls within a span of milliseconds. */ var HOT_COUNT = 800,
+ HOT_SPAN = 16;
+ /** Used to indicate the type of lazy iteratees. */ var LAZY_FILTER_FLAG = 1,
+ LAZY_MAP_FLAG = 2,
+ LAZY_WHILE_FLAG = 3;
+ /** Used as references for various `Number` constants. */ var INFINITY =
+ 1 / 0,
+ MAX_SAFE_INTEGER = 9007199254740991,
+ MAX_INTEGER = 1.7976931348623157e308,
+ NAN = 0 / 0;
+ /** Used as references for the maximum length and index of an array. */ var MAX_ARRAY_LENGTH = 4294967295,
+ MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1,
+ HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;
+ /** Used to associate wrap methods with their bit flags. */ var wrapFlags = [
+ ["ary", WRAP_ARY_FLAG],
+ ["bind", WRAP_BIND_FLAG],
+ ["bindKey", WRAP_BIND_KEY_FLAG],
+ ["curry", WRAP_CURRY_FLAG],
+ ["curryRight", WRAP_CURRY_RIGHT_FLAG],
+ ["flip", WRAP_FLIP_FLAG],
+ ["partial", WRAP_PARTIAL_FLAG],
+ ["partialRight", WRAP_PARTIAL_RIGHT_FLAG],
+ ["rearg", WRAP_REARG_FLAG]
+ ];
+ /** `Object#toString` result references. */ var argsTag =
+ "[object Arguments]",
+ arrayTag = "[object Array]",
+ asyncTag = "[object AsyncFunction]",
+ boolTag = "[object Boolean]",
+ dateTag = "[object Date]",
+ domExcTag = "[object DOMException]",
+ errorTag = "[object Error]",
+ funcTag = "[object Function]",
+ genTag = "[object GeneratorFunction]",
+ mapTag = "[object Map]",
+ numberTag = "[object Number]",
+ nullTag = "[object Null]",
+ objectTag = "[object Object]",
+ promiseTag = "[object Promise]",
+ proxyTag = "[object Proxy]",
+ regexpTag = "[object RegExp]",
+ setTag = "[object Set]",
+ stringTag = "[object String]",
+ symbolTag = "[object Symbol]",
+ undefinedTag = "[object Undefined]",
+ weakMapTag = "[object WeakMap]",
+ weakSetTag = "[object WeakSet]";
+ var arrayBufferTag = "[object ArrayBuffer]",
+ dataViewTag = "[object DataView]",
+ float32Tag = "[object Float32Array]",
+ float64Tag = "[object Float64Array]",
+ int8Tag = "[object Int8Array]",
+ int16Tag = "[object Int16Array]",
+ int32Tag = "[object Int32Array]",
+ uint8Tag = "[object Uint8Array]",
+ uint8ClampedTag = "[object Uint8ClampedArray]",
+ uint16Tag = "[object Uint16Array]",
+ uint32Tag = "[object Uint32Array]";
+ /** Used to match empty string literals in compiled template source. */ var reEmptyStringLeading = /\b__p \+= '';/g,
+ reEmptyStringMiddle = /\b(__p \+=) '' \+/g,
+ reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;
+ /** Used to match HTML entities and HTML characters. */ var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g,
+ reUnescapedHtml = /[&<>"']/g,
+ reHasEscapedHtml = RegExp(reEscapedHtml.source),
+ reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
+ /** Used to match template delimiters. */ var reEscape = /<%-([\s\S]+?)%>/g,
+ reEvaluate = /<%([\s\S]+?)%>/g,
+ reInterpolate = /<%=([\s\S]+?)%>/g;
+ /** Used to match property names within property paths. */ var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
+ reIsPlainProp = /^\w*$/,
+ rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
+ /**
+ * Used to match `RegExp`
+ * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
+ */ var reRegExpChar = /[\\^$.*+?()[\]{}|]/g,
+ reHasRegExpChar = RegExp(reRegExpChar.source);
+ /** Used to match leading and trailing whitespace. */ var reTrim = /^\s+|\s+$/g,
+ reTrimStart = /^\s+/,
+ reTrimEnd = /\s+$/;
+ /** Used to match wrap detail comments. */ var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,
+ reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/,
+ reSplitDetails = /,? & /;
+ /** Used to match words composed of alphanumeric characters. */ var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
+ /** Used to match backslashes in property paths. */ var reEscapeChar = /\\(\\)?/g;
+ /**
+ * Used to match
+ * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components).
+ */ var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
+ /** Used to match `RegExp` flags from their coerced string values. */ var reFlags = /\w*$/;
+ /** Used to detect bad signed hexadecimal string values. */ var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
+ /** Used to detect binary string values. */ var reIsBinary = /^0b[01]+$/i;
+ /** Used to detect host constructors (Safari). */ var reIsHostCtor = /^\[object .+?Constructor\]$/;
+ /** Used to detect octal string values. */ var reIsOctal = /^0o[0-7]+$/i;
+ /** Used to detect unsigned integer values. */ var reIsUint = /^(?:0|[1-9]\d*)$/;
+ /** Used to match Latin Unicode letters (excluding mathematical operators). */ var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
+ /** Used to ensure capturing order of template delimiters. */ var reNoMatch = /($^)/;
+ /** Used to match unescaped characters in compiled string literals. */ var reUnescapedString = /['\n\r\u2028\u2029\\]/g;
+ /** Used to compose unicode character classes. */ var rsAstralRange =
+ "\\ud800-\\udfff",
+ rsComboMarksRange = "\\u0300-\\u036f",
+ reComboHalfMarksRange = "\\ufe20-\\ufe2f",
+ rsComboSymbolsRange = "\\u20d0-\\u20ff",
+ rsComboRange =
+ rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,
+ rsDingbatRange = "\\u2700-\\u27bf",
+ rsLowerRange = "a-z\\xdf-\\xf6\\xf8-\\xff",
+ rsMathOpRange = "\\xac\\xb1\\xd7\\xf7",
+ rsNonCharRange = "\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",
+ rsPunctuationRange = "\\u2000-\\u206f",
+ rsSpaceRange =
+ " \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",
+ rsUpperRange = "A-Z\\xc0-\\xd6\\xd8-\\xde",
+ rsVarRange = "\\ufe0e\\ufe0f",
+ rsBreakRange =
+ rsMathOpRange +
+ rsNonCharRange +
+ rsPunctuationRange +
+ rsSpaceRange;
+ /** Used to compose unicode capture groups. */ var rsApos =
+ "['\u2019]",
+ rsAstral = "[" + rsAstralRange + "]",
+ rsBreak = "[" + rsBreakRange + "]",
+ rsCombo = "[" + rsComboRange + "]",
+ rsDigits = "\\d+",
+ rsDingbat = "[" + rsDingbatRange + "]",
+ rsLower = "[" + rsLowerRange + "]",
+ rsMisc =
+ "[^" +
+ rsAstralRange +
+ rsBreakRange +
+ rsDigits +
+ rsDingbatRange +
+ rsLowerRange +
+ rsUpperRange +
+ "]",
+ rsFitz = "\\ud83c[\\udffb-\\udfff]",
+ rsModifier = "(?:" + rsCombo + "|" + rsFitz + ")",
+ rsNonAstral = "[^" + rsAstralRange + "]",
+ rsRegional = "(?:\\ud83c[\\udde6-\\uddff]){2}",
+ rsSurrPair = "[\\ud800-\\udbff][\\udc00-\\udfff]",
+ rsUpper = "[" + rsUpperRange + "]",
+ rsZWJ = "\\u200d";
+ /** Used to compose unicode regexes. */ var rsMiscLower =
+ "(?:" + rsLower + "|" + rsMisc + ")",
+ rsMiscUpper = "(?:" + rsUpper + "|" + rsMisc + ")",
+ rsOptContrLower = "(?:" + rsApos + "(?:d|ll|m|re|s|t|ve))?",
+ rsOptContrUpper = "(?:" + rsApos + "(?:D|LL|M|RE|S|T|VE))?",
+ reOptMod = rsModifier + "?",
+ rsOptVar = "[" + rsVarRange + "]?",
+ rsOptJoin =
+ "(?:" +
+ rsZWJ +
+ "(?:" +
+ [rsNonAstral, rsRegional, rsSurrPair].join("|") +
+ ")" +
+ rsOptVar +
+ reOptMod +
+ ")*",
+ rsOrdLower = "\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",
+ rsOrdUpper = "\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",
+ rsSeq = rsOptVar + reOptMod + rsOptJoin,
+ rsEmoji =
+ "(?:" +
+ [rsDingbat, rsRegional, rsSurrPair].join("|") +
+ ")" +
+ rsSeq,
+ rsSymbol =
+ "(?:" +
+ [
+ rsNonAstral + rsCombo + "?",
+ rsCombo,
+ rsRegional,
+ rsSurrPair,
+ rsAstral
+ ].join("|") +
+ ")";
+ /** Used to match apostrophes. */ var reApos = RegExp(rsApos, "g");
+ /**
+ * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and
+ * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).
+ */ var reComboMark = RegExp(rsCombo, "g");
+ /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */ var reUnicode = RegExp(
+ rsFitz + "(?=" + rsFitz + ")|" + rsSymbol + rsSeq,
+ "g"
+ );
+ /** Used to match complex or compound words. */ var reUnicodeWord = RegExp(
+ [
+ rsUpper +
+ "?" +
+ rsLower +
+ "+" +
+ rsOptContrLower +
+ "(?=" +
+ [rsBreak, rsUpper, "$"].join("|") +
+ ")",
+ rsMiscUpper +
+ "+" +
+ rsOptContrUpper +
+ "(?=" +
+ [rsBreak, rsUpper + rsMiscLower, "$"].join("|") +
+ ")",
+ rsUpper + "?" + rsMiscLower + "+" + rsOptContrLower,
+ rsUpper + "+" + rsOptContrUpper,
+ rsOrdUpper,
+ rsOrdLower,
+ rsDigits,
+ rsEmoji
+ ].join("|"),
+ "g"
+ );
+ /** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */ var reHasUnicode = RegExp(
+ "[" + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + "]"
+ );
+ /** Used to detect strings that need a more robust regexp to match words. */ var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;
+ /** Used to assign default `context` object properties. */ var contextProps = [
+ "Array",
+ "Buffer",
+ "DataView",
+ "Date",
+ "Error",
+ "Float32Array",
+ "Float64Array",
+ "Function",
+ "Int8Array",
+ "Int16Array",
+ "Int32Array",
+ "Map",
+ "Math",
+ "Object",
+ "Promise",
+ "RegExp",
+ "Set",
+ "String",
+ "Symbol",
+ "TypeError",
+ "Uint8Array",
+ "Uint8ClampedArray",
+ "Uint16Array",
+ "Uint32Array",
+ "WeakMap",
+ "_",
+ "clearTimeout",
+ "isFinite",
+ "parseInt",
+ "setTimeout"
+ ];
+ /** Used to make template sourceURLs easier to identify. */ var templateCounter = -1;
+ /** Used to identify `toStringTag` values of typed arrays. */ var typedArrayTags = {};
+ typedArrayTags[float32Tag] = typedArrayTags[
+ float64Tag
+ ] = typedArrayTags[int8Tag] = typedArrayTags[
+ int16Tag
+ ] = typedArrayTags[int32Tag] = typedArrayTags[
+ uint8Tag
+ ] = typedArrayTags[uint8ClampedTag] = typedArrayTags[
+ uint16Tag
+ ] = typedArrayTags[uint32Tag] = true;
+ typedArrayTags[argsTag] = typedArrayTags[arrayTag] = typedArrayTags[
+ arrayBufferTag
+ ] = typedArrayTags[boolTag] = typedArrayTags[
+ dataViewTag
+ ] = typedArrayTags[dateTag] = typedArrayTags[
+ errorTag
+ ] = typedArrayTags[funcTag] = typedArrayTags[
+ mapTag
+ ] = typedArrayTags[numberTag] = typedArrayTags[
+ objectTag
+ ] = typedArrayTags[regexpTag] = typedArrayTags[
+ setTag
+ ] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false;
+ /** Used to identify `toStringTag` values supported by `_.clone`. */ var cloneableTags = {};
+ cloneableTags[argsTag] = cloneableTags[arrayTag] = cloneableTags[
+ arrayBufferTag
+ ] = cloneableTags[dataViewTag] = cloneableTags[
+ boolTag
+ ] = cloneableTags[dateTag] = cloneableTags[
+ float32Tag
+ ] = cloneableTags[float64Tag] = cloneableTags[
+ int8Tag
+ ] = cloneableTags[int16Tag] = cloneableTags[
+ int32Tag
+ ] = cloneableTags[mapTag] = cloneableTags[
+ numberTag
+ ] = cloneableTags[objectTag] = cloneableTags[
+ regexpTag
+ ] = cloneableTags[setTag] = cloneableTags[
+ stringTag
+ ] = cloneableTags[symbolTag] = cloneableTags[
+ uint8Tag
+ ] = cloneableTags[uint8ClampedTag] = cloneableTags[
+ uint16Tag
+ ] = cloneableTags[uint32Tag] = true;
+ cloneableTags[errorTag] = cloneableTags[funcTag] = cloneableTags[
+ weakMapTag
+ ] = false;
+ /** Used to map Latin Unicode letters to basic Latin letters. */ var deburredLetters = {
+ // Latin-1 Supplement block.
+ À: "A",
+ Á: "A",
+ Â: "A",
+ Ã: "A",
+ Ä: "A",
+ Å: "A",
+ à: "a",
+ á: "a",
+ â: "a",
+ ã: "a",
+ ä: "a",
+ å: "a",
+ Ç: "C",
+ ç: "c",
+ Ð: "D",
+ ð: "d",
+ È: "E",
+ É: "E",
+ Ê: "E",
+ Ë: "E",
+ è: "e",
+ é: "e",
+ ê: "e",
+ ë: "e",
+ Ì: "I",
+ Í: "I",
+ Î: "I",
+ Ï: "I",
+ ì: "i",
+ í: "i",
+ î: "i",
+ ï: "i",
+ Ñ: "N",
+ ñ: "n",
+ Ò: "O",
+ Ó: "O",
+ Ô: "O",
+ Õ: "O",
+ Ö: "O",
+ Ø: "O",
+ ò: "o",
+ ó: "o",
+ ô: "o",
+ õ: "o",
+ ö: "o",
+ ø: "o",
+ Ù: "U",
+ Ú: "U",
+ Û: "U",
+ Ü: "U",
+ ù: "u",
+ ú: "u",
+ û: "u",
+ ü: "u",
+ Ý: "Y",
+ ý: "y",
+ ÿ: "y",
+ Æ: "Ae",
+ æ: "ae",
+ Þ: "Th",
+ þ: "th",
+ ß: "ss", // Latin Extended-A block.
+ Ā: "A",
+ Ă: "A",
+ Ą: "A",
+ ā: "a",
+ ă: "a",
+ ą: "a",
+ Ć: "C",
+ Ĉ: "C",
+ Ċ: "C",
+ Č: "C",
+ ć: "c",
+ ĉ: "c",
+ ċ: "c",
+ č: "c",
+ Ď: "D",
+ Đ: "D",
+ ď: "d",
+ đ: "d",
+ Ē: "E",
+ Ĕ: "E",
+ Ė: "E",
+ Ę: "E",
+ Ě: "E",
+ ē: "e",
+ ĕ: "e",
+ ė: "e",
+ ę: "e",
+ ě: "e",
+ Ĝ: "G",
+ Ğ: "G",
+ Ġ: "G",
+ Ģ: "G",
+ ĝ: "g",
+ ğ: "g",
+ ġ: "g",
+ ģ: "g",
+ Ĥ: "H",
+ Ħ: "H",
+ ĥ: "h",
+ ħ: "h",
+ Ĩ: "I",
+ Ī: "I",
+ Ĭ: "I",
+ Į: "I",
+ İ: "I",
+ ĩ: "i",
+ ī: "i",
+ ĭ: "i",
+ į: "i",
+ ı: "i",
+ Ĵ: "J",
+ ĵ: "j",
+ Ķ: "K",
+ ķ: "k",
+ ĸ: "k",
+ Ĺ: "L",
+ Ļ: "L",
+ Ľ: "L",
+ Ŀ: "L",
+ Ł: "L",
+ ĺ: "l",
+ ļ: "l",
+ ľ: "l",
+ ŀ: "l",
+ ł: "l",
+ Ń: "N",
+ Ņ: "N",
+ Ň: "N",
+ Ŋ: "N",
+ ń: "n",
+ ņ: "n",
+ ň: "n",
+ ŋ: "n",
+ Ō: "O",
+ Ŏ: "O",
+ Ő: "O",
+ ō: "o",
+ ŏ: "o",
+ ő: "o",
+ Ŕ: "R",
+ Ŗ: "R",
+ Ř: "R",
+ ŕ: "r",
+ ŗ: "r",
+ ř: "r",
+ Ś: "S",
+ Ŝ: "S",
+ Ş: "S",
+ Š: "S",
+ ś: "s",
+ ŝ: "s",
+ ş: "s",
+ š: "s",
+ Ţ: "T",
+ Ť: "T",
+ Ŧ: "T",
+ ţ: "t",
+ ť: "t",
+ ŧ: "t",
+ Ũ: "U",
+ Ū: "U",
+ Ŭ: "U",
+ Ů: "U",
+ Ű: "U",
+ Ų: "U",
+ ũ: "u",
+ ū: "u",
+ ŭ: "u",
+ ů: "u",
+ ű: "u",
+ ų: "u",
+ Ŵ: "W",
+ ŵ: "w",
+ Ŷ: "Y",
+ ŷ: "y",
+ Ÿ: "Y",
+ Ź: "Z",
+ Ż: "Z",
+ Ž: "Z",
+ ź: "z",
+ ż: "z",
+ ž: "z",
+ IJ: "IJ",
+ ij: "ij",
+ Œ: "Oe",
+ œ: "oe",
+ ʼn: "'n",
+ ſ: "s"
+ };
+ /** Used to map characters to HTML entities. */ var htmlEscapes = {
+ "&": "&",
+ "<": "<",
+ ">": ">",
+ '"': """,
+ "'": "'"
+ };
+ /** Used to map HTML entities to characters. */ var htmlUnescapes = {
+ "&": "&",
+ "<": "<",
+ ">": ">",
+ """: '"',
+ "'": "'"
+ };
+ /** Used to escape characters for inclusion in compiled string literals. */ var stringEscapes = {
+ "\\": "\\",
+ "'": "'",
+ "\n": "n",
+ "\r": "r",
+ "\u2028": "u2028",
+ "\u2029": "u2029"
+ };
+ /** Built-in method references without a dependency on `root`. */ var freeParseFloat = parseFloat,
+ freeParseInt = parseInt;
+ /** Detect free variable `global` from Node.js. */ var freeGlobal =
+ (typeof global === "undefined" ? "undefined" : _typeof(global)) ==
+ "object" &&
+ global &&
+ global.Object === Object &&
+ global;
+ /** Detect free variable `self`. */ var freeSelf =
+ (typeof self === "undefined" ? "undefined" : _typeof(self)) ==
+ "object" &&
+ self &&
+ self.Object === Object &&
+ self;
+ /** Used as a reference to the global object. */ var root =
+ freeGlobal || freeSelf || Function("return this")();
+ /** Detect free variable `exports`. */ var freeExports =
+ (typeof exports === "undefined"
+ ? "undefined"
+ : _typeof(exports)) == "object" &&
+ exports &&
+ !exports.nodeType &&
+ exports;
+ /** Detect free variable `module`. */ var freeModule =
+ freeExports &&
+ (typeof module === "undefined" ? "undefined" : _typeof(module)) ==
+ "object" &&
+ module &&
+ !module.nodeType &&
+ module;
+ /** Detect the popular CommonJS extension `module.exports`. */ var moduleExports =
+ freeModule && freeModule.exports === freeExports;
+ /** Detect free variable `process` from Node.js. */ var freeProcess =
+ moduleExports && freeGlobal.process;
+ /** Used to access faster Node.js helpers. */ var nodeUtil = (function() {
+ try {
+ return (
+ freeProcess &&
+ freeProcess.binding &&
+ freeProcess.binding("util")
+ );
+ } catch (e) {}
+ })();
+ /* Node.js helper references. */ var nodeIsArrayBuffer =
+ nodeUtil && nodeUtil.isArrayBuffer,
+ nodeIsDate = nodeUtil && nodeUtil.isDate,
+ nodeIsMap = nodeUtil && nodeUtil.isMap,
+ nodeIsRegExp = nodeUtil && nodeUtil.isRegExp,
+ nodeIsSet = nodeUtil && nodeUtil.isSet,
+ nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
+ /*--------------------------------------------------------------------------*/ /**
+ * A faster alternative to `Function#apply`, this function invokes `func`
+ * with the `this` binding of `thisArg` and the arguments of `args`.
+ *
+ * @private
+ * @param {Function} func The function to invoke.
+ * @param {*} thisArg The `this` binding of `func`.
+ * @param {Array} args The arguments to invoke `func` with.
+ * @returns {*} Returns the result of `func`.
+ */ function apply(func, thisArg, args) {
+ switch (args.length) {
+ case 0:
+ return func.call(thisArg);
+ case 1:
+ return func.call(thisArg, args[0]);
+ case 2:
+ return func.call(thisArg, args[0], args[1]);
+ case 3:
+ return func.call(thisArg, args[0], args[1], args[2]);
+ }
+ return func.apply(thisArg, args);
+ }
+ /**
+ * A specialized version of `baseAggregator` for arrays.
+ *
+ * @private
+ * @param {Array} [array] The array to iterate over.
+ * @param {Function} setter The function to set `accumulator` values.
+ * @param {Function} iteratee The iteratee to transform keys.
+ * @param {Object} accumulator The initial aggregated object.
+ * @returns {Function} Returns `accumulator`.
+ */ function arrayAggregator(array, setter, iteratee, accumulator) {
+ var index = -1,
+ length = array == null ? 0 : array.length;
+ while (++index < length) {
+ var value = array[index];
+ setter(accumulator, value, iteratee(value), array);
+ }
+ return accumulator;
+ }
+ /**
+ * A specialized version of `_.forEach` for arrays without support for
+ * iteratee shorthands.
+ *
+ * @private
+ * @param {Array} [array] The array to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @returns {Array} Returns `array`.
+ */ function arrayEach(array, iteratee) {
+ var index = -1,
+ length = array == null ? 0 : array.length;
+ while (++index < length) {
+ if (iteratee(array[index], index, array) === false) {
+ break;
+ }
+ }
+ return array;
+ }
+ /**
+ * A specialized version of `_.forEachRight` for arrays without support for
+ * iteratee shorthands.
+ *
+ * @private
+ * @param {Array} [array] The array to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @returns {Array} Returns `array`.
+ */ function arrayEachRight(array, iteratee) {
+ var length = array == null ? 0 : array.length;
+ while (length--) {
+ if (iteratee(array[length], length, array) === false) {
+ break;
+ }
+ }
+ return array;
+ }
+ /**
+ * A specialized version of `_.every` for arrays without support for
+ * iteratee shorthands.
+ *
+ * @private
+ * @param {Array} [array] The array to iterate over.
+ * @param {Function} predicate The function invoked per iteration.
+ * @returns {boolean} Returns `true` if all elements pass the predicate check,
+ * else `false`.
+ */ function arrayEvery(array, predicate) {
+ var index = -1,
+ length = array == null ? 0 : array.length;
+ while (++index < length) {
+ if (!predicate(array[index], index, array)) {
+ return false;
+ }
+ }
+ return true;
+ }
+ /**
+ * A specialized version of `_.filter` for arrays without support for
+ * iteratee shorthands.
+ *
+ * @private
+ * @param {Array} [array] The array to iterate over.
+ * @param {Function} predicate The function invoked per iteration.
+ * @returns {Array} Returns the new filtered array.
+ */ function arrayFilter(array, predicate) {
+ var index = -1,
+ length = array == null ? 0 : array.length,
+ resIndex = 0,
+ result = [];
+ while (++index < length) {
+ var value = array[index];
+ if (predicate(value, index, array)) {
+ result[resIndex++] = value;
+ }
+ }
+ return result;
+ }
+ /**
+ * A specialized version of `_.includes` for arrays without support for
+ * specifying an index to search from.
+ *
+ * @private
+ * @param {Array} [array] The array to inspect.
+ * @param {*} target The value to search for.
+ * @returns {boolean} Returns `true` if `target` is found, else `false`.
+ */ function arrayIncludes(array, value) {
+ var length = array == null ? 0 : array.length;
+ return !!length && baseIndexOf(array, value, 0) > -1;
+ }
+ /**
+ * This function is like `arrayIncludes` except that it accepts a comparator.
+ *
+ * @private
+ * @param {Array} [array] The array to inspect.
+ * @param {*} target The value to search for.
+ * @param {Function} comparator The comparator invoked per element.
+ * @returns {boolean} Returns `true` if `target` is found, else `false`.
+ */ function arrayIncludesWith(array, value, comparator) {
+ var index = -1,
+ length = array == null ? 0 : array.length;
+ while (++index < length) {
+ if (comparator(value, array[index])) {
+ return true;
+ }
+ }
+ return false;
+ }
+ /**
+ * A specialized version of `_.map` for arrays without support for iteratee
+ * shorthands.
+ *
+ * @private
+ * @param {Array} [array] The array to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @returns {Array} Returns the new mapped array.
+ */ function arrayMap(array, iteratee) {
+ var index = -1,
+ length = array == null ? 0 : array.length,
+ result = Array(length);
+ while (++index < length) {
+ result[index] = iteratee(array[index], index, array);
+ }
+ return result;
+ }
+ /**
+ * Appends the elements of `values` to `array`.
+ *
+ * @private
+ * @param {Array} array The array to modify.
+ * @param {Array} values The values to append.
+ * @returns {Array} Returns `array`.
+ */ function arrayPush(array, values) {
+ var index = -1,
+ length = values.length,
+ offset = array.length;
+ while (++index < length) {
+ array[offset + index] = values[index];
+ }
+ return array;
+ }
+ /**
+ * A specialized version of `_.reduce` for arrays without support for
+ * iteratee shorthands.
+ *
+ * @private
+ * @param {Array} [array] The array to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @param {*} [accumulator] The initial value.
+ * @param {boolean} [initAccum] Specify using the first element of `array` as
+ * the initial value.
+ * @returns {*} Returns the accumulated value.
+ */ function arrayReduce(array, iteratee, accumulator, initAccum) {
+ var index = -1,
+ length = array == null ? 0 : array.length;
+ if (initAccum && length) {
+ accumulator = array[++index];
+ }
+ while (++index < length) {
+ accumulator = iteratee(accumulator, array[index], index, array);
+ }
+ return accumulator;
+ }
+ /**
+ * A specialized version of `_.reduceRight` for arrays without support for
+ * iteratee shorthands.
+ *
+ * @private
+ * @param {Array} [array] The array to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @param {*} [accumulator] The initial value.
+ * @param {boolean} [initAccum] Specify using the last element of `array` as
+ * the initial value.
+ * @returns {*} Returns the accumulated value.
+ */ function arrayReduceRight(
+ array,
+ iteratee,
+ accumulator,
+ initAccum
+ ) {
+ var length = array == null ? 0 : array.length;
+ if (initAccum && length) {
+ accumulator = array[--length];
+ }
+ while (length--) {
+ accumulator = iteratee(
+ accumulator,
+ array[length],
+ length,
+ array
+ );
+ }
+ return accumulator;
+ }
+ /**
+ * A specialized version of `_.some` for arrays without support for iteratee
+ * shorthands.
+ *
+ * @private
+ * @param {Array} [array] The array to iterate over.
+ * @param {Function} predicate The function invoked per iteration.
+ * @returns {boolean} Returns `true` if any element passes the predicate check,
+ * else `false`.
+ */ function arraySome(array, predicate) {
+ var index = -1,
+ length = array == null ? 0 : array.length;
+ while (++index < length) {
+ if (predicate(array[index], index, array)) {
+ return true;
+ }
+ }
+ return false;
+ }
+ /**
+ * Gets the size of an ASCII `string`.
+ *
+ * @private
+ * @param {string} string The string inspect.
+ * @returns {number} Returns the string size.
+ */ var asciiSize = baseProperty("length");
+ /**
+ * Converts an ASCII `string` to an array.
+ *
+ * @private
+ * @param {string} string The string to convert.
+ * @returns {Array} Returns the converted array.
+ */ function asciiToArray(string) {
+ return string.split("");
+ }
+ /**
+ * Splits an ASCII `string` into an array of its words.
+ *
+ * @private
+ * @param {string} The string to inspect.
+ * @returns {Array} Returns the words of `string`.
+ */ function asciiWords(string) {
+ return string.match(reAsciiWord) || [];
+ }
+ /**
+ * The base implementation of methods like `_.findKey` and `_.findLastKey`,
+ * without support for iteratee shorthands, which iterates over `collection`
+ * using `eachFunc`.
+ *
+ * @private
+ * @param {Array|Object} collection The collection to inspect.
+ * @param {Function} predicate The function invoked per iteration.
+ * @param {Function} eachFunc The function to iterate over `collection`.
+ * @returns {*} Returns the found element or its key, else `undefined`.
+ */ function baseFindKey(collection, predicate, eachFunc) {
+ var result;
+ eachFunc(collection, function(value, key, collection) {
+ if (predicate(value, key, collection)) {
+ result = key;
+ return false;
+ }
+ });
+ return result;
+ }
+ /**
+ * The base implementation of `_.findIndex` and `_.findLastIndex` without
+ * support for iteratee shorthands.
+ *
+ * @private
+ * @param {Array} array The array to inspect.
+ * @param {Function} predicate The function invoked per iteration.
+ * @param {number} fromIndex The index to search from.
+ * @param {boolean} [fromRight] Specify iterating from right to left.
+ * @returns {number} Returns the index of the matched value, else `-1`.
+ */ function baseFindIndex(array, predicate, fromIndex, fromRight) {
+ var length = array.length,
+ index = fromIndex + (fromRight ? 1 : -1);
+ while (fromRight ? index-- : ++index < length) {
+ if (predicate(array[index], index, array)) {
+ return index;
+ }
+ }
+ return -1;
+ }
+ /**
+ * The base implementation of `_.indexOf` without `fromIndex` bounds checks.
+ *
+ * @private
+ * @param {Array} array The array to inspect.
+ * @param {*} value The value to search for.
+ * @param {number} fromIndex The index to search from.
+ * @returns {number} Returns the index of the matched value, else `-1`.
+ */ function baseIndexOf(array, value, fromIndex) {
+ return value === value
+ ? strictIndexOf(array, value, fromIndex)
+ : baseFindIndex(array, baseIsNaN, fromIndex);
+ }
+ /**
+ * This function is like `baseIndexOf` except that it accepts a comparator.
+ *
+ * @private
+ * @param {Array} array The array to inspect.
+ * @param {*} value The value to search for.
+ * @param {number} fromIndex The index to search from.
+ * @param {Function} comparator The comparator invoked per element.
+ * @returns {number} Returns the index of the matched value, else `-1`.
+ */ function baseIndexOfWith(array, value, fromIndex, comparator) {
+ var index = fromIndex - 1,
+ length = array.length;
+ while (++index < length) {
+ if (comparator(array[index], value)) {
+ return index;
+ }
+ }
+ return -1;
+ }
+ /**
+ * The base implementation of `_.isNaN` without support for number objects.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
+ */ function baseIsNaN(value) {
+ return value !== value;
+ }
+ /**
+ * The base implementation of `_.mean` and `_.meanBy` without support for
+ * iteratee shorthands.
+ *
+ * @private
+ * @param {Array} array The array to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @returns {number} Returns the mean.
+ */ function baseMean(array, iteratee) {
+ var length = array == null ? 0 : array.length;
+ return length ? baseSum(array, iteratee) / length : NAN;
+ }
+ /**
+ * The base implementation of `_.property` without support for deep paths.
+ *
+ * @private
+ * @param {string} key The key of the property to get.
+ * @returns {Function} Returns the new accessor function.
+ */ function baseProperty(key) {
+ return function(object) {
+ return object == null ? undefined : object[key];
+ };
+ }
+ /**
+ * The base implementation of `_.propertyOf` without support for deep paths.
+ *
+ * @private
+ * @param {Object} object The object to query.
+ * @returns {Function} Returns the new accessor function.
+ */ function basePropertyOf(object) {
+ return function(key) {
+ return object == null ? undefined : object[key];
+ };
+ }
+ /**
+ * The base implementation of `_.reduce` and `_.reduceRight`, without support
+ * for iteratee shorthands, which iterates over `collection` using `eachFunc`.
+ *
+ * @private
+ * @param {Array|Object} collection The collection to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @param {*} accumulator The initial value.
+ * @param {boolean} initAccum Specify using the first or last element of
+ * `collection` as the initial value.
+ * @param {Function} eachFunc The function to iterate over `collection`.
+ * @returns {*} Returns the accumulated value.
+ */ function baseReduce(
+ collection,
+ iteratee,
+ accumulator,
+ initAccum,
+ eachFunc
+ ) {
+ eachFunc(collection, function(value, index, collection) {
+ accumulator = initAccum
+ ? ((initAccum = false), value)
+ : iteratee(accumulator, value, index, collection);
+ });
+ return accumulator;
+ }
+ /**
+ * The base implementation of `_.sortBy` which uses `comparer` to define the
+ * sort order of `array` and replaces criteria objects with their corresponding
+ * values.
+ *
+ * @private
+ * @param {Array} array The array to sort.
+ * @param {Function} comparer The function to define sort order.
+ * @returns {Array} Returns `array`.
+ */ function baseSortBy(array, comparer) {
+ var length = array.length;
+ array.sort(comparer);
+ while (length--) {
+ array[length] = array[length].value;
+ }
+ return array;
+ }
+ /**
+ * The base implementation of `_.sum` and `_.sumBy` without support for
+ * iteratee shorthands.
+ *
+ * @private
+ * @param {Array} array The array to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @returns {number} Returns the sum.
+ */ function baseSum(array, iteratee) {
+ var result,
+ index = -1,
+ length = array.length;
+ while (++index < length) {
+ var current = iteratee(array[index]);
+ if (current !== undefined) {
+ result = result === undefined ? current : result + current;
+ }
+ }
+ return result;
+ }
+ /**
+ * The base implementation of `_.times` without support for iteratee shorthands
+ * or max array length checks.
+ *
+ * @private
+ * @param {number} n The number of times to invoke `iteratee`.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @returns {Array} Returns the array of results.
+ */ function baseTimes(n, iteratee) {
+ var index = -1,
+ result = Array(n);
+ while (++index < n) {
+ result[index] = iteratee(index);
+ }
+ return result;
+ }
+ /**
+ * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array
+ * of key-value pairs for `object` corresponding to the property names of `props`.
+ *
+ * @private
+ * @param {Object} object The object to query.
+ * @param {Array} props The property names to get values for.
+ * @returns {Object} Returns the key-value pairs.
+ */ function baseToPairs(object, props) {
+ return arrayMap(props, function(key) {
+ return [key, object[key]];
+ });
+ }
+ /**
+ * The base implementation of `_.unary` without support for storing metadata.
+ *
+ * @private
+ * @param {Function} func The function to cap arguments for.
+ * @returns {Function} Returns the new capped function.
+ */ function baseUnary(func) {
+ return function(value) {
+ return func(value);
+ };
+ }
+ /**
+ * The base implementation of `_.values` and `_.valuesIn` which creates an
+ * array of `object` property values corresponding to the property names
+ * of `props`.
+ *
+ * @private
+ * @param {Object} object The object to query.
+ * @param {Array} props The property names to get values for.
+ * @returns {Object} Returns the array of property values.
+ */ function baseValues(object, props) {
+ return arrayMap(props, function(key) {
+ return object[key];
+ });
+ }
+ /**
+ * Checks if a `cache` value for `key` exists.
+ *
+ * @private
+ * @param {Object} cache The cache to query.
+ * @param {string} key The key of the entry to check.
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
+ */ function cacheHas(cache, key) {
+ return cache.has(key);
+ }
+ /**
+ * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol
+ * that is not found in the character symbols.
+ *
+ * @private
+ * @param {Array} strSymbols The string symbols to inspect.
+ * @param {Array} chrSymbols The character symbols to find.
+ * @returns {number} Returns the index of the first unmatched string symbol.
+ */ function charsStartIndex(strSymbols, chrSymbols) {
+ var index = -1,
+ length = strSymbols.length;
+ while (
+ ++index < length &&
+ baseIndexOf(chrSymbols, strSymbols[index], 0) > -1
+ ) {}
+ return index;
+ }
+ /**
+ * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol
+ * that is not found in the character symbols.
+ *
+ * @private
+ * @param {Array} strSymbols The string symbols to inspect.
+ * @param {Array} chrSymbols The character symbols to find.
+ * @returns {number} Returns the index of the last unmatched string symbol.
+ */ function charsEndIndex(strSymbols, chrSymbols) {
+ var index = strSymbols.length;
+ while (
+ index-- &&
+ baseIndexOf(chrSymbols, strSymbols[index], 0) > -1
+ ) {}
+ return index;
+ }
+ /**
+ * Gets the number of `placeholder` occurrences in `array`.
+ *
+ * @private
+ * @param {Array} array The array to inspect.
+ * @param {*} placeholder The placeholder to search for.
+ * @returns {number} Returns the placeholder count.
+ */ function countHolders(array, placeholder) {
+ var length = array.length,
+ result = 0;
+ while (length--) {
+ if (array[length] === placeholder) {
+ ++result;
+ }
+ }
+ return result;
+ }
+ /**
+ * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A
+ * letters to basic Latin letters.
+ *
+ * @private
+ * @param {string} letter The matched letter to deburr.
+ * @returns {string} Returns the deburred letter.
+ */ var deburrLetter = basePropertyOf(deburredLetters);
+ /**
+ * Used by `_.escape` to convert characters to HTML entities.
+ *
+ * @private
+ * @param {string} chr The matched character to escape.
+ * @returns {string} Returns the escaped character.
+ */ var escapeHtmlChar = basePropertyOf(htmlEscapes);
+ /**
+ * Used by `_.template` to escape characters for inclusion in compiled string literals.
+ *
+ * @private
+ * @param {string} chr The matched character to escape.
+ * @returns {string} Returns the escaped character.
+ */ function escapeStringChar(chr) {
+ return "\\" + stringEscapes[chr];
+ }
+ /**
+ * Gets the value at `key` of `object`.
+ *
+ * @private
+ * @param {Object} [object] The object to query.
+ * @param {string} key The key of the property to get.
+ * @returns {*} Returns the property value.
+ */ function getValue(object, key) {
+ return object == null ? undefined : object[key];
+ }
+ /**
+ * Checks if `string` contains Unicode symbols.
+ *
+ * @private
+ * @param {string} string The string to inspect.
+ * @returns {boolean} Returns `true` if a symbol is found, else `false`.
+ */ function hasUnicode(string) {
+ return reHasUnicode.test(string);
+ }
+ /**
+ * Checks if `string` contains a word composed of Unicode symbols.
+ *
+ * @private
+ * @param {string} string The string to inspect.
+ * @returns {boolean} Returns `true` if a word is found, else `false`.
+ */ function hasUnicodeWord(string) {
+ return reHasUnicodeWord.test(string);
+ }
+ /**
+ * Converts `iterator` to an array.
+ *
+ * @private
+ * @param {Object} iterator The iterator to convert.
+ * @returns {Array} Returns the converted array.
+ */ function iteratorToArray(iterator) {
+ var data,
+ result = [];
+ while (!(data = iterator.next()).done) {
+ result.push(data.value);
+ }
+ return result;
+ }
+ /**
+ * Converts `map` to its key-value pairs.
+ *
+ * @private
+ * @param {Object} map The map to convert.
+ * @returns {Array} Returns the key-value pairs.
+ */ function mapToArray(map) {
+ var index = -1,
+ result = Array(map.size);
+ map.forEach(function(value, key) {
+ result[++index] = [key, value];
+ });
+ return result;
+ }
+ /**
+ * Creates a unary function that invokes `func` with its argument transformed.
+ *
+ * @private
+ * @param {Function} func The function to wrap.
+ * @param {Function} transform The argument transform.
+ * @returns {Function} Returns the new function.
+ */ function overArg(func, transform) {
+ return function(arg) {
+ return func(transform(arg));
+ };
+ }
+ /**
+ * Replaces all `placeholder` elements in `array` with an internal placeholder
+ * and returns an array of their indexes.
+ *
+ * @private
+ * @param {Array} array The array to modify.
+ * @param {*} placeholder The placeholder to replace.
+ * @returns {Array} Returns the new array of placeholder indexes.
+ */ function replaceHolders(array, placeholder) {
+ var index = -1,
+ length = array.length,
+ resIndex = 0,
+ result = [];
+ while (++index < length) {
+ var value = array[index];
+ if (value === placeholder || value === PLACEHOLDER) {
+ array[index] = PLACEHOLDER;
+ result[resIndex++] = index;
+ }
+ }
+ return result;
+ }
+ /**
+ * Gets the value at `key`, unless `key` is "__proto__".
+ *
+ * @private
+ * @param {Object} object The object to query.
+ * @param {string} key The key of the property to get.
+ * @returns {*} Returns the property value.
+ */ function safeGet(object, key) {
+ return key == "__proto__" ? undefined : object[key];
+ }
+ /**
+ * Converts `set` to an array of its values.
+ *
+ * @private
+ * @param {Object} set The set to convert.
+ * @returns {Array} Returns the values.
+ */ function setToArray(set) {
+ var index = -1,
+ result = Array(set.size);
+ set.forEach(function(value) {
+ result[++index] = value;
+ });
+ return result;
+ }
+ /**
+ * Converts `set` to its value-value pairs.
+ *
+ * @private
+ * @param {Object} set The set to convert.
+ * @returns {Array} Returns the value-value pairs.
+ */ function setToPairs(set) {
+ var index = -1,
+ result = Array(set.size);
+ set.forEach(function(value) {
+ result[++index] = [value, value];
+ });
+ return result;
+ }
+ /**
+ * A specialized version of `_.indexOf` which performs strict equality
+ * comparisons of values, i.e. `===`.
+ *
+ * @private
+ * @param {Array} array The array to inspect.
+ * @param {*} value The value to search for.
+ * @param {number} fromIndex The index to search from.
+ * @returns {number} Returns the index of the matched value, else `-1`.
+ */ function strictIndexOf(array, value, fromIndex) {
+ var index = fromIndex - 1,
+ length = array.length;
+ while (++index < length) {
+ if (array[index] === value) {
+ return index;
+ }
+ }
+ return -1;
+ }
+ /**
+ * A specialized version of `_.lastIndexOf` which performs strict equality
+ * comparisons of values, i.e. `===`.
+ *
+ * @private
+ * @param {Array} array The array to inspect.
+ * @param {*} value The value to search for.
+ * @param {number} fromIndex The index to search from.
+ * @returns {number} Returns the index of the matched value, else `-1`.
+ */ function strictLastIndexOf(array, value, fromIndex) {
+ var index = fromIndex + 1;
+ while (index--) {
+ if (array[index] === value) {
+ return index;
+ }
+ }
+ return index;
+ }
+ /**
+ * Gets the number of symbols in `string`.
+ *
+ * @private
+ * @param {string} string The string to inspect.
+ * @returns {number} Returns the string size.
+ */ function stringSize(string) {
+ return hasUnicode(string)
+ ? unicodeSize(string)
+ : asciiSize(string);
+ }
+ /**
+ * Converts `string` to an array.
+ *
+ * @private
+ * @param {string} string The string to convert.
+ * @returns {Array} Returns the converted array.
+ */ function stringToArray(string) {
+ return hasUnicode(string)
+ ? unicodeToArray(string)
+ : asciiToArray(string);
+ }
+ /**
+ * Used by `_.unescape` to convert HTML entities to characters.
+ *
+ * @private
+ * @param {string} chr The matched character to unescape.
+ * @returns {string} Returns the unescaped character.
+ */ var unescapeHtmlChar = basePropertyOf(htmlUnescapes);
+ /**
+ * Gets the size of a Unicode `string`.
+ *
+ * @private
+ * @param {string} string The string inspect.
+ * @returns {number} Returns the string size.
+ */ function unicodeSize(string) {
+ var result = (reUnicode.lastIndex = 0);
+ while (reUnicode.test(string)) {
+ ++result;
+ }
+ return result;
+ }
+ /**
+ * Converts a Unicode `string` to an array.
+ *
+ * @private
+ * @param {string} string The string to convert.
+ * @returns {Array} Returns the converted array.
+ */ function unicodeToArray(string) {
+ return string.match(reUnicode) || [];
+ }
+ /**
+ * Splits a Unicode `string` into an array of its words.
+ *
+ * @private
+ * @param {string} The string to inspect.
+ * @returns {Array} Returns the words of `string`.
+ */ function unicodeWords(string) {
+ return string.match(reUnicodeWord) || [];
+ }
+ /*--------------------------------------------------------------------------*/ /**
+ * Create a new pristine `lodash` function using the `context` object.
+ *
+ * @static
+ * @memberOf _
+ * @since 1.1.0
+ * @category Util
+ * @param {Object} [context=root] The context object.
+ * @returns {Function} Returns a new `lodash` function.
+ * @example
+ *
+ * _.mixin({ 'foo': _.constant('foo') });
+ *
+ * var lodash = _.runInContext();
+ * lodash.mixin({ 'bar': lodash.constant('bar') });
+ *
+ * _.isFunction(_.foo);
+ * // => true
+ * _.isFunction(_.bar);
+ * // => false
+ *
+ * lodash.isFunction(lodash.foo);
+ * // => false
+ * lodash.isFunction(lodash.bar);
+ * // => true
+ *
+ * // Create a suped-up `defer` in Node.js.
+ * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer;
+ */ var runInContext = function runInContext(context) {
+ context =
+ context == null
+ ? root
+ : _.defaults(
+ root.Object(),
+ context,
+ _.pick(root, contextProps)
+ );
+ /** Built-in constructor references. */ var Array = context.Array,
+ Date = context.Date,
+ Error = context.Error,
+ Function = context.Function,
+ Math = context.Math,
+ Object = context.Object,
+ RegExp = context.RegExp,
+ String = context.String,
+ TypeError = context.TypeError;
+ /** Used for built-in method references. */ var arrayProto =
+ Array.prototype,
+ funcProto = Function.prototype,
+ objectProto = Object.prototype;
+ /** Used to detect overreaching core-js shims. */ var coreJsData =
+ context["__core-js_shared__"];
+ /** Used to resolve the decompiled source of functions. */ var funcToString =
+ funcProto.toString;
+ /** Used to check objects for own properties. */ var hasOwnProperty =
+ objectProto.hasOwnProperty;
+ /** Used to generate unique IDs. */ var idCounter = 0;
+ /** Used to detect methods masquerading as native. */ var maskSrcKey = (function() {
+ var uid = /[^.]+$/.exec(
+ (coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO) ||
+ ""
+ );
+ return uid ? "Symbol(src)_1." + uid : "";
+ })();
+ /**
+ * Used to resolve the
+ * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
+ * of values.
+ */ var nativeObjectToString = objectProto.toString;
+ /** Used to infer the `Object` constructor. */ var objectCtorString = funcToString.call(
+ Object
+ );
+ /** Used to restore the original `_` reference in `_.noConflict`. */ var oldDash =
+ root._;
+ /** Used to detect if a method is native. */ var reIsNative = RegExp(
+ "^" +
+ funcToString
+ .call(hasOwnProperty)
+ .replace(reRegExpChar, "\\$&")
+ .replace(
+ /hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,
+ "$1.*?"
+ ) +
+ "$"
+ );
+ /** Built-in value references. */ var Buffer = moduleExports
+ ? context.Buffer
+ : undefined,
+ _Symbol5 = context.Symbol,
+ Uint8Array = context.Uint8Array,
+ allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined,
+ getPrototype = overArg(Object.getPrototypeOf, Object),
+ objectCreate = Object.create,
+ propertyIsEnumerable = objectProto.propertyIsEnumerable,
+ splice = arrayProto.splice,
+ spreadableSymbol = _Symbol5
+ ? _Symbol5.isConcatSpreadable
+ : undefined,
+ symIterator = _Symbol5 ? _Symbol5.iterator : undefined,
+ symToStringTag = _Symbol5 ? _Symbol5.toStringTag : undefined;
+ var defineProperty = (function() {
+ try {
+ var func = getNative(Object, "defineProperty");
+ func({}, "", {});
+ return func;
+ } catch (e) {}
+ })();
+ /** Mocked built-ins. */ var ctxClearTimeout =
+ context.clearTimeout !== root.clearTimeout &&
+ context.clearTimeout,
+ ctxNow = Date && Date.now !== root.Date.now && Date.now,
+ ctxSetTimeout =
+ context.setTimeout !== root.setTimeout && context.setTimeout;
+ /* Built-in method references for those with the same name as other `lodash` methods. */ var nativeCeil =
+ Math.ceil,
+ nativeFloor = Math.floor,
+ nativeGetSymbols = Object.getOwnPropertySymbols,
+ nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,
+ nativeIsFinite = context.isFinite,
+ nativeJoin = arrayProto.join,
+ nativeKeys = overArg(Object.keys, Object),
+ nativeMax = Math.max,
+ nativeMin = Math.min,
+ nativeNow = Date.now,
+ nativeParseInt = context.parseInt,
+ nativeRandom = Math.random,
+ nativeReverse = arrayProto.reverse;
+ /* Built-in method references that are verified to be native. */ var DataView = getNative(
+ context,
+ "DataView"
+ ),
+ Map = getNative(context, "Map"),
+ Promise = getNative(context, "Promise"),
+ Set = getNative(context, "Set"),
+ WeakMap = getNative(context, "WeakMap"),
+ nativeCreate = getNative(Object, "create");
+ /** Used to store function metadata. */ var metaMap =
+ WeakMap && new WeakMap();
+ /** Used to lookup unminified function names. */ var realNames = {};
+ /** Used to detect maps, sets, and weakmaps. */ var dataViewCtorString = toSource(
+ DataView
+ ),
+ mapCtorString = toSource(Map),
+ promiseCtorString = toSource(Promise),
+ setCtorString = toSource(Set),
+ weakMapCtorString = toSource(WeakMap);
+ /** Used to convert symbols to primitives and strings. */ var symbolProto = _Symbol5
+ ? _Symbol5.prototype
+ : undefined,
+ symbolValueOf = symbolProto ? symbolProto.valueOf : undefined,
+ symbolToString = symbolProto ? symbolProto.toString : undefined;
+ /*------------------------------------------------------------------------*/ /**
+ * Creates a `lodash` object which wraps `value` to enable implicit method
+ * chain sequences. Methods that operate on and return arrays, collections,
+ * and functions can be chained together. Methods that retrieve a single value
+ * or may return a primitive value will automatically end the chain sequence
+ * and return the unwrapped value. Otherwise, the value must be unwrapped
+ * with `_#value`.
+ *
+ * Explicit chain sequences, which must be unwrapped with `_#value`, may be
+ * enabled using `_.chain`.
+ *
+ * The execution of chained methods is lazy, that is, it's deferred until
+ * `_#value` is implicitly or explicitly called.
+ *
+ * Lazy evaluation allows several methods to support shortcut fusion.
+ * Shortcut fusion is an optimization to merge iteratee calls; this avoids
+ * the creation of intermediate arrays and can greatly reduce the number of
+ * iteratee executions. Sections of a chain sequence qualify for shortcut
+ * fusion if the section is applied to an array and iteratees accept only
+ * one argument. The heuristic for whether a section qualifies for shortcut
+ * fusion is subject to change.
+ *
+ * Chaining is supported in custom builds as long as the `_#value` method is
+ * directly or indirectly included in the build.
+ *
+ * In addition to lodash methods, wrappers have `Array` and `String` methods.
+ *
+ * The wrapper `Array` methods are:
+ * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift`
+ *
+ * The wrapper `String` methods are:
+ * `replace` and `split`
+ *
+ * The wrapper methods that support shortcut fusion are:
+ * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`,
+ * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`,
+ * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray`
+ *
+ * The chainable wrapper methods are:
+ * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`,
+ * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`,
+ * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`,
+ * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`,
+ * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`,
+ * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`,
+ * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`,
+ * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`,
+ * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`,
+ * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`,
+ * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`,
+ * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`,
+ * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`,
+ * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`,
+ * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`,
+ * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`,
+ * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`,
+ * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`,
+ * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`,
+ * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`,
+ * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`,
+ * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`,
+ * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`,
+ * `zipObject`, `zipObjectDeep`, and `zipWith`
+ *
+ * The wrapper methods that are **not** chainable by default are:
+ * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,
+ * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`,
+ * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`,
+ * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`,
+ * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`,
+ * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`,
+ * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`,
+ * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`,
+ * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`,
+ * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`,
+ * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`,
+ * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`,
+ * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`,
+ * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`,
+ * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`,
+ * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`,
+ * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`,
+ * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`,
+ * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`,
+ * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`,
+ * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`,
+ * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`,
+ * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`,
+ * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`,
+ * `upperFirst`, `value`, and `words`
+ *
+ * @name _
+ * @constructor
+ * @category Seq
+ * @param {*} value The value to wrap in a `lodash` instance.
+ * @returns {Object} Returns the new `lodash` wrapper instance.
+ * @example
+ *
+ * function square(n) {
+ * return n * n;
+ * }
+ *
+ * var wrapped = _([1, 2, 3]);
+ *
+ * // Returns an unwrapped value.
+ * wrapped.reduce(_.add);
+ * // => 6
+ *
+ * // Returns a wrapped value.
+ * var squares = wrapped.map(square);
+ *
+ * _.isArray(squares);
+ * // => false
+ *
+ * _.isArray(squares.value());
+ * // => true
+ */ function lodash(value) {
+ if (
+ isObjectLike(value) &&
+ !isArray(value) &&
+ !(value instanceof LazyWrapper)
+ ) {
+ if (value instanceof LodashWrapper) {
+ return value;
+ }
+ if (hasOwnProperty.call(value, "__wrapped__")) {
+ return wrapperClone(value);
+ }
+ }
+ return new LodashWrapper(value);
+ }
+ /**
+ * The base implementation of `_.create` without support for assigning
+ * properties to the created object.
+ *
+ * @private
+ * @param {Object} proto The object to inherit from.
+ * @returns {Object} Returns the new object.
+ */ var baseCreate = (function() {
+ function object() {}
+ return function(proto) {
+ if (!isObject(proto)) {
+ return {};
+ }
+ if (objectCreate) {
+ return objectCreate(proto);
+ }
+ object.prototype = proto;
+ var result = new object();
+ object.prototype = undefined;
+ return result;
+ };
+ })();
+ /**
+ * The function whose prototype chain sequence wrappers inherit from.
+ *
+ * @private
+ */ function baseLodash() {} // No operation performed.
+ /**
+ * The base constructor for creating `lodash` wrapper objects.
+ *
+ * @private
+ * @param {*} value The value to wrap.
+ * @param {boolean} [chainAll] Enable explicit method chain sequences.
+ */ function LodashWrapper(value, chainAll) {
+ this.__wrapped__ = value;
+ this.__actions__ = [];
+ this.__chain__ = !!chainAll;
+ this.__index__ = 0;
+ this.__values__ = undefined;
+ }
+ /**
+ * By default, the template delimiters used by lodash are like those in
+ * embedded Ruby (ERB) as well as ES2015 template strings. Change the
+ * following template settings to use alternative delimiters.
+ *
+ * @static
+ * @memberOf _
+ * @type {Object}
+ */ lodash.templateSettings = {
+ /**
+ * Used to detect `data` property values to be HTML-escaped.
+ *
+ * @memberOf _.templateSettings
+ * @type {RegExp}
+ */ escape: reEscape,
+ /**
+ * Used to detect code to be evaluated.
+ *
+ * @memberOf _.templateSettings
+ * @type {RegExp}
+ */ evaluate: reEvaluate,
+ /**
+ * Used to detect `data` property values to inject.
+ *
+ * @memberOf _.templateSettings
+ * @type {RegExp}
+ */ interpolate: reInterpolate,
+ /**
+ * Used to reference the data object in the template text.
+ *
+ * @memberOf _.templateSettings
+ * @type {string}
+ */ variable: "",
+ /**
+ * Used to import variables into the compiled template.
+ *
+ * @memberOf _.templateSettings
+ * @type {Object}
+ */ imports: {
+ /**
+ * A reference to the `lodash` function.
+ *
+ * @memberOf _.templateSettings.imports
+ * @type {Function}
+ */ _: lodash
+ }
+ }; // Ensure wrappers are instances of `baseLodash`.
+ lodash.prototype = baseLodash.prototype;
+ lodash.prototype.constructor = lodash;
+ LodashWrapper.prototype = baseCreate(baseLodash.prototype);
+ LodashWrapper.prototype.constructor = LodashWrapper;
+ /*------------------------------------------------------------------------*/ /**
+ * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.
+ *
+ * @private
+ * @constructor
+ * @param {*} value The value to wrap.
+ */ function LazyWrapper(value) {
+ this.__wrapped__ = value;
+ this.__actions__ = [];
+ this.__dir__ = 1;
+ this.__filtered__ = false;
+ this.__iteratees__ = [];
+ this.__takeCount__ = MAX_ARRAY_LENGTH;
+ this.__views__ = [];
+ }
+ /**
+ * Creates a clone of the lazy wrapper object.
+ *
+ * @private
+ * @name clone
+ * @memberOf LazyWrapper
+ * @returns {Object} Returns the cloned `LazyWrapper` object.
+ */ function lazyClone() {
+ var result = new LazyWrapper(this.__wrapped__);
+ result.__actions__ = copyArray(this.__actions__);
+ result.__dir__ = this.__dir__;
+ result.__filtered__ = this.__filtered__;
+ result.__iteratees__ = copyArray(this.__iteratees__);
+ result.__takeCount__ = this.__takeCount__;
+ result.__views__ = copyArray(this.__views__);
+ return result;
+ }
+ /**
+ * Reverses the direction of lazy iteration.
+ *
+ * @private
+ * @name reverse
+ * @memberOf LazyWrapper
+ * @returns {Object} Returns the new reversed `LazyWrapper` object.
+ */ function lazyReverse() {
+ if (this.__filtered__) {
+ var result = new LazyWrapper(this);
+ result.__dir__ = -1;
+ result.__filtered__ = true;
+ } else {
+ result = this.clone();
+ result.__dir__ *= -1;
+ }
+ return result;
+ }
+ /**
+ * Extracts the unwrapped value from its lazy wrapper.
+ *
+ * @private
+ * @name value
+ * @memberOf LazyWrapper
+ * @returns {*} Returns the unwrapped value.
+ */ function lazyValue() {
+ var array = this.__wrapped__.value(),
+ dir = this.__dir__,
+ isArr = isArray(array),
+ isRight = dir < 0,
+ arrLength = isArr ? array.length : 0,
+ view = getView(0, arrLength, this.__views__),
+ start = view.start,
+ end = view.end,
+ length = end - start,
+ index = isRight ? end : start - 1,
+ iteratees = this.__iteratees__,
+ iterLength = iteratees.length,
+ resIndex = 0,
+ takeCount = nativeMin(length, this.__takeCount__);
+ if (
+ !isArr ||
+ (!isRight && arrLength == length && takeCount == length)
+ ) {
+ return baseWrapperValue(array, this.__actions__);
+ }
+ var result = [];
+ outer: while (length-- && resIndex < takeCount) {
+ index += dir;
+ var iterIndex = -1,
+ value = array[index];
+ while (++iterIndex < iterLength) {
+ var data = iteratees[iterIndex],
+ iteratee = data.iteratee,
+ type = data.type,
+ computed = iteratee(value);
+ if (type == LAZY_MAP_FLAG) {
+ value = computed;
+ } else if (!computed) {
+ if (type == LAZY_FILTER_FLAG) {
+ continue outer;
+ } else {
+ break outer;
+ }
+ }
+ }
+ result[resIndex++] = value;
+ }
+ return result;
+ } // Ensure `LazyWrapper` is an instance of `baseLodash`.
+ LazyWrapper.prototype = baseCreate(baseLodash.prototype);
+ LazyWrapper.prototype.constructor = LazyWrapper;
+ /*------------------------------------------------------------------------*/ /**
+ * Creates a hash object.
+ *
+ * @private
+ * @constructor
+ * @param {Array} [entries] The key-value pairs to cache.
+ */ function Hash(entries) {
+ var index = -1,
+ length = entries == null ? 0 : entries.length;
+ this.clear();
+ while (++index < length) {
+ var entry = entries[index];
+ this.set(entry[0], entry[1]);
+ }
+ }
+ /**
+ * Removes all key-value entries from the hash.
+ *
+ * @private
+ * @name clear
+ * @memberOf Hash
+ */ function hashClear() {
+ this.__data__ = nativeCreate ? nativeCreate(null) : {};
+ this.size = 0;
+ }
+ /**
+ * Removes `key` and its value from the hash.
+ *
+ * @private
+ * @name delete
+ * @memberOf Hash
+ * @param {Object} hash The hash to modify.
+ * @param {string} key The key of the value to remove.
+ * @returns {boolean} Returns `true` if the entry was removed, else `false`.
+ */ function hashDelete(key) {
+ var result = this.has(key) && delete this.__data__[key];
+ this.size -= result ? 1 : 0;
+ return result;
+ }
+ /**
+ * Gets the hash value for `key`.
+ *
+ * @private
+ * @name get
+ * @memberOf Hash
+ * @param {string} key The key of the value to get.
+ * @returns {*} Returns the entry value.
+ */ function hashGet(key) {
+ var data = this.__data__;
+ if (nativeCreate) {
+ var result = data[key];
+ return result === HASH_UNDEFINED ? undefined : result;
+ }
+ return hasOwnProperty.call(data, key) ? data[key] : undefined;
+ }
+ /**
+ * Checks if a hash value for `key` exists.
+ *
+ * @private
+ * @name has
+ * @memberOf Hash
+ * @param {string} key The key of the entry to check.
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
+ */ function hashHas(key) {
+ var data = this.__data__;
+ return nativeCreate
+ ? data[key] !== undefined
+ : hasOwnProperty.call(data, key);
+ }
+ /**
+ * Sets the hash `key` to `value`.
+ *
+ * @private
+ * @name set
+ * @memberOf Hash
+ * @param {string} key The key of the value to set.
+ * @param {*} value The value to set.
+ * @returns {Object} Returns the hash instance.
+ */ function hashSet(key, value) {
+ var data = this.__data__;
+ this.size += this.has(key) ? 0 : 1;
+ data[key] =
+ nativeCreate && value === undefined ? HASH_UNDEFINED : value;
+ return this;
+ } // Add methods to `Hash`.
+ Hash.prototype.clear = hashClear;
+ Hash.prototype["delete"] = hashDelete;
+ Hash.prototype.get = hashGet;
+ Hash.prototype.has = hashHas;
+ Hash.prototype.set = hashSet;
+ /*------------------------------------------------------------------------*/ /**
+ * Creates an list cache object.
+ *
+ * @private
+ * @constructor
+ * @param {Array} [entries] The key-value pairs to cache.
+ */ function ListCache(entries) {
+ var index = -1,
+ length = entries == null ? 0 : entries.length;
+ this.clear();
+ while (++index < length) {
+ var entry = entries[index];
+ this.set(entry[0], entry[1]);
+ }
+ }
+ /**
+ * Removes all key-value entries from the list cache.
+ *
+ * @private
+ * @name clear
+ * @memberOf ListCache
+ */ function listCacheClear() {
+ this.__data__ = [];
+ this.size = 0;
+ }
+ /**
+ * Removes `key` and its value from the list cache.
+ *
+ * @private
+ * @name delete
+ * @memberOf ListCache
+ * @param {string} key The key of the value to remove.
+ * @returns {boolean} Returns `true` if the entry was removed, else `false`.
+ */ function listCacheDelete(key) {
+ var data = this.__data__,
+ index = assocIndexOf(data, key);
+ if (index < 0) {
+ return false;
+ }
+ var lastIndex = data.length - 1;
+ if (index == lastIndex) {
+ data.pop();
+ } else {
+ splice.call(data, index, 1);
+ }
+ --this.size;
+ return true;
+ }
+ /**
+ * Gets the list cache value for `key`.
+ *
+ * @private
+ * @name get
+ * @memberOf ListCache
+ * @param {string} key The key of the value to get.
+ * @returns {*} Returns the entry value.
+ */ function listCacheGet(key) {
+ var data = this.__data__,
+ index = assocIndexOf(data, key);
+ return index < 0 ? undefined : data[index][1];
+ }
+ /**
+ * Checks if a list cache value for `key` exists.
+ *
+ * @private
+ * @name has
+ * @memberOf ListCache
+ * @param {string} key The key of the entry to check.
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
+ */ function listCacheHas(key) {
+ return assocIndexOf(this.__data__, key) > -1;
+ }
+ /**
+ * Sets the list cache `key` to `value`.
+ *
+ * @private
+ * @name set
+ * @memberOf ListCache
+ * @param {string} key The key of the value to set.
+ * @param {*} value The value to set.
+ * @returns {Object} Returns the list cache instance.
+ */ function listCacheSet(key, value) {
+ var data = this.__data__,
+ index = assocIndexOf(data, key);
+ if (index < 0) {
+ ++this.size;
+ data.push([key, value]);
+ } else {
+ data[index][1] = value;
+ }
+ return this;
+ } // Add methods to `ListCache`.
+ ListCache.prototype.clear = listCacheClear;
+ ListCache.prototype["delete"] = listCacheDelete;
+ ListCache.prototype.get = listCacheGet;
+ ListCache.prototype.has = listCacheHas;
+ ListCache.prototype.set = listCacheSet;
+ /*------------------------------------------------------------------------*/ /**
+ * Creates a map cache object to store key-value pairs.
+ *
+ * @private
+ * @constructor
+ * @param {Array} [entries] The key-value pairs to cache.
+ */ function MapCache(entries) {
+ var index = -1,
+ length = entries == null ? 0 : entries.length;
+ this.clear();
+ while (++index < length) {
+ var entry = entries[index];
+ this.set(entry[0], entry[1]);
+ }
+ }
+ /**
+ * Removes all key-value entries from the map.
+ *
+ * @private
+ * @name clear
+ * @memberOf MapCache
+ */ function mapCacheClear() {
+ this.size = 0;
+ this.__data__ = {
+ hash: new Hash(),
+ map: new (Map || ListCache)(),
+ string: new Hash()
+ };
+ }
+ /**
+ * Removes `key` and its value from the map.
+ *
+ * @private
+ * @name delete
+ * @memberOf MapCache
+ * @param {string} key The key of the value to remove.
+ * @returns {boolean} Returns `true` if the entry was removed, else `false`.
+ */ function mapCacheDelete(key) {
+ var result = getMapData(this, key)["delete"](key);
+ this.size -= result ? 1 : 0;
+ return result;
+ }
+ /**
+ * Gets the map value for `key`.
+ *
+ * @private
+ * @name get
+ * @memberOf MapCache
+ * @param {string} key The key of the value to get.
+ * @returns {*} Returns the entry value.
+ */ function mapCacheGet(key) {
+ return getMapData(this, key).get(key);
+ }
+ /**
+ * Checks if a map value for `key` exists.
+ *
+ * @private
+ * @name has
+ * @memberOf MapCache
+ * @param {string} key The key of the entry to check.
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
+ */ function mapCacheHas(key) {
+ return getMapData(this, key).has(key);
+ }
+ /**
+ * Sets the map `key` to `value`.
+ *
+ * @private
+ * @name set
+ * @memberOf MapCache
+ * @param {string} key The key of the value to set.
+ * @param {*} value The value to set.
+ * @returns {Object} Returns the map cache instance.
+ */ function mapCacheSet(key, value) {
+ var data = getMapData(this, key),
+ size = data.size;
+ data.set(key, value);
+ this.size += data.size == size ? 0 : 1;
+ return this;
+ } // Add methods to `MapCache`.
+ MapCache.prototype.clear = mapCacheClear;
+ MapCache.prototype["delete"] = mapCacheDelete;
+ MapCache.prototype.get = mapCacheGet;
+ MapCache.prototype.has = mapCacheHas;
+ MapCache.prototype.set = mapCacheSet;
+ /*------------------------------------------------------------------------*/ /**
+ *
+ * Creates an array cache object to store unique values.
+ *
+ * @private
+ * @constructor
+ * @param {Array} [values] The values to cache.
+ */ function SetCache(values) {
+ var index = -1,
+ length = values == null ? 0 : values.length;
+ this.__data__ = new MapCache();
+ while (++index < length) {
+ this.add(values[index]);
+ }
+ }
+ /**
+ * Adds `value` to the array cache.
+ *
+ * @private
+ * @name add
+ * @memberOf SetCache
+ * @alias push
+ * @param {*} value The value to cache.
+ * @returns {Object} Returns the cache instance.
+ */ function setCacheAdd(value) {
+ this.__data__.set(value, HASH_UNDEFINED);
+ return this;
+ }
+ /**
+ * Checks if `value` is in the array cache.
+ *
+ * @private
+ * @name has
+ * @memberOf SetCache
+ * @param {*} value The value to search for.
+ * @returns {number} Returns `true` if `value` is found, else `false`.
+ */ function setCacheHas(value) {
+ return this.__data__.has(value);
+ } // Add methods to `SetCache`.
+ SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
+ SetCache.prototype.has = setCacheHas;
+ /*------------------------------------------------------------------------*/ /**
+ * Creates a stack cache object to store key-value pairs.
+ *
+ * @private
+ * @constructor
+ * @param {Array} [entries] The key-value pairs to cache.
+ */ function Stack(entries) {
+ var data = (this.__data__ = new ListCache(entries));
+ this.size = data.size;
+ }
+ /**
+ * Removes all key-value entries from the stack.
+ *
+ * @private
+ * @name clear
+ * @memberOf Stack
+ */ function stackClear() {
+ this.__data__ = new ListCache();
+ this.size = 0;
+ }
+ /**
+ * Removes `key` and its value from the stack.
+ *
+ * @private
+ * @name delete
+ * @memberOf Stack
+ * @param {string} key The key of the value to remove.
+ * @returns {boolean} Returns `true` if the entry was removed, else `false`.
+ */ function stackDelete(key) {
+ var data = this.__data__,
+ result = data["delete"](key);
+ this.size = data.size;
+ return result;
+ }
+ /**
+ * Gets the stack value for `key`.
+ *
+ * @private
+ * @name get
+ * @memberOf Stack
+ * @param {string} key The key of the value to get.
+ * @returns {*} Returns the entry value.
+ */ function stackGet(key) {
+ return this.__data__.get(key);
+ }
+ /**
+ * Checks if a stack value for `key` exists.
+ *
+ * @private
+ * @name has
+ * @memberOf Stack
+ * @param {string} key The key of the entry to check.
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
+ */ function stackHas(key) {
+ return this.__data__.has(key);
+ }
+ /**
+ * Sets the stack `key` to `value`.
+ *
+ * @private
+ * @name set
+ * @memberOf Stack
+ * @param {string} key The key of the value to set.
+ * @param {*} value The value to set.
+ * @returns {Object} Returns the stack cache instance.
+ */ function stackSet(key, value) {
+ var data = this.__data__;
+ if (data instanceof ListCache) {
+ var pairs = data.__data__;
+ if (!Map || pairs.length < LARGE_ARRAY_SIZE - 1) {
+ pairs.push([key, value]);
+ this.size = ++data.size;
+ return this;
+ }
+ data = this.__data__ = new MapCache(pairs);
+ }
+ data.set(key, value);
+ this.size = data.size;
+ return this;
+ } // Add methods to `Stack`.
+ Stack.prototype.clear = stackClear;
+ Stack.prototype["delete"] = stackDelete;
+ Stack.prototype.get = stackGet;
+ Stack.prototype.has = stackHas;
+ Stack.prototype.set = stackSet;
+ /*------------------------------------------------------------------------*/ /**
+ * Creates an array of the enumerable property names of the array-like `value`.
+ *
+ * @private
+ * @param {*} value The value to query.
+ * @param {boolean} inherited Specify returning inherited property names.
+ * @returns {Array} Returns the array of property names.
+ */ function arrayLikeKeys(value, inherited) {
+ var isArr = isArray(value),
+ isArg = !isArr && isArguments(value),
+ isBuff = !isArr && !isArg && isBuffer(value),
+ isType = !isArr && !isArg && !isBuff && isTypedArray(value),
+ skipIndexes = isArr || isArg || isBuff || isType,
+ result = skipIndexes ? baseTimes(value.length, String) : [],
+ length = result.length;
+ for (var key in value) {
+ if (
+ (inherited || hasOwnProperty.call(value, key)) &&
+ !(
+ skipIndexes && // Safari 9 has enumerable `arguments.length` in strict mode.
+ (key == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
+ (isBuff && (key == "offset" || key == "parent")) || // PhantomJS 2 has enumerable non-index properties on typed arrays.
+ (isType &&
+ (key == "buffer" ||
+ key == "byteLength" ||
+ key == "byteOffset")) || // Skip index properties.
+ isIndex(key, length))
+ )
+ ) {
+ result.push(key);
+ }
+ }
+ return result;
+ }
+ /**
+ * A specialized version of `_.sample` for arrays.
+ *
+ * @private
+ * @param {Array} array The array to sample.
+ * @returns {*} Returns the random element.
+ */ function arraySample(array) {
+ var length = array.length;
+ return length ? array[baseRandom(0, length - 1)] : undefined;
+ }
+ /**
+ * A specialized version of `_.sampleSize` for arrays.
+ *
+ * @private
+ * @param {Array} array The array to sample.
+ * @param {number} n The number of elements to sample.
+ * @returns {Array} Returns the random elements.
+ */ function arraySampleSize(array, n) {
+ return shuffleSelf(
+ copyArray(array),
+ baseClamp(n, 0, array.length)
+ );
+ }
+ /**
+ * A specialized version of `_.shuffle` for arrays.
+ *
+ * @private
+ * @param {Array} array The array to shuffle.
+ * @returns {Array} Returns the new shuffled array.
+ */ function arrayShuffle(array) {
+ return shuffleSelf(copyArray(array));
+ }
+ /**
+ * This function is like `assignValue` except that it doesn't assign
+ * `undefined` values.
+ *
+ * @private
+ * @param {Object} object The object to modify.
+ * @param {string} key The key of the property to assign.
+ * @param {*} value The value to assign.
+ */ function assignMergeValue(object, key, value) {
+ if (
+ (value !== undefined && !eq(object[key], value)) ||
+ (value === undefined && !(key in object))
+ ) {
+ baseAssignValue(object, key, value);
+ }
+ }
+ /**
+ * Assigns `value` to `key` of `object` if the existing value is not equivalent
+ * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
+ * for equality comparisons.
+ *
+ * @private
+ * @param {Object} object The object to modify.
+ * @param {string} key The key of the property to assign.
+ * @param {*} value The value to assign.
+ */ function assignValue(object, key, value) {
+ var objValue = object[key];
+ if (
+ !(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
+ (value === undefined && !(key in object))
+ ) {
+ baseAssignValue(object, key, value);
+ }
+ }
+ /**
+ * Gets the index at which the `key` is found in `array` of key-value pairs.
+ *
+ * @private
+ * @param {Array} array The array to inspect.
+ * @param {*} key The key to search for.
+ * @returns {number} Returns the index of the matched value, else `-1`.
+ */ function assocIndexOf(array, key) {
+ var length = array.length;
+ while (length--) {
+ if (eq(array[length][0], key)) {
+ return length;
+ }
+ }
+ return -1;
+ }
+ /**
+ * Aggregates elements of `collection` on `accumulator` with keys transformed
+ * by `iteratee` and values set by `setter`.
+ *
+ * @private
+ * @param {Array|Object} collection The collection to iterate over.
+ * @param {Function} setter The function to set `accumulator` values.
+ * @param {Function} iteratee The iteratee to transform keys.
+ * @param {Object} accumulator The initial aggregated object.
+ * @returns {Function} Returns `accumulator`.
+ */ function baseAggregator(
+ collection,
+ setter,
+ iteratee,
+ accumulator
+ ) {
+ baseEach(collection, function(value, key, collection) {
+ setter(accumulator, value, iteratee(value), collection);
+ });
+ return accumulator;
+ }
+ /**
+ * The base implementation of `_.assign` without support for multiple sources
+ * or `customizer` functions.
+ *
+ * @private
+ * @param {Object} object The destination object.
+ * @param {Object} source The source object.
+ * @returns {Object} Returns `object`.
+ */ function baseAssign(object, source) {
+ return object && copyObject(source, keys(source), object);
+ }
+ /**
+ * The base implementation of `_.assignIn` without support for multiple sources
+ * or `customizer` functions.
+ *
+ * @private
+ * @param {Object} object The destination object.
+ * @param {Object} source The source object.
+ * @returns {Object} Returns `object`.
+ */ function baseAssignIn(object, source) {
+ return object && copyObject(source, keysIn(source), object);
+ }
+ /**
+ * The base implementation of `assignValue` and `assignMergeValue` without
+ * value checks.
+ *
+ * @private
+ * @param {Object} object The object to modify.
+ * @param {string} key The key of the property to assign.
+ * @param {*} value The value to assign.
+ */ function baseAssignValue(object, key, value) {
+ if (key == "__proto__" && defineProperty) {
+ defineProperty(object, key, {
+ configurable: true,
+ enumerable: true,
+ value: value,
+ writable: true
+ });
+ } else {
+ object[key] = value;
+ }
+ }
+ /**
+ * The base implementation of `_.at` without support for individual paths.
+ *
+ * @private
+ * @param {Object} object The object to iterate over.
+ * @param {string[]} paths The property paths to pick.
+ * @returns {Array} Returns the picked elements.
+ */ function baseAt(object, paths) {
+ var index = -1,
+ length = paths.length,
+ result = Array(length),
+ skip = object == null;
+ while (++index < length) {
+ result[index] = skip ? undefined : get(object, paths[index]);
+ }
+ return result;
+ }
+ /**
+ * The base implementation of `_.clamp` which doesn't coerce arguments.
+ *
+ * @private
+ * @param {number} number The number to clamp.
+ * @param {number} [lower] The lower bound.
+ * @param {number} upper The upper bound.
+ * @returns {number} Returns the clamped number.
+ */ function baseClamp(number, lower, upper) {
+ if (number === number) {
+ if (upper !== undefined) {
+ number = number <= upper ? number : upper;
+ }
+ if (lower !== undefined) {
+ number = number >= lower ? number : lower;
+ }
+ }
+ return number;
+ }
+ /**
+ * The base implementation of `_.clone` and `_.cloneDeep` which tracks
+ * traversed objects.
+ *
+ * @private
+ * @param {*} value The value to clone.
+ * @param {boolean} bitmask The bitmask flags.
+ * 1 - Deep clone
+ * 2 - Flatten inherited properties
+ * 4 - Clone symbols
+ * @param {Function} [customizer] The function to customize cloning.
+ * @param {string} [key] The key of `value`.
+ * @param {Object} [object] The parent object of `value`.
+ * @param {Object} [stack] Tracks traversed objects and their clone counterparts.
+ * @returns {*} Returns the cloned value.
+ */ function baseClone(
+ value,
+ bitmask,
+ customizer,
+ key,
+ object,
+ stack
+ ) {
+ var result,
+ isDeep = bitmask & CLONE_DEEP_FLAG,
+ isFlat = bitmask & CLONE_FLAT_FLAG,
+ isFull = bitmask & CLONE_SYMBOLS_FLAG;
+ if (customizer) {
+ result = object
+ ? customizer(value, key, object, stack)
+ : customizer(value);
+ }
+ if (result !== undefined) {
+ return result;
+ }
+ if (!isObject(value)) {
+ return value;
+ }
+ var isArr = isArray(value);
+ if (isArr) {
+ result = initCloneArray(value);
+ if (!isDeep) {
+ return copyArray(value, result);
+ }
+ } else {
+ var tag = getTag(value),
+ isFunc = tag == funcTag || tag == genTag;
+ if (isBuffer(value)) {
+ return cloneBuffer(value, isDeep);
+ }
+ if (
+ tag == objectTag ||
+ tag == argsTag ||
+ (isFunc && !object)
+ ) {
+ result = isFlat || isFunc ? {} : initCloneObject(value);
+ if (!isDeep) {
+ return isFlat
+ ? copySymbolsIn(value, baseAssignIn(result, value))
+ : copySymbols(value, baseAssign(result, value));
+ }
+ } else {
+ if (!cloneableTags[tag]) {
+ return object ? value : {};
+ }
+ result = initCloneByTag(value, tag, isDeep);
+ }
+ } // Check for circular references and return its corresponding clone.
+ stack || (stack = new Stack());
+ var stacked = stack.get(value);
+ if (stacked) {
+ return stacked;
+ }
+ stack.set(value, result);
+ if (isSet(value)) {
+ value.forEach(function(subValue) {
+ result.add(
+ baseClone(
+ subValue,
+ bitmask,
+ customizer,
+ subValue,
+ value,
+ stack
+ )
+ );
+ });
+ return result;
+ }
+ if (isMap(value)) {
+ value.forEach(function(subValue, key) {
+ result.set(
+ key,
+ baseClone(
+ subValue,
+ bitmask,
+ customizer,
+ key,
+ value,
+ stack
+ )
+ );
+ });
+ return result;
+ }
+ var keysFunc = isFull
+ ? isFlat ? getAllKeysIn : getAllKeys
+ : isFlat ? keysIn : keys;
+ var props = isArr ? undefined : keysFunc(value);
+ arrayEach(props || value, function(subValue, key) {
+ if (props) {
+ key = subValue;
+ subValue = value[key];
+ } // Recursively populate clone (susceptible to call stack limits).
+ assignValue(
+ result,
+ key,
+ baseClone(subValue, bitmask, customizer, key, value, stack)
+ );
+ });
+ return result;
+ }
+ /**
+ * The base implementation of `_.conforms` which doesn't clone `source`.
+ *
+ * @private
+ * @param {Object} source The object of property predicates to conform to.
+ * @returns {Function} Returns the new spec function.
+ */ function baseConforms(source) {
+ var props = keys(source);
+ return function(object) {
+ return baseConformsTo(object, source, props);
+ };
+ }
+ /**
+ * The base implementation of `_.conformsTo` which accepts `props` to check.
+ *
+ * @private
+ * @param {Object} object The object to inspect.
+ * @param {Object} source The object of property predicates to conform to.
+ * @returns {boolean} Returns `true` if `object` conforms, else `false`.
+ */ function baseConformsTo(object, source, props) {
+ var length = props.length;
+ if (object == null) {
+ return !length;
+ }
+ object = Object(object);
+ while (length--) {
+ var key = props[length],
+ predicate = source[key],
+ value = object[key];
+ if (
+ (value === undefined && !(key in object)) ||
+ !predicate(value)
+ ) {
+ return false;
+ }
+ }
+ return true;
+ }
+ /**
+ * The base implementation of `_.delay` and `_.defer` which accepts `args`
+ * to provide to `func`.
+ *
+ * @private
+ * @param {Function} func The function to delay.
+ * @param {number} wait The number of milliseconds to delay invocation.
+ * @param {Array} args The arguments to provide to `func`.
+ * @returns {number|Object} Returns the timer id or timeout object.
+ */ function baseDelay(func, wait, args) {
+ if (typeof func != "function") {
+ throw new TypeError(FUNC_ERROR_TEXT);
+ }
+ return setTimeout(function() {
+ func.apply(undefined, args);
+ }, wait);
+ }
+ /**
+ * The base implementation of methods like `_.difference` without support
+ * for excluding multiple arrays or iteratee shorthands.
+ *
+ * @private
+ * @param {Array} array The array to inspect.
+ * @param {Array} values The values to exclude.
+ * @param {Function} [iteratee] The iteratee invoked per element.
+ * @param {Function} [comparator] The comparator invoked per element.
+ * @returns {Array} Returns the new array of filtered values.
+ */ function baseDifference(array, values, iteratee, comparator) {
+ var index = -1,
+ includes = arrayIncludes,
+ isCommon = true,
+ length = array.length,
+ result = [],
+ valuesLength = values.length;
+ if (!length) {
+ return result;
+ }
+ if (iteratee) {
+ values = arrayMap(values, baseUnary(iteratee));
+ }
+ if (comparator) {
+ includes = arrayIncludesWith;
+ isCommon = false;
+ } else if (values.length >= LARGE_ARRAY_SIZE) {
+ includes = cacheHas;
+ isCommon = false;
+ values = new SetCache(values);
+ }
+ outer: while (++index < length) {
+ var value = array[index],
+ computed = iteratee == null ? value : iteratee(value);
+ value = comparator || value !== 0 ? value : 0;
+ if (isCommon && computed === computed) {
+ var valuesIndex = valuesLength;
+ while (valuesIndex--) {
+ if (values[valuesIndex] === computed) {
+ continue outer;
+ }
+ }
+ result.push(value);
+ } else if (!includes(values, computed, comparator)) {
+ result.push(value);
+ }
+ }
+ return result;
+ }
+ /**
+ * The base implementation of `_.forEach` without support for iteratee shorthands.
+ *
+ * @private
+ * @param {Array|Object} collection The collection to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @returns {Array|Object} Returns `collection`.
+ */ var baseEach = createBaseEach(baseForOwn);
+ /**
+ * The base implementation of `_.forEachRight` without support for iteratee shorthands.
+ *
+ * @private
+ * @param {Array|Object} collection The collection to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @returns {Array|Object} Returns `collection`.
+ */ var baseEachRight = createBaseEach(baseForOwnRight, true);
+ /**
+ * The base implementation of `_.every` without support for iteratee shorthands.
+ *
+ * @private
+ * @param {Array|Object} collection The collection to iterate over.
+ * @param {Function} predicate The function invoked per iteration.
+ * @returns {boolean} Returns `true` if all elements pass the predicate check,
+ * else `false`
+ */ function baseEvery(collection, predicate) {
+ var result = true;
+ baseEach(collection, function(value, index, collection) {
+ result = !!predicate(value, index, collection);
+ return result;
+ });
+ return result;
+ }
+ /**
+ * The base implementation of methods like `_.max` and `_.min` which accepts a
+ * `comparator` to determine the extremum value.
+ *
+ * @private
+ * @param {Array} array The array to iterate over.
+ * @param {Function} iteratee The iteratee invoked per iteration.
+ * @param {Function} comparator The comparator used to compare values.
+ * @returns {*} Returns the extremum value.
+ */ function baseExtremum(array, iteratee, comparator) {
+ var index = -1,
+ length = array.length;
+ while (++index < length) {
+ var value = array[index],
+ current = iteratee(value);
+ if (
+ current != null &&
+ (computed === undefined
+ ? current === current && !isSymbol(current)
+ : comparator(current, computed))
+ ) {
+ var computed = current,
+ result = value;
+ }
+ }
+ return result;
+ }
+ /**
+ * The base implementation of `_.fill` without an iteratee call guard.
+ *
+ * @private
+ * @param {Array} array The array to fill.
+ * @param {*} value The value to fill `array` with.
+ * @param {number} [start=0] The start position.
+ * @param {number} [end=array.length] The end position.
+ * @returns {Array} Returns `array`.
+ */ function baseFill(array, value, start, end) {
+ var length = array.length;
+ start = toInteger(start);
+ if (start < 0) {
+ start = -start > length ? 0 : length + start;
+ }
+ end =
+ end === undefined || end > length ? length : toInteger(end);
+ if (end < 0) {
+ end += length;
+ }
+ end = start > end ? 0 : toLength(end);
+ while (start < end) {
+ array[start++] = value;
+ }
+ return array;
+ }
+ /**
+ * The base implementation of `_.filter` without support for iteratee shorthands.
+ *
+ * @private
+ * @param {Array|Object} collection The collection to iterate over.
+ * @param {Function} predicate The function invoked per iteration.
+ * @returns {Array} Returns the new filtered array.
+ */ function baseFilter(collection, predicate) {
+ var result = [];
+ baseEach(collection, function(value, index, collection) {
+ if (predicate(value, index, collection)) {
+ result.push(value);
+ }
+ });
+ return result;
+ }
+ /**
+ * The base implementation of `_.flatten` with support for restricting flattening.
+ *
+ * @private
+ * @param {Array} array The array to flatten.
+ * @param {number} depth The maximum recursion depth.
+ * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.
+ * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.
+ * @param {Array} [result=[]] The initial result value.
+ * @returns {Array} Returns the new flattened array.
+ */ function baseFlatten(
+ array,
+ depth,
+ predicate,
+ isStrict,
+ result
+ ) {
+ var index = -1,
+ length = array.length;
+ predicate || (predicate = isFlattenable);
+ result || (result = []);
+ while (++index < length) {
+ var value = array[index];
+ if (depth > 0 && predicate(value)) {
+ if (depth > 1) {
+ // Recursively flatten arrays (susceptible to call stack limits).
+ baseFlatten(
+ value,
+ depth - 1,
+ predicate,
+ isStrict,
+ result
+ );
+ } else {
+ arrayPush(result, value);
+ }
+ } else if (!isStrict) {
+ result[result.length] = value;
+ }
+ }
+ return result;
+ }
+ /**
+ * The base implementation of `baseForOwn` which iterates over `object`
+ * properties returned by `keysFunc` and invokes `iteratee` for each property.
+ * Iteratee functions may exit iteration early by explicitly returning `false`.
+ *
+ * @private
+ * @param {Object} object The object to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @param {Function} keysFunc The function to get the keys of `object`.
+ * @returns {Object} Returns `object`.
+ */ var baseFor = createBaseFor();
+ /**
+ * This function is like `baseFor` except that it iterates over properties
+ * in the opposite order.
+ *
+ * @private
+ * @param {Object} object The object to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @param {Function} keysFunc The function to get the keys of `object`.
+ * @returns {Object} Returns `object`.
+ */ var baseForRight = createBaseFor(true);
+ /**
+ * The base implementation of `_.forOwn` without support for iteratee shorthands.
+ *
+ * @private
+ * @param {Object} object The object to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @returns {Object} Returns `object`.
+ */ function baseForOwn(object, iteratee) {
+ return object && baseFor(object, iteratee, keys);
+ }
+ /**
+ * The base implementation of `_.forOwnRight` without support for iteratee shorthands.
+ *
+ * @private
+ * @param {Object} object The object to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @returns {Object} Returns `object`.
+ */ function baseForOwnRight(object, iteratee) {
+ return object && baseForRight(object, iteratee, keys);
+ }
+ /**
+ * The base implementation of `_.functions` which creates an array of
+ * `object` function property names filtered from `props`.
+ *
+ * @private
+ * @param {Object} object The object to inspect.
+ * @param {Array} props The property names to filter.
+ * @returns {Array} Returns the function names.
+ */ function baseFunctions(object, props) {
+ return arrayFilter(props, function(key) {
+ return isFunction(object[key]);
+ });
+ }
+ /**
+ * The base implementation of `_.get` without support for default values.
+ *
+ * @private
+ * @param {Object} object The object to query.
+ * @param {Array|string} path The path of the property to get.
+ * @returns {*} Returns the resolved value.
+ */ function baseGet(object, path) {
+ path = castPath(path, object);
+ var index = 0,
+ length = path.length;
+ while (object != null && index < length) {
+ object = object[toKey(path[index++])];
+ }
+ return index && index == length ? object : undefined;
+ }
+ /**
+ * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
+ * `keysFunc` and `symbolsFunc` to get the enumerable property names and
+ * symbols of `object`.
+ *
+ * @private
+ * @param {Object} object The object to query.
+ * @param {Function} keysFunc The function to get the keys of `object`.
+ * @param {Function} symbolsFunc The function to get the symbols of `object`.
+ * @returns {Array} Returns the array of property names and symbols.
+ */ function baseGetAllKeys(object, keysFunc, symbolsFunc) {
+ var result = keysFunc(object);
+ return isArray(object)
+ ? result
+ : arrayPush(result, symbolsFunc(object));
+ }
+ /**
+ * The base implementation of `getTag` without fallbacks for buggy environments.
+ *
+ * @private
+ * @param {*} value The value to query.
+ * @returns {string} Returns the `toStringTag`.
+ */ function baseGetTag(value) {
+ if (value == null) {
+ return value === undefined ? undefinedTag : nullTag;
+ }
+ return symToStringTag && symToStringTag in Object(value)
+ ? getRawTag(value)
+ : objectToString(value);
+ }
+ /**
+ * The base implementation of `_.gt` which doesn't coerce arguments.
+ *
+ * @private
+ * @param {*} value The value to compare.
+ * @param {*} other The other value to compare.
+ * @returns {boolean} Returns `true` if `value` is greater than `other`,
+ * else `false`.
+ */ function baseGt(value, other) {
+ return value > other;
+ }
+ /**
+ * The base implementation of `_.has` without support for deep paths.
+ *
+ * @private
+ * @param {Object} [object] The object to query.
+ * @param {Array|string} key The key to check.
+ * @returns {boolean} Returns `true` if `key` exists, else `false`.
+ */ function baseHas(object, key) {
+ return object != null && hasOwnProperty.call(object, key);
+ }
+ /**
+ * The base implementation of `_.hasIn` without support for deep paths.
+ *
+ * @private
+ * @param {Object} [object] The object to query.
+ * @param {Array|string} key The key to check.
+ * @returns {boolean} Returns `true` if `key` exists, else `false`.
+ */ function baseHasIn(object, key) {
+ return object != null && key in Object(object);
+ }
+ /**
+ * The base implementation of `_.inRange` which doesn't coerce arguments.
+ *
+ * @private
+ * @param {number} number The number to check.
+ * @param {number} start The start of the range.
+ * @param {number} end The end of the range.
+ * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
+ */ function baseInRange(number, start, end) {
+ return (
+ number >= nativeMin(start, end) &&
+ number < nativeMax(start, end)
+ );
+ }
+ /**
+ * The base implementation of methods like `_.intersection`, without support
+ * for iteratee shorthands, that accepts an array of arrays to inspect.
+ *
+ * @private
+ * @param {Array} arrays The arrays to inspect.
+ * @param {Function} [iteratee] The iteratee invoked per element.
+ * @param {Function} [comparator] The comparator invoked per element.
+ * @returns {Array} Returns the new array of shared values.
+ */ function baseIntersection(arrays, iteratee, comparator) {
+ var includes = comparator ? arrayIncludesWith : arrayIncludes,
+ length = arrays[0].length,
+ othLength = arrays.length,
+ othIndex = othLength,
+ caches = Array(othLength),
+ maxLength = Infinity,
+ result = [];
+ while (othIndex--) {
+ var array = arrays[othIndex];
+ if (othIndex && iteratee) {
+ array = arrayMap(array, baseUnary(iteratee));
+ }
+ maxLength = nativeMin(array.length, maxLength);
+ caches[othIndex] =
+ !comparator &&
+ (iteratee || (length >= 120 && array.length >= 120))
+ ? new SetCache(othIndex && array)
+ : undefined;
+ }
+ array = arrays[0];
+ var index = -1,
+ seen = caches[0];
+ outer: while (++index < length && result.length < maxLength) {
+ var value = array[index],
+ computed = iteratee ? iteratee(value) : value;
+ value = comparator || value !== 0 ? value : 0;
+ if (
+ !(seen
+ ? cacheHas(seen, computed)
+ : includes(result, computed, comparator))
+ ) {
+ othIndex = othLength;
+ while (--othIndex) {
+ var cache = caches[othIndex];
+ if (
+ !(cache
+ ? cacheHas(cache, computed)
+ : includes(arrays[othIndex], computed, comparator))
+ ) {
+ continue outer;
+ }
+ }
+ if (seen) {
+ seen.push(computed);
+ }
+ result.push(value);
+ }
+ }
+ return result;
+ }
+ /**
+ * The base implementation of `_.invert` and `_.invertBy` which inverts
+ * `object` with values transformed by `iteratee` and set by `setter`.
+ *
+ * @private
+ * @param {Object} object The object to iterate over.
+ * @param {Function} setter The function to set `accumulator` values.
+ * @param {Function} iteratee The iteratee to transform values.
+ * @param {Object} accumulator The initial inverted object.
+ * @returns {Function} Returns `accumulator`.
+ */ function baseInverter(object, setter, iteratee, accumulator) {
+ baseForOwn(object, function(value, key, object) {
+ setter(accumulator, iteratee(value), key, object);
+ });
+ return accumulator;
+ }
+ /**
+ * The base implementation of `_.invoke` without support for individual
+ * method arguments.
+ *
+ * @private
+ * @param {Object} object The object to query.
+ * @param {Array|string} path The path of the method to invoke.
+ * @param {Array} args The arguments to invoke the method with.
+ * @returns {*} Returns the result of the invoked method.
+ */ function baseInvoke(object, path, args) {
+ path = castPath(path, object);
+ object = parent(object, path);
+ var func = object == null ? object : object[toKey(last(path))];
+ return func == null ? undefined : apply(func, object, args);
+ }
+ /**
+ * The base implementation of `_.isArguments`.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is an `arguments` object,
+ */ function baseIsArguments(value) {
+ return isObjectLike(value) && baseGetTag(value) == argsTag;
+ }
+ /**
+ * The base implementation of `_.isArrayBuffer` without Node.js optimizations.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
+ */ function baseIsArrayBuffer(value) {
+ return (
+ isObjectLike(value) && baseGetTag(value) == arrayBufferTag
+ );
+ }
+ /**
+ * The base implementation of `_.isDate` without Node.js optimizations.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
+ */ function baseIsDate(value) {
+ return isObjectLike(value) && baseGetTag(value) == dateTag;
+ }
+ /**
+ * The base implementation of `_.isEqual` which supports partial comparisons
+ * and tracks traversed objects.
+ *
+ * @private
+ * @param {*} value The value to compare.
+ * @param {*} other The other value to compare.
+ * @param {boolean} bitmask The bitmask flags.
+ * 1 - Unordered comparison
+ * 2 - Partial comparison
+ * @param {Function} [customizer] The function to customize comparisons.
+ * @param {Object} [stack] Tracks traversed `value` and `other` objects.
+ * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
+ */ function baseIsEqual(
+ value,
+ other,
+ bitmask,
+ customizer,
+ stack
+ ) {
+ if (value === other) {
+ return true;
+ }
+ if (
+ value == null ||
+ other == null ||
+ (!isObjectLike(value) && !isObjectLike(other))
+ ) {
+ return value !== value && other !== other;
+ }
+ return baseIsEqualDeep(
+ value,
+ other,
+ bitmask,
+ customizer,
+ baseIsEqual,
+ stack
+ );
+ }
+ /**
+ * A specialized version of `baseIsEqual` for arrays and objects which performs
+ * deep comparisons and tracks traversed objects enabling objects with circular
+ * references to be compared.
+ *
+ * @private
+ * @param {Object} object The object to compare.
+ * @param {Object} other The other object to compare.
+ * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
+ * @param {Function} customizer The function to customize comparisons.
+ * @param {Function} equalFunc The function to determine equivalents of values.
+ * @param {Object} [stack] Tracks traversed `object` and `other` objects.
+ * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
+ */ function baseIsEqualDeep(
+ object,
+ other,
+ bitmask,
+ customizer,
+ equalFunc,
+ stack
+ ) {
+ var objIsArr = isArray(object),
+ othIsArr = isArray(other),
+ objTag = objIsArr ? arrayTag : getTag(object),
+ othTag = othIsArr ? arrayTag : getTag(other);
+ objTag = objTag == argsTag ? objectTag : objTag;
+ othTag = othTag == argsTag ? objectTag : othTag;
+ var objIsObj = objTag == objectTag,
+ othIsObj = othTag == objectTag,
+ isSameTag = objTag == othTag;
+ if (isSameTag && isBuffer(object)) {
+ if (!isBuffer(other)) {
+ return false;
+ }
+ objIsArr = true;
+ objIsObj = false;
+ }
+ if (isSameTag && !objIsObj) {
+ stack || (stack = new Stack());
+ return objIsArr || isTypedArray(object)
+ ? equalArrays(
+ object,
+ other,
+ bitmask,
+ customizer,
+ equalFunc,
+ stack
+ )
+ : equalByTag(
+ object,
+ other,
+ objTag,
+ bitmask,
+ customizer,
+ equalFunc,
+ stack
+ );
+ }
+ if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
+ var objIsWrapped =
+ objIsObj && hasOwnProperty.call(object, "__wrapped__"),
+ othIsWrapped =
+ othIsObj && hasOwnProperty.call(other, "__wrapped__");
+ if (objIsWrapped || othIsWrapped) {
+ var objUnwrapped = objIsWrapped ? object.value() : object,
+ othUnwrapped = othIsWrapped ? other.value() : other;
+ stack || (stack = new Stack());
+ return equalFunc(
+ objUnwrapped,
+ othUnwrapped,
+ bitmask,
+ customizer,
+ stack
+ );
+ }
+ }
+ if (!isSameTag) {
+ return false;
+ }
+ stack || (stack = new Stack());
+ return equalObjects(
+ object,
+ other,
+ bitmask,
+ customizer,
+ equalFunc,
+ stack
+ );
+ }
+ /**
+ * The base implementation of `_.isMap` without Node.js optimizations.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a map, else `false`.
+ */ function baseIsMap(value) {
+ return isObjectLike(value) && getTag(value) == mapTag;
+ }
+ /**
+ * The base implementation of `_.isMatch` without support for iteratee shorthands.
+ *
+ * @private
+ * @param {Object} object The object to inspect.
+ * @param {Object} source The object of property values to match.
+ * @param {Array} matchData The property names, values, and compare flags to match.
+ * @param {Function} [customizer] The function to customize comparisons.
+ * @returns {boolean} Returns `true` if `object` is a match, else `false`.
+ */ function baseIsMatch(object, source, matchData, customizer) {
+ var index = matchData.length,
+ length = index,
+ noCustomizer = !customizer;
+ if (object == null) {
+ return !length;
+ }
+ object = Object(object);
+ while (index--) {
+ var data = matchData[index];
+ if (
+ noCustomizer && data[2]
+ ? data[1] !== object[data[0]]
+ : !(data[0] in object)
+ ) {
+ return false;
+ }
+ }
+ while (++index < length) {
+ data = matchData[index];
+ var key = data[0],
+ objValue = object[key],
+ srcValue = data[1];
+ if (noCustomizer && data[2]) {
+ if (objValue === undefined && !(key in object)) {
+ return false;
+ }
+ } else {
+ var stack = new Stack();
+ if (customizer) {
+ var result = customizer(
+ objValue,
+ srcValue,
+ key,
+ object,
+ source,
+ stack
+ );
+ }
+ if (
+ !(result === undefined
+ ? baseIsEqual(
+ srcValue,
+ objValue,
+ COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG,
+ customizer,
+ stack
+ )
+ : result)
+ ) {
+ return false;
+ }
+ }
+ }
+ return true;
+ }
+ /**
+ * The base implementation of `_.isNative` without bad shim checks.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a native function,
+ * else `false`.
+ */ function baseIsNative(value) {
+ if (!isObject(value) || isMasked(value)) {
+ return false;
+ }
+ var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
+ return pattern.test(toSource(value));
+ }
+ /**
+ * The base implementation of `_.isRegExp` without Node.js optimizations.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
+ */ function baseIsRegExp(value) {
+ return isObjectLike(value) && baseGetTag(value) == regexpTag;
+ }
+ /**
+ * The base implementation of `_.isSet` without Node.js optimizations.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a set, else `false`.
+ */ function baseIsSet(value) {
+ return isObjectLike(value) && getTag(value) == setTag;
+ }
+ /**
+ * The base implementation of `_.isTypedArray` without Node.js optimizations.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
+ */ function baseIsTypedArray(value) {
+ return (
+ isObjectLike(value) &&
+ isLength(value.length) &&
+ !!typedArrayTags[baseGetTag(value)]
+ );
+ }
+ /**
+ * The base implementation of `_.iteratee`.
+ *
+ * @private
+ * @param {*} [value=_.identity] The value to convert to an iteratee.
+ * @returns {Function} Returns the iteratee.
+ */ function baseIteratee(value) {
+ // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.
+ // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.
+ if (typeof value == "function") {
+ return value;
+ }
+ if (value == null) {
+ return identity;
+ }
+ if (
+ (typeof value === "undefined"
+ ? "undefined"
+ : _typeof(value)) == "object"
+ ) {
+ return isArray(value)
+ ? baseMatchesProperty(value[0], value[1])
+ : baseMatches(value);
+ }
+ return property(value);
+ }
+ /**
+ * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
+ *
+ * @private
+ * @param {Object} object The object to query.
+ * @returns {Array} Returns the array of property names.
+ */ function baseKeys(object) {
+ if (!isPrototype(object)) {
+ return nativeKeys(object);
+ }
+ var result = [];
+ for (var key in Object(object)) {
+ if (
+ hasOwnProperty.call(object, key) &&
+ key != "constructor"
+ ) {
+ result.push(key);
+ }
+ }
+ return result;
+ }
+ /**
+ * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
+ *
+ * @private
+ * @param {Object} object The object to query.
+ * @returns {Array} Returns the array of property names.
+ */ function baseKeysIn(object) {
+ if (!isObject(object)) {
+ return nativeKeysIn(object);
+ }
+ var isProto = isPrototype(object),
+ result = [];
+ for (var key in object) {
+ if (
+ !(
+ key == "constructor" &&
+ (isProto || !hasOwnProperty.call(object, key))
+ )
+ ) {
+ result.push(key);
+ }
+ }
+ return result;
+ }
+ /**
+ * The base implementation of `_.lt` which doesn't coerce arguments.
+ *
+ * @private
+ * @param {*} value The value to compare.
+ * @param {*} other The other value to compare.
+ * @returns {boolean} Returns `true` if `value` is less than `other`,
+ * else `false`.
+ */ function baseLt(value, other) {
+ return value < other;
+ }
+ /**
+ * The base implementation of `_.map` without support for iteratee shorthands.
+ *
+ * @private
+ * @param {Array|Object} collection The collection to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @returns {Array} Returns the new mapped array.
+ */ function baseMap(collection, iteratee) {
+ var index = -1,
+ result = isArrayLike(collection)
+ ? Array(collection.length)
+ : [];
+ baseEach(collection, function(value, key, collection) {
+ result[++index] = iteratee(value, key, collection);
+ });
+ return result;
+ }
+ /**
+ * The base implementation of `_.matches` which doesn't clone `source`.
+ *
+ * @private
+ * @param {Object} source The object of property values to match.
+ * @returns {Function} Returns the new spec function.
+ */ function baseMatches(source) {
+ var matchData = getMatchData(source);
+ if (matchData.length == 1 && matchData[0][2]) {
+ return matchesStrictComparable(
+ matchData[0][0],
+ matchData[0][1]
+ );
+ }
+ return function(object) {
+ return (
+ object === source || baseIsMatch(object, source, matchData)
+ );
+ };
+ }
+ /**
+ * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.
+ *
+ * @private
+ * @param {string} path The path of the property to get.
+ * @param {*} srcValue The value to match.
+ * @returns {Function} Returns the new spec function.
+ */ function baseMatchesProperty(path, srcValue) {
+ if (isKey(path) && isStrictComparable(srcValue)) {
+ return matchesStrictComparable(toKey(path), srcValue);
+ }
+ return function(object) {
+ var objValue = get(object, path);
+ return objValue === undefined && objValue === srcValue
+ ? hasIn(object, path)
+ : baseIsEqual(
+ srcValue,
+ objValue,
+ COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG
+ );
+ };
+ }
+ /**
+ * The base implementation of `_.merge` without support for multiple sources.
+ *
+ * @private
+ * @param {Object} object The destination object.
+ * @param {Object} source The source object.
+ * @param {number} srcIndex The index of `source`.
+ * @param {Function} [customizer] The function to customize merged values.
+ * @param {Object} [stack] Tracks traversed source values and their merged
+ * counterparts.
+ */ function baseMerge(
+ object,
+ source,
+ srcIndex,
+ customizer,
+ stack
+ ) {
+ if (object === source) {
+ return;
+ }
+ baseFor(
+ source,
+ function(srcValue, key) {
+ if (isObject(srcValue)) {
+ stack || (stack = new Stack());
+ baseMergeDeep(
+ object,
+ source,
+ key,
+ srcIndex,
+ baseMerge,
+ customizer,
+ stack
+ );
+ } else {
+ var newValue = customizer
+ ? customizer(
+ safeGet(object, key),
+ srcValue,
+ key + "",
+ object,
+ source,
+ stack
+ )
+ : undefined;
+ if (newValue === undefined) {
+ newValue = srcValue;
+ }
+ assignMergeValue(object, key, newValue);
+ }
+ },
+ keysIn
+ );
+ }
+ /**
+ * A specialized version of `baseMerge` for arrays and objects which performs
+ * deep merges and tracks traversed objects enabling objects with circular
+ * references to be merged.
+ *
+ * @private
+ * @param {Object} object The destination object.
+ * @param {Object} source The source object.
+ * @param {string} key The key of the value to merge.
+ * @param {number} srcIndex The index of `source`.
+ * @param {Function} mergeFunc The function to merge values.
+ * @param {Function} [customizer] The function to customize assigned values.
+ * @param {Object} [stack] Tracks traversed source values and their merged
+ * counterparts.
+ */ function baseMergeDeep(
+ object,
+ source,
+ key,
+ srcIndex,
+ mergeFunc,
+ customizer,
+ stack
+ ) {
+ var objValue = safeGet(object, key),
+ srcValue = safeGet(source, key),
+ stacked = stack.get(srcValue);
+ if (stacked) {
+ assignMergeValue(object, key, stacked);
+ return;
+ }
+ var newValue = customizer
+ ? customizer(
+ objValue,
+ srcValue,
+ key + "",
+ object,
+ source,
+ stack
+ )
+ : undefined;
+ var isCommon = newValue === undefined;
+ if (isCommon) {
+ var isArr = isArray(srcValue),
+ isBuff = !isArr && isBuffer(srcValue),
+ isTyped = !isArr && !isBuff && isTypedArray(srcValue);
+ newValue = srcValue;
+ if (isArr || isBuff || isTyped) {
+ if (isArray(objValue)) {
+ newValue = objValue;
+ } else if (isArrayLikeObject(objValue)) {
+ newValue = copyArray(objValue);
+ } else if (isBuff) {
+ isCommon = false;
+ newValue = cloneBuffer(srcValue, true);
+ } else if (isTyped) {
+ isCommon = false;
+ newValue = cloneTypedArray(srcValue, true);
+ } else {
+ newValue = [];
+ }
+ } else if (isPlainObject(srcValue) || isArguments(srcValue)) {
+ newValue = objValue;
+ if (isArguments(objValue)) {
+ newValue = toPlainObject(objValue);
+ } else if (
+ !isObject(objValue) ||
+ (srcIndex && isFunction(objValue))
+ ) {
+ newValue = initCloneObject(srcValue);
+ }
+ } else {
+ isCommon = false;
+ }
+ }
+ if (isCommon) {
+ // Recursively merge objects and arrays (susceptible to call stack limits).
+ stack.set(srcValue, newValue);
+ mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
+ stack["delete"](srcValue);
+ }
+ assignMergeValue(object, key, newValue);
+ }
+ /**
+ * The base implementation of `_.nth` which doesn't coerce arguments.
+ *
+ * @private
+ * @param {Array} array The array to query.
+ * @param {number} n The index of the element to return.
+ * @returns {*} Returns the nth element of `array`.
+ */ function baseNth(array, n) {
+ var length = array.length;
+ if (!length) {
+ return;
+ }
+ n += n < 0 ? length : 0;
+ return isIndex(n, length) ? array[n] : undefined;
+ }
+ /**
+ * The base implementation of `_.orderBy` without param guards.
+ *
+ * @private
+ * @param {Array|Object} collection The collection to iterate over.
+ * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.
+ * @param {string[]} orders The sort orders of `iteratees`.
+ * @returns {Array} Returns the new sorted array.
+ */ function baseOrderBy(collection, iteratees, orders) {
+ var index = -1;
+ iteratees = arrayMap(
+ iteratees.length ? iteratees : [identity],
+ baseUnary(getIteratee())
+ );
+ var result = baseMap(collection, function(
+ value,
+ key,
+ collection
+ ) {
+ var criteria = arrayMap(iteratees, function(iteratee) {
+ return iteratee(value);
+ });
+ return { criteria: criteria, index: ++index, value: value };
+ });
+ return baseSortBy(result, function(object, other) {
+ return compareMultiple(object, other, orders);
+ });
+ }
+ /**
+ * The base implementation of `_.pick` without support for individual
+ * property identifiers.
+ *
+ * @private
+ * @param {Object} object The source object.
+ * @param {string[]} paths The property paths to pick.
+ * @returns {Object} Returns the new object.
+ */ function basePick(object, paths) {
+ return basePickBy(object, paths, function(value, path) {
+ return hasIn(object, path);
+ });
+ }
+ /**
+ * The base implementation of `_.pickBy` without support for iteratee shorthands.
+ *
+ * @private
+ * @param {Object} object The source object.
+ * @param {string[]} paths The property paths to pick.
+ * @param {Function} predicate The function invoked per property.
+ * @returns {Object} Returns the new object.
+ */ function basePickBy(object, paths, predicate) {
+ var index = -1,
+ length = paths.length,
+ result = {};
+ while (++index < length) {
+ var path = paths[index],
+ value = baseGet(object, path);
+ if (predicate(value, path)) {
+ baseSet(result, castPath(path, object), value);
+ }
+ }
+ return result;
+ }
+ /**
+ * A specialized version of `baseProperty` which supports deep paths.
+ *
+ * @private
+ * @param {Array|string} path The path of the property to get.
+ * @returns {Function} Returns the new accessor function.
+ */ function basePropertyDeep(path) {
+ return function(object) {
+ return baseGet(object, path);
+ };
+ }
+ /**
+ * The base implementation of `_.pullAllBy` without support for iteratee
+ * shorthands.
+ *
+ * @private
+ * @param {Array} array The array to modify.
+ * @param {Array} values The values to remove.
+ * @param {Function} [iteratee] The iteratee invoked per element.
+ * @param {Function} [comparator] The comparator invoked per element.
+ * @returns {Array} Returns `array`.
+ */ function basePullAll(array, values, iteratee, comparator) {
+ var indexOf = comparator ? baseIndexOfWith : baseIndexOf,
+ index = -1,
+ length = values.length,
+ seen = array;
+ if (array === values) {
+ values = copyArray(values);
+ }
+ if (iteratee) {
+ seen = arrayMap(array, baseUnary(iteratee));
+ }
+ while (++index < length) {
+ var fromIndex = 0,
+ value = values[index],
+ computed = iteratee ? iteratee(value) : value;
+ while (
+ (fromIndex = indexOf(
+ seen,
+ computed,
+ fromIndex,
+ comparator
+ )) > -1
+ ) {
+ if (seen !== array) {
+ splice.call(seen, fromIndex, 1);
+ }
+ splice.call(array, fromIndex, 1);
+ }
+ }
+ return array;
+ }
+ /**
+ * The base implementation of `_.pullAt` without support for individual
+ * indexes or capturing the removed elements.
+ *
+ * @private
+ * @param {Array} array The array to modify.
+ * @param {number[]} indexes The indexes of elements to remove.
+ * @returns {Array} Returns `array`.
+ */ function basePullAt(array, indexes) {
+ var length = array ? indexes.length : 0,
+ lastIndex = length - 1;
+ while (length--) {
+ var index = indexes[length];
+ if (length == lastIndex || index !== previous) {
+ var previous = index;
+ if (isIndex(index)) {
+ splice.call(array, index, 1);
+ } else {
+ baseUnset(array, index);
+ }
+ }
+ }
+ return array;
+ }
+ /**
+ * The base implementation of `_.random` without support for returning
+ * floating-point numbers.
+ *
+ * @private
+ * @param {number} lower The lower bound.
+ * @param {number} upper The upper bound.
+ * @returns {number} Returns the random number.
+ */ function baseRandom(lower, upper) {
+ return (
+ lower + nativeFloor(nativeRandom() * (upper - lower + 1))
+ );
+ }
+ /**
+ * The base implementation of `_.range` and `_.rangeRight` which doesn't
+ * coerce arguments.
+ *
+ * @private
+ * @param {number} start The start of the range.
+ * @param {number} end The end of the range.
+ * @param {number} step The value to increment or decrement by.
+ * @param {boolean} [fromRight] Specify iterating from right to left.
+ * @returns {Array} Returns the range of numbers.
+ */ function baseRange(start, end, step, fromRight) {
+ var index = -1,
+ length = nativeMax(
+ nativeCeil((end - start) / (step || 1)),
+ 0
+ ),
+ result = Array(length);
+ while (length--) {
+ result[fromRight ? length : ++index] = start;
+ start += step;
+ }
+ return result;
+ }
+ /**
+ * The base implementation of `_.repeat` which doesn't coerce arguments.
+ *
+ * @private
+ * @param {string} string The string to repeat.
+ * @param {number} n The number of times to repeat the string.
+ * @returns {string} Returns the repeated string.
+ */ function baseRepeat(string, n) {
+ var result = "";
+ if (!string || n < 1 || n > MAX_SAFE_INTEGER) {
+ return result;
+ } // Leverage the exponentiation by squaring algorithm for a faster repeat.
+ // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details.
+ do {
+ if (n % 2) {
+ result += string;
+ }
+ n = nativeFloor(n / 2);
+ if (n) {
+ string += string;
+ }
+ } while (n);
+ return result;
+ }
+ /**
+ * The base implementation of `_.rest` which doesn't validate or coerce arguments.
+ *
+ * @private
+ * @param {Function} func The function to apply a rest parameter to.
+ * @param {number} [start=func.length-1] The start position of the rest parameter.
+ * @returns {Function} Returns the new function.
+ */ function baseRest(func, start) {
+ return setToString(overRest(func, start, identity), func + "");
+ }
+ /**
+ * The base implementation of `_.sample`.
+ *
+ * @private
+ * @param {Array|Object} collection The collection to sample.
+ * @returns {*} Returns the random element.
+ */ function baseSample(collection) {
+ return arraySample(values(collection));
+ }
+ /**
+ * The base implementation of `_.sampleSize` without param guards.
+ *
+ * @private
+ * @param {Array|Object} collection The collection to sample.
+ * @param {number} n The number of elements to sample.
+ * @returns {Array} Returns the random elements.
+ */ function baseSampleSize(collection, n) {
+ var array = values(collection);
+ return shuffleSelf(array, baseClamp(n, 0, array.length));
+ }
+ /**
+ * The base implementation of `_.set`.
+ *
+ * @private
+ * @param {Object} object The object to modify.
+ * @param {Array|string} path The path of the property to set.
+ * @param {*} value The value to set.
+ * @param {Function} [customizer] The function to customize path creation.
+ * @returns {Object} Returns `object`.
+ */ function baseSet(object, path, value, customizer) {
+ if (!isObject(object)) {
+ return object;
+ }
+ path = castPath(path, object);
+ var index = -1,
+ length = path.length,
+ lastIndex = length - 1,
+ nested = object;
+ while (nested != null && ++index < length) {
+ var key = toKey(path[index]),
+ newValue = value;
+ if (index != lastIndex) {
+ var objValue = nested[key];
+ newValue = customizer
+ ? customizer(objValue, key, nested)
+ : undefined;
+ if (newValue === undefined) {
+ newValue = isObject(objValue)
+ ? objValue
+ : isIndex(path[index + 1]) ? [] : {};
+ }
+ }
+ assignValue(nested, key, newValue);
+ nested = nested[key];
+ }
+ return object;
+ }
+ /**
+ * The base implementation of `setData` without support for hot loop shorting.
+ *
+ * @private
+ * @param {Function} func The function to associate metadata with.
+ * @param {*} data The metadata.
+ * @returns {Function} Returns `func`.
+ */ var baseSetData = !metaMap
+ ? identity
+ : function(func, data) {
+ metaMap.set(func, data);
+ return func;
+ };
+ /**
+ * The base implementation of `setToString` without support for hot loop shorting.
+ *
+ * @private
+ * @param {Function} func The function to modify.
+ * @param {Function} string The `toString` result.
+ * @returns {Function} Returns `func`.
+ */ var baseSetToString = !defineProperty
+ ? identity
+ : function(func, string) {
+ return defineProperty(func, "toString", {
+ configurable: true,
+ enumerable: false,
+ value: constant(string),
+ writable: true
+ });
+ };
+ /**
+ * The base implementation of `_.shuffle`.
+ *
+ * @private
+ * @param {Array|Object} collection The collection to shuffle.
+ * @returns {Array} Returns the new shuffled array.
+ */ function baseShuffle(collection) {
+ return shuffleSelf(values(collection));
+ }
+ /**
+ * The base implementation of `_.slice` without an iteratee call guard.
+ *
+ * @private
+ * @param {Array} array The array to slice.
+ * @param {number} [start=0] The start position.
+ * @param {number} [end=array.length] The end position.
+ * @returns {Array} Returns the slice of `array`.
+ */ function baseSlice(array, start, end) {
+ var index = -1,
+ length = array.length;
+ if (start < 0) {
+ start = -start > length ? 0 : length + start;
+ }
+ end = end > length ? length : end;
+ if (end < 0) {
+ end += length;
+ }
+ length = start > end ? 0 : (end - start) >>> 0;
+ start >>>= 0;
+ var result = Array(length);
+ while (++index < length) {
+ result[index] = array[index + start];
+ }
+ return result;
+ }
+ /**
+ * The base implementation of `_.some` without support for iteratee shorthands.
+ *
+ * @private
+ * @param {Array|Object} collection The collection to iterate over.
+ * @param {Function} predicate The function invoked per iteration.
+ * @returns {boolean} Returns `true` if any element passes the predicate check,
+ * else `false`.
+ */ function baseSome(collection, predicate) {
+ var result;
+ baseEach(collection, function(value, index, collection) {
+ result = predicate(value, index, collection);
+ return !result;
+ });
+ return !!result;
+ }
+ /**
+ * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which
+ * performs a binary search of `array` to determine the index at which `value`
+ * should be inserted into `array` in order to maintain its sort order.
+ *
+ * @private
+ * @param {Array} array The sorted array to inspect.
+ * @param {*} value The value to evaluate.
+ * @param {boolean} [retHighest] Specify returning the highest qualified index.
+ * @returns {number} Returns the index at which `value` should be inserted
+ * into `array`.
+ */ function baseSortedIndex(array, value, retHighest) {
+ var low = 0,
+ high = array == null ? low : array.length;
+ if (
+ typeof value == "number" &&
+ value === value &&
+ high <= HALF_MAX_ARRAY_LENGTH
+ ) {
+ while (low < high) {
+ var mid = (low + high) >>> 1,
+ computed = array[mid];
+ if (
+ computed !== null &&
+ !isSymbol(computed) &&
+ (retHighest ? computed <= value : computed < value)
+ ) {
+ low = mid + 1;
+ } else {
+ high = mid;
+ }
+ }
+ return high;
+ }
+ return baseSortedIndexBy(array, value, identity, retHighest);
+ }
+ /**
+ * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy`
+ * which invokes `iteratee` for `value` and each element of `array` to compute
+ * their sort ranking. The iteratee is invoked with one argument; (value).
+ *
+ * @private
+ * @param {Array} array The sorted array to inspect.
+ * @param {*} value The value to evaluate.
+ * @param {Function} iteratee The iteratee invoked per element.
+ * @param {boolean} [retHighest] Specify returning the highest qualified index.
+ * @returns {number} Returns the index at which `value` should be inserted
+ * into `array`.
+ */ function baseSortedIndexBy(
+ array,
+ value,
+ iteratee,
+ retHighest
+ ) {
+ value = iteratee(value);
+ var low = 0,
+ high = array == null ? 0 : array.length,
+ valIsNaN = value !== value,
+ valIsNull = value === null,
+ valIsSymbol = isSymbol(value),
+ valIsUndefined = value === undefined;
+ while (low < high) {
+ var mid = nativeFloor((low + high) / 2),
+ computed = iteratee(array[mid]),
+ othIsDefined = computed !== undefined,
+ othIsNull = computed === null,
+ othIsReflexive = computed === computed,
+ othIsSymbol = isSymbol(computed);
+ if (valIsNaN) {
+ var setLow = retHighest || othIsReflexive;
+ } else if (valIsUndefined) {
+ setLow = othIsReflexive && (retHighest || othIsDefined);
+ } else if (valIsNull) {
+ setLow =
+ othIsReflexive &&
+ othIsDefined &&
+ (retHighest || !othIsNull);
+ } else if (valIsSymbol) {
+ setLow =
+ othIsReflexive &&
+ othIsDefined &&
+ !othIsNull &&
+ (retHighest || !othIsSymbol);
+ } else if (othIsNull || othIsSymbol) {
+ setLow = false;
+ } else {
+ setLow = retHighest ? computed <= value : computed < value;
+ }
+ if (setLow) {
+ low = mid + 1;
+ } else {
+ high = mid;
+ }
+ }
+ return nativeMin(high, MAX_ARRAY_INDEX);
+ }
+ /**
+ * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without
+ * support for iteratee shorthands.
+ *
+ * @private
+ * @param {Array} array The array to inspect.
+ * @param {Function} [iteratee] The iteratee invoked per element.
+ * @returns {Array} Returns the new duplicate free array.
+ */ function baseSortedUniq(array, iteratee) {
+ var index = -1,
+ length = array.length,
+ resIndex = 0,
+ result = [];
+ while (++index < length) {
+ var value = array[index],
+ computed = iteratee ? iteratee(value) : value;
+ if (!index || !eq(computed, seen)) {
+ var seen = computed;
+ result[resIndex++] = value === 0 ? 0 : value;
+ }
+ }
+ return result;
+ }
+ /**
+ * The base implementation of `_.toNumber` which doesn't ensure correct
+ * conversions of binary, hexadecimal, or octal string values.
+ *
+ * @private
+ * @param {*} value The value to process.
+ * @returns {number} Returns the number.
+ */ function baseToNumber(value) {
+ if (typeof value == "number") {
+ return value;
+ }
+ if (isSymbol(value)) {
+ return NAN;
+ }
+ return +value;
+ }
+ /**
+ * The base implementation of `_.toString` which doesn't convert nullish
+ * values to empty strings.
+ *
+ * @private
+ * @param {*} value The value to process.
+ * @returns {string} Returns the string.
+ */ function baseToString(value) {
+ // Exit early for strings to avoid a performance hit in some environments.
+ if (typeof value == "string") {
+ return value;
+ }
+ if (isArray(value)) {
+ // Recursively convert values (susceptible to call stack limits).
+ return arrayMap(value, baseToString) + "";
+ }
+ if (isSymbol(value)) {
+ return symbolToString ? symbolToString.call(value) : "";
+ }
+ var result = value + "";
+ return result == "0" && 1 / value == -INFINITY ? "-0" : result;
+ }
+ /**
+ * The base implementation of `_.uniqBy` without support for iteratee shorthands.
+ *
+ * @private
+ * @param {Array} array The array to inspect.
+ * @param {Function} [iteratee] The iteratee invoked per element.
+ * @param {Function} [comparator] The comparator invoked per element.
+ * @returns {Array} Returns the new duplicate free array.
+ */ function baseUniq(array, iteratee, comparator) {
+ var index = -1,
+ includes = arrayIncludes,
+ length = array.length,
+ isCommon = true,
+ result = [],
+ seen = result;
+ if (comparator) {
+ isCommon = false;
+ includes = arrayIncludesWith;
+ } else if (length >= LARGE_ARRAY_SIZE) {
+ var set = iteratee ? null : createSet(array);
+ if (set) {
+ return setToArray(set);
+ }
+ isCommon = false;
+ includes = cacheHas;
+ seen = new SetCache();
+ } else {
+ seen = iteratee ? [] : result;
+ }
+ outer: while (++index < length) {
+ var value = array[index],
+ computed = iteratee ? iteratee(value) : value;
+ value = comparator || value !== 0 ? value : 0;
+ if (isCommon && computed === computed) {
+ var seenIndex = seen.length;
+ while (seenIndex--) {
+ if (seen[seenIndex] === computed) {
+ continue outer;
+ }
+ }
+ if (iteratee) {
+ seen.push(computed);
+ }
+ result.push(value);
+ } else if (!includes(seen, computed, comparator)) {
+ if (seen !== result) {
+ seen.push(computed);
+ }
+ result.push(value);
+ }
+ }
+ return result;
+ }
+ /**
+ * The base implementation of `_.unset`.
+ *
+ * @private
+ * @param {Object} object The object to modify.
+ * @param {Array|string} path The property path to unset.
+ * @returns {boolean} Returns `true` if the property is deleted, else `false`.
+ */ function baseUnset(object, path) {
+ path = castPath(path, object);
+ object = parent(object, path);
+ return object == null || delete object[toKey(last(path))];
+ }
+ /**
+ * The base implementation of `_.update`.
+ *
+ * @private
+ * @param {Object} object The object to modify.
+ * @param {Array|string} path The path of the property to update.
+ * @param {Function} updater The function to produce the updated value.
+ * @param {Function} [customizer] The function to customize path creation.
+ * @returns {Object} Returns `object`.
+ */ function baseUpdate(object, path, updater, customizer) {
+ return baseSet(
+ object,
+ path,
+ updater(baseGet(object, path)),
+ customizer
+ );
+ }
+ /**
+ * The base implementation of methods like `_.dropWhile` and `_.takeWhile`
+ * without support for iteratee shorthands.
+ *
+ * @private
+ * @param {Array} array The array to query.
+ * @param {Function} predicate The function invoked per iteration.
+ * @param {boolean} [isDrop] Specify dropping elements instead of taking them.
+ * @param {boolean} [fromRight] Specify iterating from right to left.
+ * @returns {Array} Returns the slice of `array`.
+ */ function baseWhile(array, predicate, isDrop, fromRight) {
+ var length = array.length,
+ index = fromRight ? length : -1;
+ while (
+ (fromRight ? index-- : ++index < length) &&
+ predicate(array[index], index, array)
+ ) {}
+ return isDrop
+ ? baseSlice(
+ array,
+ fromRight ? 0 : index,
+ fromRight ? index + 1 : length
+ )
+ : baseSlice(
+ array,
+ fromRight ? index + 1 : 0,
+ fromRight ? length : index
+ );
+ }
+ /**
+ * The base implementation of `wrapperValue` which returns the result of
+ * performing a sequence of actions on the unwrapped `value`, where each
+ * successive action is supplied the return value of the previous.
+ *
+ * @private
+ * @param {*} value The unwrapped value.
+ * @param {Array} actions Actions to perform to resolve the unwrapped value.
+ * @returns {*} Returns the resolved value.
+ */ function baseWrapperValue(value, actions) {
+ var result = value;
+ if (result instanceof LazyWrapper) {
+ result = result.value();
+ }
+ return arrayReduce(
+ actions,
+ function(result, action) {
+ return action.func.apply(
+ action.thisArg,
+ arrayPush([result], action.args)
+ );
+ },
+ result
+ );
+ }
+ /**
+ * The base implementation of methods like `_.xor`, without support for
+ * iteratee shorthands, that accepts an array of arrays to inspect.
+ *
+ * @private
+ * @param {Array} arrays The arrays to inspect.
+ * @param {Function} [iteratee] The iteratee invoked per element.
+ * @param {Function} [comparator] The comparator invoked per element.
+ * @returns {Array} Returns the new array of values.
+ */ function baseXor(arrays, iteratee, comparator) {
+ var length = arrays.length;
+ if (length < 2) {
+ return length ? baseUniq(arrays[0]) : [];
+ }
+ var index = -1,
+ result = Array(length);
+ while (++index < length) {
+ var array = arrays[index],
+ othIndex = -1;
+ while (++othIndex < length) {
+ if (othIndex != index) {
+ result[index] = baseDifference(
+ result[index] || array,
+ arrays[othIndex],
+ iteratee,
+ comparator
+ );
+ }
+ }
+ }
+ return baseUniq(baseFlatten(result, 1), iteratee, comparator);
+ }
+ /**
+ * This base implementation of `_.zipObject` which assigns values using `assignFunc`.
+ *
+ * @private
+ * @param {Array} props The property identifiers.
+ * @param {Array} values The property values.
+ * @param {Function} assignFunc The function to assign values.
+ * @returns {Object} Returns the new object.
+ */ function baseZipObject(props, values, assignFunc) {
+ var index = -1,
+ length = props.length,
+ valsLength = values.length,
+ result = {};
+ while (++index < length) {
+ var value = index < valsLength ? values[index] : undefined;
+ assignFunc(result, props[index], value);
+ }
+ return result;
+ }
+ /**
+ * Casts `value` to an empty array if it's not an array like object.
+ *
+ * @private
+ * @param {*} value The value to inspect.
+ * @returns {Array|Object} Returns the cast array-like object.
+ */ function castArrayLikeObject(value) {
+ return isArrayLikeObject(value) ? value : [];
+ }
+ /**
+ * Casts `value` to `identity` if it's not a function.
+ *
+ * @private
+ * @param {*} value The value to inspect.
+ * @returns {Function} Returns cast function.
+ */ function castFunction(value) {
+ return typeof value == "function" ? value : identity;
+ }
+ /**
+ * Casts `value` to a path array if it's not one.
+ *
+ * @private
+ * @param {*} value The value to inspect.
+ * @param {Object} [object] The object to query keys on.
+ * @returns {Array} Returns the cast property path array.
+ */ function castPath(value, object) {
+ if (isArray(value)) {
+ return value;
+ }
+ return isKey(value, object)
+ ? [value]
+ : stringToPath(toString(value));
+ }
+ /**
+ * A `baseRest` alias which can be replaced with `identity` by module
+ * replacement plugins.
+ *
+ * @private
+ * @type {Function}
+ * @param {Function} func The function to apply a rest parameter to.
+ * @returns {Function} Returns the new function.
+ */ var castRest = baseRest;
+ /**
+ * Casts `array` to a slice if it's needed.
+ *
+ * @private
+ * @param {Array} array The array to inspect.
+ * @param {number} start The start position.
+ * @param {number} [end=array.length] The end position.
+ * @returns {Array} Returns the cast slice.
+ */ function castSlice(array, start, end) {
+ var length = array.length;
+ end = end === undefined ? length : end;
+ return !start && end >= length
+ ? array
+ : baseSlice(array, start, end);
+ }
+ /**
+ * A simple wrapper around the global [`clearTimeout`](https://mdn.io/clearTimeout).
+ *
+ * @private
+ * @param {number|Object} id The timer id or timeout object of the timer to clear.
+ */ var clearTimeout =
+ ctxClearTimeout ||
+ function(id) {
+ return root.clearTimeout(id);
+ };
+ /**
+ * Creates a clone of `buffer`.
+ *
+ * @private
+ * @param {Buffer} buffer The buffer to clone.
+ * @param {boolean} [isDeep] Specify a deep clone.
+ * @returns {Buffer} Returns the cloned buffer.
+ */ function cloneBuffer(buffer, isDeep) {
+ if (isDeep) {
+ return buffer.slice();
+ }
+ var length = buffer.length,
+ result = allocUnsafe
+ ? allocUnsafe(length)
+ : new buffer.constructor(length);
+ buffer.copy(result);
+ return result;
+ }
+ /**
+ * Creates a clone of `arrayBuffer`.
+ *
+ * @private
+ * @param {ArrayBuffer} arrayBuffer The array buffer to clone.
+ * @returns {ArrayBuffer} Returns the cloned array buffer.
+ */ function cloneArrayBuffer(arrayBuffer) {
+ var result = new arrayBuffer.constructor(
+ arrayBuffer.byteLength
+ );
+ new Uint8Array(result).set(new Uint8Array(arrayBuffer));
+ return result;
+ }
+ /**
+ * Creates a clone of `dataView`.
+ *
+ * @private
+ * @param {Object} dataView The data view to clone.
+ * @param {boolean} [isDeep] Specify a deep clone.
+ * @returns {Object} Returns the cloned data view.
+ */ function cloneDataView(dataView, isDeep) {
+ var buffer = isDeep
+ ? cloneArrayBuffer(dataView.buffer)
+ : dataView.buffer;
+ return new dataView.constructor(
+ buffer,
+ dataView.byteOffset,
+ dataView.byteLength
+ );
+ }
+ /**
+ * Creates a clone of `regexp`.
+ *
+ * @private
+ * @param {Object} regexp The regexp to clone.
+ * @returns {Object} Returns the cloned regexp.
+ */ function cloneRegExp(regexp) {
+ var result = new regexp.constructor(
+ regexp.source,
+ reFlags.exec(regexp)
+ );
+ result.lastIndex = regexp.lastIndex;
+ return result;
+ }
+ /**
+ * Creates a clone of the `symbol` object.
+ *
+ * @private
+ * @param {Object} symbol The symbol object to clone.
+ * @returns {Object} Returns the cloned symbol object.
+ */ function cloneSymbol(symbol) {
+ return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
+ }
+ /**
+ * Creates a clone of `typedArray`.
+ *
+ * @private
+ * @param {Object} typedArray The typed array to clone.
+ * @param {boolean} [isDeep] Specify a deep clone.
+ * @returns {Object} Returns the cloned typed array.
+ */ function cloneTypedArray(typedArray, isDeep) {
+ var buffer = isDeep
+ ? cloneArrayBuffer(typedArray.buffer)
+ : typedArray.buffer;
+ return new typedArray.constructor(
+ buffer,
+ typedArray.byteOffset,
+ typedArray.length
+ );
+ }
+ /**
+ * Compares values to sort them in ascending order.
+ *
+ * @private
+ * @param {*} value The value to compare.
+ * @param {*} other The other value to compare.
+ * @returns {number} Returns the sort order indicator for `value`.
+ */ function compareAscending(value, other) {
+ if (value !== other) {
+ var valIsDefined = value !== undefined,
+ valIsNull = value === null,
+ valIsReflexive = value === value,
+ valIsSymbol = isSymbol(value);
+ var othIsDefined = other !== undefined,
+ othIsNull = other === null,
+ othIsReflexive = other === other,
+ othIsSymbol = isSymbol(other);
+ if (
+ (!othIsNull &&
+ !othIsSymbol &&
+ !valIsSymbol &&
+ value > other) ||
+ (valIsSymbol &&
+ othIsDefined &&
+ othIsReflexive &&
+ !othIsNull &&
+ !othIsSymbol) ||
+ (valIsNull && othIsDefined && othIsReflexive) ||
+ (!valIsDefined && othIsReflexive) ||
+ !valIsReflexive
+ ) {
+ return 1;
+ }
+ if (
+ (!valIsNull &&
+ !valIsSymbol &&
+ !othIsSymbol &&
+ value < other) ||
+ (othIsSymbol &&
+ valIsDefined &&
+ valIsReflexive &&
+ !valIsNull &&
+ !valIsSymbol) ||
+ (othIsNull && valIsDefined && valIsReflexive) ||
+ (!othIsDefined && valIsReflexive) ||
+ !othIsReflexive
+ ) {
+ return -1;
+ }
+ }
+ return 0;
+ }
+ /**
+ * Used by `_.orderBy` to compare multiple properties of a value to another
+ * and stable sort them.
+ *
+ * If `orders` is unspecified, all values are sorted in ascending order. Otherwise,
+ * specify an order of "desc" for descending or "asc" for ascending sort order
+ * of corresponding values.
+ *
+ * @private
+ * @param {Object} object The object to compare.
+ * @param {Object} other The other object to compare.
+ * @param {boolean[]|string[]} orders The order to sort by for each property.
+ * @returns {number} Returns the sort order indicator for `object`.
+ */ function compareMultiple(object, other, orders) {
+ var index = -1,
+ objCriteria = object.criteria,
+ othCriteria = other.criteria,
+ length = objCriteria.length,
+ ordersLength = orders.length;
+ while (++index < length) {
+ var result = compareAscending(
+ objCriteria[index],
+ othCriteria[index]
+ );
+ if (result) {
+ if (index >= ordersLength) {
+ return result;
+ }
+ var order = orders[index];
+ return result * (order == "desc" ? -1 : 1);
+ }
+ } // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications
+ // that causes it, under certain circumstances, to provide the same value for
+ // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247
+ // for more details.
+ //
+ // This also ensures a stable sort in V8 and other engines.
+ // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.
+ return object.index - other.index;
+ }
+ /**
+ * Creates an array that is the composition of partially applied arguments,
+ * placeholders, and provided arguments into a single array of arguments.
+ *
+ * @private
+ * @param {Array} args The provided arguments.
+ * @param {Array} partials The arguments to prepend to those provided.
+ * @param {Array} holders The `partials` placeholder indexes.
+ * @params {boolean} [isCurried] Specify composing for a curried function.
+ * @returns {Array} Returns the new array of composed arguments.
+ */ function composeArgs(args, partials, holders, isCurried) {
+ var argsIndex = -1,
+ argsLength = args.length,
+ holdersLength = holders.length,
+ leftIndex = -1,
+ leftLength = partials.length,
+ rangeLength = nativeMax(argsLength - holdersLength, 0),
+ result = Array(leftLength + rangeLength),
+ isUncurried = !isCurried;
+ while (++leftIndex < leftLength) {
+ result[leftIndex] = partials[leftIndex];
+ }
+ while (++argsIndex < holdersLength) {
+ if (isUncurried || argsIndex < argsLength) {
+ result[holders[argsIndex]] = args[argsIndex];
+ }
+ }
+ while (rangeLength--) {
+ result[leftIndex++] = args[argsIndex++];
+ }
+ return result;
+ }
+ /**
+ * This function is like `composeArgs` except that the arguments composition
+ * is tailored for `_.partialRight`.
+ *
+ * @private
+ * @param {Array} args The provided arguments.
+ * @param {Array} partials The arguments to append to those provided.
+ * @param {Array} holders The `partials` placeholder indexes.
+ * @params {boolean} [isCurried] Specify composing for a curried function.
+ * @returns {Array} Returns the new array of composed arguments.
+ */ function composeArgsRight(
+ args,
+ partials,
+ holders,
+ isCurried
+ ) {
+ var argsIndex = -1,
+ argsLength = args.length,
+ holdersIndex = -1,
+ holdersLength = holders.length,
+ rightIndex = -1,
+ rightLength = partials.length,
+ rangeLength = nativeMax(argsLength - holdersLength, 0),
+ result = Array(rangeLength + rightLength),
+ isUncurried = !isCurried;
+ while (++argsIndex < rangeLength) {
+ result[argsIndex] = args[argsIndex];
+ }
+ var offset = argsIndex;
+ while (++rightIndex < rightLength) {
+ result[offset + rightIndex] = partials[rightIndex];
+ }
+ while (++holdersIndex < holdersLength) {
+ if (isUncurried || argsIndex < argsLength) {
+ result[offset + holders[holdersIndex]] = args[argsIndex++];
+ }
+ }
+ return result;
+ }
+ /**
+ * Copies the values of `source` to `array`.
+ *
+ * @private
+ * @param {Array} source The array to copy values from.
+ * @param {Array} [array=[]] The array to copy values to.
+ * @returns {Array} Returns `array`.
+ */ function copyArray(source, array) {
+ var index = -1,
+ length = source.length;
+ array || (array = Array(length));
+ while (++index < length) {
+ array[index] = source[index];
+ }
+ return array;
+ }
+ /**
+ * Copies properties of `source` to `object`.
+ *
+ * @private
+ * @param {Object} source The object to copy properties from.
+ * @param {Array} props The property identifiers to copy.
+ * @param {Object} [object={}] The object to copy properties to.
+ * @param {Function} [customizer] The function to customize copied values.
+ * @returns {Object} Returns `object`.
+ */ function copyObject(source, props, object, customizer) {
+ var isNew = !object;
+ object || (object = {});
+ var index = -1,
+ length = props.length;
+ while (++index < length) {
+ var key = props[index];
+ var newValue = customizer
+ ? customizer(object[key], source[key], key, object, source)
+ : undefined;
+ if (newValue === undefined) {
+ newValue = source[key];
+ }
+ if (isNew) {
+ baseAssignValue(object, key, newValue);
+ } else {
+ assignValue(object, key, newValue);
+ }
+ }
+ return object;
+ }
+ /**
+ * Copies own symbols of `source` to `object`.
+ *
+ * @private
+ * @param {Object} source The object to copy symbols from.
+ * @param {Object} [object={}] The object to copy symbols to.
+ * @returns {Object} Returns `object`.
+ */ function copySymbols(source, object) {
+ return copyObject(source, getSymbols(source), object);
+ }
+ /**
+ * Copies own and inherited symbols of `source` to `object`.
+ *
+ * @private
+ * @param {Object} source The object to copy symbols from.
+ * @param {Object} [object={}] The object to copy symbols to.
+ * @returns {Object} Returns `object`.
+ */ function copySymbolsIn(source, object) {
+ return copyObject(source, getSymbolsIn(source), object);
+ }
+ /**
+ * Creates a function like `_.groupBy`.
+ *
+ * @private
+ * @param {Function} setter The function to set accumulator values.
+ * @param {Function} [initializer] The accumulator object initializer.
+ * @returns {Function} Returns the new aggregator function.
+ */ function createAggregator(setter, initializer) {
+ return function(collection, iteratee) {
+ var func = isArray(collection)
+ ? arrayAggregator
+ : baseAggregator,
+ accumulator = initializer ? initializer() : {};
+ return func(
+ collection,
+ setter,
+ getIteratee(iteratee, 2),
+ accumulator
+ );
+ };
+ }
+ /**
+ * Creates a function like `_.assign`.
+ *
+ * @private
+ * @param {Function} assigner The function to assign values.
+ * @returns {Function} Returns the new assigner function.
+ */ function createAssigner(assigner) {
+ return baseRest(function(object, sources) {
+ var index = -1,
+ length = sources.length,
+ customizer = length > 1 ? sources[length - 1] : undefined,
+ guard = length > 2 ? sources[2] : undefined;
+ customizer =
+ assigner.length > 3 && typeof customizer == "function"
+ ? (length--, customizer)
+ : undefined;
+ if (guard && isIterateeCall(sources[0], sources[1], guard)) {
+ customizer = length < 3 ? undefined : customizer;
+ length = 1;
+ }
+ object = Object(object);
+ while (++index < length) {
+ var source = sources[index];
+ if (source) {
+ assigner(object, source, index, customizer);
+ }
+ }
+ return object;
+ });
+ }
+ /**
+ * Creates a `baseEach` or `baseEachRight` function.
+ *
+ * @private
+ * @param {Function} eachFunc The function to iterate over a collection.
+ * @param {boolean} [fromRight] Specify iterating from right to left.
+ * @returns {Function} Returns the new base function.
+ */ function createBaseEach(eachFunc, fromRight) {
+ return function(collection, iteratee) {
+ if (collection == null) {
+ return collection;
+ }
+ if (!isArrayLike(collection)) {
+ return eachFunc(collection, iteratee);
+ }
+ var length = collection.length,
+ index = fromRight ? length : -1,
+ iterable = Object(collection);
+ while (fromRight ? index-- : ++index < length) {
+ if (iteratee(iterable[index], index, iterable) === false) {
+ break;
+ }
+ }
+ return collection;
+ };
+ }
+ /**
+ * Creates a base function for methods like `_.forIn` and `_.forOwn`.
+ *
+ * @private
+ * @param {boolean} [fromRight] Specify iterating from right to left.
+ * @returns {Function} Returns the new base function.
+ */ function createBaseFor(fromRight) {
+ return function(object, iteratee, keysFunc) {
+ var index = -1,
+ iterable = Object(object),
+ props = keysFunc(object),
+ length = props.length;
+ while (length--) {
+ var key = props[fromRight ? length : ++index];
+ if (iteratee(iterable[key], key, iterable) === false) {
+ break;
+ }
+ }
+ return object;
+ };
+ }
+ /**
+ * Creates a function that wraps `func` to invoke it with the optional `this`
+ * binding of `thisArg`.
+ *
+ * @private
+ * @param {Function} func The function to wrap.
+ * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
+ * @param {*} [thisArg] The `this` binding of `func`.
+ * @returns {Function} Returns the new wrapped function.
+ */ function createBind(func, bitmask, thisArg) {
+ var isBind = bitmask & WRAP_BIND_FLAG,
+ Ctor = createCtor(func);
+ function wrapper() {
+ var fn =
+ this && this !== root && this instanceof wrapper
+ ? Ctor
+ : func;
+ return fn.apply(isBind ? thisArg : this, arguments);
+ }
+ return wrapper;
+ }
+ /**
+ * Creates a function like `_.lowerFirst`.
+ *
+ * @private
+ * @param {string} methodName The name of the `String` case method to use.
+ * @returns {Function} Returns the new case function.
+ */ function createCaseFirst(methodName) {
+ return function(string) {
+ string = toString(string);
+ var strSymbols = hasUnicode(string)
+ ? stringToArray(string)
+ : undefined;
+ var chr = strSymbols ? strSymbols[0] : string.charAt(0);
+ var trailing = strSymbols
+ ? castSlice(strSymbols, 1).join("")
+ : string.slice(1);
+ return chr[methodName]() + trailing;
+ };
+ }
+ /**
+ * Creates a function like `_.camelCase`.
+ *
+ * @private
+ * @param {Function} callback The function to combine each word.
+ * @returns {Function} Returns the new compounder function.
+ */ function createCompounder(callback) {
+ return function(string) {
+ return arrayReduce(
+ words(deburr(string).replace(reApos, "")),
+ callback,
+ ""
+ );
+ };
+ }
+ /**
+ * Creates a function that produces an instance of `Ctor` regardless of
+ * whether it was invoked as part of a `new` expression or by `call` or `apply`.
+ *
+ * @private
+ * @param {Function} Ctor The constructor to wrap.
+ * @returns {Function} Returns the new wrapped function.
+ */ function createCtor(Ctor) {
+ return function() {
+ // Use a `switch` statement to work with class constructors. See
+ // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist
+ // for more details.
+ var args = arguments;
+ switch (args.length) {
+ case 0:
+ return new Ctor();
+ case 1:
+ return new Ctor(args[0]);
+ case 2:
+ return new Ctor(args[0], args[1]);
+ case 3:
+ return new Ctor(args[0], args[1], args[2]);
+ case 4:
+ return new Ctor(args[0], args[1], args[2], args[3]);
+ case 5:
+ return new Ctor(
+ args[0],
+ args[1],
+ args[2],
+ args[3],
+ args[4]
+ );
+ case 6:
+ return new Ctor(
+ args[0],
+ args[1],
+ args[2],
+ args[3],
+ args[4],
+ args[5]
+ );
+ case 7:
+ return new Ctor(
+ args[0],
+ args[1],
+ args[2],
+ args[3],
+ args[4],
+ args[5],
+ args[6]
+ );
+ }
+ var thisBinding = baseCreate(Ctor.prototype),
+ result = Ctor.apply(thisBinding, args); // Mimic the constructor's `return` behavior.
+ // See https://es5.github.io/#x13.2.2 for more details.
+ return isObject(result) ? result : thisBinding;
+ };
+ }
+ /**
+ * Creates a function that wraps `func` to enable currying.
+ *
+ * @private
+ * @param {Function} func The function to wrap.
+ * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
+ * @param {number} arity The arity of `func`.
+ * @returns {Function} Returns the new wrapped function.
+ */ function createCurry(func, bitmask, arity) {
+ var Ctor = createCtor(func);
+ function wrapper() {
+ var length = arguments.length,
+ args = Array(length),
+ index = length,
+ placeholder = getHolder(wrapper);
+ while (index--) {
+ args[index] = arguments[index];
+ }
+ var holders =
+ length < 3 &&
+ args[0] !== placeholder &&
+ args[length - 1] !== placeholder
+ ? []
+ : replaceHolders(args, placeholder);
+ length -= holders.length;
+ if (length < arity) {
+ return createRecurry(
+ func,
+ bitmask,
+ createHybrid,
+ wrapper.placeholder,
+ undefined,
+ args,
+ holders,
+ undefined,
+ undefined,
+ arity - length
+ );
+ }
+ var fn =
+ this && this !== root && this instanceof wrapper
+ ? Ctor
+ : func;
+ return apply(fn, this, args);
+ }
+ return wrapper;
+ }
+ /**
+ * Creates a `_.find` or `_.findLast` function.
+ *
+ * @private
+ * @param {Function} findIndexFunc The function to find the collection index.
+ * @returns {Function} Returns the new find function.
+ */ function createFind(findIndexFunc) {
+ return function(collection, predicate, fromIndex) {
+ var iterable = Object(collection);
+ if (!isArrayLike(collection)) {
+ var iteratee = getIteratee(predicate, 3);
+ collection = keys(collection);
+ predicate = function predicate(key) {
+ return iteratee(iterable[key], key, iterable);
+ };
+ }
+ var index = findIndexFunc(collection, predicate, fromIndex);
+ return index > -1
+ ? iterable[iteratee ? collection[index] : index]
+ : undefined;
+ };
+ }
+ /**
+ * Creates a `_.flow` or `_.flowRight` function.
+ *
+ * @private
+ * @param {boolean} [fromRight] Specify iterating from right to left.
+ * @returns {Function} Returns the new flow function.
+ */ function createFlow(fromRight) {
+ return flatRest(function(funcs) {
+ var length = funcs.length,
+ index = length,
+ prereq = LodashWrapper.prototype.thru;
+ if (fromRight) {
+ funcs.reverse();
+ }
+ while (index--) {
+ var func = funcs[index];
+ if (typeof func != "function") {
+ throw new TypeError(FUNC_ERROR_TEXT);
+ }
+ if (prereq && !wrapper && getFuncName(func) == "wrapper") {
+ var wrapper = new LodashWrapper([], true);
+ }
+ }
+ index = wrapper ? index : length;
+ while (++index < length) {
+ func = funcs[index];
+ var funcName = getFuncName(func),
+ data = funcName == "wrapper" ? getData(func) : undefined;
+ if (
+ data &&
+ isLaziable(data[0]) &&
+ data[1] ==
+ (WRAP_ARY_FLAG |
+ WRAP_CURRY_FLAG |
+ WRAP_PARTIAL_FLAG |
+ WRAP_REARG_FLAG) &&
+ !data[4].length &&
+ data[9] == 1
+ ) {
+ wrapper = wrapper[getFuncName(data[0])].apply(
+ wrapper,
+ data[3]
+ );
+ } else {
+ wrapper =
+ func.length == 1 && isLaziable(func)
+ ? wrapper[funcName]()
+ : wrapper.thru(func);
+ }
+ }
+ return function() {
+ var args = arguments,
+ value = args[0];
+ if (wrapper && args.length == 1 && isArray(value)) {
+ return wrapper.plant(value).value();
+ }
+ var index = 0,
+ result = length ? funcs[index].apply(this, args) : value;
+ while (++index < length) {
+ result = funcs[index].call(this, result);
+ }
+ return result;
+ };
+ });
+ }
+ /**
+ * Creates a function that wraps `func` to invoke it with optional `this`
+ * binding of `thisArg`, partial application, and currying.
+ *
+ * @private
+ * @param {Function|string} func The function or method name to wrap.
+ * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
+ * @param {*} [thisArg] The `this` binding of `func`.
+ * @param {Array} [partials] The arguments to prepend to those provided to
+ * the new function.
+ * @param {Array} [holders] The `partials` placeholder indexes.
+ * @param {Array} [partialsRight] The arguments to append to those provided
+ * to the new function.
+ * @param {Array} [holdersRight] The `partialsRight` placeholder indexes.
+ * @param {Array} [argPos] The argument positions of the new function.
+ * @param {number} [ary] The arity cap of `func`.
+ * @param {number} [arity] The arity of `func`.
+ * @returns {Function} Returns the new wrapped function.
+ */ function createHybrid(
+ func,
+ bitmask,
+ thisArg,
+ partials,
+ holders,
+ partialsRight,
+ holdersRight,
+ argPos,
+ ary,
+ arity
+ ) {
+ var isAry = bitmask & WRAP_ARY_FLAG,
+ isBind = bitmask & WRAP_BIND_FLAG,
+ isBindKey = bitmask & WRAP_BIND_KEY_FLAG,
+ isCurried =
+ bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG),
+ isFlip = bitmask & WRAP_FLIP_FLAG,
+ Ctor = isBindKey ? undefined : createCtor(func);
+ function wrapper() {
+ var length = arguments.length,
+ args = Array(length),
+ index = length;
+ while (index--) {
+ args[index] = arguments[index];
+ }
+ if (isCurried) {
+ var placeholder = getHolder(wrapper),
+ holdersCount = countHolders(args, placeholder);
+ }
+ if (partials) {
+ args = composeArgs(args, partials, holders, isCurried);
+ }
+ if (partialsRight) {
+ args = composeArgsRight(
+ args,
+ partialsRight,
+ holdersRight,
+ isCurried
+ );
+ }
+ length -= holdersCount;
+ if (isCurried && length < arity) {
+ var newHolders = replaceHolders(args, placeholder);
+ return createRecurry(
+ func,
+ bitmask,
+ createHybrid,
+ wrapper.placeholder,
+ thisArg,
+ args,
+ newHolders,
+ argPos,
+ ary,
+ arity - length
+ );
+ }
+ var thisBinding = isBind ? thisArg : this,
+ fn = isBindKey ? thisBinding[func] : func;
+ length = args.length;
+ if (argPos) {
+ args = reorder(args, argPos);
+ } else if (isFlip && length > 1) {
+ args.reverse();
+ }
+ if (isAry && ary < length) {
+ args.length = ary;
+ }
+ if (this && this !== root && this instanceof wrapper) {
+ fn = Ctor || createCtor(fn);
+ }
+ return fn.apply(thisBinding, args);
+ }
+ return wrapper;
+ }
+ /**
+ * Creates a function like `_.invertBy`.
+ *
+ * @private
+ * @param {Function} setter The function to set accumulator values.
+ * @param {Function} toIteratee The function to resolve iteratees.
+ * @returns {Function} Returns the new inverter function.
+ */ function createInverter(setter, toIteratee) {
+ return function(object, iteratee) {
+ return baseInverter(object, setter, toIteratee(iteratee), {});
+ };
+ }
+ /**
+ * Creates a function that performs a mathematical operation on two values.
+ *
+ * @private
+ * @param {Function} operator The function to perform the operation.
+ * @param {number} [defaultValue] The value used for `undefined` arguments.
+ * @returns {Function} Returns the new mathematical operation function.
+ */ function createMathOperation(operator, defaultValue) {
+ return function(value, other) {
+ var result;
+ if (value === undefined && other === undefined) {
+ return defaultValue;
+ }
+ if (value !== undefined) {
+ result = value;
+ }
+ if (other !== undefined) {
+ if (result === undefined) {
+ return other;
+ }
+ if (typeof value == "string" || typeof other == "string") {
+ value = baseToString(value);
+ other = baseToString(other);
+ } else {
+ value = baseToNumber(value);
+ other = baseToNumber(other);
+ }
+ result = operator(value, other);
+ }
+ return result;
+ };
+ }
+ /**
+ * Creates a function like `_.over`.
+ *
+ * @private
+ * @param {Function} arrayFunc The function to iterate over iteratees.
+ * @returns {Function} Returns the new over function.
+ */ function createOver(arrayFunc) {
+ return flatRest(function(iteratees) {
+ iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
+ return baseRest(function(args) {
+ var thisArg = this;
+ return arrayFunc(iteratees, function(iteratee) {
+ return apply(iteratee, thisArg, args);
+ });
+ });
+ });
+ }
+ /**
+ * Creates the padding for `string` based on `length`. The `chars` string
+ * is truncated if the number of characters exceeds `length`.
+ *
+ * @private
+ * @param {number} length The padding length.
+ * @param {string} [chars=' '] The string used as padding.
+ * @returns {string} Returns the padding for `string`.
+ */ function createPadding(length, chars) {
+ chars = chars === undefined ? " " : baseToString(chars);
+ var charsLength = chars.length;
+ if (charsLength < 2) {
+ return charsLength ? baseRepeat(chars, length) : chars;
+ }
+ var result = baseRepeat(
+ chars,
+ nativeCeil(length / stringSize(chars))
+ );
+ return hasUnicode(chars)
+ ? castSlice(stringToArray(result), 0, length).join("")
+ : result.slice(0, length);
+ }
+ /**
+ * Creates a function that wraps `func` to invoke it with the `this` binding
+ * of `thisArg` and `partials` prepended to the arguments it receives.
+ *
+ * @private
+ * @param {Function} func The function to wrap.
+ * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
+ * @param {*} thisArg The `this` binding of `func`.
+ * @param {Array} partials The arguments to prepend to those provided to
+ * the new function.
+ * @returns {Function} Returns the new wrapped function.
+ */ function createPartial(func, bitmask, thisArg, partials) {
+ var isBind = bitmask & WRAP_BIND_FLAG,
+ Ctor = createCtor(func);
+ function wrapper() {
+ var argsIndex = -1,
+ argsLength = arguments.length,
+ leftIndex = -1,
+ leftLength = partials.length,
+ args = Array(leftLength + argsLength),
+ fn =
+ this && this !== root && this instanceof wrapper
+ ? Ctor
+ : func;
+ while (++leftIndex < leftLength) {
+ args[leftIndex] = partials[leftIndex];
+ }
+ while (argsLength--) {
+ args[leftIndex++] = arguments[++argsIndex];
+ }
+ return apply(fn, isBind ? thisArg : this, args);
+ }
+ return wrapper;
+ }
+ /**
+ * Creates a `_.range` or `_.rangeRight` function.
+ *
+ * @private
+ * @param {boolean} [fromRight] Specify iterating from right to left.
+ * @returns {Function} Returns the new range function.
+ */ function createRange(fromRight) {
+ return function(start, end, step) {
+ if (
+ step &&
+ typeof step != "number" &&
+ isIterateeCall(start, end, step)
+ ) {
+ end = step = undefined;
+ } // Ensure the sign of `-0` is preserved.
+ start = toFinite(start);
+ if (end === undefined) {
+ end = start;
+ start = 0;
+ } else {
+ end = toFinite(end);
+ }
+ step =
+ step === undefined
+ ? start < end ? 1 : -1
+ : toFinite(step);
+ return baseRange(start, end, step, fromRight);
+ };
+ }
+ /**
+ * Creates a function that performs a relational operation on two values.
+ *
+ * @private
+ * @param {Function} operator The function to perform the operation.
+ * @returns {Function} Returns the new relational operation function.
+ */ function createRelationalOperation(operator) {
+ return function(value, other) {
+ if (!(typeof value == "string" && typeof other == "string")) {
+ value = toNumber(value);
+ other = toNumber(other);
+ }
+ return operator(value, other);
+ };
+ }
+ /**
+ * Creates a function that wraps `func` to continue currying.
+ *
+ * @private
+ * @param {Function} func The function to wrap.
+ * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
+ * @param {Function} wrapFunc The function to create the `func` wrapper.
+ * @param {*} placeholder The placeholder value.
+ * @param {*} [thisArg] The `this` binding of `func`.
+ * @param {Array} [partials] The arguments to prepend to those provided to
+ * the new function.
+ * @param {Array} [holders] The `partials` placeholder indexes.
+ * @param {Array} [argPos] The argument positions of the new function.
+ * @param {number} [ary] The arity cap of `func`.
+ * @param {number} [arity] The arity of `func`.
+ * @returns {Function} Returns the new wrapped function.
+ */ function createRecurry(
+ func,
+ bitmask,
+ wrapFunc,
+ placeholder,
+ thisArg,
+ partials,
+ holders,
+ argPos,
+ ary,
+ arity
+ ) {
+ var isCurry = bitmask & WRAP_CURRY_FLAG,
+ newHolders = isCurry ? holders : undefined,
+ newHoldersRight = isCurry ? undefined : holders,
+ newPartials = isCurry ? partials : undefined,
+ newPartialsRight = isCurry ? undefined : partials;
+ bitmask |= isCurry
+ ? WRAP_PARTIAL_FLAG
+ : WRAP_PARTIAL_RIGHT_FLAG;
+ bitmask &= ~(isCurry
+ ? WRAP_PARTIAL_RIGHT_FLAG
+ : WRAP_PARTIAL_FLAG);
+ if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) {
+ bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG);
+ }
+ var newData = [
+ func,
+ bitmask,
+ thisArg,
+ newPartials,
+ newHolders,
+ newPartialsRight,
+ newHoldersRight,
+ argPos,
+ ary,
+ arity
+ ];
+ var result = wrapFunc.apply(undefined, newData);
+ if (isLaziable(func)) {
+ setData(result, newData);
+ }
+ result.placeholder = placeholder;
+ return setWrapToString(result, func, bitmask);
+ }
+ /**
+ * Creates a function like `_.round`.
+ *
+ * @private
+ * @param {string} methodName The name of the `Math` method to use when rounding.
+ * @returns {Function} Returns the new round function.
+ */ function createRound(methodName) {
+ var func = Math[methodName];
+ return function(number, precision) {
+ number = toNumber(number);
+ precision =
+ precision == null
+ ? 0
+ : nativeMin(toInteger(precision), 292);
+ if (precision) {
+ // Shift with exponential notation to avoid floating-point issues.
+ // See [MDN](https://mdn.io/round#Examples) for more details.
+ var pair = (toString(number) + "e").split("e"),
+ value = func(pair[0] + "e" + (+pair[1] + precision));
+ pair = (toString(value) + "e").split("e");
+ return +(pair[0] + "e" + (+pair[1] - precision));
+ }
+ return func(number);
+ };
+ }
+ /**
+ * Creates a set object of `values`.
+ *
+ * @private
+ * @param {Array} values The values to add to the set.
+ * @returns {Object} Returns the new set.
+ */ var createSet = !(
+ Set && 1 / setToArray(new Set([, -0]))[1] == INFINITY
+ )
+ ? noop
+ : function(values) {
+ return new Set(values);
+ };
+ /**
+ * Creates a `_.toPairs` or `_.toPairsIn` function.
+ *
+ * @private
+ * @param {Function} keysFunc The function to get the keys of a given object.
+ * @returns {Function} Returns the new pairs function.
+ */ function createToPairs(keysFunc) {
+ return function(object) {
+ var tag = getTag(object);
+ if (tag == mapTag) {
+ return mapToArray(object);
+ }
+ if (tag == setTag) {
+ return setToPairs(object);
+ }
+ return baseToPairs(object, keysFunc(object));
+ };
+ }
+ /**
+ * Creates a function that either curries or invokes `func` with optional
+ * `this` binding and partially applied arguments.
+ *
+ * @private
+ * @param {Function|string} func The function or method name to wrap.
+ * @param {number} bitmask The bitmask flags.
+ * 1 - `_.bind`
+ * 2 - `_.bindKey`
+ * 4 - `_.curry` or `_.curryRight` of a bound function
+ * 8 - `_.curry`
+ * 16 - `_.curryRight`
+ * 32 - `_.partial`
+ * 64 - `_.partialRight`
+ * 128 - `_.rearg`
+ * 256 - `_.ary`
+ * 512 - `_.flip`
+ * @param {*} [thisArg] The `this` binding of `func`.
+ * @param {Array} [partials] The arguments to be partially applied.
+ * @param {Array} [holders] The `partials` placeholder indexes.
+ * @param {Array} [argPos] The argument positions of the new function.
+ * @param {number} [ary] The arity cap of `func`.
+ * @param {number} [arity] The arity of `func`.
+ * @returns {Function} Returns the new wrapped function.
+ */ function createWrap(
+ func,
+ bitmask,
+ thisArg,
+ partials,
+ holders,
+ argPos,
+ ary,
+ arity
+ ) {
+ var isBindKey = bitmask & WRAP_BIND_KEY_FLAG;
+ if (!isBindKey && typeof func != "function") {
+ throw new TypeError(FUNC_ERROR_TEXT);
+ }
+ var length = partials ? partials.length : 0;
+ if (!length) {
+ bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG);
+ partials = holders = undefined;
+ }
+ ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0);
+ arity = arity === undefined ? arity : toInteger(arity);
+ length -= holders ? holders.length : 0;
+ if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) {
+ var partialsRight = partials,
+ holdersRight = holders;
+ partials = holders = undefined;
+ }
+ var data = isBindKey ? undefined : getData(func);
+ var newData = [
+ func,
+ bitmask,
+ thisArg,
+ partials,
+ holders,
+ partialsRight,
+ holdersRight,
+ argPos,
+ ary,
+ arity
+ ];
+ if (data) {
+ mergeData(newData, data);
+ }
+ func = newData[0];
+ bitmask = newData[1];
+ thisArg = newData[2];
+ partials = newData[3];
+ holders = newData[4];
+ arity = newData[9] =
+ newData[9] === undefined
+ ? isBindKey ? 0 : func.length
+ : nativeMax(newData[9] - length, 0);
+ if (
+ !arity &&
+ bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)
+ ) {
+ bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG);
+ }
+ if (!bitmask || bitmask == WRAP_BIND_FLAG) {
+ var result = createBind(func, bitmask, thisArg);
+ } else if (
+ bitmask == WRAP_CURRY_FLAG ||
+ bitmask == WRAP_CURRY_RIGHT_FLAG
+ ) {
+ result = createCurry(func, bitmask, arity);
+ } else if (
+ (bitmask == WRAP_PARTIAL_FLAG ||
+ bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) &&
+ !holders.length
+ ) {
+ result = createPartial(func, bitmask, thisArg, partials);
+ } else {
+ result = createHybrid.apply(undefined, newData);
+ }
+ var setter = data ? baseSetData : setData;
+ return setWrapToString(setter(result, newData), func, bitmask);
+ }
+ /**
+ * Used by `_.defaults` to customize its `_.assignIn` use to assign properties
+ * of source objects to the destination object for all destination properties
+ * that resolve to `undefined`.
+ *
+ * @private
+ * @param {*} objValue The destination value.
+ * @param {*} srcValue The source value.
+ * @param {string} key The key of the property to assign.
+ * @param {Object} object The parent object of `objValue`.
+ * @returns {*} Returns the value to assign.
+ */ function customDefaultsAssignIn(
+ objValue,
+ srcValue,
+ key,
+ object
+ ) {
+ if (
+ objValue === undefined ||
+ (eq(objValue, objectProto[key]) &&
+ !hasOwnProperty.call(object, key))
+ ) {
+ return srcValue;
+ }
+ return objValue;
+ }
+ /**
+ * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source
+ * objects into destination objects that are passed thru.
+ *
+ * @private
+ * @param {*} objValue The destination value.
+ * @param {*} srcValue The source value.
+ * @param {string} key The key of the property to merge.
+ * @param {Object} object The parent object of `objValue`.
+ * @param {Object} source The parent object of `srcValue`.
+ * @param {Object} [stack] Tracks traversed source values and their merged
+ * counterparts.
+ * @returns {*} Returns the value to assign.
+ */ function customDefaultsMerge(
+ objValue,
+ srcValue,
+ key,
+ object,
+ source,
+ stack
+ ) {
+ if (isObject(objValue) && isObject(srcValue)) {
+ // Recursively merge objects and arrays (susceptible to call stack limits).
+ stack.set(srcValue, objValue);
+ baseMerge(
+ objValue,
+ srcValue,
+ undefined,
+ customDefaultsMerge,
+ stack
+ );
+ stack["delete"](srcValue);
+ }
+ return objValue;
+ }
+ /**
+ * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain
+ * objects.
+ *
+ * @private
+ * @param {*} value The value to inspect.
+ * @param {string} key The key of the property to inspect.
+ * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`.
+ */ function customOmitClone(value) {
+ return isPlainObject(value) ? undefined : value;
+ }
+ /**
+ * A specialized version of `baseIsEqualDeep` for arrays with support for
+ * partial deep comparisons.
+ *
+ * @private
+ * @param {Array} array The array to compare.
+ * @param {Array} other The other array to compare.
+ * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
+ * @param {Function} customizer The function to customize comparisons.
+ * @param {Function} equalFunc The function to determine equivalents of values.
+ * @param {Object} stack Tracks traversed `array` and `other` objects.
+ * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
+ */ function equalArrays(
+ array,
+ other,
+ bitmask,
+ customizer,
+ equalFunc,
+ stack
+ ) {
+ var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
+ arrLength = array.length,
+ othLength = other.length;
+ if (
+ arrLength != othLength &&
+ !(isPartial && othLength > arrLength)
+ ) {
+ return false;
+ } // Assume cyclic values are equal.
+ var stacked = stack.get(array);
+ if (stacked && stack.get(other)) {
+ return stacked == other;
+ }
+ var index = -1,
+ result = true,
+ seen =
+ bitmask & COMPARE_UNORDERED_FLAG
+ ? new SetCache()
+ : undefined;
+ stack.set(array, other);
+ stack.set(other, array); // Ignore non-index properties.
+ while (++index < arrLength) {
+ var arrValue = array[index],
+ othValue = other[index];
+ if (customizer) {
+ var compared = isPartial
+ ? customizer(
+ othValue,
+ arrValue,
+ index,
+ other,
+ array,
+ stack
+ )
+ : customizer(
+ arrValue,
+ othValue,
+ index,
+ array,
+ other,
+ stack
+ );
+ }
+ if (compared !== undefined) {
+ if (compared) {
+ continue;
+ }
+ result = false;
+ break;
+ } // Recursively compare arrays (susceptible to call stack limits).
+ if (seen) {
+ if (
+ !arraySome(other, function(othValue, othIndex) {
+ if (
+ !cacheHas(seen, othIndex) &&
+ (arrValue === othValue ||
+ equalFunc(
+ arrValue,
+ othValue,
+ bitmask,
+ customizer,
+ stack
+ ))
+ ) {
+ return seen.push(othIndex);
+ }
+ })
+ ) {
+ result = false;
+ break;
+ }
+ } else if (
+ !(
+ arrValue === othValue ||
+ equalFunc(arrValue, othValue, bitmask, customizer, stack)
+ )
+ ) {
+ result = false;
+ break;
+ }
+ }
+ stack["delete"](array);
+ stack["delete"](other);
+ return result;
+ }
+ /**
+ * A specialized version of `baseIsEqualDeep` for comparing objects of
+ * the same `toStringTag`.
+ *
+ * **Note:** This function only supports comparing values with tags of
+ * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
+ *
+ * @private
+ * @param {Object} object The object to compare.
+ * @param {Object} other The other object to compare.
+ * @param {string} tag The `toStringTag` of the objects to compare.
+ * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
+ * @param {Function} customizer The function to customize comparisons.
+ * @param {Function} equalFunc The function to determine equivalents of values.
+ * @param {Object} stack Tracks traversed `object` and `other` objects.
+ * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
+ */ function equalByTag(
+ object,
+ other,
+ tag,
+ bitmask,
+ customizer,
+ equalFunc,
+ stack
+ ) {
+ switch (tag) {
+ case dataViewTag:
+ if (
+ object.byteLength != other.byteLength ||
+ object.byteOffset != other.byteOffset
+ ) {
+ return false;
+ }
+ object = object.buffer;
+ other = other.buffer;
+ case arrayBufferTag:
+ if (
+ object.byteLength != other.byteLength ||
+ !equalFunc(new Uint8Array(object), new Uint8Array(other))
+ ) {
+ return false;
+ }
+ return true;
+ case boolTag:
+ case dateTag:
+ case numberTag: // Coerce booleans to `1` or `0` and dates to milliseconds.
+ // Invalid dates are coerced to `NaN`.
+ return eq(+object, +other);
+ case errorTag:
+ return (
+ object.name == other.name &&
+ object.message == other.message
+ );
+ case regexpTag:
+ case stringTag: // Coerce regexes to strings and treat strings, primitives and objects,
+ // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
+ // for more details.
+ return object == other + "";
+ case mapTag:
+ var convert = mapToArray;
+ case setTag:
+ var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
+ convert || (convert = setToArray);
+ if (object.size != other.size && !isPartial) {
+ return false;
+ } // Assume cyclic values are equal.
+ var stacked = stack.get(object);
+ if (stacked) {
+ return stacked == other;
+ }
+ bitmask |= COMPARE_UNORDERED_FLAG; // Recursively compare objects (susceptible to call stack limits).
+ stack.set(object, other);
+ var result = equalArrays(
+ convert(object),
+ convert(other),
+ bitmask,
+ customizer,
+ equalFunc,
+ stack
+ );
+ stack["delete"](object);
+ return result;
+ case symbolTag:
+ if (symbolValueOf) {
+ return (
+ symbolValueOf.call(object) == symbolValueOf.call(other)
+ );
+ }
+ }
+ return false;
+ }
+ /**
+ * A specialized version of `baseIsEqualDeep` for objects with support for
+ * partial deep comparisons.
+ *
+ * @private
+ * @param {Object} object The object to compare.
+ * @param {Object} other The other object to compare.
+ * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
+ * @param {Function} customizer The function to customize comparisons.
+ * @param {Function} equalFunc The function to determine equivalents of values.
+ * @param {Object} stack Tracks traversed `object` and `other` objects.
+ * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
+ */ function equalObjects(
+ object,
+ other,
+ bitmask,
+ customizer,
+ equalFunc,
+ stack
+ ) {
+ var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
+ objProps = getAllKeys(object),
+ objLength = objProps.length,
+ othProps = getAllKeys(other),
+ othLength = othProps.length;
+ if (objLength != othLength && !isPartial) {
+ return false;
+ }
+ var index = objLength;
+ while (index--) {
+ var key = objProps[index];
+ if (
+ !(isPartial
+ ? key in other
+ : hasOwnProperty.call(other, key))
+ ) {
+ return false;
+ }
+ } // Assume cyclic values are equal.
+ var stacked = stack.get(object);
+ if (stacked && stack.get(other)) {
+ return stacked == other;
+ }
+ var result = true;
+ stack.set(object, other);
+ stack.set(other, object);
+ var skipCtor = isPartial;
+ while (++index < objLength) {
+ key = objProps[index];
+ var objValue = object[key],
+ othValue = other[key];
+ if (customizer) {
+ var compared = isPartial
+ ? customizer(
+ othValue,
+ objValue,
+ key,
+ other,
+ object,
+ stack
+ )
+ : customizer(
+ objValue,
+ othValue,
+ key,
+ object,
+ other,
+ stack
+ );
+ } // Recursively compare objects (susceptible to call stack limits).
+ if (
+ !(compared === undefined
+ ? objValue === othValue ||
+ equalFunc(
+ objValue,
+ othValue,
+ bitmask,
+ customizer,
+ stack
+ )
+ : compared)
+ ) {
+ result = false;
+ break;
+ }
+ skipCtor || (skipCtor = key == "constructor");
+ }
+ if (result && !skipCtor) {
+ var objCtor = object.constructor,
+ othCtor = other.constructor; // Non `Object` object instances with different constructors are not equal.
+ if (
+ objCtor != othCtor &&
+ "constructor" in object &&
+ "constructor" in other &&
+ !(
+ typeof objCtor == "function" &&
+ objCtor instanceof objCtor &&
+ typeof othCtor == "function" &&
+ othCtor instanceof othCtor
+ )
+ ) {
+ result = false;
+ }
+ }
+ stack["delete"](object);
+ stack["delete"](other);
+ return result;
+ }
+ /**
+ * A specialized version of `baseRest` which flattens the rest array.
+ *
+ * @private
+ * @param {Function} func The function to apply a rest parameter to.
+ * @returns {Function} Returns the new function.
+ */ function flatRest(func) {
+ return setToString(
+ overRest(func, undefined, flatten),
+ func + ""
+ );
+ }
+ /**
+ * Creates an array of own enumerable property names and symbols of `object`.
+ *
+ * @private
+ * @param {Object} object The object to query.
+ * @returns {Array} Returns the array of property names and symbols.
+ */ function getAllKeys(object) {
+ return baseGetAllKeys(object, keys, getSymbols);
+ }
+ /**
+ * Creates an array of own and inherited enumerable property names and
+ * symbols of `object`.
+ *
+ * @private
+ * @param {Object} object The object to query.
+ * @returns {Array} Returns the array of property names and symbols.
+ */ function getAllKeysIn(object) {
+ return baseGetAllKeys(object, keysIn, getSymbolsIn);
+ }
+ /**
+ * Gets metadata for `func`.
+ *
+ * @private
+ * @param {Function} func The function to query.
+ * @returns {*} Returns the metadata for `func`.
+ */ var getData = !metaMap
+ ? noop
+ : function(func) {
+ return metaMap.get(func);
+ };
+ /**
+ * Gets the name of `func`.
+ *
+ * @private
+ * @param {Function} func The function to query.
+ * @returns {string} Returns the function name.
+ */ function getFuncName(func) {
+ var result = func.name + "",
+ array = realNames[result],
+ length = hasOwnProperty.call(realNames, result)
+ ? array.length
+ : 0;
+ while (length--) {
+ var data = array[length],
+ otherFunc = data.func;
+ if (otherFunc == null || otherFunc == func) {
+ return data.name;
+ }
+ }
+ return result;
+ }
+ /**
+ * Gets the argument placeholder value for `func`.
+ *
+ * @private
+ * @param {Function} func The function to inspect.
+ * @returns {*} Returns the placeholder value.
+ */ function getHolder(func) {
+ var object = hasOwnProperty.call(lodash, "placeholder")
+ ? lodash
+ : func;
+ return object.placeholder;
+ }
+ /**
+ * Gets the appropriate "iteratee" function. If `_.iteratee` is customized,
+ * this function returns the custom method, otherwise it returns `baseIteratee`.
+ * If arguments are provided, the chosen function is invoked with them and
+ * its result is returned.
+ *
+ * @private
+ * @param {*} [value] The value to convert to an iteratee.
+ * @param {number} [arity] The arity of the created iteratee.
+ * @returns {Function} Returns the chosen function or its result.
+ */ function getIteratee() {
+ var result = lodash.iteratee || iteratee;
+ result = result === iteratee ? baseIteratee : result;
+ return arguments.length
+ ? result(arguments[0], arguments[1])
+ : result;
+ }
+ /**
+ * Gets the data for `map`.
+ *
+ * @private
+ * @param {Object} map The map to query.
+ * @param {string} key The reference key.
+ * @returns {*} Returns the map data.
+ */ function getMapData(map, key) {
+ var data = map.__data__;
+ return isKeyable(key)
+ ? data[typeof key == "string" ? "string" : "hash"]
+ : data.map;
+ }
+ /**
+ * Gets the property names, values, and compare flags of `object`.
+ *
+ * @private
+ * @param {Object} object The object to query.
+ * @returns {Array} Returns the match data of `object`.
+ */ function getMatchData(object) {
+ var result = keys(object),
+ length = result.length;
+ while (length--) {
+ var key = result[length],
+ value = object[key];
+ result[length] = [key, value, isStrictComparable(value)];
+ }
+ return result;
+ }
+ /**
+ * Gets the native function at `key` of `object`.
+ *
+ * @private
+ * @param {Object} object The object to query.
+ * @param {string} key The key of the method to get.
+ * @returns {*} Returns the function if it's native, else `undefined`.
+ */ function getNative(object, key) {
+ var value = getValue(object, key);
+ return baseIsNative(value) ? value : undefined;
+ }
+ /**
+ * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
+ *
+ * @private
+ * @param {*} value The value to query.
+ * @returns {string} Returns the raw `toStringTag`.
+ */ function getRawTag(value) {
+ var isOwn = hasOwnProperty.call(value, symToStringTag),
+ tag = value[symToStringTag];
+ try {
+ value[symToStringTag] = undefined;
+ var unmasked = true;
+ } catch (e) {}
+ var result = nativeObjectToString.call(value);
+ if (unmasked) {
+ if (isOwn) {
+ value[symToStringTag] = tag;
+ } else {
+ delete value[symToStringTag];
+ }
+ }
+ return result;
+ }
+ /**
+ * Creates an array of the own enumerable symbols of `object`.
+ *
+ * @private
+ * @param {Object} object The object to query.
+ * @returns {Array} Returns the array of symbols.
+ */ var getSymbols = !nativeGetSymbols
+ ? stubArray
+ : function(object) {
+ if (object == null) {
+ return [];
+ }
+ object = Object(object);
+ return arrayFilter(nativeGetSymbols(object), function(
+ symbol
+ ) {
+ return propertyIsEnumerable.call(object, symbol);
+ });
+ };
+ /**
+ * Creates an array of the own and inherited enumerable symbols of `object`.
+ *
+ * @private
+ * @param {Object} object The object to query.
+ * @returns {Array} Returns the array of symbols.
+ */ var getSymbolsIn = !nativeGetSymbols
+ ? stubArray
+ : function(object) {
+ var result = [];
+ while (object) {
+ arrayPush(result, getSymbols(object));
+ object = getPrototype(object);
+ }
+ return result;
+ };
+ /**
+ * Gets the `toStringTag` of `value`.
+ *
+ * @private
+ * @param {*} value The value to query.
+ * @returns {string} Returns the `toStringTag`.
+ */ var getTag = baseGetTag; // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
+ if (
+ (DataView &&
+ getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
+ (Map && getTag(new Map()) != mapTag) ||
+ (Promise && getTag(Promise.resolve()) != promiseTag) ||
+ (Set && getTag(new Set()) != setTag) ||
+ (WeakMap && getTag(new WeakMap()) != weakMapTag)
+ ) {
+ getTag = function getTag(value) {
+ var result = baseGetTag(value),
+ Ctor = result == objectTag ? value.constructor : undefined,
+ ctorString = Ctor ? toSource(Ctor) : "";
+ if (ctorString) {
+ switch (ctorString) {
+ case dataViewCtorString:
+ return dataViewTag;
+ case mapCtorString:
+ return mapTag;
+ case promiseCtorString:
+ return promiseTag;
+ case setCtorString:
+ return setTag;
+ case weakMapCtorString:
+ return weakMapTag;
+ }
+ }
+ return result;
+ };
+ }
+ /**
+ * Gets the view, applying any `transforms` to the `start` and `end` positions.
+ *
+ * @private
+ * @param {number} start The start of the view.
+ * @param {number} end The end of the view.
+ * @param {Array} transforms The transformations to apply to the view.
+ * @returns {Object} Returns an object containing the `start` and `end`
+ * positions of the view.
+ */ function getView(start, end, transforms) {
+ var index = -1,
+ length = transforms.length;
+ while (++index < length) {
+ var data = transforms[index],
+ size = data.size;
+ switch (data.type) {
+ case "drop":
+ start += size;
+ break;
+ case "dropRight":
+ end -= size;
+ break;
+ case "take":
+ end = nativeMin(end, start + size);
+ break;
+ case "takeRight":
+ start = nativeMax(start, end - size);
+ break;
+ }
+ }
+ return { start: start, end: end };
+ }
+ /**
+ * Extracts wrapper details from the `source` body comment.
+ *
+ * @private
+ * @param {string} source The source to inspect.
+ * @returns {Array} Returns the wrapper details.
+ */ function getWrapDetails(source) {
+ var match = source.match(reWrapDetails);
+ return match ? match[1].split(reSplitDetails) : [];
+ }
+ /**
+ * Checks if `path` exists on `object`.
+ *
+ * @private
+ * @param {Object} object The object to query.
+ * @param {Array|string} path The path to check.
+ * @param {Function} hasFunc The function to check properties.
+ * @returns {boolean} Returns `true` if `path` exists, else `false`.
+ */ function hasPath(object, path, hasFunc) {
+ path = castPath(path, object);
+ var index = -1,
+ length = path.length,
+ result = false;
+ while (++index < length) {
+ var key = toKey(path[index]);
+ if (!(result = object != null && hasFunc(object, key))) {
+ break;
+ }
+ object = object[key];
+ }
+ if (result || ++index != length) {
+ return result;
+ }
+ length = object == null ? 0 : object.length;
+ return (
+ !!length &&
+ isLength(length) &&
+ isIndex(key, length) &&
+ (isArray(object) || isArguments(object))
+ );
+ }
+ /**
+ * Initializes an array clone.
+ *
+ * @private
+ * @param {Array} array The array to clone.
+ * @returns {Array} Returns the initialized clone.
+ */ function initCloneArray(array) {
+ var length = array.length,
+ result = new array.constructor(length); // Add properties assigned by `RegExp#exec`.
+ if (
+ length &&
+ typeof array[0] == "string" &&
+ hasOwnProperty.call(array, "index")
+ ) {
+ result.index = array.index;
+ result.input = array.input;
+ }
+ return result;
+ }
+ /**
+ * Initializes an object clone.
+ *
+ * @private
+ * @param {Object} object The object to clone.
+ * @returns {Object} Returns the initialized clone.
+ */ function initCloneObject(object) {
+ return typeof object.constructor == "function" &&
+ !isPrototype(object)
+ ? baseCreate(getPrototype(object))
+ : {};
+ }
+ /**
+ * Initializes an object clone based on its `toStringTag`.
+ *
+ * **Note:** This function only supports cloning values with tags of
+ * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.
+ *
+ * @private
+ * @param {Object} object The object to clone.
+ * @param {string} tag The `toStringTag` of the object to clone.
+ * @param {boolean} [isDeep] Specify a deep clone.
+ * @returns {Object} Returns the initialized clone.
+ */ function initCloneByTag(object, tag, isDeep) {
+ var Ctor = object.constructor;
+ switch (tag) {
+ case arrayBufferTag:
+ return cloneArrayBuffer(object);
+ case boolTag:
+ case dateTag:
+ return new Ctor(+object);
+ case dataViewTag:
+ return cloneDataView(object, isDeep);
+ case float32Tag:
+ case float64Tag:
+ case int8Tag:
+ case int16Tag:
+ case int32Tag:
+ case uint8Tag:
+ case uint8ClampedTag:
+ case uint16Tag:
+ case uint32Tag:
+ return cloneTypedArray(object, isDeep);
+ case mapTag:
+ return new Ctor();
+ case numberTag:
+ case stringTag:
+ return new Ctor(object);
+ case regexpTag:
+ return cloneRegExp(object);
+ case setTag:
+ return new Ctor();
+ case symbolTag:
+ return cloneSymbol(object);
+ }
+ }
+ /**
+ * Inserts wrapper `details` in a comment at the top of the `source` body.
+ *
+ * @private
+ * @param {string} source The source to modify.
+ * @returns {Array} details The details to insert.
+ * @returns {string} Returns the modified source.
+ */ function insertWrapDetails(source, details) {
+ var length = details.length;
+ if (!length) {
+ return source;
+ }
+ var lastIndex = length - 1;
+ details[lastIndex] =
+ (length > 1 ? "& " : "") + details[lastIndex];
+ details = details.join(length > 2 ? ", " : " ");
+ return source.replace(
+ reWrapComment,
+ "{\n/* [wrapped with " + details + "] */\n"
+ );
+ }
+ /**
+ * Checks if `value` is a flattenable `arguments` object or array.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.
+ */ function isFlattenable(value) {
+ return (
+ isArray(value) ||
+ isArguments(value) ||
+ !!(spreadableSymbol && value && value[spreadableSymbol])
+ );
+ }
+ /**
+ * Checks if `value` is a valid array-like index.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
+ * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
+ */ function isIndex(value, length) {
+ var type =
+ typeof value === "undefined" ? "undefined" : _typeof(value);
+ length = length == null ? MAX_SAFE_INTEGER : length;
+ return (
+ !!length &&
+ (type == "number" ||
+ (type != "symbol" && reIsUint.test(value))) &&
+ value > -1 &&
+ value % 1 == 0 &&
+ value < length
+ );
+ }
+ /**
+ * Checks if the given arguments are from an iteratee call.
+ *
+ * @private
+ * @param {*} value The potential iteratee value argument.
+ * @param {*} index The potential iteratee index or key argument.
+ * @param {*} object The potential iteratee object argument.
+ * @returns {boolean} Returns `true` if the arguments are from an iteratee call,
+ * else `false`.
+ */ function isIterateeCall(value, index, object) {
+ if (!isObject(object)) {
+ return false;
+ }
+ var type =
+ typeof index === "undefined" ? "undefined" : _typeof(index);
+ if (
+ type == "number"
+ ? isArrayLike(object) && isIndex(index, object.length)
+ : type == "string" && index in object
+ ) {
+ return eq(object[index], value);
+ }
+ return false;
+ }
+ /**
+ * Checks if `value` is a property name and not a property path.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @param {Object} [object] The object to query keys on.
+ * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
+ */ function isKey(value, object) {
+ if (isArray(value)) {
+ return false;
+ }
+ var type =
+ typeof value === "undefined" ? "undefined" : _typeof(value);
+ if (
+ type == "number" ||
+ type == "symbol" ||
+ type == "boolean" ||
+ value == null ||
+ isSymbol(value)
+ ) {
+ return true;
+ }
+ return (
+ reIsPlainProp.test(value) ||
+ !reIsDeepProp.test(value) ||
+ (object != null && value in Object(object))
+ );
+ }
+ /**
+ * Checks if `value` is suitable for use as unique object key.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
+ */ function isKeyable(value) {
+ var type =
+ typeof value === "undefined" ? "undefined" : _typeof(value);
+ return type == "string" ||
+ type == "number" ||
+ type == "symbol" ||
+ type == "boolean"
+ ? value !== "__proto__"
+ : value === null;
+ }
+ /**
+ * Checks if `func` has a lazy counterpart.
+ *
+ * @private
+ * @param {Function} func The function to check.
+ * @returns {boolean} Returns `true` if `func` has a lazy counterpart,
+ * else `false`.
+ */ function isLaziable(func) {
+ var funcName = getFuncName(func),
+ other = lodash[funcName];
+ if (
+ typeof other != "function" ||
+ !(funcName in LazyWrapper.prototype)
+ ) {
+ return false;
+ }
+ if (func === other) {
+ return true;
+ }
+ var data = getData(other);
+ return !!data && func === data[0];
+ }
+ /**
+ * Checks if `func` has its source masked.
+ *
+ * @private
+ * @param {Function} func The function to check.
+ * @returns {boolean} Returns `true` if `func` is masked, else `false`.
+ */ function isMasked(func) {
+ return !!maskSrcKey && maskSrcKey in func;
+ }
+ /**
+ * Checks if `func` is capable of being masked.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `func` is maskable, else `false`.
+ */ var isMaskable = coreJsData ? isFunction : stubFalse;
+ /**
+ * Checks if `value` is likely a prototype object.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
+ */ function isPrototype(value) {
+ var Ctor = value && value.constructor,
+ proto =
+ (typeof Ctor == "function" && Ctor.prototype) ||
+ objectProto;
+ return value === proto;
+ }
+ /**
+ * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` if suitable for strict
+ * equality comparisons, else `false`.
+ */ function isStrictComparable(value) {
+ return value === value && !isObject(value);
+ }
+ /**
+ * A specialized version of `matchesProperty` for source values suitable
+ * for strict equality comparisons, i.e. `===`.
+ *
+ * @private
+ * @param {string} key The key of the property to get.
+ * @param {*} srcValue The value to match.
+ * @returns {Function} Returns the new spec function.
+ */ function matchesStrictComparable(key, srcValue) {
+ return function(object) {
+ if (object == null) {
+ return false;
+ }
+ return (
+ object[key] === srcValue &&
+ (srcValue !== undefined || key in Object(object))
+ );
+ };
+ }
+ /**
+ * A specialized version of `_.memoize` which clears the memoized function's
+ * cache when it exceeds `MAX_MEMOIZE_SIZE`.
+ *
+ * @private
+ * @param {Function} func The function to have its output memoized.
+ * @returns {Function} Returns the new memoized function.
+ */ function memoizeCapped(func) {
+ var result = memoize(func, function(key) {
+ if (cache.size === MAX_MEMOIZE_SIZE) {
+ cache.clear();
+ }
+ return key;
+ });
+ var cache = result.cache;
+ return result;
+ }
+ /**
+ * Merges the function metadata of `source` into `data`.
+ *
+ * Merging metadata reduces the number of wrappers used to invoke a function.
+ * This is possible because methods like `_.bind`, `_.curry`, and `_.partial`
+ * may be applied regardless of execution order. Methods like `_.ary` and
+ * `_.rearg` modify function arguments, making the order in which they are
+ * executed important, preventing the merging of metadata. However, we make
+ * an exception for a safe combined case where curried functions have `_.ary`
+ * and or `_.rearg` applied.
+ *
+ * @private
+ * @param {Array} data The destination metadata.
+ * @param {Array} source The source metadata.
+ * @returns {Array} Returns `data`.
+ */ function mergeData(data, source) {
+ var bitmask = data[1],
+ srcBitmask = source[1],
+ newBitmask = bitmask | srcBitmask,
+ isCommon =
+ newBitmask <
+ (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG);
+ var isCombo =
+ (srcBitmask == WRAP_ARY_FLAG && bitmask == WRAP_CURRY_FLAG) ||
+ (srcBitmask == WRAP_ARY_FLAG &&
+ bitmask == WRAP_REARG_FLAG &&
+ data[7].length <= source[8]) ||
+ (srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG) &&
+ source[7].length <= source[8] &&
+ bitmask == WRAP_CURRY_FLAG); // Exit early if metadata can't be merged.
+ if (!(isCommon || isCombo)) {
+ return data;
+ } // Use source `thisArg` if available.
+ if (srcBitmask & WRAP_BIND_FLAG) {
+ data[2] = source[2]; // Set when currying a bound function.
+ newBitmask |=
+ bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG;
+ } // Compose partial arguments.
+ var value = source[3];
+ if (value) {
+ var partials = data[3];
+ data[3] = partials
+ ? composeArgs(partials, value, source[4])
+ : value;
+ data[4] = partials
+ ? replaceHolders(data[3], PLACEHOLDER)
+ : source[4];
+ } // Compose partial right arguments.
+ value = source[5];
+ if (value) {
+ partials = data[5];
+ data[5] = partials
+ ? composeArgsRight(partials, value, source[6])
+ : value;
+ data[6] = partials
+ ? replaceHolders(data[5], PLACEHOLDER)
+ : source[6];
+ } // Use source `argPos` if available.
+ value = source[7];
+ if (value) {
+ data[7] = value;
+ } // Use source `ary` if it's smaller.
+ if (srcBitmask & WRAP_ARY_FLAG) {
+ data[8] =
+ data[8] == null ? source[8] : nativeMin(data[8], source[8]);
+ } // Use source `arity` if one is not provided.
+ if (data[9] == null) {
+ data[9] = source[9];
+ } // Use source `func` and merge bitmasks.
+ data[0] = source[0];
+ data[1] = newBitmask;
+ return data;
+ }
+ /**
+ * This function is like
+ * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
+ * except that it includes inherited enumerable properties.
+ *
+ * @private
+ * @param {Object} object The object to query.
+ * @returns {Array} Returns the array of property names.
+ */ function nativeKeysIn(object) {
+ var result = [];
+ if (object != null) {
+ for (var key in Object(object)) {
+ result.push(key);
+ }
+ }
+ return result;
+ }
+ /**
+ * Converts `value` to a string using `Object.prototype.toString`.
+ *
+ * @private
+ * @param {*} value The value to convert.
+ * @returns {string} Returns the converted string.
+ */ function objectToString(value) {
+ return nativeObjectToString.call(value);
+ }
+ /**
+ * A specialized version of `baseRest` which transforms the rest array.
+ *
+ * @private
+ * @param {Function} func The function to apply a rest parameter to.
+ * @param {number} [start=func.length-1] The start position of the rest parameter.
+ * @param {Function} transform The rest array transform.
+ * @returns {Function} Returns the new function.
+ */ function overRest(func, start, transform) {
+ start = nativeMax(
+ start === undefined ? func.length - 1 : start,
+ 0
+ );
+ return function() {
+ var args = arguments,
+ index = -1,
+ length = nativeMax(args.length - start, 0),
+ array = Array(length);
+ while (++index < length) {
+ array[index] = args[start + index];
+ }
+ index = -1;
+ var otherArgs = Array(start + 1);
+ while (++index < start) {
+ otherArgs[index] = args[index];
+ }
+ otherArgs[start] = transform(array);
+ return apply(func, this, otherArgs);
+ };
+ }
+ /**
+ * Gets the parent value at `path` of `object`.
+ *
+ * @private
+ * @param {Object} object The object to query.
+ * @param {Array} path The path to get the parent value of.
+ * @returns {*} Returns the parent value.
+ */ function parent(object, path) {
+ return path.length < 2
+ ? object
+ : baseGet(object, baseSlice(path, 0, -1));
+ }
+ /**
+ * Reorder `array` according to the specified indexes where the element at
+ * the first index is assigned as the first element, the element at
+ * the second index is assigned as the second element, and so on.
+ *
+ * @private
+ * @param {Array} array The array to reorder.
+ * @param {Array} indexes The arranged array indexes.
+ * @returns {Array} Returns `array`.
+ */ function reorder(array, indexes) {
+ var arrLength = array.length,
+ length = nativeMin(indexes.length, arrLength),
+ oldArray = copyArray(array);
+ while (length--) {
+ var index = indexes[length];
+ array[length] = isIndex(index, arrLength)
+ ? oldArray[index]
+ : undefined;
+ }
+ return array;
+ }
+ /**
+ * Sets metadata for `func`.
+ *
+ * **Note:** If this function becomes hot, i.e. is invoked a lot in a short
+ * period of time, it will trip its breaker and transition to an identity
+ * function to avoid garbage collection pauses in V8. See
+ * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070)
+ * for more details.
+ *
+ * @private
+ * @param {Function} func The function to associate metadata with.
+ * @param {*} data The metadata.
+ * @returns {Function} Returns `func`.
+ */ var setData = shortOut(baseSetData);
+ /**
+ * A simple wrapper around the global [`setTimeout`](https://mdn.io/setTimeout).
+ *
+ * @private
+ * @param {Function} func The function to delay.
+ * @param {number} wait The number of milliseconds to delay invocation.
+ * @returns {number|Object} Returns the timer id or timeout object.
+ */ var setTimeout =
+ ctxSetTimeout ||
+ function(func, wait) {
+ return root.setTimeout(func, wait);
+ };
+ /**
+ * Sets the `toString` method of `func` to return `string`.
+ *
+ * @private
+ * @param {Function} func The function to modify.
+ * @param {Function} string The `toString` result.
+ * @returns {Function} Returns `func`.
+ */ var setToString = shortOut(baseSetToString);
+ /**
+ * Sets the `toString` method of `wrapper` to mimic the source of `reference`
+ * with wrapper details in a comment at the top of the source body.
+ *
+ * @private
+ * @param {Function} wrapper The function to modify.
+ * @param {Function} reference The reference function.
+ * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
+ * @returns {Function} Returns `wrapper`.
+ */ function setWrapToString(wrapper, reference, bitmask) {
+ var source = reference + "";
+ return setToString(
+ wrapper,
+ insertWrapDetails(
+ source,
+ updateWrapDetails(getWrapDetails(source), bitmask)
+ )
+ );
+ }
+ /**
+ * Creates a function that'll short out and invoke `identity` instead
+ * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`
+ * milliseconds.
+ *
+ * @private
+ * @param {Function} func The function to restrict.
+ * @returns {Function} Returns the new shortable function.
+ */ function shortOut(func) {
+ var count = 0,
+ lastCalled = 0;
+ return function() {
+ var stamp = nativeNow(),
+ remaining = HOT_SPAN - (stamp - lastCalled);
+ lastCalled = stamp;
+ if (remaining > 0) {
+ if (++count >= HOT_COUNT) {
+ return arguments[0];
+ }
+ } else {
+ count = 0;
+ }
+ return func.apply(undefined, arguments);
+ };
+ }
+ /**
+ * A specialized version of `_.shuffle` which mutates and sets the size of `array`.
+ *
+ * @private
+ * @param {Array} array The array to shuffle.
+ * @param {number} [size=array.length] The size of `array`.
+ * @returns {Array} Returns `array`.
+ */ function shuffleSelf(array, size) {
+ var index = -1,
+ length = array.length,
+ lastIndex = length - 1;
+ size = size === undefined ? length : size;
+ while (++index < size) {
+ var rand = baseRandom(index, lastIndex),
+ value = array[rand];
+ array[rand] = array[index];
+ array[index] = value;
+ }
+ array.length = size;
+ return array;
+ }
+ /**
+ * Converts `string` to a property path array.
+ *
+ * @private
+ * @param {string} string The string to convert.
+ * @returns {Array} Returns the property path array.
+ */ var stringToPath = memoizeCapped(function(string) {
+ var result = [];
+ if (string.charCodeAt(0) === 46 /* . */) {
+ result.push("");
+ }
+ string.replace(rePropName, function(
+ match,
+ number,
+ quote,
+ subString
+ ) {
+ result.push(
+ quote
+ ? subString.replace(reEscapeChar, "$1")
+ : number || match
+ );
+ });
+ return result;
+ });
+ /**
+ * Converts `value` to a string key if it's not a string or symbol.
+ *
+ * @private
+ * @param {*} value The value to inspect.
+ * @returns {string|symbol} Returns the key.
+ */ function toKey(value) {
+ if (typeof value == "string" || isSymbol(value)) {
+ return value;
+ }
+ var result = value + "";
+ return result == "0" && 1 / value == -INFINITY ? "-0" : result;
+ }
+ /**
+ * Converts `func` to its source code.
+ *
+ * @private
+ * @param {Function} func The function to convert.
+ * @returns {string} Returns the source code.
+ */ function toSource(func) {
+ if (func != null) {
+ try {
+ return funcToString.call(func);
+ } catch (e) {}
+ try {
+ return func + "";
+ } catch (e) {}
+ }
+ return "";
+ }
+ /**
+ * Updates wrapper `details` based on `bitmask` flags.
+ *
+ * @private
+ * @returns {Array} details The details to modify.
+ * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
+ * @returns {Array} Returns `details`.
+ */ function updateWrapDetails(details, bitmask) {
+ arrayEach(wrapFlags, function(pair) {
+ var value = "_." + pair[0];
+ if (bitmask & pair[1] && !arrayIncludes(details, value)) {
+ details.push(value);
+ }
+ });
+ return details.sort();
+ }
+ /**
+ * Creates a clone of `wrapper`.
+ *
+ * @private
+ * @param {Object} wrapper The wrapper to clone.
+ * @returns {Object} Returns the cloned wrapper.
+ */ function wrapperClone(wrapper) {
+ if (wrapper instanceof LazyWrapper) {
+ return wrapper.clone();
+ }
+ var result = new LodashWrapper(
+ wrapper.__wrapped__,
+ wrapper.__chain__
+ );
+ result.__actions__ = copyArray(wrapper.__actions__);
+ result.__index__ = wrapper.__index__;
+ result.__values__ = wrapper.__values__;
+ return result;
+ }
+ /*------------------------------------------------------------------------*/ /**
+ * Creates an array of elements split into groups the length of `size`.
+ * If `array` can't be split evenly, the final chunk will be the remaining
+ * elements.
+ *
+ * @static
+ * @memberOf _
+ * @since 3.0.0
+ * @category Array
+ * @param {Array} array The array to process.
+ * @param {number} [size=1] The length of each chunk
+ * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
+ * @returns {Array} Returns the new array of chunks.
+ * @example
+ *
+ * _.chunk(['a', 'b', 'c', 'd'], 2);
+ * // => [['a', 'b'], ['c', 'd']]
+ *
+ * _.chunk(['a', 'b', 'c', 'd'], 3);
+ * // => [['a', 'b', 'c'], ['d']]
+ */ function chunk(array, size, guard) {
+ if (
+ guard
+ ? isIterateeCall(array, size, guard)
+ : size === undefined
+ ) {
+ size = 1;
+ } else {
+ size = nativeMax(toInteger(size), 0);
+ }
+ var length = array == null ? 0 : array.length;
+ if (!length || size < 1) {
+ return [];
+ }
+ var index = 0,
+ resIndex = 0,
+ result = Array(nativeCeil(length / size));
+ while (index < length) {
+ result[resIndex++] = baseSlice(array, index, (index += size));
+ }
+ return result;
+ }
+ /**
+ * Creates an array with all falsey values removed. The values `false`, `null`,
+ * `0`, `""`, `undefined`, and `NaN` are falsey.
+ *
+ * @static
+ * @memberOf _
+ * @since 0.1.0
+ * @category Array
+ * @param {Array} array The array to compact.
+ * @returns {Array} Returns the new array of filtered values.
+ * @example
+ *
+ * _.compact([0, 1, false, 2, '', 3]);
+ * // => [1, 2, 3]
+ */ function compact(array) {
+ var index = -1,
+ length = array == null ? 0 : array.length,
+ resIndex = 0,
+ result = [];
+ while (++index < length) {
+ var value = array[index];
+ if (value) {
+ result[resIndex++] = value;
+ }
+ }
+ return result;
+ }
+ /**
+ * Creates a new array concatenating `array` with any additional arrays
+ * and/or values.
+ *
+ * @static
+ * @memberOf _
+ * @since 4.0.0
+ * @category Array
+ * @param {Array} array The array to concatenate.
+ * @param {...*} [values] The values to concatenate.
+ * @returns {Array} Returns the new concatenated array.
+ * @example
+ *
+ * var array = [1];
+ * var other = _.concat(array, 2, [3], [[4]]);
+ *
+ * console.log(other);
+ * // => [1, 2, 3, [4]]
+ *
+ * console.log(array);
+ * // => [1]
+ */ function concat() {
+ var length = arguments.length;
+ if (!length) {
+ return [];
+ }
+ var args = Array(length - 1),
+ array = arguments[0],
+ index = length;
+ while (index--) {
+ args[index - 1] = arguments[index];
+ }
+ return arrayPush(
+ isArray(array) ? copyArray(array) : [array],
+ baseFlatten(args, 1)
+ );
+ }
+ /**
+ * Creates an array of `array` values not included in the other given arrays
+ * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
+ * for equality comparisons. The order and references of result values are
+ * determined by the first array.
+ *
+ * **Note:** Unlike `_.pullAll`, this method returns a new array.
+ *
+ * @static
+ * @memberOf _
+ * @since 0.1.0
+ * @category Array
+ * @param {Array} array The array to inspect.
+ * @param {...Array} [values] The values to exclude.
+ * @returns {Array} Returns the new array of filtered values.
+ * @see _.without, _.xor
+ * @example
+ *
+ * _.difference([2, 1], [2, 3]);
+ * // => [1]
+ */ var difference = baseRest(function(array, values) {
+ return isArrayLikeObject(array)
+ ? baseDifference(
+ array,
+ baseFlatten(values, 1, isArrayLikeObject, true)
+ )
+ : [];
+ });
+ /**
+ * This method is like `_.difference` except that it accepts `iteratee` which
+ * is invoked for each element of `array` and `values` to generate the criterion
+ * by which they're compared. The order and references of result values are
+ * determined by the first array. The iteratee is invoked with one argument:
+ * (value).
+ *
+ * **Note:** Unlike `_.pullAllBy`, this method returns a new array.
+ *
+ * @static
+ * @memberOf _
+ * @since 4.0.0
+ * @category Array
+ * @param {Array} array The array to inspect.
+ * @param {...Array} [values] The values to exclude.
+ * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
+ * @returns {Array} Returns the new array of filtered values.
+ * @example
+ *
+ * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor);
+ * // => [1.2]
+ *
+ * // The `_.property` iteratee shorthand.
+ * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x');
+ * // => [{ 'x': 2 }]
+ */ var differenceBy = baseRest(function(array, values) {
+ var iteratee = last(values);
+ if (isArrayLikeObject(iteratee)) {
+ iteratee = undefined;
+ }
+ return isArrayLikeObject(array)
+ ? baseDifference(
+ array,
+ baseFlatten(values, 1, isArrayLikeObject, true),
+ getIteratee(iteratee, 2)
+ )
+ : [];
+ });
+ /**
+ * This method is like `_.difference` except that it accepts `comparator`
+ * which is invoked to compare elements of `array` to `values`. The order and
+ * references of result values are determined by the first array. The comparator
+ * is invoked with two arguments: (arrVal, othVal).
+ *
+ * **Note:** Unlike `_.pullAllWith`, this method returns a new array.
+ *
+ * @static
+ * @memberOf _
+ * @since 4.0.0
+ * @category Array
+ * @param {Array} array The array to inspect.
+ * @param {...Array} [values] The values to exclude.
+ * @param {Function} [comparator] The comparator invoked per element.
+ * @returns {Array} Returns the new array of filtered values.
+ * @example
+ *
+ * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
+ *
+ * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual);
+ * // => [{ 'x': 2, 'y': 1 }]
+ */ var differenceWith = baseRest(function(array, values) {
+ var comparator = last(values);
+ if (isArrayLikeObject(comparator)) {
+ comparator = undefined;
+ }
+ return isArrayLikeObject(array)
+ ? baseDifference(
+ array,
+ baseFlatten(values, 1, isArrayLikeObject, true),
+ undefined,
+ comparator
+ )
+ : [];
+ });
+ /**
+ * Creates a slice of `array` with `n` elements dropped from the beginning.
+ *
+ * @static
+ * @memberOf _
+ * @since 0.5.0
+ * @category Array
+ * @param {Array} array The array to query.
+ * @param {number} [n=1] The number of elements to drop.
+ * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
+ * @returns {Array} Returns the slice of `array`.
+ * @example
+ *
+ * _.drop([1, 2, 3]);
+ * // => [2, 3]
+ *
+ * _.drop([1, 2, 3], 2);
+ * // => [3]
+ *
+ * _.drop([1, 2, 3], 5);
+ * // => []
+ *
+ * _.drop([1, 2, 3], 0);
+ * // => [1, 2, 3]
+ */ function drop(array, n, guard) {
+ var length = array == null ? 0 : array.length;
+ if (!length) {
+ return [];
+ }
+ n = guard || n === undefined ? 1 : toInteger(n);
+ return baseSlice(array, n < 0 ? 0 : n, length);
+ }
+ /**
+ * Creates a slice of `array` with `n` elements dropped from the end.
+ *
+ * @static
+ * @memberOf _
+ * @since 3.0.0
+ * @category Array
+ * @param {Array} array The array to query.
+ * @param {number} [n=1] The number of elements to drop.
+ * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
+ * @returns {Array} Returns the slice of `array`.
+ * @example
+ *
+ * _.dropRight([1, 2, 3]);
+ * // => [1, 2]
+ *
+ * _.dropRight([1, 2, 3], 2);
+ * // => [1]
+ *
+ * _.dropRight([1, 2, 3], 5);
+ * // => []
+ *
+ * _.dropRight([1, 2, 3], 0);
+ * // => [1, 2, 3]
+ */ function dropRight(array, n, guard) {
+ var length = array == null ? 0 : array.length;
+ if (!length) {
+ return [];
+ }
+ n = guard || n === undefined ? 1 : toInteger(n);
+ n = length - n;
+ return baseSlice(array, 0, n < 0 ? 0 : n);
+ }
+ /**
+ * Creates a slice of `array` excluding elements dropped from the end.
+ * Elements are dropped until `predicate` returns falsey. The predicate is
+ * invoked with three arguments: (value, index, array).
+ *
+ * @static
+ * @memberOf _
+ * @since 3.0.0
+ * @category Array
+ * @param {Array} array The array to query.
+ * @param {Function} [predicate=_.identity] The function invoked per iteration.
+ * @returns {Array} Returns the slice of `array`.
+ * @example
+ *
+ * var users = [
+ * { 'user': 'barney', 'active': true },
+ * { 'user': 'fred', 'active': false },
+ * { 'user': 'pebbles', 'active': false }
+ * ];
+ *
+ * _.dropRightWhile(users, function(o) { return !o.active; });
+ * // => objects for ['barney']
+ *
+ * // The `_.matches` iteratee shorthand.
+ * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false });
+ * // => objects for ['barney', 'fred']
+ *
+ * // The `_.matchesProperty` iteratee shorthand.
+ * _.dropRightWhile(users, ['active', false]);
+ * // => objects for ['barney']
+ *
+ * // The `_.property` iteratee shorthand.
+ * _.dropRightWhile(users, 'active');
+ * // => objects for ['barney', 'fred', 'pebbles']
+ */ function dropRightWhile(array, predicate) {
+ return array && array.length
+ ? baseWhile(array, getIteratee(predicate, 3), true, true)
+ : [];
+ }
+ /**
+ * Creates a slice of `array` excluding elements dropped from the beginning.
+ * Elements are dropped until `predicate` returns falsey. The predicate is
+ * invoked with three arguments: (value, index, array).
+ *
+ * @static
+ * @memberOf _
+ * @since 3.0.0
+ * @category Array
+ * @param {Array} array The array to query.
+ * @param {Function} [predicate=_.identity] The function invoked per iteration.
+ * @returns {Array} Returns the slice of `array`.
+ * @example
+ *
+ * var users = [
+ * { 'user': 'barney', 'active': false },
+ * { 'user': 'fred', 'active': false },
+ * { 'user': 'pebbles', 'active': true }
+ * ];
+ *
+ * _.dropWhile(users, function(o) { return !o.active; });
+ * // => objects for ['pebbles']
+ *
+ * // The `_.matches` iteratee shorthand.
+ * _.dropWhile(users, { 'user': 'barney', 'active': false });
+ * // => objects for ['fred', 'pebbles']
+ *
+ * // The `_.matchesProperty` iteratee shorthand.
+ * _.dropWhile(users, ['active', false]);
+ * // => objects for ['pebbles']
+ *
+ * // The `_.property` iteratee shorthand.
+ * _.dropWhile(users, 'active');
+ * // => objects for ['barney', 'fred', 'pebbles']
+ */ function dropWhile(array, predicate) {
+ return array && array.length
+ ? baseWhile(array, getIteratee(predicate, 3), true)
+ : [];
+ }
+ /**
+ * Fills elements of `array` with `value` from `start` up to, but not
+ * including, `end`.
+ *
+ * **Note:** This method mutates `array`.
+ *
+ * @static
+ * @memberOf _
+ * @since 3.2.0
+ * @category Array
+ * @param {Array} array The array to fill.
+ * @param {*} value The value to fill `array` with.
+ * @param {number} [start=0] The start position.
+ * @param {number} [end=array.length] The end position.
+ * @returns {Array} Returns `array`.
+ * @example
+ *
+ * var array = [1, 2, 3];
+ *
+ * _.fill(array, 'a');
+ * console.log(array);
+ * // => ['a', 'a', 'a']
+ *
+ * _.fill(Array(3), 2);
+ * // => [2, 2, 2]
+ *
+ * _.fill([4, 6, 8, 10], '*', 1, 3);
+ * // => [4, '*', '*', 10]
+ */ function fill(array, value, start, end) {
+ var length = array == null ? 0 : array.length;
+ if (!length) {
+ return [];
+ }
+ if (
+ start &&
+ typeof start != "number" &&
+ isIterateeCall(array, value, start)
+ ) {
+ start = 0;
+ end = length;
+ }
+ return baseFill(array, value, start, end);
+ }
+ /**
+ * This method is like `_.find` except that it returns the index of the first
+ * element `predicate` returns truthy for instead of the element itself.
+ *
+ * @static
+ * @memberOf _
+ * @since 1.1.0
+ * @category Array
+ * @param {Array} array The array to inspect.
+ * @param {Function} [predicate=_.identity] The function invoked per iteration.
+ * @param {number} [fromIndex=0] The index to search from.
+ * @returns {number} Returns the index of the found element, else `-1`.
+ * @example
+ *
+ * var users = [
+ * { 'user': 'barney', 'active': false },
+ * { 'user': 'fred', 'active': false },
+ * { 'user': 'pebbles', 'active': true }
+ * ];
+ *
+ * _.findIndex(users, function(o) { return o.user == 'barney'; });
+ * // => 0
+ *
+ * // The `_.matches` iteratee shorthand.
+ * _.findIndex(users, { 'user': 'fred', 'active': false });
+ * // => 1
+ *
+ * // The `_.matchesProperty` iteratee shorthand.
+ * _.findIndex(users, ['active', false]);
+ * // => 0
+ *
+ * // The `_.property` iteratee shorthand.
+ * _.findIndex(users, 'active');
+ * // => 2
+ */ function findIndex(array, predicate, fromIndex) {
+ var length = array == null ? 0 : array.length;
+ if (!length) {
+ return -1;
+ }
+ var index = fromIndex == null ? 0 : toInteger(fromIndex);
+ if (index < 0) {
+ index = nativeMax(length + index, 0);
+ }
+ return baseFindIndex(array, getIteratee(predicate, 3), index);
+ }
+ /**
+ * This method is like `_.findIndex` except that it iterates over elements
+ * of `collection` from right to left.
+ *
+ * @static
+ * @memberOf _
+ * @since 2.0.0
+ * @category Array
+ * @param {Array} array The array to inspect.
+ * @param {Function} [predicate=_.identity] The function invoked per iteration.
+ * @param {number} [fromIndex=array.length-1] The index to search from.
+ * @returns {number} Returns the index of the found element, else `-1`.
+ * @example
+ *
+ * var users = [
+ * { 'user': 'barney', 'active': true },
+ * { 'user': 'fred', 'active': false },
+ * { 'user': 'pebbles', 'active': false }
+ * ];
+ *
+ * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; });
+ * // => 2
+ *
+ * // The `_.matches` iteratee shorthand.
+ * _.findLastIndex(users, { 'user': 'barney', 'active': true });
+ * // => 0
+ *
+ * // The `_.matchesProperty` iteratee shorthand.
+ * _.findLastIndex(users, ['active', false]);
+ * // => 2
+ *
+ * // The `_.property` iteratee shorthand.
+ * _.findLastIndex(users, 'active');
+ * // => 0
+ */ function findLastIndex(array, predicate, fromIndex) {
+ var length = array == null ? 0 : array.length;
+ if (!length) {
+ return -1;
+ }
+ var index = length - 1;
+ if (fromIndex !== undefined) {
+ index = toInteger(fromIndex);
+ index =
+ fromIndex < 0
+ ? nativeMax(length + index, 0)
+ : nativeMin(index, length - 1);
+ }
+ return baseFindIndex(
+ array,
+ getIteratee(predicate, 3),
+ index,
+ true
+ );
+ }
+ /**
+ * Flattens `array` a single level deep.
+ *
+ * @static
+ * @memberOf _
+ * @since 0.1.0
+ * @category Array
+ * @param {Array} array The array to flatten.
+ * @returns {Array} Returns the new flattened array.
+ * @example
+ *
+ * _.flatten([1, [2, [3, [4]], 5]]);
+ * // => [1, 2, [3, [4]], 5]
+ */ function flatten(array) {
+ var length = array == null ? 0 : array.length;
+ return length ? baseFlatten(array, 1) : [];
+ }
+ /**
+ * Recursively flattens `array`.
+ *
+ * @static
+ * @memberOf _
+ * @since 3.0.0
+ * @category Array
+ * @param {Array} array The array to flatten.
+ * @returns {Array} Returns the new flattened array.
+ * @example
+ *
+ * _.flattenDeep([1, [2, [3, [4]], 5]]);
+ * // => [1, 2, 3, 4, 5]
+ */ function flattenDeep(array) {
+ var length = array == null ? 0 : array.length;
+ return length ? baseFlatten(array, INFINITY) : [];
+ }
+ /**
+ * Recursively flatten `array` up to `depth` times.
+ *
+ * @static
+ * @memberOf _
+ * @since 4.4.0
+ * @category Array
+ * @param {Array} array The array to flatten.
+ * @param {number} [depth=1] The maximum recursion depth.
+ * @returns {Array} Returns the new flattened array.
+ * @example
+ *
+ * var array = [1, [2, [3, [4]], 5]];
+ *
+ * _.flattenDepth(array, 1);
+ * // => [1, 2, [3, [4]], 5]
+ *
+ * _.flattenDepth(array, 2);
+ * // => [1, 2, 3, [4], 5]
+ */ function flattenDepth(array, depth) {
+ var length = array == null ? 0 : array.length;
+ if (!length) {
+ return [];
+ }
+ depth = depth === undefined ? 1 : toInteger(depth);
+ return baseFlatten(array, depth);
+ }
+ /**
+ * The inverse of `_.toPairs`; this method returns an object composed
+ * from key-value `pairs`.
+ *
+ * @static
+ * @memberOf _
+ * @since 4.0.0
+ * @category Array
+ * @param {Array} pairs The key-value pairs.
+ * @returns {Object} Returns the new object.
+ * @example
+ *
+ * _.fromPairs([['a', 1], ['b', 2]]);
+ * // => { 'a': 1, 'b': 2 }
+ */ function fromPairs(pairs) {
+ var index = -1,
+ length = pairs == null ? 0 : pairs.length,
+ result = {};
+ while (++index < length) {
+ var pair = pairs[index];
+ result[pair[0]] = pair[1];
+ }
+ return result;
+ }
+ /**
+ * Gets the first element of `array`.
+ *
+ * @static
+ * @memberOf _
+ * @since 0.1.0
+ * @alias first
+ * @category Array
+ * @param {Array} array The array to query.
+ * @returns {*} Returns the first element of `array`.
+ * @example
+ *
+ * _.head([1, 2, 3]);
+ * // => 1
+ *
+ * _.head([]);
+ * // => undefined
+ */ function head(array) {
+ return array && array.length ? array[0] : undefined;
+ }
+ /**
+ * Gets the index at which the first occurrence of `value` is found in `array`
+ * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
+ * for equality comparisons. If `fromIndex` is negative, it's used as the
+ * offset from the end of `array`.
+ *
+ * @static
+ * @memberOf _
+ * @since 0.1.0
+ * @category Array
+ * @param {Array} array The array to inspect.
+ * @param {*} value The value to search for.
+ * @param {number} [fromIndex=0] The index to search from.
+ * @returns {number} Returns the index of the matched value, else `-1`.
+ * @example
+ *
+ * _.indexOf([1, 2, 1, 2], 2);
+ * // => 1
+ *
+ * // Search from the `fromIndex`.
+ * _.indexOf([1, 2, 1, 2], 2, 2);
+ * // => 3
+ */ function indexOf(array, value, fromIndex) {
+ var length = array == null ? 0 : array.length;
+ if (!length) {
+ return -1;
+ }
+ var index = fromIndex == null ? 0 : toInteger(fromIndex);
+ if (index < 0) {
+ index = nativeMax(length + index, 0);
+ }
+ return baseIndexOf(array, value, index);
+ }
+ /**
+ * Gets all but the last element of `array`.
+ *
+ * @static
+ * @memberOf _
+ * @since 0.1.0
+ * @category Array
+ * @param {Array} array The array to query.
+ * @returns {Array} Returns the slice of `array`.
+ * @example
+ *
+ * _.initial([1, 2, 3]);
+ * // => [1, 2]
+ */ function initial(array) {
+ var length = array == null ? 0 : array.length;
+ return length ? baseSlice(array, 0, -1) : [];
+ }
+ /**
+ * Creates an array of unique values that are included in all given arrays
+ * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
+ * for equality comparisons. The order and references of result values are
+ * determined by the first array.
+ *
+ * @static
+ * @memberOf _
+ * @since 0.1.0
+ * @category Array
+ * @param {...Array} [arrays] The arrays to inspect.
+ * @returns {Array} Returns the new array of intersecting values.
+ * @example
+ *
+ * _.intersection([2, 1], [2, 3]);
+ * // => [2]
+ */ var intersection = baseRest(function(arrays) {
+ var mapped = arrayMap(arrays, castArrayLikeObject);
+ return mapped.length && mapped[0] === arrays[0]
+ ? baseIntersection(mapped)
+ : [];
+ });
+ /**
+ * This method is like `_.intersection` except that it accepts `iteratee`
+ * which is invoked for each element of each `arrays` to generate the criterion
+ * by which they're compared. The order and references of result values are
+ * determined by the first array. The iteratee is invoked with one argument:
+ * (value).
+ *
+ * @static
+ * @memberOf _
+ * @since 4.0.0
+ * @category Array
+ * @param {...Array} [arrays] The arrays to inspect.
+ * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
+ * @returns {Array} Returns the new array of intersecting values.
+ * @example
+ *
+ * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor);
+ * // => [2.1]
+ *
+ * // The `_.property` iteratee shorthand.
+ * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
+ * // => [{ 'x': 1 }]
+ */ var intersectionBy = baseRest(function(arrays) {
+ var iteratee = last(arrays),
+ mapped = arrayMap(arrays, castArrayLikeObject);
+ if (iteratee === last(mapped)) {
+ iteratee = undefined;
+ } else {
+ mapped.pop();
+ }
+ return mapped.length && mapped[0] === arrays[0]
+ ? baseIntersection(mapped, getIteratee(iteratee, 2))
+ : [];
+ });
+ /**
+ * This method is like `_.intersection` except that it accepts `comparator`
+ * which is invoked to compare elements of `arrays`. The order and references
+ * of result values are determined by the first array. The comparator is
+ * invoked with two arguments: (arrVal, othVal).
+ *
+ * @static
+ * @memberOf _
+ * @since 4.0.0
+ * @category Array
+ * @param {...Array} [arrays] The arrays to inspect.
+ * @param {Function} [comparator] The comparator invoked per element.
+ * @returns {Array} Returns the new array of intersecting values.
+ * @example
+ *
+ * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
+ * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
+ *
+ * _.intersectionWith(objects, others, _.isEqual);
+ * // => [{ 'x': 1, 'y': 2 }]
+ */ var intersectionWith = baseRest(function(arrays) {
+ var comparator = last(arrays),
+ mapped = arrayMap(arrays, castArrayLikeObject);
+ comparator =
+ typeof comparator == "function" ? comparator : undefined;
+ if (comparator) {
+ mapped.pop();
+ }
+ return mapped.length && mapped[0] === arrays[0]
+ ? baseIntersection(mapped, undefined, comparator)
+ : [];
+ });
+ /**
+ * Converts all elements in `array` into a string separated by `separator`.
+ *
+ * @static
+ * @memberOf _
+ * @since 4.0.0
+ * @category Array
+ * @param {Array} array The array to convert.
+ * @param {string} [separator=','] The element separator.
+ * @returns {string} Returns the joined string.
+ * @example
+ *
+ * _.join(['a', 'b', 'c'], '~');
+ * // => 'a~b~c'
+ */ function join(array, separator) {
+ return array == null ? "" : nativeJoin.call(array, separator);
+ }
+ /**
+ * Gets the last element of `array`.
+ *
+ * @static
+ * @memberOf _
+ * @since 0.1.0
+ * @category Array
+ * @param {Array} array The array to query.
+ * @returns {*} Returns the last element of `array`.
+ * @example
+ *
+ * _.last([1, 2, 3]);
+ * // => 3
+ */ function last(array) {
+ var length = array == null ? 0 : array.length;
+ return length ? array[length - 1] : undefined;
+ }
+ /**
+ * This method is like `_.indexOf` except that it iterates over elements of
+ * `array` from right to left.
+ *
+ * @static
+ * @memberOf _
+ * @since 0.1.0
+ * @category Array
+ * @param {Array} array The array to inspect.
+ * @param {*} value The value to search for.
+ * @param {number} [fromIndex=array.length-1] The index to search from.
+ * @returns {number} Returns the index of the matched value, else `-1`.
+ * @example
+ *
+ * _.lastIndexOf([1, 2, 1, 2], 2);
+ * // => 3
+ *
+ * // Search from the `fromIndex`.
+ * _.lastIndexOf([1, 2, 1, 2], 2, 2);
+ * // => 1
+ */ function lastIndexOf(array, value, fromIndex) {
+ var length = array == null ? 0 : array.length;
+ if (!length) {
+ return -1;
+ }
+ var index = length;
+ if (fromIndex !== undefined) {
+ index = toInteger(fromIndex);
+ index =
+ index < 0
+ ? nativeMax(length + index, 0)
+ : nativeMin(index, length - 1);
+ }
+ return value === value
+ ? strictLastIndexOf(array, value, index)
+ : baseFindIndex(array, baseIsNaN, index, true);
+ }
+ /**
+ * Gets the element at index `n` of `array`. If `n` is negative, the nth
+ * element from the end is returned.
+ *
+ * @static
+ * @memberOf _
+ * @since 4.11.0
+ * @category Array
+ * @param {Array} array The array to query.
+ * @param {number} [n=0] The index of the element to return.
+ * @returns {*} Returns the nth element of `array`.
+ * @example
+ *
+ * var array = ['a', 'b', 'c', 'd'];
+ *
+ * _.nth(array, 1);
+ * // => 'b'
+ *
+ * _.nth(array, -2);
+ * // => 'c';
+ */ function nth(array, n) {
+ return array && array.length
+ ? baseNth(array, toInteger(n))
+ : undefined;
+ }
+ /**
+ * Removes all given values from `array` using
+ * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
+ * for equality comparisons.
+ *
+ * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove`
+ * to remove elements from an array by predicate.
+ *
+ * @static
+ * @memberOf _
+ * @since 2.0.0
+ * @category Array
+ * @param {Array} array The array to modify.
+ * @param {...*} [values] The values to remove.
+ * @returns {Array} Returns `array`.
+ * @example
+ *
+ * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
+ *
+ * _.pull(array, 'a', 'c');
+ * console.log(array);
+ * // => ['b', 'b']
+ */ var pull = baseRest(pullAll);
+ /**
+ * This method is like `_.pull` except that it accepts an array of values to remove.
+ *
+ * **Note:** Unlike `_.difference`, this method mutates `array`.
+ *
+ * @static
+ * @memberOf _
+ * @since 4.0.0
+ * @category Array
+ * @param {Array} array The array to modify.
+ * @param {Array} values The values to remove.
+ * @returns {Array} Returns `array`.
+ * @example
+ *
+ * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
+ *
+ * _.pullAll(array, ['a', 'c']);
+ * console.log(array);
+ * // => ['b', 'b']
+ */ function pullAll(array, values) {
+ return array && array.length && values && values.length
+ ? basePullAll(array, values)
+ : array;
+ }
+ /**
+ * This method is like `_.pullAll` except that it accepts `iteratee` which is
+ * invoked for each element of `array` and `values` to generate the criterion
+ * by which they're compared. The iteratee is invoked with one argument: (value).
+ *
+ * **Note:** Unlike `_.differenceBy`, this method mutates `array`.
+ *
+ * @static
+ * @memberOf _
+ * @since 4.0.0
+ * @category Array
+ * @param {Array} array The array to modify.
+ * @param {Array} values The values to remove.
+ * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
+ * @returns {Array} Returns `array`.
+ * @example
+ *
+ * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }];
+ *
+ * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x');
+ * console.log(array);
+ * // => [{ 'x': 2 }]
+ */ function pullAllBy(array, values, iteratee) {
+ return array && array.length && values && values.length
+ ? basePullAll(array, values, getIteratee(iteratee, 2))
+ : array;
+ }
+ /**
+ * This method is like `_.pullAll` except that it accepts `comparator` which
+ * is invoked to compare elements of `array` to `values`. The comparator is
+ * invoked with two arguments: (arrVal, othVal).
+ *
+ * **Note:** Unlike `_.differenceWith`, this method mutates `array`.
+ *
+ * @static
+ * @memberOf _
+ * @since 4.6.0
+ * @category Array
+ * @param {Array} array The array to modify.
+ * @param {Array} values The values to remove.
+ * @param {Function} [comparator] The comparator invoked per element.
+ * @returns {Array} Returns `array`.
+ * @example
+ *
+ * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }];
+ *
+ * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual);
+ * console.log(array);
+ * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }]
+ */ function pullAllWith(array, values, comparator) {
+ return array && array.length && values && values.length
+ ? basePullAll(array, values, undefined, comparator)
+ : array;
+ }
+ /**
+ * Removes elements from `array` corresponding to `indexes` and returns an
+ * array of removed elements.
+ *
+ * **Note:** Unlike `_.at`, this method mutates `array`.
+ *
+ * @static
+ * @memberOf _
+ * @since 3.0.0
+ * @category Array
+ * @param {Array} array The array to modify.
+ * @param {...(number|number[])} [indexes] The indexes of elements to remove.
+ * @returns {Array} Returns the new array of removed elements.
+ * @example
+ *
+ * var array = ['a', 'b', 'c', 'd'];
+ * var pulled = _.pullAt(array, [1, 3]);
+ *
+ * console.log(array);
+ * // => ['a', 'c']
+ *
+ * console.log(pulled);
+ * // => ['b', 'd']
+ */ var pullAt = flatRest(function(array, indexes) {
+ var length = array == null ? 0 : array.length,
+ result = baseAt(array, indexes);
+ basePullAt(
+ array,
+ arrayMap(indexes, function(index) {
+ return isIndex(index, length) ? +index : index;
+ }).sort(compareAscending)
+ );
+ return result;
+ });
+ /**
+ * Removes all elements from `array` that `predicate` returns truthy for
+ * and returns an array of the removed elements. The predicate is invoked
+ * with three arguments: (value, index, array).
+ *
+ * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull`
+ * to pull elements from an array by value.
+ *
+ * @static
+ * @memberOf _
+ * @since 2.0.0
+ * @category Array
+ * @param {Array} array The array to modify.
+ * @param {Function} [predicate=_.identity] The function invoked per iteration.
+ * @returns {Array} Returns the new array of removed elements.
+ * @example
+ *
+ * var array = [1, 2, 3, 4];
+ * var evens = _.remove(array, function(n) {
+ * return n % 2 == 0;
+ * });
+ *
+ * console.log(array);
+ * // => [1, 3]
+ *
+ * console.log(evens);
+ * // => [2, 4]
+ */ function remove(array, predicate) {
+ var result = [];
+ if (!(array && array.length)) {
+ return result;
+ }
+ var index = -1,
+ indexes = [],
+ length = array.length;
+ predicate = getIteratee(predicate, 3);
+ while (++index < length) {
+ var value = array[index];
+ if (predicate(value, index, array)) {
+ result.push(value);
+ indexes.push(index);
+ }
+ }
+ basePullAt(array, indexes);
+ return result;
+ }
+ /**
+ * Reverses `array` so that the first element becomes the last, the second
+ * element becomes the second to last, and so on.
+ *
+ * **Note:** This method mutates `array` and is based on
+ * [`Array#reverse`](https://mdn.io/Array/reverse).
+ *
+ * @static
+ * @memberOf _
+ * @since 4.0.0
+ * @category Array
+ * @param {Array} array The array to modify.
+ * @returns {Array} Returns `array`.
+ * @example
+ *
+ * var array = [1, 2, 3];
+ *
+ * _.reverse(array);
+ * // => [3, 2, 1]
+ *
+ * console.log(array);
+ * // => [3, 2, 1]
+ */ function reverse(array) {
+ return array == null ? array : nativeReverse.call(array);
+ }
+ /**
+ * Creates a slice of `array` from `start` up to, but not including, `end`.
+ *
+ * **Note:** This method is used instead of
+ * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are
+ * returned.
+ *
+ * @static
+ * @memberOf _
+ * @since 3.0.0
+ * @category Array
+ * @param {Array} array The array to slice.
+ * @param {number} [start=0] The start position.
+ * @param {number} [end=array.length] The end position.
+ * @returns {Array} Returns the slice of `array`.
+ */ function slice(array, start, end) {
+ var length = array == null ? 0 : array.length;
+ if (!length) {
+ return [];
+ }
+ if (
+ end &&
+ typeof end != "number" &&
+ isIterateeCall(array, start, end)
+ ) {
+ start = 0;
+ end = length;
+ } else {
+ start = start == null ? 0 : toInteger(start);
+ end = end === undefined ? length : toInteger(end);
+ }
+ return baseSlice(array, start, end);
+ }
+ /**
+ * Uses a binary search to determine the lowest index at which `value`
+ * should be inserted into `array` in order to maintain its sort order.
+ *
+ * @static
+ * @memberOf _
+ * @since 0.1.0
+ * @category Array
+ * @param {Array} array The sorted array to inspect.
+ * @param {*} value The value to evaluate.
+ * @returns {number} Returns the index at which `value` should be inserted
+ * into `array`.
+ * @example
+ *
+ * _.sortedIndex([30, 50], 40);
+ * // => 1
+ */ function sortedIndex(array, value) {
+ return baseSortedIndex(array, value);
+ }
+ /**
+ * This method is like `_.sortedIndex` except that it accepts `iteratee`
+ * which is invoked for `value` and each element of `array` to compute their
+ * sort ranking. The iteratee is invoked with one argument: (value).
+ *
+ * @static
+ * @memberOf _
+ * @since 4.0.0
+ * @category Array
+ * @param {Array} array The sorted array to inspect.
+ * @param {*} value The value to evaluate.
+ * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
+ * @returns {number} Returns the index at which `value` should be inserted
+ * into `array`.
+ * @example
+ *
+ * var objects = [{ 'x': 4 }, { 'x': 5 }];
+ *
+ * _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
+ * // => 0
+ *
+ * // The `_.property` iteratee shorthand.
+ * _.sortedIndexBy(objects, { 'x': 4 }, 'x');
+ * // => 0
+ */ function sortedIndexBy(array, value, iteratee) {
+ return baseSortedIndexBy(
+ array,
+ value,
+ getIteratee(iteratee, 2)
+ );
+ }
+ /**
+ * This method is like `_.indexOf` except that it performs a binary
+ * search on a sorted `array`.
+ *
+ * @static
+ * @memberOf _
+ * @since 4.0.0
+ * @category Array
+ * @param {Array} array The array to inspect.
+ * @param {*} value The value to search for.
+ * @returns {number} Returns the index of the matched value, else `-1`.
+ * @example
+ *
+ * _.sortedIndexOf([4, 5, 5, 5, 6], 5);
+ * // => 1
+ */ function sortedIndexOf(array, value) {
+ var length = array == null ? 0 : array.length;
+ if (length) {
+ var index = baseSortedIndex(array, value);
+ if (index < length && eq(array[index], value)) {
+ return index;
+ }
+ }
+ return -1;
+ }
+ /**
+ * This method is like `_.sortedIndex` except that it returns the highest
+ * index at which `value` should be inserted into `array` in order to
+ * maintain its sort order.
+ *
+ * @static
+ * @memberOf _
+ * @since 3.0.0
+ * @category Array
+ * @param {Array} array The sorted array to inspect.
+ * @param {*} value The value to evaluate.
+ * @returns {number} Returns the index at which `value` should be inserted
+ * into `array`.
+ * @example
+ *
+ * _.sortedLastIndex([4, 5, 5, 5, 6], 5);
+ * // => 4
+ */ function sortedLastIndex(array, value) {
+ return baseSortedIndex(array, value, true);
+ }
+ /**
+ * This method is like `_.sortedLastIndex` except that it accepts `iteratee`
+ * which is invoked for `value` and each element of `array` to compute their
+ * sort ranking. The iteratee is invoked with one argument: (value).
+ *
+ * @static
+ * @memberOf _
+ * @since 4.0.0
+ * @category Array
+ * @param {Array} array The sorted array to inspect.
+ * @param {*} value The value to evaluate.
+ * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
+ * @returns {number} Returns the index at which `value` should be inserted
+ * into `array`.
+ * @example
+ *
+ * var objects = [{ 'x': 4 }, { 'x': 5 }];
+ *
+ * _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
+ * // => 1
+ *
+ * // The `_.property` iteratee shorthand.
+ * _.sortedLastIndexBy(objects, { 'x': 4 }, 'x');
+ * // => 1
+ */ function sortedLastIndexBy(array, value, iteratee) {
+ return baseSortedIndexBy(
+ array,
+ value,
+ getIteratee(iteratee, 2),
+ true
+ );
+ }
+ /**
+ * This method is like `_.lastIndexOf` except that it performs a binary
+ * search on a sorted `array`.
+ *
+ * @static
+ * @memberOf _
+ * @since 4.0.0
+ * @category Array
+ * @param {Array} array The array to inspect.
+ * @param {*} value The value to search for.
+ * @returns {number} Returns the index of the matched value, else `-1`.
+ * @example
+ *
+ * _.sortedLastIndexOf([4, 5, 5, 5, 6], 5);
+ * // => 3
+ */ function sortedLastIndexOf(array, value) {
+ var length = array == null ? 0 : array.length;
+ if (length) {
+ var index = baseSortedIndex(array, value, true) - 1;
+ if (eq(array[index], value)) {
+ return index;
+ }
+ }
+ return -1;
+ }
+ /**
+ * This method is like `_.uniq` except that it's designed and optimized
+ * for sorted arrays.
+ *
+ * @static
+ * @memberOf _
+ * @since 4.0.0
+ * @category Array
+ * @param {Array} array The array to inspect.
+ * @returns {Array} Returns the new duplicate free array.
+ * @example
+ *
+ * _.sortedUniq([1, 1, 2]);
+ * // => [1, 2]
+ */ function sortedUniq(array) {
+ return array && array.length ? baseSortedUniq(array) : [];
+ }
+ /**
+ * This method is like `_.uniqBy` except that it's designed and optimized
+ * for sorted arrays.
+ *
+ * @static
+ * @memberOf _
+ * @since 4.0.0
+ * @category Array
+ * @param {Array} array The array to inspect.
+ * @param {Function} [iteratee] The iteratee invoked per element.
+ * @returns {Array} Returns the new duplicate free array.
+ * @example
+ *
+ * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor);
+ * // => [1.1, 2.3]
+ */ function sortedUniqBy(array, iteratee) {
+ return array && array.length
+ ? baseSortedUniq(array, getIteratee(iteratee, 2))
+ : [];
+ }
+ /**
+ * Gets all but the first element of `array`.
+ *
+ * @static
+ * @memberOf _
+ * @since 4.0.0
+ * @category Array
+ * @param {Array} array The array to query.
+ * @returns {Array} Returns the slice of `array`.
+ * @example
+ *
+ * _.tail([1, 2, 3]);
+ * // => [2, 3]
+ */ function tail(array) {
+ var length = array == null ? 0 : array.length;
+ return length ? baseSlice(array, 1, length) : [];
+ }
+ /**
+ * Creates a slice of `array` with `n` elements taken from the beginning.
+ *
+ * @static
+ * @memberOf _
+ * @since 0.1.0
+ * @category Array
+ * @param {Array} array The array to query.
+ * @param {number} [n=1] The number of elements to take.
+ * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
+ * @returns {Array} Returns the slice of `array`.
+ * @example
+ *
+ * _.take([1, 2, 3]);
+ * // => [1]
+ *
+ * _.take([1, 2, 3], 2);
+ * // => [1, 2]
+ *
+ * _.take([1, 2, 3], 5);
+ * // => [1, 2, 3]
+ *
+ * _.take([1, 2, 3], 0);
+ * // => []
+ */ function take(array, n, guard) {
+ if (!(array && array.length)) {
+ return [];
+ }
+ n = guard || n === undefined ? 1 : toInteger(n);
+ return baseSlice(array, 0, n < 0 ? 0 : n);
+ }
+ /**
+ * Creates a slice of `array` with `n` elements taken from the end.
+ *
+ * @static
+ * @memberOf _
+ * @since 3.0.0
+ * @category Array
+ * @param {Array} array The array to query.
+ * @param {number} [n=1] The number of elements to take.
+ * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
+ * @returns {Array} Returns the slice of `array`.
+ * @example
+ *
+ * _.takeRight([1, 2, 3]);
+ * // => [3]
+ *
+ * _.takeRight([1, 2, 3], 2);
+ * // => [2, 3]
+ *
+ * _.takeRight([1, 2, 3], 5);
+ * // => [1, 2, 3]
+ *
+ * _.takeRight([1, 2, 3], 0);
+ * // => []
+ */ function takeRight(array, n, guard) {
+ var length = array == null ? 0 : array.length;
+ if (!length) {
+ return [];
+ }
+ n = guard || n === undefined ? 1 : toInteger(n);
+ n = length - n;
+ return baseSlice(array, n < 0 ? 0 : n, length);
+ }
+ /**
+ * Creates a slice of `array` with elements taken from the end. Elements are
+ * taken until `predicate` returns falsey. The predicate is invoked with
+ * three arguments: (value, index, array).
+ *
+ * @static
+ * @memberOf _
+ * @since 3.0.0
+ * @category Array
+ * @param {Array} array The array to query.
+ * @param {Function} [predicate=_.identity] The function invoked per iteration.
+ * @returns {Array} Returns the slice of `array`.
+ * @example
+ *
+ * var users = [
+ * { 'user': 'barney', 'active': true },
+ * { 'user': 'fred', 'active': false },
+ * { 'user': 'pebbles', 'active': false }
+ * ];
+ *
+ * _.takeRightWhile(users, function(o) { return !o.active; });
+ * // => objects for ['fred', 'pebbles']
+ *
+ * // The `_.matches` iteratee shorthand.
+ * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false });
+ * // => objects for ['pebbles']
+ *
+ * // The `_.matchesProperty` iteratee shorthand.
+ * _.takeRightWhile(users, ['active', false]);
+ * // => objects for ['fred', 'pebbles']
+ *
+ * // The `_.property` iteratee shorthand.
+ * _.takeRightWhile(users, 'active');
+ * // => []
+ */ function takeRightWhile(array, predicate) {
+ return array && array.length
+ ? baseWhile(array, getIteratee(predicate, 3), false, true)
+ : [];
+ }
+ /**
+ * Creates a slice of `array` with elements taken from the beginning. Elements
+ * are taken until `predicate` returns falsey. The predicate is invoked with
+ * three arguments: (value, index, array).
+ *
+ * @static
+ * @memberOf _
+ * @since 3.0.0
+ * @category Array
+ * @param {Array} array The array to query.
+ * @param {Function} [predicate=_.identity] The function invoked per iteration.
+ * @returns {Array} Returns the slice of `array`.
+ * @example
+ *
+ * var users = [
+ * { 'user': 'barney', 'active': false },
+ * { 'user': 'fred', 'active': false },
+ * { 'user': 'pebbles', 'active': true }
+ * ];
+ *
+ * _.takeWhile(users, function(o) { return !o.active; });
+ * // => objects for ['barney', 'fred']
+ *
+ * // The `_.matches` iteratee shorthand.
+ * _.takeWhile(users, { 'user': 'barney', 'active': false });
+ * // => objects for ['barney']
+ *
+ * // The `_.matchesProperty` iteratee shorthand.
+ * _.takeWhile(users, ['active', false]);
+ * // => objects for ['barney', 'fred']
+ *
+ * // The `_.property` iteratee shorthand.
+ * _.takeWhile(users, 'active');
+ * // => []
+ */ function takeWhile(array, predicate) {
+ return array && array.length
+ ? baseWhile(array, getIteratee(predicate, 3))
+ : [];
+ }
+ /**
+ * Creates an array of unique values, in order, from all given arrays using
+ * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
+ * for equality comparisons.
+ *
+ * @static
+ * @memberOf _
+ * @since 0.1.0
+ * @category Array
+ * @param {...Array} [arrays] The arrays to inspect.
+ * @returns {Array} Returns the new array of combined values.
+ * @example
+ *
+ * _.union([2], [1, 2]);
+ * // => [2, 1]
+ */ var union = baseRest(function(arrays) {
+ return baseUniq(
+ baseFlatten(arrays, 1, isArrayLikeObject, true)
+ );
+ });
+ /**
+ * This method is like `_.union` except that it accepts `iteratee` which is
+ * invoked for each element of each `arrays` to generate the criterion by
+ * which uniqueness is computed. Result values are chosen from the first
+ * array in which the value occurs. The iteratee is invoked with one argument:
+ * (value).
+ *
+ * @static
+ * @memberOf _
+ * @since 4.0.0
+ * @category Array
+ * @param {...Array} [arrays] The arrays to inspect.
+ * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
+ * @returns {Array} Returns the new array of combined values.
+ * @example
+ *
+ * _.unionBy([2.1], [1.2, 2.3], Math.floor);
+ * // => [2.1, 1.2]
+ *
+ * // The `_.property` iteratee shorthand.
+ * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
+ * // => [{ 'x': 1 }, { 'x': 2 }]
+ */ var unionBy = baseRest(function(arrays) {
+ var iteratee = last(arrays);
+ if (isArrayLikeObject(iteratee)) {
+ iteratee = undefined;
+ }
+ return baseUniq(
+ baseFlatten(arrays, 1, isArrayLikeObject, true),
+ getIteratee(iteratee, 2)
+ );
+ });
+ /**
+ * This method is like `_.union` except that it accepts `comparator` which
+ * is invoked to compare elements of `arrays`. Result values are chosen from
+ * the first array in which the value occurs. The comparator is invoked
+ * with two arguments: (arrVal, othVal).
+ *
+ * @static
+ * @memberOf _
+ * @since 4.0.0
+ * @category Array
+ * @param {...Array} [arrays] The arrays to inspect.
+ * @param {Function} [comparator] The comparator invoked per element.
+ * @returns {Array} Returns the new array of combined values.
+ * @example
+ *
+ * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
+ * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
+ *
+ * _.unionWith(objects, others, _.isEqual);
+ * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
+ */ var unionWith = baseRest(function(arrays) {
+ var comparator = last(arrays);
+ comparator =
+ typeof comparator == "function" ? comparator : undefined;
+ return baseUniq(
+ baseFlatten(arrays, 1, isArrayLikeObject, true),
+ undefined,
+ comparator
+ );
+ });
+ /**
+ * Creates a duplicate-free version of an array, using
+ * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
+ * for equality comparisons, in which only the first occurrence of each element
+ * is kept. The order of result values is determined by the order they occur
+ * in the array.
+ *
+ * @static
+ * @memberOf _
+ * @since 0.1.0
+ * @category Array
+ * @param {Array} array The array to inspect.
+ * @returns {Array} Returns the new duplicate free array.
+ * @example
+ *
+ * _.uniq([2, 1, 2]);
+ * // => [2, 1]
+ */ function uniq(array) {
+ return array && array.length ? baseUniq(array) : [];
+ }
+ /**
+ * This method is like `_.uniq` except that it accepts `iteratee` which is
+ * invoked for each element in `array` to generate the criterion by which
+ * uniqueness is computed. The order of result values is determined by the
+ * order they occur in the array. The iteratee is invoked with one argument:
+ * (value).
+ *
+ * @static
+ * @memberOf _
+ * @since 4.0.0
+ * @category Array
+ * @param {Array} array The array to inspect.
+ * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
+ * @returns {Array} Returns the new duplicate free array.
+ * @example
+ *
+ * _.uniqBy([2.1, 1.2, 2.3], Math.floor);
+ * // => [2.1, 1.2]
+ *
+ * // The `_.property` iteratee shorthand.
+ * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');
+ * // => [{ 'x': 1 }, { 'x': 2 }]
+ */ function uniqBy(array, iteratee) {
+ return array && array.length
+ ? baseUniq(array, getIteratee(iteratee, 2))
+ : [];
+ }
+ /**
+ * This method is like `_.uniq` except that it accepts `comparator` which
+ * is invoked to compare elements of `array`. The order of result values is
+ * determined by the order they occur in the array.The comparator is invoked
+ * with two arguments: (arrVal, othVal).
+ *
+ * @static
+ * @memberOf _
+ * @since 4.0.0
+ * @category Array
+ * @param {Array} array The array to inspect.
+ * @param {Function} [comparator] The comparator invoked per element.
+ * @returns {Array} Returns the new duplicate free array.
+ * @example
+ *
+ * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }];
+ *
+ * _.uniqWith(objects, _.isEqual);
+ * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]
+ */ function uniqWith(array, comparator) {
+ comparator =
+ typeof comparator == "function" ? comparator : undefined;
+ return array && array.length
+ ? baseUniq(array, undefined, comparator)
+ : [];
+ }
+ /**
+ * This method is like `_.zip` except that it accepts an array of grouped
+ * elements and creates an array regrouping the elements to their pre-zip
+ * configuration.
+ *
+ * @static
+ * @memberOf _
+ * @since 1.2.0
+ * @category Array
+ * @param {Array} array The array of grouped elements to process.
+ * @returns {Array} Returns the new array of regrouped elements.
+ * @example
+ *
+ * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]);
+ * // => [['a', 1, true], ['b', 2, false]]
+ *
+ * _.unzip(zipped);
+ * // => [['a', 'b'], [1, 2], [true, false]]
+ */ function unzip(array) {
+ if (!(array && array.length)) {
+ return [];
+ }
+ var length = 0;
+ array = arrayFilter(array, function(group) {
+ if (isArrayLikeObject(group)) {
+ length = nativeMax(group.length, length);
+ return true;
+ }
+ });
+ return baseTimes(length, function(index) {
+ return arrayMap(array, baseProperty(index));
+ });
+ }
+ /**
+ * This method is like `_.unzip` except that it accepts `iteratee` to specify
+ * how regrouped values should be combined. The iteratee is invoked with the
+ * elements of each group: (...group).
+ *
+ * @static
+ * @memberOf _
+ * @since 3.8.0
+ * @category Array
+ * @param {Array} array The array of grouped elements to process.
+ * @param {Function} [iteratee=_.identity] The function to combine
+ * regrouped values.
+ * @returns {Array} Returns the new array of regrouped elements.
+ * @example
+ *
+ * var zipped = _.zip([1, 2], [10, 20], [100, 200]);
+ * // => [[1, 10, 100], [2, 20, 200]]
+ *
+ * _.unzipWith(zipped, _.add);
+ * // => [3, 30, 300]
+ */ function unzipWith(array, iteratee) {
+ if (!(array && array.length)) {
+ return [];
+ }
+ var result = unzip(array);
+ if (iteratee == null) {
+ return result;
+ }
+ return arrayMap(result, function(group) {
+ return apply(iteratee, undefined, group);
+ });
+ }
+ /**
+ * Creates an array excluding all given values using
+ * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
+ * for equality comparisons.
+ *
+ * **Note:** Unlike `_.pull`, this method returns a new array.
+ *
+ * @static
+ * @memberOf _
+ * @since 0.1.0
+ * @category Array
+ * @param {Array} array The array to inspect.
+ * @param {...*} [values] The values to exclude.
+ * @returns {Array} Returns the new array of filtered values.
+ * @see _.difference, _.xor
+ * @example
+ *
+ * _.without([2, 1, 2, 3], 1, 2);
+ * // => [3]
+ */ var without = baseRest(function(array, values) {
+ return isArrayLikeObject(array)
+ ? baseDifference(array, values)
+ : [];
+ });
+ /**
+ * Creates an array of unique values that is the
+ * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference)
+ * of the given arrays. The order of result values is determined by the order
+ * they occur in the arrays.
+ *
+ * @static
+ * @memberOf _
+ * @since 2.4.0
+ * @category Array
+ * @param {...Array} [arrays] The arrays to inspect.
+ * @returns {Array} Returns the new array of filtered values.
+ * @see _.difference, _.without
+ * @example
+ *
+ * _.xor([2, 1], [2, 3]);
+ * // => [1, 3]
+ */ var xor = baseRest(function(arrays) {
+ return baseXor(arrayFilter(arrays, isArrayLikeObject));
+ });
+ /**
+ * This method is like `_.xor` except that it accepts `iteratee` which is
+ * invoked for each element of each `arrays` to generate the criterion by
+ * which by which they're compared. The order of result values is determined
+ * by the order they occur in the arrays. The iteratee is invoked with one
+ * argument: (value).
+ *
+ * @static
+ * @memberOf _
+ * @since 4.0.0
+ * @category Array
+ * @param {...Array} [arrays] The arrays to inspect.
+ * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
+ * @returns {Array} Returns the new array of filtered values.
+ * @example
+ *
+ * _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor);
+ * // => [1.2, 3.4]
+ *
+ * // The `_.property` iteratee shorthand.
+ * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
+ * // => [{ 'x': 2 }]
+ */ var xorBy = baseRest(function(arrays) {
+ var iteratee = last(arrays);
+ if (isArrayLikeObject(iteratee)) {
+ iteratee = undefined;
+ }
+ return baseXor(
+ arrayFilter(arrays, isArrayLikeObject),
+ getIteratee(iteratee, 2)
+ );
+ });
+ /**
+ * This method is like `_.xor` except that it accepts `comparator` which is
+ * invoked to compare elements of `arrays`. The order of result values is
+ * determined by the order they occur in the arrays. The comparator is invoked
+ * with two arguments: (arrVal, othVal).
+ *
+ * @static
+ * @memberOf _
+ * @since 4.0.0
+ * @category Array
+ * @param {...Array} [arrays] The arrays to inspect.
+ * @param {Function} [comparator] The comparator invoked per element.
+ * @returns {Array} Returns the new array of filtered values.
+ * @example
+ *
+ * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
+ * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
+ *
+ * _.xorWith(objects, others, _.isEqual);
+ * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
+ */ var xorWith = baseRest(function(arrays) {
+ var comparator = last(arrays);
+ comparator =
+ typeof comparator == "function" ? comparator : undefined;
+ return baseXor(
+ arrayFilter(arrays, isArrayLikeObject),
+ undefined,
+ comparator
+ );
+ });
+ /**
+ * Creates an array of grouped elements, the first of which contains the
+ * first elements of the given arrays, the second of which contains the
+ * second elements of the given arrays, and so on.
+ *
+ * @static
+ * @memberOf _
+ * @since 0.1.0
+ * @category Array
+ * @param {...Array} [arrays] The arrays to process.
+ * @returns {Array} Returns the new array of grouped elements.
+ * @example
+ *
+ * _.zip(['a', 'b'], [1, 2], [true, false]);
+ * // => [['a', 1, true], ['b', 2, false]]
+ */ var zip = baseRest(unzip);
+ /**
+ * This method is like `_.fromPairs` except that it accepts two arrays,
+ * one of property identifiers and one of corresponding values.
+ *
+ * @static
+ * @memberOf _
+ * @since 0.4.0
+ * @category Array
+ * @param {Array} [props=[]] The property identifiers.
+ * @param {Array} [values=[]] The property values.
+ * @returns {Object} Returns the new object.
+ * @example
+ *
+ * _.zipObject(['a', 'b'], [1, 2]);
+ * // => { 'a': 1, 'b': 2 }
+ */ function zipObject(props, values) {
+ return baseZipObject(props || [], values || [], assignValue);
+ }
+ /**
+ * This method is like `_.zipObject` except that it supports property paths.
+ *
+ * @static
+ * @memberOf _
+ * @since 4.1.0
+ * @category Array
+ * @param {Array} [props=[]] The property identifiers.
+ * @param {Array} [values=[]] The property values.
+ * @returns {Object} Returns the new object.
+ * @example
+ *
+ * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]);
+ * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } }
+ */ function zipObjectDeep(props, values) {
+ return baseZipObject(props || [], values || [], baseSet);
+ }
+ /**
+ * This method is like `_.zip` except that it accepts `iteratee` to specify
+ * how grouped values should be combined. The iteratee is invoked with the
+ * elements of each group: (...group).
+ *
+ * @static
+ * @memberOf _
+ * @since 3.8.0
+ * @category Array
+ * @param {...Array} [arrays] The arrays to process.
+ * @param {Function} [iteratee=_.identity] The function to combine
+ * grouped values.
+ * @returns {Array} Returns the new array of grouped elements.
+ * @example
+ *
+ * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) {
+ * return a + b + c;
+ * });
+ * // => [111, 222]
+ */ var zipWith = baseRest(function(arrays) {
+ var length = arrays.length,
+ iteratee = length > 1 ? arrays[length - 1] : undefined;
+ iteratee =
+ typeof iteratee == "function"
+ ? (arrays.pop(), iteratee)
+ : undefined;
+ return unzipWith(arrays, iteratee);
+ });
+ /*------------------------------------------------------------------------*/ /**
+ * Creates a `lodash` wrapper instance that wraps `value` with explicit method
+ * chain sequences enabled. The result of such sequences must be unwrapped
+ * with `_#value`.
+ *
+ * @static
+ * @memberOf _
+ * @since 1.3.0
+ * @category Seq
+ * @param {*} value The value to wrap.
+ * @returns {Object} Returns the new `lodash` wrapper instance.
+ * @example
+ *
+ * var users = [
+ * { 'user': 'barney', 'age': 36 },
+ * { 'user': 'fred', 'age': 40 },
+ * { 'user': 'pebbles', 'age': 1 }
+ * ];
+ *
+ * var youngest = _
+ * .chain(users)
+ * .sortBy('age')
+ * .map(function(o) {
+ * return o.user + ' is ' + o.age;
+ * })
+ * .head()
+ * .value();
+ * // => 'pebbles is 1'
+ */ function chain(value) {
+ var result = lodash(value);
+ result.__chain__ = true;
+ return result;
+ }
+ /**
+ * This method invokes `interceptor` and returns `value`. The interceptor
+ * is invoked with one argument; (value). The purpose of this method is to
+ * "tap into" a method chain sequence in order to modify intermediate results.
+ *
+ * @static
+ * @memberOf _
+ * @since 0.1.0
+ * @category Seq
+ * @param {*} value The value to provide to `interceptor`.
+ * @param {Function} interceptor The function to invoke.
+ * @returns {*} Returns `value`.
+ * @example
+ *
+ * _([1, 2, 3])
+ * .tap(function(array) {
+ * // Mutate input array.
+ * array.pop();
+ * })
+ * .reverse()
+ * .value();
+ * // => [2, 1]
+ */ function tap(value, interceptor) {
+ interceptor(value);
+ return value;
+ }
+ /**
+ * This method is like `_.tap` except that it returns the result of `interceptor`.
+ * The purpose of this method is to "pass thru" values replacing intermediate
+ * results in a method chain sequence.
+ *
+ * @static
+ * @memberOf _
+ * @since 3.0.0
+ * @category Seq
+ * @param {*} value The value to provide to `interceptor`.
+ * @param {Function} interceptor The function to invoke.
+ * @returns {*} Returns the result of `interceptor`.
+ * @example
+ *
+ * _(' abc ')
+ * .chain()
+ * .trim()
+ * .thru(function(value) {
+ * return [value];
+ * })
+ * .value();
+ * // => ['abc']
+ */ function thru(value, interceptor) {
+ return interceptor(value);
+ }
+ /**
+ * This method is the wrapper version of `_.at`.
+ *
+ * @name at
+ * @memberOf _
+ * @since 1.0.0
+ * @category Seq
+ * @param {...(string|string[])} [paths] The property paths to pick.
+ * @returns {Object} Returns the new `lodash` wrapper instance.
+ * @example
+ *
+ * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
+ *
+ * _(object).at(['a[0].b.c', 'a[1]']).value();
+ * // => [3, 4]
+ */ var wrapperAt = flatRest(function(paths) {
+ var length = paths.length,
+ start = length ? paths[0] : 0,
+ value = this.__wrapped__,
+ interceptor = function interceptor(object) {
+ return baseAt(object, paths);
+ };
+ if (
+ length > 1 ||
+ this.__actions__.length ||
+ !(value instanceof LazyWrapper) ||
+ !isIndex(start)
+ ) {
+ return this.thru(interceptor);
+ }
+ value = value.slice(start, +start + (length ? 1 : 0));
+ value.__actions__.push({
+ func: thru,
+ args: [interceptor],
+ thisArg: undefined
+ });
+ return new LodashWrapper(value, this.__chain__).thru(function(
+ array
+ ) {
+ if (length && !array.length) {
+ array.push(undefined);
+ }
+ return array;
+ });
+ });
+ /**
+ * Creates a `lodash` wrapper instance with explicit method chain sequences enabled.
+ *
+ * @name chain
+ * @memberOf _
+ * @since 0.1.0
+ * @category Seq
+ * @returns {Object} Returns the new `lodash` wrapper instance.
+ * @example
+ *
+ * var users = [
+ * { 'user': 'barney', 'age': 36 },
+ * { 'user': 'fred', 'age': 40 }
+ * ];
+ *
+ * // A sequence without explicit chaining.
+ * _(users).head();
+ * // => { 'user': 'barney', 'age': 36 }
+ *
+ * // A sequence with explicit chaining.
+ * _(users)
+ * .chain()
+ * .head()
+ * .pick('user')
+ * .value();
+ * // => { 'user': 'barney' }
+ */ function wrapperChain() {
+ return chain(this);
+ }
+ /**
+ * Executes the chain sequence and returns the wrapped result.
+ *
+ * @name commit
+ * @memberOf _
+ * @since 3.2.0
+ * @category Seq
+ * @returns {Object} Returns the new `lodash` wrapper instance.
+ * @example
+ *
+ * var array = [1, 2];
+ * var wrapped = _(array).push(3);
+ *
+ * console.log(array);
+ * // => [1, 2]
+ *
+ * wrapped = wrapped.commit();
+ * console.log(array);
+ * // => [1, 2, 3]
+ *
+ * wrapped.last();
+ * // => 3
+ *
+ * console.log(array);
+ * // => [1, 2, 3]
+ */ function wrapperCommit() {
+ return new LodashWrapper(this.value(), this.__chain__);
+ }
+ /**
+ * Gets the next value on a wrapped object following the
+ * [iterator protocol](https://mdn.io/iteration_protocols#iterator).
+ *
+ * @name next
+ * @memberOf _
+ * @since 4.0.0
+ * @category Seq
+ * @returns {Object} Returns the next iterator value.
+ * @example
+ *
+ * var wrapped = _([1, 2]);
+ *
+ * wrapped.next();
+ * // => { 'done': false, 'value': 1 }
+ *
+ * wrapped.next();
+ * // => { 'done': false, 'value': 2 }
+ *
+ * wrapped.next();
+ * // => { 'done': true, 'value': undefined }
+ */ function wrapperNext() {
+ if (this.__values__ === undefined) {
+ this.__values__ = toArray(this.value());
+ }
+ var done = this.__index__ >= this.__values__.length,
+ value = done ? undefined : this.__values__[this.__index__++];
+ return { done: done, value: value };
+ }
+ /**
+ * Enables the wrapper to be iterable.
+ *
+ * @name Symbol.iterator
+ * @memberOf _
+ * @since 4.0.0
+ * @category Seq
+ * @returns {Object} Returns the wrapper object.
+ * @example
+ *
+ * var wrapped = _([1, 2]);
+ *
+ * wrapped[Symbol.iterator]() === wrapped;
+ * // => true
+ *
+ * Array.from(wrapped);
+ * // => [1, 2]
+ */ function wrapperToIterator() {
+ return this;
+ }
+ /**
+ * Creates a clone of the chain sequence planting `value` as the wrapped value.
+ *
+ * @name plant
+ * @memberOf _
+ * @since 3.2.0
+ * @category Seq
+ * @param {*} value The value to plant.
+ * @returns {Object} Returns the new `lodash` wrapper instance.
+ * @example
+ *
+ * function square(n) {
+ * return n * n;
+ * }
+ *
+ * var wrapped = _([1, 2]).map(square);
+ * var other = wrapped.plant([3, 4]);
+ *
+ * other.value();
+ * // => [9, 16]
+ *
+ * wrapped.value();
+ * // => [1, 4]
+ */ function wrapperPlant(value) {
+ var result,
+ parent = this;
+ while (parent instanceof baseLodash) {
+ var clone = wrapperClone(parent);
+ clone.__index__ = 0;
+ clone.__values__ = undefined;
+ if (result) {
+ previous.__wrapped__ = clone;
+ } else {
+ result = clone;
+ }
+ var previous = clone;
+ parent = parent.__wrapped__;
+ }
+ previous.__wrapped__ = value;
+ return result;
+ }
+ /**
+ * This method is the wrapper version of `_.reverse`.
+ *
+ * **Note:** This method mutates the wrapped array.
+ *
+ * @name reverse
+ * @memberOf _
+ * @since 0.1.0
+ * @category Seq
+ * @returns {Object} Returns the new `lodash` wrapper instance.
+ * @example
+ *
+ * var array = [1, 2, 3];
+ *
+ * _(array).reverse().value()
+ * // => [3, 2, 1]
+ *
+ * console.log(array);
+ * // => [3, 2, 1]
+ */ function wrapperReverse() {
+ var value = this.__wrapped__;
+ if (value instanceof LazyWrapper) {
+ var wrapped = value;
+ if (this.__actions__.length) {
+ wrapped = new LazyWrapper(this);
+ }
+ wrapped = wrapped.reverse();
+ wrapped.__actions__.push({
+ func: thru,
+ args: [reverse],
+ thisArg: undefined
+ });
+ return new LodashWrapper(wrapped, this.__chain__);
+ }
+ return this.thru(reverse);
+ }
+ /**
+ * Executes the chain sequence to resolve the unwrapped value.
+ *
+ * @name value
+ * @memberOf _
+ * @since 0.1.0
+ * @alias toJSON, valueOf
+ * @category Seq
+ * @returns {*} Returns the resolved unwrapped value.
+ * @example
+ *
+ * _([1, 2, 3]).value();
+ * // => [1, 2, 3]
+ */ function wrapperValue() {
+ return baseWrapperValue(this.__wrapped__, this.__actions__);
+ }
+ /*------------------------------------------------------------------------*/ /**
+ * Creates an object composed of keys generated from the results of running
+ * each element of `collection` thru `iteratee`. The corresponding value of
+ * each key is the number of times the key was returned by `iteratee`. The
+ * iteratee is invoked with one argument: (value).
+ *
+ * @static
+ * @memberOf _
+ * @since 0.5.0
+ * @category Collection
+ * @param {Array|Object} collection The collection to iterate over.
+ * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
+ * @returns {Object} Returns the composed aggregate object.
+ * @example
+ *
+ * _.countBy([6.1, 4.2, 6.3], Math.floor);
+ * // => { '4': 1, '6': 2 }
+ *
+ * // The `_.property` iteratee shorthand.
+ * _.countBy(['one', 'two', 'three'], 'length');
+ * // => { '3': 2, '5': 1 }
+ */ var countBy = createAggregator(function(result, value, key) {
+ if (hasOwnProperty.call(result, key)) {
+ ++result[key];
+ } else {
+ baseAssignValue(result, key, 1);
+ }
+ });
+ /**
+ * Checks if `predicate` returns truthy for **all** elements of `collection`.
+ * Iteration is stopped once `predicate` returns falsey. The predicate is
+ * invoked with three arguments: (value, index|key, collection).
+ *
+ * **Note:** This method returns `true` for
+ * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because
+ * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of
+ * elements of empty collections.
+ *
+ * @static
+ * @memberOf _
+ * @since 0.1.0
+ * @category Collection
+ * @param {Array|Object} collection The collection to iterate over.
+ * @param {Function} [predicate=_.identity] The function invoked per iteration.
+ * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
+ * @returns {boolean} Returns `true` if all elements pass the predicate check,
+ * else `false`.
+ * @example
+ *
+ * _.every([true, 1, null, 'yes'], Boolean);
+ * // => false
+ *
+ * var users = [
+ * { 'user': 'barney', 'age': 36, 'active': false },
+ * { 'user': 'fred', 'age': 40, 'active': false }
+ * ];
+ *
+ * // The `_.matches` iteratee shorthand.
+ * _.every(users, { 'user': 'barney', 'active': false });
+ * // => false
+ *
+ * // The `_.matchesProperty` iteratee shorthand.
+ * _.every(users, ['active', false]);
+ * // => true
+ *
+ * // The `_.property` iteratee shorthand.
+ * _.every(users, 'active');
+ * // => false
+ */ function every(collection, predicate, guard) {
+ var func = isArray(collection) ? arrayEvery : baseEvery;
+ if (guard && isIterateeCall(collection, predicate, guard)) {
+ predicate = undefined;
+ }
+ return func(collection, getIteratee(predicate, 3));
+ }
+ /**
+ * Iterates over elements of `collection`, returning an array of all elements
+ * `predicate` returns truthy for. The predicate is invoked with three
+ * arguments: (value, index|key, collection).
+ *
+ * **Note:** Unlike `_.remove`, this method returns a new array.
+ *
+ * @static
+ * @memberOf _
+ * @since 0.1.0
+ * @category Collection
+ * @param {Array|Object} collection The collection to iterate over.
+ * @param {Function} [predicate=_.identity] The function invoked per iteration.
+ * @returns {Array} Returns the new filtered array.
+ * @see _.reject
+ * @example
+ *
+ * var users = [
+ * { 'user': 'barney', 'age': 36, 'active': true },
+ * { 'user': 'fred', 'age': 40, 'active': false }
+ * ];
+ *
+ * _.filter(users, function(o) { return !o.active; });
+ * // => objects for ['fred']
+ *
+ * // The `_.matches` iteratee shorthand.
+ * _.filter(users, { 'age': 36, 'active': true });
+ * // => objects for ['barney']
+ *
+ * // The `_.matchesProperty` iteratee shorthand.
+ * _.filter(users, ['active', false]);
+ * // => objects for ['fred']
+ *
+ * // The `_.property` iteratee shorthand.
+ * _.filter(users, 'active');
+ * // => objects for ['barney']
+ */ function filter(collection, predicate) {
+ var func = isArray(collection) ? arrayFilter : baseFilter;
+ return func(collection, getIteratee(predicate, 3));
+ }
+ /**
+ * Iterates over elements of `collection`, returning the first element
+ * `predicate` returns truthy for. The predicate is invoked with three
+ * arguments: (value, index|key, collection).
+ *
+ * @static
+ * @memberOf _
+ * @since 0.1.0
+ * @category Collection
+ * @param {Array|Object} collection The collection to inspect.
+ * @param {Function} [predicate=_.identity] The function invoked per iteration.
+ * @param {number} [fromIndex=0] The index to search from.
+ * @returns {*} Returns the matched element, else `undefined`.
+ * @example
+ *
+ * var users = [
+ * { 'user': 'barney', 'age': 36, 'active': true },
+ * { 'user': 'fred', 'age': 40, 'active': false },
+ * { 'user': 'pebbles', 'age': 1, 'active': true }
+ * ];
+ *
+ * _.find(users, function(o) { return o.age < 40; });
+ * // => object for 'barney'
+ *
+ * // The `_.matches` iteratee shorthand.
+ * _.find(users, { 'age': 1, 'active': true });
+ * // => object for 'pebbles'
+ *
+ * // The `_.matchesProperty` iteratee shorthand.
+ * _.find(users, ['active', false]);
+ * // => object for 'fred'
+ *
+ * // The `_.property` iteratee shorthand.
+ * _.find(users, 'active');
+ * // => object for 'barney'
+ */ var find = createFind(findIndex);
+ /**
+ * This method is like `_.find` except that it iterates over elements of
+ * `collection` from right to left.
+ *
+ * @static
+ * @memberOf _
+ * @since 2.0.0
+ * @category Collection
+ * @param {Array|Object} collection The collection to inspect.
+ * @param {Function} [predicate=_.identity] The function invoked per iteration.
+ * @param {number} [fromIndex=collection.length-1] The index to search from.
+ * @returns {*} Returns the matched element, else `undefined`.
+ * @example
+ *
+ * _.findLast([1, 2, 3, 4], function(n) {
+ * return n % 2 == 1;
+ * });
+ * // => 3
+ */ var findLast = createFind(findLastIndex);
+ /**
+ * Creates a flattened array of values by running each element in `collection`
+ * thru `iteratee` and flattening the mapped results. The iteratee is invoked
+ * with three arguments: (value, index|key, collection).
+ *
+ * @static
+ * @memberOf _
+ * @since 4.0.0
+ * @category Collection
+ * @param {Array|Object} collection The collection to iterate over.
+ * @param {Function} [iteratee=_.identity] The function invoked per iteration.
+ * @returns {Array} Returns the new flattened array.
+ * @example
+ *
+ * function duplicate(n) {
+ * return [n, n];
+ * }
+ *
+ * _.flatMap([1, 2], duplicate);
+ * // => [1, 1, 2, 2]
+ */ function flatMap(collection, iteratee) {
+ return baseFlatten(map(collection, iteratee), 1);
+ }
+ /**
+ * This method is like `_.flatMap` except that it recursively flattens the
+ * mapped results.
+ *
+ * @static
+ * @memberOf _
+ * @since 4.7.0
+ * @category Collection
+ * @param {Array|Object} collection The collection to iterate over.
+ * @param {Function} [iteratee=_.identity] The function invoked per iteration.
+ * @returns {Array} Returns the new flattened array.
+ * @example
+ *
+ * function duplicate(n) {
+ * return [[[n, n]]];
+ * }
+ *
+ * _.flatMapDeep([1, 2], duplicate);
+ * // => [1, 1, 2, 2]
+ */ function flatMapDeep(collection, iteratee) {
+ return baseFlatten(map(collection, iteratee), INFINITY);
+ }
+ /**
+ * This method is like `_.flatMap` except that it recursively flattens the
+ * mapped results up to `depth` times.
+ *
+ * @static
+ * @memberOf _
+ * @since 4.7.0
+ * @category Collection
+ * @param {Array|Object} collection The collection to iterate over.
+ * @param {Function} [iteratee=_.identity] The function invoked per iteration.
+ * @param {number} [depth=1] The maximum recursion depth.
+ * @returns {Array} Returns the new flattened array.
+ * @example
+ *
+ * function duplicate(n) {
+ * return [[[n, n]]];
+ * }
+ *
+ * _.flatMapDepth([1, 2], duplicate, 2);
+ * // => [[1, 1], [2, 2]]
+ */ function flatMapDepth(collection, iteratee, depth) {
+ depth = depth === undefined ? 1 : toInteger(depth);
+ return baseFlatten(map(collection, iteratee), depth);
+ }
+ /**
+ * Iterates over elements of `collection` and invokes `iteratee` for each element.
+ * The iteratee is invoked with three arguments: (value, index|key, collection).
+ * Iteratee functions may exit iteration early by explicitly returning `false`.
+ *
+ * **Note:** As with other "Collections" methods, objects with a "length"
+ * property are iterated like arrays. To avoid this behavior use `_.forIn`
+ * or `_.forOwn` for object iteration.
+ *
+ * @static
+ * @memberOf _
+ * @since 0.1.0
+ * @alias each
+ * @category Collection
+ * @param {Array|Object} collection The collection to iterate over.
+ * @param {Function} [iteratee=_.identity] The function invoked per iteration.
+ * @returns {Array|Object} Returns `collection`.
+ * @see _.forEachRight
+ * @example
+ *
+ * _.forEach([1, 2], function(value) {
+ * console.log(value);
+ * });
+ * // => Logs `1` then `2`.
+ *
+ * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {
+ * console.log(key);
+ * });
+ * // => Logs 'a' then 'b' (iteration order is not guaranteed).
+ */ function forEach(collection, iteratee) {
+ var func = isArray(collection) ? arrayEach : baseEach;
+ return func(collection, getIteratee(iteratee, 3));
+ }
+ /**
+ * This method is like `_.forEach` except that it iterates over elements of
+ * `collection` from right to left.
+ *
+ * @static
+ * @memberOf _
+ * @since 2.0.0
+ * @alias eachRight
+ * @category Collection
+ * @param {Array|Object} collection The collection to iterate over.
+ * @param {Function} [iteratee=_.identity] The function invoked per iteration.
+ * @returns {Array|Object} Returns `collection`.
+ * @see _.forEach
+ * @example
+ *
+ * _.forEachRight([1, 2], function(value) {
+ * console.log(value);
+ * });
+ * // => Logs `2` then `1`.
+ */ function forEachRight(collection, iteratee) {
+ var func = isArray(collection) ? arrayEachRight : baseEachRight;
+ return func(collection, getIteratee(iteratee, 3));
+ }
+ /**
+ * Creates an object composed of keys generated from the results of running
+ * each element of `collection` thru `iteratee`. The order of grouped values
+ * is determined by the order they occur in `collection`. The corresponding
+ * value of each key is an array of elements responsible for generating the
+ * key. The iteratee is invoked with one argument: (value).
+ *
+ * @static
+ * @memberOf _
+ * @since 0.1.0
+ * @category Collection
+ * @param {Array|Object} collection The collection to iterate over.
+ * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
+ * @returns {Object} Returns the composed aggregate object.
+ * @example
+ *
+ * _.groupBy([6.1, 4.2, 6.3], Math.floor);
+ * // => { '4': [4.2], '6': [6.1, 6.3] }
+ *
+ * // The `_.property` iteratee shorthand.
+ * _.groupBy(['one', 'two', 'three'], 'length');
+ * // => { '3': ['one', 'two'], '5': ['three'] }
+ */ var groupBy = createAggregator(function(result, value, key) {
+ if (hasOwnProperty.call(result, key)) {
+ result[key].push(value);
+ } else {
+ baseAssignValue(result, key, [value]);
+ }
+ });
+ /**
+ * Checks if `value` is in `collection`. If `collection` is a string, it's
+ * checked for a substring of `value`, otherwise
+ * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
+ * is used for equality comparisons. If `fromIndex` is negative, it's used as
+ * the offset from the end of `collection`.
+ *
+ * @static
+ * @memberOf _
+ * @since 0.1.0
+ * @category Collection
+ * @param {Array|Object|string} collection The collection to inspect.
+ * @param {*} value The value to search for.
+ * @param {number} [fromIndex=0] The index to search from.
+ * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
+ * @returns {boolean} Returns `true` if `value` is found, else `false`.
+ * @example
+ *
+ * _.includes([1, 2, 3], 1);
+ * // => true
+ *
+ * _.includes([1, 2, 3], 1, 2);
+ * // => false
+ *
+ * _.includes({ 'a': 1, 'b': 2 }, 1);
+ * // => true
+ *
+ * _.includes('abcd', 'bc');
+ * // => true
+ */ function includes(collection, value, fromIndex, guard) {
+ collection = isArrayLike(collection)
+ ? collection
+ : values(collection);
+ fromIndex = fromIndex && !guard ? toInteger(fromIndex) : 0;
+ var length = collection.length;
+ if (fromIndex < 0) {
+ fromIndex = nativeMax(length + fromIndex, 0);
+ }
+ return isString(collection)
+ ? fromIndex <= length &&
+ collection.indexOf(value, fromIndex) > -1
+ : !!length && baseIndexOf(collection, value, fromIndex) > -1;
+ }
+ /**
+ * Invokes the method at `path` of each element in `collection`, returning
+ * an array of the results of each invoked method. Any additional arguments
+ * are provided to each invoked method. If `path` is a function, it's invoked
+ * for, and `this` bound to, each element in `collection`.
+ *
+ * @static
+ * @memberOf _
+ * @since 4.0.0
+ * @category Collection
+ * @param {Array|Object} collection The collection to iterate over.
+ * @param {Array|Function|string} path The path of the method to invoke or
+ * the function invoked per iteration.
+ * @param {...*} [args] The arguments to invoke each method with.
+ * @returns {Array} Returns the array of results.
+ * @example
+ *
+ * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort');
+ * // => [[1, 5, 7], [1, 2, 3]]
+ *
+ * _.invokeMap([123, 456], String.prototype.split, '');
+ * // => [['1', '2', '3'], ['4', '5', '6']]
+ */ var invokeMap = baseRest(function(collection, path, args) {
+ var index = -1,
+ isFunc = typeof path == "function",
+ result = isArrayLike(collection)
+ ? Array(collection.length)
+ : [];
+ baseEach(collection, function(value) {
+ result[++index] = isFunc
+ ? apply(path, value, args)
+ : baseInvoke(value, path, args);
+ });
+ return result;
+ });
+ /**
+ * Creates an object composed of keys generated from the results of running
+ * each element of `collection` thru `iteratee`. The corresponding value of
+ * each key is the last element responsible for generating the key. The
+ * iteratee is invoked with one argument: (value).
+ *
+ * @static
+ * @memberOf _
+ * @since 4.0.0
+ * @category Collection
+ * @param {Array|Object} collection The collection to iterate over.
+ * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
+ * @returns {Object} Returns the composed aggregate object.
+ * @example
+ *
+ * var array = [
+ * { 'dir': 'left', 'code': 97 },
+ * { 'dir': 'right', 'code': 100 }
+ * ];
+ *
+ * _.keyBy(array, function(o) {
+ * return String.fromCharCode(o.code);
+ * });
+ * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }
+ *
+ * _.keyBy(array, 'dir');
+ * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }
+ */ var keyBy = createAggregator(function(result, value, key) {
+ baseAssignValue(result, key, value);
+ });
+ /**
+ * Creates an array of values by running each element in `collection` thru
+ * `iteratee`. The iteratee is invoked with three arguments:
+ * (value, index|key, collection).
+ *
+ * Many lodash methods are guarded to work as iteratees for methods like
+ * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
+ *
+ * The guarded methods are:
+ * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,
+ * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,
+ * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,
+ * `template`, `trim`, `trimEnd`, `trimStart`, and `words`
+ *
+ * @static
+ * @memberOf _
+ * @since 0.1.0
+ * @category Collection
+ * @param {Array|Object} collection The collection to iterate over.
+ * @param {Function} [iteratee=_.identity] The function invoked per iteration.
+ * @returns {Array} Returns the new mapped array.
+ * @example
+ *
+ * function square(n) {
+ * return n * n;
+ * }
+ *
+ * _.map([4, 8], square);
+ * // => [16, 64]
+ *
+ * _.map({ 'a': 4, 'b': 8 }, square);
+ * // => [16, 64] (iteration order is not guaranteed)
+ *
+ * var users = [
+ * { 'user': 'barney' },
+ * { 'user': 'fred' }
+ * ];
+ *
+ * // The `_.property` iteratee shorthand.
+ * _.map(users, 'user');
+ * // => ['barney', 'fred']
+ */ function map(collection, iteratee) {
+ var func = isArray(collection) ? arrayMap : baseMap;
+ return func(collection, getIteratee(iteratee, 3));
+ }
+ /**
+ * This method is like `_.sortBy` except that it allows specifying the sort
+ * orders of the iteratees to sort by. If `orders` is unspecified, all values
+ * are sorted in ascending order. Otherwise, specify an order of "desc" for
+ * descending or "asc" for ascending sort order of corresponding values.
+ *
+ * @static
+ * @memberOf _
+ * @since 4.0.0
+ * @category Collection
+ * @param {Array|Object} collection The collection to iterate over.
+ * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]]
+ * The iteratees to sort by.
+ * @param {string[]} [orders] The sort orders of `iteratees`.
+ * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
+ * @returns {Array} Returns the new sorted array.
+ * @example
+ *
+ * var users = [
+ * { 'user': 'fred', 'age': 48 },
+ * { 'user': 'barney', 'age': 34 },
+ * { 'user': 'fred', 'age': 40 },
+ * { 'user': 'barney', 'age': 36 }
+ * ];
+ *
+ * // Sort by `user` in ascending order and by `age` in descending order.
+ * _.orderBy(users, ['user', 'age'], ['asc', 'desc']);
+ * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]
+ */ function orderBy(collection, iteratees, orders, guard) {
+ if (collection == null) {
+ return [];
+ }
+ if (!isArray(iteratees)) {
+ iteratees = iteratees == null ? [] : [iteratees];
+ }
+ orders = guard ? undefined : orders;
+ if (!isArray(orders)) {
+ orders = orders == null ? [] : [orders];
+ }
+ return baseOrderBy(collection, iteratees, orders);
+ }
+ /**
+ * Creates an array of elements split into two groups, the first of which
+ * contains elements `predicate` returns truthy for, the second of which
+ * contains elements `predicate` returns falsey for. The predicate is
+ * invoked with one argument: (value).
+ *
+ * @static
+ * @memberOf _
+ * @since 3.0.0
+ * @category Collection
+ * @param {Array|Object} collection The collection to iterate over.
+ * @param {Function} [predicate=_.identity] The function invoked per iteration.
+ * @returns {Array} Returns the array of grouped elements.
+ * @example
+ *
+ * var users = [
+ * { 'user': 'barney', 'age': 36, 'active': false },
+ * { 'user': 'fred', 'age': 40, 'active': true },
+ * { 'user': 'pebbles', 'age': 1, 'active': false }
+ * ];
+ *
+ * _.partition(users, function(o) { return o.active; });
+ * // => objects for [['fred'], ['barney', 'pebbles']]
+ *
+ * // The `_.matches` iteratee shorthand.
+ * _.partition(users, { 'age': 1, 'active': false });
+ * // => objects for [['pebbles'], ['barney', 'fred']]
+ *
+ * // The `_.matchesProperty` iteratee shorthand.
+ * _.partition(users, ['active', false]);
+ * // => objects for [['barney', 'pebbles'], ['fred']]
+ *
+ * // The `_.property` iteratee shorthand.
+ * _.partition(users, 'active');
+ * // => objects for [['fred'], ['barney', 'pebbles']]
+ */ var partition = createAggregator(
+ function(result, value, key) {
+ result[key ? 0 : 1].push(value);
+ },
+ function() {
+ return [[], []];
+ }
+ );
+ /**
+ * Reduces `collection` to a value which is the accumulated result of running
+ * each element in `collection` thru `iteratee`, where each successive
+ * invocation is supplied the return value of the previous. If `accumulator`
+ * is not given, the first element of `collection` is used as the initial
+ * value. The iteratee is invoked with four arguments:
+ * (accumulator, value, index|key, collection).
+ *
+ * Many lodash methods are guarded to work as iteratees for methods like
+ * `_.reduce`, `_.reduceRight`, and `_.transform`.
+ *
+ * The guarded methods are:
+ * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,
+ * and `sortBy`
+ *
+ * @static
+ * @memberOf _
+ * @since 0.1.0
+ * @category Collection
+ * @param {Array|Object} collection The collection to iterate over.
+ * @param {Function} [iteratee=_.identity] The function invoked per iteration.
+ * @param {*} [accumulator] The initial value.
+ * @returns {*} Returns the accumulated value.
+ * @see _.reduceRight
+ * @example
+ *
+ * _.reduce([1, 2], function(sum, n) {
+ * return sum + n;
+ * }, 0);
+ * // => 3
+ *
+ * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
+ * (result[value] || (result[value] = [])).push(key);
+ * return result;
+ * }, {});
+ * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)
+ */ function reduce(collection, iteratee, accumulator) {
+ var func = isArray(collection) ? arrayReduce : baseReduce,
+ initAccum = arguments.length < 3;
+ return func(
+ collection,
+ getIteratee(iteratee, 4),
+ accumulator,
+ initAccum,
+ baseEach
+ );
+ }
+ /**
+ * This method is like `_.reduce` except that it iterates over elements of
+ * `collection` from right to left.
+ *
+ * @static
+ * @memberOf _
+ * @since 0.1.0
+ * @category Collection
+ * @param {Array|Object} collection The collection to iterate over.
+ * @param {Function} [iteratee=_.identity] The function invoked per iteration.
+ * @param {*} [accumulator] The initial value.
+ * @returns {*} Returns the accumulated value.
+ * @see _.reduce
+ * @example
+ *
+ * var array = [[0, 1], [2, 3], [4, 5]];
+ *
+ * _.reduceRight(array, function(flattened, other) {
+ * return flattened.concat(other);
+ * }, []);
+ * // => [4, 5, 2, 3, 0, 1]
+ */ function reduceRight(collection, iteratee, accumulator) {
+ var func = isArray(collection) ? arrayReduceRight : baseReduce,
+ initAccum = arguments.length < 3;
+ return func(
+ collection,
+ getIteratee(iteratee, 4),
+ accumulator,
+ initAccum,
+ baseEachRight
+ );
+ }
+ /**
+ * The opposite of `_.filter`; this method returns the elements of `collection`
+ * that `predicate` does **not** return truthy for.
+ *
+ * @static
+ * @memberOf _
+ * @since 0.1.0
+ * @category Collection
+ * @param {Array|Object} collection The collection to iterate over.
+ * @param {Function} [predicate=_.identity] The function invoked per iteration.
+ * @returns {Array} Returns the new filtered array.
+ * @see _.filter
+ * @example
+ *
+ * var users = [
+ * { 'user': 'barney', 'age': 36, 'active': false },
+ * { 'user': 'fred', 'age': 40, 'active': true }
+ * ];
+ *
+ * _.reject(users, function(o) { return !o.active; });
+ * // => objects for ['fred']
+ *
+ * // The `_.matches` iteratee shorthand.
+ * _.reject(users, { 'age': 40, 'active': true });
+ * // => objects for ['barney']
+ *
+ * // The `_.matchesProperty` iteratee shorthand.
+ * _.reject(users, ['active', false]);
+ * // => objects for ['fred']
+ *
+ * // The `_.property` iteratee shorthand.
+ * _.reject(users, 'active');
+ * // => objects for ['barney']
+ */ function reject(collection, predicate) {
+ var func = isArray(collection) ? arrayFilter : baseFilter;
+ return func(collection, negate(getIteratee(predicate, 3)));
+ }
+ /**
+ * Gets a random element from `collection`.
+ *
+ * @static
+ * @memberOf _
+ * @since 2.0.0
+ * @category Collection
+ * @param {Array|Object} collection The collection to sample.
+ * @returns {*} Returns the random element.
+ * @example
+ *
+ * _.sample([1, 2, 3, 4]);
+ * // => 2
+ */ function sample(collection) {
+ var func = isArray(collection) ? arraySample : baseSample;
+ return func(collection);
+ }
+ /**
+ * Gets `n` random elements at unique keys from `collection` up to the
+ * size of `collection`.
+ *
+ * @static
+ * @memberOf _
+ * @since 4.0.0
+ * @category Collection
+ * @param {Array|Object} collection The collection to sample.
+ * @param {number} [n=1] The number of elements to sample.
+ * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
+ * @returns {Array} Returns the random elements.
+ * @example
+ *
+ * _.sampleSize([1, 2, 3], 2);
+ * // => [3, 1]
+ *
+ * _.sampleSize([1, 2, 3], 4);
+ * // => [2, 3, 1]
+ */ function sampleSize(collection, n, guard) {
+ if (
+ guard ? isIterateeCall(collection, n, guard) : n === undefined
+ ) {
+ n = 1;
+ } else {
+ n = toInteger(n);
+ }
+ var func = isArray(collection)
+ ? arraySampleSize
+ : baseSampleSize;
+ return func(collection, n);
+ }
+ /**
+ * Creates an array of shuffled values, using a version of the
+ * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).
+ *
+ * @static
+ * @memberOf _
+ * @since 0.1.0
+ * @category Collection
+ * @param {Array|Object} collection The collection to shuffle.
+ * @returns {Array} Returns the new shuffled array.
+ * @example
+ *
+ * _.shuffle([1, 2, 3, 4]);
+ * // => [4, 1, 3, 2]
+ */ function shuffle(collection) {
+ var func = isArray(collection) ? arrayShuffle : baseShuffle;
+ return func(collection);
+ }
+ /**
+ * Gets the size of `collection` by returning its length for array-like
+ * values or the number of own enumerable string keyed properties for objects.
+ *
+ * @static
+ * @memberOf _
+ * @since 0.1.0
+ * @category Collection
+ * @param {Array|Object|string} collection The collection to inspect.
+ * @returns {number} Returns the collection size.
+ * @example
+ *
+ * _.size([1, 2, 3]);
+ * // => 3
+ *
+ * _.size({ 'a': 1, 'b': 2 });
+ * // => 2
+ *
+ * _.size('pebbles');
+ * // => 7
+ */ function size(collection) {
+ if (collection == null) {
+ return 0;
+ }
+ if (isArrayLike(collection)) {
+ return isString(collection)
+ ? stringSize(collection)
+ : collection.length;
+ }
+ var tag = getTag(collection);
+ if (tag == mapTag || tag == setTag) {
+ return collection.size;
+ }
+ return baseKeys(collection).length;
+ }
+ /**
+ * Checks if `predicate` returns truthy for **any** element of `collection`.
+ * Iteration is stopped once `predicate` returns truthy. The predicate is
+ * invoked with three arguments: (value, index|key, collection).
+ *
+ * @static
+ * @memberOf _
+ * @since 0.1.0
+ * @category Collection
+ * @param {Array|Object} collection The collection to iterate over.
+ * @param {Function} [predicate=_.identity] The function invoked per iteration.
+ * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
+ * @returns {boolean} Returns `true` if any element passes the predicate check,
+ * else `false`.
+ * @example
+ *
+ * _.some([null, 0, 'yes', false], Boolean);
+ * // => true
+ *
+ * var users = [
+ * { 'user': 'barney', 'active': true },
+ * { 'user': 'fred', 'active': false }
+ * ];
+ *
+ * // The `_.matches` iteratee shorthand.
+ * _.some(users, { 'user': 'barney', 'active': false });
+ * // => false
+ *
+ * // The `_.matchesProperty` iteratee shorthand.
+ * _.some(users, ['active', false]);
+ * // => true
+ *
+ * // The `_.property` iteratee shorthand.
+ * _.some(users, 'active');
+ * // => true
+ */ function some(collection, predicate, guard) {
+ var func = isArray(collection) ? arraySome : baseSome;
+ if (guard && isIterateeCall(collection, predicate, guard)) {
+ predicate = undefined;
+ }
+ return func(collection, getIteratee(predicate, 3));
+ }
+ /**
+ * Creates an array of elements, sorted in ascending order by the results of
+ * running each element in a collection thru each iteratee. This method
+ * performs a stable sort, that is, it preserves the original sort order of
+ * equal elements. The iteratees are invoked with one argument: (value).
+ *
+ * @static
+ * @memberOf _
+ * @since 0.1.0
+ * @category Collection
+ * @param {Array|Object} collection The collection to iterate over.
+ * @param {...(Function|Function[])} [iteratees=[_.identity]]
+ * The iteratees to sort by.
+ * @returns {Array} Returns the new sorted array.
+ * @example
+ *
+ * var users = [
+ * { 'user': 'fred', 'age': 48 },
+ * { 'user': 'barney', 'age': 36 },
+ * { 'user': 'fred', 'age': 40 },
+ * { 'user': 'barney', 'age': 34 }
+ * ];
+ *
+ * _.sortBy(users, [function(o) { return o.user; }]);
+ * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]
+ *
+ * _.sortBy(users, ['user', 'age']);
+ * // => objects for [['barney', 34], ['barney', 36], ['fred', 40], ['fred', 48]]
+ */ var sortBy = baseRest(function(collection, iteratees) {
+ if (collection == null) {
+ return [];
+ }
+ var length = iteratees.length;
+ if (
+ length > 1 &&
+ isIterateeCall(collection, iteratees[0], iteratees[1])
+ ) {
+ iteratees = [];
+ } else if (
+ length > 2 &&
+ isIterateeCall(iteratees[0], iteratees[1], iteratees[2])
+ ) {
+ iteratees = [iteratees[0]];
+ }
+ return baseOrderBy(collection, baseFlatten(iteratees, 1), []);
+ });
+ /*------------------------------------------------------------------------*/ /**
+ * Gets the timestamp of the number of milliseconds that have elapsed since
+ * the Unix epoch (1 January 1970 00:00:00 UTC).
+ *
+ * @static
+ * @memberOf _
+ * @since 2.4.0
+ * @category Date
+ * @returns {number} Returns the timestamp.
+ * @example
+ *
+ * _.defer(function(stamp) {
+ * console.log(_.now() - stamp);
+ * }, _.now());
+ * // => Logs the number of milliseconds it took for the deferred invocation.
+ */ var now =
+ ctxNow ||
+ function() {
+ return root.Date.now();
+ };
+ /*------------------------------------------------------------------------*/ /**
+ * The opposite of `_.before`; this method creates a function that invokes
+ * `func` once it's called `n` or more times.
+ *
+ * @static
+ * @memberOf _
+ * @since 0.1.0
+ * @category Function
+ * @param {number} n The number of calls before `func` is invoked.
+ * @param {Function} func The function to restrict.
+ * @returns {Function} Returns the new restricted function.
+ * @example
+ *
+ * var saves = ['profile', 'settings'];
+ *
+ * var done = _.after(saves.length, function() {
+ * console.log('done saving!');
+ * });
+ *
+ * _.forEach(saves, function(type) {
+ * asyncSave({ 'type': type, 'complete': done });
+ * });
+ * // => Logs 'done saving!' after the two async saves have completed.
+ */ function after(n, func) {
+ if (typeof func != "function") {
+ throw new TypeError(FUNC_ERROR_TEXT);
+ }
+ n = toInteger(n);
+ return function() {
+ if (--n < 1) {
+ return func.apply(this, arguments);
+ }
+ };
+ }
+ /**
+ * Creates a function that invokes `func`, with up to `n` arguments,
+ * ignoring any additional arguments.
+ *
+ * @static
+ * @memberOf _
+ * @since 3.0.0
+ * @category Function
+ * @param {Function} func The function to cap arguments for.
+ * @param {number} [n=func.length] The arity cap.
+ * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
+ * @returns {Function} Returns the new capped function.
+ * @example
+ *
+ * _.map(['6', '8', '10'], _.ary(parseInt, 1));
+ * // => [6, 8, 10]
+ */ function ary(func, n, guard) {
+ n = guard ? undefined : n;
+ n = func && n == null ? func.length : n;
+ return createWrap(
+ func,
+ WRAP_ARY_FLAG,
+ undefined,
+ undefined,
+ undefined,
+ undefined,
+ n
+ );
+ }
+ /**
+ * Creates a function that invokes `func`, with the `this` binding and arguments
+ * of the created function, while it's called less than `n` times. Subsequent
+ * calls to the created function return the result of the last `func` invocation.
+ *
+ * @static
+ * @memberOf _
+ * @since 3.0.0
+ * @category Function
+ * @param {number} n The number of calls at which `func` is no longer invoked.
+ * @param {Function} func The function to restrict.
+ * @returns {Function} Returns the new restricted function.
+ * @example
+ *
+ * jQuery(element).on('click', _.before(5, addContactToList));
+ * // => Allows adding up to 4 contacts to the list.
+ */ function before(n, func) {
+ var result;
+ if (typeof func != "function") {
+ throw new TypeError(FUNC_ERROR_TEXT);
+ }
+ n = toInteger(n);
+ return function() {
+ if (--n > 0) {
+ result = func.apply(this, arguments);
+ }
+ if (n <= 1) {
+ func = undefined;
+ }
+ return result;
+ };
+ }
+ /**
+ * Creates a function that invokes `func` with the `this` binding of `thisArg`
+ * and `partials` prepended to the arguments it receives.
+ *
+ * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,
+ * may be used as a placeholder for partially applied arguments.
+ *
+ * **Note:** Unlike native `Function#bind`, this method doesn't set the "length"
+ * property of bound functions.
+ *
+ * @static
+ * @memberOf _
+ * @since 0.1.0
+ * @category Function
+ * @param {Function} func The function to bind.
+ * @param {*} thisArg The `this` binding of `func`.
+ * @param {...*} [partials] The arguments to be partially applied.
+ * @returns {Function} Returns the new bound function.
+ * @example
+ *
+ * function greet(greeting, punctuation) {
+ * return greeting + ' ' + this.user + punctuation;
+ * }
+ *
+ * var object = { 'user': 'fred' };
+ *
+ * var bound = _.bind(greet, object, 'hi');
+ * bound('!');
+ * // => 'hi fred!'
+ *
+ * // Bound with placeholders.
+ * var bound = _.bind(greet, object, _, '!');
+ * bound('hi');
+ * // => 'hi fred!'
+ */ var bind = baseRest(function(func, thisArg, partials) {
+ var bitmask = WRAP_BIND_FLAG;
+ if (partials.length) {
+ var holders = replaceHolders(partials, getHolder(bind));
+ bitmask |= WRAP_PARTIAL_FLAG;
+ }
+ return createWrap(func, bitmask, thisArg, partials, holders);
+ });
+ /**
+ * Creates a function that invokes the method at `object[key]` with `partials`
+ * prepended to the arguments it receives.
+ *
+ * This method differs from `_.bind` by allowing bound functions to reference
+ * methods that may be redefined or don't yet exist. See
+ * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern)
+ * for more details.
+ *
+ * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic
+ * builds, may be used as a placeholder for partially applied arguments.
+ *
+ * @static
+ * @memberOf _
+ * @since 0.10.0
+ * @category Function
+ * @param {Object} object The object to invoke the method on.
+ * @param {string} key The key of the method.
+ * @param {...*} [partials] The arguments to be partially applied.
+ * @returns {Function} Returns the new bound function.
+ * @example
+ *
+ * var object = {
+ * 'user': 'fred',
+ * 'greet': function(greeting, punctuation) {
+ * return greeting + ' ' + this.user + punctuation;
+ * }
+ * };
+ *
+ * var bound = _.bindKey(object, 'greet', 'hi');
+ * bound('!');
+ * // => 'hi fred!'
+ *
+ * object.greet = function(greeting, punctuation) {
+ * return greeting + 'ya ' + this.user + punctuation;
+ * };
+ *
+ * bound('!');
+ * // => 'hiya fred!'
+ *
+ * // Bound with placeholders.
+ * var bound = _.bindKey(object, 'greet', _, '!');
+ * bound('hi');
+ * // => 'hiya fred!'
+ */ var bindKey = baseRest(function(object, key, partials) {
+ var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG;
+ if (partials.length) {
+ var holders = replaceHolders(partials, getHolder(bindKey));
+ bitmask |= WRAP_PARTIAL_FLAG;
+ }
+ return createWrap(key, bitmask, object, partials, holders);
+ });
+ /**
+ * Creates a function that accepts arguments of `func` and either invokes
+ * `func` returning its result, if at least `arity` number of arguments have
+ * been provided, or returns a function that accepts the remaining `func`
+ * arguments, and so on. The arity of `func` may be specified if `func.length`
+ * is not sufficient.
+ *
+ * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds,
+ * may be used as a placeholder for provided arguments.
+ *
+ * **Note:** This method doesn't set the "length" property of curried functions.
+ *
+ * @static
+ * @memberOf _
+ * @since 2.0.0
+ * @category Function
+ * @param {Function} func The function to curry.
+ * @param {number} [arity=func.length] The arity of `func`.
+ * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
+ * @returns {Function} Returns the new curried function.
+ * @example
+ *
+ * var abc = function(a, b, c) {
+ * return [a, b, c];
+ * };
+ *
+ * var curried = _.curry(abc);
+ *
+ * curried(1)(2)(3);
+ * // => [1, 2, 3]
+ *
+ * curried(1, 2)(3);
+ * // => [1, 2, 3]
+ *
+ * curried(1, 2, 3);
+ * // => [1, 2, 3]
+ *
+ * // Curried with placeholders.
+ * curried(1)(_, 3)(2);
+ * // => [1, 2, 3]
+ */ function curry(func, arity, guard) {
+ arity = guard ? undefined : arity;
+ var result = createWrap(
+ func,
+ WRAP_CURRY_FLAG,
+ undefined,
+ undefined,
+ undefined,
+ undefined,
+ undefined,
+ arity
+ );
+ result.placeholder = curry.placeholder;
+ return result;
+ }
+ /**
+ * This method is like `_.curry` except that arguments are applied to `func`
+ * in the manner of `_.partialRight` instead of `_.partial`.
+ *
+ * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic
+ * builds, may be used as a placeholder for provided arguments.
+ *
+ * **Note:** This method doesn't set the "length" property of curried functions.
+ *
+ * @static
+ * @memberOf _
+ * @since 3.0.0
+ * @category Function
+ * @param {Function} func The function to curry.
+ * @param {number} [arity=func.length] The arity of `func`.
+ * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
+ * @returns {Function} Returns the new curried function.
+ * @example
+ *
+ * var abc = function(a, b, c) {
+ * return [a, b, c];
+ * };
+ *
+ * var curried = _.curryRight(abc);
+ *
+ * curried(3)(2)(1);
+ * // => [1, 2, 3]
+ *
+ * curried(2, 3)(1);
+ * // => [1, 2, 3]
+ *
+ * curried(1, 2, 3);
+ * // => [1, 2, 3]
+ *
+ * // Curried with placeholders.
+ * curried(3)(1, _)(2);
+ * // => [1, 2, 3]
+ */ function curryRight(func, arity, guard) {
+ arity = guard ? undefined : arity;
+ var result = createWrap(
+ func,
+ WRAP_CURRY_RIGHT_FLAG,
+ undefined,
+ undefined,
+ undefined,
+ undefined,
+ undefined,
+ arity
+ );
+ result.placeholder = curryRight.placeholder;
+ return result;
+ }
+ /**
+ * Creates a debounced function that delays invoking `func` until after `wait`
+ * milliseconds have elapsed since the last time the debounced function was
+ * invoked. The debounced function comes with a `cancel` method to cancel
+ * delayed `func` invocations and a `flush` method to immediately invoke them.
+ * Provide `options` to indicate whether `func` should be invoked on the
+ * leading and/or trailing edge of the `wait` timeout. The `func` is invoked
+ * with the last arguments provided to the debounced function. Subsequent
+ * calls to the debounced function return the result of the last `func`
+ * invocation.
+ *
+ * **Note:** If `leading` and `trailing` options are `true`, `func` is
+ * invoked on the trailing edge of the timeout only if the debounced function
+ * is invoked more than once during the `wait` timeout.
+ *
+ * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
+ * until to the next tick, similar to `setTimeout` with a timeout of `0`.
+ *
+ * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
+ * for details over the differences between `_.debounce` and `_.throttle`.
+ *
+ * @static
+ * @memberOf _
+ * @since 0.1.0
+ * @category Function
+ * @param {Function} func The function to debounce.
+ * @param {number} [wait=0] The number of milliseconds to delay.
+ * @param {Object} [options={}] The options object.
+ * @param {boolean} [options.leading=false]
+ * Specify invoking on the leading edge of the timeout.
+ * @param {number} [options.maxWait]
+ * The maximum time `func` is allowed to be delayed before it's invoked.
+ * @param {boolean} [options.trailing=true]
+ * Specify invoking on the trailing edge of the timeout.
+ * @returns {Function} Returns the new debounced function.
+ * @example
+ *
+ * // Avoid costly calculations while the window size is in flux.
+ * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
+ *
+ * // Invoke `sendMail` when clicked, debouncing subsequent calls.
+ * jQuery(element).on('click', _.debounce(sendMail, 300, {
+ * 'leading': true,
+ * 'trailing': false
+ * }));
+ *
+ * // Ensure `batchLog` is invoked once after 1 second of debounced calls.
+ * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
+ * var source = new EventSource('/stream');
+ * jQuery(source).on('message', debounced);
+ *
+ * // Cancel the trailing debounced invocation.
+ * jQuery(window).on('popstate', debounced.cancel);
+ */ function debounce(func, wait, options) {
+ var lastArgs,
+ lastThis,
+ maxWait,
+ result,
+ timerId,
+ lastCallTime,
+ lastInvokeTime = 0,
+ leading = false,
+ maxing = false,
+ trailing = true;
+ if (typeof func != "function") {
+ throw new TypeError(FUNC_ERROR_TEXT);
+ }
+ wait = toNumber(wait) || 0;
+ if (isObject(options)) {
+ leading = !!options.leading;
+ maxing = "maxWait" in options;
+ maxWait = maxing
+ ? nativeMax(toNumber(options.maxWait) || 0, wait)
+ : maxWait;
+ trailing =
+ "trailing" in options ? !!options.trailing : trailing;
+ }
+ function invokeFunc(time) {
+ var args = lastArgs,
+ thisArg = lastThis;
+ lastArgs = lastThis = undefined;
+ lastInvokeTime = time;
+ result = func.apply(thisArg, args);
+ return result;
+ }
+ function leadingEdge(time) {
+ // Reset any `maxWait` timer.
+ lastInvokeTime = time; // Start the timer for the trailing edge.
+ timerId = setTimeout(timerExpired, wait); // Invoke the leading edge.
+ return leading ? invokeFunc(time) : result;
+ }
+ function remainingWait(time) {
+ var timeSinceLastCall = time - lastCallTime,
+ timeSinceLastInvoke = time - lastInvokeTime,
+ timeWaiting = wait - timeSinceLastCall;
+ return maxing
+ ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)
+ : timeWaiting;
+ }
+ function shouldInvoke(time) {
+ var timeSinceLastCall = time - lastCallTime,
+ timeSinceLastInvoke = time - lastInvokeTime; // Either this is the first call, activity has stopped and we're at the
+ // trailing edge, the system time has gone backwards and we're treating
+ // it as the trailing edge, or we've hit the `maxWait` limit.
+ return (
+ lastCallTime === undefined ||
+ timeSinceLastCall >= wait ||
+ timeSinceLastCall < 0 ||
+ (maxing && timeSinceLastInvoke >= maxWait)
+ );
+ }
+ function timerExpired() {
+ var time = now();
+ if (shouldInvoke(time)) {
+ return trailingEdge(time);
+ } // Restart the timer.
+ timerId = setTimeout(timerExpired, remainingWait(time));
+ }
+ function trailingEdge(time) {
+ timerId = undefined; // Only invoke if we have `lastArgs` which means `func` has been
+ // debounced at least once.
+ if (trailing && lastArgs) {
+ return invokeFunc(time);
+ }
+ lastArgs = lastThis = undefined;
+ return result;
+ }
+ function cancel() {
+ if (timerId !== undefined) {
+ clearTimeout(timerId);
+ }
+ lastInvokeTime = 0;
+ lastArgs = lastCallTime = lastThis = timerId = undefined;
+ }
+ function flush() {
+ return timerId === undefined ? result : trailingEdge(now());
+ }
+ function debounced() {
+ var time = now(),
+ isInvoking = shouldInvoke(time);
+ lastArgs = arguments;
+ lastThis = this;
+ lastCallTime = time;
+ if (isInvoking) {
+ if (timerId === undefined) {
+ return leadingEdge(lastCallTime);
+ }
+ if (maxing) {
+ // Handle invocations in a tight loop.
+ timerId = setTimeout(timerExpired, wait);
+ return invokeFunc(lastCallTime);
+ }
+ }
+ if (timerId === undefined) {
+ timerId = setTimeout(timerExpired, wait);
+ }
+ return result;
+ }
+ debounced.cancel = cancel;
+ debounced.flush = flush;
+ return debounced;
+ }
+ /**
+ * Defers invoking the `func` until the current call stack has cleared. Any
+ * additional arguments are provided to `func` when it's invoked.
+ *
+ * @static
+ * @memberOf _
+ * @since 0.1.0
+ * @category Function
+ * @param {Function} func The function to defer.
+ * @param {...*} [args] The arguments to invoke `func` with.
+ * @returns {number} Returns the timer id.
+ * @example
+ *
+ * _.defer(function(text) {
+ * console.log(text);
+ * }, 'deferred');
+ * // => Logs 'deferred' after one millisecond.
+ */ var defer = baseRest(function(func, args) {
+ return baseDelay(func, 1, args);
+ });
+ /**
+ * Invokes `func` after `wait` milliseconds. Any additional arguments are
+ * provided to `func` when it's invoked.
+ *
+ * @static
+ * @memberOf _
+ * @since 0.1.0
+ * @category Function
+ * @param {Function} func The function to delay.
+ * @param {number} wait The number of milliseconds to delay invocation.
+ * @param {...*} [args] The arguments to invoke `func` with.
+ * @returns {number} Returns the timer id.
+ * @example
+ *
+ * _.delay(function(text) {
+ * console.log(text);
+ * }, 1000, 'later');
+ * // => Logs 'later' after one second.
+ */ var delay = baseRest(function(func, wait, args) {
+ return baseDelay(func, toNumber(wait) || 0, args);
+ });
+ /**
+ * Creates a function that invokes `func` with arguments reversed.
+ *
+ * @static
+ * @memberOf _
+ * @since 4.0.0
+ * @category Function
+ * @param {Function} func The function to flip arguments for.
+ * @returns {Function} Returns the new flipped function.
+ * @example
+ *
+ * var flipped = _.flip(function() {
+ * return _.toArray(arguments);
+ * });
+ *
+ * flipped('a', 'b', 'c', 'd');
+ * // => ['d', 'c', 'b', 'a']
+ */ function flip(func) {
+ return createWrap(func, WRAP_FLIP_FLAG);
+ }
+ /**
+ * Creates a function that memoizes the result of `func`. If `resolver` is
+ * provided, it determines the cache key for storing the result based on the
+ * arguments provided to the memoized function. By default, the first argument
+ * provided to the memoized function is used as the map cache key. The `func`
+ * is invoked with the `this` binding of the memoized function.
+ *
+ * **Note:** The cache is exposed as the `cache` property on the memoized
+ * function. Its creation may be customized by replacing the `_.memoize.Cache`
+ * constructor with one whose instances implement the
+ * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
+ * method interface of `clear`, `delete`, `get`, `has`, and `set`.
+ *
+ * @static
+ * @memberOf _
+ * @since 0.1.0
+ * @category Function
+ * @param {Function} func The function to have its output memoized.
+ * @param {Function} [resolver] The function to resolve the cache key.
+ * @returns {Function} Returns the new memoized function.
+ * @example
+ *
+ * var object = { 'a': 1, 'b': 2 };
+ * var other = { 'c': 3, 'd': 4 };
+ *
+ * var values = _.memoize(_.values);
+ * values(object);
+ * // => [1, 2]
+ *
+ * values(other);
+ * // => [3, 4]
+ *
+ * object.a = 2;
+ * values(object);
+ * // => [1, 2]
+ *
+ * // Modify the result cache.
+ * values.cache.set(object, ['a', 'b']);
+ * values(object);
+ * // => ['a', 'b']
+ *
+ * // Replace `_.memoize.Cache`.
+ * _.memoize.Cache = WeakMap;
+ */ function memoize(func, resolver) {
+ if (
+ typeof func != "function" ||
+ (resolver != null && typeof resolver != "function")
+ ) {
+ throw new TypeError(FUNC_ERROR_TEXT);
+ }
+ var memoized = function memoized() {
+ var args = arguments,
+ key = resolver ? resolver.apply(this, args) : args[0],
+ cache = memoized.cache;
+ if (cache.has(key)) {
+ return cache.get(key);
+ }
+ var result = func.apply(this, args);
+ memoized.cache = cache.set(key, result) || cache;
+ return result;
+ };
+ memoized.cache = new (memoize.Cache || MapCache)();
+ return memoized;
+ } // Expose `MapCache`.
+ memoize.Cache = MapCache;
+ /**
+ * Creates a function that negates the result of the predicate `func`. The
+ * `func` predicate is invoked with the `this` binding and arguments of the
+ * created function.
+ *
+ * @static
+ * @memberOf _
+ * @since 3.0.0
+ * @category Function
+ * @param {Function} predicate The predicate to negate.
+ * @returns {Function} Returns the new negated function.
+ * @example
+ *
+ * function isEven(n) {
+ * return n % 2 == 0;
+ * }
+ *
+ * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));
+ * // => [1, 3, 5]
+ */ function negate(predicate) {
+ if (typeof predicate != "function") {
+ throw new TypeError(FUNC_ERROR_TEXT);
+ }
+ return function() {
+ var args = arguments;
+ switch (args.length) {
+ case 0:
+ return !predicate.call(this);
+ case 1:
+ return !predicate.call(this, args[0]);
+ case 2:
+ return !predicate.call(this, args[0], args[1]);
+ case 3:
+ return !predicate.call(this, args[0], args[1], args[2]);
+ }
+ return !predicate.apply(this, args);
+ };
+ }
+ /**
+ * Creates a function that is restricted to invoking `func` once. Repeat calls
+ * to the function return the value of the first invocation. The `func` is
+ * invoked with the `this` binding and arguments of the created function.
+ *
+ * @static
+ * @memberOf _
+ * @since 0.1.0
+ * @category Function
+ * @param {Function} func The function to restrict.
+ * @returns {Function} Returns the new restricted function.
+ * @example
+ *
+ * var initialize = _.once(createApplication);
+ * initialize();
+ * initialize();
+ * // => `createApplication` is invoked once
+ */ function once(func) {
+ return before(2, func);
+ }
+ /**
+ * Creates a function that invokes `func` with its arguments transformed.
+ *
+ * @static
+ * @since 4.0.0
+ * @memberOf _
+ * @category Function
+ * @param {Function} func The function to wrap.
+ * @param {...(Function|Function[])} [transforms=[_.identity]]
+ * The argument transforms.
+ * @returns {Function} Returns the new function.
+ * @example
+ *
+ * function doubled(n) {
+ * return n * 2;
+ * }
+ *
+ * function square(n) {
+ * return n * n;
+ * }
+ *
+ * var func = _.overArgs(function(x, y) {
+ * return [x, y];
+ * }, [square, doubled]);
+ *
+ * func(9, 3);
+ * // => [81, 6]
+ *
+ * func(10, 5);
+ * // => [100, 10]
+ */ var overArgs = castRest(function(func, transforms) {
+ transforms =
+ transforms.length == 1 && isArray(transforms[0])
+ ? arrayMap(transforms[0], baseUnary(getIteratee()))
+ : arrayMap(
+ baseFlatten(transforms, 1),
+ baseUnary(getIteratee())
+ );
+ var funcsLength = transforms.length;
+ return baseRest(function(args) {
+ var index = -1,
+ length = nativeMin(args.length, funcsLength);
+ while (++index < length) {
+ args[index] = transforms[index].call(this, args[index]);
+ }
+ return apply(func, this, args);
+ });
+ });
+ /**
+ * Creates a function that invokes `func` with `partials` prepended to the
+ * arguments it receives. This method is like `_.bind` except it does **not**
+ * alter the `this` binding.
+ *
+ * The `_.partial.placeholder` value, which defaults to `_` in monolithic
+ * builds, may be used as a placeholder for partially applied arguments.
+ *
+ * **Note:** This method doesn't set the "length" property of partially
+ * applied functions.
+ *
+ * @static
+ * @memberOf _
+ * @since 0.2.0
+ * @category Function
+ * @param {Function} func The function to partially apply arguments to.
+ * @param {...*} [partials] The arguments to be partially applied.
+ * @returns {Function} Returns the new partially applied function.
+ * @example
+ *
+ * function greet(greeting, name) {
+ * return greeting + ' ' + name;
+ * }
+ *
+ * var sayHelloTo = _.partial(greet, 'hello');
+ * sayHelloTo('fred');
+ * // => 'hello fred'
+ *
+ * // Partially applied with placeholders.
+ * var greetFred = _.partial(greet, _, 'fred');
+ * greetFred('hi');
+ * // => 'hi fred'
+ */ var partial = baseRest(function(func, partials) {
+ var holders = replaceHolders(partials, getHolder(partial));
+ return createWrap(
+ func,
+ WRAP_PARTIAL_FLAG,
+ undefined,
+ partials,
+ holders
+ );
+ });
+ /**
+ * This method is like `_.partial` except that partially applied arguments
+ * are appended to the arguments it receives.
+ *
+ * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic
+ * builds, may be used as a placeholder for partially applied arguments.
+ *
+ * **Note:** This method doesn't set the "length" property of partially
+ * applied functions.
+ *
+ * @static
+ * @memberOf _
+ * @since 1.0.0
+ * @category Function
+ * @param {Function} func The function to partially apply arguments to.
+ * @param {...*} [partials] The arguments to be partially applied.
+ * @returns {Function} Returns the new partially applied function.
+ * @example
+ *
+ * function greet(greeting, name) {
+ * return greeting + ' ' + name;
+ * }
+ *
+ * var greetFred = _.partialRight(greet, 'fred');
+ * greetFred('hi');
+ * // => 'hi fred'
+ *
+ * // Partially applied with placeholders.
+ * var sayHelloTo = _.partialRight(greet, 'hello', _);
+ * sayHelloTo('fred');
+ * // => 'hello fred'
+ */ var partialRight = baseRest(function(func, partials) {
+ var holders = replaceHolders(partials, getHolder(partialRight));
+ return createWrap(
+ func,
+ WRAP_PARTIAL_RIGHT_FLAG,
+ undefined,
+ partials,
+ holders
+ );
+ });
+ /**
+ * Creates a function that invokes `func` with arguments arranged according
+ * to the specified `indexes` where the argument value at the first index is
+ * provided as the first argument, the argument value at the second index is
+ * provided as the second argument, and so on.
+ *
+ * @static
+ * @memberOf _
+ * @since 3.0.0
+ * @category Function
+ * @param {Function} func The function to rearrange arguments for.
+ * @param {...(number|number[])} indexes The arranged argument indexes.
+ * @returns {Function} Returns the new function.
+ * @example
+ *
+ * var rearged = _.rearg(function(a, b, c) {
+ * return [a, b, c];
+ * }, [2, 0, 1]);
+ *
+ * rearged('b', 'c', 'a')
+ * // => ['a', 'b', 'c']
+ */ var rearg = flatRest(function(func, indexes) {
+ return createWrap(
+ func,
+ WRAP_REARG_FLAG,
+ undefined,
+ undefined,
+ undefined,
+ indexes
+ );
+ });
+ /**
+ * Creates a function that invokes `func` with the `this` binding of the
+ * created function and arguments from `start` and beyond provided as
+ * an array.
+ *
+ * **Note:** This method is based on the
+ * [rest parameter](https://mdn.io/rest_parameters).
+ *
+ * @static
+ * @memberOf _
+ * @since 4.0.0
+ * @category Function
+ * @param {Function} func The function to apply a rest parameter to.
+ * @param {number} [start=func.length-1] The start position of the rest parameter.
+ * @returns {Function} Returns the new function.
+ * @example
+ *
+ * var say = _.rest(function(what, names) {
+ * return what + ' ' + _.initial(names).join(', ') +
+ * (_.size(names) > 1 ? ', & ' : '') + _.last(names);
+ * });
+ *
+ * say('hello', 'fred', 'barney', 'pebbles');
+ * // => 'hello fred, barney, & pebbles'
+ */ function rest(func, start) {
+ if (typeof func != "function") {
+ throw new TypeError(FUNC_ERROR_TEXT);
+ }
+ start = start === undefined ? start : toInteger(start);
+ return baseRest(func, start);
+ }
+ /**
+ * Creates a function that invokes `func` with the `this` binding of the
+ * create function and an array of arguments much like
+ * [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply).
+ *
+ * **Note:** This method is based on the
+ * [spread operator](https://mdn.io/spread_operator).
+ *
+ * @static
+ * @memberOf _
+ * @since 3.2.0
+ * @category Function
+ * @param {Function} func The function to spread arguments over.
+ * @param {number} [start=0] The start position of the spread.
+ * @returns {Function} Returns the new function.
+ * @example
+ *
+ * var say = _.spread(function(who, what) {
+ * return who + ' says ' + what;
+ * });
+ *
+ * say(['fred', 'hello']);
+ * // => 'fred says hello'
+ *
+ * var numbers = Promise.all([
+ * Promise.resolve(40),
+ * Promise.resolve(36)
+ * ]);
+ *
+ * numbers.then(_.spread(function(x, y) {
+ * return x + y;
+ * }));
+ * // => a Promise of 76
+ */ function spread(func, start) {
+ if (typeof func != "function") {
+ throw new TypeError(FUNC_ERROR_TEXT);
+ }
+ start = start == null ? 0 : nativeMax(toInteger(start), 0);
+ return baseRest(function(args) {
+ var array = args[start],
+ otherArgs = castSlice(args, 0, start);
+ if (array) {
+ arrayPush(otherArgs, array);
+ }
+ return apply(func, this, otherArgs);
+ });
+ }
+ /**
+ * Creates a throttled function that only invokes `func` at most once per
+ * every `wait` milliseconds. The throttled function comes with a `cancel`
+ * method to cancel delayed `func` invocations and a `flush` method to
+ * immediately invoke them. Provide `options` to indicate whether `func`
+ * should be invoked on the leading and/or trailing edge of the `wait`
+ * timeout. The `func` is invoked with the last arguments provided to the
+ * throttled function. Subsequent calls to the throttled function return the
+ * result of the last `func` invocation.
+ *
+ * **Note:** If `leading` and `trailing` options are `true`, `func` is
+ * invoked on the trailing edge of the timeout only if the throttled function
+ * is invoked more than once during the `wait` timeout.
+ *
+ * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
+ * until to the next tick, similar to `setTimeout` with a timeout of `0`.
+ *
+ * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
+ * for details over the differences between `_.throttle` and `_.debounce`.
+ *
+ * @static
+ * @memberOf _
+ * @since 0.1.0
+ * @category Function
+ * @param {Function} func The function to throttle.
+ * @param {number} [wait=0] The number of milliseconds to throttle invocations to.
+ * @param {Object} [options={}] The options object.
+ * @param {boolean} [options.leading=true]
+ * Specify invoking on the leading edge of the timeout.
+ * @param {boolean} [options.trailing=true]
+ * Specify invoking on the trailing edge of the timeout.
+ * @returns {Function} Returns the new throttled function.
+ * @example
+ *
+ * // Avoid excessively updating the position while scrolling.
+ * jQuery(window).on('scroll', _.throttle(updatePosition, 100));
+ *
+ * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.
+ * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });
+ * jQuery(element).on('click', throttled);
+ *
+ * // Cancel the trailing throttled invocation.
+ * jQuery(window).on('popstate', throttled.cancel);
+ */ function throttle(func, wait, options) {
+ var leading = true,
+ trailing = true;
+ if (typeof func != "function") {
+ throw new TypeError(FUNC_ERROR_TEXT);
+ }
+ if (isObject(options)) {
+ leading = "leading" in options ? !!options.leading : leading;
+ trailing =
+ "trailing" in options ? !!options.trailing : trailing;
+ }
+ return debounce(func, wait, {
+ leading: leading,
+ maxWait: wait,
+ trailing: trailing
+ });
+ }
+ /**
+ * Creates a function that accepts up to one argument, ignoring any
+ * additional arguments.
+ *
+ * @static
+ * @memberOf _
+ * @since 4.0.0
+ * @category Function
+ * @param {Function} func The function to cap arguments for.
+ * @returns {Function} Returns the new capped function.
+ * @example
+ *
+ * _.map(['6', '8', '10'], _.unary(parseInt));
+ * // => [6, 8, 10]
+ */ function unary(func) {
+ return ary(func, 1);
+ }
+ /**
+ * Creates a function that provides `value` to `wrapper` as its first
+ * argument. Any additional arguments provided to the function are appended
+ * to those provided to the `wrapper`. The wrapper is invoked with the `this`
+ * binding of the created function.
+ *
+ * @static
+ * @memberOf _
+ * @since 0.1.0
+ * @category Function
+ * @param {*} value The value to wrap.
+ * @param {Function} [wrapper=identity] The wrapper function.
+ * @returns {Function} Returns the new function.
+ * @example
+ *
+ * var p = _.wrap(_.escape, function(func, text) {
+ * return '' + func(text) + '
';
+ * });
+ *
+ * p('fred, barney, & pebbles');
+ * // => 'fred, barney, & pebbles
'
+ */ function wrap(value, wrapper) {
+ return partial(castFunction(wrapper), value);
+ }
+ /*------------------------------------------------------------------------*/ /**
+ * Casts `value` as an array if it's not one.
+ *
+ * @static
+ * @memberOf _
+ * @since 4.4.0
+ * @category Lang
+ * @param {*} value The value to inspect.
+ * @returns {Array} Returns the cast array.
+ * @example
+ *
+ * _.castArray(1);
+ * // => [1]
+ *
+ * _.castArray({ 'a': 1 });
+ * // => [{ 'a': 1 }]
+ *
+ * _.castArray('abc');
+ * // => ['abc']
+ *
+ * _.castArray(null);
+ * // => [null]
+ *
+ * _.castArray(undefined);
+ * // => [undefined]
+ *
+ * _.castArray();
+ * // => []
+ *
+ * var array = [1, 2, 3];
+ * console.log(_.castArray(array) === array);
+ * // => true
+ */ function castArray() {
+ if (!arguments.length) {
+ return [];
+ }
+ var value = arguments[0];
+ return isArray(value) ? value : [value];
+ }
+ /**
+ * Creates a shallow clone of `value`.
+ *
+ * **Note:** This method is loosely based on the
+ * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)
+ * and supports cloning arrays, array buffers, booleans, date objects, maps,
+ * numbers, `Object` objects, regexes, sets, strings, symbols, and typed
+ * arrays. The own enumerable properties of `arguments` objects are cloned
+ * as plain objects. An empty object is returned for uncloneable values such
+ * as error objects, functions, DOM nodes, and WeakMaps.
+ *
+ * @static
+ * @memberOf _
+ * @since 0.1.0
+ * @category Lang
+ * @param {*} value The value to clone.
+ * @returns {*} Returns the cloned value.
+ * @see _.cloneDeep
+ * @example
+ *
+ * var objects = [{ 'a': 1 }, { 'b': 2 }];
+ *
+ * var shallow = _.clone(objects);
+ * console.log(shallow[0] === objects[0]);
+ * // => true
+ */ function clone(value) {
+ return baseClone(value, CLONE_SYMBOLS_FLAG);
+ }
+ /**
+ * This method is like `_.clone` except that it accepts `customizer` which
+ * is invoked to produce the cloned value. If `customizer` returns `undefined`,
+ * cloning is handled by the method instead. The `customizer` is invoked with
+ * up to four arguments; (value [, index|key, object, stack]).
+ *
+ * @static
+ * @memberOf _
+ * @since 4.0.0
+ * @category Lang
+ * @param {*} value The value to clone.
+ * @param {Function} [customizer] The function to customize cloning.
+ * @returns {*} Returns the cloned value.
+ * @see _.cloneDeepWith
+ * @example
+ *
+ * function customizer(value) {
+ * if (_.isElement(value)) {
+ * return value.cloneNode(false);
+ * }
+ * }
+ *
+ * var el = _.cloneWith(document.body, customizer);
+ *
+ * console.log(el === document.body);
+ * // => false
+ * console.log(el.nodeName);
+ * // => 'BODY'
+ * console.log(el.childNodes.length);
+ * // => 0
+ */ function cloneWith(value, customizer) {
+ customizer =
+ typeof customizer == "function" ? customizer : undefined;
+ return baseClone(value, CLONE_SYMBOLS_FLAG, customizer);
+ }
+ /**
+ * This method is like `_.clone` except that it recursively clones `value`.
+ *
+ * @static
+ * @memberOf _
+ * @since 1.0.0
+ * @category Lang
+ * @param {*} value The value to recursively clone.
+ * @returns {*} Returns the deep cloned value.
+ * @see _.clone
+ * @example
+ *
+ * var objects = [{ 'a': 1 }, { 'b': 2 }];
+ *
+ * var deep = _.cloneDeep(objects);
+ * console.log(deep[0] === objects[0]);
+ * // => false
+ */ function cloneDeep(value) {
+ return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
+ }
+ /**
+ * This method is like `_.cloneWith` except that it recursively clones `value`.
+ *
+ * @static
+ * @memberOf _
+ * @since 4.0.0
+ * @category Lang
+ * @param {*} value The value to recursively clone.
+ * @param {Function} [customizer] The function to customize cloning.
+ * @returns {*} Returns the deep cloned value.
+ * @see _.cloneWith
+ * @example
+ *
+ * function customizer(value) {
+ * if (_.isElement(value)) {
+ * return value.cloneNode(true);
+ * }
+ * }
+ *
+ * var el = _.cloneDeepWith(document.body, customizer);
+ *
+ * console.log(el === document.body);
+ * // => false
+ * console.log(el.nodeName);
+ * // => 'BODY'
+ * console.log(el.childNodes.length);
+ * // => 20
+ */ function cloneDeepWith(value, customizer) {
+ customizer =
+ typeof customizer == "function" ? customizer : undefined;
+ return baseClone(
+ value,
+ CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG,
+ customizer
+ );
+ }
+ /**
+ * Checks if `object` conforms to `source` by invoking the predicate
+ * properties of `source` with the corresponding property values of `object`.
+ *
+ * **Note:** This method is equivalent to `_.conforms` when `source` is
+ * partially applied.
+ *
+ * @static
+ * @memberOf _
+ * @since 4.14.0
+ * @category Lang
+ * @param {Object} object The object to inspect.
+ * @param {Object} source The object of property predicates to conform to.
+ * @returns {boolean} Returns `true` if `object` conforms, else `false`.
+ * @example
+ *
+ * var object = { 'a': 1, 'b': 2 };
+ *
+ * _.conformsTo(object, { 'b': function(n) { return n > 1; } });
+ * // => true
+ *
+ * _.conformsTo(object, { 'b': function(n) { return n > 2; } });
+ * // => false
+ */ function conformsTo(object, source) {
+ return (
+ source == null || baseConformsTo(object, source, keys(source))
+ );
+ }
+ /**
+ * Performs a
+ * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
+ * comparison between two values to determine if they are equivalent.
+ *
+ * @static
+ * @memberOf _
+ * @since 4.0.0
+ * @category Lang
+ * @param {*} value The value to compare.
+ * @param {*} other The other value to compare.
+ * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
+ * @example
+ *
+ * var object = { 'a': 1 };
+ * var other = { 'a': 1 };
+ *
+ * _.eq(object, object);
+ * // => true
+ *
+ * _.eq(object, other);
+ * // => false
+ *
+ * _.eq('a', 'a');
+ * // => true
+ *
+ * _.eq('a', Object('a'));
+ * // => false
+ *
+ * _.eq(NaN, NaN);
+ * // => true
+ */ function eq(value, other) {
+ return value === other || (value !== value && other !== other);
+ }
+ /**
+ * Checks if `value` is greater than `other`.
+ *
+ * @static
+ * @memberOf _
+ * @since 3.9.0
+ * @category Lang
+ * @param {*} value The value to compare.
+ * @param {*} other The other value to compare.
+ * @returns {boolean} Returns `true` if `value` is greater than `other`,
+ * else `false`.
+ * @see _.lt
+ * @example
+ *
+ * _.gt(3, 1);
+ * // => true
+ *
+ * _.gt(3, 3);
+ * // => false
+ *
+ * _.gt(1, 3);
+ * // => false
+ */ var gt = createRelationalOperation(baseGt);
+ /**
+ * Checks if `value` is greater than or equal to `other`.
+ *
+ * @static
+ * @memberOf _
+ * @since 3.9.0
+ * @category Lang
+ * @param {*} value The value to compare.
+ * @param {*} other The other value to compare.
+ * @returns {boolean} Returns `true` if `value` is greater than or equal to
+ * `other`, else `false`.
+ * @see _.lte
+ * @example
+ *
+ * _.gte(3, 1);
+ * // => true
+ *
+ * _.gte(3, 3);
+ * // => true
+ *
+ * _.gte(1, 3);
+ * // => false
+ */ var gte = createRelationalOperation(function(value, other) {
+ return value >= other;
+ });
+ /**
+ * Checks if `value` is likely an `arguments` object.
+ *
+ * @static
+ * @memberOf _
+ * @since 0.1.0
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is an `arguments` object,
+ * else `false`.
+ * @example
+ *
+ * _.isArguments(function() { return arguments; }());
+ * // => true
+ *
+ * _.isArguments([1, 2, 3]);
+ * // => false
+ */ var isArguments = baseIsArguments(
+ (function() {
+ return arguments;
+ })()
+ )
+ ? baseIsArguments
+ : function(value) {
+ return (
+ isObjectLike(value) &&
+ hasOwnProperty.call(value, "callee") &&
+ !propertyIsEnumerable.call(value, "callee")
+ );
+ };
+ /**
+ * Checks if `value` is classified as an `Array` object.
+ *
+ * @static
+ * @memberOf _
+ * @since 0.1.0
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is an array, else `false`.
+ * @example
+ *
+ * _.isArray([1, 2, 3]);
+ * // => true
+ *
+ * _.isArray(document.body.children);
+ * // => false
+ *
+ * _.isArray('abc');
+ * // => false
+ *
+ * _.isArray(_.noop);
+ * // => false
+ */ var isArray = Array.isArray;
+ /**
+ * Checks if `value` is classified as an `ArrayBuffer` object.
+ *
+ * @static
+ * @memberOf _
+ * @since 4.3.0
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
+ * @example
+ *
+ * _.isArrayBuffer(new ArrayBuffer(2));
+ * // => true
+ *
+ * _.isArrayBuffer(new Array(2));
+ * // => false
+ */ var isArrayBuffer = nodeIsArrayBuffer
+ ? baseUnary(nodeIsArrayBuffer)
+ : baseIsArrayBuffer;
+ /**
+ * Checks if `value` is array-like. A value is considered array-like if it's
+ * not a function and has a `value.length` that's an integer greater than or
+ * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
+ *
+ * @static
+ * @memberOf _
+ * @since 4.0.0
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
+ * @example
+ *
+ * _.isArrayLike([1, 2, 3]);
+ * // => true
+ *
+ * _.isArrayLike(document.body.children);
+ * // => true
+ *
+ * _.isArrayLike('abc');
+ * // => true
+ *
+ * _.isArrayLike(_.noop);
+ * // => false
+ */ function isArrayLike(value) {
+ return (
+ value != null && isLength(value.length) && !isFunction(value)
+ );
+ }
+ /**
+ * This method is like `_.isArrayLike` except that it also checks if `value`
+ * is an object.
+ *
+ * @static
+ * @memberOf _
+ * @since 4.0.0
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is an array-like object,
+ * else `false`.
+ * @example
+ *
+ * _.isArrayLikeObject([1, 2, 3]);
+ * // => true
+ *
+ * _.isArrayLikeObject(document.body.children);
+ * // => true
+ *
+ * _.isArrayLikeObject('abc');
+ * // => false
+ *
+ * _.isArrayLikeObject(_.noop);
+ * // => false
+ */ function isArrayLikeObject(value) {
+ return isObjectLike(value) && isArrayLike(value);
+ }
+ /**
+ * Checks if `value` is classified as a boolean primitive or object.
+ *
+ * @static
+ * @memberOf _
+ * @since 0.1.0
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a boolean, else `false`.
+ * @example
+ *
+ * _.isBoolean(false);
+ * // => true
+ *
+ * _.isBoolean(null);
+ * // => false
+ */ function isBoolean(value) {
+ return (
+ value === true ||
+ value === false ||
+ (isObjectLike(value) && baseGetTag(value) == boolTag)
+ );
+ }
+ /**
+ * Checks if `value` is a buffer.
+ *
+ * @static
+ * @memberOf _
+ * @since 4.3.0
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
+ * @example
+ *
+ * _.isBuffer(new Buffer(2));
+ * // => true
+ *
+ * _.isBuffer(new Uint8Array(2));
+ * // => false
+ */ var isBuffer = nativeIsBuffer || stubFalse;
+ /**
+ * Checks if `value` is classified as a `Date` object.
+ *
+ * @static
+ * @memberOf _
+ * @since 0.1.0
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
+ * @example
+ *
+ * _.isDate(new Date);
+ * // => true
+ *
+ * _.isDate('Mon April 23 2012');
+ * // => false
+ */ var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate;
+ /**
+ * Checks if `value` is likely a DOM element.
+ *
+ * @static
+ * @memberOf _
+ * @since 0.1.0
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`.
+ * @example
+ *
+ * _.isElement(document.body);
+ * // => true
+ *
+ * _.isElement('');
+ * // => false
+ */ function isElement(value) {
+ return (
+ isObjectLike(value) &&
+ value.nodeType === 1 &&
+ !isPlainObject(value)
+ );
+ }
+ /**
+ * Checks if `value` is an empty object, collection, map, or set.
+ *
+ * Objects are considered empty if they have no own enumerable string keyed
+ * properties.
+ *
+ * Array-like values such as `arguments` objects, arrays, buffers, strings, or
+ * jQuery-like collections are considered empty if they have a `length` of `0`.
+ * Similarly, maps and sets are considered empty if they have a `size` of `0`.
+ *
+ * @static
+ * @memberOf _
+ * @since 0.1.0
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is empty, else `false`.
+ * @example
+ *
+ * _.isEmpty(null);
+ * // => true
+ *
+ * _.isEmpty(true);
+ * // => true
+ *
+ * _.isEmpty(1);
+ * // => true
+ *
+ * _.isEmpty([1, 2, 3]);
+ * // => false
+ *
+ * _.isEmpty({ 'a': 1 });
+ * // => false
+ */ function isEmpty(value) {
+ if (value == null) {
+ return true;
+ }
+ if (
+ isArrayLike(value) &&
+ (isArray(value) ||
+ typeof value == "string" ||
+ typeof value.splice == "function" ||
+ isBuffer(value) ||
+ isTypedArray(value) ||
+ isArguments(value))
+ ) {
+ return !value.length;
+ }
+ var tag = getTag(value);
+ if (tag == mapTag || tag == setTag) {
+ return !value.size;
+ }
+ if (isPrototype(value)) {
+ return !baseKeys(value).length;
+ }
+ for (var key in value) {
+ if (hasOwnProperty.call(value, key)) {
+ return false;
+ }
+ }
+ return true;
+ }
+ /**
+ * Performs a deep comparison between two values to determine if they are
+ * equivalent.
+ *
+ * **Note:** This method supports comparing arrays, array buffers, booleans,
+ * date objects, error objects, maps, numbers, `Object` objects, regexes,
+ * sets, strings, symbols, and typed arrays. `Object` objects are compared
+ * by their own, not inherited, enumerable properties. Functions and DOM
+ * nodes are compared by strict equality, i.e. `===`.
+ *
+ * @static
+ * @memberOf _
+ * @since 0.1.0
+ * @category Lang
+ * @param {*} value The value to compare.
+ * @param {*} other The other value to compare.
+ * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
+ * @example
+ *
+ * var object = { 'a': 1 };
+ * var other = { 'a': 1 };
+ *
+ * _.isEqual(object, other);
+ * // => true
+ *
+ * object === other;
+ * // => false
+ */ function isEqual(value, other) {
+ return baseIsEqual(value, other);
+ }
+ /**
+ * This method is like `_.isEqual` except that it accepts `customizer` which
+ * is invoked to compare values. If `customizer` returns `undefined`, comparisons
+ * are handled by the method instead. The `customizer` is invoked with up to
+ * six arguments: (objValue, othValue [, index|key, object, other, stack]).
+ *
+ * @static
+ * @memberOf _
+ * @since 4.0.0
+ * @category Lang
+ * @param {*} value The value to compare.
+ * @param {*} other The other value to compare.
+ * @param {Function} [customizer] The function to customize comparisons.
+ * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
+ * @example
+ *
+ * function isGreeting(value) {
+ * return /^h(?:i|ello)$/.test(value);
+ * }
+ *
+ * function customizer(objValue, othValue) {
+ * if (isGreeting(objValue) && isGreeting(othValue)) {
+ * return true;
+ * }
+ * }
+ *
+ * var array = ['hello', 'goodbye'];
+ * var other = ['hi', 'goodbye'];
+ *
+ * _.isEqualWith(array, other, customizer);
+ * // => true
+ */ function isEqualWith(value, other, customizer) {
+ customizer =
+ typeof customizer == "function" ? customizer : undefined;
+ var result = customizer ? customizer(value, other) : undefined;
+ return result === undefined
+ ? baseIsEqual(value, other, undefined, customizer)
+ : !!result;
+ }
+ /**
+ * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,
+ * `SyntaxError`, `TypeError`, or `URIError` object.
+ *
+ * @static
+ * @memberOf _
+ * @since 3.0.0
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is an error object, else `false`.
+ * @example
+ *
+ * _.isError(new Error);
+ * // => true
+ *
+ * _.isError(Error);
+ * // => false
+ */ function isError(value) {
+ if (!isObjectLike(value)) {
+ return false;
+ }
+ var tag = baseGetTag(value);
+ return (
+ tag == errorTag ||
+ tag == domExcTag ||
+ (typeof value.message == "string" &&
+ typeof value.name == "string" &&
+ !isPlainObject(value))
+ );
+ }
+ /**
+ * Checks if `value` is a finite primitive number.
+ *
+ * **Note:** This method is based on
+ * [`Number.isFinite`](https://mdn.io/Number/isFinite).
+ *
+ * @static
+ * @memberOf _
+ * @since 0.1.0
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a finite number, else `false`.
+ * @example
+ *
+ * _.isFinite(3);
+ * // => true
+ *
+ * _.isFinite(Number.MIN_VALUE);
+ * // => true
+ *
+ * _.isFinite(Infinity);
+ * // => false
+ *
+ * _.isFinite('3');
+ * // => false
+ */ function isFinite(value) {
+ return typeof value == "number" && nativeIsFinite(value);
+ }
+ /**
+ * Checks if `value` is classified as a `Function` object.
+ *
+ * @static
+ * @memberOf _
+ * @since 0.1.0
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a function, else `false`.
+ * @example
+ *
+ * _.isFunction(_);
+ * // => true
+ *
+ * _.isFunction(/abc/);
+ * // => false
+ */ function isFunction(value) {
+ if (!isObject(value)) {
+ return false;
+ } // The use of `Object#toString` avoids issues with the `typeof` operator
+ // in Safari 9 which returns 'object' for typed arrays and other constructors.
+ var tag = baseGetTag(value);
+ return (
+ tag == funcTag ||
+ tag == genTag ||
+ tag == asyncTag ||
+ tag == proxyTag
+ );
+ }
+ /**
+ * Checks if `value` is an integer.
+ *
+ * **Note:** This method is based on
+ * [`Number.isInteger`](https://mdn.io/Number/isInteger).
+ *
+ * @static
+ * @memberOf _
+ * @since 4.0.0
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is an integer, else `false`.
+ * @example
+ *
+ * _.isInteger(3);
+ * // => true
+ *
+ * _.isInteger(Number.MIN_VALUE);
+ * // => false
+ *
+ * _.isInteger(Infinity);
+ * // => false
+ *
+ * _.isInteger('3');
+ * // => false
+ */ function isInteger(value) {
+ return typeof value == "number" && value == toInteger(value);
+ }
+ /**
+ * Checks if `value` is a valid array-like length.
+ *
+ * **Note:** This method is loosely based on
+ * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
+ *
+ * @static
+ * @memberOf _
+ * @since 4.0.0
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
+ * @example
+ *
+ * _.isLength(3);
+ * // => true
+ *
+ * _.isLength(Number.MIN_VALUE);
+ * // => false
+ *
+ * _.isLength(Infinity);
+ * // => false
+ *
+ * _.isLength('3');
+ * // => false
+ */ function isLength(value) {
+ return (
+ typeof value == "number" &&
+ value > -1 &&
+ value % 1 == 0 &&
+ value <= MAX_SAFE_INTEGER
+ );
+ }
+ /**
+ * Checks if `value` is the
+ * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
+ * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
+ *
+ * @static
+ * @memberOf _
+ * @since 0.1.0
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is an object, else `false`.
+ * @example
+ *
+ * _.isObject({});
+ * // => true
+ *
+ * _.isObject([1, 2, 3]);
+ * // => true
+ *
+ * _.isObject(_.noop);
+ * // => true
+ *
+ * _.isObject(null);
+ * // => false
+ */ function isObject(value) {
+ var type =
+ typeof value === "undefined" ? "undefined" : _typeof(value);
+ return (
+ value != null && (type == "object" || type == "function")
+ );
+ }
+ /**
+ * Checks if `value` is object-like. A value is object-like if it's not `null`
+ * and has a `typeof` result of "object".
+ *
+ * @static
+ * @memberOf _
+ * @since 4.0.0
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
+ * @example
+ *
+ * _.isObjectLike({});
+ * // => true
+ *
+ * _.isObjectLike([1, 2, 3]);
+ * // => true
+ *
+ * _.isObjectLike(_.noop);
+ * // => false
+ *
+ * _.isObjectLike(null);
+ * // => false
+ */ function isObjectLike(value) {
+ return (
+ value != null &&
+ (typeof value === "undefined"
+ ? "undefined"
+ : _typeof(value)) == "object"
+ );
+ }
+ /**
+ * Checks if `value` is classified as a `Map` object.
+ *
+ * @static
+ * @memberOf _
+ * @since 4.3.0
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a map, else `false`.
+ * @example
+ *
+ * _.isMap(new Map);
+ * // => true
+ *
+ * _.isMap(new WeakMap);
+ * // => false
+ */ var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;
+ /**
+ * Performs a partial deep comparison between `object` and `source` to
+ * determine if `object` contains equivalent property values.
+ *
+ * **Note:** This method is equivalent to `_.matches` when `source` is
+ * partially applied.
+ *
+ * Partial comparisons will match empty array and empty object `source`
+ * values against any array or object value, respectively. See `_.isEqual`
+ * for a list of supported value comparisons.
+ *
+ * @static
+ * @memberOf _
+ * @since 3.0.0
+ * @category Lang
+ * @param {Object} object The object to inspect.
+ * @param {Object} source The object of property values to match.
+ * @returns {boolean} Returns `true` if `object` is a match, else `false`.
+ * @example
+ *
+ * var object = { 'a': 1, 'b': 2 };
+ *
+ * _.isMatch(object, { 'b': 2 });
+ * // => true
+ *
+ * _.isMatch(object, { 'b': 1 });
+ * // => false
+ */ function isMatch(object, source) {
+ return (
+ object === source ||
+ baseIsMatch(object, source, getMatchData(source))
+ );
+ }
+ /**
+ * This method is like `_.isMatch` except that it accepts `customizer` which
+ * is invoked to compare values. If `customizer` returns `undefined`, comparisons
+ * are handled by the method instead. The `customizer` is invoked with five
+ * arguments: (objValue, srcValue, index|key, object, source).
+ *
+ * @static
+ * @memberOf _
+ * @since 4.0.0
+ * @category Lang
+ * @param {Object} object The object to inspect.
+ * @param {Object} source The object of property values to match.
+ * @param {Function} [customizer] The function to customize comparisons.
+ * @returns {boolean} Returns `true` if `object` is a match, else `false`.
+ * @example
+ *
+ * function isGreeting(value) {
+ * return /^h(?:i|ello)$/.test(value);
+ * }
+ *
+ * function customizer(objValue, srcValue) {
+ * if (isGreeting(objValue) && isGreeting(srcValue)) {
+ * return true;
+ * }
+ * }
+ *
+ * var object = { 'greeting': 'hello' };
+ * var source = { 'greeting': 'hi' };
+ *
+ * _.isMatchWith(object, source, customizer);
+ * // => true
+ */ function isMatchWith(object, source, customizer) {
+ customizer =
+ typeof customizer == "function" ? customizer : undefined;
+ return baseIsMatch(
+ object,
+ source,
+ getMatchData(source),
+ customizer
+ );
+ }
+ /**
+ * Checks if `value` is `NaN`.
+ *
+ * **Note:** This method is based on
+ * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as
+ * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for
+ * `undefined` and other non-number values.
+ *
+ * @static
+ * @memberOf _
+ * @since 0.1.0
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
+ * @example
+ *
+ * _.isNaN(NaN);
+ * // => true
+ *
+ * _.isNaN(new Number(NaN));
+ * // => true
+ *
+ * isNaN(undefined);
+ * // => true
+ *
+ * _.isNaN(undefined);
+ * // => false
+ */ function isNaN(value) {
+ // An `NaN` primitive is the only value that is not equal to itself.
+ // Perform the `toStringTag` check first to avoid errors with some
+ // ActiveX objects in IE.
+ return isNumber(value) && value != +value;
+ }
+ /**
+ * Checks if `value` is a pristine native function.
+ *
+ * **Note:** This method can't reliably detect native functions in the presence
+ * of the core-js package because core-js circumvents this kind of detection.
+ * Despite multiple requests, the core-js maintainer has made it clear: any
+ * attempt to fix the detection will be obstructed. As a result, we're left
+ * with little choice but to throw an error. Unfortunately, this also affects
+ * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill),
+ * which rely on core-js.
+ *
+ * @static
+ * @memberOf _
+ * @since 3.0.0
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a native function,
+ * else `false`.
+ * @example
+ *
+ * _.isNative(Array.prototype.push);
+ * // => true
+ *
+ * _.isNative(_);
+ * // => false
+ */ function isNative(value) {
+ if (isMaskable(value)) {
+ throw new Error(CORE_ERROR_TEXT);
+ }
+ return baseIsNative(value);
+ }
+ /**
+ * Checks if `value` is `null`.
+ *
+ * @static
+ * @memberOf _
+ * @since 0.1.0
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is `null`, else `false`.
+ * @example
+ *
+ * _.isNull(null);
+ * // => true
+ *
+ * _.isNull(void 0);
+ * // => false
+ */ function isNull(value) {
+ return value === null;
+ }
+ /**
+ * Checks if `value` is `null` or `undefined`.
+ *
+ * @static
+ * @memberOf _
+ * @since 4.0.0
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is nullish, else `false`.
+ * @example
+ *
+ * _.isNil(null);
+ * // => true
+ *
+ * _.isNil(void 0);
+ * // => true
+ *
+ * _.isNil(NaN);
+ * // => false
+ */ function isNil(value) {
+ return value == null;
+ }
+ /**
+ * Checks if `value` is classified as a `Number` primitive or object.
+ *
+ * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are
+ * classified as numbers, use the `_.isFinite` method.
+ *
+ * @static
+ * @memberOf _
+ * @since 0.1.0
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a number, else `false`.
+ * @example
+ *
+ * _.isNumber(3);
+ * // => true
+ *
+ * _.isNumber(Number.MIN_VALUE);
+ * // => true
+ *
+ * _.isNumber(Infinity);
+ * // => true
+ *
+ * _.isNumber('3');
+ * // => false
+ */ function isNumber(value) {
+ return (
+ typeof value == "number" ||
+ (isObjectLike(value) && baseGetTag(value) == numberTag)
+ );
+ }
+ /**
+ * Checks if `value` is a plain object, that is, an object created by the
+ * `Object` constructor or one with a `[[Prototype]]` of `null`.
+ *
+ * @static
+ * @memberOf _
+ * @since 0.8.0
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
+ * @example
+ *
+ * function Foo() {
+ * this.a = 1;
+ * }
+ *
+ * _.isPlainObject(new Foo);
+ * // => false
+ *
+ * _.isPlainObject([1, 2, 3]);
+ * // => false
+ *
+ * _.isPlainObject({ 'x': 0, 'y': 0 });
+ * // => true
+ *
+ * _.isPlainObject(Object.create(null));
+ * // => true
+ */ function isPlainObject(value) {
+ if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
+ return false;
+ }
+ var proto = getPrototype(value);
+ if (proto === null) {
+ return true;
+ }
+ var Ctor =
+ hasOwnProperty.call(proto, "constructor") &&
+ proto.constructor;
+ return (
+ typeof Ctor == "function" &&
+ Ctor instanceof Ctor &&
+ funcToString.call(Ctor) == objectCtorString
+ );
+ }
+ /**
+ * Checks if `value` is classified as a `RegExp` object.
+ *
+ * @static
+ * @memberOf _
+ * @since 0.1.0
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
+ * @example
+ *
+ * _.isRegExp(/abc/);
+ * // => true
+ *
+ * _.isRegExp('/abc/');
+ * // => false
+ */ var isRegExp = nodeIsRegExp
+ ? baseUnary(nodeIsRegExp)
+ : baseIsRegExp;
+ /**
+ * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754
+ * double precision number which isn't the result of a rounded unsafe integer.
+ *
+ * **Note:** This method is based on
+ * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger).
+ *
+ * @static
+ * @memberOf _
+ * @since 4.0.0
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`.
+ * @example
+ *
+ * _.isSafeInteger(3);
+ * // => true
+ *
+ * _.isSafeInteger(Number.MIN_VALUE);
+ * // => false
+ *
+ * _.isSafeInteger(Infinity);
+ * // => false
+ *
+ * _.isSafeInteger('3');
+ * // => false
+ */ function isSafeInteger(value) {
+ return (
+ isInteger(value) &&
+ value >= -MAX_SAFE_INTEGER &&
+ value <= MAX_SAFE_INTEGER
+ );
+ }
+ /**
+ * Checks if `value` is classified as a `Set` object.
+ *
+ * @static
+ * @memberOf _
+ * @since 4.3.0
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a set, else `false`.
+ * @example
+ *
+ * _.isSet(new Set);
+ * // => true
+ *
+ * _.isSet(new WeakSet);
+ * // => false
+ */ var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
+ /**
+ * Checks if `value` is classified as a `String` primitive or object.
+ *
+ * @static
+ * @since 0.1.0
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a string, else `false`.
+ * @example
+ *
+ * _.isString('abc');
+ * // => true
+ *
+ * _.isString(1);
+ * // => false
+ */ function isString(value) {
+ return (
+ typeof value == "string" ||
+ (!isArray(value) &&
+ isObjectLike(value) &&
+ baseGetTag(value) == stringTag)
+ );
+ }
+ /**
+ * Checks if `value` is classified as a `Symbol` primitive or object.
+ *
+ * @static
+ * @memberOf _
+ * @since 4.0.0
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
+ * @example
+ *
+ * _.isSymbol(Symbol.iterator);
+ * // => true
+ *
+ * _.isSymbol('abc');
+ * // => false
+ */ function isSymbol(value) {
+ return (
+ (typeof value === "undefined"
+ ? "undefined"
+ : _typeof(value)) == "symbol" ||
+ (isObjectLike(value) && baseGetTag(value) == symbolTag)
+ );
+ }
+ /**
+ * Checks if `value` is classified as a typed array.
+ *
+ * @static
+ * @memberOf _
+ * @since 3.0.0
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
+ * @example
+ *
+ * _.isTypedArray(new Uint8Array);
+ * // => true
+ *
+ * _.isTypedArray([]);
+ * // => false
+ */ var isTypedArray = nodeIsTypedArray
+ ? baseUnary(nodeIsTypedArray)
+ : baseIsTypedArray;
+ /**
+ * Checks if `value` is `undefined`.
+ *
+ * @static
+ * @since 0.1.0
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.
+ * @example
+ *
+ * _.isUndefined(void 0);
+ * // => true
+ *
+ * _.isUndefined(null);
+ * // => false
+ */ function isUndefined(value) {
+ return value === undefined;
+ }
+ /**
+ * Checks if `value` is classified as a `WeakMap` object.
+ *
+ * @static
+ * @memberOf _
+ * @since 4.3.0
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a weak map, else `false`.
+ * @example
+ *
+ * _.isWeakMap(new WeakMap);
+ * // => true
+ *
+ * _.isWeakMap(new Map);
+ * // => false
+ */ function isWeakMap(value) {
+ return isObjectLike(value) && getTag(value) == weakMapTag;
+ }
+ /**
+ * Checks if `value` is classified as a `WeakSet` object.
+ *
+ * @static
+ * @memberOf _
+ * @since 4.3.0
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a weak set, else `false`.
+ * @example
+ *
+ * _.isWeakSet(new WeakSet);
+ * // => true
+ *
+ * _.isWeakSet(new Set);
+ * // => false
+ */ function isWeakSet(value) {
+ return isObjectLike(value) && baseGetTag(value) == weakSetTag;
+ }
+ /**
+ * Checks if `value` is less than `other`.
+ *
+ * @static
+ * @memberOf _
+ * @since 3.9.0
+ * @category Lang
+ * @param {*} value The value to compare.
+ * @param {*} other The other value to compare.
+ * @returns {boolean} Returns `true` if `value` is less than `other`,
+ * else `false`.
+ * @see _.gt
+ * @example
+ *
+ * _.lt(1, 3);
+ * // => true
+ *
+ * _.lt(3, 3);
+ * // => false
+ *
+ * _.lt(3, 1);
+ * // => false
+ */ var lt = createRelationalOperation(baseLt);
+ /**
+ * Checks if `value` is less than or equal to `other`.
+ *
+ * @static
+ * @memberOf _
+ * @since 3.9.0
+ * @category Lang
+ * @param {*} value The value to compare.
+ * @param {*} other The other value to compare.
+ * @returns {boolean} Returns `true` if `value` is less than or equal to
+ * `other`, else `false`.
+ * @see _.gte
+ * @example
+ *
+ * _.lte(1, 3);
+ * // => true
+ *
+ * _.lte(3, 3);
+ * // => true
+ *
+ * _.lte(3, 1);
+ * // => false
+ */ var lte = createRelationalOperation(function(value, other) {
+ return value <= other;
+ });
+ /**
+ * Converts `value` to an array.
+ *
+ * @static
+ * @since 0.1.0
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to convert.
+ * @returns {Array} Returns the converted array.
+ * @example
+ *
+ * _.toArray({ 'a': 1, 'b': 2 });
+ * // => [1, 2]
+ *
+ * _.toArray('abc');
+ * // => ['a', 'b', 'c']
+ *
+ * _.toArray(1);
+ * // => []
+ *
+ * _.toArray(null);
+ * // => []
+ */ function toArray(value) {
+ if (!value) {
+ return [];
+ }
+ if (isArrayLike(value)) {
+ return isString(value)
+ ? stringToArray(value)
+ : copyArray(value);
+ }
+ if (symIterator && value[symIterator]) {
+ return iteratorToArray(value[symIterator]());
+ }
+ var tag = getTag(value),
+ func =
+ tag == mapTag
+ ? mapToArray
+ : tag == setTag ? setToArray : values;
+ return func(value);
+ }
+ /**
+ * Converts `value` to a finite number.
+ *
+ * @static
+ * @memberOf _
+ * @since 4.12.0
+ * @category Lang
+ * @param {*} value The value to convert.
+ * @returns {number} Returns the converted number.
+ * @example
+ *
+ * _.toFinite(3.2);
+ * // => 3.2
+ *
+ * _.toFinite(Number.MIN_VALUE);
+ * // => 5e-324
+ *
+ * _.toFinite(Infinity);
+ * // => 1.7976931348623157e+308
+ *
+ * _.toFinite('3.2');
+ * // => 3.2
+ */ function toFinite(value) {
+ if (!value) {
+ return value === 0 ? value : 0;
+ }
+ value = toNumber(value);
+ if (value === INFINITY || value === -INFINITY) {
+ var sign = value < 0 ? -1 : 1;
+ return sign * MAX_INTEGER;
+ }
+ return value === value ? value : 0;
+ }
+ /**
+ * Converts `value` to an integer.
+ *
+ * **Note:** This method is loosely based on
+ * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).
+ *
+ * @static
+ * @memberOf _
+ * @since 4.0.0
+ * @category Lang
+ * @param {*} value The value to convert.
+ * @returns {number} Returns the converted integer.
+ * @example
+ *
+ * _.toInteger(3.2);
+ * // => 3
+ *
+ * _.toInteger(Number.MIN_VALUE);
+ * // => 0
+ *
+ * _.toInteger(Infinity);
+ * // => 1.7976931348623157e+308
+ *
+ * _.toInteger('3.2');
+ * // => 3
+ */ function toInteger(value) {
+ var result = toFinite(value),
+ remainder = result % 1;
+ return result === result
+ ? remainder ? result - remainder : result
+ : 0;
+ }
+ /**
+ * Converts `value` to an integer suitable for use as the length of an
+ * array-like object.
+ *
+ * **Note:** This method is based on
+ * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
+ *
+ * @static
+ * @memberOf _
+ * @since 4.0.0
+ * @category Lang
+ * @param {*} value The value to convert.
+ * @returns {number} Returns the converted integer.
+ * @example
+ *
+ * _.toLength(3.2);
+ * // => 3
+ *
+ * _.toLength(Number.MIN_VALUE);
+ * // => 0
+ *
+ * _.toLength(Infinity);
+ * // => 4294967295
+ *
+ * _.toLength('3.2');
+ * // => 3
+ */ function toLength(value) {
+ return value
+ ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH)
+ : 0;
+ }
+ /**
+ * Converts `value` to a number.
+ *
+ * @static
+ * @memberOf _
+ * @since 4.0.0
+ * @category Lang
+ * @param {*} value The value to process.
+ * @returns {number} Returns the number.
+ * @example
+ *
+ * _.toNumber(3.2);
+ * // => 3.2
+ *
+ * _.toNumber(Number.MIN_VALUE);
+ * // => 5e-324
+ *
+ * _.toNumber(Infinity);
+ * // => Infinity
+ *
+ * _.toNumber('3.2');
+ * // => 3.2
+ */ function toNumber(value) {
+ if (typeof value == "number") {
+ return value;
+ }
+ if (isSymbol(value)) {
+ return NAN;
+ }
+ if (isObject(value)) {
+ var other =
+ typeof value.valueOf == "function"
+ ? value.valueOf()
+ : value;
+ value = isObject(other) ? other + "" : other;
+ }
+ if (typeof value != "string") {
+ return value === 0 ? value : +value;
+ }
+ value = value.replace(reTrim, "");
+ var isBinary = reIsBinary.test(value);
+ return isBinary || reIsOctal.test(value)
+ ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
+ : reIsBadHex.test(value) ? NAN : +value;
+ }
+ /**
+ * Converts `value` to a plain object flattening inherited enumerable string
+ * keyed properties of `value` to own properties of the plain object.
+ *
+ * @static
+ * @memberOf _
+ * @since 3.0.0
+ * @category Lang
+ * @param {*} value The value to convert.
+ * @returns {Object} Returns the converted plain object.
+ * @example
+ *
+ * function Foo() {
+ * this.b = 2;
+ * }
+ *
+ * Foo.prototype.c = 3;
+ *
+ * _.assign({ 'a': 1 }, new Foo);
+ * // => { 'a': 1, 'b': 2 }
+ *
+ * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));
+ * // => { 'a': 1, 'b': 2, 'c': 3 }
+ */ function toPlainObject(value) {
+ return copyObject(value, keysIn(value));
+ }
+ /**
+ * Converts `value` to a safe integer. A safe integer can be compared and
+ * represented correctly.
+ *
+ * @static
+ * @memberOf _
+ * @since 4.0.0
+ * @category Lang
+ * @param {*} value The value to convert.
+ * @returns {number} Returns the converted integer.
+ * @example
+ *
+ * _.toSafeInteger(3.2);
+ * // => 3
+ *
+ * _.toSafeInteger(Number.MIN_VALUE);
+ * // => 0
+ *
+ * _.toSafeInteger(Infinity);
+ * // => 9007199254740991
+ *
+ * _.toSafeInteger('3.2');
+ * // => 3
+ */ function toSafeInteger(value) {
+ return value
+ ? baseClamp(
+ toInteger(value),
+ -MAX_SAFE_INTEGER,
+ MAX_SAFE_INTEGER
+ )
+ : value === 0 ? value : 0;
+ }
+ /**
+ * Converts `value` to a string. An empty string is returned for `null`
+ * and `undefined` values. The sign of `-0` is preserved.
+ *
+ * @static
+ * @memberOf _
+ * @since 4.0.0
+ * @category Lang
+ * @param {*} value The value to convert.
+ * @returns {string} Returns the converted string.
+ * @example
+ *
+ * _.toString(null);
+ * // => ''
+ *
+ * _.toString(-0);
+ * // => '-0'
+ *
+ * _.toString([1, 2, 3]);
+ * // => '1,2,3'
+ */ function toString(value) {
+ return value == null ? "" : baseToString(value);
+ }
+ /*------------------------------------------------------------------------*/ /**
+ * Assigns own enumerable string keyed properties of source objects to the
+ * destination object. Source objects are applied from left to right.
+ * Subsequent sources overwrite property assignments of previous sources.
+ *
+ * **Note:** This method mutates `object` and is loosely based on
+ * [`Object.assign`](https://mdn.io/Object/assign).
+ *
+ * @static
+ * @memberOf _
+ * @since 0.10.0
+ * @category Object
+ * @param {Object} object The destination object.
+ * @param {...Object} [sources] The source objects.
+ * @returns {Object} Returns `object`.
+ * @see _.assignIn
+ * @example
+ *
+ * function Foo() {
+ * this.a = 1;
+ * }
+ *
+ * function Bar() {
+ * this.c = 3;
+ * }
+ *
+ * Foo.prototype.b = 2;
+ * Bar.prototype.d = 4;
+ *
+ * _.assign({ 'a': 0 }, new Foo, new Bar);
+ * // => { 'a': 1, 'c': 3 }
+ */ var assign = createAssigner(function(object, source) {
+ if (isPrototype(source) || isArrayLike(source)) {
+ copyObject(source, keys(source), object);
+ return;
+ }
+ for (var key in source) {
+ if (hasOwnProperty.call(source, key)) {
+ assignValue(object, key, source[key]);
+ }
+ }
+ });
+ /**
+ * This method is like `_.assign` except that it iterates over own and
+ * inherited source properties.
+ *
+ * **Note:** This method mutates `object`.
+ *
+ * @static
+ * @memberOf _
+ * @since 4.0.0
+ * @alias extend
+ * @category Object
+ * @param {Object} object The destination object.
+ * @param {...Object} [sources] The source objects.
+ * @returns {Object} Returns `object`.
+ * @see _.assign
+ * @example
+ *
+ * function Foo() {
+ * this.a = 1;
+ * }
+ *
+ * function Bar() {
+ * this.c = 3;
+ * }
+ *
+ * Foo.prototype.b = 2;
+ * Bar.prototype.d = 4;
+ *
+ * _.assignIn({ 'a': 0 }, new Foo, new Bar);
+ * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 }
+ */ var assignIn = createAssigner(function(object, source) {
+ copyObject(source, keysIn(source), object);
+ });
+ /**
+ * This method is like `_.assignIn` except that it accepts `customizer`
+ * which is invoked to produce the assigned values. If `customizer` returns
+ * `undefined`, assignment is handled by the method instead. The `customizer`
+ * is invoked with five arguments: (objValue, srcValue, key, object, source).
+ *
+ * **Note:** This method mutates `object`.
+ *
+ * @static
+ * @memberOf _
+ * @since 4.0.0
+ * @alias extendWith
+ * @category Object
+ * @param {Object} object The destination object.
+ * @param {...Object} sources The source objects.
+ * @param {Function} [customizer] The function to customize assigned values.
+ * @returns {Object} Returns `object`.
+ * @see _.assignWith
+ * @example
+ *
+ * function customizer(objValue, srcValue) {
+ * return _.isUndefined(objValue) ? srcValue : objValue;
+ * }
+ *
+ * var defaults = _.partialRight(_.assignInWith, customizer);
+ *
+ * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
+ * // => { 'a': 1, 'b': 2 }
+ */ var assignInWith = createAssigner(function(
+ object,
+ source,
+ srcIndex,
+ customizer
+ ) {
+ copyObject(source, keysIn(source), object, customizer);
+ });
+ /**
+ * This method is like `_.assign` except that it accepts `customizer`
+ * which is invoked to produce the assigned values. If `customizer` returns
+ * `undefined`, assignment is handled by the method instead. The `customizer`
+ * is invoked with five arguments: (objValue, srcValue, key, object, source).
+ *
+ * **Note:** This method mutates `object`.
+ *
+ * @static
+ * @memberOf _
+ * @since 4.0.0
+ * @category Object
+ * @param {Object} object The destination object.
+ * @param {...Object} sources The source objects.
+ * @param {Function} [customizer] The function to customize assigned values.
+ * @returns {Object} Returns `object`.
+ * @see _.assignInWith
+ * @example
+ *
+ * function customizer(objValue, srcValue) {
+ * return _.isUndefined(objValue) ? srcValue : objValue;
+ * }
+ *
+ * var defaults = _.partialRight(_.assignWith, customizer);
+ *
+ * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
+ * // => { 'a': 1, 'b': 2 }
+ */ var assignWith = createAssigner(function(
+ object,
+ source,
+ srcIndex,
+ customizer
+ ) {
+ copyObject(source, keys(source), object, customizer);
+ });
+ /**
+ * Creates an array of values corresponding to `paths` of `object`.
+ *
+ * @static
+ * @memberOf _
+ * @since 1.0.0
+ * @category Object
+ * @param {Object} object The object to iterate over.
+ * @param {...(string|string[])} [paths] The property paths to pick.
+ * @returns {Array} Returns the picked values.
+ * @example
+ *
+ * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
+ *
+ * _.at(object, ['a[0].b.c', 'a[1]']);
+ * // => [3, 4]
+ */ var at = flatRest(baseAt);
+ /**
+ * Creates an object that inherits from the `prototype` object. If a
+ * `properties` object is given, its own enumerable string keyed properties
+ * are assigned to the created object.
+ *
+ * @static
+ * @memberOf _
+ * @since 2.3.0
+ * @category Object
+ * @param {Object} prototype The object to inherit from.
+ * @param {Object} [properties] The properties to assign to the object.
+ * @returns {Object} Returns the new object.
+ * @example
+ *
+ * function Shape() {
+ * this.x = 0;
+ * this.y = 0;
+ * }
+ *
+ * function Circle() {
+ * Shape.call(this);
+ * }
+ *
+ * Circle.prototype = _.create(Shape.prototype, {
+ * 'constructor': Circle
+ * });
+ *
+ * var circle = new Circle;
+ * circle instanceof Circle;
+ * // => true
+ *
+ * circle instanceof Shape;
+ * // => true
+ */ function create(prototype, properties) {
+ var result = baseCreate(prototype);
+ return properties == null
+ ? result
+ : baseAssign(result, properties);
+ }
+ /**
+ * Assigns own and inherited enumerable string keyed properties of source
+ * objects to the destination object for all destination properties that
+ * resolve to `undefined`. Source objects are applied from left to right.
+ * Once a property is set, additional values of the same property are ignored.
+ *
+ * **Note:** This method mutates `object`.
+ *
+ * @static
+ * @since 0.1.0
+ * @memberOf _
+ * @category Object
+ * @param {Object} object The destination object.
+ * @param {...Object} [sources] The source objects.
+ * @returns {Object} Returns `object`.
+ * @see _.defaultsDeep
+ * @example
+ *
+ * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
+ * // => { 'a': 1, 'b': 2 }
+ */ var defaults = baseRest(function(object, sources) {
+ object = Object(object);
+ var index = -1;
+ var length = sources.length;
+ var guard = length > 2 ? sources[2] : undefined;
+ if (guard && isIterateeCall(sources[0], sources[1], guard)) {
+ length = 1;
+ }
+ while (++index < length) {
+ var source = sources[index];
+ var props = keysIn(source);
+ var propsIndex = -1;
+ var propsLength = props.length;
+ while (++propsIndex < propsLength) {
+ var key = props[propsIndex];
+ var value = object[key];
+ if (
+ value === undefined ||
+ (eq(value, objectProto[key]) &&
+ !hasOwnProperty.call(object, key))
+ ) {
+ object[key] = source[key];
+ }
+ }
+ }
+ return object;
+ });
+ /**
+ * This method is like `_.defaults` except that it recursively assigns
+ * default properties.
+ *
+ * **Note:** This method mutates `object`.
+ *
+ * @static
+ * @memberOf _
+ * @since 3.10.0
+ * @category Object
+ * @param {Object} object The destination object.
+ * @param {...Object} [sources] The source objects.
+ * @returns {Object} Returns `object`.
+ * @see _.defaults
+ * @example
+ *
+ * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } });
+ * // => { 'a': { 'b': 2, 'c': 3 } }
+ */ var defaultsDeep = baseRest(function(args) {
+ args.push(undefined, customDefaultsMerge);
+ return apply(mergeWith, undefined, args);
+ });
+ /**
+ * This method is like `_.find` except that it returns the key of the first
+ * element `predicate` returns truthy for instead of the element itself.
+ *
+ * @static
+ * @memberOf _
+ * @since 1.1.0
+ * @category Object
+ * @param {Object} object The object to inspect.
+ * @param {Function} [predicate=_.identity] The function invoked per iteration.
+ * @returns {string|undefined} Returns the key of the matched element,
+ * else `undefined`.
+ * @example
+ *
+ * var users = {
+ * 'barney': { 'age': 36, 'active': true },
+ * 'fred': { 'age': 40, 'active': false },
+ * 'pebbles': { 'age': 1, 'active': true }
+ * };
+ *
+ * _.findKey(users, function(o) { return o.age < 40; });
+ * // => 'barney' (iteration order is not guaranteed)
+ *
+ * // The `_.matches` iteratee shorthand.
+ * _.findKey(users, { 'age': 1, 'active': true });
+ * // => 'pebbles'
+ *
+ * // The `_.matchesProperty` iteratee shorthand.
+ * _.findKey(users, ['active', false]);
+ * // => 'fred'
+ *
+ * // The `_.property` iteratee shorthand.
+ * _.findKey(users, 'active');
+ * // => 'barney'
+ */ function findKey(object, predicate) {
+ return baseFindKey(
+ object,
+ getIteratee(predicate, 3),
+ baseForOwn
+ );
+ }
+ /**
+ * This method is like `_.findKey` except that it iterates over elements of
+ * a collection in the opposite order.
+ *
+ * @static
+ * @memberOf _
+ * @since 2.0.0
+ * @category Object
+ * @param {Object} object The object to inspect.
+ * @param {Function} [predicate=_.identity] The function invoked per iteration.
+ * @returns {string|undefined} Returns the key of the matched element,
+ * else `undefined`.
+ * @example
+ *
+ * var users = {
+ * 'barney': { 'age': 36, 'active': true },
+ * 'fred': { 'age': 40, 'active': false },
+ * 'pebbles': { 'age': 1, 'active': true }
+ * };
+ *
+ * _.findLastKey(users, function(o) { return o.age < 40; });
+ * // => returns 'pebbles' assuming `_.findKey` returns 'barney'
+ *
+ * // The `_.matches` iteratee shorthand.
+ * _.findLastKey(users, { 'age': 36, 'active': true });
+ * // => 'barney'
+ *
+ * // The `_.matchesProperty` iteratee shorthand.
+ * _.findLastKey(users, ['active', false]);
+ * // => 'fred'
+ *
+ * // The `_.property` iteratee shorthand.
+ * _.findLastKey(users, 'active');
+ * // => 'pebbles'
+ */ function findLastKey(object, predicate) {
+ return baseFindKey(
+ object,
+ getIteratee(predicate, 3),
+ baseForOwnRight
+ );
+ }
+ /**
+ * Iterates over own and inherited enumerable string keyed properties of an
+ * object and invokes `iteratee` for each property. The iteratee is invoked
+ * with three arguments: (value, key, object). Iteratee functions may exit
+ * iteration early by explicitly returning `false`.
+ *
+ * @static
+ * @memberOf _
+ * @since 0.3.0
+ * @category Object
+ * @param {Object} object The object to iterate over.
+ * @param {Function} [iteratee=_.identity] The function invoked per iteration.
+ * @returns {Object} Returns `object`.
+ * @see _.forInRight
+ * @example
+ *
+ * function Foo() {
+ * this.a = 1;
+ * this.b = 2;
+ * }
+ *
+ * Foo.prototype.c = 3;
+ *
+ * _.forIn(new Foo, function(value, key) {
+ * console.log(key);
+ * });
+ * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed).
+ */ function forIn(object, iteratee) {
+ return object == null
+ ? object
+ : baseFor(object, getIteratee(iteratee, 3), keysIn);
+ }
+ /**
+ * This method is like `_.forIn` except that it iterates over properties of
+ * `object` in the opposite order.
+ *
+ * @static
+ * @memberOf _
+ * @since 2.0.0
+ * @category Object
+ * @param {Object} object The object to iterate over.
+ * @param {Function} [iteratee=_.identity] The function invoked per iteration.
+ * @returns {Object} Returns `object`.
+ * @see _.forIn
+ * @example
+ *
+ * function Foo() {
+ * this.a = 1;
+ * this.b = 2;
+ * }
+ *
+ * Foo.prototype.c = 3;
+ *
+ * _.forInRight(new Foo, function(value, key) {
+ * console.log(key);
+ * });
+ * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'.
+ */ function forInRight(object, iteratee) {
+ return object == null
+ ? object
+ : baseForRight(object, getIteratee(iteratee, 3), keysIn);
+ }
+ /**
+ * Iterates over own enumerable string keyed properties of an object and
+ * invokes `iteratee` for each property. The iteratee is invoked with three
+ * arguments: (value, key, object). Iteratee functions may exit iteration
+ * early by explicitly returning `false`.
+ *
+ * @static
+ * @memberOf _
+ * @since 0.3.0
+ * @category Object
+ * @param {Object} object The object to iterate over.
+ * @param {Function} [iteratee=_.identity] The function invoked per iteration.
+ * @returns {Object} Returns `object`.
+ * @see _.forOwnRight
+ * @example
+ *
+ * function Foo() {
+ * this.a = 1;
+ * this.b = 2;
+ * }
+ *
+ * Foo.prototype.c = 3;
+ *
+ * _.forOwn(new Foo, function(value, key) {
+ * console.log(key);
+ * });
+ * // => Logs 'a' then 'b' (iteration order is not guaranteed).
+ */ function forOwn(object, iteratee) {
+ return object && baseForOwn(object, getIteratee(iteratee, 3));
+ }
+ /**
+ * This method is like `_.forOwn` except that it iterates over properties of
+ * `object` in the opposite order.
+ *
+ * @static
+ * @memberOf _
+ * @since 2.0.0
+ * @category Object
+ * @param {Object} object The object to iterate over.
+ * @param {Function} [iteratee=_.identity] The function invoked per iteration.
+ * @returns {Object} Returns `object`.
+ * @see _.forOwn
+ * @example
+ *
+ * function Foo() {
+ * this.a = 1;
+ * this.b = 2;
+ * }
+ *
+ * Foo.prototype.c = 3;
+ *
+ * _.forOwnRight(new Foo, function(value, key) {
+ * console.log(key);
+ * });
+ * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'.
+ */ function forOwnRight(object, iteratee) {
+ return (
+ object && baseForOwnRight(object, getIteratee(iteratee, 3))
+ );
+ }
+ /**
+ * Creates an array of function property names from own enumerable properties
+ * of `object`.
+ *
+ * @static
+ * @since 0.1.0
+ * @memberOf _
+ * @category Object
+ * @param {Object} object The object to inspect.
+ * @returns {Array} Returns the function names.
+ * @see _.functionsIn
+ * @example
+ *
+ * function Foo() {
+ * this.a = _.constant('a');
+ * this.b = _.constant('b');
+ * }
+ *
+ * Foo.prototype.c = _.constant('c');
+ *
+ * _.functions(new Foo);
+ * // => ['a', 'b']
+ */ function functions(object) {
+ return object == null
+ ? []
+ : baseFunctions(object, keys(object));
+ }
+ /**
+ * Creates an array of function property names from own and inherited
+ * enumerable properties of `object`.
+ *
+ * @static
+ * @memberOf _
+ * @since 4.0.0
+ * @category Object
+ * @param {Object} object The object to inspect.
+ * @returns {Array} Returns the function names.
+ * @see _.functions
+ * @example
+ *
+ * function Foo() {
+ * this.a = _.constant('a');
+ * this.b = _.constant('b');
+ * }
+ *
+ * Foo.prototype.c = _.constant('c');
+ *
+ * _.functionsIn(new Foo);
+ * // => ['a', 'b', 'c']
+ */ function functionsIn(object) {
+ return object == null
+ ? []
+ : baseFunctions(object, keysIn(object));
+ }
+ /**
+ * Gets the value at `path` of `object`. If the resolved value is
+ * `undefined`, the `defaultValue` is returned in its place.
+ *
+ * @static
+ * @memberOf _
+ * @since 3.7.0
+ * @category Object
+ * @param {Object} object The object to query.
+ * @param {Array|string} path The path of the property to get.
+ * @param {*} [defaultValue] The value returned for `undefined` resolved values.
+ * @returns {*} Returns the resolved value.
+ * @example
+ *
+ * var object = { 'a': [{ 'b': { 'c': 3 } }] };
+ *
+ * _.get(object, 'a[0].b.c');
+ * // => 3
+ *
+ * _.get(object, ['a', '0', 'b', 'c']);
+ * // => 3
+ *
+ * _.get(object, 'a.b.c', 'default');
+ * // => 'default'
+ */ function get(object, path, defaultValue) {
+ var result = object == null ? undefined : baseGet(object, path);
+ return result === undefined ? defaultValue : result;
+ }
+ /**
+ * Checks if `path` is a direct property of `object`.
+ *
+ * @static
+ * @since 0.1.0
+ * @memberOf _
+ * @category Object
+ * @param {Object} object The object to query.
+ * @param {Array|string} path The path to check.
+ * @returns {boolean} Returns `true` if `path` exists, else `false`.
+ * @example
+ *
+ * var object = { 'a': { 'b': 2 } };
+ * var other = _.create({ 'a': _.create({ 'b': 2 }) });
+ *
+ * _.has(object, 'a');
+ * // => true
+ *
+ * _.has(object, 'a.b');
+ * // => true
+ *
+ * _.has(object, ['a', 'b']);
+ * // => true
+ *
+ * _.has(other, 'a');
+ * // => false
+ */ function has(object, path) {
+ return object != null && hasPath(object, path, baseHas);
+ }
+ /**
+ * Checks if `path` is a direct or inherited property of `object`.
+ *
+ * @static
+ * @memberOf _
+ * @since 4.0.0
+ * @category Object
+ * @param {Object} object The object to query.
+ * @param {Array|string} path The path to check.
+ * @returns {boolean} Returns `true` if `path` exists, else `false`.
+ * @example
+ *
+ * var object = _.create({ 'a': _.create({ 'b': 2 }) });
+ *
+ * _.hasIn(object, 'a');
+ * // => true
+ *
+ * _.hasIn(object, 'a.b');
+ * // => true
+ *
+ * _.hasIn(object, ['a', 'b']);
+ * // => true
+ *
+ * _.hasIn(object, 'b');
+ * // => false
+ */ function hasIn(object, path) {
+ return object != null && hasPath(object, path, baseHasIn);
+ }
+ /**
+ * Creates an object composed of the inverted keys and values of `object`.
+ * If `object` contains duplicate values, subsequent values overwrite
+ * property assignments of previous values.
+ *
+ * @static
+ * @memberOf _
+ * @since 0.7.0
+ * @category Object
+ * @param {Object} object The object to invert.
+ * @returns {Object} Returns the new inverted object.
+ * @example
+ *
+ * var object = { 'a': 1, 'b': 2, 'c': 1 };
+ *
+ * _.invert(object);
+ * // => { '1': 'c', '2': 'b' }
+ */ var invert = createInverter(function(result, value, key) {
+ if (value != null && typeof value.toString != "function") {
+ value = nativeObjectToString.call(value);
+ }
+ result[value] = key;
+ }, constant(identity));
+ /**
+ * This method is like `_.invert` except that the inverted object is generated
+ * from the results of running each element of `object` thru `iteratee`. The
+ * corresponding inverted value of each inverted key is an array of keys
+ * responsible for generating the inverted value. The iteratee is invoked
+ * with one argument: (value).
+ *
+ * @static
+ * @memberOf _
+ * @since 4.1.0
+ * @category Object
+ * @param {Object} object The object to invert.
+ * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
+ * @returns {Object} Returns the new inverted object.
+ * @example
+ *
+ * var object = { 'a': 1, 'b': 2, 'c': 1 };
+ *
+ * _.invertBy(object);
+ * // => { '1': ['a', 'c'], '2': ['b'] }
+ *
+ * _.invertBy(object, function(value) {
+ * return 'group' + value;
+ * });
+ * // => { 'group1': ['a', 'c'], 'group2': ['b'] }
+ */ var invertBy = createInverter(function(result, value, key) {
+ if (value != null && typeof value.toString != "function") {
+ value = nativeObjectToString.call(value);
+ }
+ if (hasOwnProperty.call(result, value)) {
+ result[value].push(key);
+ } else {
+ result[value] = [key];
+ }
+ }, getIteratee);
+ /**
+ * Invokes the method at `path` of `object`.
+ *
+ * @static
+ * @memberOf _
+ * @since 4.0.0
+ * @category Object
+ * @param {Object} object The object to query.
+ * @param {Array|string} path The path of the method to invoke.
+ * @param {...*} [args] The arguments to invoke the method with.
+ * @returns {*} Returns the result of the invoked method.
+ * @example
+ *
+ * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] };
+ *
+ * _.invoke(object, 'a[0].b.c.slice', 1, 3);
+ * // => [2, 3]
+ */ var invoke = baseRest(baseInvoke);
+ /**
+ * Creates an array of the own enumerable property names of `object`.
+ *
+ * **Note:** Non-object values are coerced to objects. See the
+ * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
+ * for more details.
+ *
+ * @static
+ * @since 0.1.0
+ * @memberOf _
+ * @category Object
+ * @param {Object} object The object to query.
+ * @returns {Array} Returns the array of property names.
+ * @example
+ *
+ * function Foo() {
+ * this.a = 1;
+ * this.b = 2;
+ * }
+ *
+ * Foo.prototype.c = 3;
+ *
+ * _.keys(new Foo);
+ * // => ['a', 'b'] (iteration order is not guaranteed)
+ *
+ * _.keys('hi');
+ * // => ['0', '1']
+ */ function keys(object) {
+ return isArrayLike(object)
+ ? arrayLikeKeys(object)
+ : baseKeys(object);
+ }
+ /**
+ * Creates an array of the own and inherited enumerable property names of `object`.
+ *
+ * **Note:** Non-object values are coerced to objects.
+ *
+ * @static
+ * @memberOf _
+ * @since 3.0.0
+ * @category Object
+ * @param {Object} object The object to query.
+ * @returns {Array} Returns the array of property names.
+ * @example
+ *
+ * function Foo() {
+ * this.a = 1;
+ * this.b = 2;
+ * }
+ *
+ * Foo.prototype.c = 3;
+ *
+ * _.keysIn(new Foo);
+ * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
+ */ function keysIn(object) {
+ return isArrayLike(object)
+ ? arrayLikeKeys(object, true)
+ : baseKeysIn(object);
+ }
+ /**
+ * The opposite of `_.mapValues`; this method creates an object with the
+ * same values as `object` and keys generated by running each own enumerable
+ * string keyed property of `object` thru `iteratee`. The iteratee is invoked
+ * with three arguments: (value, key, object).
+ *
+ * @static
+ * @memberOf _
+ * @since 3.8.0
+ * @category Object
+ * @param {Object} object The object to iterate over.
+ * @param {Function} [iteratee=_.identity] The function invoked per iteration.
+ * @returns {Object} Returns the new mapped object.
+ * @see _.mapValues
+ * @example
+ *
+ * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) {
+ * return key + value;
+ * });
+ * // => { 'a1': 1, 'b2': 2 }
+ */ function mapKeys(object, iteratee) {
+ var result = {};
+ iteratee = getIteratee(iteratee, 3);
+ baseForOwn(object, function(value, key, object) {
+ baseAssignValue(result, iteratee(value, key, object), value);
+ });
+ return result;
+ }
+ /**
+ * Creates an object with the same keys as `object` and values generated
+ * by running each own enumerable string keyed property of `object` thru
+ * `iteratee`. The iteratee is invoked with three arguments:
+ * (value, key, object).
+ *
+ * @static
+ * @memberOf _
+ * @since 2.4.0
+ * @category Object
+ * @param {Object} object The object to iterate over.
+ * @param {Function} [iteratee=_.identity] The function invoked per iteration.
+ * @returns {Object} Returns the new mapped object.
+ * @see _.mapKeys
+ * @example
+ *
+ * var users = {
+ * 'fred': { 'user': 'fred', 'age': 40 },
+ * 'pebbles': { 'user': 'pebbles', 'age': 1 }
+ * };
+ *
+ * _.mapValues(users, function(o) { return o.age; });
+ * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
+ *
+ * // The `_.property` iteratee shorthand.
+ * _.mapValues(users, 'age');
+ * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
+ */ function mapValues(object, iteratee) {
+ var result = {};
+ iteratee = getIteratee(iteratee, 3);
+ baseForOwn(object, function(value, key, object) {
+ baseAssignValue(result, key, iteratee(value, key, object));
+ });
+ return result;
+ }
+ /**
+ * This method is like `_.assign` except that it recursively merges own and
+ * inherited enumerable string keyed properties of source objects into the
+ * destination object. Source properties that resolve to `undefined` are
+ * skipped if a destination value exists. Array and plain object properties
+ * are merged recursively. Other objects and value types are overridden by
+ * assignment. Source objects are applied from left to right. Subsequent
+ * sources overwrite property assignments of previous sources.
+ *
+ * **Note:** This method mutates `object`.
+ *
+ * @static
+ * @memberOf _
+ * @since 0.5.0
+ * @category Object
+ * @param {Object} object The destination object.
+ * @param {...Object} [sources] The source objects.
+ * @returns {Object} Returns `object`.
+ * @example
+ *
+ * var object = {
+ * 'a': [{ 'b': 2 }, { 'd': 4 }]
+ * };
+ *
+ * var other = {
+ * 'a': [{ 'c': 3 }, { 'e': 5 }]
+ * };
+ *
+ * _.merge(object, other);
+ * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }
+ */ var merge = createAssigner(function(
+ object,
+ source,
+ srcIndex
+ ) {
+ baseMerge(object, source, srcIndex);
+ });
+ /**
+ * This method is like `_.merge` except that it accepts `customizer` which
+ * is invoked to produce the merged values of the destination and source
+ * properties. If `customizer` returns `undefined`, merging is handled by the
+ * method instead. The `customizer` is invoked with six arguments:
+ * (objValue, srcValue, key, object, source, stack).
+ *
+ * **Note:** This method mutates `object`.
+ *
+ * @static
+ * @memberOf _
+ * @since 4.0.0
+ * @category Object
+ * @param {Object} object The destination object.
+ * @param {...Object} sources The source objects.
+ * @param {Function} customizer The function to customize assigned values.
+ * @returns {Object} Returns `object`.
+ * @example
+ *
+ * function customizer(objValue, srcValue) {
+ * if (_.isArray(objValue)) {
+ * return objValue.concat(srcValue);
+ * }
+ * }
+ *
+ * var object = { 'a': [1], 'b': [2] };
+ * var other = { 'a': [3], 'b': [4] };
+ *
+ * _.mergeWith(object, other, customizer);
+ * // => { 'a': [1, 3], 'b': [2, 4] }
+ */ var mergeWith = createAssigner(function(
+ object,
+ source,
+ srcIndex,
+ customizer
+ ) {
+ baseMerge(object, source, srcIndex, customizer);
+ });
+ /**
+ * The opposite of `_.pick`; this method creates an object composed of the
+ * own and inherited enumerable property paths of `object` that are not omitted.
+ *
+ * **Note:** This method is considerably slower than `_.pick`.
+ *
+ * @static
+ * @since 0.1.0
+ * @memberOf _
+ * @category Object
+ * @param {Object} object The source object.
+ * @param {...(string|string[])} [paths] The property paths to omit.
+ * @returns {Object} Returns the new object.
+ * @example
+ *
+ * var object = { 'a': 1, 'b': '2', 'c': 3 };
+ *
+ * _.omit(object, ['a', 'c']);
+ * // => { 'b': '2' }
+ */ var omit = flatRest(function(object, paths) {
+ var result = {};
+ if (object == null) {
+ return result;
+ }
+ var isDeep = false;
+ paths = arrayMap(paths, function(path) {
+ path = castPath(path, object);
+ isDeep || (isDeep = path.length > 1);
+ return path;
+ });
+ copyObject(object, getAllKeysIn(object), result);
+ if (isDeep) {
+ result = baseClone(
+ result,
+ CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG,
+ customOmitClone
+ );
+ }
+ var length = paths.length;
+ while (length--) {
+ baseUnset(result, paths[length]);
+ }
+ return result;
+ });
+ /**
+ * The opposite of `_.pickBy`; this method creates an object composed of
+ * the own and inherited enumerable string keyed properties of `object` that
+ * `predicate` doesn't return truthy for. The predicate is invoked with two
+ * arguments: (value, key).
+ *
+ * @static
+ * @memberOf _
+ * @since 4.0.0
+ * @category Object
+ * @param {Object} object The source object.
+ * @param {Function} [predicate=_.identity] The function invoked per property.
+ * @returns {Object} Returns the new object.
+ * @example
+ *
+ * var object = { 'a': 1, 'b': '2', 'c': 3 };
+ *
+ * _.omitBy(object, _.isNumber);
+ * // => { 'b': '2' }
+ */ function omitBy(object, predicate) {
+ return pickBy(object, negate(getIteratee(predicate)));
+ }
+ /**
+ * Creates an object composed of the picked `object` properties.
+ *
+ * @static
+ * @since 0.1.0
+ * @memberOf _
+ * @category Object
+ * @param {Object} object The source object.
+ * @param {...(string|string[])} [paths] The property paths to pick.
+ * @returns {Object} Returns the new object.
+ * @example
+ *
+ * var object = { 'a': 1, 'b': '2', 'c': 3 };
+ *
+ * _.pick(object, ['a', 'c']);
+ * // => { 'a': 1, 'c': 3 }
+ */ var pick = flatRest(function(object, paths) {
+ return object == null ? {} : basePick(object, paths);
+ });
+ /**
+ * Creates an object composed of the `object` properties `predicate` returns
+ * truthy for. The predicate is invoked with two arguments: (value, key).
+ *
+ * @static
+ * @memberOf _
+ * @since 4.0.0
+ * @category Object
+ * @param {Object} object The source object.
+ * @param {Function} [predicate=_.identity] The function invoked per property.
+ * @returns {Object} Returns the new object.
+ * @example
+ *
+ * var object = { 'a': 1, 'b': '2', 'c': 3 };
+ *
+ * _.pickBy(object, _.isNumber);
+ * // => { 'a': 1, 'c': 3 }
+ */ function pickBy(object, predicate) {
+ if (object == null) {
+ return {};
+ }
+ var props = arrayMap(getAllKeysIn(object), function(prop) {
+ return [prop];
+ });
+ predicate = getIteratee(predicate);
+ return basePickBy(object, props, function(value, path) {
+ return predicate(value, path[0]);
+ });
+ }
+ /**
+ * This method is like `_.get` except that if the resolved value is a
+ * function it's invoked with the `this` binding of its parent object and
+ * its result is returned.
+ *
+ * @static
+ * @since 0.1.0
+ * @memberOf _
+ * @category Object
+ * @param {Object} object The object to query.
+ * @param {Array|string} path The path of the property to resolve.
+ * @param {*} [defaultValue] The value returned for `undefined` resolved values.
+ * @returns {*} Returns the resolved value.
+ * @example
+ *
+ * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };
+ *
+ * _.result(object, 'a[0].b.c1');
+ * // => 3
+ *
+ * _.result(object, 'a[0].b.c2');
+ * // => 4
+ *
+ * _.result(object, 'a[0].b.c3', 'default');
+ * // => 'default'
+ *
+ * _.result(object, 'a[0].b.c3', _.constant('default'));
+ * // => 'default'
+ */ function result(object, path, defaultValue) {
+ path = castPath(path, object);
+ var index = -1,
+ length = path.length; // Ensure the loop is entered when path is empty.
+ if (!length) {
+ length = 1;
+ object = undefined;
+ }
+ while (++index < length) {
+ var value =
+ object == null ? undefined : object[toKey(path[index])];
+ if (value === undefined) {
+ index = length;
+ value = defaultValue;
+ }
+ object = isFunction(value) ? value.call(object) : value;
+ }
+ return object;
+ }
+ /**
+ * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,
+ * it's created. Arrays are created for missing index properties while objects
+ * are created for all other missing properties. Use `_.setWith` to customize
+ * `path` creation.
+ *
+ * **Note:** This method mutates `object`.
+ *
+ * @static
+ * @memberOf _
+ * @since 3.7.0
+ * @category Object
+ * @param {Object} object The object to modify.
+ * @param {Array|string} path The path of the property to set.
+ * @param {*} value The value to set.
+ * @returns {Object} Returns `object`.
+ * @example
+ *
+ * var object = { 'a': [{ 'b': { 'c': 3 } }] };
+ *
+ * _.set(object, 'a[0].b.c', 4);
+ * console.log(object.a[0].b.c);
+ * // => 4
+ *
+ * _.set(object, ['x', '0', 'y', 'z'], 5);
+ * console.log(object.x[0].y.z);
+ * // => 5
+ */ function set(object, path, value) {
+ return object == null ? object : baseSet(object, path, value);
+ }
+ /**
+ * This method is like `_.set` except that it accepts `customizer` which is
+ * invoked to produce the objects of `path`. If `customizer` returns `undefined`
+ * path creation is handled by the method instead. The `customizer` is invoked
+ * with three arguments: (nsValue, key, nsObject).
+ *
+ * **Note:** This method mutates `object`.
+ *
+ * @static
+ * @memberOf _
+ * @since 4.0.0
+ * @category Object
+ * @param {Object} object The object to modify.
+ * @param {Array|string} path The path of the property to set.
+ * @param {*} value The value to set.
+ * @param {Function} [customizer] The function to customize assigned values.
+ * @returns {Object} Returns `object`.
+ * @example
+ *
+ * var object = {};
+ *
+ * _.setWith(object, '[0][1]', 'a', Object);
+ * // => { '0': { '1': 'a' } }
+ */ function setWith(object, path, value, customizer) {
+ customizer =
+ typeof customizer == "function" ? customizer : undefined;
+ return object == null
+ ? object
+ : baseSet(object, path, value, customizer);
+ }
+ /**
+ * Creates an array of own enumerable string keyed-value pairs for `object`
+ * which can be consumed by `_.fromPairs`. If `object` is a map or set, its
+ * entries are returned.
+ *
+ * @static
+ * @memberOf _
+ * @since 4.0.0
+ * @alias entries
+ * @category Object
+ * @param {Object} object The object to query.
+ * @returns {Array} Returns the key-value pairs.
+ * @example
+ *
+ * function Foo() {
+ * this.a = 1;
+ * this.b = 2;
+ * }
+ *
+ * Foo.prototype.c = 3;
+ *
+ * _.toPairs(new Foo);
+ * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed)
+ */ var toPairs = createToPairs(keys);
+ /**
+ * Creates an array of own and inherited enumerable string keyed-value pairs
+ * for `object` which can be consumed by `_.fromPairs`. If `object` is a map
+ * or set, its entries are returned.
+ *
+ * @static
+ * @memberOf _
+ * @since 4.0.0
+ * @alias entriesIn
+ * @category Object
+ * @param {Object} object The object to query.
+ * @returns {Array} Returns the key-value pairs.
+ * @example
+ *
+ * function Foo() {
+ * this.a = 1;
+ * this.b = 2;
+ * }
+ *
+ * Foo.prototype.c = 3;
+ *
+ * _.toPairsIn(new Foo);
+ * // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed)
+ */ var toPairsIn = createToPairs(keysIn);
+ /**
+ * An alternative to `_.reduce`; this method transforms `object` to a new
+ * `accumulator` object which is the result of running each of its own
+ * enumerable string keyed properties thru `iteratee`, with each invocation
+ * potentially mutating the `accumulator` object. If `accumulator` is not
+ * provided, a new object with the same `[[Prototype]]` will be used. The
+ * iteratee is invoked with four arguments: (accumulator, value, key, object).
+ * Iteratee functions may exit iteration early by explicitly returning `false`.
+ *
+ * @static
+ * @memberOf _
+ * @since 1.3.0
+ * @category Object
+ * @param {Object} object The object to iterate over.
+ * @param {Function} [iteratee=_.identity] The function invoked per iteration.
+ * @param {*} [accumulator] The custom accumulator value.
+ * @returns {*} Returns the accumulated value.
+ * @example
+ *
+ * _.transform([2, 3, 4], function(result, n) {
+ * result.push(n *= n);
+ * return n % 2 == 0;
+ * }, []);
+ * // => [4, 9]
+ *
+ * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
+ * (result[value] || (result[value] = [])).push(key);
+ * }, {});
+ * // => { '1': ['a', 'c'], '2': ['b'] }
+ */ function transform(object, iteratee, accumulator) {
+ var isArr = isArray(object),
+ isArrLike = isArr || isBuffer(object) || isTypedArray(object);
+ iteratee = getIteratee(iteratee, 4);
+ if (accumulator == null) {
+ var Ctor = object && object.constructor;
+ if (isArrLike) {
+ accumulator = isArr ? new Ctor() : [];
+ } else if (isObject(object)) {
+ accumulator = isFunction(Ctor)
+ ? baseCreate(getPrototype(object))
+ : {};
+ } else {
+ accumulator = {};
+ }
+ }
+ (isArrLike ? arrayEach : baseForOwn)(object, function(
+ value,
+ index,
+ object
+ ) {
+ return iteratee(accumulator, value, index, object);
+ });
+ return accumulator;
+ }
+ /**
+ * Removes the property at `path` of `object`.
+ *
+ * **Note:** This method mutates `object`.
+ *
+ * @static
+ * @memberOf _
+ * @since 4.0.0
+ * @category Object
+ * @param {Object} object The object to modify.
+ * @param {Array|string} path The path of the property to unset.
+ * @returns {boolean} Returns `true` if the property is deleted, else `false`.
+ * @example
+ *
+ * var object = { 'a': [{ 'b': { 'c': 7 } }] };
+ * _.unset(object, 'a[0].b.c');
+ * // => true
+ *
+ * console.log(object);
+ * // => { 'a': [{ 'b': {} }] };
+ *
+ * _.unset(object, ['a', '0', 'b', 'c']);
+ * // => true
+ *
+ * console.log(object);
+ * // => { 'a': [{ 'b': {} }] };
+ */ function unset(object, path) {
+ return object == null ? true : baseUnset(object, path);
+ }
+ /**
+ * This method is like `_.set` except that accepts `updater` to produce the
+ * value to set. Use `_.updateWith` to customize `path` creation. The `updater`
+ * is invoked with one argument: (value).
+ *
+ * **Note:** This method mutates `object`.
+ *
+ * @static
+ * @memberOf _
+ * @since 4.6.0
+ * @category Object
+ * @param {Object} object The object to modify.
+ * @param {Array|string} path The path of the property to set.
+ * @param {Function} updater The function to produce the updated value.
+ * @returns {Object} Returns `object`.
+ * @example
+ *
+ * var object = { 'a': [{ 'b': { 'c': 3 } }] };
+ *
+ * _.update(object, 'a[0].b.c', function(n) { return n * n; });
+ * console.log(object.a[0].b.c);
+ * // => 9
+ *
+ * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; });
+ * console.log(object.x[0].y.z);
+ * // => 0
+ */ function update(object, path, updater) {
+ return object == null
+ ? object
+ : baseUpdate(object, path, castFunction(updater));
+ }
+ /**
+ * This method is like `_.update` except that it accepts `customizer` which is
+ * invoked to produce the objects of `path`. If `customizer` returns `undefined`
+ * path creation is handled by the method instead. The `customizer` is invoked
+ * with three arguments: (nsValue, key, nsObject).
+ *
+ * **Note:** This method mutates `object`.
+ *
+ * @static
+ * @memberOf _
+ * @since 4.6.0
+ * @category Object
+ * @param {Object} object The object to modify.
+ * @param {Array|string} path The path of the property to set.
+ * @param {Function} updater The function to produce the updated value.
+ * @param {Function} [customizer] The function to customize assigned values.
+ * @returns {Object} Returns `object`.
+ * @example
+ *
+ * var object = {};
+ *
+ * _.updateWith(object, '[0][1]', _.constant('a'), Object);
+ * // => { '0': { '1': 'a' } }
+ */ function updateWith(object, path, updater, customizer) {
+ customizer =
+ typeof customizer == "function" ? customizer : undefined;
+ return object == null
+ ? object
+ : baseUpdate(object, path, castFunction(updater), customizer);
+ }
+ /**
+ * Creates an array of the own enumerable string keyed property values of `object`.
+ *
+ * **Note:** Non-object values are coerced to objects.
+ *
+ * @static
+ * @since 0.1.0
+ * @memberOf _
+ * @category Object
+ * @param {Object} object The object to query.
+ * @returns {Array} Returns the array of property values.
+ * @example
+ *
+ * function Foo() {
+ * this.a = 1;
+ * this.b = 2;
+ * }
+ *
+ * Foo.prototype.c = 3;
+ *
+ * _.values(new Foo);
+ * // => [1, 2] (iteration order is not guaranteed)
+ *
+ * _.values('hi');
+ * // => ['h', 'i']
+ */ function values(object) {
+ return object == null ? [] : baseValues(object, keys(object));
+ }
+ /**
+ * Creates an array of the own and inherited enumerable string keyed property
+ * values of `object`.
+ *
+ * **Note:** Non-object values are coerced to objects.
+ *
+ * @static
+ * @memberOf _
+ * @since 3.0.0
+ * @category Object
+ * @param {Object} object The object to query.
+ * @returns {Array} Returns the array of property values.
+ * @example
+ *
+ * function Foo() {
+ * this.a = 1;
+ * this.b = 2;
+ * }
+ *
+ * Foo.prototype.c = 3;
+ *
+ * _.valuesIn(new Foo);
+ * // => [1, 2, 3] (iteration order is not guaranteed)
+ */ function valuesIn(object) {
+ return object == null ? [] : baseValues(object, keysIn(object));
+ }
+ /*------------------------------------------------------------------------*/ /**
+ * Clamps `number` within the inclusive `lower` and `upper` bounds.
+ *
+ * @static
+ * @memberOf _
+ * @since 4.0.0
+ * @category Number
+ * @param {number} number The number to clamp.
+ * @param {number} [lower] The lower bound.
+ * @param {number} upper The upper bound.
+ * @returns {number} Returns the clamped number.
+ * @example
+ *
+ * _.clamp(-10, -5, 5);
+ * // => -5
+ *
+ * _.clamp(10, -5, 5);
+ * // => 5
+ */ function clamp(number, lower, upper) {
+ if (upper === undefined) {
+ upper = lower;
+ lower = undefined;
+ }
+ if (upper !== undefined) {
+ upper = toNumber(upper);
+ upper = upper === upper ? upper : 0;
+ }
+ if (lower !== undefined) {
+ lower = toNumber(lower);
+ lower = lower === lower ? lower : 0;
+ }
+ return baseClamp(toNumber(number), lower, upper);
+ }
+ /**
+ * Checks if `n` is between `start` and up to, but not including, `end`. If
+ * `end` is not specified, it's set to `start` with `start` then set to `0`.
+ * If `start` is greater than `end` the params are swapped to support
+ * negative ranges.
+ *
+ * @static
+ * @memberOf _
+ * @since 3.3.0
+ * @category Number
+ * @param {number} number The number to check.
+ * @param {number} [start=0] The start of the range.
+ * @param {number} end The end of the range.
+ * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
+ * @see _.range, _.rangeRight
+ * @example
+ *
+ * _.inRange(3, 2, 4);
+ * // => true
+ *
+ * _.inRange(4, 8);
+ * // => true
+ *
+ * _.inRange(4, 2);
+ * // => false
+ *
+ * _.inRange(2, 2);
+ * // => false
+ *
+ * _.inRange(1.2, 2);
+ * // => true
+ *
+ * _.inRange(5.2, 4);
+ * // => false
+ *
+ * _.inRange(-3, -2, -6);
+ * // => true
+ */ function inRange(number, start, end) {
+ start = toFinite(start);
+ if (end === undefined) {
+ end = start;
+ start = 0;
+ } else {
+ end = toFinite(end);
+ }
+ number = toNumber(number);
+ return baseInRange(number, start, end);
+ }
+ /**
+ * Produces a random number between the inclusive `lower` and `upper` bounds.
+ * If only one argument is provided a number between `0` and the given number
+ * is returned. If `floating` is `true`, or either `lower` or `upper` are
+ * floats, a floating-point number is returned instead of an integer.
+ *
+ * **Note:** JavaScript follows the IEEE-754 standard for resolving
+ * floating-point values which can produce unexpected results.
+ *
+ * @static
+ * @memberOf _
+ * @since 0.7.0
+ * @category Number
+ * @param {number} [lower=0] The lower bound.
+ * @param {number} [upper=1] The upper bound.
+ * @param {boolean} [floating] Specify returning a floating-point number.
+ * @returns {number} Returns the random number.
+ * @example
+ *
+ * _.random(0, 5);
+ * // => an integer between 0 and 5
+ *
+ * _.random(5);
+ * // => also an integer between 0 and 5
+ *
+ * _.random(5, true);
+ * // => a floating-point number between 0 and 5
+ *
+ * _.random(1.2, 5.2);
+ * // => a floating-point number between 1.2 and 5.2
+ */ function random(lower, upper, floating) {
+ if (
+ floating &&
+ typeof floating != "boolean" &&
+ isIterateeCall(lower, upper, floating)
+ ) {
+ upper = floating = undefined;
+ }
+ if (floating === undefined) {
+ if (typeof upper == "boolean") {
+ floating = upper;
+ upper = undefined;
+ } else if (typeof lower == "boolean") {
+ floating = lower;
+ lower = undefined;
+ }
+ }
+ if (lower === undefined && upper === undefined) {
+ lower = 0;
+ upper = 1;
+ } else {
+ lower = toFinite(lower);
+ if (upper === undefined) {
+ upper = lower;
+ lower = 0;
+ } else {
+ upper = toFinite(upper);
+ }
+ }
+ if (lower > upper) {
+ var temp = lower;
+ lower = upper;
+ upper = temp;
+ }
+ if (floating || lower % 1 || upper % 1) {
+ var rand = nativeRandom();
+ return nativeMin(
+ lower +
+ rand *
+ (upper -
+ lower +
+ freeParseFloat("1e-" + ((rand + "").length - 1))),
+ upper
+ );
+ }
+ return baseRandom(lower, upper);
+ }
+ /*------------------------------------------------------------------------*/ /**
+ * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).
+ *
+ * @static
+ * @memberOf _
+ * @since 3.0.0
+ * @category String
+ * @param {string} [string=''] The string to convert.
+ * @returns {string} Returns the camel cased string.
+ * @example
+ *
+ * _.camelCase('Foo Bar');
+ * // => 'fooBar'
+ *
+ * _.camelCase('--foo-bar--');
+ * // => 'fooBar'
+ *
+ * _.camelCase('__FOO_BAR__');
+ * // => 'fooBar'
+ */ var camelCase = createCompounder(function(
+ result,
+ word,
+ index
+ ) {
+ word = word.toLowerCase();
+ return result + (index ? capitalize(word) : word);
+ });
+ /**
+ * Converts the first character of `string` to upper case and the remaining
+ * to lower case.
+ *
+ * @static
+ * @memberOf _
+ * @since 3.0.0
+ * @category String
+ * @param {string} [string=''] The string to capitalize.
+ * @returns {string} Returns the capitalized string.
+ * @example
+ *
+ * _.capitalize('FRED');
+ * // => 'Fred'
+ */ function capitalize(string) {
+ return upperFirst(toString(string).toLowerCase());
+ }
+ /**
+ * Deburrs `string` by converting
+ * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)
+ * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)
+ * letters to basic Latin letters and removing
+ * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).
+ *
+ * @static
+ * @memberOf _
+ * @since 3.0.0
+ * @category String
+ * @param {string} [string=''] The string to deburr.
+ * @returns {string} Returns the deburred string.
+ * @example
+ *
+ * _.deburr('déjà vu');
+ * // => 'deja vu'
+ */ function deburr(string) {
+ string = toString(string);
+ return (
+ string &&
+ string.replace(reLatin, deburrLetter).replace(reComboMark, "")
+ );
+ }
+ /**
+ * Checks if `string` ends with the given target string.
+ *
+ * @static
+ * @memberOf _
+ * @since 3.0.0
+ * @category String
+ * @param {string} [string=''] The string to inspect.
+ * @param {string} [target] The string to search for.
+ * @param {number} [position=string.length] The position to search up to.
+ * @returns {boolean} Returns `true` if `string` ends with `target`,
+ * else `false`.
+ * @example
+ *
+ * _.endsWith('abc', 'c');
+ * // => true
+ *
+ * _.endsWith('abc', 'b');
+ * // => false
+ *
+ * _.endsWith('abc', 'b', 2);
+ * // => true
+ */ function endsWith(string, target, position) {
+ string = toString(string);
+ target = baseToString(target);
+ var length = string.length;
+ position =
+ position === undefined
+ ? length
+ : baseClamp(toInteger(position), 0, length);
+ var end = position;
+ position -= target.length;
+ return position >= 0 && string.slice(position, end) == target;
+ }
+ /**
+ * Converts the characters "&", "<", ">", '"', and "'" in `string` to their
+ * corresponding HTML entities.
+ *
+ * **Note:** No other characters are escaped. To escape additional
+ * characters use a third-party library like [_he_](https://mths.be/he).
+ *
+ * Though the ">" character is escaped for symmetry, characters like
+ * ">" and "/" don't need escaping in HTML and have no special meaning
+ * unless they're part of a tag or unquoted attribute value. See
+ * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)
+ * (under "semi-related fun fact") for more details.
+ *
+ * When working with HTML you should always
+ * [quote attribute values](http://wonko.com/post/html-escaping) to reduce
+ * XSS vectors.
+ *
+ * @static
+ * @since 0.1.0
+ * @memberOf _
+ * @category String
+ * @param {string} [string=''] The string to escape.
+ * @returns {string} Returns the escaped string.
+ * @example
+ *
+ * _.escape('fred, barney, & pebbles');
+ * // => 'fred, barney, & pebbles'
+ */ function escape(string) {
+ string = toString(string);
+ return string && reHasUnescapedHtml.test(string)
+ ? string.replace(reUnescapedHtml, escapeHtmlChar)
+ : string;
+ }
+ /**
+ * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+",
+ * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`.
+ *
+ * @static
+ * @memberOf _
+ * @since 3.0.0
+ * @category String
+ * @param {string} [string=''] The string to escape.
+ * @returns {string} Returns the escaped string.
+ * @example
+ *
+ * _.escapeRegExp('[lodash](https://lodash.com/)');
+ * // => '\[lodash\]\(https://lodash\.com/\)'
+ */ function escapeRegExp(string) {
+ string = toString(string);
+ return string && reHasRegExpChar.test(string)
+ ? string.replace(reRegExpChar, "\\$&")
+ : string;
+ }
+ /**
+ * Converts `string` to
+ * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).
+ *
+ * @static
+ * @memberOf _
+ * @since 3.0.0
+ * @category String
+ * @param {string} [string=''] The string to convert.
+ * @returns {string} Returns the kebab cased string.
+ * @example
+ *
+ * _.kebabCase('Foo Bar');
+ * // => 'foo-bar'
+ *
+ * _.kebabCase('fooBar');
+ * // => 'foo-bar'
+ *
+ * _.kebabCase('__FOO_BAR__');
+ * // => 'foo-bar'
+ */ var kebabCase = createCompounder(function(
+ result,
+ word,
+ index
+ ) {
+ return result + (index ? "-" : "") + word.toLowerCase();
+ });
+ /**
+ * Converts `string`, as space separated words, to lower case.
+ *
+ * @static
+ * @memberOf _
+ * @since 4.0.0
+ * @category String
+ * @param {string} [string=''] The string to convert.
+ * @returns {string} Returns the lower cased string.
+ * @example
+ *
+ * _.lowerCase('--Foo-Bar--');
+ * // => 'foo bar'
+ *
+ * _.lowerCase('fooBar');
+ * // => 'foo bar'
+ *
+ * _.lowerCase('__FOO_BAR__');
+ * // => 'foo bar'
+ */ var lowerCase = createCompounder(function(
+ result,
+ word,
+ index
+ ) {
+ return result + (index ? " " : "") + word.toLowerCase();
+ });
+ /**
+ * Converts the first character of `string` to lower case.
+ *
+ * @static
+ * @memberOf _
+ * @since 4.0.0
+ * @category String
+ * @param {string} [string=''] The string to convert.
+ * @returns {string} Returns the converted string.
+ * @example
+ *
+ * _.lowerFirst('Fred');
+ * // => 'fred'
+ *
+ * _.lowerFirst('FRED');
+ * // => 'fRED'
+ */ var lowerFirst = createCaseFirst("toLowerCase");
+ /**
+ * Pads `string` on the left and right sides if it's shorter than `length`.
+ * Padding characters are truncated if they can't be evenly divided by `length`.
+ *
+ * @static
+ * @memberOf _
+ * @since 3.0.0
+ * @category String
+ * @param {string} [string=''] The string to pad.
+ * @param {number} [length=0] The padding length.
+ * @param {string} [chars=' '] The string used as padding.
+ * @returns {string} Returns the padded string.
+ * @example
+ *
+ * _.pad('abc', 8);
+ * // => ' abc '
+ *
+ * _.pad('abc', 8, '_-');
+ * // => '_-abc_-_'
+ *
+ * _.pad('abc', 3);
+ * // => 'abc'
+ */ function pad(string, length, chars) {
+ string = toString(string);
+ length = toInteger(length);
+ var strLength = length ? stringSize(string) : 0;
+ if (!length || strLength >= length) {
+ return string;
+ }
+ var mid = (length - strLength) / 2;
+ return (
+ createPadding(nativeFloor(mid), chars) +
+ string +
+ createPadding(nativeCeil(mid), chars)
+ );
+ }
+ /**
+ * Pads `string` on the right side if it's shorter than `length`. Padding
+ * characters are truncated if they exceed `length`.
+ *
+ * @static
+ * @memberOf _
+ * @since 4.0.0
+ * @category String
+ * @param {string} [string=''] The string to pad.
+ * @param {number} [length=0] The padding length.
+ * @param {string} [chars=' '] The string used as padding.
+ * @returns {string} Returns the padded string.
+ * @example
+ *
+ * _.padEnd('abc', 6);
+ * // => 'abc '
+ *
+ * _.padEnd('abc', 6, '_-');
+ * // => 'abc_-_'
+ *
+ * _.padEnd('abc', 3);
+ * // => 'abc'
+ */ function padEnd(string, length, chars) {
+ string = toString(string);
+ length = toInteger(length);
+ var strLength = length ? stringSize(string) : 0;
+ return length && strLength < length
+ ? string + createPadding(length - strLength, chars)
+ : string;
+ }
+ /**
+ * Pads `string` on the left side if it's shorter than `length`. Padding
+ * characters are truncated if they exceed `length`.
+ *
+ * @static
+ * @memberOf _
+ * @since 4.0.0
+ * @category String
+ * @param {string} [string=''] The string to pad.
+ * @param {number} [length=0] The padding length.
+ * @param {string} [chars=' '] The string used as padding.
+ * @returns {string} Returns the padded string.
+ * @example
+ *
+ * _.padStart('abc', 6);
+ * // => ' abc'
+ *
+ * _.padStart('abc', 6, '_-');
+ * // => '_-_abc'
+ *
+ * _.padStart('abc', 3);
+ * // => 'abc'
+ */ function padStart(string, length, chars) {
+ string = toString(string);
+ length = toInteger(length);
+ var strLength = length ? stringSize(string) : 0;
+ return length && strLength < length
+ ? createPadding(length - strLength, chars) + string
+ : string;
+ }
+ /**
+ * Converts `string` to an integer of the specified radix. If `radix` is
+ * `undefined` or `0`, a `radix` of `10` is used unless `value` is a
+ * hexadecimal, in which case a `radix` of `16` is used.
+ *
+ * **Note:** This method aligns with the
+ * [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`.
+ *
+ * @static
+ * @memberOf _
+ * @since 1.1.0
+ * @category String
+ * @param {string} string The string to convert.
+ * @param {number} [radix=10] The radix to interpret `value` by.
+ * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
+ * @returns {number} Returns the converted integer.
+ * @example
+ *
+ * _.parseInt('08');
+ * // => 8
+ *
+ * _.map(['6', '08', '10'], _.parseInt);
+ * // => [6, 8, 10]
+ */ function parseInt(string, radix, guard) {
+ if (guard || radix == null) {
+ radix = 0;
+ } else if (radix) {
+ radix = +radix;
+ }
+ return nativeParseInt(
+ toString(string).replace(reTrimStart, ""),
+ radix || 0
+ );
+ }
+ /**
+ * Repeats the given string `n` times.
+ *
+ * @static
+ * @memberOf _
+ * @since 3.0.0
+ * @category String
+ * @param {string} [string=''] The string to repeat.
+ * @param {number} [n=1] The number of times to repeat the string.
+ * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
+ * @returns {string} Returns the repeated string.
+ * @example
+ *
+ * _.repeat('*', 3);
+ * // => '***'
+ *
+ * _.repeat('abc', 2);
+ * // => 'abcabc'
+ *
+ * _.repeat('abc', 0);
+ * // => ''
+ */ function repeat(string, n, guard) {
+ if (
+ guard ? isIterateeCall(string, n, guard) : n === undefined
+ ) {
+ n = 1;
+ } else {
+ n = toInteger(n);
+ }
+ return baseRepeat(toString(string), n);
+ }
+ /**
+ * Replaces matches for `pattern` in `string` with `replacement`.
+ *
+ * **Note:** This method is based on
+ * [`String#replace`](https://mdn.io/String/replace).
+ *
+ * @static
+ * @memberOf _
+ * @since 4.0.0
+ * @category String
+ * @param {string} [string=''] The string to modify.
+ * @param {RegExp|string} pattern The pattern to replace.
+ * @param {Function|string} replacement The match replacement.
+ * @returns {string} Returns the modified string.
+ * @example
+ *
+ * _.replace('Hi Fred', 'Fred', 'Barney');
+ * // => 'Hi Barney'
+ */ function replace() {
+ var args = arguments,
+ string = toString(args[0]);
+ return args.length < 3
+ ? string
+ : string.replace(args[1], args[2]);
+ }
+ /**
+ * Converts `string` to
+ * [snake case](https://en.wikipedia.org/wiki/Snake_case).
+ *
+ * @static
+ * @memberOf _
+ * @since 3.0.0
+ * @category String
+ * @param {string} [string=''] The string to convert.
+ * @returns {string} Returns the snake cased string.
+ * @example
+ *
+ * _.snakeCase('Foo Bar');
+ * // => 'foo_bar'
+ *
+ * _.snakeCase('fooBar');
+ * // => 'foo_bar'
+ *
+ * _.snakeCase('--FOO-BAR--');
+ * // => 'foo_bar'
+ */ var snakeCase = createCompounder(function(
+ result,
+ word,
+ index
+ ) {
+ return result + (index ? "_" : "") + word.toLowerCase();
+ });
+ /**
+ * Splits `string` by `separator`.
+ *
+ * **Note:** This method is based on
+ * [`String#split`](https://mdn.io/String/split).
+ *
+ * @static
+ * @memberOf _
+ * @since 4.0.0
+ * @category String
+ * @param {string} [string=''] The string to split.
+ * @param {RegExp|string} separator The separator pattern to split by.
+ * @param {number} [limit] The length to truncate results to.
+ * @returns {Array} Returns the string segments.
+ * @example
+ *
+ * _.split('a-b-c', '-', 2);
+ * // => ['a', 'b']
+ */ function split(string, separator, limit) {
+ if (
+ limit &&
+ typeof limit != "number" &&
+ isIterateeCall(string, separator, limit)
+ ) {
+ separator = limit = undefined;
+ }
+ limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0;
+ if (!limit) {
+ return [];
+ }
+ string = toString(string);
+ if (
+ string &&
+ (typeof separator == "string" ||
+ (separator != null && !isRegExp(separator)))
+ ) {
+ separator = baseToString(separator);
+ if (!separator && hasUnicode(string)) {
+ return castSlice(stringToArray(string), 0, limit);
+ }
+ }
+ return string.split(separator, limit);
+ }
+ /**
+ * Converts `string` to
+ * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).
+ *
+ * @static
+ * @memberOf _
+ * @since 3.1.0
+ * @category String
+ * @param {string} [string=''] The string to convert.
+ * @returns {string} Returns the start cased string.
+ * @example
+ *
+ * _.startCase('--foo-bar--');
+ * // => 'Foo Bar'
+ *
+ * _.startCase('fooBar');
+ * // => 'Foo Bar'
+ *
+ * _.startCase('__FOO_BAR__');
+ * // => 'FOO BAR'
+ */ var startCase = createCompounder(function(
+ result,
+ word,
+ index
+ ) {
+ return result + (index ? " " : "") + upperFirst(word);
+ });
+ /**
+ * Checks if `string` starts with the given target string.
+ *
+ * @static
+ * @memberOf _
+ * @since 3.0.0
+ * @category String
+ * @param {string} [string=''] The string to inspect.
+ * @param {string} [target] The string to search for.
+ * @param {number} [position=0] The position to search from.
+ * @returns {boolean} Returns `true` if `string` starts with `target`,
+ * else `false`.
+ * @example
+ *
+ * _.startsWith('abc', 'a');
+ * // => true
+ *
+ * _.startsWith('abc', 'b');
+ * // => false
+ *
+ * _.startsWith('abc', 'b', 1);
+ * // => true
+ */ function startsWith(string, target, position) {
+ string = toString(string);
+ position =
+ position == null
+ ? 0
+ : baseClamp(toInteger(position), 0, string.length);
+ target = baseToString(target);
+ return (
+ string.slice(position, position + target.length) == target
+ );
+ }
+ /**
+ * Creates a compiled template function that can interpolate data properties
+ * in "interpolate" delimiters, HTML-escape interpolated data properties in
+ * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data
+ * properties may be accessed as free variables in the template. If a setting
+ * object is given, it takes precedence over `_.templateSettings` values.
+ *
+ * **Note:** In the development build `_.template` utilizes
+ * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)
+ * for easier debugging.
+ *
+ * For more information on precompiling templates see
+ * [lodash's custom builds documentation](https://lodash.com/custom-builds).
+ *
+ * For more information on Chrome extension sandboxes see
+ * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval).
+ *
+ * @static
+ * @since 0.1.0
+ * @memberOf _
+ * @category String
+ * @param {string} [string=''] The template string.
+ * @param {Object} [options={}] The options object.
+ * @param {RegExp} [options.escape=_.templateSettings.escape]
+ * The HTML "escape" delimiter.
+ * @param {RegExp} [options.evaluate=_.templateSettings.evaluate]
+ * The "evaluate" delimiter.
+ * @param {Object} [options.imports=_.templateSettings.imports]
+ * An object to import into the template as free variables.
+ * @param {RegExp} [options.interpolate=_.templateSettings.interpolate]
+ * The "interpolate" delimiter.
+ * @param {string} [options.sourceURL='lodash.templateSources[n]']
+ * The sourceURL of the compiled template.
+ * @param {string} [options.variable='obj']
+ * The data object variable name.
+ * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
+ * @returns {Function} Returns the compiled template function.
+ * @example
+ *
+ * // Use the "interpolate" delimiter to create a compiled template.
+ * var compiled = _.template('hello <%= user %>!');
+ * compiled({ 'user': 'fred' });
+ * // => 'hello fred!'
+ *
+ * // Use the HTML "escape" delimiter to escape data property values.
+ * var compiled = _.template('<%- value %> ');
+ * compiled({ 'value': '