diff --git a/node_modules/.bin/acorn b/node_modules/.bin/acorn deleted file mode 100644 index 46a3e61a1..000000000 --- a/node_modules/.bin/acorn +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") - -case `uname` in - *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;; -esac - -if [ -x "$basedir/node" ]; then - exec "$basedir/node" "$basedir/../acorn/bin/acorn" "$@" -else - exec node "$basedir/../acorn/bin/acorn" "$@" -fi diff --git a/node_modules/.bin/acorn b/node_modules/.bin/acorn new file mode 120000 index 000000000..cf7676038 --- /dev/null +++ b/node_modules/.bin/acorn @@ -0,0 +1 @@ +../acorn/bin/acorn \ No newline at end of file diff --git a/node_modules/.bin/acorn.cmd b/node_modules/.bin/acorn.cmd deleted file mode 100644 index a9324df95..000000000 --- a/node_modules/.bin/acorn.cmd +++ /dev/null @@ -1,17 +0,0 @@ -@ECHO off -GOTO start -:find_dp0 -SET dp0=%~dp0 -EXIT /b -:start -SETLOCAL -CALL :find_dp0 - -IF EXIST "%dp0%\node.exe" ( - SET "_prog=%dp0%\node.exe" -) ELSE ( - SET "_prog=node" - SET PATHEXT=%PATHEXT:;.JS;=;% -) - -endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\acorn\bin\acorn" %* diff --git a/node_modules/.bin/acorn.ps1 b/node_modules/.bin/acorn.ps1 deleted file mode 100644 index 6f6dcddf3..000000000 --- a/node_modules/.bin/acorn.ps1 +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env pwsh -$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent - -$exe="" -if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { - # Fix case when both the Windows and Linux builds of Node - # are installed in the same directory - $exe=".exe" -} -$ret=0 -if (Test-Path "$basedir/node$exe") { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "$basedir/node$exe" "$basedir/../acorn/bin/acorn" $args - } else { - & "$basedir/node$exe" "$basedir/../acorn/bin/acorn" $args - } - $ret=$LASTEXITCODE -} else { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "node$exe" "$basedir/../acorn/bin/acorn" $args - } else { - & "node$exe" "$basedir/../acorn/bin/acorn" $args - } - $ret=$LASTEXITCODE -} -exit $ret diff --git a/node_modules/.bin/atob b/node_modules/.bin/atob deleted file mode 100644 index 6d8ec0eef..000000000 --- a/node_modules/.bin/atob +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") - -case `uname` in - *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;; -esac - -if [ -x "$basedir/node" ]; then - exec "$basedir/node" "$basedir/../atob/bin/atob.js" "$@" -else - exec node "$basedir/../atob/bin/atob.js" "$@" -fi diff --git a/node_modules/.bin/atob b/node_modules/.bin/atob new file mode 120000 index 000000000..a68344a38 --- /dev/null +++ b/node_modules/.bin/atob @@ -0,0 +1 @@ +../atob/bin/atob.js \ No newline at end of file diff --git a/node_modules/.bin/atob.cmd b/node_modules/.bin/atob.cmd deleted file mode 100644 index 850a60b95..000000000 --- a/node_modules/.bin/atob.cmd +++ /dev/null @@ -1,17 +0,0 @@ -@ECHO off -GOTO start -:find_dp0 -SET dp0=%~dp0 -EXIT /b -:start -SETLOCAL -CALL :find_dp0 - -IF EXIST "%dp0%\node.exe" ( - SET "_prog=%dp0%\node.exe" -) ELSE ( - SET "_prog=node" - SET PATHEXT=%PATHEXT:;.JS;=;% -) - -endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\atob\bin\atob.js" %* diff --git a/node_modules/.bin/atob.ps1 b/node_modules/.bin/atob.ps1 deleted file mode 100644 index 4a9f311bd..000000000 --- a/node_modules/.bin/atob.ps1 +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env pwsh -$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent - -$exe="" -if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { - # Fix case when both the Windows and Linux builds of Node - # are installed in the same directory - $exe=".exe" -} -$ret=0 -if (Test-Path "$basedir/node$exe") { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "$basedir/node$exe" "$basedir/../atob/bin/atob.js" $args - } else { - & "$basedir/node$exe" "$basedir/../atob/bin/atob.js" $args - } - $ret=$LASTEXITCODE -} else { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "node$exe" "$basedir/../atob/bin/atob.js" $args - } else { - & "node$exe" "$basedir/../atob/bin/atob.js" $args - } - $ret=$LASTEXITCODE -} -exit $ret diff --git a/node_modules/.bin/decompress-zip b/node_modules/.bin/decompress-zip deleted file mode 100644 index 1d84b2252..000000000 --- a/node_modules/.bin/decompress-zip +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") - -case `uname` in - *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;; -esac - -if [ -x "$basedir/node" ]; then - exec "$basedir/node" "$basedir/../decompress-zip/bin/decompress-zip" "$@" -else - exec node "$basedir/../decompress-zip/bin/decompress-zip" "$@" -fi diff --git a/node_modules/.bin/decompress-zip b/node_modules/.bin/decompress-zip new file mode 120000 index 000000000..832552916 --- /dev/null +++ b/node_modules/.bin/decompress-zip @@ -0,0 +1 @@ +../decompress-zip/bin/decompress-zip \ No newline at end of file diff --git a/node_modules/.bin/decompress-zip.cmd b/node_modules/.bin/decompress-zip.cmd deleted file mode 100644 index a791e260b..000000000 --- a/node_modules/.bin/decompress-zip.cmd +++ /dev/null @@ -1,17 +0,0 @@ -@ECHO off -GOTO start -:find_dp0 -SET dp0=%~dp0 -EXIT /b -:start -SETLOCAL -CALL :find_dp0 - -IF EXIST "%dp0%\node.exe" ( - SET "_prog=%dp0%\node.exe" -) ELSE ( - SET "_prog=node" - SET PATHEXT=%PATHEXT:;.JS;=;% -) - -endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\decompress-zip\bin\decompress-zip" %* diff --git a/node_modules/.bin/decompress-zip.ps1 b/node_modules/.bin/decompress-zip.ps1 deleted file mode 100644 index d2937443f..000000000 --- a/node_modules/.bin/decompress-zip.ps1 +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env pwsh -$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent - -$exe="" -if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { - # Fix case when both the Windows and Linux builds of Node - # are installed in the same directory - $exe=".exe" -} -$ret=0 -if (Test-Path "$basedir/node$exe") { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "$basedir/node$exe" "$basedir/../decompress-zip/bin/decompress-zip" $args - } else { - & "$basedir/node$exe" "$basedir/../decompress-zip/bin/decompress-zip" $args - } - $ret=$LASTEXITCODE -} else { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "node$exe" "$basedir/../decompress-zip/bin/decompress-zip" $args - } else { - & "node$exe" "$basedir/../decompress-zip/bin/decompress-zip" $args - } - $ret=$LASTEXITCODE -} -exit $ret diff --git a/node_modules/.bin/escodegen b/node_modules/.bin/escodegen deleted file mode 100644 index 63c8e9931..000000000 --- a/node_modules/.bin/escodegen +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") - -case `uname` in - *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;; -esac - -if [ -x "$basedir/node" ]; then - exec "$basedir/node" "$basedir/../escodegen/bin/escodegen.js" "$@" -else - exec node "$basedir/../escodegen/bin/escodegen.js" "$@" -fi diff --git a/node_modules/.bin/escodegen b/node_modules/.bin/escodegen new file mode 120000 index 000000000..01a7c3259 --- /dev/null +++ b/node_modules/.bin/escodegen @@ -0,0 +1 @@ +../escodegen/bin/escodegen.js \ No newline at end of file diff --git a/node_modules/.bin/escodegen.cmd b/node_modules/.bin/escodegen.cmd deleted file mode 100644 index 9ac38a744..000000000 --- a/node_modules/.bin/escodegen.cmd +++ /dev/null @@ -1,17 +0,0 @@ -@ECHO off -GOTO start -:find_dp0 -SET dp0=%~dp0 -EXIT /b -:start -SETLOCAL -CALL :find_dp0 - -IF EXIST "%dp0%\node.exe" ( - SET "_prog=%dp0%\node.exe" -) ELSE ( - SET "_prog=node" - SET PATHEXT=%PATHEXT:;.JS;=;% -) - -endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\escodegen\bin\escodegen.js" %* diff --git a/node_modules/.bin/escodegen.ps1 b/node_modules/.bin/escodegen.ps1 deleted file mode 100644 index 61d258e10..000000000 --- a/node_modules/.bin/escodegen.ps1 +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env pwsh -$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent - -$exe="" -if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { - # Fix case when both the Windows and Linux builds of Node - # are installed in the same directory - $exe=".exe" -} -$ret=0 -if (Test-Path "$basedir/node$exe") { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "$basedir/node$exe" "$basedir/../escodegen/bin/escodegen.js" $args - } else { - & "$basedir/node$exe" "$basedir/../escodegen/bin/escodegen.js" $args - } - $ret=$LASTEXITCODE -} else { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "node$exe" "$basedir/../escodegen/bin/escodegen.js" $args - } else { - & "node$exe" "$basedir/../escodegen/bin/escodegen.js" $args - } - $ret=$LASTEXITCODE -} -exit $ret diff --git a/node_modules/.bin/esgenerate b/node_modules/.bin/esgenerate deleted file mode 100644 index 710797a61..000000000 --- a/node_modules/.bin/esgenerate +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") - -case `uname` in - *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;; -esac - -if [ -x "$basedir/node" ]; then - exec "$basedir/node" "$basedir/../escodegen/bin/esgenerate.js" "$@" -else - exec node "$basedir/../escodegen/bin/esgenerate.js" "$@" -fi diff --git a/node_modules/.bin/esgenerate b/node_modules/.bin/esgenerate new file mode 120000 index 000000000..7d0293e66 --- /dev/null +++ b/node_modules/.bin/esgenerate @@ -0,0 +1 @@ +../escodegen/bin/esgenerate.js \ No newline at end of file diff --git a/node_modules/.bin/esgenerate.cmd b/node_modules/.bin/esgenerate.cmd deleted file mode 100644 index 5c6426ddd..000000000 --- a/node_modules/.bin/esgenerate.cmd +++ /dev/null @@ -1,17 +0,0 @@ -@ECHO off -GOTO start -:find_dp0 -SET dp0=%~dp0 -EXIT /b -:start -SETLOCAL -CALL :find_dp0 - -IF EXIST "%dp0%\node.exe" ( - SET "_prog=%dp0%\node.exe" -) ELSE ( - SET "_prog=node" - SET PATHEXT=%PATHEXT:;.JS;=;% -) - -endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\escodegen\bin\esgenerate.js" %* diff --git a/node_modules/.bin/esgenerate.ps1 b/node_modules/.bin/esgenerate.ps1 deleted file mode 100644 index 8835d6075..000000000 --- a/node_modules/.bin/esgenerate.ps1 +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env pwsh -$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent - -$exe="" -if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { - # Fix case when both the Windows and Linux builds of Node - # are installed in the same directory - $exe=".exe" -} -$ret=0 -if (Test-Path "$basedir/node$exe") { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "$basedir/node$exe" "$basedir/../escodegen/bin/esgenerate.js" $args - } else { - & "$basedir/node$exe" "$basedir/../escodegen/bin/esgenerate.js" $args - } - $ret=$LASTEXITCODE -} else { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "node$exe" "$basedir/../escodegen/bin/esgenerate.js" $args - } else { - & "node$exe" "$basedir/../escodegen/bin/esgenerate.js" $args - } - $ret=$LASTEXITCODE -} -exit $ret diff --git a/node_modules/.bin/esparse b/node_modules/.bin/esparse deleted file mode 100644 index 1cc1c96ff..000000000 --- a/node_modules/.bin/esparse +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") - -case `uname` in - *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;; -esac - -if [ -x "$basedir/node" ]; then - exec "$basedir/node" "$basedir/../esprima/bin/esparse.js" "$@" -else - exec node "$basedir/../esprima/bin/esparse.js" "$@" -fi diff --git a/node_modules/.bin/esparse b/node_modules/.bin/esparse new file mode 120000 index 000000000..7423b18b2 --- /dev/null +++ b/node_modules/.bin/esparse @@ -0,0 +1 @@ +../esprima/bin/esparse.js \ No newline at end of file diff --git a/node_modules/.bin/esparse.cmd b/node_modules/.bin/esparse.cmd deleted file mode 100644 index 2ca6d502e..000000000 --- a/node_modules/.bin/esparse.cmd +++ /dev/null @@ -1,17 +0,0 @@ -@ECHO off -GOTO start -:find_dp0 -SET dp0=%~dp0 -EXIT /b -:start -SETLOCAL -CALL :find_dp0 - -IF EXIST "%dp0%\node.exe" ( - SET "_prog=%dp0%\node.exe" -) ELSE ( - SET "_prog=node" - SET PATHEXT=%PATHEXT:;.JS;=;% -) - -endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\esprima\bin\esparse.js" %* diff --git a/node_modules/.bin/esparse.ps1 b/node_modules/.bin/esparse.ps1 deleted file mode 100644 index f19ed7301..000000000 --- a/node_modules/.bin/esparse.ps1 +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env pwsh -$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent - -$exe="" -if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { - # Fix case when both the Windows and Linux builds of Node - # are installed in the same directory - $exe=".exe" -} -$ret=0 -if (Test-Path "$basedir/node$exe") { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "$basedir/node$exe" "$basedir/../esprima/bin/esparse.js" $args - } else { - & "$basedir/node$exe" "$basedir/../esprima/bin/esparse.js" $args - } - $ret=$LASTEXITCODE -} else { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "node$exe" "$basedir/../esprima/bin/esparse.js" $args - } else { - & "node$exe" "$basedir/../esprima/bin/esparse.js" $args - } - $ret=$LASTEXITCODE -} -exit $ret diff --git a/node_modules/.bin/esvalidate b/node_modules/.bin/esvalidate deleted file mode 100644 index 91a4c9b5f..000000000 --- a/node_modules/.bin/esvalidate +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") - -case `uname` in - *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;; -esac - -if [ -x "$basedir/node" ]; then - exec "$basedir/node" "$basedir/../esprima/bin/esvalidate.js" "$@" -else - exec node "$basedir/../esprima/bin/esvalidate.js" "$@" -fi diff --git a/node_modules/.bin/esvalidate b/node_modules/.bin/esvalidate new file mode 120000 index 000000000..16069effb --- /dev/null +++ b/node_modules/.bin/esvalidate @@ -0,0 +1 @@ +../esprima/bin/esvalidate.js \ No newline at end of file diff --git a/node_modules/.bin/esvalidate.cmd b/node_modules/.bin/esvalidate.cmd deleted file mode 100644 index 4c41643ef..000000000 --- a/node_modules/.bin/esvalidate.cmd +++ /dev/null @@ -1,17 +0,0 @@ -@ECHO off -GOTO start -:find_dp0 -SET dp0=%~dp0 -EXIT /b -:start -SETLOCAL -CALL :find_dp0 - -IF EXIST "%dp0%\node.exe" ( - SET "_prog=%dp0%\node.exe" -) ELSE ( - SET "_prog=node" - SET PATHEXT=%PATHEXT:;.JS;=;% -) - -endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\esprima\bin\esvalidate.js" %* diff --git a/node_modules/.bin/esvalidate.ps1 b/node_modules/.bin/esvalidate.ps1 deleted file mode 100644 index 23699d11e..000000000 --- a/node_modules/.bin/esvalidate.ps1 +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env pwsh -$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent - -$exe="" -if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { - # Fix case when both the Windows and Linux builds of Node - # are installed in the same directory - $exe=".exe" -} -$ret=0 -if (Test-Path "$basedir/node$exe") { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "$basedir/node$exe" "$basedir/../esprima/bin/esvalidate.js" $args - } else { - & "$basedir/node$exe" "$basedir/../esprima/bin/esvalidate.js" $args - } - $ret=$LASTEXITCODE -} else { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "node$exe" "$basedir/../esprima/bin/esvalidate.js" $args - } else { - & "node$exe" "$basedir/../esprima/bin/esvalidate.js" $args - } - $ret=$LASTEXITCODE -} -exit $ret diff --git a/node_modules/.bin/import-local-fixture b/node_modules/.bin/import-local-fixture deleted file mode 100644 index 79e318001..000000000 --- a/node_modules/.bin/import-local-fixture +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") - -case `uname` in - *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;; -esac - -if [ -x "$basedir/node" ]; then - exec "$basedir/node" "$basedir/../import-local/fixtures/cli.js" "$@" -else - exec node "$basedir/../import-local/fixtures/cli.js" "$@" -fi diff --git a/node_modules/.bin/import-local-fixture b/node_modules/.bin/import-local-fixture new file mode 120000 index 000000000..ff4b10482 --- /dev/null +++ b/node_modules/.bin/import-local-fixture @@ -0,0 +1 @@ +../import-local/fixtures/cli.js \ No newline at end of file diff --git a/node_modules/.bin/import-local-fixture.cmd b/node_modules/.bin/import-local-fixture.cmd deleted file mode 100644 index 5a3f68598..000000000 --- a/node_modules/.bin/import-local-fixture.cmd +++ /dev/null @@ -1,17 +0,0 @@ -@ECHO off -GOTO start -:find_dp0 -SET dp0=%~dp0 -EXIT /b -:start -SETLOCAL -CALL :find_dp0 - -IF EXIST "%dp0%\node.exe" ( - SET "_prog=%dp0%\node.exe" -) ELSE ( - SET "_prog=node" - SET PATHEXT=%PATHEXT:;.JS;=;% -) - -endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\import-local\fixtures\cli.js" %* diff --git a/node_modules/.bin/import-local-fixture.ps1 b/node_modules/.bin/import-local-fixture.ps1 deleted file mode 100644 index 01ef78421..000000000 --- a/node_modules/.bin/import-local-fixture.ps1 +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env pwsh -$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent - -$exe="" -if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { - # Fix case when both the Windows and Linux builds of Node - # are installed in the same directory - $exe=".exe" -} -$ret=0 -if (Test-Path "$basedir/node$exe") { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "$basedir/node$exe" "$basedir/../import-local/fixtures/cli.js" $args - } else { - & "$basedir/node$exe" "$basedir/../import-local/fixtures/cli.js" $args - } - $ret=$LASTEXITCODE -} else { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "node$exe" "$basedir/../import-local/fixtures/cli.js" $args - } else { - & "node$exe" "$basedir/../import-local/fixtures/cli.js" $args - } - $ret=$LASTEXITCODE -} -exit $ret diff --git a/node_modules/.bin/is-ci b/node_modules/.bin/is-ci deleted file mode 100644 index c9b0db40e..000000000 --- a/node_modules/.bin/is-ci +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") - -case `uname` in - *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;; -esac - -if [ -x "$basedir/node" ]; then - exec "$basedir/node" "$basedir/../is-ci/bin.js" "$@" -else - exec node "$basedir/../is-ci/bin.js" "$@" -fi diff --git a/node_modules/.bin/is-ci b/node_modules/.bin/is-ci new file mode 120000 index 000000000..fe6aca6f5 --- /dev/null +++ b/node_modules/.bin/is-ci @@ -0,0 +1 @@ +../is-ci/bin.js \ No newline at end of file diff --git a/node_modules/.bin/is-ci.cmd b/node_modules/.bin/is-ci.cmd deleted file mode 100644 index 67e1e22ed..000000000 --- a/node_modules/.bin/is-ci.cmd +++ /dev/null @@ -1,17 +0,0 @@ -@ECHO off -GOTO start -:find_dp0 -SET dp0=%~dp0 -EXIT /b -:start -SETLOCAL -CALL :find_dp0 - -IF EXIST "%dp0%\node.exe" ( - SET "_prog=%dp0%\node.exe" -) ELSE ( - SET "_prog=node" - SET PATHEXT=%PATHEXT:;.JS;=;% -) - -endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\is-ci\bin.js" %* diff --git a/node_modules/.bin/is-ci.ps1 b/node_modules/.bin/is-ci.ps1 deleted file mode 100644 index 773a44d22..000000000 --- a/node_modules/.bin/is-ci.ps1 +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env pwsh -$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent - -$exe="" -if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { - # Fix case when both the Windows and Linux builds of Node - # are installed in the same directory - $exe=".exe" -} -$ret=0 -if (Test-Path "$basedir/node$exe") { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "$basedir/node$exe" "$basedir/../is-ci/bin.js" $args - } else { - & "$basedir/node$exe" "$basedir/../is-ci/bin.js" $args - } - $ret=$LASTEXITCODE -} else { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "node$exe" "$basedir/../is-ci/bin.js" $args - } else { - & "node$exe" "$basedir/../is-ci/bin.js" $args - } - $ret=$LASTEXITCODE -} -exit $ret diff --git a/node_modules/.bin/is-docker b/node_modules/.bin/is-docker deleted file mode 100644 index 9e457930e..000000000 --- a/node_modules/.bin/is-docker +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") - -case `uname` in - *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;; -esac - -if [ -x "$basedir/node" ]; then - exec "$basedir/node" "$basedir/../is-docker/cli.js" "$@" -else - exec node "$basedir/../is-docker/cli.js" "$@" -fi diff --git a/node_modules/.bin/is-docker b/node_modules/.bin/is-docker new file mode 120000 index 000000000..9896ba572 --- /dev/null +++ b/node_modules/.bin/is-docker @@ -0,0 +1 @@ +../is-docker/cli.js \ No newline at end of file diff --git a/node_modules/.bin/is-docker.cmd b/node_modules/.bin/is-docker.cmd deleted file mode 100644 index 79e76ca1e..000000000 --- a/node_modules/.bin/is-docker.cmd +++ /dev/null @@ -1,17 +0,0 @@ -@ECHO off -GOTO start -:find_dp0 -SET dp0=%~dp0 -EXIT /b -:start -SETLOCAL -CALL :find_dp0 - -IF EXIST "%dp0%\node.exe" ( - SET "_prog=%dp0%\node.exe" -) ELSE ( - SET "_prog=node" - SET PATHEXT=%PATHEXT:;.JS;=;% -) - -endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\is-docker\cli.js" %* diff --git a/node_modules/.bin/is-docker.ps1 b/node_modules/.bin/is-docker.ps1 deleted file mode 100644 index 742762537..000000000 --- a/node_modules/.bin/is-docker.ps1 +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env pwsh -$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent - -$exe="" -if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { - # Fix case when both the Windows and Linux builds of Node - # are installed in the same directory - $exe=".exe" -} -$ret=0 -if (Test-Path "$basedir/node$exe") { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "$basedir/node$exe" "$basedir/../is-docker/cli.js" $args - } else { - & "$basedir/node$exe" "$basedir/../is-docker/cli.js" $args - } - $ret=$LASTEXITCODE -} else { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "node$exe" "$basedir/../is-docker/cli.js" $args - } else { - & "node$exe" "$basedir/../is-docker/cli.js" $args - } - $ret=$LASTEXITCODE -} -exit $ret diff --git a/node_modules/.bin/jest b/node_modules/.bin/jest deleted file mode 100644 index e6376e84e..000000000 --- a/node_modules/.bin/jest +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") - -case `uname` in - *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;; -esac - -if [ -x "$basedir/node" ]; then - exec "$basedir/node" "$basedir/../jest/bin/jest.js" "$@" -else - exec node "$basedir/../jest/bin/jest.js" "$@" -fi diff --git a/node_modules/.bin/jest b/node_modules/.bin/jest new file mode 120000 index 000000000..61c186154 --- /dev/null +++ b/node_modules/.bin/jest @@ -0,0 +1 @@ +../jest/bin/jest.js \ No newline at end of file diff --git a/node_modules/.bin/jest-runtime b/node_modules/.bin/jest-runtime deleted file mode 100644 index d0e6388a0..000000000 --- a/node_modules/.bin/jest-runtime +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") - -case `uname` in - *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;; -esac - -if [ -x "$basedir/node" ]; then - exec "$basedir/node" "$basedir/../jest-runtime/bin/jest-runtime.js" "$@" -else - exec node "$basedir/../jest-runtime/bin/jest-runtime.js" "$@" -fi diff --git a/node_modules/.bin/jest-runtime b/node_modules/.bin/jest-runtime new file mode 120000 index 000000000..ec00171e0 --- /dev/null +++ b/node_modules/.bin/jest-runtime @@ -0,0 +1 @@ +../jest-runtime/bin/jest-runtime.js \ No newline at end of file diff --git a/node_modules/.bin/jest-runtime.cmd b/node_modules/.bin/jest-runtime.cmd deleted file mode 100644 index 624ef458c..000000000 --- a/node_modules/.bin/jest-runtime.cmd +++ /dev/null @@ -1,17 +0,0 @@ -@ECHO off -GOTO start -:find_dp0 -SET dp0=%~dp0 -EXIT /b -:start -SETLOCAL -CALL :find_dp0 - -IF EXIST "%dp0%\node.exe" ( - SET "_prog=%dp0%\node.exe" -) ELSE ( - SET "_prog=node" - SET PATHEXT=%PATHEXT:;.JS;=;% -) - -endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\jest-runtime\bin\jest-runtime.js" %* diff --git a/node_modules/.bin/jest-runtime.ps1 b/node_modules/.bin/jest-runtime.ps1 deleted file mode 100644 index c3d7facdf..000000000 --- a/node_modules/.bin/jest-runtime.ps1 +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env pwsh -$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent - -$exe="" -if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { - # Fix case when both the Windows and Linux builds of Node - # are installed in the same directory - $exe=".exe" -} -$ret=0 -if (Test-Path "$basedir/node$exe") { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "$basedir/node$exe" "$basedir/../jest-runtime/bin/jest-runtime.js" $args - } else { - & "$basedir/node$exe" "$basedir/../jest-runtime/bin/jest-runtime.js" $args - } - $ret=$LASTEXITCODE -} else { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "node$exe" "$basedir/../jest-runtime/bin/jest-runtime.js" $args - } else { - & "node$exe" "$basedir/../jest-runtime/bin/jest-runtime.js" $args - } - $ret=$LASTEXITCODE -} -exit $ret diff --git a/node_modules/.bin/jest.cmd b/node_modules/.bin/jest.cmd deleted file mode 100644 index 67a602ac5..000000000 --- a/node_modules/.bin/jest.cmd +++ /dev/null @@ -1,17 +0,0 @@ -@ECHO off -GOTO start -:find_dp0 -SET dp0=%~dp0 -EXIT /b -:start -SETLOCAL -CALL :find_dp0 - -IF EXIST "%dp0%\node.exe" ( - SET "_prog=%dp0%\node.exe" -) ELSE ( - SET "_prog=node" - SET PATHEXT=%PATHEXT:;.JS;=;% -) - -endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\jest\bin\jest.js" %* diff --git a/node_modules/.bin/jest.ps1 b/node_modules/.bin/jest.ps1 deleted file mode 100644 index 78a25637f..000000000 --- a/node_modules/.bin/jest.ps1 +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env pwsh -$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent - -$exe="" -if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { - # Fix case when both the Windows and Linux builds of Node - # are installed in the same directory - $exe=".exe" -} -$ret=0 -if (Test-Path "$basedir/node$exe") { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "$basedir/node$exe" "$basedir/../jest/bin/jest.js" $args - } else { - & "$basedir/node$exe" "$basedir/../jest/bin/jest.js" $args - } - $ret=$LASTEXITCODE -} else { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "node$exe" "$basedir/../jest/bin/jest.js" $args - } else { - & "node$exe" "$basedir/../jest/bin/jest.js" $args - } - $ret=$LASTEXITCODE -} -exit $ret diff --git a/node_modules/.bin/js-yaml b/node_modules/.bin/js-yaml deleted file mode 100644 index ed78a8682..000000000 --- a/node_modules/.bin/js-yaml +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") - -case `uname` in - *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;; -esac - -if [ -x "$basedir/node" ]; then - exec "$basedir/node" "$basedir/../js-yaml/bin/js-yaml.js" "$@" -else - exec node "$basedir/../js-yaml/bin/js-yaml.js" "$@" -fi diff --git a/node_modules/.bin/js-yaml b/node_modules/.bin/js-yaml new file mode 120000 index 000000000..9dbd010d4 --- /dev/null +++ b/node_modules/.bin/js-yaml @@ -0,0 +1 @@ +../js-yaml/bin/js-yaml.js \ No newline at end of file diff --git a/node_modules/.bin/js-yaml.cmd b/node_modules/.bin/js-yaml.cmd deleted file mode 100644 index 453312b6d..000000000 --- a/node_modules/.bin/js-yaml.cmd +++ /dev/null @@ -1,17 +0,0 @@ -@ECHO off -GOTO start -:find_dp0 -SET dp0=%~dp0 -EXIT /b -:start -SETLOCAL -CALL :find_dp0 - -IF EXIST "%dp0%\node.exe" ( - SET "_prog=%dp0%\node.exe" -) ELSE ( - SET "_prog=node" - SET PATHEXT=%PATHEXT:;.JS;=;% -) - -endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\js-yaml\bin\js-yaml.js" %* diff --git a/node_modules/.bin/js-yaml.ps1 b/node_modules/.bin/js-yaml.ps1 deleted file mode 100644 index 2acfc61c3..000000000 --- a/node_modules/.bin/js-yaml.ps1 +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env pwsh -$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent - -$exe="" -if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { - # Fix case when both the Windows and Linux builds of Node - # are installed in the same directory - $exe=".exe" -} -$ret=0 -if (Test-Path "$basedir/node$exe") { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "$basedir/node$exe" "$basedir/../js-yaml/bin/js-yaml.js" $args - } else { - & "$basedir/node$exe" "$basedir/../js-yaml/bin/js-yaml.js" $args - } - $ret=$LASTEXITCODE -} else { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "node$exe" "$basedir/../js-yaml/bin/js-yaml.js" $args - } else { - & "node$exe" "$basedir/../js-yaml/bin/js-yaml.js" $args - } - $ret=$LASTEXITCODE -} -exit $ret diff --git a/node_modules/.bin/jsesc b/node_modules/.bin/jsesc deleted file mode 100644 index e7105da30..000000000 --- a/node_modules/.bin/jsesc +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") - -case `uname` in - *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;; -esac - -if [ -x "$basedir/node" ]; then - exec "$basedir/node" "$basedir/../jsesc/bin/jsesc" "$@" -else - exec node "$basedir/../jsesc/bin/jsesc" "$@" -fi diff --git a/node_modules/.bin/jsesc b/node_modules/.bin/jsesc new file mode 120000 index 000000000..7237604c3 --- /dev/null +++ b/node_modules/.bin/jsesc @@ -0,0 +1 @@ +../jsesc/bin/jsesc \ No newline at end of file diff --git a/node_modules/.bin/jsesc.cmd b/node_modules/.bin/jsesc.cmd deleted file mode 100644 index eb41110f6..000000000 --- a/node_modules/.bin/jsesc.cmd +++ /dev/null @@ -1,17 +0,0 @@ -@ECHO off -GOTO start -:find_dp0 -SET dp0=%~dp0 -EXIT /b -:start -SETLOCAL -CALL :find_dp0 - -IF EXIST "%dp0%\node.exe" ( - SET "_prog=%dp0%\node.exe" -) ELSE ( - SET "_prog=node" - SET PATHEXT=%PATHEXT:;.JS;=;% -) - -endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\jsesc\bin\jsesc" %* diff --git a/node_modules/.bin/jsesc.ps1 b/node_modules/.bin/jsesc.ps1 deleted file mode 100644 index 6007e022f..000000000 --- a/node_modules/.bin/jsesc.ps1 +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env pwsh -$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent - -$exe="" -if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { - # Fix case when both the Windows and Linux builds of Node - # are installed in the same directory - $exe=".exe" -} -$ret=0 -if (Test-Path "$basedir/node$exe") { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "$basedir/node$exe" "$basedir/../jsesc/bin/jsesc" $args - } else { - & "$basedir/node$exe" "$basedir/../jsesc/bin/jsesc" $args - } - $ret=$LASTEXITCODE -} else { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "node$exe" "$basedir/../jsesc/bin/jsesc" $args - } else { - & "node$exe" "$basedir/../jsesc/bin/jsesc" $args - } - $ret=$LASTEXITCODE -} -exit $ret diff --git a/node_modules/.bin/json5 b/node_modules/.bin/json5 deleted file mode 100644 index 977b75071..000000000 --- a/node_modules/.bin/json5 +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") - -case `uname` in - *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;; -esac - -if [ -x "$basedir/node" ]; then - exec "$basedir/node" "$basedir/../json5/lib/cli.js" "$@" -else - exec node "$basedir/../json5/lib/cli.js" "$@" -fi diff --git a/node_modules/.bin/json5 b/node_modules/.bin/json5 new file mode 120000 index 000000000..217f37981 --- /dev/null +++ b/node_modules/.bin/json5 @@ -0,0 +1 @@ +../json5/lib/cli.js \ No newline at end of file diff --git a/node_modules/.bin/json5.cmd b/node_modules/.bin/json5.cmd deleted file mode 100644 index 95c137fe0..000000000 --- a/node_modules/.bin/json5.cmd +++ /dev/null @@ -1,17 +0,0 @@ -@ECHO off -GOTO start -:find_dp0 -SET dp0=%~dp0 -EXIT /b -:start -SETLOCAL -CALL :find_dp0 - -IF EXIST "%dp0%\node.exe" ( - SET "_prog=%dp0%\node.exe" -) ELSE ( - SET "_prog=node" - SET PATHEXT=%PATHEXT:;.JS;=;% -) - -endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\json5\lib\cli.js" %* diff --git a/node_modules/.bin/json5.ps1 b/node_modules/.bin/json5.ps1 deleted file mode 100644 index 8700ddbef..000000000 --- a/node_modules/.bin/json5.ps1 +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env pwsh -$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent - -$exe="" -if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { - # Fix case when both the Windows and Linux builds of Node - # are installed in the same directory - $exe=".exe" -} -$ret=0 -if (Test-Path "$basedir/node$exe") { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "$basedir/node$exe" "$basedir/../json5/lib/cli.js" $args - } else { - & "$basedir/node$exe" "$basedir/../json5/lib/cli.js" $args - } - $ret=$LASTEXITCODE -} else { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "node$exe" "$basedir/../json5/lib/cli.js" $args - } else { - & "node$exe" "$basedir/../json5/lib/cli.js" $args - } - $ret=$LASTEXITCODE -} -exit $ret diff --git a/node_modules/.bin/mkdirp b/node_modules/.bin/mkdirp deleted file mode 100644 index 6ba5765a8..000000000 --- a/node_modules/.bin/mkdirp +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") - -case `uname` in - *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;; -esac - -if [ -x "$basedir/node" ]; then - exec "$basedir/node" "$basedir/../mkdirp/bin/cmd.js" "$@" -else - exec node "$basedir/../mkdirp/bin/cmd.js" "$@" -fi diff --git a/node_modules/.bin/mkdirp b/node_modules/.bin/mkdirp new file mode 120000 index 000000000..017896ceb --- /dev/null +++ b/node_modules/.bin/mkdirp @@ -0,0 +1 @@ +../mkdirp/bin/cmd.js \ No newline at end of file diff --git a/node_modules/.bin/mkdirp.cmd b/node_modules/.bin/mkdirp.cmd deleted file mode 100644 index a865dd9f3..000000000 --- a/node_modules/.bin/mkdirp.cmd +++ /dev/null @@ -1,17 +0,0 @@ -@ECHO off -GOTO start -:find_dp0 -SET dp0=%~dp0 -EXIT /b -:start -SETLOCAL -CALL :find_dp0 - -IF EXIST "%dp0%\node.exe" ( - SET "_prog=%dp0%\node.exe" -) ELSE ( - SET "_prog=node" - SET PATHEXT=%PATHEXT:;.JS;=;% -) - -endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\mkdirp\bin\cmd.js" %* diff --git a/node_modules/.bin/mkdirp.ps1 b/node_modules/.bin/mkdirp.ps1 deleted file mode 100644 index 911e85466..000000000 --- a/node_modules/.bin/mkdirp.ps1 +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env pwsh -$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent - -$exe="" -if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { - # Fix case when both the Windows and Linux builds of Node - # are installed in the same directory - $exe=".exe" -} -$ret=0 -if (Test-Path "$basedir/node$exe") { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "$basedir/node$exe" "$basedir/../mkdirp/bin/cmd.js" $args - } else { - & "$basedir/node$exe" "$basedir/../mkdirp/bin/cmd.js" $args - } - $ret=$LASTEXITCODE -} else { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "node$exe" "$basedir/../mkdirp/bin/cmd.js" $args - } else { - & "node$exe" "$basedir/../mkdirp/bin/cmd.js" $args - } - $ret=$LASTEXITCODE -} -exit $ret diff --git a/node_modules/.bin/node-which b/node_modules/.bin/node-which deleted file mode 100644 index aece73531..000000000 --- a/node_modules/.bin/node-which +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") - -case `uname` in - *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;; -esac - -if [ -x "$basedir/node" ]; then - exec "$basedir/node" "$basedir/../which/bin/node-which" "$@" -else - exec node "$basedir/../which/bin/node-which" "$@" -fi diff --git a/node_modules/.bin/node-which b/node_modules/.bin/node-which new file mode 120000 index 000000000..6f8415ec5 --- /dev/null +++ b/node_modules/.bin/node-which @@ -0,0 +1 @@ +../which/bin/node-which \ No newline at end of file diff --git a/node_modules/.bin/node-which.cmd b/node_modules/.bin/node-which.cmd deleted file mode 100644 index 8738aed88..000000000 --- a/node_modules/.bin/node-which.cmd +++ /dev/null @@ -1,17 +0,0 @@ -@ECHO off -GOTO start -:find_dp0 -SET dp0=%~dp0 -EXIT /b -:start -SETLOCAL -CALL :find_dp0 - -IF EXIST "%dp0%\node.exe" ( - SET "_prog=%dp0%\node.exe" -) ELSE ( - SET "_prog=node" - SET PATHEXT=%PATHEXT:;.JS;=;% -) - -endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\which\bin\node-which" %* diff --git a/node_modules/.bin/node-which.ps1 b/node_modules/.bin/node-which.ps1 deleted file mode 100644 index cfb09e844..000000000 --- a/node_modules/.bin/node-which.ps1 +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env pwsh -$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent - -$exe="" -if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { - # Fix case when both the Windows and Linux builds of Node - # are installed in the same directory - $exe=".exe" -} -$ret=0 -if (Test-Path "$basedir/node$exe") { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "$basedir/node$exe" "$basedir/../which/bin/node-which" $args - } else { - & "$basedir/node$exe" "$basedir/../which/bin/node-which" $args - } - $ret=$LASTEXITCODE -} else { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "node$exe" "$basedir/../which/bin/node-which" $args - } else { - & "node$exe" "$basedir/../which/bin/node-which" $args - } - $ret=$LASTEXITCODE -} -exit $ret diff --git a/node_modules/.bin/nopt b/node_modules/.bin/nopt deleted file mode 100644 index f1ec43bc2..000000000 --- a/node_modules/.bin/nopt +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") - -case `uname` in - *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;; -esac - -if [ -x "$basedir/node" ]; then - exec "$basedir/node" "$basedir/../nopt/bin/nopt.js" "$@" -else - exec node "$basedir/../nopt/bin/nopt.js" "$@" -fi diff --git a/node_modules/.bin/nopt b/node_modules/.bin/nopt new file mode 120000 index 000000000..6b6566ea7 --- /dev/null +++ b/node_modules/.bin/nopt @@ -0,0 +1 @@ +../nopt/bin/nopt.js \ No newline at end of file diff --git a/node_modules/.bin/nopt.cmd b/node_modules/.bin/nopt.cmd deleted file mode 100644 index a7f38b3da..000000000 --- a/node_modules/.bin/nopt.cmd +++ /dev/null @@ -1,17 +0,0 @@ -@ECHO off -GOTO start -:find_dp0 -SET dp0=%~dp0 -EXIT /b -:start -SETLOCAL -CALL :find_dp0 - -IF EXIST "%dp0%\node.exe" ( - SET "_prog=%dp0%\node.exe" -) ELSE ( - SET "_prog=node" - SET PATHEXT=%PATHEXT:;.JS;=;% -) - -endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\nopt\bin\nopt.js" %* diff --git a/node_modules/.bin/nopt.ps1 b/node_modules/.bin/nopt.ps1 deleted file mode 100644 index 9d6ba56f6..000000000 --- a/node_modules/.bin/nopt.ps1 +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env pwsh -$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent - -$exe="" -if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { - # Fix case when both the Windows and Linux builds of Node - # are installed in the same directory - $exe=".exe" -} -$ret=0 -if (Test-Path "$basedir/node$exe") { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "$basedir/node$exe" "$basedir/../nopt/bin/nopt.js" $args - } else { - & "$basedir/node$exe" "$basedir/../nopt/bin/nopt.js" $args - } - $ret=$LASTEXITCODE -} else { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "node$exe" "$basedir/../nopt/bin/nopt.js" $args - } else { - & "node$exe" "$basedir/../nopt/bin/nopt.js" $args - } - $ret=$LASTEXITCODE -} -exit $ret diff --git a/node_modules/.bin/parser b/node_modules/.bin/parser deleted file mode 100644 index cb5b10d8a..000000000 --- a/node_modules/.bin/parser +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") - -case `uname` in - *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;; -esac - -if [ -x "$basedir/node" ]; then - exec "$basedir/node" "$basedir/../@babel/parser/bin/babel-parser.js" "$@" -else - exec node "$basedir/../@babel/parser/bin/babel-parser.js" "$@" -fi diff --git a/node_modules/.bin/parser b/node_modules/.bin/parser new file mode 120000 index 000000000..ce7bf97ef --- /dev/null +++ b/node_modules/.bin/parser @@ -0,0 +1 @@ +../@babel/parser/bin/babel-parser.js \ No newline at end of file diff --git a/node_modules/.bin/parser.cmd b/node_modules/.bin/parser.cmd deleted file mode 100644 index 1ad5c81c2..000000000 --- a/node_modules/.bin/parser.cmd +++ /dev/null @@ -1,17 +0,0 @@ -@ECHO off -GOTO start -:find_dp0 -SET dp0=%~dp0 -EXIT /b -:start -SETLOCAL -CALL :find_dp0 - -IF EXIST "%dp0%\node.exe" ( - SET "_prog=%dp0%\node.exe" -) ELSE ( - SET "_prog=node" - SET PATHEXT=%PATHEXT:;.JS;=;% -) - -endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\@babel\parser\bin\babel-parser.js" %* diff --git a/node_modules/.bin/parser.ps1 b/node_modules/.bin/parser.ps1 deleted file mode 100644 index 8926517b4..000000000 --- a/node_modules/.bin/parser.ps1 +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env pwsh -$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent - -$exe="" -if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { - # Fix case when both the Windows and Linux builds of Node - # are installed in the same directory - $exe=".exe" -} -$ret=0 -if (Test-Path "$basedir/node$exe") { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "$basedir/node$exe" "$basedir/../@babel/parser/bin/babel-parser.js" $args - } else { - & "$basedir/node$exe" "$basedir/../@babel/parser/bin/babel-parser.js" $args - } - $ret=$LASTEXITCODE -} else { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "node$exe" "$basedir/../@babel/parser/bin/babel-parser.js" $args - } else { - & "node$exe" "$basedir/../@babel/parser/bin/babel-parser.js" $args - } - $ret=$LASTEXITCODE -} -exit $ret diff --git a/node_modules/.bin/rimraf b/node_modules/.bin/rimraf deleted file mode 100644 index b81682550..000000000 --- a/node_modules/.bin/rimraf +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") - -case `uname` in - *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;; -esac - -if [ -x "$basedir/node" ]; then - exec "$basedir/node" "$basedir/../rimraf/bin.js" "$@" -else - exec node "$basedir/../rimraf/bin.js" "$@" -fi diff --git a/node_modules/.bin/rimraf b/node_modules/.bin/rimraf new file mode 120000 index 000000000..4cd49a49d --- /dev/null +++ b/node_modules/.bin/rimraf @@ -0,0 +1 @@ +../rimraf/bin.js \ No newline at end of file diff --git a/node_modules/.bin/rimraf.cmd b/node_modules/.bin/rimraf.cmd deleted file mode 100644 index 13f45eca3..000000000 --- a/node_modules/.bin/rimraf.cmd +++ /dev/null @@ -1,17 +0,0 @@ -@ECHO off -GOTO start -:find_dp0 -SET dp0=%~dp0 -EXIT /b -:start -SETLOCAL -CALL :find_dp0 - -IF EXIST "%dp0%\node.exe" ( - SET "_prog=%dp0%\node.exe" -) ELSE ( - SET "_prog=node" - SET PATHEXT=%PATHEXT:;.JS;=;% -) - -endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\rimraf\bin.js" %* diff --git a/node_modules/.bin/rimraf.ps1 b/node_modules/.bin/rimraf.ps1 deleted file mode 100644 index 17167914f..000000000 --- a/node_modules/.bin/rimraf.ps1 +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env pwsh -$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent - -$exe="" -if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { - # Fix case when both the Windows and Linux builds of Node - # are installed in the same directory - $exe=".exe" -} -$ret=0 -if (Test-Path "$basedir/node$exe") { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "$basedir/node$exe" "$basedir/../rimraf/bin.js" $args - } else { - & "$basedir/node$exe" "$basedir/../rimraf/bin.js" $args - } - $ret=$LASTEXITCODE -} else { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "node$exe" "$basedir/../rimraf/bin.js" $args - } else { - & "node$exe" "$basedir/../rimraf/bin.js" $args - } - $ret=$LASTEXITCODE -} -exit $ret diff --git a/node_modules/.bin/sane b/node_modules/.bin/sane deleted file mode 100644 index 54b02623b..000000000 --- a/node_modules/.bin/sane +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") - -case `uname` in - *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;; -esac - -if [ -x "$basedir/node" ]; then - exec "$basedir/node" "$basedir/../sane/src/cli.js" "$@" -else - exec node "$basedir/../sane/src/cli.js" "$@" -fi diff --git a/node_modules/.bin/sane b/node_modules/.bin/sane new file mode 120000 index 000000000..ab4163ba5 --- /dev/null +++ b/node_modules/.bin/sane @@ -0,0 +1 @@ +../sane/src/cli.js \ No newline at end of file diff --git a/node_modules/.bin/sane.cmd b/node_modules/.bin/sane.cmd deleted file mode 100644 index fa952e557..000000000 --- a/node_modules/.bin/sane.cmd +++ /dev/null @@ -1,17 +0,0 @@ -@ECHO off -GOTO start -:find_dp0 -SET dp0=%~dp0 -EXIT /b -:start -SETLOCAL -CALL :find_dp0 - -IF EXIST "%dp0%\node.exe" ( - SET "_prog=%dp0%\node.exe" -) ELSE ( - SET "_prog=node" - SET PATHEXT=%PATHEXT:;.JS;=;% -) - -endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\sane\src\cli.js" %* diff --git a/node_modules/.bin/sane.ps1 b/node_modules/.bin/sane.ps1 deleted file mode 100644 index ce27e1c24..000000000 --- a/node_modules/.bin/sane.ps1 +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env pwsh -$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent - -$exe="" -if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { - # Fix case when both the Windows and Linux builds of Node - # are installed in the same directory - $exe=".exe" -} -$ret=0 -if (Test-Path "$basedir/node$exe") { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "$basedir/node$exe" "$basedir/../sane/src/cli.js" $args - } else { - & "$basedir/node$exe" "$basedir/../sane/src/cli.js" $args - } - $ret=$LASTEXITCODE -} else { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "node$exe" "$basedir/../sane/src/cli.js" $args - } else { - & "node$exe" "$basedir/../sane/src/cli.js" $args - } - $ret=$LASTEXITCODE -} -exit $ret diff --git a/node_modules/.bin/semver b/node_modules/.bin/semver deleted file mode 100644 index 77443e787..000000000 --- a/node_modules/.bin/semver +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") - -case `uname` in - *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;; -esac - -if [ -x "$basedir/node" ]; then - exec "$basedir/node" "$basedir/../semver/bin/semver.js" "$@" -else - exec node "$basedir/../semver/bin/semver.js" "$@" -fi diff --git a/node_modules/.bin/semver b/node_modules/.bin/semver new file mode 120000 index 000000000..5aaadf42c --- /dev/null +++ b/node_modules/.bin/semver @@ -0,0 +1 @@ +../semver/bin/semver.js \ No newline at end of file diff --git a/node_modules/.bin/semver.cmd b/node_modules/.bin/semver.cmd deleted file mode 100644 index 9913fa9d0..000000000 --- a/node_modules/.bin/semver.cmd +++ /dev/null @@ -1,17 +0,0 @@ -@ECHO off -GOTO start -:find_dp0 -SET dp0=%~dp0 -EXIT /b -:start -SETLOCAL -CALL :find_dp0 - -IF EXIST "%dp0%\node.exe" ( - SET "_prog=%dp0%\node.exe" -) ELSE ( - SET "_prog=node" - SET PATHEXT=%PATHEXT:;.JS;=;% -) - -endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\semver\bin\semver.js" %* diff --git a/node_modules/.bin/semver.ps1 b/node_modules/.bin/semver.ps1 deleted file mode 100644 index 314717ad4..000000000 --- a/node_modules/.bin/semver.ps1 +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env pwsh -$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent - -$exe="" -if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { - # Fix case when both the Windows and Linux builds of Node - # are installed in the same directory - $exe=".exe" -} -$ret=0 -if (Test-Path "$basedir/node$exe") { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "$basedir/node$exe" "$basedir/../semver/bin/semver.js" $args - } else { - & "$basedir/node$exe" "$basedir/../semver/bin/semver.js" $args - } - $ret=$LASTEXITCODE -} else { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "node$exe" "$basedir/../semver/bin/semver.js" $args - } else { - & "node$exe" "$basedir/../semver/bin/semver.js" $args - } - $ret=$LASTEXITCODE -} -exit $ret diff --git a/node_modules/.bin/shjs b/node_modules/.bin/shjs deleted file mode 100644 index 39ae9cbab..000000000 --- a/node_modules/.bin/shjs +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") - -case `uname` in - *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;; -esac - -if [ -x "$basedir/node" ]; then - exec "$basedir/node" "$basedir/../shelljs/bin/shjs" "$@" -else - exec node "$basedir/../shelljs/bin/shjs" "$@" -fi diff --git a/node_modules/.bin/shjs b/node_modules/.bin/shjs new file mode 120000 index 000000000..a0449975b --- /dev/null +++ b/node_modules/.bin/shjs @@ -0,0 +1 @@ +../shelljs/bin/shjs \ No newline at end of file diff --git a/node_modules/.bin/shjs.cmd b/node_modules/.bin/shjs.cmd deleted file mode 100644 index fa4df35d1..000000000 --- a/node_modules/.bin/shjs.cmd +++ /dev/null @@ -1,17 +0,0 @@ -@ECHO off -GOTO start -:find_dp0 -SET dp0=%~dp0 -EXIT /b -:start -SETLOCAL -CALL :find_dp0 - -IF EXIST "%dp0%\node.exe" ( - SET "_prog=%dp0%\node.exe" -) ELSE ( - SET "_prog=node" - SET PATHEXT=%PATHEXT:;.JS;=;% -) - -endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\shelljs\bin\shjs" %* diff --git a/node_modules/.bin/shjs.ps1 b/node_modules/.bin/shjs.ps1 deleted file mode 100644 index c24e10423..000000000 --- a/node_modules/.bin/shjs.ps1 +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env pwsh -$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent - -$exe="" -if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { - # Fix case when both the Windows and Linux builds of Node - # are installed in the same directory - $exe=".exe" -} -$ret=0 -if (Test-Path "$basedir/node$exe") { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "$basedir/node$exe" "$basedir/../shelljs/bin/shjs" $args - } else { - & "$basedir/node$exe" "$basedir/../shelljs/bin/shjs" $args - } - $ret=$LASTEXITCODE -} else { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "node$exe" "$basedir/../shelljs/bin/shjs" $args - } else { - & "node$exe" "$basedir/../shelljs/bin/shjs" $args - } - $ret=$LASTEXITCODE -} -exit $ret diff --git a/node_modules/.bin/ts-jest b/node_modules/.bin/ts-jest deleted file mode 100644 index 3410df171..000000000 --- a/node_modules/.bin/ts-jest +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") - -case `uname` in - *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;; -esac - -if [ -x "$basedir/node" ]; then - exec "$basedir/node" "$basedir/../ts-jest/cli.js" "$@" -else - exec node "$basedir/../ts-jest/cli.js" "$@" -fi diff --git a/node_modules/.bin/ts-jest b/node_modules/.bin/ts-jest new file mode 120000 index 000000000..0f8a26ec4 --- /dev/null +++ b/node_modules/.bin/ts-jest @@ -0,0 +1 @@ +../ts-jest/cli.js \ No newline at end of file diff --git a/node_modules/.bin/ts-jest.cmd b/node_modules/.bin/ts-jest.cmd deleted file mode 100644 index 220f1b56c..000000000 --- a/node_modules/.bin/ts-jest.cmd +++ /dev/null @@ -1,17 +0,0 @@ -@ECHO off -GOTO start -:find_dp0 -SET dp0=%~dp0 -EXIT /b -:start -SETLOCAL -CALL :find_dp0 - -IF EXIST "%dp0%\node.exe" ( - SET "_prog=%dp0%\node.exe" -) ELSE ( - SET "_prog=node" - SET PATHEXT=%PATHEXT:;.JS;=;% -) - -endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\ts-jest\cli.js" %* diff --git a/node_modules/.bin/ts-jest.ps1 b/node_modules/.bin/ts-jest.ps1 deleted file mode 100644 index 145b8f791..000000000 --- a/node_modules/.bin/ts-jest.ps1 +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env pwsh -$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent - -$exe="" -if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { - # Fix case when both the Windows and Linux builds of Node - # are installed in the same directory - $exe=".exe" -} -$ret=0 -if (Test-Path "$basedir/node$exe") { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "$basedir/node$exe" "$basedir/../ts-jest/cli.js" $args - } else { - & "$basedir/node$exe" "$basedir/../ts-jest/cli.js" $args - } - $ret=$LASTEXITCODE -} else { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "node$exe" "$basedir/../ts-jest/cli.js" $args - } else { - & "node$exe" "$basedir/../ts-jest/cli.js" $args - } - $ret=$LASTEXITCODE -} -exit $ret diff --git a/node_modules/.bin/ts-node b/node_modules/.bin/ts-node deleted file mode 100644 index 54276ecc8..000000000 --- a/node_modules/.bin/ts-node +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") - -case `uname` in - *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;; -esac - -if [ -x "$basedir/node" ]; then - exec "$basedir/node" "$basedir/../ts-node/dist/bin.js" "$@" -else - exec node "$basedir/../ts-node/dist/bin.js" "$@" -fi diff --git a/node_modules/.bin/ts-node b/node_modules/.bin/ts-node new file mode 120000 index 000000000..b3ff94bcb --- /dev/null +++ b/node_modules/.bin/ts-node @@ -0,0 +1 @@ +../ts-node/dist/bin.js \ No newline at end of file diff --git a/node_modules/.bin/ts-node-script b/node_modules/.bin/ts-node-script deleted file mode 100644 index 82fbad1c3..000000000 --- a/node_modules/.bin/ts-node-script +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") - -case `uname` in - *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;; -esac - -if [ -x "$basedir/node" ]; then - exec "$basedir/node" "$basedir/../ts-node/dist/bin-script.js" "$@" -else - exec node "$basedir/../ts-node/dist/bin-script.js" "$@" -fi diff --git a/node_modules/.bin/ts-node-script b/node_modules/.bin/ts-node-script new file mode 120000 index 000000000..edc40b309 --- /dev/null +++ b/node_modules/.bin/ts-node-script @@ -0,0 +1 @@ +../ts-node/dist/bin-script.js \ No newline at end of file diff --git a/node_modules/.bin/ts-node-script.cmd b/node_modules/.bin/ts-node-script.cmd deleted file mode 100644 index 146251be7..000000000 --- a/node_modules/.bin/ts-node-script.cmd +++ /dev/null @@ -1,17 +0,0 @@ -@ECHO off -GOTO start -:find_dp0 -SET dp0=%~dp0 -EXIT /b -:start -SETLOCAL -CALL :find_dp0 - -IF EXIST "%dp0%\node.exe" ( - SET "_prog=%dp0%\node.exe" -) ELSE ( - SET "_prog=node" - SET PATHEXT=%PATHEXT:;.JS;=;% -) - -endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\ts-node\dist\bin-script.js" %* diff --git a/node_modules/.bin/ts-node-script.ps1 b/node_modules/.bin/ts-node-script.ps1 deleted file mode 100644 index 3061e8179..000000000 --- a/node_modules/.bin/ts-node-script.ps1 +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env pwsh -$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent - -$exe="" -if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { - # Fix case when both the Windows and Linux builds of Node - # are installed in the same directory - $exe=".exe" -} -$ret=0 -if (Test-Path "$basedir/node$exe") { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "$basedir/node$exe" "$basedir/../ts-node/dist/bin-script.js" $args - } else { - & "$basedir/node$exe" "$basedir/../ts-node/dist/bin-script.js" $args - } - $ret=$LASTEXITCODE -} else { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "node$exe" "$basedir/../ts-node/dist/bin-script.js" $args - } else { - & "node$exe" "$basedir/../ts-node/dist/bin-script.js" $args - } - $ret=$LASTEXITCODE -} -exit $ret diff --git a/node_modules/.bin/ts-node-transpile-only b/node_modules/.bin/ts-node-transpile-only deleted file mode 100644 index a7fc92abc..000000000 --- a/node_modules/.bin/ts-node-transpile-only +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") - -case `uname` in - *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;; -esac - -if [ -x "$basedir/node" ]; then - exec "$basedir/node" "$basedir/../ts-node/dist/bin-transpile.js" "$@" -else - exec node "$basedir/../ts-node/dist/bin-transpile.js" "$@" -fi diff --git a/node_modules/.bin/ts-node-transpile-only b/node_modules/.bin/ts-node-transpile-only new file mode 120000 index 000000000..173710d0b --- /dev/null +++ b/node_modules/.bin/ts-node-transpile-only @@ -0,0 +1 @@ +../ts-node/dist/bin-transpile.js \ No newline at end of file diff --git a/node_modules/.bin/ts-node-transpile-only.cmd b/node_modules/.bin/ts-node-transpile-only.cmd deleted file mode 100644 index 60b2af384..000000000 --- a/node_modules/.bin/ts-node-transpile-only.cmd +++ /dev/null @@ -1,17 +0,0 @@ -@ECHO off -GOTO start -:find_dp0 -SET dp0=%~dp0 -EXIT /b -:start -SETLOCAL -CALL :find_dp0 - -IF EXIST "%dp0%\node.exe" ( - SET "_prog=%dp0%\node.exe" -) ELSE ( - SET "_prog=node" - SET PATHEXT=%PATHEXT:;.JS;=;% -) - -endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\ts-node\dist\bin-transpile.js" %* diff --git a/node_modules/.bin/ts-node-transpile-only.ps1 b/node_modules/.bin/ts-node-transpile-only.ps1 deleted file mode 100644 index 9503db427..000000000 --- a/node_modules/.bin/ts-node-transpile-only.ps1 +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env pwsh -$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent - -$exe="" -if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { - # Fix case when both the Windows and Linux builds of Node - # are installed in the same directory - $exe=".exe" -} -$ret=0 -if (Test-Path "$basedir/node$exe") { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "$basedir/node$exe" "$basedir/../ts-node/dist/bin-transpile.js" $args - } else { - & "$basedir/node$exe" "$basedir/../ts-node/dist/bin-transpile.js" $args - } - $ret=$LASTEXITCODE -} else { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "node$exe" "$basedir/../ts-node/dist/bin-transpile.js" $args - } else { - & "node$exe" "$basedir/../ts-node/dist/bin-transpile.js" $args - } - $ret=$LASTEXITCODE -} -exit $ret diff --git a/node_modules/.bin/ts-node.cmd b/node_modules/.bin/ts-node.cmd deleted file mode 100644 index a2a9c924e..000000000 --- a/node_modules/.bin/ts-node.cmd +++ /dev/null @@ -1,17 +0,0 @@ -@ECHO off -GOTO start -:find_dp0 -SET dp0=%~dp0 -EXIT /b -:start -SETLOCAL -CALL :find_dp0 - -IF EXIST "%dp0%\node.exe" ( - SET "_prog=%dp0%\node.exe" -) ELSE ( - SET "_prog=node" - SET PATHEXT=%PATHEXT:;.JS;=;% -) - -endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\ts-node\dist\bin.js" %* diff --git a/node_modules/.bin/ts-node.ps1 b/node_modules/.bin/ts-node.ps1 deleted file mode 100644 index 90517a4a1..000000000 --- a/node_modules/.bin/ts-node.ps1 +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env pwsh -$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent - -$exe="" -if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { - # Fix case when both the Windows and Linux builds of Node - # are installed in the same directory - $exe=".exe" -} -$ret=0 -if (Test-Path "$basedir/node$exe") { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "$basedir/node$exe" "$basedir/../ts-node/dist/bin.js" $args - } else { - & "$basedir/node$exe" "$basedir/../ts-node/dist/bin.js" $args - } - $ret=$LASTEXITCODE -} else { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "node$exe" "$basedir/../ts-node/dist/bin.js" $args - } else { - & "node$exe" "$basedir/../ts-node/dist/bin.js" $args - } - $ret=$LASTEXITCODE -} -exit $ret diff --git a/node_modules/.bin/ts-script b/node_modules/.bin/ts-script deleted file mode 100644 index d776b64f8..000000000 --- a/node_modules/.bin/ts-script +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") - -case `uname` in - *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;; -esac - -if [ -x "$basedir/node" ]; then - exec "$basedir/node" "$basedir/../ts-node/dist/bin-script-deprecated.js" "$@" -else - exec node "$basedir/../ts-node/dist/bin-script-deprecated.js" "$@" -fi diff --git a/node_modules/.bin/ts-script b/node_modules/.bin/ts-script new file mode 120000 index 000000000..7382912f4 --- /dev/null +++ b/node_modules/.bin/ts-script @@ -0,0 +1 @@ +../ts-node/dist/bin-script-deprecated.js \ No newline at end of file diff --git a/node_modules/.bin/ts-script.cmd b/node_modules/.bin/ts-script.cmd deleted file mode 100644 index e3b0e81fe..000000000 --- a/node_modules/.bin/ts-script.cmd +++ /dev/null @@ -1,17 +0,0 @@ -@ECHO off -GOTO start -:find_dp0 -SET dp0=%~dp0 -EXIT /b -:start -SETLOCAL -CALL :find_dp0 - -IF EXIST "%dp0%\node.exe" ( - SET "_prog=%dp0%\node.exe" -) ELSE ( - SET "_prog=node" - SET PATHEXT=%PATHEXT:;.JS;=;% -) - -endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\ts-node\dist\bin-script-deprecated.js" %* diff --git a/node_modules/.bin/ts-script.ps1 b/node_modules/.bin/ts-script.ps1 deleted file mode 100644 index 1b348afb9..000000000 --- a/node_modules/.bin/ts-script.ps1 +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env pwsh -$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent - -$exe="" -if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { - # Fix case when both the Windows and Linux builds of Node - # are installed in the same directory - $exe=".exe" -} -$ret=0 -if (Test-Path "$basedir/node$exe") { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "$basedir/node$exe" "$basedir/../ts-node/dist/bin-script-deprecated.js" $args - } else { - & "$basedir/node$exe" "$basedir/../ts-node/dist/bin-script-deprecated.js" $args - } - $ret=$LASTEXITCODE -} else { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "node$exe" "$basedir/../ts-node/dist/bin-script-deprecated.js" $args - } else { - & "node$exe" "$basedir/../ts-node/dist/bin-script-deprecated.js" $args - } - $ret=$LASTEXITCODE -} -exit $ret diff --git a/node_modules/.bin/tsc b/node_modules/.bin/tsc deleted file mode 100644 index 49798517b..000000000 --- a/node_modules/.bin/tsc +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") - -case `uname` in - *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;; -esac - -if [ -x "$basedir/node" ]; then - exec "$basedir/node" "$basedir/../typescript/bin/tsc" "$@" -else - exec node "$basedir/../typescript/bin/tsc" "$@" -fi diff --git a/node_modules/.bin/tsc b/node_modules/.bin/tsc new file mode 120000 index 000000000..0863208a6 --- /dev/null +++ b/node_modules/.bin/tsc @@ -0,0 +1 @@ +../typescript/bin/tsc \ No newline at end of file diff --git a/node_modules/.bin/tsc.cmd b/node_modules/.bin/tsc.cmd deleted file mode 100644 index 40bf12845..000000000 --- a/node_modules/.bin/tsc.cmd +++ /dev/null @@ -1,17 +0,0 @@ -@ECHO off -GOTO start -:find_dp0 -SET dp0=%~dp0 -EXIT /b -:start -SETLOCAL -CALL :find_dp0 - -IF EXIST "%dp0%\node.exe" ( - SET "_prog=%dp0%\node.exe" -) ELSE ( - SET "_prog=node" - SET PATHEXT=%PATHEXT:;.JS;=;% -) - -endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\typescript\bin\tsc" %* diff --git a/node_modules/.bin/tsc.ps1 b/node_modules/.bin/tsc.ps1 deleted file mode 100644 index 112413b58..000000000 --- a/node_modules/.bin/tsc.ps1 +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env pwsh -$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent - -$exe="" -if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { - # Fix case when both the Windows and Linux builds of Node - # are installed in the same directory - $exe=".exe" -} -$ret=0 -if (Test-Path "$basedir/node$exe") { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "$basedir/node$exe" "$basedir/../typescript/bin/tsc" $args - } else { - & "$basedir/node$exe" "$basedir/../typescript/bin/tsc" $args - } - $ret=$LASTEXITCODE -} else { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "node$exe" "$basedir/../typescript/bin/tsc" $args - } else { - & "node$exe" "$basedir/../typescript/bin/tsc" $args - } - $ret=$LASTEXITCODE -} -exit $ret diff --git a/node_modules/.bin/tsserver b/node_modules/.bin/tsserver deleted file mode 100644 index cc53aac9e..000000000 --- a/node_modules/.bin/tsserver +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") - -case `uname` in - *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;; -esac - -if [ -x "$basedir/node" ]; then - exec "$basedir/node" "$basedir/../typescript/bin/tsserver" "$@" -else - exec node "$basedir/../typescript/bin/tsserver" "$@" -fi diff --git a/node_modules/.bin/tsserver b/node_modules/.bin/tsserver new file mode 120000 index 000000000..f8f8f1a0c --- /dev/null +++ b/node_modules/.bin/tsserver @@ -0,0 +1 @@ +../typescript/bin/tsserver \ No newline at end of file diff --git a/node_modules/.bin/tsserver.cmd b/node_modules/.bin/tsserver.cmd deleted file mode 100644 index 57f851fd7..000000000 --- a/node_modules/.bin/tsserver.cmd +++ /dev/null @@ -1,17 +0,0 @@ -@ECHO off -GOTO start -:find_dp0 -SET dp0=%~dp0 -EXIT /b -:start -SETLOCAL -CALL :find_dp0 - -IF EXIST "%dp0%\node.exe" ( - SET "_prog=%dp0%\node.exe" -) ELSE ( - SET "_prog=node" - SET PATHEXT=%PATHEXT:;.JS;=;% -) - -endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\typescript\bin\tsserver" %* diff --git a/node_modules/.bin/tsserver.ps1 b/node_modules/.bin/tsserver.ps1 deleted file mode 100644 index 249f417d2..000000000 --- a/node_modules/.bin/tsserver.ps1 +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env pwsh -$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent - -$exe="" -if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { - # Fix case when both the Windows and Linux builds of Node - # are installed in the same directory - $exe=".exe" -} -$ret=0 -if (Test-Path "$basedir/node$exe") { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "$basedir/node$exe" "$basedir/../typescript/bin/tsserver" $args - } else { - & "$basedir/node$exe" "$basedir/../typescript/bin/tsserver" $args - } - $ret=$LASTEXITCODE -} else { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "node$exe" "$basedir/../typescript/bin/tsserver" $args - } else { - & "node$exe" "$basedir/../typescript/bin/tsserver" $args - } - $ret=$LASTEXITCODE -} -exit $ret diff --git a/node_modules/.bin/uuid b/node_modules/.bin/uuid deleted file mode 100644 index 2cfa7bf7c..000000000 --- a/node_modules/.bin/uuid +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") - -case `uname` in - *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;; -esac - -if [ -x "$basedir/node" ]; then - exec "$basedir/node" "$basedir/../uuid/bin/uuid" "$@" -else - exec node "$basedir/../uuid/bin/uuid" "$@" -fi diff --git a/node_modules/.bin/uuid b/node_modules/.bin/uuid new file mode 120000 index 000000000..b3e45bc53 --- /dev/null +++ b/node_modules/.bin/uuid @@ -0,0 +1 @@ +../uuid/bin/uuid \ No newline at end of file diff --git a/node_modules/.bin/uuid.cmd b/node_modules/.bin/uuid.cmd deleted file mode 100644 index 5b5c3dc06..000000000 --- a/node_modules/.bin/uuid.cmd +++ /dev/null @@ -1,17 +0,0 @@ -@ECHO off -GOTO start -:find_dp0 -SET dp0=%~dp0 -EXIT /b -:start -SETLOCAL -CALL :find_dp0 - -IF EXIST "%dp0%\node.exe" ( - SET "_prog=%dp0%\node.exe" -) ELSE ( - SET "_prog=node" - SET PATHEXT=%PATHEXT:;.JS;=;% -) - -endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\uuid\bin\uuid" %* diff --git a/node_modules/.bin/uuid.ps1 b/node_modules/.bin/uuid.ps1 deleted file mode 100644 index 9e6c24b14..000000000 --- a/node_modules/.bin/uuid.ps1 +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env pwsh -$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent - -$exe="" -if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { - # Fix case when both the Windows and Linux builds of Node - # are installed in the same directory - $exe=".exe" -} -$ret=0 -if (Test-Path "$basedir/node$exe") { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "$basedir/node$exe" "$basedir/../uuid/bin/uuid" $args - } else { - & "$basedir/node$exe" "$basedir/../uuid/bin/uuid" $args - } - $ret=$LASTEXITCODE -} else { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "node$exe" "$basedir/../uuid/bin/uuid" $args - } else { - & "node$exe" "$basedir/../uuid/bin/uuid" $args - } - $ret=$LASTEXITCODE -} -exit $ret diff --git a/node_modules/.bin/watch b/node_modules/.bin/watch deleted file mode 100644 index 1c288a788..000000000 --- a/node_modules/.bin/watch +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") - -case `uname` in - *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;; -esac - -if [ -x "$basedir/node" ]; then - exec "$basedir/node" "$basedir/../@cnakazawa/watch/cli.js" "$@" -else - exec node "$basedir/../@cnakazawa/watch/cli.js" "$@" -fi diff --git a/node_modules/.bin/watch b/node_modules/.bin/watch new file mode 120000 index 000000000..6c62430b5 --- /dev/null +++ b/node_modules/.bin/watch @@ -0,0 +1 @@ +../@cnakazawa/watch/cli.js \ No newline at end of file diff --git a/node_modules/.bin/watch.cmd b/node_modules/.bin/watch.cmd deleted file mode 100644 index dd62d70cb..000000000 --- a/node_modules/.bin/watch.cmd +++ /dev/null @@ -1,17 +0,0 @@ -@ECHO off -GOTO start -:find_dp0 -SET dp0=%~dp0 -EXIT /b -:start -SETLOCAL -CALL :find_dp0 - -IF EXIST "%dp0%\node.exe" ( - SET "_prog=%dp0%\node.exe" -) ELSE ( - SET "_prog=node" - SET PATHEXT=%PATHEXT:;.JS;=;% -) - -endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\@cnakazawa\watch\cli.js" %* diff --git a/node_modules/.bin/watch.ps1 b/node_modules/.bin/watch.ps1 deleted file mode 100644 index 1cc1b8364..000000000 --- a/node_modules/.bin/watch.ps1 +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env pwsh -$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent - -$exe="" -if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { - # Fix case when both the Windows and Linux builds of Node - # are installed in the same directory - $exe=".exe" -} -$ret=0 -if (Test-Path "$basedir/node$exe") { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "$basedir/node$exe" "$basedir/../@cnakazawa/watch/cli.js" $args - } else { - & "$basedir/node$exe" "$basedir/../@cnakazawa/watch/cli.js" $args - } - $ret=$LASTEXITCODE -} else { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "node$exe" "$basedir/../@cnakazawa/watch/cli.js" $args - } else { - & "node$exe" "$basedir/../@cnakazawa/watch/cli.js" $args - } - $ret=$LASTEXITCODE -} -exit $ret diff --git a/node_modules/@actions/core/node_modules/.bin/uuid b/node_modules/@actions/core/node_modules/.bin/uuid deleted file mode 100644 index c3ec0035f..000000000 --- a/node_modules/@actions/core/node_modules/.bin/uuid +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") - -case `uname` in - *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;; -esac - -if [ -x "$basedir/node" ]; then - exec "$basedir/node" "$basedir/../uuid/dist/bin/uuid" "$@" -else - exec node "$basedir/../uuid/dist/bin/uuid" "$@" -fi diff --git a/node_modules/@actions/core/node_modules/.bin/uuid b/node_modules/@actions/core/node_modules/.bin/uuid new file mode 120000 index 000000000..588f70ecc --- /dev/null +++ b/node_modules/@actions/core/node_modules/.bin/uuid @@ -0,0 +1 @@ +../uuid/dist/bin/uuid \ No newline at end of file diff --git a/node_modules/@actions/core/node_modules/.bin/uuid.cmd b/node_modules/@actions/core/node_modules/.bin/uuid.cmd deleted file mode 100644 index 0f2376eaf..000000000 --- a/node_modules/@actions/core/node_modules/.bin/uuid.cmd +++ /dev/null @@ -1,17 +0,0 @@ -@ECHO off -GOTO start -:find_dp0 -SET dp0=%~dp0 -EXIT /b -:start -SETLOCAL -CALL :find_dp0 - -IF EXIST "%dp0%\node.exe" ( - SET "_prog=%dp0%\node.exe" -) ELSE ( - SET "_prog=node" - SET PATHEXT=%PATHEXT:;.JS;=;% -) - -endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\uuid\dist\bin\uuid" %* diff --git a/node_modules/@actions/core/node_modules/.bin/uuid.ps1 b/node_modules/@actions/core/node_modules/.bin/uuid.ps1 deleted file mode 100644 index 78046284b..000000000 --- a/node_modules/@actions/core/node_modules/.bin/uuid.ps1 +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env pwsh -$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent - -$exe="" -if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { - # Fix case when both the Windows and Linux builds of Node - # are installed in the same directory - $exe=".exe" -} -$ret=0 -if (Test-Path "$basedir/node$exe") { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "$basedir/node$exe" "$basedir/../uuid/dist/bin/uuid" $args - } else { - & "$basedir/node$exe" "$basedir/../uuid/dist/bin/uuid" $args - } - $ret=$LASTEXITCODE -} else { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "node$exe" "$basedir/../uuid/dist/bin/uuid" $args - } else { - & "node$exe" "$basedir/../uuid/dist/bin/uuid" $args - } - $ret=$LASTEXITCODE -} -exit $ret diff --git a/node_modules/@actions/core/node_modules/uuid/dist/bin/uuid b/node_modules/@actions/core/node_modules/uuid/dist/bin/uuid old mode 100644 new mode 100755 diff --git a/node_modules/@actions/io/package.json b/node_modules/@actions/io/package.json index 3a303f251..ce7820c20 100644 --- a/node_modules/@actions/io/package.json +++ b/node_modules/@actions/io/package.json @@ -32,8 +32,4 @@ "url": "https://github.com/actions/toolkit/issues" }, "gitHead": "a2ab4bcf78e4f7080f0d45856e6eeba16f0bbc52" - -,"_resolved": "https://registry.npmjs.org/@actions/io/-/io-1.0.1.tgz" -,"_integrity": "sha512-rhq+tfZukbtaus7xyUtwKfuiCRXd1hWSfmJNEpFgBQJ4woqPEpsBw04awicjwz9tyG2/MVhAEMfVn664Cri5zA==" -,"_from": "@actions/io@1.0.1" -} \ No newline at end of file +} diff --git a/node_modules/@babel/core/node_modules/.bin/semver b/node_modules/@babel/core/node_modules/.bin/semver deleted file mode 100644 index 86cee84b6..000000000 --- a/node_modules/@babel/core/node_modules/.bin/semver +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") - -case `uname` in - *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;; -esac - -if [ -x "$basedir/node" ]; then - exec "$basedir/node" "$basedir/../semver/bin/semver" "$@" -else - exec node "$basedir/../semver/bin/semver" "$@" -fi diff --git a/node_modules/@babel/core/node_modules/.bin/semver b/node_modules/@babel/core/node_modules/.bin/semver new file mode 120000 index 000000000..317eb293d --- /dev/null +++ b/node_modules/@babel/core/node_modules/.bin/semver @@ -0,0 +1 @@ +../semver/bin/semver \ No newline at end of file diff --git a/node_modules/@babel/core/node_modules/.bin/semver.cmd b/node_modules/@babel/core/node_modules/.bin/semver.cmd deleted file mode 100644 index 22d9286cd..000000000 --- a/node_modules/@babel/core/node_modules/.bin/semver.cmd +++ /dev/null @@ -1,17 +0,0 @@ -@ECHO off -GOTO start -:find_dp0 -SET dp0=%~dp0 -EXIT /b -:start -SETLOCAL -CALL :find_dp0 - -IF EXIST "%dp0%\node.exe" ( - SET "_prog=%dp0%\node.exe" -) ELSE ( - SET "_prog=node" - SET PATHEXT=%PATHEXT:;.JS;=;% -) - -endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\semver\bin\semver" %* diff --git a/node_modules/@babel/core/node_modules/.bin/semver.ps1 b/node_modules/@babel/core/node_modules/.bin/semver.ps1 deleted file mode 100644 index 98c1b093f..000000000 --- a/node_modules/@babel/core/node_modules/.bin/semver.ps1 +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env pwsh -$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent - -$exe="" -if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { - # Fix case when both the Windows and Linux builds of Node - # are installed in the same directory - $exe=".exe" -} -$ret=0 -if (Test-Path "$basedir/node$exe") { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "$basedir/node$exe" "$basedir/../semver/bin/semver" $args - } else { - & "$basedir/node$exe" "$basedir/../semver/bin/semver" $args - } - $ret=$LASTEXITCODE -} else { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "node$exe" "$basedir/../semver/bin/semver" $args - } else { - & "node$exe" "$basedir/../semver/bin/semver" $args - } - $ret=$LASTEXITCODE -} -exit $ret diff --git a/node_modules/@babel/core/node_modules/semver/bin/semver b/node_modules/@babel/core/node_modules/semver/bin/semver old mode 100644 new mode 100755 diff --git a/node_modules/@babel/highlight/node_modules/color-name/.npmignore b/node_modules/@babel/highlight/node_modules/color-name/.npmignore index 3854c07dc..f9f281648 100644 --- a/node_modules/@babel/highlight/node_modules/color-name/.npmignore +++ b/node_modules/@babel/highlight/node_modules/color-name/.npmignore @@ -1,107 +1,107 @@ -//this will affect all the git repos -git config --global core.excludesfile ~/.gitignore - - -//update files since .ignore won't if already tracked -git rm --cached - -# Compiled source # -################### -*.com -*.class -*.dll -*.exe -*.o -*.so - -# Packages # -############ -# it's better to unpack these files and commit the raw source -# git has its own built in compression methods -*.7z -*.dmg -*.gz -*.iso -*.jar -*.rar -*.tar -*.zip - -# Logs and databases # -###################### -*.log -*.sql -*.sqlite - -# OS generated files # -###################### -.DS_Store -.DS_Store? -._* -.Spotlight-V100 -.Trashes -# Icon? -ehthumbs.db -Thumbs.db -.cache -.project -.settings -.tmproj -*.esproj -nbproject - -# Numerous always-ignore extensions # -##################################### -*.diff -*.err -*.orig -*.rej -*.swn -*.swo -*.swp -*.vi -*~ -*.sass-cache -*.grunt -*.tmp - -# Dreamweaver added files # -########################### -_notes -dwsync.xml - -# Komodo # -########################### -*.komodoproject -.komodotools - -# Node # -##################### -node_modules - -# Bower # -##################### -bower_components - -# Folders to ignore # -##################### -.hg -.svn -.CVS -intermediate -publish -.idea -.graphics -_test -_archive -uploads -tmp - -# Vim files to ignore # -####################### -.VimballRecord -.netrwhist - -bundle.* - +//this will affect all the git repos +git config --global core.excludesfile ~/.gitignore + + +//update files since .ignore won't if already tracked +git rm --cached + +# Compiled source # +################### +*.com +*.class +*.dll +*.exe +*.o +*.so + +# Packages # +############ +# it's better to unpack these files and commit the raw source +# git has its own built in compression methods +*.7z +*.dmg +*.gz +*.iso +*.jar +*.rar +*.tar +*.zip + +# Logs and databases # +###################### +*.log +*.sql +*.sqlite + +# OS generated files # +###################### +.DS_Store +.DS_Store? +._* +.Spotlight-V100 +.Trashes +# Icon? +ehthumbs.db +Thumbs.db +.cache +.project +.settings +.tmproj +*.esproj +nbproject + +# Numerous always-ignore extensions # +##################################### +*.diff +*.err +*.orig +*.rej +*.swn +*.swo +*.swp +*.vi +*~ +*.sass-cache +*.grunt +*.tmp + +# Dreamweaver added files # +########################### +_notes +dwsync.xml + +# Komodo # +########################### +*.komodoproject +.komodotools + +# Node # +##################### +node_modules + +# Bower # +##################### +bower_components + +# Folders to ignore # +##################### +.hg +.svn +.CVS +intermediate +publish +.idea +.graphics +_test +_archive +uploads +tmp + +# Vim files to ignore # +####################### +.VimballRecord +.netrwhist + +bundle.* + _demo \ No newline at end of file diff --git a/node_modules/@babel/highlight/node_modules/color-name/LICENSE b/node_modules/@babel/highlight/node_modules/color-name/LICENSE index 4d9802a89..c6b100125 100644 --- a/node_modules/@babel/highlight/node_modules/color-name/LICENSE +++ b/node_modules/@babel/highlight/node_modules/color-name/LICENSE @@ -1,8 +1,8 @@ -The MIT License (MIT) -Copyright (c) 2015 Dmitry Ivanov - -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 MIT License (MIT) +Copyright (c) 2015 Dmitry Ivanov + +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. \ No newline at end of file diff --git a/node_modules/@babel/highlight/node_modules/color-name/README.md b/node_modules/@babel/highlight/node_modules/color-name/README.md index 3611a6b52..932b97917 100644 --- a/node_modules/@babel/highlight/node_modules/color-name/README.md +++ b/node_modules/@babel/highlight/node_modules/color-name/README.md @@ -1,11 +1,11 @@ -A JSON with color names and its values. Based on http://dev.w3.org/csswg/css-color/#named-colors. - -[![NPM](https://nodei.co/npm/color-name.png?mini=true)](https://nodei.co/npm/color-name/) - - -```js -var colors = require('color-name'); -colors.red //[255,0,0] -``` - - +A JSON with color names and its values. Based on http://dev.w3.org/csswg/css-color/#named-colors. + +[![NPM](https://nodei.co/npm/color-name.png?mini=true)](https://nodei.co/npm/color-name/) + + +```js +var colors = require('color-name'); +colors.red //[255,0,0] +``` + + diff --git a/node_modules/@babel/highlight/node_modules/color-name/index.js b/node_modules/@babel/highlight/node_modules/color-name/index.js index e42aa68a5..b7c198a6f 100644 --- a/node_modules/@babel/highlight/node_modules/color-name/index.js +++ b/node_modules/@babel/highlight/node_modules/color-name/index.js @@ -1,152 +1,152 @@ -'use strict' - -module.exports = { - "aliceblue": [240, 248, 255], - "antiquewhite": [250, 235, 215], - "aqua": [0, 255, 255], - "aquamarine": [127, 255, 212], - "azure": [240, 255, 255], - "beige": [245, 245, 220], - "bisque": [255, 228, 196], - "black": [0, 0, 0], - "blanchedalmond": [255, 235, 205], - "blue": [0, 0, 255], - "blueviolet": [138, 43, 226], - "brown": [165, 42, 42], - "burlywood": [222, 184, 135], - "cadetblue": [95, 158, 160], - "chartreuse": [127, 255, 0], - "chocolate": [210, 105, 30], - "coral": [255, 127, 80], - "cornflowerblue": [100, 149, 237], - "cornsilk": [255, 248, 220], - "crimson": [220, 20, 60], - "cyan": [0, 255, 255], - "darkblue": [0, 0, 139], - "darkcyan": [0, 139, 139], - "darkgoldenrod": [184, 134, 11], - "darkgray": [169, 169, 169], - "darkgreen": [0, 100, 0], - "darkgrey": [169, 169, 169], - "darkkhaki": [189, 183, 107], - "darkmagenta": [139, 0, 139], - "darkolivegreen": [85, 107, 47], - "darkorange": [255, 140, 0], - "darkorchid": [153, 50, 204], - "darkred": [139, 0, 0], - "darksalmon": [233, 150, 122], - "darkseagreen": [143, 188, 143], - "darkslateblue": [72, 61, 139], - "darkslategray": [47, 79, 79], - "darkslategrey": [47, 79, 79], - "darkturquoise": [0, 206, 209], - "darkviolet": [148, 0, 211], - "deeppink": [255, 20, 147], - "deepskyblue": [0, 191, 255], - "dimgray": [105, 105, 105], - "dimgrey": [105, 105, 105], - "dodgerblue": [30, 144, 255], - "firebrick": [178, 34, 34], - "floralwhite": [255, 250, 240], - "forestgreen": [34, 139, 34], - "fuchsia": [255, 0, 255], - "gainsboro": [220, 220, 220], - "ghostwhite": [248, 248, 255], - "gold": [255, 215, 0], - "goldenrod": [218, 165, 32], - "gray": [128, 128, 128], - "green": [0, 128, 0], - "greenyellow": [173, 255, 47], - "grey": [128, 128, 128], - "honeydew": [240, 255, 240], - "hotpink": [255, 105, 180], - "indianred": [205, 92, 92], - "indigo": [75, 0, 130], - "ivory": [255, 255, 240], - "khaki": [240, 230, 140], - "lavender": [230, 230, 250], - "lavenderblush": [255, 240, 245], - "lawngreen": [124, 252, 0], - "lemonchiffon": [255, 250, 205], - "lightblue": [173, 216, 230], - "lightcoral": [240, 128, 128], - "lightcyan": [224, 255, 255], - "lightgoldenrodyellow": [250, 250, 210], - "lightgray": [211, 211, 211], - "lightgreen": [144, 238, 144], - "lightgrey": [211, 211, 211], - "lightpink": [255, 182, 193], - "lightsalmon": [255, 160, 122], - "lightseagreen": [32, 178, 170], - "lightskyblue": [135, 206, 250], - "lightslategray": [119, 136, 153], - "lightslategrey": [119, 136, 153], - "lightsteelblue": [176, 196, 222], - "lightyellow": [255, 255, 224], - "lime": [0, 255, 0], - "limegreen": [50, 205, 50], - "linen": [250, 240, 230], - "magenta": [255, 0, 255], - "maroon": [128, 0, 0], - "mediumaquamarine": [102, 205, 170], - "mediumblue": [0, 0, 205], - "mediumorchid": [186, 85, 211], - "mediumpurple": [147, 112, 219], - "mediumseagreen": [60, 179, 113], - "mediumslateblue": [123, 104, 238], - "mediumspringgreen": [0, 250, 154], - "mediumturquoise": [72, 209, 204], - "mediumvioletred": [199, 21, 133], - "midnightblue": [25, 25, 112], - "mintcream": [245, 255, 250], - "mistyrose": [255, 228, 225], - "moccasin": [255, 228, 181], - "navajowhite": [255, 222, 173], - "navy": [0, 0, 128], - "oldlace": [253, 245, 230], - "olive": [128, 128, 0], - "olivedrab": [107, 142, 35], - "orange": [255, 165, 0], - "orangered": [255, 69, 0], - "orchid": [218, 112, 214], - "palegoldenrod": [238, 232, 170], - "palegreen": [152, 251, 152], - "paleturquoise": [175, 238, 238], - "palevioletred": [219, 112, 147], - "papayawhip": [255, 239, 213], - "peachpuff": [255, 218, 185], - "peru": [205, 133, 63], - "pink": [255, 192, 203], - "plum": [221, 160, 221], - "powderblue": [176, 224, 230], - "purple": [128, 0, 128], - "rebeccapurple": [102, 51, 153], - "red": [255, 0, 0], - "rosybrown": [188, 143, 143], - "royalblue": [65, 105, 225], - "saddlebrown": [139, 69, 19], - "salmon": [250, 128, 114], - "sandybrown": [244, 164, 96], - "seagreen": [46, 139, 87], - "seashell": [255, 245, 238], - "sienna": [160, 82, 45], - "silver": [192, 192, 192], - "skyblue": [135, 206, 235], - "slateblue": [106, 90, 205], - "slategray": [112, 128, 144], - "slategrey": [112, 128, 144], - "snow": [255, 250, 250], - "springgreen": [0, 255, 127], - "steelblue": [70, 130, 180], - "tan": [210, 180, 140], - "teal": [0, 128, 128], - "thistle": [216, 191, 216], - "tomato": [255, 99, 71], - "turquoise": [64, 224, 208], - "violet": [238, 130, 238], - "wheat": [245, 222, 179], - "white": [255, 255, 255], - "whitesmoke": [245, 245, 245], - "yellow": [255, 255, 0], - "yellowgreen": [154, 205, 50] -}; +'use strict' + +module.exports = { + "aliceblue": [240, 248, 255], + "antiquewhite": [250, 235, 215], + "aqua": [0, 255, 255], + "aquamarine": [127, 255, 212], + "azure": [240, 255, 255], + "beige": [245, 245, 220], + "bisque": [255, 228, 196], + "black": [0, 0, 0], + "blanchedalmond": [255, 235, 205], + "blue": [0, 0, 255], + "blueviolet": [138, 43, 226], + "brown": [165, 42, 42], + "burlywood": [222, 184, 135], + "cadetblue": [95, 158, 160], + "chartreuse": [127, 255, 0], + "chocolate": [210, 105, 30], + "coral": [255, 127, 80], + "cornflowerblue": [100, 149, 237], + "cornsilk": [255, 248, 220], + "crimson": [220, 20, 60], + "cyan": [0, 255, 255], + "darkblue": [0, 0, 139], + "darkcyan": [0, 139, 139], + "darkgoldenrod": [184, 134, 11], + "darkgray": [169, 169, 169], + "darkgreen": [0, 100, 0], + "darkgrey": [169, 169, 169], + "darkkhaki": [189, 183, 107], + "darkmagenta": [139, 0, 139], + "darkolivegreen": [85, 107, 47], + "darkorange": [255, 140, 0], + "darkorchid": [153, 50, 204], + "darkred": [139, 0, 0], + "darksalmon": [233, 150, 122], + "darkseagreen": [143, 188, 143], + "darkslateblue": [72, 61, 139], + "darkslategray": [47, 79, 79], + "darkslategrey": [47, 79, 79], + "darkturquoise": [0, 206, 209], + "darkviolet": [148, 0, 211], + "deeppink": [255, 20, 147], + "deepskyblue": [0, 191, 255], + "dimgray": [105, 105, 105], + "dimgrey": [105, 105, 105], + "dodgerblue": [30, 144, 255], + "firebrick": [178, 34, 34], + "floralwhite": [255, 250, 240], + "forestgreen": [34, 139, 34], + "fuchsia": [255, 0, 255], + "gainsboro": [220, 220, 220], + "ghostwhite": [248, 248, 255], + "gold": [255, 215, 0], + "goldenrod": [218, 165, 32], + "gray": [128, 128, 128], + "green": [0, 128, 0], + "greenyellow": [173, 255, 47], + "grey": [128, 128, 128], + "honeydew": [240, 255, 240], + "hotpink": [255, 105, 180], + "indianred": [205, 92, 92], + "indigo": [75, 0, 130], + "ivory": [255, 255, 240], + "khaki": [240, 230, 140], + "lavender": [230, 230, 250], + "lavenderblush": [255, 240, 245], + "lawngreen": [124, 252, 0], + "lemonchiffon": [255, 250, 205], + "lightblue": [173, 216, 230], + "lightcoral": [240, 128, 128], + "lightcyan": [224, 255, 255], + "lightgoldenrodyellow": [250, 250, 210], + "lightgray": [211, 211, 211], + "lightgreen": [144, 238, 144], + "lightgrey": [211, 211, 211], + "lightpink": [255, 182, 193], + "lightsalmon": [255, 160, 122], + "lightseagreen": [32, 178, 170], + "lightskyblue": [135, 206, 250], + "lightslategray": [119, 136, 153], + "lightslategrey": [119, 136, 153], + "lightsteelblue": [176, 196, 222], + "lightyellow": [255, 255, 224], + "lime": [0, 255, 0], + "limegreen": [50, 205, 50], + "linen": [250, 240, 230], + "magenta": [255, 0, 255], + "maroon": [128, 0, 0], + "mediumaquamarine": [102, 205, 170], + "mediumblue": [0, 0, 205], + "mediumorchid": [186, 85, 211], + "mediumpurple": [147, 112, 219], + "mediumseagreen": [60, 179, 113], + "mediumslateblue": [123, 104, 238], + "mediumspringgreen": [0, 250, 154], + "mediumturquoise": [72, 209, 204], + "mediumvioletred": [199, 21, 133], + "midnightblue": [25, 25, 112], + "mintcream": [245, 255, 250], + "mistyrose": [255, 228, 225], + "moccasin": [255, 228, 181], + "navajowhite": [255, 222, 173], + "navy": [0, 0, 128], + "oldlace": [253, 245, 230], + "olive": [128, 128, 0], + "olivedrab": [107, 142, 35], + "orange": [255, 165, 0], + "orangered": [255, 69, 0], + "orchid": [218, 112, 214], + "palegoldenrod": [238, 232, 170], + "palegreen": [152, 251, 152], + "paleturquoise": [175, 238, 238], + "palevioletred": [219, 112, 147], + "papayawhip": [255, 239, 213], + "peachpuff": [255, 218, 185], + "peru": [205, 133, 63], + "pink": [255, 192, 203], + "plum": [221, 160, 221], + "powderblue": [176, 224, 230], + "purple": [128, 0, 128], + "rebeccapurple": [102, 51, 153], + "red": [255, 0, 0], + "rosybrown": [188, 143, 143], + "royalblue": [65, 105, 225], + "saddlebrown": [139, 69, 19], + "salmon": [250, 128, 114], + "sandybrown": [244, 164, 96], + "seagreen": [46, 139, 87], + "seashell": [255, 245, 238], + "sienna": [160, 82, 45], + "silver": [192, 192, 192], + "skyblue": [135, 206, 235], + "slateblue": [106, 90, 205], + "slategray": [112, 128, 144], + "slategrey": [112, 128, 144], + "snow": [255, 250, 250], + "springgreen": [0, 255, 127], + "steelblue": [70, 130, 180], + "tan": [210, 180, 140], + "teal": [0, 128, 128], + "thistle": [216, 191, 216], + "tomato": [255, 99, 71], + "turquoise": [64, 224, 208], + "violet": [238, 130, 238], + "wheat": [245, 222, 179], + "white": [255, 255, 255], + "whitesmoke": [245, 245, 245], + "yellow": [255, 255, 0], + "yellowgreen": [154, 205, 50] +}; diff --git a/node_modules/@babel/highlight/node_modules/color-name/test.js b/node_modules/@babel/highlight/node_modules/color-name/test.js index 7a0874621..6e6bf30bc 100644 --- a/node_modules/@babel/highlight/node_modules/color-name/test.js +++ b/node_modules/@babel/highlight/node_modules/color-name/test.js @@ -1,7 +1,7 @@ -'use strict' - -var names = require('./'); -var assert = require('assert'); - -assert.deepEqual(names.red, [255,0,0]); -assert.deepEqual(names.aliceblue, [240,248,255]); +'use strict' + +var names = require('./'); +var assert = require('assert'); + +assert.deepEqual(names.red, [255,0,0]); +assert.deepEqual(names.aliceblue, [240,248,255]); diff --git a/node_modules/@babel/parser/bin/babel-parser.js b/node_modules/@babel/parser/bin/babel-parser.js old mode 100644 new mode 100755 diff --git a/node_modules/@cnakazawa/watch/cli.js b/node_modules/@cnakazawa/watch/cli.js old mode 100644 new mode 100755 diff --git a/node_modules/@cnakazawa/watch/scripts/release.sh b/node_modules/@cnakazawa/watch/scripts/release.sh old mode 100644 new mode 100755 diff --git a/node_modules/@jest/console/build/ts3.4/BufferedConsole.d.ts b/node_modules/@jest/console/build/ts3.4/BufferedConsole.d.ts index 6b04fcd2c..948c845cb 100644 --- a/node_modules/@jest/console/build/ts3.4/BufferedConsole.d.ts +++ b/node_modules/@jest/console/build/ts3.4/BufferedConsole.d.ts @@ -1,33 +1,33 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import { Console } from 'console'; -import { ConsoleBuffer, LogMessage, LogType } from './types'; -export default class BufferedConsole extends Console { - private _buffer; - private _counters; - private _timers; - private _groupDepth; - constructor(); - static write(buffer: ConsoleBuffer, type: LogType, message: LogMessage, level?: number | null): ConsoleBuffer; - private _log; - assert(value: unknown, message?: string | Error): void; - count(label?: string): void; - countReset(label?: string): void; - debug(firstArg: unknown, ...rest: Array): void; - dir(firstArg: unknown, ...rest: Array): void; - dirxml(firstArg: unknown, ...rest: Array): void; - error(firstArg: unknown, ...rest: Array): void; - group(title?: string, ...rest: Array): void; - groupCollapsed(title?: string, ...rest: Array): void; - groupEnd(): void; - info(firstArg: unknown, ...rest: Array): void; - log(firstArg: unknown, ...rest: Array): void; - time(label?: string): void; - timeEnd(label?: string): void; - warn(firstArg: unknown, ...rest: Array): void; - getBuffer(): ConsoleBuffer | undefined; -} +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import { Console } from 'console'; +import { ConsoleBuffer, LogMessage, LogType } from './types'; +export default class BufferedConsole extends Console { + private _buffer; + private _counters; + private _timers; + private _groupDepth; + constructor(); + static write(buffer: ConsoleBuffer, type: LogType, message: LogMessage, level?: number | null): ConsoleBuffer; + private _log; + assert(value: unknown, message?: string | Error): void; + count(label?: string): void; + countReset(label?: string): void; + debug(firstArg: unknown, ...rest: Array): void; + dir(firstArg: unknown, ...rest: Array): void; + dirxml(firstArg: unknown, ...rest: Array): void; + error(firstArg: unknown, ...rest: Array): void; + group(title?: string, ...rest: Array): void; + groupCollapsed(title?: string, ...rest: Array): void; + groupEnd(): void; + info(firstArg: unknown, ...rest: Array): void; + log(firstArg: unknown, ...rest: Array): void; + time(label?: string): void; + timeEnd(label?: string): void; + warn(firstArg: unknown, ...rest: Array): void; + getBuffer(): ConsoleBuffer | undefined; +} diff --git a/node_modules/@jest/console/build/ts3.4/CustomConsole.d.ts b/node_modules/@jest/console/build/ts3.4/CustomConsole.d.ts index ff471465b..c2bc64798 100644 --- a/node_modules/@jest/console/build/ts3.4/CustomConsole.d.ts +++ b/node_modules/@jest/console/build/ts3.4/CustomConsole.d.ts @@ -1,39 +1,39 @@ -/// -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -/// -import { Console } from 'console'; -import { LogMessage, LogType } from './types'; -declare type Formatter = (type: LogType, message: LogMessage) => string; -export default class CustomConsole extends Console { - private _stdout; - private _stderr; - private _formatBuffer; - private _counters; - private _timers; - private _groupDepth; - constructor(stdout: NodeJS.WriteStream, stderr: NodeJS.WriteStream, formatBuffer?: Formatter); - private _log; - private _logError; - assert(value: unknown, message?: string | Error): void; - count(label?: string): void; - countReset(label?: string): void; - debug(firstArg: unknown, ...args: Array): void; - dir(firstArg: unknown, ...args: Array): void; - dirxml(firstArg: unknown, ...args: Array): void; - error(firstArg: unknown, ...args: Array): void; - group(title?: string, ...args: Array): void; - groupCollapsed(title?: string, ...args: Array): void; - groupEnd(): void; - info(firstArg: unknown, ...args: Array): void; - log(firstArg: unknown, ...args: Array): void; - time(label?: string): void; - timeEnd(label?: string): void; - warn(firstArg: unknown, ...args: Array): void; - getBuffer(): undefined; -} -export {}; +/// +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +/// +import { Console } from 'console'; +import { LogMessage, LogType } from './types'; +declare type Formatter = (type: LogType, message: LogMessage) => string; +export default class CustomConsole extends Console { + private _stdout; + private _stderr; + private _formatBuffer; + private _counters; + private _timers; + private _groupDepth; + constructor(stdout: NodeJS.WriteStream, stderr: NodeJS.WriteStream, formatBuffer?: Formatter); + private _log; + private _logError; + assert(value: unknown, message?: string | Error): void; + count(label?: string): void; + countReset(label?: string): void; + debug(firstArg: unknown, ...args: Array): void; + dir(firstArg: unknown, ...args: Array): void; + dirxml(firstArg: unknown, ...args: Array): void; + error(firstArg: unknown, ...args: Array): void; + group(title?: string, ...args: Array): void; + groupCollapsed(title?: string, ...args: Array): void; + groupEnd(): void; + info(firstArg: unknown, ...args: Array): void; + log(firstArg: unknown, ...args: Array): void; + time(label?: string): void; + timeEnd(label?: string): void; + warn(firstArg: unknown, ...args: Array): void; + getBuffer(): undefined; +} +export {}; diff --git a/node_modules/@jest/console/build/ts3.4/NullConsole.d.ts b/node_modules/@jest/console/build/ts3.4/NullConsole.d.ts index 07ba4aef0..ce9ba0a4b 100644 --- a/node_modules/@jest/console/build/ts3.4/NullConsole.d.ts +++ b/node_modules/@jest/console/build/ts3.4/NullConsole.d.ts @@ -1,22 +1,22 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import CustomConsole from './CustomConsole'; -export default class NullConsole extends CustomConsole { - assert(): void; - debug(): void; - dir(): void; - error(): void; - info(): void; - log(): void; - time(): void; - timeEnd(): void; - trace(): void; - warn(): void; - group(): void; - groupCollapsed(): void; - groupEnd(): void; -} +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import CustomConsole from './CustomConsole'; +export default class NullConsole extends CustomConsole { + assert(): void; + debug(): void; + dir(): void; + error(): void; + info(): void; + log(): void; + time(): void; + timeEnd(): void; + trace(): void; + warn(): void; + group(): void; + groupCollapsed(): void; + groupEnd(): void; +} diff --git a/node_modules/@jest/console/build/ts3.4/getConsoleOutput.d.ts b/node_modules/@jest/console/build/ts3.4/getConsoleOutput.d.ts index a5fd7b33a..48daf3191 100644 --- a/node_modules/@jest/console/build/ts3.4/getConsoleOutput.d.ts +++ b/node_modules/@jest/console/build/ts3.4/getConsoleOutput.d.ts @@ -1,9 +1,9 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import { ConsoleBuffer } from './types'; -declare const _default: (root: string, verbose: boolean, buffer: ConsoleBuffer, config?: Pick) => string; -export default _default; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import { ConsoleBuffer } from './types'; +declare const _default: (root: string, verbose: boolean, buffer: ConsoleBuffer, config?: Pick) => string; +export default _default; diff --git a/node_modules/@jest/console/build/ts3.4/index.d.ts b/node_modules/@jest/console/build/ts3.4/index.d.ts index d09119d18..b74145664 100644 --- a/node_modules/@jest/console/build/ts3.4/index.d.ts +++ b/node_modules/@jest/console/build/ts3.4/index.d.ts @@ -1,11 +1,11 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -export { default as BufferedConsole } from './BufferedConsole'; -export { default as CustomConsole } from './CustomConsole'; -export { default as NullConsole } from './NullConsole'; -export { default as getConsoleOutput } from './getConsoleOutput'; -export { ConsoleBuffer, LogMessage, LogType } from './types'; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +export { default as BufferedConsole } from './BufferedConsole'; +export { default as CustomConsole } from './CustomConsole'; +export { default as NullConsole } from './NullConsole'; +export { default as getConsoleOutput } from './getConsoleOutput'; +export { ConsoleBuffer, LogMessage, LogType } from './types'; diff --git a/node_modules/@jest/console/build/ts3.4/types.d.ts b/node_modules/@jest/console/build/ts3.4/types.d.ts index 8490c6764..0962a4334 100644 --- a/node_modules/@jest/console/build/ts3.4/types.d.ts +++ b/node_modules/@jest/console/build/ts3.4/types.d.ts @@ -1,20 +1,20 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -export declare type LogMessage = string; -export declare type LogEntry = { - message: LogMessage; - origin: string; - type: LogType; -}; -export declare type LogCounters = { - [label: string]: number; -}; -export declare type LogTimers = { - [label: string]: Date; -}; -export declare type LogType = 'assert' | 'count' | 'debug' | 'dir' | 'dirxml' | 'error' | 'group' | 'groupCollapsed' | 'info' | 'log' | 'time' | 'warn'; -export declare type ConsoleBuffer = Array; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +export declare type LogMessage = string; +export declare type LogEntry = { + message: LogMessage; + origin: string; + type: LogType; +}; +export declare type LogCounters = { + [label: string]: number; +}; +export declare type LogTimers = { + [label: string]: Date; +}; +export declare type LogType = 'assert' | 'count' | 'debug' | 'dir' | 'dirxml' | 'error' | 'group' | 'groupCollapsed' | 'info' | 'log' | 'time' | 'warn'; +export declare type ConsoleBuffer = Array; diff --git a/node_modules/@jest/core/build/ts3.4/FailedTestsCache.d.ts b/node_modules/@jest/core/build/ts3.4/FailedTestsCache.d.ts index 9e6d73841..17607d25f 100644 --- a/node_modules/@jest/core/build/ts3.4/FailedTestsCache.d.ts +++ b/node_modules/@jest/core/build/ts3.4/FailedTestsCache.d.ts @@ -1,15 +1,15 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import { Test } from 'jest-runner'; -import { Config } from '@jest/types'; -import { TestResult } from '@jest/test-result'; -export default class FailedTestsCache { - private _enabledTestsMap?; - filterTests(tests: Array): Array; - setTestResults(testResults: Array): void; - updateConfig(globalConfig: Config.GlobalConfig): Config.GlobalConfig; -} +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import { Test } from 'jest-runner'; +import { Config } from '@jest/types'; +import { TestResult } from '@jest/test-result'; +export default class FailedTestsCache { + private _enabledTestsMap?; + filterTests(tests: Array): Array; + setTestResults(testResults: Array): void; + updateConfig(globalConfig: Config.GlobalConfig): Config.GlobalConfig; +} diff --git a/node_modules/@jest/core/build/ts3.4/ReporterDispatcher.d.ts b/node_modules/@jest/core/build/ts3.4/ReporterDispatcher.d.ts index b5965a31f..521056029 100644 --- a/node_modules/@jest/core/build/ts3.4/ReporterDispatcher.d.ts +++ b/node_modules/@jest/core/build/ts3.4/ReporterDispatcher.d.ts @@ -1,22 +1,22 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import { AggregatedResult, TestResult } from '@jest/test-result'; -import { Test } from 'jest-runner'; -import { Context } from 'jest-runtime'; -import { Reporter, ReporterOnStartOptions } from '@jest/reporters'; -export default class ReporterDispatcher { - private _reporters; - constructor(); - register(reporter: Reporter): void; - unregister(ReporterClass: Function): void; - onTestResult(test: Test, testResult: TestResult, results: AggregatedResult): Promise; - onTestStart(test: Test): Promise; - onRunStart(results: AggregatedResult, options: ReporterOnStartOptions): Promise; - onRunComplete(contexts: Set, results: AggregatedResult): Promise; - getErrors(): Array; - hasErrors(): boolean; -} +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import { AggregatedResult, TestResult } from '@jest/test-result'; +import { Test } from 'jest-runner'; +import { Context } from 'jest-runtime'; +import { Reporter, ReporterOnStartOptions } from '@jest/reporters'; +export default class ReporterDispatcher { + private _reporters; + constructor(); + register(reporter: Reporter): void; + unregister(ReporterClass: Function): void; + onTestResult(test: Test, testResult: TestResult, results: AggregatedResult): Promise; + onTestStart(test: Test): Promise; + onRunStart(results: AggregatedResult, options: ReporterOnStartOptions): Promise; + onRunComplete(contexts: Set, results: AggregatedResult): Promise; + getErrors(): Array; + hasErrors(): boolean; +} diff --git a/node_modules/@jest/core/build/ts3.4/SearchSource.d.ts b/node_modules/@jest/core/build/ts3.4/SearchSource.d.ts index ce8329d73..9855d3af7 100644 --- a/node_modules/@jest/core/build/ts3.4/SearchSource.d.ts +++ b/node_modules/@jest/core/build/ts3.4/SearchSource.d.ts @@ -1,45 +1,45 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import { Context } from 'jest-runtime'; -import { Config } from '@jest/types'; -import { Test } from 'jest-runner'; -import { ChangedFiles } from 'jest-changed-files'; -import { Filter, Stats } from './types'; -export declare type SearchResult = { - noSCM?: boolean; - stats?: Stats; - collectCoverageFrom?: Set; - tests: Array; - total?: number; -}; -export declare type TestSelectionConfig = { - input?: string; - findRelatedTests?: boolean; - onlyChanged?: boolean; - paths?: Array; - shouldTreatInputAsPattern?: boolean; - testPathPattern?: string; - watch?: boolean; -}; -export default class SearchSource { - private _context; - private _dependencyResolver; - private _testPathCases; - constructor(context: Context); - private _getOrBuildDependencyResolver; - private _filterTestPathsWithStats; - private _getAllTestPaths; - isTestFilePath(path: Config.Path): boolean; - findMatchingTests(testPathPattern?: string): SearchResult; - findRelatedTests(allPaths: Set, collectCoverage: boolean): SearchResult; - findTestsByPaths(paths: Array): SearchResult; - findRelatedTestsFromPattern(paths: Array, collectCoverage: boolean): SearchResult; - findTestRelatedToChangedFiles(changedFilesInfo: ChangedFiles, collectCoverage: boolean): SearchResult; - private _getTestPaths; - getTestPaths(globalConfig: Config.GlobalConfig, changedFiles: ChangedFiles | undefined, filter?: Filter): Promise; - findRelatedSourcesFromTestsInChangedFiles(changedFilesInfo: ChangedFiles): Array; -} +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import { Context } from 'jest-runtime'; +import { Config } from '@jest/types'; +import { Test } from 'jest-runner'; +import { ChangedFiles } from 'jest-changed-files'; +import { Filter, Stats } from './types'; +export declare type SearchResult = { + noSCM?: boolean; + stats?: Stats; + collectCoverageFrom?: Set; + tests: Array; + total?: number; +}; +export declare type TestSelectionConfig = { + input?: string; + findRelatedTests?: boolean; + onlyChanged?: boolean; + paths?: Array; + shouldTreatInputAsPattern?: boolean; + testPathPattern?: string; + watch?: boolean; +}; +export default class SearchSource { + private _context; + private _dependencyResolver; + private _testPathCases; + constructor(context: Context); + private _getOrBuildDependencyResolver; + private _filterTestPathsWithStats; + private _getAllTestPaths; + isTestFilePath(path: Config.Path): boolean; + findMatchingTests(testPathPattern?: string): SearchResult; + findRelatedTests(allPaths: Set, collectCoverage: boolean): SearchResult; + findTestsByPaths(paths: Array): SearchResult; + findRelatedTestsFromPattern(paths: Array, collectCoverage: boolean): SearchResult; + findTestRelatedToChangedFiles(changedFilesInfo: ChangedFiles, collectCoverage: boolean): SearchResult; + private _getTestPaths; + getTestPaths(globalConfig: Config.GlobalConfig, changedFiles: ChangedFiles | undefined, filter?: Filter): Promise; + findRelatedSourcesFromTestsInChangedFiles(changedFilesInfo: ChangedFiles): Array; +} diff --git a/node_modules/@jest/core/build/ts3.4/SnapshotInteractiveMode.d.ts b/node_modules/@jest/core/build/ts3.4/SnapshotInteractiveMode.d.ts index d7dc89a7c..ffc1258e4 100644 --- a/node_modules/@jest/core/build/ts3.4/SnapshotInteractiveMode.d.ts +++ b/node_modules/@jest/core/build/ts3.4/SnapshotInteractiveMode.d.ts @@ -1,31 +1,31 @@ -/// -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -/// -import { AggregatedResult, AssertionLocation } from '@jest/test-result'; -export default class SnapshotInteractiveMode { - private _pipe; - private _isActive; - private _updateTestRunnerConfig; - private _testAssertions; - private _countPaths; - private _skippedNum; - constructor(pipe: NodeJS.WritableStream); - isActive(): boolean; - getSkippedNum(): number; - private _clearTestSummary; - private _drawUIProgress; - private _drawUIDoneWithSkipped; - private _drawUIDone; - private _drawUIOverlay; - put(key: string): void; - abort(): void; - restart(): void; - updateWithResults(results: AggregatedResult): void; - private _run; - run(failedSnapshotTestAssertions: Array, onConfigChange: (assertion: AssertionLocation | null, shouldUpdateSnapshot: boolean) => unknown): void; -} +/// +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +/// +import { AggregatedResult, AssertionLocation } from '@jest/test-result'; +export default class SnapshotInteractiveMode { + private _pipe; + private _isActive; + private _updateTestRunnerConfig; + private _testAssertions; + private _countPaths; + private _skippedNum; + constructor(pipe: NodeJS.WritableStream); + isActive(): boolean; + getSkippedNum(): number; + private _clearTestSummary; + private _drawUIProgress; + private _drawUIDoneWithSkipped; + private _drawUIDone; + private _drawUIOverlay; + put(key: string): void; + abort(): void; + restart(): void; + updateWithResults(results: AggregatedResult): void; + private _run; + run(failedSnapshotTestAssertions: Array, onConfigChange: (assertion: AssertionLocation | null, shouldUpdateSnapshot: boolean) => unknown): void; +} diff --git a/node_modules/@jest/core/build/ts3.4/TestNamePatternPrompt.d.ts b/node_modules/@jest/core/build/ts3.4/TestNamePatternPrompt.d.ts index c0546fe72..d95188c4d 100644 --- a/node_modules/@jest/core/build/ts3.4/TestNamePatternPrompt.d.ts +++ b/node_modules/@jest/core/build/ts3.4/TestNamePatternPrompt.d.ts @@ -1,18 +1,18 @@ -/// -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -/// -import { PatternPrompt, Prompt, ScrollOptions } from 'jest-watcher'; -import { TestResult } from '@jest/test-result'; -export default class TestNamePatternPrompt extends PatternPrompt { - _cachedTestResults: Array; - constructor(pipe: NodeJS.WritableStream, prompt: Prompt); - _onChange(pattern: string, options: ScrollOptions): void; - _printPrompt(pattern: string): void; - _getMatchedTests(pattern: string): Array; - updateCachedTestResults(testResults?: Array): void; -} +/// +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +/// +import { PatternPrompt, Prompt, ScrollOptions } from 'jest-watcher'; +import { TestResult } from '@jest/test-result'; +export default class TestNamePatternPrompt extends PatternPrompt { + _cachedTestResults: Array; + constructor(pipe: NodeJS.WritableStream, prompt: Prompt); + _onChange(pattern: string, options: ScrollOptions): void; + _printPrompt(pattern: string): void; + _getMatchedTests(pattern: string): Array; + updateCachedTestResults(testResults?: Array): void; +} diff --git a/node_modules/@jest/core/build/ts3.4/TestPathPatternPrompt.d.ts b/node_modules/@jest/core/build/ts3.4/TestPathPatternPrompt.d.ts index bdd9debaa..39d9c3bf1 100644 --- a/node_modules/@jest/core/build/ts3.4/TestPathPatternPrompt.d.ts +++ b/node_modules/@jest/core/build/ts3.4/TestPathPatternPrompt.d.ts @@ -1,25 +1,25 @@ -/// -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -/// -import { Context } from 'jest-runtime'; -import { Test } from 'jest-runner'; -import { PatternPrompt, Prompt, ScrollOptions } from 'jest-watcher'; -import SearchSource from './SearchSource'; -declare type SearchSources = Array<{ - context: Context; - searchSource: SearchSource; -}>; -export default class TestPathPatternPrompt extends PatternPrompt { - _searchSources?: SearchSources; - constructor(pipe: NodeJS.WritableStream, prompt: Prompt); - _onChange(pattern: string, options: ScrollOptions): void; - _printPrompt(pattern: string): void; - _getMatchedTests(pattern: string): Array; - updateSearchSources(searchSources: SearchSources): void; -} -export {}; +/// +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +/// +import { Context } from 'jest-runtime'; +import { Test } from 'jest-runner'; +import { PatternPrompt, Prompt, ScrollOptions } from 'jest-watcher'; +import SearchSource from './SearchSource'; +declare type SearchSources = Array<{ + context: Context; + searchSource: SearchSource; +}>; +export default class TestPathPatternPrompt extends PatternPrompt { + _searchSources?: SearchSources; + constructor(pipe: NodeJS.WritableStream, prompt: Prompt); + _onChange(pattern: string, options: ScrollOptions): void; + _printPrompt(pattern: string): void; + _getMatchedTests(pattern: string): Array; + updateSearchSources(searchSources: SearchSources): void; +} +export {}; diff --git a/node_modules/@jest/core/build/ts3.4/TestScheduler.d.ts b/node_modules/@jest/core/build/ts3.4/TestScheduler.d.ts index 172a01193..e1dadf6f1 100644 --- a/node_modules/@jest/core/build/ts3.4/TestScheduler.d.ts +++ b/node_modules/@jest/core/build/ts3.4/TestScheduler.d.ts @@ -1,41 +1,41 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import { Config } from '@jest/types'; -import TestRunner = require('jest-runner'); -import { Reporter } from '@jest/reporters'; -import { AggregatedResult } from '@jest/test-result'; -import TestWatcher from './TestWatcher'; -export declare type TestSchedulerOptions = { - startRun: (globalConfig: Config.GlobalConfig) => void; -}; -export declare type TestSchedulerContext = { - firstRun: boolean; - previousSuccess: boolean; - changedFiles?: Set; - sourcesRelatedToTestsInChangedFiles?: Set; -}; -export default class TestScheduler { - private _dispatcher; - private _globalConfig; - private _options; - private _context; - constructor(globalConfig: Config.GlobalConfig, options: TestSchedulerOptions, context: TestSchedulerContext); - addReporter(reporter: Reporter): void; - removeReporter(ReporterClass: Function): void; - scheduleTests(tests: Array, watcher: TestWatcher): Promise; - private _partitionTests; - private _shouldAddDefaultReporters; - private _setupReporters; - private _setupDefaultReporters; - private _addCustomReporters; - /** - * Get properties of a reporter in an object - * to make dealing with them less painful. - */ - private _getReporterProps; - private _bailIfNeeded; -} +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import { Config } from '@jest/types'; +import TestRunner = require('jest-runner'); +import { Reporter } from '@jest/reporters'; +import { AggregatedResult } from '@jest/test-result'; +import TestWatcher from './TestWatcher'; +export declare type TestSchedulerOptions = { + startRun: (globalConfig: Config.GlobalConfig) => void; +}; +export declare type TestSchedulerContext = { + firstRun: boolean; + previousSuccess: boolean; + changedFiles?: Set; + sourcesRelatedToTestsInChangedFiles?: Set; +}; +export default class TestScheduler { + private _dispatcher; + private _globalConfig; + private _options; + private _context; + constructor(globalConfig: Config.GlobalConfig, options: TestSchedulerOptions, context: TestSchedulerContext); + addReporter(reporter: Reporter): void; + removeReporter(ReporterClass: Function): void; + scheduleTests(tests: Array, watcher: TestWatcher): Promise; + private _partitionTests; + private _shouldAddDefaultReporters; + private _setupReporters; + private _setupDefaultReporters; + private _addCustomReporters; + /** + * Get properties of a reporter in an object + * to make dealing with them less painful. + */ + private _getReporterProps; + private _bailIfNeeded; +} diff --git a/node_modules/@jest/core/build/ts3.4/TestWatcher.d.ts b/node_modules/@jest/core/build/ts3.4/TestWatcher.d.ts index c412c25f7..74daf9d79 100644 --- a/node_modules/@jest/core/build/ts3.4/TestWatcher.d.ts +++ b/node_modules/@jest/core/build/ts3.4/TestWatcher.d.ts @@ -1,23 +1,23 @@ -/// -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -/// -import { EventEmitter } from 'events'; -declare type State = { - interrupted: boolean; -}; -export default class TestWatcher extends EventEmitter { - state: State; - private _isWatchMode; - constructor({ isWatchMode }: { - isWatchMode: boolean; - }); - setState(state: State): void; - isInterrupted(): boolean; - isWatchMode(): boolean; -} -export {}; +/// +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +/// +import { EventEmitter } from 'events'; +declare type State = { + interrupted: boolean; +}; +export default class TestWatcher extends EventEmitter { + state: State; + private _isWatchMode; + constructor({ isWatchMode }: { + isWatchMode: boolean; + }); + setState(state: State): void; + isInterrupted(): boolean; + isWatchMode(): boolean; +} +export {}; diff --git a/node_modules/@jest/core/build/ts3.4/cli/index.d.ts b/node_modules/@jest/core/build/ts3.4/cli/index.d.ts index 4e7333e73..5ae4ecf50 100644 --- a/node_modules/@jest/core/build/ts3.4/cli/index.d.ts +++ b/node_modules/@jest/core/build/ts3.4/cli/index.d.ts @@ -1,12 +1,12 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import { Config } from '@jest/types'; -import { AggregatedResult } from '@jest/test-result'; -export declare function runCLI(argv: Config.Argv, projects: Array): Promise<{ - results: AggregatedResult; - globalConfig: Config.GlobalConfig; -}>; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import { Config } from '@jest/types'; +import { AggregatedResult } from '@jest/test-result'; +export declare function runCLI(argv: Config.Argv, projects: Array): Promise<{ + results: AggregatedResult; + globalConfig: Config.GlobalConfig; +}>; diff --git a/node_modules/@jest/core/build/ts3.4/collectHandles.d.ts b/node_modules/@jest/core/build/ts3.4/collectHandles.d.ts index 03bdd25ef..d99f75f44 100644 --- a/node_modules/@jest/core/build/ts3.4/collectHandles.d.ts +++ b/node_modules/@jest/core/build/ts3.4/collectHandles.d.ts @@ -1,9 +1,9 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import { Config } from '@jest/types'; -export default function collectHandles(): () => Array; -export declare function formatHandleErrors(errors: Array, config: Config.ProjectConfig): Array; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import { Config } from '@jest/types'; +export default function collectHandles(): () => Array; +export declare function formatHandleErrors(errors: Array, config: Config.ProjectConfig): Array; diff --git a/node_modules/@jest/core/build/ts3.4/getChangedFilesPromise.d.ts b/node_modules/@jest/core/build/ts3.4/getChangedFilesPromise.d.ts index ca37b49e7..46ee9fc7b 100644 --- a/node_modules/@jest/core/build/ts3.4/getChangedFilesPromise.d.ts +++ b/node_modules/@jest/core/build/ts3.4/getChangedFilesPromise.d.ts @@ -1,10 +1,10 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import { Config } from '@jest/types'; -import { ChangedFilesPromise } from 'jest-changed-files'; -declare const _default: (globalConfig: Config.GlobalConfig, configs: Config.ProjectConfig[]) => ChangedFilesPromise | undefined; -export default _default; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import { Config } from '@jest/types'; +import { ChangedFilesPromise } from 'jest-changed-files'; +declare const _default: (globalConfig: Config.GlobalConfig, configs: Config.ProjectConfig[]) => ChangedFilesPromise | undefined; +export default _default; diff --git a/node_modules/@jest/core/build/ts3.4/getNoTestFound.d.ts b/node_modules/@jest/core/build/ts3.4/getNoTestFound.d.ts index 56a6a6a95..9af99c453 100644 --- a/node_modules/@jest/core/build/ts3.4/getNoTestFound.d.ts +++ b/node_modules/@jest/core/build/ts3.4/getNoTestFound.d.ts @@ -1,9 +1,9 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import { Config } from '@jest/types'; -import { TestRunData } from './types'; -export default function getNoTestFound(testRunData: TestRunData, globalConfig: Config.GlobalConfig): string; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import { Config } from '@jest/types'; +import { TestRunData } from './types'; +export default function getNoTestFound(testRunData: TestRunData, globalConfig: Config.GlobalConfig): string; diff --git a/node_modules/@jest/core/build/ts3.4/getNoTestFoundFailed.d.ts b/node_modules/@jest/core/build/ts3.4/getNoTestFoundFailed.d.ts index bb83f936e..d2e70b206 100644 --- a/node_modules/@jest/core/build/ts3.4/getNoTestFoundFailed.d.ts +++ b/node_modules/@jest/core/build/ts3.4/getNoTestFoundFailed.d.ts @@ -1,7 +1,7 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -export default function getNoTestFoundFailed(): string; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +export default function getNoTestFoundFailed(): string; diff --git a/node_modules/@jest/core/build/ts3.4/getNoTestFoundPassWithNoTests.d.ts b/node_modules/@jest/core/build/ts3.4/getNoTestFoundPassWithNoTests.d.ts index a594ba41c..f9e771e8a 100644 --- a/node_modules/@jest/core/build/ts3.4/getNoTestFoundPassWithNoTests.d.ts +++ b/node_modules/@jest/core/build/ts3.4/getNoTestFoundPassWithNoTests.d.ts @@ -1,7 +1,7 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -export default function getNoTestFoundPassWithNoTests(): string; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +export default function getNoTestFoundPassWithNoTests(): string; diff --git a/node_modules/@jest/core/build/ts3.4/getNoTestFoundRelatedToChangedFiles.d.ts b/node_modules/@jest/core/build/ts3.4/getNoTestFoundRelatedToChangedFiles.d.ts index 7ebe80f3e..0221716ff 100644 --- a/node_modules/@jest/core/build/ts3.4/getNoTestFoundRelatedToChangedFiles.d.ts +++ b/node_modules/@jest/core/build/ts3.4/getNoTestFoundRelatedToChangedFiles.d.ts @@ -1,8 +1,8 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import { Config } from '@jest/types'; -export default function getNoTestFoundRelatedToChangedFiles(globalConfig: Config.GlobalConfig): string; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import { Config } from '@jest/types'; +export default function getNoTestFoundRelatedToChangedFiles(globalConfig: Config.GlobalConfig): string; diff --git a/node_modules/@jest/core/build/ts3.4/getNoTestFoundVerbose.d.ts b/node_modules/@jest/core/build/ts3.4/getNoTestFoundVerbose.d.ts index f23e11231..b14f1bf9b 100644 --- a/node_modules/@jest/core/build/ts3.4/getNoTestFoundVerbose.d.ts +++ b/node_modules/@jest/core/build/ts3.4/getNoTestFoundVerbose.d.ts @@ -1,9 +1,9 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import { Config } from '@jest/types'; -import { TestRunData } from './types'; -export default function getNoTestFoundVerbose(testRunData: TestRunData, globalConfig: Config.GlobalConfig): string; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import { Config } from '@jest/types'; +import { TestRunData } from './types'; +export default function getNoTestFoundVerbose(testRunData: TestRunData, globalConfig: Config.GlobalConfig): string; diff --git a/node_modules/@jest/core/build/ts3.4/getNoTestsFoundMessage.d.ts b/node_modules/@jest/core/build/ts3.4/getNoTestsFoundMessage.d.ts index e324ac477..586733dca 100644 --- a/node_modules/@jest/core/build/ts3.4/getNoTestsFoundMessage.d.ts +++ b/node_modules/@jest/core/build/ts3.4/getNoTestsFoundMessage.d.ts @@ -1,9 +1,9 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import { Config } from '@jest/types'; -import { TestRunData } from './types'; -export default function getNoTestsFoundMessage(testRunData: TestRunData, globalConfig: Config.GlobalConfig): string; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import { Config } from '@jest/types'; +import { TestRunData } from './types'; +export default function getNoTestsFoundMessage(testRunData: TestRunData, globalConfig: Config.GlobalConfig): string; diff --git a/node_modules/@jest/core/build/ts3.4/jest.d.ts b/node_modules/@jest/core/build/ts3.4/jest.d.ts index af8512284..a3016d464 100644 --- a/node_modules/@jest/core/build/ts3.4/jest.d.ts +++ b/node_modules/@jest/core/build/ts3.4/jest.d.ts @@ -1,11 +1,11 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -export { default as SearchSource } from './SearchSource'; -export { default as TestScheduler } from './TestScheduler'; -export { default as TestWatcher } from './TestWatcher'; -export { runCLI } from './cli'; -export { default as getVersion } from './version'; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +export { default as SearchSource } from './SearchSource'; +export { default as TestScheduler } from './TestScheduler'; +export { default as TestWatcher } from './TestWatcher'; +export { runCLI } from './cli'; +export { default as getVersion } from './version'; diff --git a/node_modules/@jest/core/build/ts3.4/lib/active_filters_message.d.ts b/node_modules/@jest/core/build/ts3.4/lib/active_filters_message.d.ts index 84db30925..061ef899e 100644 --- a/node_modules/@jest/core/build/ts3.4/lib/active_filters_message.d.ts +++ b/node_modules/@jest/core/build/ts3.4/lib/active_filters_message.d.ts @@ -1,9 +1,9 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import { Config } from '@jest/types'; -declare const activeFilters: (globalConfig: Config.GlobalConfig, delimiter?: string) => string; -export default activeFilters; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import { Config } from '@jest/types'; +declare const activeFilters: (globalConfig: Config.GlobalConfig, delimiter?: string) => string; +export default activeFilters; diff --git a/node_modules/@jest/core/build/ts3.4/lib/create_context.d.ts b/node_modules/@jest/core/build/ts3.4/lib/create_context.d.ts index 227f90c5a..4c8424342 100644 --- a/node_modules/@jest/core/build/ts3.4/lib/create_context.d.ts +++ b/node_modules/@jest/core/build/ts3.4/lib/create_context.d.ts @@ -1,9 +1,9 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import { Config } from '@jest/types'; -declare const _default: (config: Config.ProjectConfig, { hasteFS, moduleMap }: import("jest-haste-map/build/types").HasteMap) => import("jest-runtime/build/types").Context; -export default _default; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import { Config } from '@jest/types'; +declare const _default: (config: Config.ProjectConfig, { hasteFS, moduleMap }: import("jest-haste-map/build/types").HasteMap) => import("jest-runtime/build/types").Context; +export default _default; diff --git a/node_modules/@jest/core/build/ts3.4/lib/handle_deprecation_warnings.d.ts b/node_modules/@jest/core/build/ts3.4/lib/handle_deprecation_warnings.d.ts index 939638970..9bd359672 100644 --- a/node_modules/@jest/core/build/ts3.4/lib/handle_deprecation_warnings.d.ts +++ b/node_modules/@jest/core/build/ts3.4/lib/handle_deprecation_warnings.d.ts @@ -1,10 +1,10 @@ -/// -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -/// -declare const _default: (pipe: NodeJS.WriteStream, stdin?: NodeJS.ReadStream) => Promise; -export default _default; +/// +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +/// +declare const _default: (pipe: NodeJS.WriteStream, stdin?: NodeJS.ReadStream) => Promise; +export default _default; diff --git a/node_modules/@jest/core/build/ts3.4/lib/is_valid_path.d.ts b/node_modules/@jest/core/build/ts3.4/lib/is_valid_path.d.ts index 15dd6115c..cebefc862 100644 --- a/node_modules/@jest/core/build/ts3.4/lib/is_valid_path.d.ts +++ b/node_modules/@jest/core/build/ts3.4/lib/is_valid_path.d.ts @@ -1,8 +1,8 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import { Config } from '@jest/types'; -export default function isValidPath(globalConfig: Config.GlobalConfig, filePath: Config.Path): boolean; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import { Config } from '@jest/types'; +export default function isValidPath(globalConfig: Config.GlobalConfig, filePath: Config.Path): boolean; diff --git a/node_modules/@jest/core/build/ts3.4/lib/log_debug_messages.d.ts b/node_modules/@jest/core/build/ts3.4/lib/log_debug_messages.d.ts index a35bbc5b3..0a2d95aab 100644 --- a/node_modules/@jest/core/build/ts3.4/lib/log_debug_messages.d.ts +++ b/node_modules/@jest/core/build/ts3.4/lib/log_debug_messages.d.ts @@ -1,10 +1,10 @@ -/// -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -/// -import { Config } from '@jest/types'; -export default function logDebugMessages(globalConfig: Config.GlobalConfig, configs: Array | Config.ProjectConfig, outputStream: NodeJS.WriteStream): void; +/// +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +/// +import { Config } from '@jest/types'; +export default function logDebugMessages(globalConfig: Config.GlobalConfig, configs: Array | Config.ProjectConfig, outputStream: NodeJS.WriteStream): void; diff --git a/node_modules/@jest/core/build/ts3.4/lib/update_global_config.d.ts b/node_modules/@jest/core/build/ts3.4/lib/update_global_config.d.ts index 5f354fd84..e0c0bbd51 100644 --- a/node_modules/@jest/core/build/ts3.4/lib/update_global_config.d.ts +++ b/node_modules/@jest/core/build/ts3.4/lib/update_global_config.d.ts @@ -1,11 +1,11 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import { Config } from '@jest/types'; -declare const _default: (globalConfig: Config.GlobalConfig, options?: Partial & { - mode: "watch" | "watchAll"; -}> & Partial>) => Config.GlobalConfig; -export default _default; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import { Config } from '@jest/types'; +declare const _default: (globalConfig: Config.GlobalConfig, options?: Partial & { + mode: "watch" | "watchAll"; +}> & Partial>) => Config.GlobalConfig; +export default _default; diff --git a/node_modules/@jest/core/build/ts3.4/lib/watch_plugins_helpers.d.ts b/node_modules/@jest/core/build/ts3.4/lib/watch_plugins_helpers.d.ts index bba984e22..f5791a395 100644 --- a/node_modules/@jest/core/build/ts3.4/lib/watch_plugins_helpers.d.ts +++ b/node_modules/@jest/core/build/ts3.4/lib/watch_plugins_helpers.d.ts @@ -1,10 +1,10 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import { Config } from '@jest/types'; -import { UsageData, WatchPlugin } from 'jest-watcher'; -export declare const filterInteractivePlugins: (watchPlugins: WatchPlugin[], globalConfig: Config.GlobalConfig) => WatchPlugin[]; -export declare const getSortedUsageRows: (watchPlugins: WatchPlugin[], globalConfig: Config.GlobalConfig) => UsageData[]; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import { Config } from '@jest/types'; +import { UsageData, WatchPlugin } from 'jest-watcher'; +export declare const filterInteractivePlugins: (watchPlugins: WatchPlugin[], globalConfig: Config.GlobalConfig) => WatchPlugin[]; +export declare const getSortedUsageRows: (watchPlugins: WatchPlugin[], globalConfig: Config.GlobalConfig) => UsageData[]; diff --git a/node_modules/@jest/core/build/ts3.4/plugins/quit.d.ts b/node_modules/@jest/core/build/ts3.4/plugins/quit.d.ts index 8f19a3369..61c0af772 100644 --- a/node_modules/@jest/core/build/ts3.4/plugins/quit.d.ts +++ b/node_modules/@jest/core/build/ts3.4/plugins/quit.d.ts @@ -1,22 +1,22 @@ -/// -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -/// -import { BaseWatchPlugin } from 'jest-watcher'; -declare class QuitPlugin extends BaseWatchPlugin { - isInternal: true; - constructor(options: { - stdin: NodeJS.ReadStream; - stdout: NodeJS.WriteStream; - }); - run(): Promise; - getUsageInfo(): { - key: string; - prompt: string; - }; -} -export default QuitPlugin; +/// +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +/// +import { BaseWatchPlugin } from 'jest-watcher'; +declare class QuitPlugin extends BaseWatchPlugin { + isInternal: true; + constructor(options: { + stdin: NodeJS.ReadStream; + stdout: NodeJS.WriteStream; + }); + run(): Promise; + getUsageInfo(): { + key: string; + prompt: string; + }; +} +export default QuitPlugin; diff --git a/node_modules/@jest/core/build/ts3.4/plugins/test_name_pattern.d.ts b/node_modules/@jest/core/build/ts3.4/plugins/test_name_pattern.d.ts index b4a3ac00e..fd9db5d04 100644 --- a/node_modules/@jest/core/build/ts3.4/plugins/test_name_pattern.d.ts +++ b/node_modules/@jest/core/build/ts3.4/plugins/test_name_pattern.d.ts @@ -1,25 +1,25 @@ -/// -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -/// -import { Config } from '@jest/types'; -import { BaseWatchPlugin, Prompt, UpdateConfigCallback } from 'jest-watcher'; -declare class TestNamePatternPlugin extends BaseWatchPlugin { - _prompt: Prompt; - isInternal: true; - constructor(options: { - stdin: NodeJS.ReadStream; - stdout: NodeJS.WriteStream; - }); - getUsageInfo(): { - key: string; - prompt: string; - }; - onKey(key: string): void; - run(globalConfig: Config.GlobalConfig, updateConfigAndRun: UpdateConfigCallback): Promise; -} -export default TestNamePatternPlugin; +/// +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +/// +import { Config } from '@jest/types'; +import { BaseWatchPlugin, Prompt, UpdateConfigCallback } from 'jest-watcher'; +declare class TestNamePatternPlugin extends BaseWatchPlugin { + _prompt: Prompt; + isInternal: true; + constructor(options: { + stdin: NodeJS.ReadStream; + stdout: NodeJS.WriteStream; + }); + getUsageInfo(): { + key: string; + prompt: string; + }; + onKey(key: string): void; + run(globalConfig: Config.GlobalConfig, updateConfigAndRun: UpdateConfigCallback): Promise; +} +export default TestNamePatternPlugin; diff --git a/node_modules/@jest/core/build/ts3.4/plugins/test_path_pattern.d.ts b/node_modules/@jest/core/build/ts3.4/plugins/test_path_pattern.d.ts index bd455cf7d..4a69c04d7 100644 --- a/node_modules/@jest/core/build/ts3.4/plugins/test_path_pattern.d.ts +++ b/node_modules/@jest/core/build/ts3.4/plugins/test_path_pattern.d.ts @@ -1,25 +1,25 @@ -/// -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -/// -import { Config } from '@jest/types'; -import { BaseWatchPlugin, UpdateConfigCallback } from 'jest-watcher'; -declare class TestPathPatternPlugin extends BaseWatchPlugin { - private _prompt; - isInternal: true; - constructor(options: { - stdin: NodeJS.ReadStream; - stdout: NodeJS.WriteStream; - }); - getUsageInfo(): { - key: string; - prompt: string; - }; - onKey(key: string): void; - run(globalConfig: Config.GlobalConfig, updateConfigAndRun: UpdateConfigCallback): Promise; -} -export default TestPathPatternPlugin; +/// +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +/// +import { Config } from '@jest/types'; +import { BaseWatchPlugin, UpdateConfigCallback } from 'jest-watcher'; +declare class TestPathPatternPlugin extends BaseWatchPlugin { + private _prompt; + isInternal: true; + constructor(options: { + stdin: NodeJS.ReadStream; + stdout: NodeJS.WriteStream; + }); + getUsageInfo(): { + key: string; + prompt: string; + }; + onKey(key: string): void; + run(globalConfig: Config.GlobalConfig, updateConfigAndRun: UpdateConfigCallback): Promise; +} +export default TestPathPatternPlugin; diff --git a/node_modules/@jest/core/build/ts3.4/plugins/update_snapshots.d.ts b/node_modules/@jest/core/build/ts3.4/plugins/update_snapshots.d.ts index 3359714ca..38fa983fe 100644 --- a/node_modules/@jest/core/build/ts3.4/plugins/update_snapshots.d.ts +++ b/node_modules/@jest/core/build/ts3.4/plugins/update_snapshots.d.ts @@ -1,25 +1,25 @@ -/// -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -/// -import { Config } from '@jest/types'; -import { BaseWatchPlugin, JestHookSubscriber, UpdateConfigCallback } from 'jest-watcher'; -declare class UpdateSnapshotsPlugin extends BaseWatchPlugin { - private _hasSnapshotFailure; - isInternal: true; - constructor(options: { - stdin: NodeJS.ReadStream; - stdout: NodeJS.WriteStream; - }); - run(_globalConfig: Config.GlobalConfig, updateConfigAndRun: UpdateConfigCallback): Promise; - apply(hooks: JestHookSubscriber): void; - getUsageInfo(): { - key: string; - prompt: string; - } | null; -} -export default UpdateSnapshotsPlugin; +/// +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +/// +import { Config } from '@jest/types'; +import { BaseWatchPlugin, JestHookSubscriber, UpdateConfigCallback } from 'jest-watcher'; +declare class UpdateSnapshotsPlugin extends BaseWatchPlugin { + private _hasSnapshotFailure; + isInternal: true; + constructor(options: { + stdin: NodeJS.ReadStream; + stdout: NodeJS.WriteStream; + }); + run(_globalConfig: Config.GlobalConfig, updateConfigAndRun: UpdateConfigCallback): Promise; + apply(hooks: JestHookSubscriber): void; + getUsageInfo(): { + key: string; + prompt: string; + } | null; +} +export default UpdateSnapshotsPlugin; diff --git a/node_modules/@jest/core/build/ts3.4/plugins/update_snapshots_interactive.d.ts b/node_modules/@jest/core/build/ts3.4/plugins/update_snapshots_interactive.d.ts index e1a1b75a1..113c32300 100644 --- a/node_modules/@jest/core/build/ts3.4/plugins/update_snapshots_interactive.d.ts +++ b/node_modules/@jest/core/build/ts3.4/plugins/update_snapshots_interactive.d.ts @@ -1,23 +1,23 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import { Config } from '@jest/types'; -import { AggregatedResult, AssertionLocation } from '@jest/test-result'; -import { BaseWatchPlugin, JestHookSubscriber } from 'jest-watcher'; -declare class UpdateSnapshotInteractivePlugin extends BaseWatchPlugin { - private _snapshotInteractiveMode; - private _failedSnapshotTestAssertions; - isInternal: true; - getFailedSnapshotTestAssertions(testResults: AggregatedResult): Array; - apply(hooks: JestHookSubscriber): void; - onKey(key: string): void; - run(_globalConfig: Config.GlobalConfig, updateConfigAndRun: Function): Promise; - getUsageInfo(): { - key: string; - prompt: string; - } | null; -} -export default UpdateSnapshotInteractivePlugin; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import { Config } from '@jest/types'; +import { AggregatedResult, AssertionLocation } from '@jest/test-result'; +import { BaseWatchPlugin, JestHookSubscriber } from 'jest-watcher'; +declare class UpdateSnapshotInteractivePlugin extends BaseWatchPlugin { + private _snapshotInteractiveMode; + private _failedSnapshotTestAssertions; + isInternal: true; + getFailedSnapshotTestAssertions(testResults: AggregatedResult): Array; + apply(hooks: JestHookSubscriber): void; + onKey(key: string): void; + run(_globalConfig: Config.GlobalConfig, updateConfigAndRun: Function): Promise; + getUsageInfo(): { + key: string; + prompt: string; + } | null; +} +export default UpdateSnapshotInteractivePlugin; diff --git a/node_modules/@jest/core/build/ts3.4/pluralize.d.ts b/node_modules/@jest/core/build/ts3.4/pluralize.d.ts index a4e01ce96..6eb7bf38a 100644 --- a/node_modules/@jest/core/build/ts3.4/pluralize.d.ts +++ b/node_modules/@jest/core/build/ts3.4/pluralize.d.ts @@ -1,7 +1,7 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -export default function pluralize(word: string, count: number, ending: string): string; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +export default function pluralize(word: string, count: number, ending: string): string; diff --git a/node_modules/@jest/core/build/ts3.4/runGlobalHook.d.ts b/node_modules/@jest/core/build/ts3.4/runGlobalHook.d.ts index a4a565521..f55655f77 100644 --- a/node_modules/@jest/core/build/ts3.4/runGlobalHook.d.ts +++ b/node_modules/@jest/core/build/ts3.4/runGlobalHook.d.ts @@ -1,13 +1,13 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import { Config } from '@jest/types'; -declare const _default: ({ allTests, globalConfig, moduleName, }: { - allTests: import("jest-runner/build/types").Test[]; - globalConfig: Config.GlobalConfig; - moduleName: "globalSetup" | "globalTeardown"; -}) => Promise; -export default _default; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import { Config } from '@jest/types'; +declare const _default: ({ allTests, globalConfig, moduleName, }: { + allTests: import("jest-runner/build/types").Test[]; + globalConfig: Config.GlobalConfig; + moduleName: "globalSetup" | "globalTeardown"; +}) => Promise; +export default _default; diff --git a/node_modules/@jest/core/build/ts3.4/runJest.d.ts b/node_modules/@jest/core/build/ts3.4/runJest.d.ts index 18c52295c..a6ee44658 100644 --- a/node_modules/@jest/core/build/ts3.4/runJest.d.ts +++ b/node_modules/@jest/core/build/ts3.4/runJest.d.ts @@ -1,28 +1,28 @@ -/// -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -/// -import { JestHookEmitter } from 'jest-watcher'; -import { Context } from 'jest-runtime'; -import { Config } from '@jest/types'; -import { AggregatedResult } from '@jest/test-result'; -import { ChangedFilesPromise } from 'jest-changed-files'; -import FailedTestsCache from './FailedTestsCache'; -import TestWatcher from './TestWatcher'; -import { Filter } from './types'; -export default function runJest({ contexts, globalConfig, outputStream, testWatcher, jestHooks, startRun, changedFilesPromise, onComplete, failedTestsCache, filter, }: { - globalConfig: Config.GlobalConfig; - contexts: Array; - outputStream: NodeJS.WriteStream; - testWatcher: TestWatcher; - jestHooks?: JestHookEmitter; - startRun: (globalConfig: Config.GlobalConfig) => void; - changedFilesPromise?: ChangedFilesPromise; - onComplete: (testResults: AggregatedResult) => void; - failedTestsCache?: FailedTestsCache; - filter?: Filter; -}): Promise; +/// +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +/// +import { JestHookEmitter } from 'jest-watcher'; +import { Context } from 'jest-runtime'; +import { Config } from '@jest/types'; +import { AggregatedResult } from '@jest/test-result'; +import { ChangedFilesPromise } from 'jest-changed-files'; +import FailedTestsCache from './FailedTestsCache'; +import TestWatcher from './TestWatcher'; +import { Filter } from './types'; +export default function runJest({ contexts, globalConfig, outputStream, testWatcher, jestHooks, startRun, changedFilesPromise, onComplete, failedTestsCache, filter, }: { + globalConfig: Config.GlobalConfig; + contexts: Array; + outputStream: NodeJS.WriteStream; + testWatcher: TestWatcher; + jestHooks?: JestHookEmitter; + startRun: (globalConfig: Config.GlobalConfig) => void; + changedFilesPromise?: ChangedFilesPromise; + onComplete: (testResults: AggregatedResult) => void; + failedTestsCache?: FailedTestsCache; + filter?: Filter; +}): Promise; diff --git a/node_modules/@jest/core/build/ts3.4/testSchedulerHelper.d.ts b/node_modules/@jest/core/build/ts3.4/testSchedulerHelper.d.ts index a841ffee2..2a2356341 100644 --- a/node_modules/@jest/core/build/ts3.4/testSchedulerHelper.d.ts +++ b/node_modules/@jest/core/build/ts3.4/testSchedulerHelper.d.ts @@ -1,9 +1,9 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import { Config } from '@jest/types'; -import { Test } from 'jest-runner'; -export declare function shouldRunInBand(tests: Array, timings: Array, { detectOpenHandles, maxWorkers, watch, watchAll }: Config.GlobalConfig): boolean; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import { Config } from '@jest/types'; +import { Test } from 'jest-runner'; +export declare function shouldRunInBand(tests: Array, timings: Array, { detectOpenHandles, maxWorkers, watch, watchAll }: Config.GlobalConfig): boolean; diff --git a/node_modules/@jest/core/build/ts3.4/types.d.ts b/node_modules/@jest/core/build/ts3.4/types.d.ts index 7106dd821..c80828d4f 100644 --- a/node_modules/@jest/core/build/ts3.4/types.d.ts +++ b/node_modules/@jest/core/build/ts3.4/types.d.ts @@ -1,39 +1,39 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import { Context } from 'jest-runtime'; -import { Test } from 'jest-runner'; -import { Config } from '@jest/types'; -export declare type Stats = { - roots: number; - testMatch: number; - testPathIgnorePatterns: number; - testRegex: number; - testPathPattern?: number; -}; -export declare type TestRunData = Array<{ - context: Context; - matches: { - allTests: number; - tests: Array; - total?: number; - stats?: Stats; - }; -}>; -export declare type TestPathCases = Array<{ - stat: keyof Stats; - isMatch: (path: Config.Path) => boolean; -}>; -export declare type TestPathCasesWithPathPattern = TestPathCases & { - testPathPattern: (path: Config.Path) => boolean; -}; -export declare type FilterResult = { - test: string; - message: string; -}; -export declare type Filter = (testPaths: Array) => Promise<{ - filtered: Array; -}>; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import { Context } from 'jest-runtime'; +import { Test } from 'jest-runner'; +import { Config } from '@jest/types'; +export declare type Stats = { + roots: number; + testMatch: number; + testPathIgnorePatterns: number; + testRegex: number; + testPathPattern?: number; +}; +export declare type TestRunData = Array<{ + context: Context; + matches: { + allTests: number; + tests: Array; + total?: number; + stats?: Stats; + }; +}>; +export declare type TestPathCases = Array<{ + stat: keyof Stats; + isMatch: (path: Config.Path) => boolean; +}>; +export declare type TestPathCasesWithPathPattern = TestPathCases & { + testPathPattern: (path: Config.Path) => boolean; +}; +export declare type FilterResult = { + test: string; + message: string; +}; +export declare type Filter = (testPaths: Array) => Promise<{ + filtered: Array; +}>; diff --git a/node_modules/@jest/core/build/ts3.4/version.d.ts b/node_modules/@jest/core/build/ts3.4/version.d.ts index 86467315e..43b75ce4a 100644 --- a/node_modules/@jest/core/build/ts3.4/version.d.ts +++ b/node_modules/@jest/core/build/ts3.4/version.d.ts @@ -1,7 +1,7 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -export default function getVersion(): string; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +export default function getVersion(): string; diff --git a/node_modules/@jest/core/build/ts3.4/watch.d.ts b/node_modules/@jest/core/build/ts3.4/watch.d.ts index 8f2b65a58..514e0296f 100644 --- a/node_modules/@jest/core/build/ts3.4/watch.d.ts +++ b/node_modules/@jest/core/build/ts3.4/watch.d.ts @@ -1,14 +1,14 @@ -/// -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -/// -import HasteMap = require('jest-haste-map'); -import { Context } from 'jest-runtime'; -import { Config } from '@jest/types'; -import { JestHook } from 'jest-watcher'; -import { Filter } from './types'; -export default function watch(initialGlobalConfig: Config.GlobalConfig, contexts: Array, outputStream: NodeJS.WriteStream, hasteMapInstances: Array, stdin?: NodeJS.ReadStream, hooks?: JestHook, filter?: Filter): Promise; +/// +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +/// +import HasteMap = require('jest-haste-map'); +import { Context } from 'jest-runtime'; +import { Config } from '@jest/types'; +import { JestHook } from 'jest-watcher'; +import { Filter } from './types'; +export default function watch(initialGlobalConfig: Config.GlobalConfig, contexts: Array, outputStream: NodeJS.WriteStream, hasteMapInstances: Array, stdin?: NodeJS.ReadStream, hooks?: JestHook, filter?: Filter): Promise; diff --git a/node_modules/@jest/environment/build/ts3.4/index.d.ts b/node_modules/@jest/environment/build/ts3.4/index.d.ts index e8b20eba6..1cd63757a 100644 --- a/node_modules/@jest/environment/build/ts3.4/index.d.ts +++ b/node_modules/@jest/environment/build/ts3.4/index.d.ts @@ -1,265 +1,265 @@ -/// -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -/// -import { Context, Script } from 'vm'; -import { Circus, Config, Global } from '@jest/types'; -import jestMock = require('jest-mock'); -import { JestFakeTimers as LegacyFakeTimers, LolexFakeTimers } from '@jest/fake-timers'; -declare type JestMockFn = typeof jestMock.fn; -declare type JestMockSpyOn = typeof jestMock.spyOn; -export declare type EnvironmentContext = Partial<{ - console: Console; - docblockPragmas: Record>; - testPath: Config.Path; -}>; -export declare type ModuleWrapper = (this: Module['exports'], module: Module, exports: Module['exports'], require: Module['require'], __dirname: string, __filename: Module['filename'], global: Global.Global, jest: Jest, ...extraGlobals: Array) => unknown; -export declare class JestEnvironment { - constructor(config: Config.ProjectConfig, context?: EnvironmentContext); - global: Global.Global; - fakeTimers: LegacyFakeTimers | null; - fakeTimersLolex: LolexFakeTimers | null; - moduleMocker: jestMock.ModuleMocker | null; - /** - * @deprecated implement getVmContext instead - */ - runScript(script: Script): T | null; - getVmContext?(): Context | null; - setup(): Promise; - teardown(): Promise; - handleTestEvent?(event: Circus.Event, state: Circus.State): void | Promise; -} -export declare type Module = NodeModule; -export interface LocalModuleRequire extends NodeRequire { - requireActual(moduleName: string): unknown; - requireMock(moduleName: string): unknown; -} -export interface Jest { - /** - * Provides a way to add Jasmine-compatible matchers into your Jest context. - * - * @deprecated Use `expect.extend` instead - */ - addMatchers(matchers: Record): void; - /** - * Advances all timers by the needed milliseconds so that only the next timeouts/intervals will run. - * Optionally, you can provide steps, so it will run steps amount of next timeouts/intervals. - */ - advanceTimersToNextTimer(steps?: number): void; - /** - * Disables automatic mocking in the module loader. - */ - autoMockOff(): Jest; - /** - * Enables automatic mocking in the module loader. - */ - autoMockOn(): Jest; - /** - * Clears the mock.calls and mock.instances properties of all mocks. - * Equivalent to calling .mockClear() on every mocked function. - */ - clearAllMocks(): Jest; - /** - * Removes any pending timers from the timer system. If any timers have been - * scheduled, they will be cleared and will never have the opportunity to - * execute in the future. - */ - clearAllTimers(): void; - /** - * Indicates that the module system should never return a mocked version - * of the specified module, including all of the specified module's - * dependencies. - */ - deepUnmock(moduleName: string): Jest; - /** - * Disables automatic mocking in the module loader. - * - * After this method is called, all `require()`s will return the real - * versions of each module (rather than a mocked version). - */ - disableAutomock(): Jest; - /** - * When using `babel-jest`, calls to mock will automatically be hoisted to - * the top of the code block. Use this method if you want to explicitly avoid - * this behavior. - */ - doMock(moduleName: string, moduleFactory?: () => unknown): Jest; - /** - * Indicates that the module system should never return a mocked version - * of the specified module from require() (e.g. that it should always return - * the real module). - */ - dontMock(moduleName: string): Jest; - /** - * Enables automatic mocking in the module loader. - */ - enableAutomock(): Jest; - /** - * Creates a mock function. Optionally takes a mock implementation. - */ - fn: JestMockFn; - /** - * Given the name of a module, use the automatic mocking system to generate a - * mocked version of the module for you. - * - * This is useful when you want to create a manual mock that extends the - * automatic mock's behavior. - */ - genMockFromModule(moduleName: string): unknown; - /** - * Determines if the given function is a mocked function. - */ - isMockFunction(fn: Function): fn is ReturnType; - /** - * Mocks a module with an auto-mocked version when it is being required. - */ - mock(moduleName: string, moduleFactory?: () => unknown, options?: { - virtual?: boolean; - }): Jest; - /** - * Returns the actual module instead of a mock, bypassing all checks on - * whether the module should receive a mock implementation or not. - * - * @example - ``` - jest.mock('../myModule', () => { - // Require the original module to not be mocked... - const originalModule = jest.requireActual(moduleName); - return { - __esModule: true, // Use it when dealing with esModules - ...originalModule, - getRandom: jest.fn().mockReturnValue(10), - }; - }); - - const getRandom = require('../myModule').getRandom; - - getRandom(); // Always returns 10 - ``` - */ - requireActual: (moduleName: string) => unknown; - /** - * Returns a mock module instead of the actual module, bypassing all checks - * on whether the module should be required normally or not. - */ - requireMock: (moduleName: string) => unknown; - /** - * Resets the state of all mocks. - * Equivalent to calling .mockReset() on every mocked function. - */ - resetAllMocks(): Jest; - /** - * Resets the module registry - the cache of all required modules. This is - * useful to isolate modules where local state might conflict between tests. - * - * @deprecated Use `jest.resetModules()` - */ - resetModuleRegistry(): Jest; - /** - * Resets the module registry - the cache of all required modules. This is - * useful to isolate modules where local state might conflict between tests. - */ - resetModules(): Jest; - /** - * Restores all mocks back to their original value. Equivalent to calling - * `.mockRestore` on every mocked function. - * - * Beware that jest.restoreAllMocks() only works when the mock was created with - * jest.spyOn; other mocks will require you to manually restore them. - */ - restoreAllMocks(): Jest; - /** - * Runs failed tests n-times until they pass or until the max number of - * retries is exhausted. This only works with `jest-circus`! - */ - retryTimes(numRetries: number): Jest; - /** - * Exhausts tasks queued by setImmediate(). - */ - runAllImmediates(): void; - /** - * Exhausts the micro-task queue (usually interfaced in node via - * process.nextTick). - */ - runAllTicks(): void; - /** - * Exhausts the macro-task queue (i.e., all tasks queued by setTimeout() - * and setInterval()). - */ - runAllTimers(): void; - /** - * Executes only the macro-tasks that are currently pending (i.e., only the - * tasks that have been queued by setTimeout() or setInterval() up to this - * point). If any of the currently pending macro-tasks schedule new - * macro-tasks, those new tasks will not be executed by this call. - */ - runOnlyPendingTimers(): void; - /** - * Advances all timers by msToRun milliseconds. All pending "macro-tasks" - * that have been queued via setTimeout() or setInterval(), and would be - * executed within this timeframe will be executed. - */ - advanceTimersByTime(msToRun: number): void; - /** - * Executes only the macro task queue (i.e. all tasks queued by setTimeout() - * or setInterval() and setImmediate()). - * - * @deprecated Use `jest.advanceTimersByTime()` - */ - runTimersToTime(msToRun: number): void; - /** - * Returns the number of fake timers still left to run. - */ - getTimerCount(): number; - /** - * Explicitly supplies the mock object that the module system should return - * for the specified module. - * - * Note It is recommended to use `jest.mock()` instead. The `jest.mock` - * API's second argument is a module factory instead of the expected - * exported module object. - */ - setMock(moduleName: string, moduleExports: unknown): Jest; - /** - * Set the default timeout interval for tests and before/after hooks in - * milliseconds. - * - * Note: The default timeout interval is 5 seconds if this method is not - * called. - */ - setTimeout(timeout: number): Jest; - /** - * Creates a mock function similar to `jest.fn` but also tracks calls to - * `object[methodName]`. - * - * Note: By default, jest.spyOn also calls the spied method. This is - * different behavior from most other test libraries. - */ - spyOn: JestMockSpyOn; - /** - * Indicates that the module system should never return a mocked version of - * the specified module from require() (e.g. that it should always return the - * real module). - */ - unmock(moduleName: string): Jest; - /** - * Instructs Jest to use fake versions of the standard timer functions. - */ - useFakeTimers(): Jest; - /** - * Instructs Jest to use the real versions of the standard timer functions. - */ - useRealTimers(): Jest; - /** - * `jest.isolateModules(fn)` goes a step further than `jest.resetModules()` - * and creates a sandbox registry for the modules that are loaded inside - * the callback function. This is useful to isolate specific modules for - * every test so that local module state doesn't conflict between tests. - */ - isolateModules(fn: () => void): Jest; -} -export {}; +/// +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +/// +import { Context, Script } from 'vm'; +import { Circus, Config, Global } from '@jest/types'; +import jestMock = require('jest-mock'); +import { JestFakeTimers as LegacyFakeTimers, LolexFakeTimers } from '@jest/fake-timers'; +declare type JestMockFn = typeof jestMock.fn; +declare type JestMockSpyOn = typeof jestMock.spyOn; +export declare type EnvironmentContext = Partial<{ + console: Console; + docblockPragmas: Record>; + testPath: Config.Path; +}>; +export declare type ModuleWrapper = (this: Module['exports'], module: Module, exports: Module['exports'], require: Module['require'], __dirname: string, __filename: Module['filename'], global: Global.Global, jest: Jest, ...extraGlobals: Array) => unknown; +export declare class JestEnvironment { + constructor(config: Config.ProjectConfig, context?: EnvironmentContext); + global: Global.Global; + fakeTimers: LegacyFakeTimers | null; + fakeTimersLolex: LolexFakeTimers | null; + moduleMocker: jestMock.ModuleMocker | null; + /** + * @deprecated implement getVmContext instead + */ + runScript(script: Script): T | null; + getVmContext?(): Context | null; + setup(): Promise; + teardown(): Promise; + handleTestEvent?(event: Circus.Event, state: Circus.State): void | Promise; +} +export declare type Module = NodeModule; +export interface LocalModuleRequire extends NodeRequire { + requireActual(moduleName: string): unknown; + requireMock(moduleName: string): unknown; +} +export interface Jest { + /** + * Provides a way to add Jasmine-compatible matchers into your Jest context. + * + * @deprecated Use `expect.extend` instead + */ + addMatchers(matchers: Record): void; + /** + * Advances all timers by the needed milliseconds so that only the next timeouts/intervals will run. + * Optionally, you can provide steps, so it will run steps amount of next timeouts/intervals. + */ + advanceTimersToNextTimer(steps?: number): void; + /** + * Disables automatic mocking in the module loader. + */ + autoMockOff(): Jest; + /** + * Enables automatic mocking in the module loader. + */ + autoMockOn(): Jest; + /** + * Clears the mock.calls and mock.instances properties of all mocks. + * Equivalent to calling .mockClear() on every mocked function. + */ + clearAllMocks(): Jest; + /** + * Removes any pending timers from the timer system. If any timers have been + * scheduled, they will be cleared and will never have the opportunity to + * execute in the future. + */ + clearAllTimers(): void; + /** + * Indicates that the module system should never return a mocked version + * of the specified module, including all of the specified module's + * dependencies. + */ + deepUnmock(moduleName: string): Jest; + /** + * Disables automatic mocking in the module loader. + * + * After this method is called, all `require()`s will return the real + * versions of each module (rather than a mocked version). + */ + disableAutomock(): Jest; + /** + * When using `babel-jest`, calls to mock will automatically be hoisted to + * the top of the code block. Use this method if you want to explicitly avoid + * this behavior. + */ + doMock(moduleName: string, moduleFactory?: () => unknown): Jest; + /** + * Indicates that the module system should never return a mocked version + * of the specified module from require() (e.g. that it should always return + * the real module). + */ + dontMock(moduleName: string): Jest; + /** + * Enables automatic mocking in the module loader. + */ + enableAutomock(): Jest; + /** + * Creates a mock function. Optionally takes a mock implementation. + */ + fn: JestMockFn; + /** + * Given the name of a module, use the automatic mocking system to generate a + * mocked version of the module for you. + * + * This is useful when you want to create a manual mock that extends the + * automatic mock's behavior. + */ + genMockFromModule(moduleName: string): unknown; + /** + * Determines if the given function is a mocked function. + */ + isMockFunction(fn: Function): fn is ReturnType; + /** + * Mocks a module with an auto-mocked version when it is being required. + */ + mock(moduleName: string, moduleFactory?: () => unknown, options?: { + virtual?: boolean; + }): Jest; + /** + * Returns the actual module instead of a mock, bypassing all checks on + * whether the module should receive a mock implementation or not. + * + * @example + ``` + jest.mock('../myModule', () => { + // Require the original module to not be mocked... + const originalModule = jest.requireActual(moduleName); + return { + __esModule: true, // Use it when dealing with esModules + ...originalModule, + getRandom: jest.fn().mockReturnValue(10), + }; + }); + + const getRandom = require('../myModule').getRandom; + + getRandom(); // Always returns 10 + ``` + */ + requireActual: (moduleName: string) => unknown; + /** + * Returns a mock module instead of the actual module, bypassing all checks + * on whether the module should be required normally or not. + */ + requireMock: (moduleName: string) => unknown; + /** + * Resets the state of all mocks. + * Equivalent to calling .mockReset() on every mocked function. + */ + resetAllMocks(): Jest; + /** + * Resets the module registry - the cache of all required modules. This is + * useful to isolate modules where local state might conflict between tests. + * + * @deprecated Use `jest.resetModules()` + */ + resetModuleRegistry(): Jest; + /** + * Resets the module registry - the cache of all required modules. This is + * useful to isolate modules where local state might conflict between tests. + */ + resetModules(): Jest; + /** + * Restores all mocks back to their original value. Equivalent to calling + * `.mockRestore` on every mocked function. + * + * Beware that jest.restoreAllMocks() only works when the mock was created with + * jest.spyOn; other mocks will require you to manually restore them. + */ + restoreAllMocks(): Jest; + /** + * Runs failed tests n-times until they pass or until the max number of + * retries is exhausted. This only works with `jest-circus`! + */ + retryTimes(numRetries: number): Jest; + /** + * Exhausts tasks queued by setImmediate(). + */ + runAllImmediates(): void; + /** + * Exhausts the micro-task queue (usually interfaced in node via + * process.nextTick). + */ + runAllTicks(): void; + /** + * Exhausts the macro-task queue (i.e., all tasks queued by setTimeout() + * and setInterval()). + */ + runAllTimers(): void; + /** + * Executes only the macro-tasks that are currently pending (i.e., only the + * tasks that have been queued by setTimeout() or setInterval() up to this + * point). If any of the currently pending macro-tasks schedule new + * macro-tasks, those new tasks will not be executed by this call. + */ + runOnlyPendingTimers(): void; + /** + * Advances all timers by msToRun milliseconds. All pending "macro-tasks" + * that have been queued via setTimeout() or setInterval(), and would be + * executed within this timeframe will be executed. + */ + advanceTimersByTime(msToRun: number): void; + /** + * Executes only the macro task queue (i.e. all tasks queued by setTimeout() + * or setInterval() and setImmediate()). + * + * @deprecated Use `jest.advanceTimersByTime()` + */ + runTimersToTime(msToRun: number): void; + /** + * Returns the number of fake timers still left to run. + */ + getTimerCount(): number; + /** + * Explicitly supplies the mock object that the module system should return + * for the specified module. + * + * Note It is recommended to use `jest.mock()` instead. The `jest.mock` + * API's second argument is a module factory instead of the expected + * exported module object. + */ + setMock(moduleName: string, moduleExports: unknown): Jest; + /** + * Set the default timeout interval for tests and before/after hooks in + * milliseconds. + * + * Note: The default timeout interval is 5 seconds if this method is not + * called. + */ + setTimeout(timeout: number): Jest; + /** + * Creates a mock function similar to `jest.fn` but also tracks calls to + * `object[methodName]`. + * + * Note: By default, jest.spyOn also calls the spied method. This is + * different behavior from most other test libraries. + */ + spyOn: JestMockSpyOn; + /** + * Indicates that the module system should never return a mocked version of + * the specified module from require() (e.g. that it should always return the + * real module). + */ + unmock(moduleName: string): Jest; + /** + * Instructs Jest to use fake versions of the standard timer functions. + */ + useFakeTimers(): Jest; + /** + * Instructs Jest to use the real versions of the standard timer functions. + */ + useRealTimers(): Jest; + /** + * `jest.isolateModules(fn)` goes a step further than `jest.resetModules()` + * and creates a sandbox registry for the modules that are loaded inside + * the callback function. This is useful to isolate specific modules for + * every test so that local module state doesn't conflict between tests. + */ + isolateModules(fn: () => void): Jest; +} +export {}; diff --git a/node_modules/@jest/fake-timers/build/ts3.4/FakeTimersLolex.d.ts b/node_modules/@jest/fake-timers/build/ts3.4/FakeTimersLolex.d.ts index a51713a60..736578939 100644 --- a/node_modules/@jest/fake-timers/build/ts3.4/FakeTimersLolex.d.ts +++ b/node_modules/@jest/fake-timers/build/ts3.4/FakeTimersLolex.d.ts @@ -1,36 +1,36 @@ -/// -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -/// -import { StackTraceConfig } from 'jest-message-util'; -export default class FakeTimers { - private _clock; - private _config; - private _fakingTime; - private _global; - private _lolex; - private _maxLoops; - constructor({ global, config, maxLoops, }: { - global: NodeJS.Global; - config: StackTraceConfig; - maxLoops?: number; - }); - clearAllTimers(): void; - dispose(): void; - runAllTimers(): void; - runOnlyPendingTimers(): void; - advanceTimersToNextTimer(steps?: number): void; - advanceTimersByTime(msToRun: number): void; - runAllTicks(): void; - useRealTimers(): void; - useFakeTimers(): void; - reset(): void; - setSystemTime(now?: number): void; - getRealSystemTime(): number; - getTimerCount(): number; - private _checkFakeTimers; -} +/// +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +/// +import { StackTraceConfig } from 'jest-message-util'; +export default class FakeTimers { + private _clock; + private _config; + private _fakingTime; + private _global; + private _lolex; + private _maxLoops; + constructor({ global, config, maxLoops, }: { + global: NodeJS.Global; + config: StackTraceConfig; + maxLoops?: number; + }); + clearAllTimers(): void; + dispose(): void; + runAllTimers(): void; + runOnlyPendingTimers(): void; + advanceTimersToNextTimer(steps?: number): void; + advanceTimersByTime(msToRun: number): void; + runAllTicks(): void; + useRealTimers(): void; + useFakeTimers(): void; + reset(): void; + setSystemTime(now?: number): void; + getRealSystemTime(): number; + getTimerCount(): number; + private _checkFakeTimers; +} diff --git a/node_modules/@jest/fake-timers/build/ts3.4/index.d.ts b/node_modules/@jest/fake-timers/build/ts3.4/index.d.ts index 5b5ff7cb5..766aeb6a2 100644 --- a/node_modules/@jest/fake-timers/build/ts3.4/index.d.ts +++ b/node_modules/@jest/fake-timers/build/ts3.4/index.d.ts @@ -1,8 +1,8 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -export { default as JestFakeTimers } from './jestFakeTimers'; -export { default as LolexFakeTimers } from './FakeTimersLolex'; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +export { default as JestFakeTimers } from './jestFakeTimers'; +export { default as LolexFakeTimers } from './FakeTimersLolex'; diff --git a/node_modules/@jest/fake-timers/build/ts3.4/jestFakeTimers.d.ts b/node_modules/@jest/fake-timers/build/ts3.4/jestFakeTimers.d.ts index c05cacead..680cac74b 100644 --- a/node_modules/@jest/fake-timers/build/ts3.4/jestFakeTimers.d.ts +++ b/node_modules/@jest/fake-timers/build/ts3.4/jestFakeTimers.d.ts @@ -1,63 +1,63 @@ -/// -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -/// -import { ModuleMocker } from 'jest-mock'; -import { StackTraceConfig } from 'jest-message-util'; -declare type Callback = (...args: Array) => void; -declare type TimerConfig = { - idToRef: (id: number) => Ref; - refToId: (ref: Ref) => number | void; -}; -export default class FakeTimers { - private _cancelledTicks; - private _config; - private _disposed?; - private _fakeTimerAPIs; - private _global; - private _immediates; - private _maxLoops; - private _moduleMocker; - private _now; - private _ticks; - private _timerAPIs; - private _timers; - private _uuidCounter; - private _timerConfig; - constructor({ global, moduleMocker, timerConfig, config, maxLoops, }: { - global: NodeJS.Global; - moduleMocker: ModuleMocker; - timerConfig: TimerConfig; - config: StackTraceConfig; - maxLoops?: number; - }); - clearAllTimers(): void; - dispose(): void; - reset(): void; - runAllTicks(): void; - runAllImmediates(): void; - private _runImmediate; - runAllTimers(): void; - runOnlyPendingTimers(): void; - advanceTimersToNextTimer(steps?: number): void; - advanceTimersByTime(msToRun: number): void; - runWithRealTimers(cb: Callback): void; - useRealTimers(): void; - useFakeTimers(): void; - getTimerCount(): number; - private _checkFakeTimers; - private _createMocks; - private _fakeClearTimer; - private _fakeClearImmediate; - private _fakeNextTick; - private _fakeSetImmediate; - private _fakeSetInterval; - private _fakeSetTimeout; - private _getNextTimerHandle; - private _runTimerHandle; -} -export {}; +/// +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +/// +import { ModuleMocker } from 'jest-mock'; +import { StackTraceConfig } from 'jest-message-util'; +declare type Callback = (...args: Array) => void; +declare type TimerConfig = { + idToRef: (id: number) => Ref; + refToId: (ref: Ref) => number | void; +}; +export default class FakeTimers { + private _cancelledTicks; + private _config; + private _disposed?; + private _fakeTimerAPIs; + private _global; + private _immediates; + private _maxLoops; + private _moduleMocker; + private _now; + private _ticks; + private _timerAPIs; + private _timers; + private _uuidCounter; + private _timerConfig; + constructor({ global, moduleMocker, timerConfig, config, maxLoops, }: { + global: NodeJS.Global; + moduleMocker: ModuleMocker; + timerConfig: TimerConfig; + config: StackTraceConfig; + maxLoops?: number; + }); + clearAllTimers(): void; + dispose(): void; + reset(): void; + runAllTicks(): void; + runAllImmediates(): void; + private _runImmediate; + runAllTimers(): void; + runOnlyPendingTimers(): void; + advanceTimersToNextTimer(steps?: number): void; + advanceTimersByTime(msToRun: number): void; + runWithRealTimers(cb: Callback): void; + useRealTimers(): void; + useFakeTimers(): void; + getTimerCount(): number; + private _checkFakeTimers; + private _createMocks; + private _fakeClearTimer; + private _fakeClearImmediate; + private _fakeNextTick; + private _fakeSetImmediate; + private _fakeSetInterval; + private _fakeSetTimeout; + private _getNextTimerHandle; + private _runTimerHandle; +} +export {}; diff --git a/node_modules/@jest/globals/build/ts3.4/index.d.ts b/node_modules/@jest/globals/build/ts3.4/index.d.ts index 9aac1e9ca..e0c9479ce 100644 --- a/node_modules/@jest/globals/build/ts3.4/index.d.ts +++ b/node_modules/@jest/globals/build/ts3.4/index.d.ts @@ -1,23 +1,23 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import importedExpect = require('expect'); -import { Jest } from '@jest/environment'; -import { Global } from '@jest/types'; -export declare const jest: Jest; -export declare const expect: typeof importedExpect; -export declare const it: Global.GlobalAdditions['it']; -export declare const test: Global.GlobalAdditions['test']; -export declare const fit: Global.GlobalAdditions['fit']; -export declare const xit: Global.GlobalAdditions['xit']; -export declare const xtest: Global.GlobalAdditions['xtest']; -export declare const describe: Global.GlobalAdditions['describe']; -export declare const xdescribe: Global.GlobalAdditions['xdescribe']; -export declare const fdescribe: Global.GlobalAdditions['fdescribe']; -export declare const beforeAll: Global.GlobalAdditions['beforeAll']; -export declare const beforeEach: Global.GlobalAdditions['beforeEach']; -export declare const afterEach: Global.GlobalAdditions['afterEach']; -export declare const afterAll: Global.GlobalAdditions['afterAll']; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import importedExpect = require('expect'); +import { Jest } from '@jest/environment'; +import { Global } from '@jest/types'; +export declare const jest: Jest; +export declare const expect: typeof importedExpect; +export declare const it: Global.GlobalAdditions['it']; +export declare const test: Global.GlobalAdditions['test']; +export declare const fit: Global.GlobalAdditions['fit']; +export declare const xit: Global.GlobalAdditions['xit']; +export declare const xtest: Global.GlobalAdditions['xtest']; +export declare const describe: Global.GlobalAdditions['describe']; +export declare const xdescribe: Global.GlobalAdditions['xdescribe']; +export declare const fdescribe: Global.GlobalAdditions['fdescribe']; +export declare const beforeAll: Global.GlobalAdditions['beforeAll']; +export declare const beforeEach: Global.GlobalAdditions['beforeEach']; +export declare const afterEach: Global.GlobalAdditions['afterEach']; +export declare const afterAll: Global.GlobalAdditions['afterAll']; diff --git a/node_modules/@jest/reporters/build/ts3.4/Status.d.ts b/node_modules/@jest/reporters/build/ts3.4/Status.d.ts index 6a4249d2b..9f43e0612 100644 --- a/node_modules/@jest/reporters/build/ts3.4/Status.d.ts +++ b/node_modules/@jest/reporters/build/ts3.4/Status.d.ts @@ -1,40 +1,40 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import { Config } from '@jest/types'; -import { AggregatedResult, TestResult } from '@jest/test-result'; -import { ReporterOnStartOptions } from './types'; -declare type Cache = { - content: string; - clear: string; -}; -/** - * A class that generates the CLI status of currently running tests - * and also provides an ANSI escape sequence to remove status lines - * from the terminal. - */ -export default class Status { - private _cache; - private _callback?; - private _currentTests; - private _done; - private _emitScheduled; - private _estimatedTime; - private _interval?; - private _aggregatedResults?; - private _showStatus; - constructor(); - onChange(callback: () => void): void; - runStarted(aggregatedResults: AggregatedResult, options: ReporterOnStartOptions): void; - runFinished(): void; - testStarted(testPath: Config.Path, config: Config.ProjectConfig): void; - testFinished(_config: Config.ProjectConfig, testResult: TestResult, aggregatedResults: AggregatedResult): void; - get(): Cache; - private _emit; - private _debouncedEmit; - private _tick; -} -export {}; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import { Config } from '@jest/types'; +import { AggregatedResult, TestResult } from '@jest/test-result'; +import { ReporterOnStartOptions } from './types'; +declare type Cache = { + content: string; + clear: string; +}; +/** + * A class that generates the CLI status of currently running tests + * and also provides an ANSI escape sequence to remove status lines + * from the terminal. + */ +export default class Status { + private _cache; + private _callback?; + private _currentTests; + private _done; + private _emitScheduled; + private _estimatedTime; + private _interval?; + private _aggregatedResults?; + private _showStatus; + constructor(); + onChange(callback: () => void): void; + runStarted(aggregatedResults: AggregatedResult, options: ReporterOnStartOptions): void; + runFinished(): void; + testStarted(testPath: Config.Path, config: Config.ProjectConfig): void; + testFinished(_config: Config.ProjectConfig, testResult: TestResult, aggregatedResults: AggregatedResult): void; + get(): Cache; + private _emit; + private _debouncedEmit; + private _tick; +} +export {}; diff --git a/node_modules/@jest/reporters/build/ts3.4/base_reporter.d.ts b/node_modules/@jest/reporters/build/ts3.4/base_reporter.d.ts index 6e7be220e..05b57a949 100644 --- a/node_modules/@jest/reporters/build/ts3.4/base_reporter.d.ts +++ b/node_modules/@jest/reporters/build/ts3.4/base_reporter.d.ts @@ -1,18 +1,18 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import { AggregatedResult, TestResult } from '@jest/test-result'; -import { Context, Reporter, ReporterOnStartOptions, Test } from './types'; -export default class BaseReporter implements Reporter { - private _error?; - log(message: string): void; - onRunStart(_results?: AggregatedResult, _options?: ReporterOnStartOptions): void; - onTestResult(_test?: Test, _testResult?: TestResult, _results?: AggregatedResult): void; - onTestStart(_test?: Test): void; - onRunComplete(_contexts?: Set, _aggregatedResults?: AggregatedResult): Promise | void; - protected _setError(error: Error): void; - getLastError(): Error | undefined; -} +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import { AggregatedResult, TestResult } from '@jest/test-result'; +import { Context, Reporter, ReporterOnStartOptions, Test } from './types'; +export default class BaseReporter implements Reporter { + private _error?; + log(message: string): void; + onRunStart(_results?: AggregatedResult, _options?: ReporterOnStartOptions): void; + onTestResult(_test?: Test, _testResult?: TestResult, _results?: AggregatedResult): void; + onTestStart(_test?: Test): void; + onRunComplete(_contexts?: Set, _aggregatedResults?: AggregatedResult): Promise | void; + protected _setError(error: Error): void; + getLastError(): Error | undefined; +} diff --git a/node_modules/@jest/reporters/build/ts3.4/coverage_reporter.d.ts b/node_modules/@jest/reporters/build/ts3.4/coverage_reporter.d.ts index 8c2f2ebcf..ec1b20a07 100644 --- a/node_modules/@jest/reporters/build/ts3.4/coverage_reporter.d.ts +++ b/node_modules/@jest/reporters/build/ts3.4/coverage_reporter.d.ts @@ -1,23 +1,23 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import { Config } from '@jest/types'; -import { AggregatedResult, TestResult } from '@jest/test-result'; -import BaseReporter from './base_reporter'; -import { Context, CoverageReporterOptions, Test } from './types'; -export default class CoverageReporter extends BaseReporter { - private _coverageMap; - private _globalConfig; - private _sourceMapStore; - private _options; - private _v8CoverageResults; - constructor(globalConfig: Config.GlobalConfig, options?: CoverageReporterOptions); - onTestResult(_test: Test, testResult: TestResult): void; - onRunComplete(contexts: Set, aggregatedResults: AggregatedResult): Promise; - private _addUntestedFiles; - private _checkThreshold; - private _getCoverageResult; -} +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import { Config } from '@jest/types'; +import { AggregatedResult, TestResult } from '@jest/test-result'; +import BaseReporter from './base_reporter'; +import { Context, CoverageReporterOptions, Test } from './types'; +export default class CoverageReporter extends BaseReporter { + private _coverageMap; + private _globalConfig; + private _sourceMapStore; + private _options; + private _v8CoverageResults; + constructor(globalConfig: Config.GlobalConfig, options?: CoverageReporterOptions); + onTestResult(_test: Test, testResult: TestResult): void; + onRunComplete(contexts: Set, aggregatedResults: AggregatedResult): Promise; + private _addUntestedFiles; + private _checkThreshold; + private _getCoverageResult; +} diff --git a/node_modules/@jest/reporters/build/ts3.4/coverage_worker.d.ts b/node_modules/@jest/reporters/build/ts3.4/coverage_worker.d.ts index 052b6487f..58c7eac47 100644 --- a/node_modules/@jest/reporters/build/ts3.4/coverage_worker.d.ts +++ b/node_modules/@jest/reporters/build/ts3.4/coverage_worker.d.ts @@ -1,17 +1,17 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import { Config } from '@jest/types'; -import { CoverageReporterSerializedOptions } from './types'; -import { CoverageWorkerResult } from './generateEmptyCoverage'; -export declare type CoverageWorkerData = { - globalConfig: Config.GlobalConfig; - config: Config.ProjectConfig; - path: Config.Path; - options?: CoverageReporterSerializedOptions; -}; -export { CoverageWorkerResult }; -export declare function worker({ config, globalConfig, path, options, }: CoverageWorkerData): CoverageWorkerResult | null; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import { Config } from '@jest/types'; +import { CoverageReporterSerializedOptions } from './types'; +import { CoverageWorkerResult } from './generateEmptyCoverage'; +export declare type CoverageWorkerData = { + globalConfig: Config.GlobalConfig; + config: Config.ProjectConfig; + path: Config.Path; + options?: CoverageReporterSerializedOptions; +}; +export { CoverageWorkerResult }; +export declare function worker({ config, globalConfig, path, options, }: CoverageWorkerData): CoverageWorkerResult | null; diff --git a/node_modules/@jest/reporters/build/ts3.4/default_reporter.d.ts b/node_modules/@jest/reporters/build/ts3.4/default_reporter.d.ts index 0c07d165c..b50f6c7a5 100644 --- a/node_modules/@jest/reporters/build/ts3.4/default_reporter.d.ts +++ b/node_modules/@jest/reporters/build/ts3.4/default_reporter.d.ts @@ -1,30 +1,30 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import { Config } from '@jest/types'; -import { AggregatedResult, TestResult } from '@jest/test-result'; -import { ReporterOnStartOptions, Test } from './types'; -import BaseReporter from './base_reporter'; -export default class DefaultReporter extends BaseReporter { - private _clear; - private _err; - protected _globalConfig: Config.GlobalConfig; - private _out; - private _status; - private _bufferedOutput; - constructor(globalConfig: Config.GlobalConfig); - private _wrapStdio; - forceFlushBufferedOutput(): void; - private _clearStatus; - private _printStatus; - onRunStart(aggregatedResults: AggregatedResult, options: ReporterOnStartOptions): void; - onTestStart(test: Test): void; - onRunComplete(): void; - onTestResult(test: Test, testResult: TestResult, aggregatedResults: AggregatedResult): void; - testFinished(config: Config.ProjectConfig, testResult: TestResult, aggregatedResults: AggregatedResult): void; - printTestFileHeader(_testPath: Config.Path, config: Config.ProjectConfig, result: TestResult): void; - printTestFileFailureMessage(_testPath: Config.Path, _config: Config.ProjectConfig, result: TestResult): void; -} +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import { Config } from '@jest/types'; +import { AggregatedResult, TestResult } from '@jest/test-result'; +import { ReporterOnStartOptions, Test } from './types'; +import BaseReporter from './base_reporter'; +export default class DefaultReporter extends BaseReporter { + private _clear; + private _err; + protected _globalConfig: Config.GlobalConfig; + private _out; + private _status; + private _bufferedOutput; + constructor(globalConfig: Config.GlobalConfig); + private _wrapStdio; + forceFlushBufferedOutput(): void; + private _clearStatus; + private _printStatus; + onRunStart(aggregatedResults: AggregatedResult, options: ReporterOnStartOptions): void; + onTestStart(test: Test): void; + onRunComplete(): void; + onTestResult(test: Test, testResult: TestResult, aggregatedResults: AggregatedResult): void; + testFinished(config: Config.ProjectConfig, testResult: TestResult, aggregatedResults: AggregatedResult): void; + printTestFileHeader(_testPath: Config.Path, config: Config.ProjectConfig, result: TestResult): void; + printTestFileFailureMessage(_testPath: Config.Path, _config: Config.ProjectConfig, result: TestResult): void; +} diff --git a/node_modules/@jest/reporters/build/ts3.4/generateEmptyCoverage.d.ts b/node_modules/@jest/reporters/build/ts3.4/generateEmptyCoverage.d.ts index e3ff62c70..3624e5ce7 100644 --- a/node_modules/@jest/reporters/build/ts3.4/generateEmptyCoverage.d.ts +++ b/node_modules/@jest/reporters/build/ts3.4/generateEmptyCoverage.d.ts @@ -1,19 +1,19 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import { Config } from '@jest/types'; -import { FileCoverage } from 'istanbul-lib-coverage'; -import { V8Coverage } from 'collect-v8-coverage'; -declare type SingleV8Coverage = V8Coverage[number]; -export declare type CoverageWorkerResult = { - kind: 'BabelCoverage'; - coverage: FileCoverage; -} | { - kind: 'V8Coverage'; - result: SingleV8Coverage; -}; -export default function (source: string, filename: Config.Path, globalConfig: Config.GlobalConfig, config: Config.ProjectConfig, changedFiles?: Set, sourcesRelatedToTestsInChangedFiles?: Set): CoverageWorkerResult | null; -export {}; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import { Config } from '@jest/types'; +import { FileCoverage } from 'istanbul-lib-coverage'; +import { V8Coverage } from 'collect-v8-coverage'; +declare type SingleV8Coverage = V8Coverage[number]; +export declare type CoverageWorkerResult = { + kind: 'BabelCoverage'; + coverage: FileCoverage; +} | { + kind: 'V8Coverage'; + result: SingleV8Coverage; +}; +export default function (source: string, filename: Config.Path, globalConfig: Config.GlobalConfig, config: Config.ProjectConfig, changedFiles?: Set, sourcesRelatedToTestsInChangedFiles?: Set): CoverageWorkerResult | null; +export {}; diff --git a/node_modules/@jest/reporters/build/ts3.4/get_result_header.d.ts b/node_modules/@jest/reporters/build/ts3.4/get_result_header.d.ts index c4833d0fe..02f21b407 100644 --- a/node_modules/@jest/reporters/build/ts3.4/get_result_header.d.ts +++ b/node_modules/@jest/reporters/build/ts3.4/get_result_header.d.ts @@ -1,10 +1,10 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import { Config } from '@jest/types'; -import { TestResult } from '@jest/test-result'; -declare const _default: (result: TestResult, globalConfig: Config.GlobalConfig, projectConfig?: Config.ProjectConfig | undefined) => string; -export default _default; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import { Config } from '@jest/types'; +import { TestResult } from '@jest/test-result'; +declare const _default: (result: TestResult, globalConfig: Config.GlobalConfig, projectConfig?: Config.ProjectConfig | undefined) => string; +export default _default; diff --git a/node_modules/@jest/reporters/build/ts3.4/get_snapshot_status.d.ts b/node_modules/@jest/reporters/build/ts3.4/get_snapshot_status.d.ts index 771a8a8eb..86a45b6d3 100644 --- a/node_modules/@jest/reporters/build/ts3.4/get_snapshot_status.d.ts +++ b/node_modules/@jest/reporters/build/ts3.4/get_snapshot_status.d.ts @@ -1,16 +1,16 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -declare const _default: (snapshot: { - added: number; - fileDeleted: boolean; - matched: number; - unchecked: number; - uncheckedKeys: string[]; - unmatched: number; - updated: number; -}, afterUpdate: boolean) => string[]; -export default _default; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +declare const _default: (snapshot: { + added: number; + fileDeleted: boolean; + matched: number; + unchecked: number; + uncheckedKeys: string[]; + unmatched: number; + updated: number; +}, afterUpdate: boolean) => string[]; +export default _default; diff --git a/node_modules/@jest/reporters/build/ts3.4/get_snapshot_summary.d.ts b/node_modules/@jest/reporters/build/ts3.4/get_snapshot_summary.d.ts index eca8a9f66..f5d25ca7c 100644 --- a/node_modules/@jest/reporters/build/ts3.4/get_snapshot_summary.d.ts +++ b/node_modules/@jest/reporters/build/ts3.4/get_snapshot_summary.d.ts @@ -1,10 +1,10 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import { Config } from '@jest/types'; -import { SnapshotSummary } from '@jest/test-result'; -declare const _default: (snapshots: SnapshotSummary, globalConfig: Config.GlobalConfig, updateCommand: string) => string[]; -export default _default; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import { Config } from '@jest/types'; +import { SnapshotSummary } from '@jest/test-result'; +declare const _default: (snapshots: SnapshotSummary, globalConfig: Config.GlobalConfig, updateCommand: string) => string[]; +export default _default; diff --git a/node_modules/@jest/reporters/build/ts3.4/get_watermarks.d.ts b/node_modules/@jest/reporters/build/ts3.4/get_watermarks.d.ts index 3e9505d26..cdb090a13 100644 --- a/node_modules/@jest/reporters/build/ts3.4/get_watermarks.d.ts +++ b/node_modules/@jest/reporters/build/ts3.4/get_watermarks.d.ts @@ -1,9 +1,9 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import { Config } from '@jest/types'; -import istanbulReport = require('istanbul-lib-report'); -export default function getWatermarks(config: Config.GlobalConfig): istanbulReport.Watermarks; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import { Config } from '@jest/types'; +import istanbulReport = require('istanbul-lib-report'); +export default function getWatermarks(config: Config.GlobalConfig): istanbulReport.Watermarks; diff --git a/node_modules/@jest/reporters/build/ts3.4/index.d.ts b/node_modules/@jest/reporters/build/ts3.4/index.d.ts index 67d58d2ef..eb59a14a3 100644 --- a/node_modules/@jest/reporters/build/ts3.4/index.d.ts +++ b/node_modules/@jest/reporters/build/ts3.4/index.d.ts @@ -1,18 +1,18 @@ -export { Config } from '@jest/types'; -export { AggregatedResult, SnapshotSummary, TestResult, } from '@jest/test-result'; -export { default as BaseReporter } from './base_reporter'; -export { default as CoverageReporter } from './coverage_reporter'; -export { default as DefaultReporter } from './default_reporter'; -export { default as NotifyReporter } from './notify_reporter'; -export { default as SummaryReporter } from './summary_reporter'; -export { default as VerboseReporter } from './verbose_reporter'; -export { Context, Reporter, ReporterOnStartOptions, SummaryOptions, Test, } from './types'; -export declare const utils: { - formatTestPath: (config: import("@jest/types/build/Config").GlobalConfig | import("@jest/types/build/Config").ProjectConfig, testPath: string) => string; - printDisplayName: (config: import("@jest/types/build/Config").ProjectConfig) => string; - relativePath: (config: import("@jest/types/build/Config").GlobalConfig | import("@jest/types/build/Config").ProjectConfig, testPath: string) => { - basename: string; - dirname: string; - }; - trimAndFormatPath: (pad: number, config: import("@jest/types/build/Config").GlobalConfig | import("@jest/types/build/Config").ProjectConfig, testPath: string, columns: number) => string; -}; +export { Config } from '@jest/types'; +export { AggregatedResult, SnapshotSummary, TestResult, } from '@jest/test-result'; +export { default as BaseReporter } from './base_reporter'; +export { default as CoverageReporter } from './coverage_reporter'; +export { default as DefaultReporter } from './default_reporter'; +export { default as NotifyReporter } from './notify_reporter'; +export { default as SummaryReporter } from './summary_reporter'; +export { default as VerboseReporter } from './verbose_reporter'; +export { Context, Reporter, ReporterOnStartOptions, SummaryOptions, Test, } from './types'; +export declare const utils: { + formatTestPath: (config: import("@jest/types/build/Config").GlobalConfig | import("@jest/types/build/Config").ProjectConfig, testPath: string) => string; + printDisplayName: (config: import("@jest/types/build/Config").ProjectConfig) => string; + relativePath: (config: import("@jest/types/build/Config").GlobalConfig | import("@jest/types/build/Config").ProjectConfig, testPath: string) => { + basename: string; + dirname: string; + }; + trimAndFormatPath: (pad: number, config: import("@jest/types/build/Config").GlobalConfig | import("@jest/types/build/Config").ProjectConfig, testPath: string, columns: number) => string; +}; diff --git a/node_modules/@jest/reporters/build/ts3.4/notify_reporter.d.ts b/node_modules/@jest/reporters/build/ts3.4/notify_reporter.d.ts index 7b4f6c12e..43b42491e 100644 --- a/node_modules/@jest/reporters/build/ts3.4/notify_reporter.d.ts +++ b/node_modules/@jest/reporters/build/ts3.4/notify_reporter.d.ts @@ -1,18 +1,18 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import { Config } from '@jest/types'; -import { AggregatedResult } from '@jest/test-result'; -import { Context, TestSchedulerContext } from './types'; -import BaseReporter from './base_reporter'; -export default class NotifyReporter extends BaseReporter { - private _notifier; - private _startRun; - private _globalConfig; - private _context; - constructor(globalConfig: Config.GlobalConfig, startRun: (globalConfig: Config.GlobalConfig) => any, context: TestSchedulerContext); - onRunComplete(contexts: Set, result: AggregatedResult): void; -} +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import { Config } from '@jest/types'; +import { AggregatedResult } from '@jest/test-result'; +import { Context, TestSchedulerContext } from './types'; +import BaseReporter from './base_reporter'; +export default class NotifyReporter extends BaseReporter { + private _notifier; + private _startRun; + private _globalConfig; + private _context; + constructor(globalConfig: Config.GlobalConfig, startRun: (globalConfig: Config.GlobalConfig) => any, context: TestSchedulerContext); + onRunComplete(contexts: Set, result: AggregatedResult): void; +} diff --git a/node_modules/@jest/reporters/build/ts3.4/summary_reporter.d.ts b/node_modules/@jest/reporters/build/ts3.4/summary_reporter.d.ts index 19a1b2247..9aa6eca3b 100644 --- a/node_modules/@jest/reporters/build/ts3.4/summary_reporter.d.ts +++ b/node_modules/@jest/reporters/build/ts3.4/summary_reporter.d.ts @@ -1,21 +1,21 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import { Config } from '@jest/types'; -import { AggregatedResult } from '@jest/test-result'; -import { Context, ReporterOnStartOptions } from './types'; -import BaseReporter from './base_reporter'; -export default class SummaryReporter extends BaseReporter { - private _estimatedTime; - private _globalConfig; - constructor(globalConfig: Config.GlobalConfig); - private _write; - onRunStart(aggregatedResults: AggregatedResult, options: ReporterOnStartOptions): void; - onRunComplete(contexts: Set, aggregatedResults: AggregatedResult): void; - private _printSnapshotSummary; - private _printSummary; - private _getTestSummary; -} +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import { Config } from '@jest/types'; +import { AggregatedResult } from '@jest/test-result'; +import { Context, ReporterOnStartOptions } from './types'; +import BaseReporter from './base_reporter'; +export default class SummaryReporter extends BaseReporter { + private _estimatedTime; + private _globalConfig; + constructor(globalConfig: Config.GlobalConfig); + private _write; + onRunStart(aggregatedResults: AggregatedResult, options: ReporterOnStartOptions): void; + onRunComplete(contexts: Set, aggregatedResults: AggregatedResult): void; + private _printSnapshotSummary; + private _printSummary; + private _getTestSummary; +} diff --git a/node_modules/@jest/reporters/build/ts3.4/types.d.ts b/node_modules/@jest/reporters/build/ts3.4/types.d.ts index a0d49a6b4..ae502da92 100644 --- a/node_modules/@jest/reporters/build/ts3.4/types.d.ts +++ b/node_modules/@jest/reporters/build/ts3.4/types.d.ts @@ -1,68 +1,68 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import { Config } from '@jest/types'; -import { AggregatedResult, SerializableError, TestResult } from '@jest/test-result'; -import { FS as HasteFS, ModuleMap } from 'jest-haste-map'; -import HasteResolver = require('jest-resolve'); -import { worker } from './coverage_worker'; -export declare type ReporterOnStartOptions = { - estimatedTime: number; - showStatus: boolean; -}; -export declare type Context = { - config: Config.ProjectConfig; - hasteFS: HasteFS; - moduleMap: ModuleMap; - resolver: HasteResolver; -}; -export declare type Test = { - context: Context; - duration?: number; - path: Config.Path; -}; -export declare type CoverageWorker = { - worker: typeof worker; -}; -export declare type CoverageReporterOptions = { - changedFiles?: Set; - sourcesRelatedToTestsInChangedFiles?: Set; -}; -export declare type CoverageReporterSerializedOptions = { - changedFiles?: Array; - sourcesRelatedToTestsInChangedFiles?: Array; -}; -export declare type OnTestStart = (test: Test) => Promise; -export declare type OnTestFailure = (test: Test, error: SerializableError) => Promise; -export declare type OnTestSuccess = (test: Test, result: TestResult) => Promise; -export interface Reporter { - readonly onTestResult: (test: Test, testResult: TestResult, aggregatedResult: AggregatedResult) => Promise | void; - readonly onRunStart: (results: AggregatedResult, options: ReporterOnStartOptions) => Promise | void; - readonly onTestStart: (test: Test) => Promise | void; - readonly onRunComplete: (contexts: Set, results: AggregatedResult) => Promise | void; - readonly getLastError: () => Error | void; -} -export declare type SummaryOptions = { - estimatedTime?: number; - roundTime?: boolean; - width?: number; -}; -export declare type TestRunnerOptions = { - serial: boolean; -}; -export declare type TestRunData = Array<{ - context: Context; - matches: { - allTests: number; - tests: Array; - total: number; - }; -}>; -export declare type TestSchedulerContext = { - firstRun: boolean; - previousSuccess: boolean; - changedFiles?: Set; -}; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import { Config } from '@jest/types'; +import { AggregatedResult, SerializableError, TestResult } from '@jest/test-result'; +import { FS as HasteFS, ModuleMap } from 'jest-haste-map'; +import HasteResolver = require('jest-resolve'); +import { worker } from './coverage_worker'; +export declare type ReporterOnStartOptions = { + estimatedTime: number; + showStatus: boolean; +}; +export declare type Context = { + config: Config.ProjectConfig; + hasteFS: HasteFS; + moduleMap: ModuleMap; + resolver: HasteResolver; +}; +export declare type Test = { + context: Context; + duration?: number; + path: Config.Path; +}; +export declare type CoverageWorker = { + worker: typeof worker; +}; +export declare type CoverageReporterOptions = { + changedFiles?: Set; + sourcesRelatedToTestsInChangedFiles?: Set; +}; +export declare type CoverageReporterSerializedOptions = { + changedFiles?: Array; + sourcesRelatedToTestsInChangedFiles?: Array; +}; +export declare type OnTestStart = (test: Test) => Promise; +export declare type OnTestFailure = (test: Test, error: SerializableError) => Promise; +export declare type OnTestSuccess = (test: Test, result: TestResult) => Promise; +export interface Reporter { + readonly onTestResult: (test: Test, testResult: TestResult, aggregatedResult: AggregatedResult) => Promise | void; + readonly onRunStart: (results: AggregatedResult, options: ReporterOnStartOptions) => Promise | void; + readonly onTestStart: (test: Test) => Promise | void; + readonly onRunComplete: (contexts: Set, results: AggregatedResult) => Promise | void; + readonly getLastError: () => Error | void; +} +export declare type SummaryOptions = { + estimatedTime?: number; + roundTime?: boolean; + width?: number; +}; +export declare type TestRunnerOptions = { + serial: boolean; +}; +export declare type TestRunData = Array<{ + context: Context; + matches: { + allTests: number; + tests: Array; + total: number; + }; +}>; +export declare type TestSchedulerContext = { + firstRun: boolean; + previousSuccess: boolean; + changedFiles?: Set; +}; diff --git a/node_modules/@jest/reporters/build/ts3.4/utils.d.ts b/node_modules/@jest/reporters/build/ts3.4/utils.d.ts index 1c4b9358b..0339729e4 100644 --- a/node_modules/@jest/reporters/build/ts3.4/utils.d.ts +++ b/node_modules/@jest/reporters/build/ts3.4/utils.d.ts @@ -1,18 +1,18 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import { Config } from '@jest/types'; -import { AggregatedResult } from '@jest/test-result'; -import { SummaryOptions } from './types'; -export declare const printDisplayName: (config: Config.ProjectConfig) => string; -export declare const trimAndFormatPath: (pad: number, config: Config.GlobalConfig | Config.ProjectConfig, testPath: string, columns: number) => string; -export declare const formatTestPath: (config: Config.GlobalConfig | Config.ProjectConfig, testPath: string) => string; -export declare const relativePath: (config: Config.GlobalConfig | Config.ProjectConfig, testPath: string) => { - basename: string; - dirname: string; -}; -export declare const getSummary: (aggregatedResults: AggregatedResult, options?: SummaryOptions | undefined) => string; -export declare const wrapAnsiString: (string: string, terminalWidth: number) => string; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import { Config } from '@jest/types'; +import { AggregatedResult } from '@jest/test-result'; +import { SummaryOptions } from './types'; +export declare const printDisplayName: (config: Config.ProjectConfig) => string; +export declare const trimAndFormatPath: (pad: number, config: Config.GlobalConfig | Config.ProjectConfig, testPath: string, columns: number) => string; +export declare const formatTestPath: (config: Config.GlobalConfig | Config.ProjectConfig, testPath: string) => string; +export declare const relativePath: (config: Config.GlobalConfig | Config.ProjectConfig, testPath: string) => { + basename: string; + dirname: string; +}; +export declare const getSummary: (aggregatedResults: AggregatedResult, options?: SummaryOptions | undefined) => string; +export declare const wrapAnsiString: (string: string, terminalWidth: number) => string; diff --git a/node_modules/@jest/reporters/build/ts3.4/verbose_reporter.d.ts b/node_modules/@jest/reporters/build/ts3.4/verbose_reporter.d.ts index 57797d141..6e8d68afa 100644 --- a/node_modules/@jest/reporters/build/ts3.4/verbose_reporter.d.ts +++ b/node_modules/@jest/reporters/build/ts3.4/verbose_reporter.d.ts @@ -1,24 +1,24 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import { Config } from '@jest/types'; -import { AggregatedResult, AssertionResult, Suite, TestResult } from '@jest/test-result'; -import { Test } from './types'; -import DefaultReporter from './default_reporter'; -export default class VerboseReporter extends DefaultReporter { - protected _globalConfig: Config.GlobalConfig; - constructor(globalConfig: Config.GlobalConfig); - static filterTestResults(testResults: Array): Array; - static groupTestsBySuites(testResults: Array): Suite; - onTestResult(test: Test, result: TestResult, aggregatedResults: AggregatedResult): void; - private _logTestResults; - private _logSuite; - private _getIcon; - private _logTest; - private _logTests; - private _logTodoOrPendingTest; - private _logLine; -} +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import { Config } from '@jest/types'; +import { AggregatedResult, AssertionResult, Suite, TestResult } from '@jest/test-result'; +import { Test } from './types'; +import DefaultReporter from './default_reporter'; +export default class VerboseReporter extends DefaultReporter { + protected _globalConfig: Config.GlobalConfig; + constructor(globalConfig: Config.GlobalConfig); + static filterTestResults(testResults: Array): Array; + static groupTestsBySuites(testResults: Array): Suite; + onTestResult(test: Test, result: TestResult, aggregatedResults: AggregatedResult): void; + private _logTestResults; + private _logSuite; + private _getIcon; + private _logTest; + private _logTests; + private _logTodoOrPendingTest; + private _logLine; +} diff --git a/node_modules/@jest/source-map/build/ts3.4/getCallsite.d.ts b/node_modules/@jest/source-map/build/ts3.4/getCallsite.d.ts index 824dd16b4..4a2014eac 100644 --- a/node_modules/@jest/source-map/build/ts3.4/getCallsite.d.ts +++ b/node_modules/@jest/source-map/build/ts3.4/getCallsite.d.ts @@ -1,9 +1,9 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import callsites = require('callsites'); -declare const _default: (level: number, sourceMaps?: Record | null | undefined) => callsites.CallSite; -export default _default; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import callsites = require('callsites'); +declare const _default: (level: number, sourceMaps?: Record | null | undefined) => callsites.CallSite; +export default _default; diff --git a/node_modules/@jest/source-map/build/ts3.4/index.d.ts b/node_modules/@jest/source-map/build/ts3.4/index.d.ts index a2a676469..8c1564927 100644 --- a/node_modules/@jest/source-map/build/ts3.4/index.d.ts +++ b/node_modules/@jest/source-map/build/ts3.4/index.d.ts @@ -1,8 +1,8 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -export { default as getCallsite } from './getCallsite'; -export { SourceMapRegistry } from './types'; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +export { default as getCallsite } from './getCallsite'; +export { SourceMapRegistry } from './types'; diff --git a/node_modules/@jest/source-map/build/ts3.4/types.d.ts b/node_modules/@jest/source-map/build/ts3.4/types.d.ts index 3085f8e5c..3c91157b4 100644 --- a/node_modules/@jest/source-map/build/ts3.4/types.d.ts +++ b/node_modules/@jest/source-map/build/ts3.4/types.d.ts @@ -1,7 +1,7 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -export declare type SourceMapRegistry = Record; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +export declare type SourceMapRegistry = Record; diff --git a/node_modules/@jest/test-result/build/ts3.4/formatTestResults.d.ts b/node_modules/@jest/test-result/build/ts3.4/formatTestResults.d.ts index 93b7e5700..a917e3be0 100644 --- a/node_modules/@jest/test-result/build/ts3.4/formatTestResults.d.ts +++ b/node_modules/@jest/test-result/build/ts3.4/formatTestResults.d.ts @@ -1,8 +1,8 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import { AggregatedResult, CodeCoverageFormatter, CodeCoverageReporter, FormattedTestResults } from './types'; -export default function formatTestResults(results: AggregatedResult, codeCoverageFormatter?: CodeCoverageFormatter, reporter?: CodeCoverageReporter): FormattedTestResults; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import { AggregatedResult, CodeCoverageFormatter, CodeCoverageReporter, FormattedTestResults } from './types'; +export default function formatTestResults(results: AggregatedResult, codeCoverageFormatter?: CodeCoverageFormatter, reporter?: CodeCoverageReporter): FormattedTestResults; diff --git a/node_modules/@jest/test-result/build/ts3.4/helpers.d.ts b/node_modules/@jest/test-result/build/ts3.4/helpers.d.ts index 3d4e44be1..215c3ff67 100644 --- a/node_modules/@jest/test-result/build/ts3.4/helpers.d.ts +++ b/node_modules/@jest/test-result/build/ts3.4/helpers.d.ts @@ -1,11 +1,11 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import { AggregatedResult, TestResult } from './types'; -export declare const makeEmptyAggregatedTestResult: () => AggregatedResult; -export declare const buildFailureTestResult: (testPath: string, err: import("@jest/types/build/TestResult").SerializableError) => TestResult; -export declare const addResult: (aggregatedResults: AggregatedResult, testResult: TestResult) => void; -export declare const createEmptyTestResult: () => TestResult; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import { AggregatedResult, TestResult } from './types'; +export declare const makeEmptyAggregatedTestResult: () => AggregatedResult; +export declare const buildFailureTestResult: (testPath: string, err: import("@jest/types/build/TestResult").SerializableError) => TestResult; +export declare const addResult: (aggregatedResults: AggregatedResult, testResult: TestResult) => void; +export declare const createEmptyTestResult: () => TestResult; diff --git a/node_modules/@jest/test-result/build/ts3.4/index.d.ts b/node_modules/@jest/test-result/build/ts3.4/index.d.ts index 81cd98696..0f8b4ec47 100644 --- a/node_modules/@jest/test-result/build/ts3.4/index.d.ts +++ b/node_modules/@jest/test-result/build/ts3.4/index.d.ts @@ -1,9 +1,9 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -export { default as formatTestResults } from './formatTestResults'; -export { addResult, buildFailureTestResult, createEmptyTestResult, makeEmptyAggregatedTestResult, } from './helpers'; -export { AggregatedResult, AssertionLocation, AssertionResult, FailedAssertion, FormattedTestResults, Milliseconds, SerializableError, SnapshotSummary, Status, Suite, TestResult, V8CoverageResult, } from './types'; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +export { default as formatTestResults } from './formatTestResults'; +export { addResult, buildFailureTestResult, createEmptyTestResult, makeEmptyAggregatedTestResult, } from './helpers'; +export { AggregatedResult, AssertionLocation, AssertionResult, FailedAssertion, FormattedTestResults, Milliseconds, SerializableError, SnapshotSummary, Status, Suite, TestResult, V8CoverageResult, } from './types'; diff --git a/node_modules/@jest/test-result/build/ts3.4/types.d.ts b/node_modules/@jest/test-result/build/ts3.4/types.d.ts index bbac5b03d..9f000ea54 100644 --- a/node_modules/@jest/test-result/build/ts3.4/types.d.ts +++ b/node_modules/@jest/test-result/build/ts3.4/types.d.ts @@ -1,146 +1,146 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import { CoverageMap, CoverageMapData } from 'istanbul-lib-coverage'; -import { ConsoleBuffer } from '@jest/console'; -import { Config, TestResult, TransformTypes } from '@jest/types'; -import { V8Coverage } from 'collect-v8-coverage'; -export declare type V8CoverageResult = Array<{ - codeTransformResult: TransformTypes.TransformResult | undefined; - result: V8Coverage[number]; -}>; -export declare type SerializableError = TestResult.SerializableError; -export declare type FailedAssertion = { - matcherName?: string; - message?: string; - actual?: any; - pass?: boolean; - passed?: boolean; - expected?: any; - isNot?: boolean; - stack?: string; - error?: any; -}; -export declare type AssertionLocation = { - fullName: string; - path: string; -}; -export declare type Status = AssertionResult['status']; -export declare type Bytes = number; -export declare type Milliseconds = TestResult.Milliseconds; -export declare type AssertionResult = TestResult.AssertionResult; -export declare type FormattedAssertionResult = Pick & { - failureMessages: AssertionResult['failureMessages'] | null; -}; -export declare type AggregatedResultWithoutCoverage = { - numFailedTests: number; - numFailedTestSuites: number; - numPassedTests: number; - numPassedTestSuites: number; - numPendingTests: number; - numTodoTests: number; - numPendingTestSuites: number; - numRuntimeErrorTestSuites: number; - numTotalTests: number; - numTotalTestSuites: number; - openHandles: Array; - snapshot: SnapshotSummary; - startTime: number; - success: boolean; - testResults: Array; - wasInterrupted: boolean; -}; -export declare type AggregatedResult = AggregatedResultWithoutCoverage & { - coverageMap?: CoverageMap | null; -}; -export declare type Suite = { - title: string; - suites: Array; - tests: Array; -}; -export declare type TestResult = { - console?: ConsoleBuffer; - coverage?: CoverageMapData; - displayName?: Config.DisplayName; - failureMessage?: string | null; - leaks: boolean; - memoryUsage?: Bytes; - numFailingTests: number; - numPassingTests: number; - numPendingTests: number; - numTodoTests: number; - openHandles: Array; - perfStats: { - end: Milliseconds; - start: Milliseconds; - }; - skipped: boolean; - snapshot: { - added: number; - fileDeleted: boolean; - matched: number; - unchecked: number; - uncheckedKeys: Array; - unmatched: number; - updated: number; - }; - sourceMaps?: { - [sourcePath: string]: string; - }; - testExecError?: SerializableError; - testFilePath: Config.Path; - testResults: Array; - v8Coverage?: V8CoverageResult; -}; -export declare type FormattedTestResult = { - message: string; - name: string; - summary: string; - status: 'failed' | 'passed'; - startTime: number; - endTime: number; - coverage: any; - assertionResults: Array; -}; -export declare type FormattedTestResults = { - coverageMap?: CoverageMap | null | undefined; - numFailedTests: number; - numFailedTestSuites: number; - numPassedTests: number; - numPassedTestSuites: number; - numPendingTests: number; - numPendingTestSuites: number; - numRuntimeErrorTestSuites: number; - numTotalTests: number; - numTotalTestSuites: number; - snapshot: SnapshotSummary; - startTime: number; - success: boolean; - testResults: Array; - wasInterrupted: boolean; -}; -export declare type CodeCoverageReporter = any; -export declare type CodeCoverageFormatter = (coverage: CoverageMapData | null | undefined, reporter: CodeCoverageReporter) => Record | null | undefined; -export declare type UncheckedSnapshot = { - filePath: string; - keys: Array; -}; -export declare type SnapshotSummary = { - added: number; - didUpdate: boolean; - failure: boolean; - filesAdded: number; - filesRemoved: number; - filesRemovedList: Array; - filesUnmatched: number; - filesUpdated: number; - matched: number; - total: number; - unchecked: number; - uncheckedKeysByFile: Array; - unmatched: number; - updated: number; -}; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import { CoverageMap, CoverageMapData } from 'istanbul-lib-coverage'; +import { ConsoleBuffer } from '@jest/console'; +import { Config, TestResult, TransformTypes } from '@jest/types'; +import { V8Coverage } from 'collect-v8-coverage'; +export declare type V8CoverageResult = Array<{ + codeTransformResult: TransformTypes.TransformResult | undefined; + result: V8Coverage[number]; +}>; +export declare type SerializableError = TestResult.SerializableError; +export declare type FailedAssertion = { + matcherName?: string; + message?: string; + actual?: any; + pass?: boolean; + passed?: boolean; + expected?: any; + isNot?: boolean; + stack?: string; + error?: any; +}; +export declare type AssertionLocation = { + fullName: string; + path: string; +}; +export declare type Status = AssertionResult['status']; +export declare type Bytes = number; +export declare type Milliseconds = TestResult.Milliseconds; +export declare type AssertionResult = TestResult.AssertionResult; +export declare type FormattedAssertionResult = Pick & { + failureMessages: AssertionResult['failureMessages'] | null; +}; +export declare type AggregatedResultWithoutCoverage = { + numFailedTests: number; + numFailedTestSuites: number; + numPassedTests: number; + numPassedTestSuites: number; + numPendingTests: number; + numTodoTests: number; + numPendingTestSuites: number; + numRuntimeErrorTestSuites: number; + numTotalTests: number; + numTotalTestSuites: number; + openHandles: Array; + snapshot: SnapshotSummary; + startTime: number; + success: boolean; + testResults: Array; + wasInterrupted: boolean; +}; +export declare type AggregatedResult = AggregatedResultWithoutCoverage & { + coverageMap?: CoverageMap | null; +}; +export declare type Suite = { + title: string; + suites: Array; + tests: Array; +}; +export declare type TestResult = { + console?: ConsoleBuffer; + coverage?: CoverageMapData; + displayName?: Config.DisplayName; + failureMessage?: string | null; + leaks: boolean; + memoryUsage?: Bytes; + numFailingTests: number; + numPassingTests: number; + numPendingTests: number; + numTodoTests: number; + openHandles: Array; + perfStats: { + end: Milliseconds; + start: Milliseconds; + }; + skipped: boolean; + snapshot: { + added: number; + fileDeleted: boolean; + matched: number; + unchecked: number; + uncheckedKeys: Array; + unmatched: number; + updated: number; + }; + sourceMaps?: { + [sourcePath: string]: string; + }; + testExecError?: SerializableError; + testFilePath: Config.Path; + testResults: Array; + v8Coverage?: V8CoverageResult; +}; +export declare type FormattedTestResult = { + message: string; + name: string; + summary: string; + status: 'failed' | 'passed'; + startTime: number; + endTime: number; + coverage: any; + assertionResults: Array; +}; +export declare type FormattedTestResults = { + coverageMap?: CoverageMap | null | undefined; + numFailedTests: number; + numFailedTestSuites: number; + numPassedTests: number; + numPassedTestSuites: number; + numPendingTests: number; + numPendingTestSuites: number; + numRuntimeErrorTestSuites: number; + numTotalTests: number; + numTotalTestSuites: number; + snapshot: SnapshotSummary; + startTime: number; + success: boolean; + testResults: Array; + wasInterrupted: boolean; +}; +export declare type CodeCoverageReporter = any; +export declare type CodeCoverageFormatter = (coverage: CoverageMapData | null | undefined, reporter: CodeCoverageReporter) => Record | null | undefined; +export declare type UncheckedSnapshot = { + filePath: string; + keys: Array; +}; +export declare type SnapshotSummary = { + added: number; + didUpdate: boolean; + failure: boolean; + filesAdded: number; + filesRemoved: number; + filesRemovedList: Array; + filesUnmatched: number; + filesUpdated: number; + matched: number; + total: number; + unchecked: number; + uncheckedKeysByFile: Array; + unmatched: number; + updated: number; +}; diff --git a/node_modules/@jest/test-sequencer/build/ts3.4/index.d.ts b/node_modules/@jest/test-sequencer/build/ts3.4/index.d.ts index f90b6a0ca..4d3540731 100644 --- a/node_modules/@jest/test-sequencer/build/ts3.4/index.d.ts +++ b/node_modules/@jest/test-sequencer/build/ts3.4/index.d.ts @@ -1,51 +1,51 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import { AggregatedResult } from '@jest/test-result'; -import { Context } from 'jest-runtime'; -import { Test } from 'jest-runner'; -declare type Cache = { - [key: string]: [0 | 1, number]; -}; -/** - * The TestSequencer will ultimately decide which tests should run first. - * It is responsible for storing and reading from a local cache - * map that stores context information for a given test, such as how long it - * took to run during the last run and if it has failed or not. - * Such information is used on: - * TestSequencer.sort(tests: Array) - * to sort the order of the provided tests. - * - * After the results are collected, - * TestSequencer.cacheResults(tests: Array, results: AggregatedResult) - * is called to store/update this information on the cache map. - */ -export default class TestSequencer { - private _cache; - _getCachePath(context: Context): string; - _getCache(test: Test): Cache; - /** - * Sorting tests is very important because it has a great impact on the - * user-perceived responsiveness and speed of the test run. - * - * If such information is on cache, tests are sorted based on: - * -> Has it failed during the last run ? - * Since it's important to provide the most expected feedback as quickly - * as possible. - * -> How long it took to run ? - * Because running long tests first is an effort to minimize worker idle - * time at the end of a long test run. - * And if that information is not available they are sorted based on file size - * since big test files usually take longer to complete. - * - * Note that a possible improvement would be to analyse other information - * from the file other than its size. - * - */ - sort(tests: Array): Array; - cacheResults(tests: Array, results: AggregatedResult): void; -} -export {}; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import { AggregatedResult } from '@jest/test-result'; +import { Context } from 'jest-runtime'; +import { Test } from 'jest-runner'; +declare type Cache = { + [key: string]: [0 | 1, number]; +}; +/** + * The TestSequencer will ultimately decide which tests should run first. + * It is responsible for storing and reading from a local cache + * map that stores context information for a given test, such as how long it + * took to run during the last run and if it has failed or not. + * Such information is used on: + * TestSequencer.sort(tests: Array) + * to sort the order of the provided tests. + * + * After the results are collected, + * TestSequencer.cacheResults(tests: Array, results: AggregatedResult) + * is called to store/update this information on the cache map. + */ +export default class TestSequencer { + private _cache; + _getCachePath(context: Context): string; + _getCache(test: Test): Cache; + /** + * Sorting tests is very important because it has a great impact on the + * user-perceived responsiveness and speed of the test run. + * + * If such information is on cache, tests are sorted based on: + * -> Has it failed during the last run ? + * Since it's important to provide the most expected feedback as quickly + * as possible. + * -> How long it took to run ? + * Because running long tests first is an effort to minimize worker idle + * time at the end of a long test run. + * And if that information is not available they are sorted based on file size + * since big test files usually take longer to complete. + * + * Note that a possible improvement would be to analyse other information + * from the file other than its size. + * + */ + sort(tests: Array): Array; + cacheResults(tests: Array, results: AggregatedResult): void; +} +export {}; diff --git a/node_modules/@jest/transform/build/ts3.4/ScriptTransformer.d.ts b/node_modules/@jest/transform/build/ts3.4/ScriptTransformer.d.ts index 1212ab0f6..2d0e84ff0 100644 --- a/node_modules/@jest/transform/build/ts3.4/ScriptTransformer.d.ts +++ b/node_modules/@jest/transform/build/ts3.4/ScriptTransformer.d.ts @@ -1,34 +1,34 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import { Config } from '@jest/types'; -import { Options, TransformResult } from './types'; -export default class ScriptTransformer { - private _cache; - private _config; - private _transformCache; - private _transformConfigCache; - constructor(config: Config.ProjectConfig); - private _getCacheKey; - private _getFileCachePath; - private _getTransformPath; - private _getTransformer; - private _instrumentFile; - private _getRealPath; - preloadTransformer(filepath: Config.Path): void; - transformSource(filepath: Config.Path, content: string, instrument: boolean, supportsDynamicImport?: boolean, supportsStaticESM?: boolean): TransformResult; - private _transformAndBuildScript; - transform(filename: Config.Path, options: Options, fileSource?: string): TransformResult; - transformJson(filename: Config.Path, options: Options, fileSource: string): string; - requireAndTranspileModule(moduleName: string, callback?: (module: ModuleType) => void): ModuleType; - requireAndTranspileModule(moduleName: string, callback?: (module: ModuleType) => Promise): Promise; - /** - * @deprecated use `this.shouldTransform` instead - */ - private _shouldTransform; - shouldTransform(filename: Config.Path): boolean; -} -export declare function createTranspilingRequire(config: Config.ProjectConfig): (resolverPath: string, applyInteropRequireDefault?: boolean) => TModuleType; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import { Config } from '@jest/types'; +import { Options, TransformResult } from './types'; +export default class ScriptTransformer { + private _cache; + private _config; + private _transformCache; + private _transformConfigCache; + constructor(config: Config.ProjectConfig); + private _getCacheKey; + private _getFileCachePath; + private _getTransformPath; + private _getTransformer; + private _instrumentFile; + private _getRealPath; + preloadTransformer(filepath: Config.Path): void; + transformSource(filepath: Config.Path, content: string, instrument: boolean, supportsDynamicImport?: boolean, supportsStaticESM?: boolean): TransformResult; + private _transformAndBuildScript; + transform(filename: Config.Path, options: Options, fileSource?: string): TransformResult; + transformJson(filename: Config.Path, options: Options, fileSource: string): string; + requireAndTranspileModule(moduleName: string, callback?: (module: ModuleType) => void): ModuleType; + requireAndTranspileModule(moduleName: string, callback?: (module: ModuleType) => Promise): Promise; + /** + * @deprecated use `this.shouldTransform` instead + */ + private _shouldTransform; + shouldTransform(filename: Config.Path): boolean; +} +export declare function createTranspilingRequire(config: Config.ProjectConfig): (resolverPath: string, applyInteropRequireDefault?: boolean) => TModuleType; diff --git a/node_modules/@jest/transform/build/ts3.4/enhanceUnexpectedTokenMessage.d.ts b/node_modules/@jest/transform/build/ts3.4/enhanceUnexpectedTokenMessage.d.ts index 7847dc7e9..bc8ba4d9c 100644 --- a/node_modules/@jest/transform/build/ts3.4/enhanceUnexpectedTokenMessage.d.ts +++ b/node_modules/@jest/transform/build/ts3.4/enhanceUnexpectedTokenMessage.d.ts @@ -1,12 +1,12 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -interface ErrorWithCodeFrame extends Error { - codeFrame?: string; -} -export default function handlePotentialSyntaxError(e: ErrorWithCodeFrame): ErrorWithCodeFrame; -export declare function enhanceUnexpectedTokenMessage(e: Error): Error; -export {}; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +interface ErrorWithCodeFrame extends Error { + codeFrame?: string; +} +export default function handlePotentialSyntaxError(e: ErrorWithCodeFrame): ErrorWithCodeFrame; +export declare function enhanceUnexpectedTokenMessage(e: Error): Error; +export {}; diff --git a/node_modules/@jest/transform/build/ts3.4/index.d.ts b/node_modules/@jest/transform/build/ts3.4/index.d.ts index 5bcc8635d..7a44e04ac 100644 --- a/node_modules/@jest/transform/build/ts3.4/index.d.ts +++ b/node_modules/@jest/transform/build/ts3.4/index.d.ts @@ -1,10 +1,10 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -export { default as ScriptTransformer, createTranspilingRequire, } from './ScriptTransformer'; -export { default as shouldInstrument } from './shouldInstrument'; -export { CacheKeyOptions, Transformer, ShouldInstrumentOptions, Options as TransformationOptions, TransformOptions, TransformResult, TransformedSource, } from './types'; -export { default as handlePotentialSyntaxError } from './enhanceUnexpectedTokenMessage'; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +export { default as ScriptTransformer, createTranspilingRequire, } from './ScriptTransformer'; +export { default as shouldInstrument } from './shouldInstrument'; +export { CacheKeyOptions, Transformer, ShouldInstrumentOptions, Options as TransformationOptions, TransformOptions, TransformResult, TransformedSource, } from './types'; +export { default as handlePotentialSyntaxError } from './enhanceUnexpectedTokenMessage'; diff --git a/node_modules/@jest/transform/build/ts3.4/shouldInstrument.d.ts b/node_modules/@jest/transform/build/ts3.4/shouldInstrument.d.ts index dde462c15..6bb46e73b 100644 --- a/node_modules/@jest/transform/build/ts3.4/shouldInstrument.d.ts +++ b/node_modules/@jest/transform/build/ts3.4/shouldInstrument.d.ts @@ -1,9 +1,9 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import { Config } from '@jest/types'; -import { ShouldInstrumentOptions } from './types'; -export default function shouldInstrument(filename: Config.Path, options: ShouldInstrumentOptions, config: Config.ProjectConfig): boolean; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import { Config } from '@jest/types'; +import { ShouldInstrumentOptions } from './types'; +export default function shouldInstrument(filename: Config.Path, options: ShouldInstrumentOptions, config: Config.ProjectConfig): boolean; diff --git a/node_modules/@jest/transform/build/ts3.4/types.d.ts b/node_modules/@jest/transform/build/ts3.4/types.d.ts index ed0b11bf0..844395b41 100644 --- a/node_modules/@jest/transform/build/ts3.4/types.d.ts +++ b/node_modules/@jest/transform/build/ts3.4/types.d.ts @@ -1,43 +1,43 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import { RawSourceMap } from 'source-map'; -import { Config, TransformTypes } from '@jest/types'; -export declare type ShouldInstrumentOptions = Pick & { - changedFiles?: Set; - sourcesRelatedToTestsInChangedFiles?: Set; -}; -export declare type Options = ShouldInstrumentOptions & Partial<{ - isCoreModule: boolean; - isInternalModule: boolean; - supportsDynamicImport: boolean; - supportsStaticESM: boolean; -}>; -declare type SourceMapWithVersion = Pick>; -interface FixedRawSourceMap extends SourceMapWithVersion { - version: number; -} -export declare type TransformedSource = { - code: string; - map?: FixedRawSourceMap | string | null; -} | string; -export declare type TransformResult = TransformTypes.TransformResult; -export interface TransformOptions { - instrument: boolean; - supportsDynamicImport?: boolean; - supportsStaticESM?: boolean; -} -export interface CacheKeyOptions extends TransformOptions { - config: Config.ProjectConfig; - rootDir: string; -} -export interface Transformer { - canInstrument?: boolean; - createTransformer?: (options?: any) => Transformer; - getCacheKey?: (fileData: string, filePath: Config.Path, configStr: string, options: CacheKeyOptions) => string; - process: (sourceText: string, sourcePath: Config.Path, config: Config.ProjectConfig, options?: TransformOptions) => TransformedSource; -} -export {}; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import { RawSourceMap } from 'source-map'; +import { Config, TransformTypes } from '@jest/types'; +export declare type ShouldInstrumentOptions = Pick & { + changedFiles?: Set; + sourcesRelatedToTestsInChangedFiles?: Set; +}; +export declare type Options = ShouldInstrumentOptions & Partial<{ + isCoreModule: boolean; + isInternalModule: boolean; + supportsDynamicImport: boolean; + supportsStaticESM: boolean; +}>; +declare type SourceMapWithVersion = Pick>; +interface FixedRawSourceMap extends SourceMapWithVersion { + version: number; +} +export declare type TransformedSource = { + code: string; + map?: FixedRawSourceMap | string | null; +} | string; +export declare type TransformResult = TransformTypes.TransformResult; +export interface TransformOptions { + instrument: boolean; + supportsDynamicImport?: boolean; + supportsStaticESM?: boolean; +} +export interface CacheKeyOptions extends TransformOptions { + config: Config.ProjectConfig; + rootDir: string; +} +export interface Transformer { + canInstrument?: boolean; + createTransformer?: (options?: any) => Transformer; + getCacheKey?: (fileData: string, filePath: Config.Path, configStr: string, options: CacheKeyOptions) => string; + process: (sourceText: string, sourcePath: Config.Path, config: Config.ProjectConfig, options?: TransformOptions) => TransformedSource; +} +export {}; diff --git a/node_modules/@jest/types/build/ts3.4/Circus.d.ts b/node_modules/@jest/types/build/ts3.4/Circus.d.ts index 1ef9e78df..a5fac78b1 100644 --- a/node_modules/@jest/types/build/ts3.4/Circus.d.ts +++ b/node_modules/@jest/types/build/ts3.4/Circus.d.ts @@ -1,177 +1,177 @@ -/// -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -/// -import * as Global from './Global'; -declare type Process = NodeJS.Process; -export declare type DoneFn = Global.DoneFn; -export declare type BlockFn = Global.BlockFn; -export declare type BlockName = Global.BlockName; -export declare type BlockMode = void | 'skip' | 'only' | 'todo'; -export declare type TestMode = BlockMode; -export declare type TestName = Global.TestName; -export declare type TestFn = Global.TestFn; -export declare type HookFn = Global.HookFn; -export declare type AsyncFn = TestFn | HookFn; -export declare type SharedHookType = 'afterAll' | 'beforeAll'; -export declare type HookType = SharedHookType | 'afterEach' | 'beforeEach'; -export declare type TestContext = Record; -export declare type Exception = any; -export declare type FormattedError = string; -export declare type Hook = { - asyncError: Error; - fn: HookFn; - type: HookType; - parent: DescribeBlock; - timeout: number | undefined | null; -}; -export interface EventHandler { - (event: AsyncEvent, state: State): void | Promise; - (event: SyncEvent, state: State): void; -} -export declare type Event = SyncEvent | AsyncEvent; -export declare type SyncEvent = { - asyncError: Error; - mode: BlockMode; - name: 'start_describe_definition'; - blockName: BlockName; -} | { - mode: BlockMode; - name: 'finish_describe_definition'; - blockName: BlockName; -} | { - asyncError: Error; - name: 'add_hook'; - hookType: HookType; - fn: HookFn; - timeout: number | undefined; -} | { - asyncError: Error; - name: 'add_test'; - testName: TestName; - fn?: TestFn; - mode?: TestMode; - timeout: number | undefined; -} | { - name: 'error'; - error: Exception; -}; -export declare type AsyncEvent = { - name: 'setup'; - testNamePattern?: string; - parentProcess: Process; -} | { - name: 'include_test_location_in_result'; -} | { - name: 'hook_start'; - hook: Hook; -} | { - name: 'hook_success'; - describeBlock?: DescribeBlock; - test?: TestEntry; - hook: Hook; -} | { - name: 'hook_failure'; - error: string | Exception; - describeBlock?: DescribeBlock; - test?: TestEntry; - hook: Hook; -} | { - name: 'test_fn_start'; - test: TestEntry; -} | { - name: 'test_fn_success'; - test: TestEntry; -} | { - name: 'test_fn_failure'; - error: Exception; - test: TestEntry; -} | { - name: 'test_retry'; - test: TestEntry; -} | { - name: 'test_start'; - test: TestEntry; -} | { - name: 'test_skip'; - test: TestEntry; -} | { - name: 'test_todo'; - test: TestEntry; -} | { - name: 'test_done'; - test: TestEntry; -} | { - name: 'run_describe_start'; - describeBlock: DescribeBlock; -} | { - name: 'run_describe_finish'; - describeBlock: DescribeBlock; -} | { - name: 'run_start'; -} | { - name: 'run_finish'; -} | { - name: 'teardown'; -}; -export declare type TestStatus = 'skip' | 'done' | 'todo'; -export declare type TestResult = { - duration?: number | null; - errors: Array; - invocations: number; - status: TestStatus; - location?: { - column: number; - line: number; - } | null; - testPath: Array; -}; -export declare type RunResult = { - unhandledErrors: Array; - testResults: TestResults; -}; -export declare type TestResults = Array; -export declare type GlobalErrorHandlers = { - uncaughtException: Array<(exception: Exception) => void>; - unhandledRejection: Array<(exception: Exception, promise: Promise) => void>; -}; -export declare type State = { - currentDescribeBlock: DescribeBlock; - currentlyRunningTest?: TestEntry | null; - expand?: boolean; - hasFocusedTests: boolean; - originalGlobalErrorHandlers?: GlobalErrorHandlers; - parentProcess: Process | null; - rootDescribeBlock: DescribeBlock; - testNamePattern?: RegExp | null; - testTimeout: number; - unhandledErrors: Array; - includeTestLocationInResult: boolean; -}; -export declare type DescribeBlock = { - children: Array; - hooks: Array; - mode: BlockMode; - name: BlockName; - parent?: DescribeBlock; - tests: Array; -}; -export declare type TestError = Exception | Array<[Exception | undefined, Exception]>; -export declare type TestEntry = { - asyncError: Exception; - errors: TestError; - fn?: TestFn; - invocations: number; - mode: TestMode; - name: TestName; - parent: DescribeBlock; - startedAt?: number | null; - duration?: number | null; - status?: TestStatus | null; - timeout?: number; -}; -export {}; +/// +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +/// +import * as Global from './Global'; +declare type Process = NodeJS.Process; +export declare type DoneFn = Global.DoneFn; +export declare type BlockFn = Global.BlockFn; +export declare type BlockName = Global.BlockName; +export declare type BlockMode = void | 'skip' | 'only' | 'todo'; +export declare type TestMode = BlockMode; +export declare type TestName = Global.TestName; +export declare type TestFn = Global.TestFn; +export declare type HookFn = Global.HookFn; +export declare type AsyncFn = TestFn | HookFn; +export declare type SharedHookType = 'afterAll' | 'beforeAll'; +export declare type HookType = SharedHookType | 'afterEach' | 'beforeEach'; +export declare type TestContext = Record; +export declare type Exception = any; +export declare type FormattedError = string; +export declare type Hook = { + asyncError: Error; + fn: HookFn; + type: HookType; + parent: DescribeBlock; + timeout: number | undefined | null; +}; +export interface EventHandler { + (event: AsyncEvent, state: State): void | Promise; + (event: SyncEvent, state: State): void; +} +export declare type Event = SyncEvent | AsyncEvent; +export declare type SyncEvent = { + asyncError: Error; + mode: BlockMode; + name: 'start_describe_definition'; + blockName: BlockName; +} | { + mode: BlockMode; + name: 'finish_describe_definition'; + blockName: BlockName; +} | { + asyncError: Error; + name: 'add_hook'; + hookType: HookType; + fn: HookFn; + timeout: number | undefined; +} | { + asyncError: Error; + name: 'add_test'; + testName: TestName; + fn?: TestFn; + mode?: TestMode; + timeout: number | undefined; +} | { + name: 'error'; + error: Exception; +}; +export declare type AsyncEvent = { + name: 'setup'; + testNamePattern?: string; + parentProcess: Process; +} | { + name: 'include_test_location_in_result'; +} | { + name: 'hook_start'; + hook: Hook; +} | { + name: 'hook_success'; + describeBlock?: DescribeBlock; + test?: TestEntry; + hook: Hook; +} | { + name: 'hook_failure'; + error: string | Exception; + describeBlock?: DescribeBlock; + test?: TestEntry; + hook: Hook; +} | { + name: 'test_fn_start'; + test: TestEntry; +} | { + name: 'test_fn_success'; + test: TestEntry; +} | { + name: 'test_fn_failure'; + error: Exception; + test: TestEntry; +} | { + name: 'test_retry'; + test: TestEntry; +} | { + name: 'test_start'; + test: TestEntry; +} | { + name: 'test_skip'; + test: TestEntry; +} | { + name: 'test_todo'; + test: TestEntry; +} | { + name: 'test_done'; + test: TestEntry; +} | { + name: 'run_describe_start'; + describeBlock: DescribeBlock; +} | { + name: 'run_describe_finish'; + describeBlock: DescribeBlock; +} | { + name: 'run_start'; +} | { + name: 'run_finish'; +} | { + name: 'teardown'; +}; +export declare type TestStatus = 'skip' | 'done' | 'todo'; +export declare type TestResult = { + duration?: number | null; + errors: Array; + invocations: number; + status: TestStatus; + location?: { + column: number; + line: number; + } | null; + testPath: Array; +}; +export declare type RunResult = { + unhandledErrors: Array; + testResults: TestResults; +}; +export declare type TestResults = Array; +export declare type GlobalErrorHandlers = { + uncaughtException: Array<(exception: Exception) => void>; + unhandledRejection: Array<(exception: Exception, promise: Promise) => void>; +}; +export declare type State = { + currentDescribeBlock: DescribeBlock; + currentlyRunningTest?: TestEntry | null; + expand?: boolean; + hasFocusedTests: boolean; + originalGlobalErrorHandlers?: GlobalErrorHandlers; + parentProcess: Process | null; + rootDescribeBlock: DescribeBlock; + testNamePattern?: RegExp | null; + testTimeout: number; + unhandledErrors: Array; + includeTestLocationInResult: boolean; +}; +export declare type DescribeBlock = { + children: Array; + hooks: Array; + mode: BlockMode; + name: BlockName; + parent?: DescribeBlock; + tests: Array; +}; +export declare type TestError = Exception | Array<[Exception | undefined, Exception]>; +export declare type TestEntry = { + asyncError: Exception; + errors: TestError; + fn?: TestFn; + invocations: number; + mode: TestMode; + name: TestName; + parent: DescribeBlock; + startedAt?: number | null; + duration?: number | null; + status?: TestStatus | null; + timeout?: number; +}; +export {}; diff --git a/node_modules/@jest/types/build/ts3.4/Config.d.ts b/node_modules/@jest/types/build/ts3.4/Config.d.ts index 291b0780e..311db3386 100644 --- a/node_modules/@jest/types/build/ts3.4/Config.d.ts +++ b/node_modules/@jest/types/build/ts3.4/Config.d.ts @@ -1,420 +1,420 @@ -/// -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -/// -import { Arguments } from 'yargs'; -import { ReportOptions } from 'istanbul-reports'; -import chalk = require('chalk'); -declare type CoverageProvider = 'babel' | 'v8'; -export declare type Path = string; -export declare type Glob = string; -export declare type HasteConfig = { - computeSha1?: boolean; - defaultPlatform?: string | null; - hasteImplModulePath?: string; - platforms?: Array; - providesModuleNodeModules: Array; - throwOnModuleCollision?: boolean; -}; -export declare type ReporterConfig = [string, Record]; -export declare type TransformerConfig = [string, Record]; -export interface ConfigGlobals { - [K: string]: unknown; -} -export declare type DefaultOptions = { - automock: boolean; - bail: number; - browser: boolean; - cache: boolean; - cacheDirectory: Path; - changedFilesWithAncestor: boolean; - clearMocks: boolean; - collectCoverage: boolean; - coveragePathIgnorePatterns: Array; - coverageReporters: Array; - coverageProvider: CoverageProvider; - errorOnDeprecated: boolean; - expand: boolean; - forceCoverageMatch: Array; - globals: ConfigGlobals; - haste: HasteConfig; - maxConcurrency: number; - maxWorkers: number | string; - moduleDirectories: Array; - moduleFileExtensions: Array; - moduleNameMapper: Record>; - modulePathIgnorePatterns: Array; - noStackTrace: boolean; - notify: boolean; - notifyMode: NotifyMode; - prettierPath: string; - resetMocks: boolean; - resetModules: boolean; - restoreMocks: boolean; - roots: Array; - runTestsByPath: boolean; - runner: 'jest-runner'; - setupFiles: Array; - setupFilesAfterEnv: Array; - skipFilter: boolean; - snapshotSerializers: Array; - testEnvironment: string; - testEnvironmentOptions: Record; - testFailureExitCode: string | number; - testLocationInResults: boolean; - testMatch: Array; - testPathIgnorePatterns: Array; - testRegex: Array; - testRunner: string; - testSequencer: string; - testURL: string; - timers: 'real' | 'fake'; - transformIgnorePatterns: Array; - useStderr: boolean; - watch: boolean; - watchPathIgnorePatterns: Array; - watchman: boolean; -}; -export declare type DisplayName = string | { - name: string; - color: typeof chalk.Color; -}; -export declare type InitialOptionsWithRootDir = InitialOptions & Required>; -export declare type InitialOptions = Partial<{ - automock: boolean; - bail: boolean | number; - browser: boolean; - cache: boolean; - cacheDirectory: Path; - clearMocks: boolean; - changedFilesWithAncestor: boolean; - changedSince: string; - collectCoverage: boolean; - collectCoverageFrom: Array; - collectCoverageOnlyFrom: { - [key: string]: boolean; - }; - coverageDirectory: string; - coveragePathIgnorePatterns: Array; - coverageProvider: CoverageProvider; - coverageReporters: Array; - coverageThreshold: { - global: { - [key: string]: number; - }; - }; - dependencyExtractor: string; - detectLeaks: boolean; - detectOpenHandles: boolean; - displayName: DisplayName; - expand: boolean; - extraGlobals: Array; - filter: Path; - findRelatedTests: boolean; - forceCoverageMatch: Array; - forceExit: boolean; - json: boolean; - globals: ConfigGlobals; - globalSetup: string | null | undefined; - globalTeardown: string | null | undefined; - haste: HasteConfig; - reporters: Array; - logHeapUsage: boolean; - lastCommit: boolean; - listTests: boolean; - mapCoverage: boolean; - maxConcurrency: number; - maxWorkers: number | string; - moduleDirectories: Array; - moduleFileExtensions: Array; - moduleLoader: Path; - moduleNameMapper: { - [key: string]: string | Array; - }; - modulePathIgnorePatterns: Array; - modulePaths: Array; - name: string; - noStackTrace: boolean; - notify: boolean; - notifyMode: string; - onlyChanged: boolean; - outputFile: Path; - passWithNoTests: boolean; - preprocessorIgnorePatterns: Array; - preset: string | null | undefined; - prettierPath: string | null | undefined; - projects: Array; - replname: string | null | undefined; - resetMocks: boolean; - resetModules: boolean; - resolver: Path | null | undefined; - restoreMocks: boolean; - rootDir: Path; - roots: Array; - runner: string; - runTestsByPath: boolean; - scriptPreprocessor: string; - setupFiles: Array; - setupTestFrameworkScriptFile: Path; - setupFilesAfterEnv: Array; - silent: boolean; - skipFilter: boolean; - skipNodeResolution: boolean; - snapshotResolver: Path; - snapshotSerializers: Array; - errorOnDeprecated: boolean; - testEnvironment: string; - testEnvironmentOptions: Record; - testFailureExitCode: string | number; - testLocationInResults: boolean; - testMatch: Array; - testNamePattern: string; - testPathDirs: Array; - testPathIgnorePatterns: Array; - testRegex: string | Array; - testResultsProcessor: string; - testRunner: string; - testSequencer: string; - testURL: string; - testTimeout: number; - timers: 'real' | 'fake'; - transform: { - [regex: string]: Path | TransformerConfig; - }; - transformIgnorePatterns: Array; - watchPathIgnorePatterns: Array; - unmockedModulePathPatterns: Array; - updateSnapshot: boolean; - useStderr: boolean; - verbose?: boolean; - watch: boolean; - watchAll: boolean; - watchman: boolean; - watchPlugins: Array]>; -}>; -export declare type SnapshotUpdateState = 'all' | 'new' | 'none'; -declare type NotifyMode = 'always' | 'failure' | 'success' | 'change' | 'success-change' | 'failure-change'; -export declare type CoverageThresholdValue = { - branches?: number; - functions?: number; - lines?: number; - statements?: number; -}; -declare type CoverageThreshold = { - [path: string]: CoverageThresholdValue; - global: CoverageThresholdValue; -}; -export declare type GlobalConfig = { - bail: number; - changedSince?: string; - changedFilesWithAncestor: boolean; - collectCoverage: boolean; - collectCoverageFrom: Array; - collectCoverageOnlyFrom?: { - [key: string]: boolean; - }; - coverageDirectory: string; - coveragePathIgnorePatterns?: Array; - coverageProvider: CoverageProvider; - coverageReporters: Array; - coverageThreshold?: CoverageThreshold; - detectLeaks: boolean; - detectOpenHandles: boolean; - enabledTestsMap?: { - [key: string]: { - [key: string]: boolean; - }; - }; - expand: boolean; - filter?: Path; - findRelatedTests: boolean; - forceExit: boolean; - json: boolean; - globalSetup?: string; - globalTeardown?: string; - lastCommit: boolean; - logHeapUsage: boolean; - listTests: boolean; - maxConcurrency: number; - maxWorkers: number; - noStackTrace: boolean; - nonFlagArgs: Array; - noSCM?: boolean; - notify: boolean; - notifyMode: NotifyMode; - outputFile?: Path; - onlyChanged: boolean; - onlyFailures: boolean; - passWithNoTests: boolean; - projects: Array; - replname?: string; - reporters?: Array; - runTestsByPath: boolean; - rootDir: Path; - silent?: boolean; - skipFilter: boolean; - errorOnDeprecated: boolean; - testFailureExitCode: number; - testNamePattern?: string; - testPathPattern: string; - testResultsProcessor?: string; - testSequencer: string; - testTimeout?: number; - updateSnapshot: SnapshotUpdateState; - useStderr: boolean; - verbose?: boolean; - watch: boolean; - watchAll: boolean; - watchman: boolean; - watchPlugins?: Array<{ - path: string; - config: Record; - }> | null; -}; -export declare type ProjectConfig = { - automock: boolean; - browser: boolean; - cache: boolean; - cacheDirectory: Path; - clearMocks: boolean; - coveragePathIgnorePatterns: Array; - cwd: Path; - dependencyExtractor?: string; - detectLeaks: boolean; - detectOpenHandles: boolean; - displayName?: DisplayName; - errorOnDeprecated: boolean; - extraGlobals: Array; - filter?: Path; - forceCoverageMatch: Array; - globalSetup?: string; - globalTeardown?: string; - globals: ConfigGlobals; - haste: HasteConfig; - moduleDirectories: Array; - moduleFileExtensions: Array; - moduleLoader?: Path; - moduleNameMapper: Array<[string, string]>; - modulePathIgnorePatterns: Array; - modulePaths?: Array; - name: string; - prettierPath: string; - resetMocks: boolean; - resetModules: boolean; - resolver?: Path; - restoreMocks: boolean; - rootDir: Path; - roots: Array; - runner: string; - setupFiles: Array; - setupFilesAfterEnv: Array; - skipFilter: boolean; - skipNodeResolution?: boolean; - snapshotResolver?: Path; - snapshotSerializers: Array; - testEnvironment: string; - testEnvironmentOptions: Record; - testMatch: Array; - testLocationInResults: boolean; - testPathIgnorePatterns: Array; - testRegex: Array; - testRunner: string; - testURL: string; - timers: 'real' | 'fake'; - transform: Array<[string, Path, Record]>; - transformIgnorePatterns: Array; - watchPathIgnorePatterns: Array; - unmockedModulePathPatterns?: Array; -}; -export declare type Argv = Arguments; - color: boolean; - colors: boolean; - config: string; - coverage: boolean; - coverageDirectory: string; - coveragePathIgnorePatterns: Array; - coverageReporters: Array; - coverageThreshold: string; - debug: boolean; - env: string; - expand: boolean; - findRelatedTests: boolean; - forceExit: boolean; - globals: string; - globalSetup: string | null | undefined; - globalTeardown: string | null | undefined; - haste: string; - init: boolean; - json: boolean; - lastCommit: boolean; - logHeapUsage: boolean; - maxWorkers: number | string; - moduleDirectories: Array; - moduleFileExtensions: Array; - moduleNameMapper: string; - modulePathIgnorePatterns: Array; - modulePaths: Array; - noStackTrace: boolean; - notify: boolean; - notifyMode: string; - onlyChanged: boolean; - outputFile: string; - preset: string | null | undefined; - projects: Array; - prettierPath: string | null | undefined; - resetMocks: boolean; - resetModules: boolean; - resolver: string | null | undefined; - restoreMocks: boolean; - rootDir: string; - roots: Array; - runInBand: boolean; - setupFiles: Array; - setupFilesAfterEnv: Array; - showConfig: boolean; - silent: boolean; - snapshotSerializers: Array; - testEnvironment: string; - testFailureExitCode: string | null | undefined; - testMatch: Array; - testNamePattern: string; - testPathIgnorePatterns: Array; - testPathPattern: Array; - testRegex: string | Array; - testResultsProcessor: string; - testRunner: string; - testSequencer: string; - testURL: string; - testTimeout: number | null | undefined; - timers: string; - transform: string; - transformIgnorePatterns: Array; - unmockedModulePathPatterns: Array | null | undefined; - updateSnapshot: boolean; - useStderr: boolean; - verbose: boolean; - version: boolean; - watch: boolean; - watchAll: boolean; - watchman: boolean; - watchPathIgnorePatterns: Array; -}>>; -export {}; +/// +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +/// +import { Arguments } from 'yargs'; +import { ReportOptions } from 'istanbul-reports'; +import chalk = require('chalk'); +declare type CoverageProvider = 'babel' | 'v8'; +export declare type Path = string; +export declare type Glob = string; +export declare type HasteConfig = { + computeSha1?: boolean; + defaultPlatform?: string | null; + hasteImplModulePath?: string; + platforms?: Array; + providesModuleNodeModules: Array; + throwOnModuleCollision?: boolean; +}; +export declare type ReporterConfig = [string, Record]; +export declare type TransformerConfig = [string, Record]; +export interface ConfigGlobals { + [K: string]: unknown; +} +export declare type DefaultOptions = { + automock: boolean; + bail: number; + browser: boolean; + cache: boolean; + cacheDirectory: Path; + changedFilesWithAncestor: boolean; + clearMocks: boolean; + collectCoverage: boolean; + coveragePathIgnorePatterns: Array; + coverageReporters: Array; + coverageProvider: CoverageProvider; + errorOnDeprecated: boolean; + expand: boolean; + forceCoverageMatch: Array; + globals: ConfigGlobals; + haste: HasteConfig; + maxConcurrency: number; + maxWorkers: number | string; + moduleDirectories: Array; + moduleFileExtensions: Array; + moduleNameMapper: Record>; + modulePathIgnorePatterns: Array; + noStackTrace: boolean; + notify: boolean; + notifyMode: NotifyMode; + prettierPath: string; + resetMocks: boolean; + resetModules: boolean; + restoreMocks: boolean; + roots: Array; + runTestsByPath: boolean; + runner: 'jest-runner'; + setupFiles: Array; + setupFilesAfterEnv: Array; + skipFilter: boolean; + snapshotSerializers: Array; + testEnvironment: string; + testEnvironmentOptions: Record; + testFailureExitCode: string | number; + testLocationInResults: boolean; + testMatch: Array; + testPathIgnorePatterns: Array; + testRegex: Array; + testRunner: string; + testSequencer: string; + testURL: string; + timers: 'real' | 'fake'; + transformIgnorePatterns: Array; + useStderr: boolean; + watch: boolean; + watchPathIgnorePatterns: Array; + watchman: boolean; +}; +export declare type DisplayName = string | { + name: string; + color: typeof chalk.Color; +}; +export declare type InitialOptionsWithRootDir = InitialOptions & Required>; +export declare type InitialOptions = Partial<{ + automock: boolean; + bail: boolean | number; + browser: boolean; + cache: boolean; + cacheDirectory: Path; + clearMocks: boolean; + changedFilesWithAncestor: boolean; + changedSince: string; + collectCoverage: boolean; + collectCoverageFrom: Array; + collectCoverageOnlyFrom: { + [key: string]: boolean; + }; + coverageDirectory: string; + coveragePathIgnorePatterns: Array; + coverageProvider: CoverageProvider; + coverageReporters: Array; + coverageThreshold: { + global: { + [key: string]: number; + }; + }; + dependencyExtractor: string; + detectLeaks: boolean; + detectOpenHandles: boolean; + displayName: DisplayName; + expand: boolean; + extraGlobals: Array; + filter: Path; + findRelatedTests: boolean; + forceCoverageMatch: Array; + forceExit: boolean; + json: boolean; + globals: ConfigGlobals; + globalSetup: string | null | undefined; + globalTeardown: string | null | undefined; + haste: HasteConfig; + reporters: Array; + logHeapUsage: boolean; + lastCommit: boolean; + listTests: boolean; + mapCoverage: boolean; + maxConcurrency: number; + maxWorkers: number | string; + moduleDirectories: Array; + moduleFileExtensions: Array; + moduleLoader: Path; + moduleNameMapper: { + [key: string]: string | Array; + }; + modulePathIgnorePatterns: Array; + modulePaths: Array; + name: string; + noStackTrace: boolean; + notify: boolean; + notifyMode: string; + onlyChanged: boolean; + outputFile: Path; + passWithNoTests: boolean; + preprocessorIgnorePatterns: Array; + preset: string | null | undefined; + prettierPath: string | null | undefined; + projects: Array; + replname: string | null | undefined; + resetMocks: boolean; + resetModules: boolean; + resolver: Path | null | undefined; + restoreMocks: boolean; + rootDir: Path; + roots: Array; + runner: string; + runTestsByPath: boolean; + scriptPreprocessor: string; + setupFiles: Array; + setupTestFrameworkScriptFile: Path; + setupFilesAfterEnv: Array; + silent: boolean; + skipFilter: boolean; + skipNodeResolution: boolean; + snapshotResolver: Path; + snapshotSerializers: Array; + errorOnDeprecated: boolean; + testEnvironment: string; + testEnvironmentOptions: Record; + testFailureExitCode: string | number; + testLocationInResults: boolean; + testMatch: Array; + testNamePattern: string; + testPathDirs: Array; + testPathIgnorePatterns: Array; + testRegex: string | Array; + testResultsProcessor: string; + testRunner: string; + testSequencer: string; + testURL: string; + testTimeout: number; + timers: 'real' | 'fake'; + transform: { + [regex: string]: Path | TransformerConfig; + }; + transformIgnorePatterns: Array; + watchPathIgnorePatterns: Array; + unmockedModulePathPatterns: Array; + updateSnapshot: boolean; + useStderr: boolean; + verbose?: boolean; + watch: boolean; + watchAll: boolean; + watchman: boolean; + watchPlugins: Array]>; +}>; +export declare type SnapshotUpdateState = 'all' | 'new' | 'none'; +declare type NotifyMode = 'always' | 'failure' | 'success' | 'change' | 'success-change' | 'failure-change'; +export declare type CoverageThresholdValue = { + branches?: number; + functions?: number; + lines?: number; + statements?: number; +}; +declare type CoverageThreshold = { + [path: string]: CoverageThresholdValue; + global: CoverageThresholdValue; +}; +export declare type GlobalConfig = { + bail: number; + changedSince?: string; + changedFilesWithAncestor: boolean; + collectCoverage: boolean; + collectCoverageFrom: Array; + collectCoverageOnlyFrom?: { + [key: string]: boolean; + }; + coverageDirectory: string; + coveragePathIgnorePatterns?: Array; + coverageProvider: CoverageProvider; + coverageReporters: Array; + coverageThreshold?: CoverageThreshold; + detectLeaks: boolean; + detectOpenHandles: boolean; + enabledTestsMap?: { + [key: string]: { + [key: string]: boolean; + }; + }; + expand: boolean; + filter?: Path; + findRelatedTests: boolean; + forceExit: boolean; + json: boolean; + globalSetup?: string; + globalTeardown?: string; + lastCommit: boolean; + logHeapUsage: boolean; + listTests: boolean; + maxConcurrency: number; + maxWorkers: number; + noStackTrace: boolean; + nonFlagArgs: Array; + noSCM?: boolean; + notify: boolean; + notifyMode: NotifyMode; + outputFile?: Path; + onlyChanged: boolean; + onlyFailures: boolean; + passWithNoTests: boolean; + projects: Array; + replname?: string; + reporters?: Array; + runTestsByPath: boolean; + rootDir: Path; + silent?: boolean; + skipFilter: boolean; + errorOnDeprecated: boolean; + testFailureExitCode: number; + testNamePattern?: string; + testPathPattern: string; + testResultsProcessor?: string; + testSequencer: string; + testTimeout?: number; + updateSnapshot: SnapshotUpdateState; + useStderr: boolean; + verbose?: boolean; + watch: boolean; + watchAll: boolean; + watchman: boolean; + watchPlugins?: Array<{ + path: string; + config: Record; + }> | null; +}; +export declare type ProjectConfig = { + automock: boolean; + browser: boolean; + cache: boolean; + cacheDirectory: Path; + clearMocks: boolean; + coveragePathIgnorePatterns: Array; + cwd: Path; + dependencyExtractor?: string; + detectLeaks: boolean; + detectOpenHandles: boolean; + displayName?: DisplayName; + errorOnDeprecated: boolean; + extraGlobals: Array; + filter?: Path; + forceCoverageMatch: Array; + globalSetup?: string; + globalTeardown?: string; + globals: ConfigGlobals; + haste: HasteConfig; + moduleDirectories: Array; + moduleFileExtensions: Array; + moduleLoader?: Path; + moduleNameMapper: Array<[string, string]>; + modulePathIgnorePatterns: Array; + modulePaths?: Array; + name: string; + prettierPath: string; + resetMocks: boolean; + resetModules: boolean; + resolver?: Path; + restoreMocks: boolean; + rootDir: Path; + roots: Array; + runner: string; + setupFiles: Array; + setupFilesAfterEnv: Array; + skipFilter: boolean; + skipNodeResolution?: boolean; + snapshotResolver?: Path; + snapshotSerializers: Array; + testEnvironment: string; + testEnvironmentOptions: Record; + testMatch: Array; + testLocationInResults: boolean; + testPathIgnorePatterns: Array; + testRegex: Array; + testRunner: string; + testURL: string; + timers: 'real' | 'fake'; + transform: Array<[string, Path, Record]>; + transformIgnorePatterns: Array; + watchPathIgnorePatterns: Array; + unmockedModulePathPatterns?: Array; +}; +export declare type Argv = Arguments; + color: boolean; + colors: boolean; + config: string; + coverage: boolean; + coverageDirectory: string; + coveragePathIgnorePatterns: Array; + coverageReporters: Array; + coverageThreshold: string; + debug: boolean; + env: string; + expand: boolean; + findRelatedTests: boolean; + forceExit: boolean; + globals: string; + globalSetup: string | null | undefined; + globalTeardown: string | null | undefined; + haste: string; + init: boolean; + json: boolean; + lastCommit: boolean; + logHeapUsage: boolean; + maxWorkers: number | string; + moduleDirectories: Array; + moduleFileExtensions: Array; + moduleNameMapper: string; + modulePathIgnorePatterns: Array; + modulePaths: Array; + noStackTrace: boolean; + notify: boolean; + notifyMode: string; + onlyChanged: boolean; + outputFile: string; + preset: string | null | undefined; + projects: Array; + prettierPath: string | null | undefined; + resetMocks: boolean; + resetModules: boolean; + resolver: string | null | undefined; + restoreMocks: boolean; + rootDir: string; + roots: Array; + runInBand: boolean; + setupFiles: Array; + setupFilesAfterEnv: Array; + showConfig: boolean; + silent: boolean; + snapshotSerializers: Array; + testEnvironment: string; + testFailureExitCode: string | null | undefined; + testMatch: Array; + testNamePattern: string; + testPathIgnorePatterns: Array; + testPathPattern: Array; + testRegex: string | Array; + testResultsProcessor: string; + testRunner: string; + testSequencer: string; + testURL: string; + testTimeout: number | null | undefined; + timers: string; + transform: string; + transformIgnorePatterns: Array; + unmockedModulePathPatterns: Array | null | undefined; + updateSnapshot: boolean; + useStderr: boolean; + verbose: boolean; + version: boolean; + watch: boolean; + watchAll: boolean; + watchman: boolean; + watchPathIgnorePatterns: Array; +}>>; +export {}; diff --git a/node_modules/@jest/types/build/ts3.4/Global.d.ts b/node_modules/@jest/types/build/ts3.4/Global.d.ts index 2edb937fa..51968140a 100644 --- a/node_modules/@jest/types/build/ts3.4/Global.d.ts +++ b/node_modules/@jest/types/build/ts3.4/Global.d.ts @@ -1,84 +1,84 @@ -/// -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -/// -import { CoverageMapData } from 'istanbul-lib-coverage'; -export declare type DoneFn = (reason?: string | Error) => void; -export declare type TestName = string; -export declare type TestFn = (done?: DoneFn) => Promise | void | undefined; -export declare type BlockFn = () => void; -export declare type BlockName = string; -export declare type HookFn = TestFn; -export declare type Col = unknown; -export declare type Row = Array; -export declare type Table = Array; -export declare type ArrayTable = Table | Row; -export declare type TemplateTable = TemplateStringsArray; -export declare type TemplateData = Array; -export declare type EachTable = ArrayTable | TemplateTable; -export declare type EachTestFn = (...args: Array) => Promise | void | undefined; -declare type Jasmine = { - _DEFAULT_TIMEOUT_INTERVAL?: number; - addMatchers: Function; -}; -declare type Each = (table: EachTable, ...taggedTemplateData: Array) => (title: string, test: EachTestFn, timeout?: number) => void; -export interface ItBase { - (testName: TestName, fn: TestFn, timeout?: number): void; - each: Each; -} -export interface It extends ItBase { - only: ItBase; - skip: ItBase; - todo: (testName: TestName, ...rest: Array) => void; -} -export interface ItConcurrentBase { - (testName: string, testFn: () => Promise, timeout?: number): void; -} -export interface ItConcurrentExtended extends ItConcurrentBase { - only: ItConcurrentBase; - skip: ItConcurrentBase; -} -export interface ItConcurrent extends It { - concurrent: ItConcurrentExtended; -} -export interface DescribeBase { - (blockName: BlockName, blockFn: BlockFn): void; - each: Each; -} -export interface Describe extends DescribeBase { - only: DescribeBase; - skip: DescribeBase; -} -export interface TestFrameworkGlobals { - it: ItConcurrent; - test: ItConcurrent; - fit: ItBase & { - concurrent?: ItConcurrentBase; - }; - xit: ItBase; - xtest: ItBase; - describe: Describe; - xdescribe: DescribeBase; - fdescribe: DescribeBase; - beforeAll: HookFn; - beforeEach: HookFn; - afterEach: HookFn; - afterAll: HookFn; -} -export interface GlobalAdditions extends TestFrameworkGlobals { - __coverage__: CoverageMapData; - jasmine: Jasmine; - fail: () => void; - pending: () => void; - spyOn: () => void; - spyOnProperty: () => void; -} -declare type NodeGlobalWithoutAdditions = Pick>; -export interface Global extends GlobalAdditions, NodeGlobalWithoutAdditions { - [extras: string]: any; -} -export {}; +/// +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +/// +import { CoverageMapData } from 'istanbul-lib-coverage'; +export declare type DoneFn = (reason?: string | Error) => void; +export declare type TestName = string; +export declare type TestFn = (done?: DoneFn) => Promise | void | undefined; +export declare type BlockFn = () => void; +export declare type BlockName = string; +export declare type HookFn = TestFn; +export declare type Col = unknown; +export declare type Row = Array; +export declare type Table = Array; +export declare type ArrayTable = Table | Row; +export declare type TemplateTable = TemplateStringsArray; +export declare type TemplateData = Array; +export declare type EachTable = ArrayTable | TemplateTable; +export declare type EachTestFn = (...args: Array) => Promise | void | undefined; +declare type Jasmine = { + _DEFAULT_TIMEOUT_INTERVAL?: number; + addMatchers: Function; +}; +declare type Each = (table: EachTable, ...taggedTemplateData: Array) => (title: string, test: EachTestFn, timeout?: number) => void; +export interface ItBase { + (testName: TestName, fn: TestFn, timeout?: number): void; + each: Each; +} +export interface It extends ItBase { + only: ItBase; + skip: ItBase; + todo: (testName: TestName, ...rest: Array) => void; +} +export interface ItConcurrentBase { + (testName: string, testFn: () => Promise, timeout?: number): void; +} +export interface ItConcurrentExtended extends ItConcurrentBase { + only: ItConcurrentBase; + skip: ItConcurrentBase; +} +export interface ItConcurrent extends It { + concurrent: ItConcurrentExtended; +} +export interface DescribeBase { + (blockName: BlockName, blockFn: BlockFn): void; + each: Each; +} +export interface Describe extends DescribeBase { + only: DescribeBase; + skip: DescribeBase; +} +export interface TestFrameworkGlobals { + it: ItConcurrent; + test: ItConcurrent; + fit: ItBase & { + concurrent?: ItConcurrentBase; + }; + xit: ItBase; + xtest: ItBase; + describe: Describe; + xdescribe: DescribeBase; + fdescribe: DescribeBase; + beforeAll: HookFn; + beforeEach: HookFn; + afterEach: HookFn; + afterAll: HookFn; +} +export interface GlobalAdditions extends TestFrameworkGlobals { + __coverage__: CoverageMapData; + jasmine: Jasmine; + fail: () => void; + pending: () => void; + spyOn: () => void; + spyOnProperty: () => void; +} +declare type NodeGlobalWithoutAdditions = Pick>; +export interface Global extends GlobalAdditions, NodeGlobalWithoutAdditions { + [extras: string]: any; +} +export {}; diff --git a/node_modules/@jest/types/build/ts3.4/TestResult.d.ts b/node_modules/@jest/types/build/ts3.4/TestResult.d.ts index 560216c9e..4c08812de 100644 --- a/node_modules/@jest/types/build/ts3.4/TestResult.d.ts +++ b/node_modules/@jest/types/build/ts3.4/TestResult.d.ts @@ -1,30 +1,30 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -export declare type Milliseconds = number; -declare type Status = 'passed' | 'failed' | 'skipped' | 'pending' | 'todo' | 'disabled'; -declare type Callsite = { - column: number; - line: number; -}; -export declare type AssertionResult = { - ancestorTitles: Array; - duration?: Milliseconds | null; - failureMessages: Array; - fullName: string; - invocations?: number; - location?: Callsite | null; - numPassingAsserts: number; - status: Status; - title: string; -}; -export declare type SerializableError = { - code?: unknown; - message: string; - stack: string | null | undefined; - type?: string; -}; -export {}; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +export declare type Milliseconds = number; +declare type Status = 'passed' | 'failed' | 'skipped' | 'pending' | 'todo' | 'disabled'; +declare type Callsite = { + column: number; + line: number; +}; +export declare type AssertionResult = { + ancestorTitles: Array; + duration?: Milliseconds | null; + failureMessages: Array; + fullName: string; + invocations?: number; + location?: Callsite | null; + numPassingAsserts: number; + status: Status; + title: string; +}; +export declare type SerializableError = { + code?: unknown; + message: string; + stack: string | null | undefined; + type?: string; +}; +export {}; diff --git a/node_modules/@jest/types/build/ts3.4/Transform.d.ts b/node_modules/@jest/types/build/ts3.4/Transform.d.ts index af8063f7d..231ae24ca 100644 --- a/node_modules/@jest/types/build/ts3.4/Transform.d.ts +++ b/node_modules/@jest/types/build/ts3.4/Transform.d.ts @@ -1,12 +1,12 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -export declare type TransformResult = { - code: string; - originalCode: string; - mapCoverage?: boolean; - sourceMapPath: string | null; -}; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +export declare type TransformResult = { + code: string; + originalCode: string; + mapCoverage?: boolean; + sourceMapPath: string | null; +}; diff --git a/node_modules/@jest/types/build/ts3.4/index.d.ts b/node_modules/@jest/types/build/ts3.4/index.d.ts index 79ecb3a0b..28add33e4 100644 --- a/node_modules/@jest/types/build/ts3.4/index.d.ts +++ b/node_modules/@jest/types/build/ts3.4/index.d.ts @@ -1,12 +1,12 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import * as Circus from './Circus'; -import * as Config from './Config'; -import * as Global from './Global'; -import * as TestResult from './TestResult'; -import * as TransformTypes from './Transform'; -export { Circus, Config, Global, TestResult, TransformTypes }; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import * as Circus from './Circus'; +import * as Config from './Config'; +import * as Global from './Global'; +import * as TestResult from './TestResult'; +import * as TransformTypes from './Transform'; +export { Circus, Config, Global, TestResult, TransformTypes }; diff --git a/node_modules/@types/babel__core/README.md b/node_modules/@types/babel__core/README.md index 2bdd9bc0c..7657bbef4 100644 --- a/node_modules/@types/babel__core/README.md +++ b/node_modules/@types/babel__core/README.md @@ -1,16 +1,16 @@ -# Installation -> `npm install --save @types/babel__core` - -# Summary -This package contains type definitions for @babel/core (https://github.com/babel/babel/tree/master/packages/babel-core). - -# Details -Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/babel__core. - -### Additional Details - * Last updated: Thu, 24 Sep 2020 20:48:09 GMT - * Dependencies: [@types/babel__generator](https://npmjs.com/package/@types/babel__generator), [@types/babel__traverse](https://npmjs.com/package/@types/babel__traverse), [@types/babel__template](https://npmjs.com/package/@types/babel__template), [@types/babel__types](https://npmjs.com/package/@types/babel__types), [@types/babel__parser](https://npmjs.com/package/@types/babel__parser) - * Global values: `babel` - -# Credits -These definitions were written by [Troy Gerwien](https://github.com/yortus), [Marvin Hagemeister](https://github.com/marvinhagemeister), [Melvin Groenhoff](https://github.com/mgroenhoff), [Jessica Franco](https://github.com/Jessidhia), and [Ifiok Jr.](https://github.com/ifiokjr). +# Installation +> `npm install --save @types/babel__core` + +# Summary +This package contains type definitions for @babel/core (https://github.com/babel/babel/tree/master/packages/babel-core). + +# Details +Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/babel__core. + +### Additional Details + * Last updated: Thu, 24 Sep 2020 20:48:09 GMT + * Dependencies: [@types/babel__generator](https://npmjs.com/package/@types/babel__generator), [@types/babel__traverse](https://npmjs.com/package/@types/babel__traverse), [@types/babel__template](https://npmjs.com/package/@types/babel__template), [@types/babel__types](https://npmjs.com/package/@types/babel__types), [@types/babel__parser](https://npmjs.com/package/@types/babel__parser) + * Global values: `babel` + +# Credits +These definitions were written by [Troy Gerwien](https://github.com/yortus), [Marvin Hagemeister](https://github.com/marvinhagemeister), [Melvin Groenhoff](https://github.com/mgroenhoff), [Jessica Franco](https://github.com/Jessidhia), and [Ifiok Jr.](https://github.com/ifiokjr). diff --git a/node_modules/@types/babel__generator/README.md b/node_modules/@types/babel__generator/README.md index afc8829e8..9bd17aea3 100644 --- a/node_modules/@types/babel__generator/README.md +++ b/node_modules/@types/babel__generator/README.md @@ -1,16 +1,16 @@ -# Installation -> `npm install --save @types/babel__generator` - -# Summary -This package contains type definitions for @babel/generator (https://github.com/babel/babel/tree/master/packages/babel-generator). - -# Details -Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/babel__generator. - -### Additional Details - * Last updated: Fri, 25 Sep 2020 23:55:29 GMT - * Dependencies: [@types/babel__types](https://npmjs.com/package/@types/babel__types) - * Global values: none - -# Credits -These definitions were written by [Troy Gerwien](https://github.com/yortus), [Johnny Estilles](https://github.com/johnnyestilles), [Melvin Groenhoff](https://github.com/mgroenhoff), [Cameron Yan](https://github.com/khell), and [Lyanbin](https://github.com/Lyanbin). +# Installation +> `npm install --save @types/babel__generator` + +# Summary +This package contains type definitions for @babel/generator (https://github.com/babel/babel/tree/master/packages/babel-generator). + +# Details +Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/babel__generator. + +### Additional Details + * Last updated: Fri, 25 Sep 2020 23:55:29 GMT + * Dependencies: [@types/babel__types](https://npmjs.com/package/@types/babel__types) + * Global values: none + +# Credits +These definitions were written by [Troy Gerwien](https://github.com/yortus), [Johnny Estilles](https://github.com/johnnyestilles), [Melvin Groenhoff](https://github.com/mgroenhoff), [Cameron Yan](https://github.com/khell), and [Lyanbin](https://github.com/Lyanbin). diff --git a/node_modules/@types/babel__template/README.md b/node_modules/@types/babel__template/README.md index 26cb09677..f4c95a67c 100644 --- a/node_modules/@types/babel__template/README.md +++ b/node_modules/@types/babel__template/README.md @@ -1,16 +1,16 @@ -# Installation -> `npm install --save @types/babel__template` - -# Summary -This package contains type definitions for @babel/template (https://github.com/babel/babel/tree/master/packages/babel-template). - -# Details -Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/babel__template. - -### Additional Details - * Last updated: Thu, 24 Sep 2020 20:48:09 GMT - * Dependencies: [@types/babel__parser](https://npmjs.com/package/@types/babel__parser), [@types/babel__types](https://npmjs.com/package/@types/babel__types) - * Global values: none - -# Credits -These definitions were written by [Troy Gerwien](https://github.com/yortus), [Marvin Hagemeister](https://github.com/marvinhagemeister), and [Melvin Groenhoff](https://github.com/mgroenhoff). +# Installation +> `npm install --save @types/babel__template` + +# Summary +This package contains type definitions for @babel/template (https://github.com/babel/babel/tree/master/packages/babel-template). + +# Details +Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/babel__template. + +### Additional Details + * Last updated: Thu, 24 Sep 2020 20:48:09 GMT + * Dependencies: [@types/babel__parser](https://npmjs.com/package/@types/babel__parser), [@types/babel__types](https://npmjs.com/package/@types/babel__types) + * Global values: none + +# Credits +These definitions were written by [Troy Gerwien](https://github.com/yortus), [Marvin Hagemeister](https://github.com/marvinhagemeister), and [Melvin Groenhoff](https://github.com/mgroenhoff). diff --git a/node_modules/@types/babel__traverse/README.md b/node_modules/@types/babel__traverse/README.md index 70328a035..ddd8134b8 100644 --- a/node_modules/@types/babel__traverse/README.md +++ b/node_modules/@types/babel__traverse/README.md @@ -1,16 +1,16 @@ -# Installation -> `npm install --save @types/babel__traverse` - -# Summary -This package contains type definitions for @babel/traverse (https://github.com/babel/babel/tree/main/packages/babel-traverse). - -# Details -Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/babel__traverse. - -### Additional Details - * Last updated: Fri, 25 Sep 2020 23:55:30 GMT - * Dependencies: [@types/babel__types](https://npmjs.com/package/@types/babel__types) - * Global values: none - -# Credits -These definitions were written by [Troy Gerwien](https://github.com/yortus), [Marvin Hagemeister](https://github.com/marvinhagemeister), [Ryan Petrich](https://github.com/rpetrich), [Melvin Groenhoff](https://github.com/mgroenhoff), [Dean L.](https://github.com/dlgrit), [Ifiok Jr.](https://github.com/ifiokjr), and [ExE Boss](https://github.com/ExE-Boss). +# Installation +> `npm install --save @types/babel__traverse` + +# Summary +This package contains type definitions for @babel/traverse (https://github.com/babel/babel/tree/main/packages/babel-traverse). + +# Details +Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/babel__traverse. + +### Additional Details + * Last updated: Fri, 25 Sep 2020 23:55:30 GMT + * Dependencies: [@types/babel__types](https://npmjs.com/package/@types/babel__types) + * Global values: none + +# Credits +These definitions were written by [Troy Gerwien](https://github.com/yortus), [Marvin Hagemeister](https://github.com/marvinhagemeister), [Ryan Petrich](https://github.com/rpetrich), [Melvin Groenhoff](https://github.com/mgroenhoff), [Dean L.](https://github.com/dlgrit), [Ifiok Jr.](https://github.com/ifiokjr), and [ExE Boss](https://github.com/ExE-Boss). diff --git a/node_modules/@types/color-name/LICENSE b/node_modules/@types/color-name/LICENSE index 21071075c..4b1ad51b2 100644 --- a/node_modules/@types/color-name/LICENSE +++ b/node_modules/@types/color-name/LICENSE @@ -1,21 +1,21 @@ - MIT License - - Copyright (c) Microsoft Corporation. All rights reserved. - - 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 + MIT License + + Copyright (c) Microsoft Corporation. All rights reserved. + + 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/node_modules/@types/color-name/README.md b/node_modules/@types/color-name/README.md index d08d108b2..5c77cba82 100644 --- a/node_modules/@types/color-name/README.md +++ b/node_modules/@types/color-name/README.md @@ -1,16 +1,16 @@ -# Installation -> `npm install --save @types/color-name` - -# Summary -This package contains type definitions for color-name ( https://github.com/colorjs/color-name ). - -# Details -Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/color-name - -Additional Details - * Last updated: Wed, 13 Feb 2019 16:16:48 GMT - * Dependencies: none - * Global values: none - -# Credits -These definitions were written by Junyoung Clare Jang . +# Installation +> `npm install --save @types/color-name` + +# Summary +This package contains type definitions for color-name ( https://github.com/colorjs/color-name ). + +# Details +Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/color-name + +Additional Details + * Last updated: Wed, 13 Feb 2019 16:16:48 GMT + * Dependencies: none + * Global values: none + +# Credits +These definitions were written by Junyoung Clare Jang . diff --git a/node_modules/@types/graceful-fs/LICENSE b/node_modules/@types/graceful-fs/LICENSE index 21071075c..4b1ad51b2 100644 --- a/node_modules/@types/graceful-fs/LICENSE +++ b/node_modules/@types/graceful-fs/LICENSE @@ -1,21 +1,21 @@ - MIT License - - Copyright (c) Microsoft Corporation. All rights reserved. - - 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 + MIT License + + Copyright (c) Microsoft Corporation. All rights reserved. + + 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/node_modules/@types/graceful-fs/README.md b/node_modules/@types/graceful-fs/README.md index d95b837b3..754295daa 100644 --- a/node_modules/@types/graceful-fs/README.md +++ b/node_modules/@types/graceful-fs/README.md @@ -1,16 +1,16 @@ -# Installation -> `npm install --save @types/graceful-fs` - -# Summary -This package contains type definitions for graceful-fs ( https://github.com/isaacs/node-graceful-fs ). - -# Details -Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/graceful-fs - -Additional Details - * Last updated: Wed, 13 Feb 2019 18:42:10 GMT - * Dependencies: @types/node - * Global values: none - -# Credits -These definitions were written by Bart van der Schoor , BendingBender . +# Installation +> `npm install --save @types/graceful-fs` + +# Summary +This package contains type definitions for graceful-fs ( https://github.com/isaacs/node-graceful-fs ). + +# Details +Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/graceful-fs + +Additional Details + * Last updated: Wed, 13 Feb 2019 18:42:10 GMT + * Dependencies: @types/node + * Global values: none + +# Credits +These definitions were written by Bart van der Schoor , BendingBender . diff --git a/node_modules/@types/istanbul-lib-coverage/README.md b/node_modules/@types/istanbul-lib-coverage/README.md index 68efedb13..3bacfb44f 100644 --- a/node_modules/@types/istanbul-lib-coverage/README.md +++ b/node_modules/@types/istanbul-lib-coverage/README.md @@ -1,16 +1,16 @@ -# Installation -> `npm install --save @types/istanbul-lib-coverage` - -# Summary -This package contains type definitions for istanbul-lib-coverage (https://istanbul.js.org). - -# Details -Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/istanbul-lib-coverage. - -### Additional Details - * Last updated: Tue, 09 Jun 2020 16:25:43 GMT - * Dependencies: none - * Global values: none - -# Credits -These definitions were written by [Jason Cheatham](https://github.com/jason0x43), and [Lorenzo Rapetti](https://github.com/loryman). +# Installation +> `npm install --save @types/istanbul-lib-coverage` + +# Summary +This package contains type definitions for istanbul-lib-coverage (https://istanbul.js.org). + +# Details +Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/istanbul-lib-coverage. + +### Additional Details + * Last updated: Tue, 09 Jun 2020 16:25:43 GMT + * Dependencies: none + * Global values: none + +# Credits +These definitions were written by [Jason Cheatham](https://github.com/jason0x43), and [Lorenzo Rapetti](https://github.com/loryman). diff --git a/node_modules/@types/istanbul-lib-report/LICENSE b/node_modules/@types/istanbul-lib-report/LICENSE index 21071075c..4b1ad51b2 100644 --- a/node_modules/@types/istanbul-lib-report/LICENSE +++ b/node_modules/@types/istanbul-lib-report/LICENSE @@ -1,21 +1,21 @@ - MIT License - - Copyright (c) Microsoft Corporation. All rights reserved. - - 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 + MIT License + + Copyright (c) Microsoft Corporation. All rights reserved. + + 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/node_modules/@types/istanbul-lib-report/README.md b/node_modules/@types/istanbul-lib-report/README.md index 5f1ac1cae..c8fb44c53 100644 --- a/node_modules/@types/istanbul-lib-report/README.md +++ b/node_modules/@types/istanbul-lib-report/README.md @@ -1,16 +1,16 @@ -# Installation -> `npm install --save @types/istanbul-lib-report` - -# Summary -This package contains type definitions for istanbul-lib-report (https://istanbul.js.org). - -# Details -Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/istanbul-lib-report. - -### Additional Details - * Last updated: Tue, 21 Jan 2020 01:00:06 GMT - * Dependencies: [@types/istanbul-lib-coverage](https://npmjs.com/package/@types/istanbul-lib-coverage) - * Global values: none - -# Credits -These definitions were written by Jason Cheatham (https://github.com/jason0x43), and Zacharias Björngren (https://github.com/zache). +# Installation +> `npm install --save @types/istanbul-lib-report` + +# Summary +This package contains type definitions for istanbul-lib-report (https://istanbul.js.org). + +# Details +Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/istanbul-lib-report. + +### Additional Details + * Last updated: Tue, 21 Jan 2020 01:00:06 GMT + * Dependencies: [@types/istanbul-lib-coverage](https://npmjs.com/package/@types/istanbul-lib-coverage) + * Global values: none + +# Credits +These definitions were written by Jason Cheatham (https://github.com/jason0x43), and Zacharias Björngren (https://github.com/zache). diff --git a/node_modules/@types/istanbul-reports/README.md b/node_modules/@types/istanbul-reports/README.md index 6a43ff412..a560f5a2e 100644 --- a/node_modules/@types/istanbul-reports/README.md +++ b/node_modules/@types/istanbul-reports/README.md @@ -1,16 +1,16 @@ -# Installation -> `npm install --save @types/istanbul-reports` - -# Summary -This package contains type definitions for istanbul-reports (https://github.com/istanbuljs/istanbuljs). - -# Details -Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/istanbul-reports. - -### Additional Details - * Last updated: Fri, 15 May 2020 04:09:43 GMT - * Dependencies: [@types/istanbul-lib-report](https://npmjs.com/package/@types/istanbul-lib-report), [@types/istanbul-lib-coverage](https://npmjs.com/package/@types/istanbul-lib-coverage) - * Global values: none - -# Credits -These definitions were written by [Jason Cheatham](https://github.com/jason0x43). +# Installation +> `npm install --save @types/istanbul-reports` + +# Summary +This package contains type definitions for istanbul-reports (https://github.com/istanbuljs/istanbuljs). + +# Details +Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/istanbul-reports. + +### Additional Details + * Last updated: Fri, 15 May 2020 04:09:43 GMT + * Dependencies: [@types/istanbul-lib-report](https://npmjs.com/package/@types/istanbul-lib-report), [@types/istanbul-lib-coverage](https://npmjs.com/package/@types/istanbul-lib-coverage) + * Global values: none + +# Credits +These definitions were written by [Jason Cheatham](https://github.com/jason0x43). diff --git a/node_modules/@types/jest/README.md b/node_modules/@types/jest/README.md index 57e9d2e43..838b71940 100644 --- a/node_modules/@types/jest/README.md +++ b/node_modules/@types/jest/README.md @@ -1,17 +1,17 @@ -# Installation -> `npm install --save @types/jest` - -# Summary -This package contains type definitions for Jest (https://jestjs.io/). - -# Details -Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/jest. - -### Additional Details - * Last updated: Mon, 18 May 2020 19:24:51 GMT - * Dependencies: none - * Global values: `afterAll`, `afterEach`, `beforeAll`, `beforeEach`, `describe`, `expect`, `fail`, `fdescribe`, `fit`, `it`, `jasmine`, `jest`, `pending`, `spyOn`, `test`, `xdescribe`, `xit`, `xtest` - -# Credits +# Installation +> `npm install --save @types/jest` + +# Summary +This package contains type definitions for Jest (https://jestjs.io/). + +# Details +Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/jest. + +### Additional Details + * Last updated: Mon, 18 May 2020 19:24:51 GMT + * Dependencies: none + * Global values: `afterAll`, `afterEach`, `beforeAll`, `beforeEach`, `describe`, `expect`, `fail`, `fdescribe`, `fit`, `it`, `jasmine`, `jest`, `pending`, `spyOn`, `test`, `xdescribe`, `xit`, `xtest` + +# Credits These definitions were written by [Asana (https://asana.com) -// Ivo Stratev](https://github.com/NoHomey), [jwbay](https://github.com/jwbay), [Alexey Svetliakov](https://github.com/asvetliakov), [Alex Jover Morales](https://github.com/alexjoverm), [Allan Lukwago](https://github.com/epicallan), [Ika](https://github.com/ikatyang), [Waseem Dahman](https://github.com/wsmd), [Jamie Mason](https://github.com/JamieMason), [Douglas Duteil](https://github.com/douglasduteil), [Ahn](https://github.com/ahnpnl), [Josh Goldberg](https://github.com/joshuakgoldberg), [Jeff Lau](https://github.com/UselessPickles), [Andrew Makarov](https://github.com/r3nya), [Martin Hochel](https://github.com/hotell), [Sebastian Sebald](https://github.com/sebald), [Andy](https://github.com/andys8), [Antoine Brault](https://github.com/antoinebrault), [Jeroen Claassens](https://github.com/favna), [Gregor Stamać](https://github.com/gstamac), [ExE Boss](https://github.com/ExE-Boss), [Alex Bolenok](https://github.com/quassnoi), [Mario Beltrán Alarcón](https://github.com/Belco90), [Tony Hallett](https://github.com/tonyhallett), [Jason Yu](https://github.com/ycmjason), [Devansh Jethmalani](https://github.com/devanshj), [Pawel Fajfer](https://github.com/pawfa), and [Regev Brody](https://github.com/regevbr). +// Ivo Stratev](https://github.com/NoHomey), [jwbay](https://github.com/jwbay), [Alexey Svetliakov](https://github.com/asvetliakov), [Alex Jover Morales](https://github.com/alexjoverm), [Allan Lukwago](https://github.com/epicallan), [Ika](https://github.com/ikatyang), [Waseem Dahman](https://github.com/wsmd), [Jamie Mason](https://github.com/JamieMason), [Douglas Duteil](https://github.com/douglasduteil), [Ahn](https://github.com/ahnpnl), [Josh Goldberg](https://github.com/joshuakgoldberg), [Jeff Lau](https://github.com/UselessPickles), [Andrew Makarov](https://github.com/r3nya), [Martin Hochel](https://github.com/hotell), [Sebastian Sebald](https://github.com/sebald), [Andy](https://github.com/andys8), [Antoine Brault](https://github.com/antoinebrault), [Jeroen Claassens](https://github.com/favna), [Gregor Stamać](https://github.com/gstamac), [ExE Boss](https://github.com/ExE-Boss), [Alex Bolenok](https://github.com/quassnoi), [Mario Beltrán Alarcón](https://github.com/Belco90), [Tony Hallett](https://github.com/tonyhallett), [Jason Yu](https://github.com/ycmjason), [Devansh Jethmalani](https://github.com/devanshj), [Pawel Fajfer](https://github.com/pawfa), and [Regev Brody](https://github.com/regevbr). diff --git a/node_modules/@types/node/LICENSE b/node_modules/@types/node/LICENSE index 21071075c..4b1ad51b2 100644 --- a/node_modules/@types/node/LICENSE +++ b/node_modules/@types/node/LICENSE @@ -1,21 +1,21 @@ - MIT License - - Copyright (c) Microsoft Corporation. All rights reserved. - - 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 + MIT License + + Copyright (c) Microsoft Corporation. All rights reserved. + + 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/node_modules/@types/node/README.md b/node_modules/@types/node/README.md index 82a183cc6..ebde7a93a 100644 --- a/node_modules/@types/node/README.md +++ b/node_modules/@types/node/README.md @@ -1,16 +1,16 @@ -# Installation -> `npm install --save @types/node` - -# Summary -This package contains type definitions for Node.js (http://nodejs.org/). - -# Details -Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node. - -### Additional Details - * Last updated: Fri, 17 Jan 2020 18:31:08 GMT - * Dependencies: none - * Global values: `Buffer`, `Symbol`, `__dirname`, `__filename`, `clearImmediate`, `clearInterval`, `clearTimeout`, `console`, `exports`, `global`, `module`, `process`, `queueMicrotask`, `require`, `setImmediate`, `setInterval`, `setTimeout` - -# Credits -These definitions were written by Microsoft TypeScript (https://github.com/Microsoft), DefinitelyTyped (https://github.com/DefinitelyTyped), Alberto Schiabel (https://github.com/jkomyno), Alexander T. (https://github.com/a-tarasyuk), Alvis HT Tang (https://github.com/alvis), Andrew Makarov (https://github.com/r3nya), Benjamin Toueg (https://github.com/btoueg), Bruno Scheufler (https://github.com/brunoscheufler), Chigozirim C. (https://github.com/smac89), Christian Vaagland Tellnes (https://github.com/tellnes), David Junger (https://github.com/touffy), Deividas Bakanas (https://github.com/DeividasBakanas), Eugene Y. Q. Shen (https://github.com/eyqs), Flarna (https://github.com/Flarna), Hannes Magnusson (https://github.com/Hannes-Magnusson-CK), Hoàng Văn Khải (https://github.com/KSXGitHub), Huw (https://github.com/hoo29), Kelvin Jin (https://github.com/kjin), Klaus Meinhardt (https://github.com/ajafff), Lishude (https://github.com/islishude), Mariusz Wiktorczyk (https://github.com/mwiktorczyk), Mohsen Azimi (https://github.com/mohsen1), Nicolas Even (https://github.com/n-e), Nicolas Voigt (https://github.com/octo-sniffle), Nikita Galkin (https://github.com/galkin), Parambir Singh (https://github.com/parambirs), Sebastian Silbermann (https://github.com/eps1lon), Simon Schick (https://github.com/SimonSchick), Thomas den Hollander (https://github.com/ThomasdenH), Wilco Bakker (https://github.com/WilcoBakker), wwwy3y3 (https://github.com/wwwy3y3), Zane Hannan AU (https://github.com/ZaneHannanAU), Samuel Ainsworth (https://github.com/samuela), Kyle Uehlein (https://github.com/kuehlein), Jordi Oliveras Rovira (https://github.com/j-oliveras), Thanik Bhongbhibhat (https://github.com/bhongy), Marcin Kopacz (https://github.com/chyzwar), Trivikram Kamat (https://github.com/trivikr), Minh Son Nguyen (https://github.com/nguymin4), Junxiao Shi (https://github.com/yoursunny), and Ilia Baryshnikov (https://github.com/qwelias). +# Installation +> `npm install --save @types/node` + +# Summary +This package contains type definitions for Node.js (http://nodejs.org/). + +# Details +Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node. + +### Additional Details + * Last updated: Fri, 17 Jan 2020 18:31:08 GMT + * Dependencies: none + * Global values: `Buffer`, `Symbol`, `__dirname`, `__filename`, `clearImmediate`, `clearInterval`, `clearTimeout`, `console`, `exports`, `global`, `module`, `process`, `queueMicrotask`, `require`, `setImmediate`, `setInterval`, `setTimeout` + +# Credits +These definitions were written by Microsoft TypeScript (https://github.com/Microsoft), DefinitelyTyped (https://github.com/DefinitelyTyped), Alberto Schiabel (https://github.com/jkomyno), Alexander T. (https://github.com/a-tarasyuk), Alvis HT Tang (https://github.com/alvis), Andrew Makarov (https://github.com/r3nya), Benjamin Toueg (https://github.com/btoueg), Bruno Scheufler (https://github.com/brunoscheufler), Chigozirim C. (https://github.com/smac89), Christian Vaagland Tellnes (https://github.com/tellnes), David Junger (https://github.com/touffy), Deividas Bakanas (https://github.com/DeividasBakanas), Eugene Y. Q. Shen (https://github.com/eyqs), Flarna (https://github.com/Flarna), Hannes Magnusson (https://github.com/Hannes-Magnusson-CK), Hoàng Văn Khải (https://github.com/KSXGitHub), Huw (https://github.com/hoo29), Kelvin Jin (https://github.com/kjin), Klaus Meinhardt (https://github.com/ajafff), Lishude (https://github.com/islishude), Mariusz Wiktorczyk (https://github.com/mwiktorczyk), Mohsen Azimi (https://github.com/mohsen1), Nicolas Even (https://github.com/n-e), Nicolas Voigt (https://github.com/octo-sniffle), Nikita Galkin (https://github.com/galkin), Parambir Singh (https://github.com/parambirs), Sebastian Silbermann (https://github.com/eps1lon), Simon Schick (https://github.com/SimonSchick), Thomas den Hollander (https://github.com/ThomasdenH), Wilco Bakker (https://github.com/WilcoBakker), wwwy3y3 (https://github.com/wwwy3y3), Zane Hannan AU (https://github.com/ZaneHannanAU), Samuel Ainsworth (https://github.com/samuela), Kyle Uehlein (https://github.com/kuehlein), Jordi Oliveras Rovira (https://github.com/j-oliveras), Thanik Bhongbhibhat (https://github.com/bhongy), Marcin Kopacz (https://github.com/chyzwar), Trivikram Kamat (https://github.com/trivikr), Minh Son Nguyen (https://github.com/nguymin4), Junxiao Shi (https://github.com/yoursunny), and Ilia Baryshnikov (https://github.com/qwelias). diff --git a/node_modules/@types/node/package.json b/node_modules/@types/node/package.json index d86ae90d7..240338a5f 100644 --- a/node_modules/@types/node/package.json +++ b/node_modules/@types/node/package.json @@ -228,8 +228,4 @@ "dependencies": {}, "typesPublisherContentHash": "0badd9e8c83ca280ae46f1520423742e02143c5a86c6b97568ebe3cecbf37efe", "typeScriptVersion": "2.8" - -,"_resolved": "https://registry.npmjs.org/@types/node/-/node-13.1.8.tgz" -,"_integrity": "sha512-6XzyyNM9EKQW4HKuzbo/CkOIjn/evtCmsU+MUM1xDfJ+3/rNjBttM1NgN7AOQvN6tP1Sl1D1PIKMreTArnxM9A==" -,"_from": "@types/node@13.1.8" } \ No newline at end of file diff --git a/node_modules/@types/normalize-package-data/LICENSE b/node_modules/@types/normalize-package-data/LICENSE old mode 100644 new mode 100755 diff --git a/node_modules/@types/normalize-package-data/README.md b/node_modules/@types/normalize-package-data/README.md old mode 100644 new mode 100755 index 781a75dc7..e24ae276d --- a/node_modules/@types/normalize-package-data/README.md +++ b/node_modules/@types/normalize-package-data/README.md @@ -1,16 +1,16 @@ -# Installation -> `npm install --save @types/normalize-package-data` - -# Summary -This package contains type definitions for normalize-package-data (https://github.com/npm/normalize-package-data#readme). - -# Details -Files were exported from https://www.github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/normalize-package-data - -Additional Details - * Last updated: Sun, 07 Jan 2018 07:34:38 GMT - * Dependencies: none - * Global values: none - -# Credits -These definitions were written by Jeff Dickey . +# Installation +> `npm install --save @types/normalize-package-data` + +# Summary +This package contains type definitions for normalize-package-data (https://github.com/npm/normalize-package-data#readme). + +# Details +Files were exported from https://www.github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/normalize-package-data + +Additional Details + * Last updated: Sun, 07 Jan 2018 07:34:38 GMT + * Dependencies: none + * Global values: none + +# Credits +These definitions were written by Jeff Dickey . diff --git a/node_modules/@types/normalize-package-data/index.d.ts b/node_modules/@types/normalize-package-data/index.d.ts old mode 100644 new mode 100755 diff --git a/node_modules/@types/normalize-package-data/package.json b/node_modules/@types/normalize-package-data/package.json old mode 100644 new mode 100755 diff --git a/node_modules/@types/prettier/LICENSE b/node_modules/@types/prettier/LICENSE index 21071075c..4b1ad51b2 100644 --- a/node_modules/@types/prettier/LICENSE +++ b/node_modules/@types/prettier/LICENSE @@ -1,21 +1,21 @@ - MIT License - - Copyright (c) Microsoft Corporation. All rights reserved. - - 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 + MIT License + + Copyright (c) Microsoft Corporation. All rights reserved. + + 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/node_modules/@types/prettier/README.md b/node_modules/@types/prettier/README.md index 85bd3d250..a8136e585 100644 --- a/node_modules/@types/prettier/README.md +++ b/node_modules/@types/prettier/README.md @@ -1,16 +1,16 @@ -# Installation -> `npm install --save @types/prettier` - -# Summary -This package contains type definitions for prettier (https://github.com/prettier/prettier). - -# Details -Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/prettier. - -### Additional Details - * Last updated: Sun, 22 Mar 2020 21:07:03 GMT - * Dependencies: none - * Global values: `prettier` - -# Credits -These definitions were written by [Ika](https://github.com/ikatyang), [Ifiok Jr.](https://github.com/ifiokjr), [Florian Keller](https://github.com/ffflorian), and [Sosuke Suzuki](https://github.com/sosukesuzuki). +# Installation +> `npm install --save @types/prettier` + +# Summary +This package contains type definitions for prettier (https://github.com/prettier/prettier). + +# Details +Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/prettier. + +### Additional Details + * Last updated: Sun, 22 Mar 2020 21:07:03 GMT + * Dependencies: none + * Global values: `prettier` + +# Credits +These definitions were written by [Ika](https://github.com/ikatyang), [Ifiok Jr.](https://github.com/ifiokjr), [Florian Keller](https://github.com/ffflorian), and [Sosuke Suzuki](https://github.com/sosukesuzuki). diff --git a/node_modules/@types/stack-utils/LICENSE b/node_modules/@types/stack-utils/LICENSE index 21071075c..4b1ad51b2 100644 --- a/node_modules/@types/stack-utils/LICENSE +++ b/node_modules/@types/stack-utils/LICENSE @@ -1,21 +1,21 @@ - MIT License - - Copyright (c) Microsoft Corporation. All rights reserved. - - 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 + MIT License + + Copyright (c) Microsoft Corporation. All rights reserved. + + 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/node_modules/@types/stack-utils/README.md b/node_modules/@types/stack-utils/README.md index b6905468d..5d1fdb458 100644 --- a/node_modules/@types/stack-utils/README.md +++ b/node_modules/@types/stack-utils/README.md @@ -1,16 +1,16 @@ -# Installation -> `npm install --save @types/stack-utils` - -# Summary -This package contains type definitions for stack-utils (https://github.com/tapjs/stack-utils#readme). - -# Details -Files were exported from https://www.github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/stack-utils - -Additional Details - * Last updated: Tue, 07 Nov 2017 17:49:01 GMT - * Dependencies: none - * Global values: none - -# Credits -These definitions were written by BendingBender . +# Installation +> `npm install --save @types/stack-utils` + +# Summary +This package contains type definitions for stack-utils (https://github.com/tapjs/stack-utils#readme). + +# Details +Files were exported from https://www.github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/stack-utils + +Additional Details + * Last updated: Tue, 07 Nov 2017 17:49:01 GMT + * Dependencies: none + * Global values: none + +# Credits +These definitions were written by BendingBender . diff --git a/node_modules/@types/stack-utils/index.d.ts b/node_modules/@types/stack-utils/index.d.ts index f29a42298..a2e890b30 100644 --- a/node_modules/@types/stack-utils/index.d.ts +++ b/node_modules/@types/stack-utils/index.d.ts @@ -1,64 +1,64 @@ -// Type definitions for stack-utils 1.0 -// Project: https://github.com/tapjs/stack-utils#readme -// Definitions by: BendingBender -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.2 - -export = StackUtils; - -declare class StackUtils { - static nodeInternals(): RegExp[]; - constructor(options?: StackUtils.Options); - clean(stack: string | string[]): string; - capture(limit?: number, startStackFunction?: Function): StackUtils.CallSite[]; - capture(startStackFunction: Function): StackUtils.CallSite[]; - captureString(limit?: number, startStackFunction?: Function): string; - captureString(startStackFunction: Function): string; - at(startStackFunction?: Function): StackUtils.CallSiteLike; - parseLine(line: string): StackUtils.StackLineData | null; -} - -declare namespace StackUtils { - interface Options { - internals?: RegExp[]; - cwd?: string; - wrapCallSite?(callSite: CallSite): CallSite; - } - - interface CallSite { - getThis(): object | undefined; - getTypeName(): string; - getFunction(): Function | undefined; - getFunctionName(): string; - getMethodName(): string | null; - getFileName(): string | undefined; - getLineNumber(): number; - getColumnNumber(): number; - getEvalOrigin(): CallSite | string; - isToplevel(): boolean; - isEval(): boolean; - isNative(): boolean; - isConstructor(): boolean; - } - - interface CallSiteLike extends StackData { - type?: string; - } - - interface StackLineData extends StackData { - evalLine?: number; - evalColumn?: number; - evalFile?: string; - } - - interface StackData { - line?: number; - column?: number; - file?: string; - constructor?: boolean; - evalOrigin?: string; - native?: boolean; - function?: string; - method?: string; - } -} +// Type definitions for stack-utils 1.0 +// Project: https://github.com/tapjs/stack-utils#readme +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +export = StackUtils; + +declare class StackUtils { + static nodeInternals(): RegExp[]; + constructor(options?: StackUtils.Options); + clean(stack: string | string[]): string; + capture(limit?: number, startStackFunction?: Function): StackUtils.CallSite[]; + capture(startStackFunction: Function): StackUtils.CallSite[]; + captureString(limit?: number, startStackFunction?: Function): string; + captureString(startStackFunction: Function): string; + at(startStackFunction?: Function): StackUtils.CallSiteLike; + parseLine(line: string): StackUtils.StackLineData | null; +} + +declare namespace StackUtils { + interface Options { + internals?: RegExp[]; + cwd?: string; + wrapCallSite?(callSite: CallSite): CallSite; + } + + interface CallSite { + getThis(): object | undefined; + getTypeName(): string; + getFunction(): Function | undefined; + getFunctionName(): string; + getMethodName(): string | null; + getFileName(): string | undefined; + getLineNumber(): number; + getColumnNumber(): number; + getEvalOrigin(): CallSite | string; + isToplevel(): boolean; + isEval(): boolean; + isNative(): boolean; + isConstructor(): boolean; + } + + interface CallSiteLike extends StackData { + type?: string; + } + + interface StackLineData extends StackData { + evalLine?: number; + evalColumn?: number; + evalFile?: string; + } + + interface StackData { + line?: number; + column?: number; + file?: string; + constructor?: boolean; + evalOrigin?: string; + native?: boolean; + function?: string; + method?: string; + } +} diff --git a/node_modules/@types/yargs-parser/LICENSE b/node_modules/@types/yargs-parser/LICENSE index 21071075c..4b1ad51b2 100644 --- a/node_modules/@types/yargs-parser/LICENSE +++ b/node_modules/@types/yargs-parser/LICENSE @@ -1,21 +1,21 @@ - MIT License - - Copyright (c) Microsoft Corporation. All rights reserved. - - 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 + MIT License + + Copyright (c) Microsoft Corporation. All rights reserved. + + 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/node_modules/@types/yargs-parser/README.md b/node_modules/@types/yargs-parser/README.md index 133507284..dc5ed4cde 100644 --- a/node_modules/@types/yargs-parser/README.md +++ b/node_modules/@types/yargs-parser/README.md @@ -1,16 +1,16 @@ -# Installation -> `npm install --save @types/yargs-parser` - -# Summary -This package contains type definitions for yargs-parser (https://github.com/yargs/yargs-parser#readme). - -# Details -Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/yargs-parser. - -### Additional Details - * Last updated: Mon, 13 Jan 2020 21:01:19 GMT - * Dependencies: none - * Global values: none - -# Credits -These definitions were written by Miles Johnson (https://github.com/milesj). +# Installation +> `npm install --save @types/yargs-parser` + +# Summary +This package contains type definitions for yargs-parser (https://github.com/yargs/yargs-parser#readme). + +# Details +Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/yargs-parser. + +### Additional Details + * Last updated: Mon, 13 Jan 2020 21:01:19 GMT + * Dependencies: none + * Global values: none + +# Credits +These definitions were written by Miles Johnson (https://github.com/milesj). diff --git a/node_modules/@types/yargs/README.md b/node_modules/@types/yargs/README.md index 908fe08df..9d413239b 100644 --- a/node_modules/@types/yargs/README.md +++ b/node_modules/@types/yargs/README.md @@ -1,16 +1,16 @@ -# Installation -> `npm install --save @types/yargs` - -# Summary -This package contains type definitions for yargs (https://github.com/chevex/yargs). - -# Details -Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/yargs. - -### Additional Details - * Last updated: Wed, 23 Sep 2020 19:15:29 GMT - * Dependencies: [@types/yargs-parser](https://npmjs.com/package/@types/yargs-parser) - * Global values: none - -# Credits -These definitions were written by [Martin Poelstra](https://github.com/poelstra), [Mizunashi Mana](https://github.com/mizunashi-mana), [Jeffery Grajkowski](https://github.com/pushplay), [Jimi (Dimitris) Charalampidis](https://github.com/JimiC), [Steffen Viken Valvåg](https://github.com/steffenvv), [Emily Marigold Klassen](https://github.com/forivall), [ExE Boss](https://github.com/ExE-Boss), and [Aankhen](https://github.com/Aankhen). +# Installation +> `npm install --save @types/yargs` + +# Summary +This package contains type definitions for yargs (https://github.com/chevex/yargs). + +# Details +Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/yargs. + +### Additional Details + * Last updated: Wed, 23 Sep 2020 19:15:29 GMT + * Dependencies: [@types/yargs-parser](https://npmjs.com/package/@types/yargs-parser) + * Global values: none + +# Credits +These definitions were written by [Martin Poelstra](https://github.com/poelstra), [Mizunashi Mana](https://github.com/mizunashi-mana), [Jeffery Grajkowski](https://github.com/pushplay), [Jimi (Dimitris) Charalampidis](https://github.com/JimiC), [Steffen Viken Valvåg](https://github.com/steffenvv), [Emily Marigold Klassen](https://github.com/forivall), [ExE Boss](https://github.com/ExE-Boss), and [Aankhen](https://github.com/Aankhen). diff --git a/node_modules/abbrev/package.json b/node_modules/abbrev/package.json index dace5cf45..bf4e8015b 100644 --- a/node_modules/abbrev/package.json +++ b/node_modules/abbrev/package.json @@ -18,8 +18,4 @@ "files": [ "abbrev.js" ] - -,"_resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz" -,"_integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==" -,"_from": "abbrev@1.1.1" -} \ No newline at end of file +} diff --git a/node_modules/acorn-globals/node_modules/.bin/acorn b/node_modules/acorn-globals/node_modules/.bin/acorn deleted file mode 100644 index 46a3e61a1..000000000 --- a/node_modules/acorn-globals/node_modules/.bin/acorn +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") - -case `uname` in - *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;; -esac - -if [ -x "$basedir/node" ]; then - exec "$basedir/node" "$basedir/../acorn/bin/acorn" "$@" -else - exec node "$basedir/../acorn/bin/acorn" "$@" -fi diff --git a/node_modules/acorn-globals/node_modules/.bin/acorn b/node_modules/acorn-globals/node_modules/.bin/acorn new file mode 120000 index 000000000..cf7676038 --- /dev/null +++ b/node_modules/acorn-globals/node_modules/.bin/acorn @@ -0,0 +1 @@ +../acorn/bin/acorn \ No newline at end of file diff --git a/node_modules/acorn-globals/node_modules/.bin/acorn.cmd b/node_modules/acorn-globals/node_modules/.bin/acorn.cmd deleted file mode 100644 index a9324df95..000000000 --- a/node_modules/acorn-globals/node_modules/.bin/acorn.cmd +++ /dev/null @@ -1,17 +0,0 @@ -@ECHO off -GOTO start -:find_dp0 -SET dp0=%~dp0 -EXIT /b -:start -SETLOCAL -CALL :find_dp0 - -IF EXIST "%dp0%\node.exe" ( - SET "_prog=%dp0%\node.exe" -) ELSE ( - SET "_prog=node" - SET PATHEXT=%PATHEXT:;.JS;=;% -) - -endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\acorn\bin\acorn" %* diff --git a/node_modules/acorn-globals/node_modules/.bin/acorn.ps1 b/node_modules/acorn-globals/node_modules/.bin/acorn.ps1 deleted file mode 100644 index 6f6dcddf3..000000000 --- a/node_modules/acorn-globals/node_modules/.bin/acorn.ps1 +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env pwsh -$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent - -$exe="" -if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { - # Fix case when both the Windows and Linux builds of Node - # are installed in the same directory - $exe=".exe" -} -$ret=0 -if (Test-Path "$basedir/node$exe") { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "$basedir/node$exe" "$basedir/../acorn/bin/acorn" $args - } else { - & "$basedir/node$exe" "$basedir/../acorn/bin/acorn" $args - } - $ret=$LASTEXITCODE -} else { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "node$exe" "$basedir/../acorn/bin/acorn" $args - } else { - & "node$exe" "$basedir/../acorn/bin/acorn" $args - } - $ret=$LASTEXITCODE -} -exit $ret diff --git a/node_modules/acorn-globals/node_modules/acorn/bin/acorn b/node_modules/acorn-globals/node_modules/acorn/bin/acorn old mode 100644 new mode 100755 diff --git a/node_modules/acorn/bin/acorn b/node_modules/acorn/bin/acorn old mode 100644 new mode 100755 diff --git a/node_modules/actions-secret-parser/index.d.ts b/node_modules/actions-secret-parser/index.d.ts index a759a8647..4c342aad9 100644 --- a/node_modules/actions-secret-parser/index.d.ts +++ b/node_modules/actions-secret-parser/index.d.ts @@ -1,24 +1,24 @@ -export declare enum FormatType { - "JSON" = 0, - "XML" = 1 -} -/** - * Takes content as string and format type (xml, json). - * Exposes getSecret method to get value of specific secret in object and set it as secret. - */ -export declare class SecretParser { - private dom; - private contentType; - constructor(content: string, contentType: FormatType); - /** - * - * @param key jsonpath or xpath depending on content type - * @param isSecret should the value parsed be a secret. Deafult: true - * @param variableName optional. If provided value will be exported with this variable name - * @returns a string value or empty string if key not found - */ - getSecret(key: string, isSecret?: boolean, variableName?: string): string; - private extractJsonPath; - private extractXmlPath; - private handleSecret; -} +export declare enum FormatType { + "JSON" = 0, + "XML" = 1 +} +/** + * Takes content as string and format type (xml, json). + * Exposes getSecret method to get value of specific secret in object and set it as secret. + */ +export declare class SecretParser { + private dom; + private contentType; + constructor(content: string, contentType: FormatType); + /** + * + * @param key jsonpath or xpath depending on content type + * @param isSecret should the value parsed be a secret. Deafult: true + * @param variableName optional. If provided value will be exported with this variable name + * @returns a string value or empty string if key not found + */ + getSecret(key: string, isSecret?: boolean, variableName?: string): string; + private extractJsonPath; + private extractXmlPath; + private handleSecret; +} diff --git a/node_modules/actions-secret-parser/index.js b/node_modules/actions-secret-parser/index.js index 1efb6f3da..c1970100a 100644 --- a/node_modules/actions-secret-parser/index.js +++ b/node_modules/actions-secret-parser/index.js @@ -1,92 +1,92 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.SecretParser = exports.FormatType = void 0; -var core = require('@actions/core'); -var jp = require('jsonpath'); -var xpath = require('xpath'); -var domParser = require('xmldom').DOMParser; -var FormatType; -(function (FormatType) { - FormatType[FormatType["JSON"] = 0] = "JSON"; - FormatType[FormatType["XML"] = 1] = "XML"; -})(FormatType = exports.FormatType || (exports.FormatType = {})); -/** - * Takes content as string and format type (xml, json). - * Exposes getSecret method to get value of specific secret in object and set it as secret. - */ -class SecretParser { - constructor(content, contentType) { - switch (contentType) { - case FormatType.JSON: - try { - this.dom = JSON.parse(content); - } - catch (ex) { - throw new Error('Content is not a valid JSON object'); - } - break; - case FormatType.XML: - try { - this.dom = new domParser().parseFromString(content); - } - catch (ex) { - throw new Error('Content is not a valid XML object'); - } - break; - default: - throw new Error(`Given format: ${contentType} is not supported. Valid options are JSON, XML.`); - } - this.contentType = contentType; - } - /** - * - * @param key jsonpath or xpath depending on content type - * @param isSecret should the value parsed be a secret. Deafult: true - * @param variableName optional. If provided value will be exported with this variable name - * @returns a string value or empty string if key not found - */ - getSecret(key, isSecret = true, variableName) { - let value = ""; - switch (this.contentType) { - case FormatType.JSON: - value = this.extractJsonPath(key, isSecret, variableName); - break; - case FormatType.XML: - value = this.extractXmlPath(key, isSecret, variableName); - break; - } - return value; - } - extractJsonPath(key, isSecret = false, variableName) { - let value = jp.query(this.dom, key); - if (value.length == 0) { - core.debug("Cannot find key: " + key); - return ""; - } - else if (value.length > 1) { - core.debug("Multiple values found for key: " + key + ". Please give jsonPath which points to a single value."); - return ""; - } - return this.handleSecret(key, value[0], isSecret, variableName); - } - extractXmlPath(key, isSecret = false, variableName) { - let value = xpath.select("string(" + key + ")", this.dom); - return this.handleSecret(key, value, isSecret, variableName); - } - handleSecret(key, value, isSecret, variableName) { - if (!!value) { - if (isSecret) { - core.setSecret(value); - } - if (!!variableName) { - core.exportVariable(variableName, value); - } - return value; - } - else { - core.debug("Cannot find key: " + key); - return ""; - } - } -} -exports.SecretParser = SecretParser; +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SecretParser = exports.FormatType = void 0; +var core = require('@actions/core'); +var jp = require('jsonpath'); +var xpath = require('xpath'); +var domParser = require('xmldom').DOMParser; +var FormatType; +(function (FormatType) { + FormatType[FormatType["JSON"] = 0] = "JSON"; + FormatType[FormatType["XML"] = 1] = "XML"; +})(FormatType = exports.FormatType || (exports.FormatType = {})); +/** + * Takes content as string and format type (xml, json). + * Exposes getSecret method to get value of specific secret in object and set it as secret. + */ +class SecretParser { + constructor(content, contentType) { + switch (contentType) { + case FormatType.JSON: + try { + this.dom = JSON.parse(content); + } + catch (ex) { + throw new Error('Content is not a valid JSON object'); + } + break; + case FormatType.XML: + try { + this.dom = new domParser().parseFromString(content); + } + catch (ex) { + throw new Error('Content is not a valid XML object'); + } + break; + default: + throw new Error(`Given format: ${contentType} is not supported. Valid options are JSON, XML.`); + } + this.contentType = contentType; + } + /** + * + * @param key jsonpath or xpath depending on content type + * @param isSecret should the value parsed be a secret. Deafult: true + * @param variableName optional. If provided value will be exported with this variable name + * @returns a string value or empty string if key not found + */ + getSecret(key, isSecret = true, variableName) { + let value = ""; + switch (this.contentType) { + case FormatType.JSON: + value = this.extractJsonPath(key, isSecret, variableName); + break; + case FormatType.XML: + value = this.extractXmlPath(key, isSecret, variableName); + break; + } + return value; + } + extractJsonPath(key, isSecret = false, variableName) { + let value = jp.query(this.dom, key); + if (value.length == 0) { + core.debug("Cannot find key: " + key); + return ""; + } + else if (value.length > 1) { + core.debug("Multiple values found for key: " + key + ". Please give jsonPath which points to a single value."); + return ""; + } + return this.handleSecret(key, value[0], isSecret, variableName); + } + extractXmlPath(key, isSecret = false, variableName) { + let value = xpath.select("string(" + key + ")", this.dom); + return this.handleSecret(key, value, isSecret, variableName); + } + handleSecret(key, value, isSecret, variableName) { + if (!!value) { + if (isSecret) { + core.setSecret(value); + } + if (!!variableName) { + core.exportVariable(variableName, value); + } + return value; + } + else { + core.debug("Cannot find key: " + key); + return ""; + } + } +} +exports.SecretParser = SecretParser; diff --git a/node_modules/actions-secret-parser/package.json b/node_modules/actions-secret-parser/package.json index c4147b97d..32c937b60 100644 --- a/node_modules/actions-secret-parser/package.json +++ b/node_modules/actions-secret-parser/package.json @@ -1,35 +1,35 @@ -{ - "name": "actions-secret-parser", - "version": "1.0.4", - "description": "Parse and set repository secrets", - "main": "index.js", - "scripts": { - "build": "tsc", - "copypackage": "copy package.json lib", - "dist": "npm run build && npm run copypackage && cd lib && npm publish" - }, - "keywords": [ - "secret", - "actions" - ], - "repository": { - "type": "git", - "url": "git+https://github.com/Microsoft/pipelines-appservice-lib.git" - }, - "author": "Sumiran Aggarwal ", - "bugs": { - "url": "https://github.com/Microsoft/pipelines-appservice-lib/issues" - }, - "homepage": "https://github.com/Microsoft/pipelines-appservice-lib/tree/master/packages/utility", - "license": "MIT", - "devDependencies": { - "@types/node": "^18.11.17", - "typescript": "^3.6.3" - }, - "dependencies": { - "@actions/core": "^1.1.10", - "jsonpath": "^1.0.2", - "xmldom": "^0.1.27", - "xpath": "0.0.27" - } -} +{ + "name": "actions-secret-parser", + "version": "1.0.4", + "description": "Parse and set repository secrets", + "main": "index.js", + "scripts": { + "build": "tsc", + "copypackage": "copy package.json lib", + "dist": "npm run build && npm run copypackage && cd lib && npm publish" + }, + "keywords": [ + "secret", + "actions" + ], + "repository": { + "type": "git", + "url": "git+https://github.com/Microsoft/pipelines-appservice-lib.git" + }, + "author": "Sumiran Aggarwal ", + "bugs": { + "url": "https://github.com/Microsoft/pipelines-appservice-lib/issues" + }, + "homepage": "https://github.com/Microsoft/pipelines-appservice-lib/tree/master/packages/utility", + "license": "MIT", + "devDependencies": { + "@types/node": "^18.11.17", + "typescript": "^3.6.3" + }, + "dependencies": { + "@actions/core": "^1.1.10", + "jsonpath": "^1.0.2", + "xmldom": "^0.1.27", + "xpath": "0.0.27" + } +} diff --git a/node_modules/ajv/scripts/info b/node_modules/ajv/scripts/info old mode 100644 new mode 100755 diff --git a/node_modules/ajv/scripts/prepare-tests b/node_modules/ajv/scripts/prepare-tests old mode 100644 new mode 100755 diff --git a/node_modules/ajv/scripts/publish-built-version b/node_modules/ajv/scripts/publish-built-version old mode 100644 new mode 100755 diff --git a/node_modules/ajv/scripts/travis-gh-pages b/node_modules/ajv/scripts/travis-gh-pages old mode 100644 new mode 100755 diff --git a/node_modules/archiver-utils/LICENSE b/node_modules/archiver-utils/LICENSE index f12cd49ca..af5a4f6c1 100644 --- a/node_modules/archiver-utils/LICENSE +++ b/node_modules/archiver-utils/LICENSE @@ -1,22 +1,22 @@ -Copyright (c) 2015 Chris Talkington. - -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 +Copyright (c) 2015 Chris Talkington. + +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. \ No newline at end of file diff --git a/node_modules/archiver-utils/README.md b/node_modules/archiver-utils/README.md index 936f2b113..4f654c3b0 100644 --- a/node_modules/archiver-utils/README.md +++ b/node_modules/archiver-utils/README.md @@ -1,7 +1,7 @@ -# archiver-utils v1.2.0 [![Build Status](https://travis-ci.org/archiverjs/archiver-utils.svg?branch=master)](https://travis-ci.org/archiverjs/archiver-utils) [![Build status](https://ci.appveyor.com/api/projects/status/7254ojgmlglhqbed/branch/master?svg=true)](https://ci.appveyor.com/project/ctalkington/archiver-utils/branch/master) - - -## Things of Interest -- [Changelog](https://github.com/archiverjs/archiver-utils/releases) -- [Contributing](https://github.com/archiverjs/archiver-utils/blob/master/CONTRIBUTING.md) +# archiver-utils v1.2.0 [![Build Status](https://travis-ci.org/archiverjs/archiver-utils.svg?branch=master)](https://travis-ci.org/archiverjs/archiver-utils) [![Build status](https://ci.appveyor.com/api/projects/status/7254ojgmlglhqbed/branch/master?svg=true)](https://ci.appveyor.com/project/ctalkington/archiver-utils/branch/master) + + +## Things of Interest +- [Changelog](https://github.com/archiverjs/archiver-utils/releases) +- [Contributing](https://github.com/archiverjs/archiver-utils/blob/master/CONTRIBUTING.md) - [MIT License](https://github.com/archiverjs/archiver-utils/blob/master/LICENSE) \ No newline at end of file diff --git a/node_modules/archiver-utils/file.js b/node_modules/archiver-utils/file.js index 38162645a..6218f687b 100644 --- a/node_modules/archiver-utils/file.js +++ b/node_modules/archiver-utils/file.js @@ -1,206 +1,206 @@ -/** - * archiver-utils - * - * Copyright (c) 2012-2014 Chris Talkington, contributors. - * Licensed under the MIT license. - * https://github.com/archiverjs/node-archiver/blob/master/LICENSE-MIT - */ -var fs = require('graceful-fs'); -var path = require('path'); - -var _ = require('lodash'); -var glob = require('glob'); - -var file = module.exports = {}; - -var pathSeparatorRe = /[\/\\]/g; - -// Process specified wildcard glob patterns or filenames against a -// callback, excluding and uniquing files in the result set. -var processPatterns = function(patterns, fn) { - // Filepaths to return. - var result = []; - // Iterate over flattened patterns array. - _.flatten(patterns).forEach(function(pattern) { - // If the first character is ! it should be omitted - var exclusion = pattern.indexOf('!') === 0; - // If the pattern is an exclusion, remove the ! - if (exclusion) { pattern = pattern.slice(1); } - // Find all matching files for this pattern. - var matches = fn(pattern); - if (exclusion) { - // If an exclusion, remove matching files. - result = _.difference(result, matches); - } else { - // Otherwise add matching files. - result = _.union(result, matches); - } - }); - return result; -}; - -// True if the file path exists. -file.exists = function() { - var filepath = path.join.apply(path, arguments); - return fs.existsSync(filepath); -}; - -// Return an array of all file paths that match the given wildcard patterns. -file.expand = function() { - var args = _.toArray(arguments); - // If the first argument is an options object, save those options to pass - // into the File.prototype.glob.sync method. - var options = _.isPlainObject(args[0]) ? args.shift() : {}; - // Use the first argument if it's an Array, otherwise convert the arguments - // object to an array and use that. - var patterns = Array.isArray(args[0]) ? args[0] : args; - // Return empty set if there are no patterns or filepaths. - if (patterns.length === 0) { return []; } - // Return all matching filepaths. - var matches = processPatterns(patterns, function(pattern) { - // Find all matching files for this pattern. - return glob.sync(pattern, options); - }); - // Filter result set? - if (options.filter) { - matches = matches.filter(function(filepath) { - filepath = path.join(options.cwd || '', filepath); - try { - if (typeof options.filter === 'function') { - return options.filter(filepath); - } else { - // If the file is of the right type and exists, this should work. - return fs.statSync(filepath)[options.filter](); - } - } catch(e) { - // Otherwise, it's probably not the right type. - return false; - } - }); - } - return matches; -}; - -// Build a multi task "files" object dynamically. -file.expandMapping = function(patterns, destBase, options) { - options = _.defaults({}, options, { - rename: function(destBase, destPath) { - return path.join(destBase || '', destPath); - } - }); - var files = []; - var fileByDest = {}; - // Find all files matching pattern, using passed-in options. - file.expand(options, patterns).forEach(function(src) { - var destPath = src; - // Flatten? - if (options.flatten) { - destPath = path.basename(destPath); - } - // Change the extension? - if (options.ext) { - destPath = destPath.replace(/(\.[^\/]*)?$/, options.ext); - } - // Generate destination filename. - var dest = options.rename(destBase, destPath, options); - // Prepend cwd to src path if necessary. - if (options.cwd) { src = path.join(options.cwd, src); } - // Normalize filepaths to be unix-style. - dest = dest.replace(pathSeparatorRe, '/'); - src = src.replace(pathSeparatorRe, '/'); - // Map correct src path to dest path. - if (fileByDest[dest]) { - // If dest already exists, push this src onto that dest's src array. - fileByDest[dest].src.push(src); - } else { - // Otherwise create a new src-dest file mapping object. - files.push({ - src: [src], - dest: dest, - }); - // And store a reference for later use. - fileByDest[dest] = files[files.length - 1]; - } - }); - return files; -}; - -// reusing bits of grunt's multi-task source normalization -file.normalizeFilesArray = function(data) { - var files = []; - - data.forEach(function(obj) { - var prop; - if ('src' in obj || 'dest' in obj) { - files.push(obj); - } - }); - - if (files.length === 0) { - return []; - } - - files = _(files).chain().forEach(function(obj) { - if (!('src' in obj) || !obj.src) { return; } - // Normalize .src properties to flattened array. - if (Array.isArray(obj.src)) { - obj.src = _.flatten(obj.src); - } else { - obj.src = [obj.src]; - } - }).map(function(obj) { - // Build options object, removing unwanted properties. - var expandOptions = _.extend({}, obj); - delete expandOptions.src; - delete expandOptions.dest; - - // Expand file mappings. - if (obj.expand) { - return file.expandMapping(obj.src, obj.dest, expandOptions).map(function(mapObj) { - // Copy obj properties to result. - var result = _.extend({}, obj); - // Make a clone of the orig obj available. - result.orig = _.extend({}, obj); - // Set .src and .dest, processing both as templates. - result.src = mapObj.src; - result.dest = mapObj.dest; - // Remove unwanted properties. - ['expand', 'cwd', 'flatten', 'rename', 'ext'].forEach(function(prop) { - delete result[prop]; - }); - return result; - }); - } - - // Copy obj properties to result, adding an .orig property. - var result = _.extend({}, obj); - // Make a clone of the orig obj available. - result.orig = _.extend({}, obj); - - if ('src' in result) { - // Expose an expand-on-demand getter method as .src. - Object.defineProperty(result, 'src', { - enumerable: true, - get: function fn() { - var src; - if (!('result' in fn)) { - src = obj.src; - // If src is an array, flatten it. Otherwise, make it into an array. - src = Array.isArray(src) ? _.flatten(src) : [src]; - // Expand src files, memoizing result. - fn.result = file.expand(expandOptions, src); - } - return fn.result; - } - }); - } - - if ('dest' in result) { - result.dest = obj.dest; - } - - return result; - }).flatten().value(); - - return files; +/** + * archiver-utils + * + * Copyright (c) 2012-2014 Chris Talkington, contributors. + * Licensed under the MIT license. + * https://github.com/archiverjs/node-archiver/blob/master/LICENSE-MIT + */ +var fs = require('graceful-fs'); +var path = require('path'); + +var _ = require('lodash'); +var glob = require('glob'); + +var file = module.exports = {}; + +var pathSeparatorRe = /[\/\\]/g; + +// Process specified wildcard glob patterns or filenames against a +// callback, excluding and uniquing files in the result set. +var processPatterns = function(patterns, fn) { + // Filepaths to return. + var result = []; + // Iterate over flattened patterns array. + _.flatten(patterns).forEach(function(pattern) { + // If the first character is ! it should be omitted + var exclusion = pattern.indexOf('!') === 0; + // If the pattern is an exclusion, remove the ! + if (exclusion) { pattern = pattern.slice(1); } + // Find all matching files for this pattern. + var matches = fn(pattern); + if (exclusion) { + // If an exclusion, remove matching files. + result = _.difference(result, matches); + } else { + // Otherwise add matching files. + result = _.union(result, matches); + } + }); + return result; +}; + +// True if the file path exists. +file.exists = function() { + var filepath = path.join.apply(path, arguments); + return fs.existsSync(filepath); +}; + +// Return an array of all file paths that match the given wildcard patterns. +file.expand = function() { + var args = _.toArray(arguments); + // If the first argument is an options object, save those options to pass + // into the File.prototype.glob.sync method. + var options = _.isPlainObject(args[0]) ? args.shift() : {}; + // Use the first argument if it's an Array, otherwise convert the arguments + // object to an array and use that. + var patterns = Array.isArray(args[0]) ? args[0] : args; + // Return empty set if there are no patterns or filepaths. + if (patterns.length === 0) { return []; } + // Return all matching filepaths. + var matches = processPatterns(patterns, function(pattern) { + // Find all matching files for this pattern. + return glob.sync(pattern, options); + }); + // Filter result set? + if (options.filter) { + matches = matches.filter(function(filepath) { + filepath = path.join(options.cwd || '', filepath); + try { + if (typeof options.filter === 'function') { + return options.filter(filepath); + } else { + // If the file is of the right type and exists, this should work. + return fs.statSync(filepath)[options.filter](); + } + } catch(e) { + // Otherwise, it's probably not the right type. + return false; + } + }); + } + return matches; +}; + +// Build a multi task "files" object dynamically. +file.expandMapping = function(patterns, destBase, options) { + options = _.defaults({}, options, { + rename: function(destBase, destPath) { + return path.join(destBase || '', destPath); + } + }); + var files = []; + var fileByDest = {}; + // Find all files matching pattern, using passed-in options. + file.expand(options, patterns).forEach(function(src) { + var destPath = src; + // Flatten? + if (options.flatten) { + destPath = path.basename(destPath); + } + // Change the extension? + if (options.ext) { + destPath = destPath.replace(/(\.[^\/]*)?$/, options.ext); + } + // Generate destination filename. + var dest = options.rename(destBase, destPath, options); + // Prepend cwd to src path if necessary. + if (options.cwd) { src = path.join(options.cwd, src); } + // Normalize filepaths to be unix-style. + dest = dest.replace(pathSeparatorRe, '/'); + src = src.replace(pathSeparatorRe, '/'); + // Map correct src path to dest path. + if (fileByDest[dest]) { + // If dest already exists, push this src onto that dest's src array. + fileByDest[dest].src.push(src); + } else { + // Otherwise create a new src-dest file mapping object. + files.push({ + src: [src], + dest: dest, + }); + // And store a reference for later use. + fileByDest[dest] = files[files.length - 1]; + } + }); + return files; +}; + +// reusing bits of grunt's multi-task source normalization +file.normalizeFilesArray = function(data) { + var files = []; + + data.forEach(function(obj) { + var prop; + if ('src' in obj || 'dest' in obj) { + files.push(obj); + } + }); + + if (files.length === 0) { + return []; + } + + files = _(files).chain().forEach(function(obj) { + if (!('src' in obj) || !obj.src) { return; } + // Normalize .src properties to flattened array. + if (Array.isArray(obj.src)) { + obj.src = _.flatten(obj.src); + } else { + obj.src = [obj.src]; + } + }).map(function(obj) { + // Build options object, removing unwanted properties. + var expandOptions = _.extend({}, obj); + delete expandOptions.src; + delete expandOptions.dest; + + // Expand file mappings. + if (obj.expand) { + return file.expandMapping(obj.src, obj.dest, expandOptions).map(function(mapObj) { + // Copy obj properties to result. + var result = _.extend({}, obj); + // Make a clone of the orig obj available. + result.orig = _.extend({}, obj); + // Set .src and .dest, processing both as templates. + result.src = mapObj.src; + result.dest = mapObj.dest; + // Remove unwanted properties. + ['expand', 'cwd', 'flatten', 'rename', 'ext'].forEach(function(prop) { + delete result[prop]; + }); + return result; + }); + } + + // Copy obj properties to result, adding an .orig property. + var result = _.extend({}, obj); + // Make a clone of the orig obj available. + result.orig = _.extend({}, obj); + + if ('src' in result) { + // Expose an expand-on-demand getter method as .src. + Object.defineProperty(result, 'src', { + enumerable: true, + get: function fn() { + var src; + if (!('result' in fn)) { + src = obj.src; + // If src is an array, flatten it. Otherwise, make it into an array. + src = Array.isArray(src) ? _.flatten(src) : [src]; + // Expand src files, memoizing result. + fn.result = file.expand(expandOptions, src); + } + return fn.result; + } + }); + } + + if ('dest' in result) { + result.dest = obj.dest; + } + + return result; + }).flatten().value(); + + return files; }; \ No newline at end of file diff --git a/node_modules/archiver-utils/index.js b/node_modules/archiver-utils/index.js index 574e882cf..c1607f81d 100644 --- a/node_modules/archiver-utils/index.js +++ b/node_modules/archiver-utils/index.js @@ -1,156 +1,156 @@ -/** - * archiver-utils - * - * Copyright (c) 2015 Chris Talkington. - * Licensed under the MIT license. - * https://github.com/archiverjs/archiver-utils/blob/master/LICENSE - */ -var fs = require('graceful-fs'); -var path = require('path'); -var nutil = require('util'); -var lazystream = require('lazystream'); -var normalizePath = require('normalize-path'); -var _ = require('lodash'); - -var Stream = require('stream').Stream; -var PassThrough = require('readable-stream').PassThrough; - -var utils = module.exports = {}; -utils.file = require('./file.js'); - -function assertPath(path) { - if (typeof path !== 'string') { - throw new TypeError('Path must be a string. Received ' + nutils.inspect(path)); - } -} - -utils.collectStream = function(source, callback) { - var collection = []; - var size = 0; - - source.on('error', callback); - - source.on('data', function(chunk) { - collection.push(chunk); - size += chunk.length; - }); - - source.on('end', function() { - var buf = new Buffer(size); - var offset = 0; - - collection.forEach(function(data) { - data.copy(buf, offset); - offset += data.length; - }); - - callback(null, buf); - }); -}; - -utils.dateify = function(dateish) { - dateish = dateish || new Date(); - - if (dateish instanceof Date) { - dateish = dateish; - } else if (typeof dateish === 'string') { - dateish = new Date(dateish); - } else { - dateish = new Date(); - } - - return dateish; -}; - -// this is slightly different from lodash version -utils.defaults = function(object, source, guard) { - var args = arguments; - args[0] = args[0] || {}; - - return _.defaults.apply(_, args); -}; - -utils.isStream = function(source) { - return source instanceof Stream; -}; - -utils.lazyReadStream = function(filepath) { - return new lazystream.Readable(function() { - return fs.createReadStream(filepath); - }); -}; - -utils.normalizeInputSource = function(source) { - if (source === null) { - return new Buffer(0); - } else if (typeof source === 'string') { - return new Buffer(source); - } else if (utils.isStream(source) && !source._readableState) { - var normalized = new PassThrough(); - source.pipe(normalized); - - return normalized; - } - - return source; -}; - -utils.sanitizePath = function(filepath) { - return normalizePath(filepath, false).replace(/^\w+:/, '').replace(/^(\.\.\/|\/)+/, ''); -}; - -utils.trailingSlashIt = function(str) { - return str.slice(-1) !== '/' ? str + '/' : str; -}; - -utils.unixifyPath = function(filepath) { - return normalizePath(filepath, false).replace(/^\w+:/, ''); -}; - -utils.walkdir = function(dirpath, base, callback) { - var results = []; - - if (typeof base === 'function') { - callback = base; - base = dirpath; - } - - fs.readdir(dirpath, function(err, list) { - var i = 0; - var file; - var filepath; - - if (err) { - return callback(err); - } - - (function next() { - file = list[i++]; - - if (!file) { - return callback(null, results); - } - - filepath = path.join(dirpath, file); - - fs.stat(filepath, function(err, stats) { - results.push({ - path: filepath, - relative: path.relative(base, filepath).replace(/\\/g, '/'), - stats: stats - }); - - if (stats && stats.isDirectory()) { - utils.walkdir(filepath, base, function(err, res) { - res.forEach(function(dirEntry) { - results.push(dirEntry); - }); - next(); - }); - } else { - next(); - } - }); - })(); - }); -}; +/** + * archiver-utils + * + * Copyright (c) 2015 Chris Talkington. + * Licensed under the MIT license. + * https://github.com/archiverjs/archiver-utils/blob/master/LICENSE + */ +var fs = require('graceful-fs'); +var path = require('path'); +var nutil = require('util'); +var lazystream = require('lazystream'); +var normalizePath = require('normalize-path'); +var _ = require('lodash'); + +var Stream = require('stream').Stream; +var PassThrough = require('readable-stream').PassThrough; + +var utils = module.exports = {}; +utils.file = require('./file.js'); + +function assertPath(path) { + if (typeof path !== 'string') { + throw new TypeError('Path must be a string. Received ' + nutils.inspect(path)); + } +} + +utils.collectStream = function(source, callback) { + var collection = []; + var size = 0; + + source.on('error', callback); + + source.on('data', function(chunk) { + collection.push(chunk); + size += chunk.length; + }); + + source.on('end', function() { + var buf = new Buffer(size); + var offset = 0; + + collection.forEach(function(data) { + data.copy(buf, offset); + offset += data.length; + }); + + callback(null, buf); + }); +}; + +utils.dateify = function(dateish) { + dateish = dateish || new Date(); + + if (dateish instanceof Date) { + dateish = dateish; + } else if (typeof dateish === 'string') { + dateish = new Date(dateish); + } else { + dateish = new Date(); + } + + return dateish; +}; + +// this is slightly different from lodash version +utils.defaults = function(object, source, guard) { + var args = arguments; + args[0] = args[0] || {}; + + return _.defaults.apply(_, args); +}; + +utils.isStream = function(source) { + return source instanceof Stream; +}; + +utils.lazyReadStream = function(filepath) { + return new lazystream.Readable(function() { + return fs.createReadStream(filepath); + }); +}; + +utils.normalizeInputSource = function(source) { + if (source === null) { + return new Buffer(0); + } else if (typeof source === 'string') { + return new Buffer(source); + } else if (utils.isStream(source) && !source._readableState) { + var normalized = new PassThrough(); + source.pipe(normalized); + + return normalized; + } + + return source; +}; + +utils.sanitizePath = function(filepath) { + return normalizePath(filepath, false).replace(/^\w+:/, '').replace(/^(\.\.\/|\/)+/, ''); +}; + +utils.trailingSlashIt = function(str) { + return str.slice(-1) !== '/' ? str + '/' : str; +}; + +utils.unixifyPath = function(filepath) { + return normalizePath(filepath, false).replace(/^\w+:/, ''); +}; + +utils.walkdir = function(dirpath, base, callback) { + var results = []; + + if (typeof base === 'function') { + callback = base; + base = dirpath; + } + + fs.readdir(dirpath, function(err, list) { + var i = 0; + var file; + var filepath; + + if (err) { + return callback(err); + } + + (function next() { + file = list[i++]; + + if (!file) { + return callback(null, results); + } + + filepath = path.join(dirpath, file); + + fs.stat(filepath, function(err, stats) { + results.push({ + path: filepath, + relative: path.relative(base, filepath).replace(/\\/g, '/'), + stats: stats + }); + + if (stats && stats.isDirectory()) { + utils.walkdir(filepath, base, function(err, res) { + res.forEach(function(dirEntry) { + results.push(dirEntry); + }); + next(); + }); + } else { + next(); + } + }); + })(); + }); +}; diff --git a/node_modules/archiver-utils/package.json b/node_modules/archiver-utils/package.json index 54b481523..97c6abde9 100644 --- a/node_modules/archiver-utils/package.json +++ b/node_modules/archiver-utils/package.json @@ -1,55 +1,51 @@ -{ - "name": "archiver-utils", - "version": "1.3.0", - "license": "MIT", - "description": "utility functions for archiver", - "homepage": "https://github.com/archiverjs/archiver-utils", - "author": { - "name": "Chris Talkington", - "url": "http://christalkington.com/" - }, - "repository": { - "type": "git", - "url": "https://github.com/archiverjs/archiver-utils.git" - }, - "bugs": { - "url": "https://github.com/archiverjs/archiver-utils/issues" - }, - "homepage": "https://github.com/archiverjs/archiver-utils#readme", - "keywords": [ - "archiver", - "utils" - ], - "main": "index.js", - "files": [ - "index.js", - "file.js" - ], - "engines": { - "node": ">= 0.10.0" - }, - "scripts": { - "test": "mocha --reporter dot" - }, - "dependencies": { - "glob": "^7.0.0", - "graceful-fs": "^4.1.0", - "lazystream": "^1.0.0", - "lodash": "^4.8.0", - "normalize-path": "^2.0.0", - "readable-stream": "^2.0.0" - }, - "devDependencies": { - "chai": "^3.4.0", - "mocha": "^2.3.3", - "rimraf": "^2.4.2", - "mkdirp": "^0.5.0" - }, - "publishConfig": { - "registry": "https://registry.npmjs.org/" - } - -,"_resolved": "https://registry.npmjs.org/archiver-utils/-/archiver-utils-1.3.0.tgz" -,"_integrity": "sha1-5QtMCccL89aA4y/xt5lOn52JUXQ=" -,"_from": "archiver-utils@1.3.0" +{ + "name": "archiver-utils", + "version": "1.3.0", + "license": "MIT", + "description": "utility functions for archiver", + "homepage": "https://github.com/archiverjs/archiver-utils", + "author": { + "name": "Chris Talkington", + "url": "http://christalkington.com/" + }, + "repository": { + "type": "git", + "url": "https://github.com/archiverjs/archiver-utils.git" + }, + "bugs": { + "url": "https://github.com/archiverjs/archiver-utils/issues" + }, + "homepage": "https://github.com/archiverjs/archiver-utils#readme", + "keywords": [ + "archiver", + "utils" + ], + "main": "index.js", + "files": [ + "index.js", + "file.js" + ], + "engines": { + "node": ">= 0.10.0" + }, + "scripts": { + "test": "mocha --reporter dot" + }, + "dependencies": { + "glob": "^7.0.0", + "graceful-fs": "^4.1.0", + "lazystream": "^1.0.0", + "lodash": "^4.8.0", + "normalize-path": "^2.0.0", + "readable-stream": "^2.0.0" + }, + "devDependencies": { + "chai": "^3.4.0", + "mocha": "^2.3.3", + "rimraf": "^2.4.2", + "mkdirp": "^0.5.0" + }, + "publishConfig": { + "registry": "https://registry.npmjs.org/" + } } \ No newline at end of file diff --git a/node_modules/archiver/CHANGELOG.md b/node_modules/archiver/CHANGELOG.md index 52c017b31..7fdb09a7b 100644 --- a/node_modules/archiver/CHANGELOG.md +++ b/node_modules/archiver/CHANGELOG.md @@ -1,76 +1,76 @@ -## Changelog - -**2.1.1** — _January 10th, 2018_ — [Diff](https://github.com/archiverjs/node-archiver/compare/2.1.0...2.1.1) - -- bugfix: fix relative symlink paths (#293) -- other: coding style fixes (#294) - -**2.1.0** — _October 12th, 2017_ — [Diff](https://github.com/archiverjs/node-archiver/compare/2.0.3...2.1.0) - -- refactor: `directory` now uses glob behind the scenes. should fix some directory recursion issues. (#267, #275) -- docs: more info in quick start. (#284) - -**2.0.3** — _August 25th, 2017_ — [Diff](https://github.com/archiverjs/node-archiver/compare/2.0.2...2.0.3) - -- bugfix: revert #261 due to potential issues with editing entryData in special cases. -- bugfix: add var to entryData in glob callback (#273) - -**2.0.2** — _August 25th, 2017_ — [Diff](https://github.com/archiverjs/node-archiver/compare/2.0.1...2.0.2) - -- docs: fix changelog date. - -**2.0.1** — _August 25th, 2017_ — [Diff](https://github.com/archiverjs/node-archiver/compare/2.0.0...2.0.1) - -- bugfix: add const to entryData in glob callback (#261) -- other: coding style fixes (#263) - -**2.0.0** — _July 5th, 2017_ — [Diff](https://github.com/archiverjs/node-archiver/compare/1.3.0...2.0.0) - -- feature: support for symlinks. (#228) -- feature: support for promises on `finalize`. (#248) -- feature: addition of `symlink` method for programmatically creating symlinks within an archive. -- change: emit `warning` instead of `error` when stat fails and the process can still continue. -- change: errors and warnings now contain extended data (where available) and have standardized error codes (#256) -- change: removal of deprecated `bulk` functionality. (#249) -- change: removal of internal `_entries` property in favor of `progress` event. (#247) -- change: support for node v4.0+ only. node v0.10 and v0.12 support has been dropped. (#241) - -**1.3.0** — _December 13, 2016_ — [Diff](https://github.com/archiverjs/node-archiver/compare/1.2.0...1.3.0) - -- improve `directory` and `glob` methods to use events rather than callbacks. (#203) -- fix bulk warning spam (#208) -- updated mocha (#205) - -**1.2.0** — _November 2, 2016_ — [Diff](https://github.com/archiverjs/node-archiver/compare/1.1.0...1.2.0) - -- Add a `process.emitWarning` for `deprecated` (#202) - -**1.1.0** — _August 29, 2016_ — [Diff](https://github.com/archiverjs/node-archiver/compare/1.0.1...1.1.0) - -- minor doc fixes. -- bump deps to ensure latest versions are used. - -**1.0.1** — _July 27, 2016_ — [Diff](https://github.com/archiverjs/node-archiver/compare/1.0.0...1.0.1) - -- minor doc fixes. -- dependencies upgraded. - -**1.0.0** — _April 5, 2016_ — [Diff](https://github.com/archiverjs/node-archiver/compare/0.21.0...1.0.0) - -- version unification across many archiver packages. -- dependencies upgraded and now using semver caret (^). - -**0.21.0** — _December 21, 2015_ — [Diff](https://github.com/archiverjs/node-archiver/compare/0.20.0...0.21.0) - -- core: add support for `entry.prefix`. update some internals to use it. -- core(glob): when setting `options.cwd` get an absolute path to the file and use the relative path for `entry.name`. #173 -- core(bulk): soft-deprecation of `bulk` feature. will remain for time being with no new features or support. -- docs: initial jsdoc for core. http://archiverjs.com/docs -- tests: restructure a bit. - -**0.20.0** — _November 30, 2015_ — [Diff](https://github.com/archiverjs/node-archiver/compare/0.19.0...0.20.0) - -- simpler path normalization as path.join was a bit restrictive. #162 -- move utils to separate module to DRY. - +## Changelog + +**2.1.1** — _January 10th, 2018_ — [Diff](https://github.com/archiverjs/node-archiver/compare/2.1.0...2.1.1) + +- bugfix: fix relative symlink paths (#293) +- other: coding style fixes (#294) + +**2.1.0** — _October 12th, 2017_ — [Diff](https://github.com/archiverjs/node-archiver/compare/2.0.3...2.1.0) + +- refactor: `directory` now uses glob behind the scenes. should fix some directory recursion issues. (#267, #275) +- docs: more info in quick start. (#284) + +**2.0.3** — _August 25th, 2017_ — [Diff](https://github.com/archiverjs/node-archiver/compare/2.0.2...2.0.3) + +- bugfix: revert #261 due to potential issues with editing entryData in special cases. +- bugfix: add var to entryData in glob callback (#273) + +**2.0.2** — _August 25th, 2017_ — [Diff](https://github.com/archiverjs/node-archiver/compare/2.0.1...2.0.2) + +- docs: fix changelog date. + +**2.0.1** — _August 25th, 2017_ — [Diff](https://github.com/archiverjs/node-archiver/compare/2.0.0...2.0.1) + +- bugfix: add const to entryData in glob callback (#261) +- other: coding style fixes (#263) + +**2.0.0** — _July 5th, 2017_ — [Diff](https://github.com/archiverjs/node-archiver/compare/1.3.0...2.0.0) + +- feature: support for symlinks. (#228) +- feature: support for promises on `finalize`. (#248) +- feature: addition of `symlink` method for programmatically creating symlinks within an archive. +- change: emit `warning` instead of `error` when stat fails and the process can still continue. +- change: errors and warnings now contain extended data (where available) and have standardized error codes (#256) +- change: removal of deprecated `bulk` functionality. (#249) +- change: removal of internal `_entries` property in favor of `progress` event. (#247) +- change: support for node v4.0+ only. node v0.10 and v0.12 support has been dropped. (#241) + +**1.3.0** — _December 13, 2016_ — [Diff](https://github.com/archiverjs/node-archiver/compare/1.2.0...1.3.0) + +- improve `directory` and `glob` methods to use events rather than callbacks. (#203) +- fix bulk warning spam (#208) +- updated mocha (#205) + +**1.2.0** — _November 2, 2016_ — [Diff](https://github.com/archiverjs/node-archiver/compare/1.1.0...1.2.0) + +- Add a `process.emitWarning` for `deprecated` (#202) + +**1.1.0** — _August 29, 2016_ — [Diff](https://github.com/archiverjs/node-archiver/compare/1.0.1...1.1.0) + +- minor doc fixes. +- bump deps to ensure latest versions are used. + +**1.0.1** — _July 27, 2016_ — [Diff](https://github.com/archiverjs/node-archiver/compare/1.0.0...1.0.1) + +- minor doc fixes. +- dependencies upgraded. + +**1.0.0** — _April 5, 2016_ — [Diff](https://github.com/archiverjs/node-archiver/compare/0.21.0...1.0.0) + +- version unification across many archiver packages. +- dependencies upgraded and now using semver caret (^). + +**0.21.0** — _December 21, 2015_ — [Diff](https://github.com/archiverjs/node-archiver/compare/0.20.0...0.21.0) + +- core: add support for `entry.prefix`. update some internals to use it. +- core(glob): when setting `options.cwd` get an absolute path to the file and use the relative path for `entry.name`. #173 +- core(bulk): soft-deprecation of `bulk` feature. will remain for time being with no new features or support. +- docs: initial jsdoc for core. http://archiverjs.com/docs +- tests: restructure a bit. + +**0.20.0** — _November 30, 2015_ — [Diff](https://github.com/archiverjs/node-archiver/compare/0.19.0...0.20.0) + +- simpler path normalization as path.join was a bit restrictive. #162 +- move utils to separate module to DRY. + [Release Archive](https://github.com/archiverjs/node-archiver/releases) \ No newline at end of file diff --git a/node_modules/archiver/LICENSE b/node_modules/archiver/LICENSE index 88caf8710..bc56a8a4c 100644 --- a/node_modules/archiver/LICENSE +++ b/node_modules/archiver/LICENSE @@ -1,22 +1,22 @@ -Copyright (c) 2012-2014 Chris Talkington, contributors. - -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 +Copyright (c) 2012-2014 Chris Talkington, contributors. + +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. \ No newline at end of file diff --git a/node_modules/archiver/README.md b/node_modules/archiver/README.md index 07922a819..72d2eb18f 100644 --- a/node_modules/archiver/README.md +++ b/node_modules/archiver/README.md @@ -1,94 +1,94 @@ -# Archiver - -[![Build Status](https://travis-ci.org/archiverjs/node-archiver.svg?branch=master)](https://travis-ci.org/archiverjs/node-archiver) [![Build status](https://ci.appveyor.com/api/projects/status/38kqu3yp159nodxe/branch/master?svg=true)](https://ci.appveyor.com/project/ctalkington/node-archiver/branch/master) - -a streaming interface for archive generation - -Visit the [API documentation](http://archiverjs.com/docs) for a list of all methods available. - -## Install - -```bash -npm install archiver --save -``` - -## Quick Start - -```js -// require modules -var fs = require('fs'); -var archiver = require('archiver'); - -// create a file to stream archive data to. -var output = fs.createWriteStream(__dirname + '/example.zip'); -var archive = archiver('zip', { - zlib: { level: 9 } // Sets the compression level. -}); - -// listen for all archive data to be written -// 'close' event is fired only when a file descriptor is involved -output.on('close', function() { - console.log(archive.pointer() + ' total bytes'); - console.log('archiver has been finalized and the output file descriptor has closed.'); -}); - -// This event is fired when the data source is drained no matter what was the data source. -// It is not part of this library but rather from the NodeJS Stream API. -// @see: https://nodejs.org/api/stream.html#stream_event_end -output.on('end', function() { - console.log('Data has been drained'); -}); - -// good practice to catch warnings (ie stat failures and other non-blocking errors) -archive.on('warning', function(err) { - if (err.code === 'ENOENT') { - // log warning - } else { - // throw error - throw err; - } -}); - -// good practice to catch this error explicitly -archive.on('error', function(err) { - throw err; -}); - -// pipe archive data to the file -archive.pipe(output); - -// append a file from stream -var file1 = __dirname + '/file1.txt'; -archive.append(fs.createReadStream(file1), { name: 'file1.txt' }); - -// append a file from string -archive.append('string cheese!', { name: 'file2.txt' }); - -// append a file from buffer -var buffer3 = Buffer.from('buff it!'); -archive.append(buffer3, { name: 'file3.txt' }); - -// append a file -archive.file('file1.txt', { name: 'file4.txt' }); - -// append files from a sub-directory and naming it `new-subdir` within the archive -archive.directory('subdir/', 'new-subdir'); - -// append files from a sub-directory, putting its contents at the root of archive -archive.directory('subdir/', false); - -// append files from a glob pattern -archive.glob('subdir/*.txt'); - -// finalize the archive (ie we are done appending files but streams have to finish yet) -// 'close', 'end' or 'finish' may be fired right after calling this method so register to them beforehand -archive.finalize(); -``` - -## Formats - -Archiver ships with out of the box support for TAR and ZIP archives. - -You can register additional formats with `registerFormat`. - -_Formats will be changing in the next few releases to implement a middleware approach._ +# Archiver + +[![Build Status](https://travis-ci.org/archiverjs/node-archiver.svg?branch=master)](https://travis-ci.org/archiverjs/node-archiver) [![Build status](https://ci.appveyor.com/api/projects/status/38kqu3yp159nodxe/branch/master?svg=true)](https://ci.appveyor.com/project/ctalkington/node-archiver/branch/master) + +a streaming interface for archive generation + +Visit the [API documentation](http://archiverjs.com/docs) for a list of all methods available. + +## Install + +```bash +npm install archiver --save +``` + +## Quick Start + +```js +// require modules +var fs = require('fs'); +var archiver = require('archiver'); + +// create a file to stream archive data to. +var output = fs.createWriteStream(__dirname + '/example.zip'); +var archive = archiver('zip', { + zlib: { level: 9 } // Sets the compression level. +}); + +// listen for all archive data to be written +// 'close' event is fired only when a file descriptor is involved +output.on('close', function() { + console.log(archive.pointer() + ' total bytes'); + console.log('archiver has been finalized and the output file descriptor has closed.'); +}); + +// This event is fired when the data source is drained no matter what was the data source. +// It is not part of this library but rather from the NodeJS Stream API. +// @see: https://nodejs.org/api/stream.html#stream_event_end +output.on('end', function() { + console.log('Data has been drained'); +}); + +// good practice to catch warnings (ie stat failures and other non-blocking errors) +archive.on('warning', function(err) { + if (err.code === 'ENOENT') { + // log warning + } else { + // throw error + throw err; + } +}); + +// good practice to catch this error explicitly +archive.on('error', function(err) { + throw err; +}); + +// pipe archive data to the file +archive.pipe(output); + +// append a file from stream +var file1 = __dirname + '/file1.txt'; +archive.append(fs.createReadStream(file1), { name: 'file1.txt' }); + +// append a file from string +archive.append('string cheese!', { name: 'file2.txt' }); + +// append a file from buffer +var buffer3 = Buffer.from('buff it!'); +archive.append(buffer3, { name: 'file3.txt' }); + +// append a file +archive.file('file1.txt', { name: 'file4.txt' }); + +// append files from a sub-directory and naming it `new-subdir` within the archive +archive.directory('subdir/', 'new-subdir'); + +// append files from a sub-directory, putting its contents at the root of archive +archive.directory('subdir/', false); + +// append files from a glob pattern +archive.glob('subdir/*.txt'); + +// finalize the archive (ie we are done appending files but streams have to finish yet) +// 'close', 'end' or 'finish' may be fired right after calling this method so register to them beforehand +archive.finalize(); +``` + +## Formats + +Archiver ships with out of the box support for TAR and ZIP archives. + +You can register additional formats with `registerFormat`. + +_Formats will be changing in the next few releases to implement a middleware approach._ diff --git a/node_modules/archiver/index.js b/node_modules/archiver/index.js index 324db8c69..bcaebf1fd 100644 --- a/node_modules/archiver/index.js +++ b/node_modules/archiver/index.js @@ -1,70 +1,70 @@ -/** - * Archiver Vending - * - * @ignore - * @license [MIT]{@link https://github.com/archiverjs/node-archiver/blob/master/LICENSE} - * @copyright (c) 2012-2014 Chris Talkington, contributors. - */ -var Archiver = require('./lib/core'); - -var formats = {}; - -/** - * Dispenses a new Archiver instance. - * - * @constructor - * @param {String} format The archive format to use. - * @param {Object} options See [Archiver]{@link Archiver} - * @return {Archiver} - */ -var vending = function(format, options) { - return vending.create(format, options); -}; - -/** - * Creates a new Archiver instance. - * - * @param {String} format The archive format to use. - * @param {Object} options See [Archiver]{@link Archiver} - * @return {Archiver} - */ -vending.create = function(format, options) { - if (formats[format]) { - var instance = new Archiver(format, options); - instance.setFormat(format); - instance.setModule(new formats[format](options)); - - return instance; - } else { - throw new Error('create(' + format + '): format not registered'); - } -}; - -/** - * Registers a format for use with archiver. - * - * @param {String} format The name of the format. - * @param {Function} module The function for archiver to interact with. - * @return void - */ -vending.registerFormat = function(format, module) { - if (formats[format]) { - throw new Error('register(' + format + '): format already registered'); - } - - if (typeof module !== 'function') { - throw new Error('register(' + format + '): format module invalid'); - } - - if (typeof module.prototype.append !== 'function' || typeof module.prototype.finalize !== 'function') { - throw new Error('register(' + format + '): format module missing methods'); - } - - formats[format] = module; -}; - -vending.registerFormat('zip', require('./lib/plugins/zip')); -vending.registerFormat('tar', require('./lib/plugins/tar')); -vending.registerFormat('json', require('./lib/plugins/json')); - +/** + * Archiver Vending + * + * @ignore + * @license [MIT]{@link https://github.com/archiverjs/node-archiver/blob/master/LICENSE} + * @copyright (c) 2012-2014 Chris Talkington, contributors. + */ +var Archiver = require('./lib/core'); + +var formats = {}; + +/** + * Dispenses a new Archiver instance. + * + * @constructor + * @param {String} format The archive format to use. + * @param {Object} options See [Archiver]{@link Archiver} + * @return {Archiver} + */ +var vending = function(format, options) { + return vending.create(format, options); +}; + +/** + * Creates a new Archiver instance. + * + * @param {String} format The archive format to use. + * @param {Object} options See [Archiver]{@link Archiver} + * @return {Archiver} + */ +vending.create = function(format, options) { + if (formats[format]) { + var instance = new Archiver(format, options); + instance.setFormat(format); + instance.setModule(new formats[format](options)); + + return instance; + } else { + throw new Error('create(' + format + '): format not registered'); + } +}; + +/** + * Registers a format for use with archiver. + * + * @param {String} format The name of the format. + * @param {Function} module The function for archiver to interact with. + * @return void + */ +vending.registerFormat = function(format, module) { + if (formats[format]) { + throw new Error('register(' + format + '): format already registered'); + } + + if (typeof module !== 'function') { + throw new Error('register(' + format + '): format module invalid'); + } + + if (typeof module.prototype.append !== 'function' || typeof module.prototype.finalize !== 'function') { + throw new Error('register(' + format + '): format module missing methods'); + } + + formats[format] = module; +}; + +vending.registerFormat('zip', require('./lib/plugins/zip')); +vending.registerFormat('tar', require('./lib/plugins/tar')); +vending.registerFormat('json', require('./lib/plugins/json')); + module.exports = vending; \ No newline at end of file diff --git a/node_modules/archiver/lib/core.js b/node_modules/archiver/lib/core.js index c7d0b61f4..64c27baa5 100644 --- a/node_modules/archiver/lib/core.js +++ b/node_modules/archiver/lib/core.js @@ -1,959 +1,959 @@ -/** - * Archiver Core - * - * @ignore - * @license [MIT]{@link https://github.com/archiverjs/node-archiver/blob/master/LICENSE} - * @copyright (c) 2012-2014 Chris Talkington, contributors. - */ -var fs = require('fs'); -var glob = require('glob'); -var async = require('async'); -var _ = require('lodash'); -var path = require('path'); -var util = require('archiver-utils'); - -var inherits = require('util').inherits; -var ArchiverError = require('./error'); -var Transform = require('readable-stream').Transform; - -var win32 = process.platform === 'win32'; - -/** - * @constructor - * @param {String} format The archive format to use. - * @param {(CoreOptions|TransformOptions)} options See also {@link ZipOptions} and {@link TarOptions}. - */ -var Archiver = function(format, options) { - if (!(this instanceof Archiver)) { - return new Archiver(format, options); - } - - if (typeof format !== 'string') { - options = format; - format = 'zip'; - } - - options = this.options = util.defaults(options, { - highWaterMark: 1024 * 1024, - statConcurrency: 4 - }); - - Transform.call(this, options); - - this._format = false; - this._module = false; - this._pending = 0; - this._pointer = 0; - - this._entriesCount = 0; - this._entriesProcessedCount = 0; - this._fsEntriesTotalBytes = 0; - this._fsEntriesProcessedBytes = 0; - - this._queue = async.queue(this._onQueueTask.bind(this), 1); - this._queue.drain = this._onQueueDrain.bind(this); - - this._statQueue = async.queue(this._onStatQueueTask.bind(this), options.statConcurrency); - - this._state = { - aborted: false, - finalize: false, - finalizing: false, - finalized: false, - modulePiped: false - }; - - this._streams = []; -}; - -inherits(Archiver, Transform); - -/** - * Internal logic for `abort`. - * - * @private - * @return void - */ -Archiver.prototype._abort = function() { - this._state.aborted = true; - this._queue.kill(); - this._statQueue.kill(); - - if (this._queue.idle()) { - this._shutdown(); - } -}; - -/** - * Internal helper for appending files. - * - * @private - * @param {String} filepath The source filepath. - * @param {EntryData} data The entry data. - * @return void - */ -Archiver.prototype._append = function(filepath, data) { - data = data || {}; - - var task = { - source: null, - filepath: filepath - }; - - if (!data.name) { - data.name = filepath; - } - - data.sourcePath = filepath; - task.data = data; - this._entriesCount++; - - if (data.stats && data.stats instanceof fs.Stats) { - task = this._updateQueueTaskWithStats(task, data.stats); - if (task) { - if (data.stats.size) { - this._fsEntriesTotalBytes += data.stats.size; - } - - this._queue.push(task); - } - } else { - this._statQueue.push(task); - } -}; - -/** - * Internal logic for `finalize`. - * - * @private - * @return void - */ -Archiver.prototype._finalize = function() { - if (this._state.finalizing || this._state.finalized || this._state.aborted) { - return; - } - - this._state.finalizing = true; - - this._moduleFinalize(); - - this._state.finalizing = false; - this._state.finalized = true; -}; - -/** - * Checks the various state variables to determine if we can `finalize`. - * - * @private - * @return {Boolean} - */ -Archiver.prototype._maybeFinalize = function() { - if (this._state.finalizing || this._state.finalized || this._state.aborted) { - return false; - } - - if (this._state.finalize && this._pending === 0 && this._queue.idle() && this._statQueue.idle()) { - this._finalize(); - return true; - } - - return false; -}; - -/** - * Appends an entry to the module. - * - * @private - * @fires Archiver#entry - * @param {(Buffer|Stream)} source - * @param {EntryData} data - * @param {Function} callback - * @return void - */ -Archiver.prototype._moduleAppend = function(source, data, callback) { - if (this._state.aborted) { - callback(); - return; - } - - this._module.append(source, data, function(err) { - this._task = null; - - if (this._state.aborted) { - this._shutdown(); - return; - } - - if (err) { - this.emit('error', err); - setImmediate(callback); - return; - } - - /** - * Fires when the entry's input has been processed and appended to the archive. - * - * @event Archiver#entry - * @type {EntryData} - */ - this.emit('entry', data); - this._entriesProcessedCount++; - - if (data.stats && data.stats.size) { - this._fsEntriesProcessedBytes += data.stats.size; - } - - /** - * @event Archiver#progress - * @type {ProgressData} - */ - this.emit('progress', { - entries: { - total: this._entriesCount, - processed: this._entriesProcessedCount - }, - fs: { - totalBytes: this._fsEntriesTotalBytes, - processedBytes: this._fsEntriesProcessedBytes - } - }); - - setImmediate(callback); - }.bind(this)); -}; - -/** - * Finalizes the module. - * - * @private - * @return void - */ -Archiver.prototype._moduleFinalize = function() { - if (typeof this._module.finalize === 'function') { - this._module.finalize(); - } else if (typeof this._module.end === 'function') { - this._module.end(); - } else { - this.emit('error', new ArchiverError('NOENDMETHOD')); - return; - } -}; - -/** - * Pipes the module to our internal stream with error bubbling. - * - * @private - * @return void - */ -Archiver.prototype._modulePipe = function() { - this._module.on('error', this._onModuleError.bind(this)); - this._module.pipe(this); - this._state.modulePiped = true; -}; - -/** - * Determines if the current module supports a defined feature. - * - * @private - * @param {String} key - * @return {Boolean} - */ -Archiver.prototype._moduleSupports = function(key) { - if (!this._module.supports || !this._module.supports[key]) { - return false; - } - - return this._module.supports[key]; -}; - -/** - * Unpipes the module from our internal stream. - * - * @private - * @return void - */ -Archiver.prototype._moduleUnpipe = function() { - this._module.unpipe(this); - this._state.modulePiped = false; -}; - -/** - * Normalizes entry data with fallbacks for key properties. - * - * @private - * @param {Object} data - * @param {fs.Stats} stats - * @return {Object} - */ -Archiver.prototype._normalizeEntryData = function(data, stats) { - data = util.defaults(data, { - type: 'file', - name: null, - date: null, - mode: null, - prefix: null, - sourcePath: null, - stats: false - }); - - if (stats && data.stats === false) { - data.stats = stats; - } - - var isDir = data.type === 'directory'; - - if (data.name) { - if (typeof data.prefix === 'string' && '' !== data.prefix) { - data.name = data.prefix + '/' + data.name; - data.prefix = null; - } - - data.name = util.sanitizePath(data.name); - - if (data.type !== 'symlink' && data.name.slice(-1) === '/') { - isDir = true; - data.type = 'directory'; - } else if (isDir) { - data.name += '/'; - } - } - - // 511 === 0777; 493 === 0755; 438 === 0666; 420 === 0644 - if (typeof data.mode === 'number') { - if (win32) { - data.mode &= 511; - } else { - data.mode &= 4095 - } - } else if (data.stats && data.mode === null) { - if (win32) { - data.mode = data.stats.mode & 511; - } else { - data.mode = data.stats.mode & 4095; - } - - // stat isn't reliable on windows; force 0755 for dir - if (win32 && isDir) { - data.mode = 493; - } - } else if (data.mode === null) { - data.mode = isDir ? 493 : 420; - } - - if (data.stats && data.date === null) { - data.date = data.stats.mtime; - } else { - data.date = util.dateify(data.date); - } - - return data; -}; - -/** - * Error listener that re-emits error on to our internal stream. - * - * @private - * @param {Error} err - * @return void - */ -Archiver.prototype._onModuleError = function(err) { - /** - * @event Archiver#error - * @type {ErrorData} - */ - this.emit('error', err); -}; - -/** - * Checks the various state variables after queue has drained to determine if - * we need to `finalize`. - * - * @private - * @return void - */ -Archiver.prototype._onQueueDrain = function() { - if (this._state.finalizing || this._state.finalized || this._state.aborted) { - return; - } - - if (this._state.finalize && this._pending === 0 && this._queue.idle() && this._statQueue.idle()) { - this._finalize(); - return; - } -}; - -/** - * Appends each queue task to the module. - * - * @private - * @param {Object} task - * @param {Function} callback - * @return void - */ -Archiver.prototype._onQueueTask = function(task, callback) { - if (this._state.finalizing || this._state.finalized || this._state.aborted) { - callback(); - return; - } - - this._task = task; - this._moduleAppend(task.source, task.data, callback); -}; - -/** - * Performs a file stat and reinjects the task back into the queue. - * - * @private - * @param {Object} task - * @param {Function} callback - * @return void - */ -Archiver.prototype._onStatQueueTask = function(task, callback) { - if (this._state.finalizing || this._state.finalized || this._state.aborted) { - callback(); - return; - } - - fs.lstat(task.filepath, function(err, stats) { - if (this._state.aborted) { - setImmediate(callback); - return; - } - - if (err) { - this._entriesCount--; - - /** - * @event Archiver#warning - * @type {ErrorData} - */ - this.emit('warning', err); - setImmediate(callback); - return; - } - - task = this._updateQueueTaskWithStats(task, stats); - - if (task) { - if (stats.size) { - this._fsEntriesTotalBytes += stats.size; - } - - this._queue.push(task); - } - - setImmediate(callback); - }.bind(this)); -}; - -/** - * Unpipes the module and ends our internal stream. - * - * @private - * @return void - */ -Archiver.prototype._shutdown = function() { - this._moduleUnpipe(); - this.end(); -}; - -/** - * Tracks the bytes emitted by our internal stream. - * - * @private - * @param {Buffer} chunk - * @param {String} encoding - * @param {Function} callback - * @return void - */ -Archiver.prototype._transform = function(chunk, encoding, callback) { - if (chunk) { - this._pointer += chunk.length; - } - - callback(null, chunk); -}; - -/** - * Updates and normalizes a queue task using stats data. - * - * @private - * @param {Object} task - * @param {fs.Stats} stats - * @return {Object} - */ -Archiver.prototype._updateQueueTaskWithStats = function(task, stats) { - if (stats.isFile()) { - task.data.type = 'file'; - task.data.sourceType = 'stream'; - task.source = util.lazyReadStream(task.filepath); - } else if (stats.isDirectory() && this._moduleSupports('directory')) { - task.data.name = util.trailingSlashIt(task.data.name); - task.data.type = 'directory'; - task.data.sourcePath = util.trailingSlashIt(task.filepath); - task.data.sourceType = 'buffer'; - task.source = new Buffer(0); - } else if (stats.isSymbolicLink() && this._moduleSupports('symlink')) { - var linkPath = fs.readlinkSync(task.filepath); - var dirName = path.dirname(task.filepath); - task.data.type = 'symlink'; - task.data.linkname = path.relative(dirName, path.resolve(dirName, linkPath)); - task.data.sourceType = 'buffer'; - task.source = new Buffer(0); - } else { - if (stats.isDirectory()) { - this.emit('warning', new ArchiverError('DIRECTORYNOTSUPPORTED', task.data)); - } else if (stats.isSymbolicLink()) { - this.emit('warning', new ArchiverError('SYMLINKNOTSUPPORTED', task.data)); - } else { - this.emit('warning', new ArchiverError('ENTRYNOTSUPPORTED', task.data)); - } - - return null; - } - - task.data = this._normalizeEntryData(task.data, stats); - - return task; -}; - -/** - * Aborts the archiving process, taking a best-effort approach, by: - * - * - removing any pending queue tasks - * - allowing any active queue workers to finish - * - detaching internal module pipes - * - ending both sides of the Transform stream - * - * It will NOT drain any remaining sources. - * - * @return {this} - */ -Archiver.prototype.abort = function() { - if (this._state.aborted || this._state.finalized) { - return this; - } - - this._abort(); - - return this; -}; - -/** - * Appends an input source (text string, buffer, or stream) to the instance. - * - * When the instance has received, processed, and emitted the input, the `entry` - * event is fired. - * - * @fires Archiver#entry - * @param {(Buffer|Stream|String)} source The input source. - * @param {EntryData} data See also {@link ZipEntryData} and {@link TarEntryData}. - * @return {this} - */ -Archiver.prototype.append = function(source, data) { - if (this._state.finalize || this._state.aborted) { - this.emit('error', new ArchiverError('QUEUECLOSED')); - return this; - } - - data = this._normalizeEntryData(data); - - if (typeof data.name !== 'string' || data.name.length === 0) { - this.emit('error', new ArchiverError('ENTRYNAMEREQUIRED')); - return this; - } - - if (data.type === 'directory' && !this._moduleSupports('directory')) { - this.emit('error', new ArchiverError('DIRECTORYNOTSUPPORTED', { name: data.name })); - return this; - } - - source = util.normalizeInputSource(source); - - if (Buffer.isBuffer(source)) { - data.sourceType = 'buffer'; - } else if (util.isStream(source)) { - data.sourceType = 'stream'; - } else { - this.emit('error', new ArchiverError('INPUTSTEAMBUFFERREQUIRED', { name: data.name })); - return this; - } - - this._entriesCount++; - this._queue.push({ - data: data, - source: source - }); - - return this; -}; - -/** - * Appends a directory and its files, recursively, given its dirpath. - * - * @param {String} dirpath The source directory path. - * @param {String} destpath The destination path within the archive. - * @param {(EntryData|Function)} data See also [ZipEntryData]{@link ZipEntryData} and - * [TarEntryData]{@link TarEntryData}. - * @return {this} - */ -Archiver.prototype.directory = function(dirpath, destpath, data) { - if (this._state.finalize || this._state.aborted) { - this.emit('error', new ArchiverError('QUEUECLOSED')); - return this; - } - - if (typeof dirpath !== 'string' || dirpath.length === 0) { - this.emit('error', new ArchiverError('DIRECTORYDIRPATHREQUIRED')); - return this; - } - - this._pending++; - - if (destpath === false) { - destpath = ''; - } else if (typeof destpath !== 'string'){ - destpath = dirpath; - } - - var dataFunction = false; - if (typeof data === 'function') { - dataFunction = data; - data = {}; - } else if (typeof data !== 'object') { - data = {}; - } - - var globOptions = { - stat: false, - dot: true, - cwd: dirpath - }; - - function onGlobEnd() { - this._pending--; - this._maybeFinalize(); - } - - function onGlobError(err) { - this.emit('error', err); - } - - function onGlobMatch(match){ - var ignoreMatch = false; - var entryData = _.extend({}, data); - entryData.name = match; - entryData.prefix = destpath; - match = globber._makeAbs(match); - - try { - if (dataFunction) { - entryData = dataFunction(entryData); - - if (entryData === false) { - ignoreMatch = true; - } else if (typeof entryData !== 'object') { - throw new ArchiverError('DIRECTORYFUNCTIONINVALIDDATA', { dirpath: dirpath }); - } - } - } catch(e) { - this.emit('error', e); - return; - } - - if (ignoreMatch) { - return; - } - - this._append(match, entryData); - } - - var globber = glob('**', globOptions); - globber.on('error', onGlobError.bind(this)); - globber.on('match', onGlobMatch.bind(this)); - globber.on('end', onGlobEnd.bind(this)); - - return this; -}; - -/** - * Appends a file given its filepath using a - * [lazystream]{@link https://github.com/jpommerening/node-lazystream} wrapper to - * prevent issues with open file limits. - * - * When the instance has received, processed, and emitted the file, the `entry` - * event is fired. - * - * @param {String} filepath The source filepath. - * @param {EntryData} data See also [ZipEntryData]{@link ZipEntryData} and - * [TarEntryData]{@link TarEntryData}. - * @return {this} - */ -Archiver.prototype.file = function(filepath, data) { - if (this._state.finalize || this._state.aborted) { - this.emit('error', new ArchiverError('QUEUECLOSED')); - return this; - } - - if (typeof filepath !== 'string' || filepath.length === 0) { - this.emit('error', new ArchiverError('FILEFILEPATHREQUIRED')); - return this; - } - - this._append(filepath, data); - - return this; -}; - -/** - * Appends multiple files that match a glob pattern. - * - * @param {String} pattern The [glob pattern]{@link https://github.com/isaacs/node-glob#glob-primer} to match. - * @param {Object} options See [node-glob]{@link https://github.com/isaacs/node-glob#options}. - * @param {EntryData} data See also [ZipEntryData]{@link ZipEntryData} and - * [TarEntryData]{@link TarEntryData}. - * @return {this} - */ -Archiver.prototype.glob = function(pattern, options, data) { - this._pending++; - - options = util.defaults(options, { - stat: false - }); - - function onGlobEnd() { - this._pending--; - this._maybeFinalize(); - } - - function onGlobError(err) { - this.emit('error', err); - } - - function onGlobMatch(match){ - var entryData = _.extend({}, data); - - if (options.cwd) { - entryData.name = match; - match = globber._makeAbs(match); - } - - this._append(match, entryData); - } - - var globber = glob(pattern, options); - globber.on('error', onGlobError.bind(this)); - globber.on('match', onGlobMatch.bind(this)); - globber.on('end', onGlobEnd.bind(this)); - - return this; -}; - -/** - * Finalizes the instance and prevents further appending to the archive - * structure (queue will continue til drained). - * - * The `end`, `close` or `finish` events on the destination stream may fire - * right after calling this method so you should set listeners beforehand to - * properly detect stream completion. - * - * @return {this} - */ -Archiver.prototype.finalize = function() { - if (this._state.aborted) { - this.emit('error', new ArchiverError('ABORTED')); - return this; - } - - if (this._state.finalize) { - this.emit('error', new ArchiverError('FINALIZING')); - return this; - } - - this._state.finalize = true; - - if (this._pending === 0 && this._queue.idle() && this._statQueue.idle()) { - this._finalize(); - } - - var self = this; - - return new Promise(function(resolve, reject) { - var errored; - - self._module.on('end', function() { - if (!errored) { - resolve(); - } - }) - - self._module.on('error', function(err) { - errored = true; - reject(err); - }) - }) -}; - -/** - * Sets the module format name used for archiving. - * - * @param {String} format The name of the format. - * @return {this} - */ -Archiver.prototype.setFormat = function(format) { - if (this._format) { - this.emit('error', new ArchiverError('FORMATSET')); - return this; - } - - this._format = format; - - return this; -}; - -/** - * Sets the module used for archiving. - * - * @param {Function} module The function for archiver to interact with. - * @return {this} - */ -Archiver.prototype.setModule = function(module) { - if (this._state.aborted) { - this.emit('error', new ArchiverError('ABORTED')); - return this; - } - - if (this._state.module) { - this.emit('error', new ArchiverError('MODULESET')); - return this; - } - - this._module = module; - this._modulePipe(); - - return this; -}; - -/** - * Appends a symlink to the instance. - * - * This does NOT interact with filesystem and is used for programmatically creating symlinks. - * - * @param {String} filepath The symlink path (within archive). - * @param {String} target The target path (within archive). - * @return {this} - */ -Archiver.prototype.symlink = function(filepath, target) { - if (this._state.finalize || this._state.aborted) { - this.emit('error', new ArchiverError('QUEUECLOSED')); - return this; - } - - if (typeof filepath !== 'string' || filepath.length === 0) { - this.emit('error', new ArchiverError('SYMLINKFILEPATHREQUIRED')); - return this; - } - - if (typeof target !== 'string' || target.length === 0) { - this.emit('error', new ArchiverError('SYMLINKTARGETREQUIRED', { filepath: filepath })); - return this; - } - - if (!this._moduleSupports('symlink')) { - this.emit('error', new ArchiverError('SYMLINKNOTSUPPORTED', { filepath: filepath })); - return this; - } - - var data = {}; - data.type = 'symlink'; - data.name = filepath.replace(/\\/g, '/'); - data.linkname = target.replace(/\\/g, '/'); - data.sourceType = 'buffer'; - - this._entriesCount++; - this._queue.push({ - data: data, - source: new Buffer(0) - }); - - return this; -}; - -/** - * Returns the current length (in bytes) that has been emitted. - * - * @return {Number} - */ -Archiver.prototype.pointer = function() { - return this._pointer; -}; - -/** - * Middleware-like helper that has yet to be fully implemented. - * - * @private - * @param {Function} plugin - * @return {this} - */ -Archiver.prototype.use = function(plugin) { - this._streams.push(plugin); - return this; -}; - -module.exports = Archiver; - -/** - * @typedef {Object} CoreOptions - * @global - * @property {Number} [statConcurrency=4] Sets the number of workers used to - * process the internal fs stat queue. - */ - -/** - * @typedef {Object} TransformOptions - * @property {Boolean} [allowHalfOpen=true] If set to false, then the stream - * will automatically end the readable side when the writable side ends and vice - * versa. - * @property {Boolean} [readableObjectMode=false] Sets objectMode for readable - * side of the stream. Has no effect if objectMode is true. - * @property {Boolean} [writableObjectMode=false] Sets objectMode for writable - * side of the stream. Has no effect if objectMode is true. - * @property {Boolean} [decodeStrings=true] Whether or not to decode strings - * into Buffers before passing them to _write(). `Writable` - * @property {String} [encoding=NULL] If specified, then buffers will be decoded - * to strings using the specified encoding. `Readable` - * @property {Number} [highWaterMark=16kb] The maximum number of bytes to store - * in the internal buffer before ceasing to read from the underlying resource. - * `Readable` `Writable` - * @property {Boolean} [objectMode=false] Whether this stream should behave as a - * stream of objects. Meaning that stream.read(n) returns a single value instead - * of a Buffer of size n. `Readable` `Writable` - */ - -/** - * @typedef {Object} EntryData - * @property {String} name Sets the entry name including internal path. - * @property {(String|Date)} [date=NOW()] Sets the entry date. - * @property {Number} [mode=D:0755/F:0644] Sets the entry permissions. - * @property {String} [prefix] Sets a path prefix for the entry name. Useful - * when working with methods like `directory` or `glob`. - * @property {fs.Stats} [stats] Sets the fs stat data for this entry allowing - * for reduction of fs stat calls when stat data is already known. - */ - -/** - * @typedef {Object} ErrorData - * @property {String} message The message of the error. - * @property {String} code The error code assigned to this error. - * @property {String} data Additional data provided for reporting or debugging (where available). - */ - -/** - * @typedef {Object} ProgressData - * @property {Object} entries - * @property {Number} entries.total Number of entries that have been appended. - * @property {Number} entries.processed Number of entries that have been processed. - * @property {Object} fs - * @property {Number} fs.totalBytes Number of bytes that have been appended. Calculated asynchronously and might not be accurate: it growth while entries are added. (based on fs.Stats) - * @property {Number} fs.processedBytes Number of bytes that have been processed. (based on fs.Stats) - */ +/** + * Archiver Core + * + * @ignore + * @license [MIT]{@link https://github.com/archiverjs/node-archiver/blob/master/LICENSE} + * @copyright (c) 2012-2014 Chris Talkington, contributors. + */ +var fs = require('fs'); +var glob = require('glob'); +var async = require('async'); +var _ = require('lodash'); +var path = require('path'); +var util = require('archiver-utils'); + +var inherits = require('util').inherits; +var ArchiverError = require('./error'); +var Transform = require('readable-stream').Transform; + +var win32 = process.platform === 'win32'; + +/** + * @constructor + * @param {String} format The archive format to use. + * @param {(CoreOptions|TransformOptions)} options See also {@link ZipOptions} and {@link TarOptions}. + */ +var Archiver = function(format, options) { + if (!(this instanceof Archiver)) { + return new Archiver(format, options); + } + + if (typeof format !== 'string') { + options = format; + format = 'zip'; + } + + options = this.options = util.defaults(options, { + highWaterMark: 1024 * 1024, + statConcurrency: 4 + }); + + Transform.call(this, options); + + this._format = false; + this._module = false; + this._pending = 0; + this._pointer = 0; + + this._entriesCount = 0; + this._entriesProcessedCount = 0; + this._fsEntriesTotalBytes = 0; + this._fsEntriesProcessedBytes = 0; + + this._queue = async.queue(this._onQueueTask.bind(this), 1); + this._queue.drain = this._onQueueDrain.bind(this); + + this._statQueue = async.queue(this._onStatQueueTask.bind(this), options.statConcurrency); + + this._state = { + aborted: false, + finalize: false, + finalizing: false, + finalized: false, + modulePiped: false + }; + + this._streams = []; +}; + +inherits(Archiver, Transform); + +/** + * Internal logic for `abort`. + * + * @private + * @return void + */ +Archiver.prototype._abort = function() { + this._state.aborted = true; + this._queue.kill(); + this._statQueue.kill(); + + if (this._queue.idle()) { + this._shutdown(); + } +}; + +/** + * Internal helper for appending files. + * + * @private + * @param {String} filepath The source filepath. + * @param {EntryData} data The entry data. + * @return void + */ +Archiver.prototype._append = function(filepath, data) { + data = data || {}; + + var task = { + source: null, + filepath: filepath + }; + + if (!data.name) { + data.name = filepath; + } + + data.sourcePath = filepath; + task.data = data; + this._entriesCount++; + + if (data.stats && data.stats instanceof fs.Stats) { + task = this._updateQueueTaskWithStats(task, data.stats); + if (task) { + if (data.stats.size) { + this._fsEntriesTotalBytes += data.stats.size; + } + + this._queue.push(task); + } + } else { + this._statQueue.push(task); + } +}; + +/** + * Internal logic for `finalize`. + * + * @private + * @return void + */ +Archiver.prototype._finalize = function() { + if (this._state.finalizing || this._state.finalized || this._state.aborted) { + return; + } + + this._state.finalizing = true; + + this._moduleFinalize(); + + this._state.finalizing = false; + this._state.finalized = true; +}; + +/** + * Checks the various state variables to determine if we can `finalize`. + * + * @private + * @return {Boolean} + */ +Archiver.prototype._maybeFinalize = function() { + if (this._state.finalizing || this._state.finalized || this._state.aborted) { + return false; + } + + if (this._state.finalize && this._pending === 0 && this._queue.idle() && this._statQueue.idle()) { + this._finalize(); + return true; + } + + return false; +}; + +/** + * Appends an entry to the module. + * + * @private + * @fires Archiver#entry + * @param {(Buffer|Stream)} source + * @param {EntryData} data + * @param {Function} callback + * @return void + */ +Archiver.prototype._moduleAppend = function(source, data, callback) { + if (this._state.aborted) { + callback(); + return; + } + + this._module.append(source, data, function(err) { + this._task = null; + + if (this._state.aborted) { + this._shutdown(); + return; + } + + if (err) { + this.emit('error', err); + setImmediate(callback); + return; + } + + /** + * Fires when the entry's input has been processed and appended to the archive. + * + * @event Archiver#entry + * @type {EntryData} + */ + this.emit('entry', data); + this._entriesProcessedCount++; + + if (data.stats && data.stats.size) { + this._fsEntriesProcessedBytes += data.stats.size; + } + + /** + * @event Archiver#progress + * @type {ProgressData} + */ + this.emit('progress', { + entries: { + total: this._entriesCount, + processed: this._entriesProcessedCount + }, + fs: { + totalBytes: this._fsEntriesTotalBytes, + processedBytes: this._fsEntriesProcessedBytes + } + }); + + setImmediate(callback); + }.bind(this)); +}; + +/** + * Finalizes the module. + * + * @private + * @return void + */ +Archiver.prototype._moduleFinalize = function() { + if (typeof this._module.finalize === 'function') { + this._module.finalize(); + } else if (typeof this._module.end === 'function') { + this._module.end(); + } else { + this.emit('error', new ArchiverError('NOENDMETHOD')); + return; + } +}; + +/** + * Pipes the module to our internal stream with error bubbling. + * + * @private + * @return void + */ +Archiver.prototype._modulePipe = function() { + this._module.on('error', this._onModuleError.bind(this)); + this._module.pipe(this); + this._state.modulePiped = true; +}; + +/** + * Determines if the current module supports a defined feature. + * + * @private + * @param {String} key + * @return {Boolean} + */ +Archiver.prototype._moduleSupports = function(key) { + if (!this._module.supports || !this._module.supports[key]) { + return false; + } + + return this._module.supports[key]; +}; + +/** + * Unpipes the module from our internal stream. + * + * @private + * @return void + */ +Archiver.prototype._moduleUnpipe = function() { + this._module.unpipe(this); + this._state.modulePiped = false; +}; + +/** + * Normalizes entry data with fallbacks for key properties. + * + * @private + * @param {Object} data + * @param {fs.Stats} stats + * @return {Object} + */ +Archiver.prototype._normalizeEntryData = function(data, stats) { + data = util.defaults(data, { + type: 'file', + name: null, + date: null, + mode: null, + prefix: null, + sourcePath: null, + stats: false + }); + + if (stats && data.stats === false) { + data.stats = stats; + } + + var isDir = data.type === 'directory'; + + if (data.name) { + if (typeof data.prefix === 'string' && '' !== data.prefix) { + data.name = data.prefix + '/' + data.name; + data.prefix = null; + } + + data.name = util.sanitizePath(data.name); + + if (data.type !== 'symlink' && data.name.slice(-1) === '/') { + isDir = true; + data.type = 'directory'; + } else if (isDir) { + data.name += '/'; + } + } + + // 511 === 0777; 493 === 0755; 438 === 0666; 420 === 0644 + if (typeof data.mode === 'number') { + if (win32) { + data.mode &= 511; + } else { + data.mode &= 4095 + } + } else if (data.stats && data.mode === null) { + if (win32) { + data.mode = data.stats.mode & 511; + } else { + data.mode = data.stats.mode & 4095; + } + + // stat isn't reliable on windows; force 0755 for dir + if (win32 && isDir) { + data.mode = 493; + } + } else if (data.mode === null) { + data.mode = isDir ? 493 : 420; + } + + if (data.stats && data.date === null) { + data.date = data.stats.mtime; + } else { + data.date = util.dateify(data.date); + } + + return data; +}; + +/** + * Error listener that re-emits error on to our internal stream. + * + * @private + * @param {Error} err + * @return void + */ +Archiver.prototype._onModuleError = function(err) { + /** + * @event Archiver#error + * @type {ErrorData} + */ + this.emit('error', err); +}; + +/** + * Checks the various state variables after queue has drained to determine if + * we need to `finalize`. + * + * @private + * @return void + */ +Archiver.prototype._onQueueDrain = function() { + if (this._state.finalizing || this._state.finalized || this._state.aborted) { + return; + } + + if (this._state.finalize && this._pending === 0 && this._queue.idle() && this._statQueue.idle()) { + this._finalize(); + return; + } +}; + +/** + * Appends each queue task to the module. + * + * @private + * @param {Object} task + * @param {Function} callback + * @return void + */ +Archiver.prototype._onQueueTask = function(task, callback) { + if (this._state.finalizing || this._state.finalized || this._state.aborted) { + callback(); + return; + } + + this._task = task; + this._moduleAppend(task.source, task.data, callback); +}; + +/** + * Performs a file stat and reinjects the task back into the queue. + * + * @private + * @param {Object} task + * @param {Function} callback + * @return void + */ +Archiver.prototype._onStatQueueTask = function(task, callback) { + if (this._state.finalizing || this._state.finalized || this._state.aborted) { + callback(); + return; + } + + fs.lstat(task.filepath, function(err, stats) { + if (this._state.aborted) { + setImmediate(callback); + return; + } + + if (err) { + this._entriesCount--; + + /** + * @event Archiver#warning + * @type {ErrorData} + */ + this.emit('warning', err); + setImmediate(callback); + return; + } + + task = this._updateQueueTaskWithStats(task, stats); + + if (task) { + if (stats.size) { + this._fsEntriesTotalBytes += stats.size; + } + + this._queue.push(task); + } + + setImmediate(callback); + }.bind(this)); +}; + +/** + * Unpipes the module and ends our internal stream. + * + * @private + * @return void + */ +Archiver.prototype._shutdown = function() { + this._moduleUnpipe(); + this.end(); +}; + +/** + * Tracks the bytes emitted by our internal stream. + * + * @private + * @param {Buffer} chunk + * @param {String} encoding + * @param {Function} callback + * @return void + */ +Archiver.prototype._transform = function(chunk, encoding, callback) { + if (chunk) { + this._pointer += chunk.length; + } + + callback(null, chunk); +}; + +/** + * Updates and normalizes a queue task using stats data. + * + * @private + * @param {Object} task + * @param {fs.Stats} stats + * @return {Object} + */ +Archiver.prototype._updateQueueTaskWithStats = function(task, stats) { + if (stats.isFile()) { + task.data.type = 'file'; + task.data.sourceType = 'stream'; + task.source = util.lazyReadStream(task.filepath); + } else if (stats.isDirectory() && this._moduleSupports('directory')) { + task.data.name = util.trailingSlashIt(task.data.name); + task.data.type = 'directory'; + task.data.sourcePath = util.trailingSlashIt(task.filepath); + task.data.sourceType = 'buffer'; + task.source = new Buffer(0); + } else if (stats.isSymbolicLink() && this._moduleSupports('symlink')) { + var linkPath = fs.readlinkSync(task.filepath); + var dirName = path.dirname(task.filepath); + task.data.type = 'symlink'; + task.data.linkname = path.relative(dirName, path.resolve(dirName, linkPath)); + task.data.sourceType = 'buffer'; + task.source = new Buffer(0); + } else { + if (stats.isDirectory()) { + this.emit('warning', new ArchiverError('DIRECTORYNOTSUPPORTED', task.data)); + } else if (stats.isSymbolicLink()) { + this.emit('warning', new ArchiverError('SYMLINKNOTSUPPORTED', task.data)); + } else { + this.emit('warning', new ArchiverError('ENTRYNOTSUPPORTED', task.data)); + } + + return null; + } + + task.data = this._normalizeEntryData(task.data, stats); + + return task; +}; + +/** + * Aborts the archiving process, taking a best-effort approach, by: + * + * - removing any pending queue tasks + * - allowing any active queue workers to finish + * - detaching internal module pipes + * - ending both sides of the Transform stream + * + * It will NOT drain any remaining sources. + * + * @return {this} + */ +Archiver.prototype.abort = function() { + if (this._state.aborted || this._state.finalized) { + return this; + } + + this._abort(); + + return this; +}; + +/** + * Appends an input source (text string, buffer, or stream) to the instance. + * + * When the instance has received, processed, and emitted the input, the `entry` + * event is fired. + * + * @fires Archiver#entry + * @param {(Buffer|Stream|String)} source The input source. + * @param {EntryData} data See also {@link ZipEntryData} and {@link TarEntryData}. + * @return {this} + */ +Archiver.prototype.append = function(source, data) { + if (this._state.finalize || this._state.aborted) { + this.emit('error', new ArchiverError('QUEUECLOSED')); + return this; + } + + data = this._normalizeEntryData(data); + + if (typeof data.name !== 'string' || data.name.length === 0) { + this.emit('error', new ArchiverError('ENTRYNAMEREQUIRED')); + return this; + } + + if (data.type === 'directory' && !this._moduleSupports('directory')) { + this.emit('error', new ArchiverError('DIRECTORYNOTSUPPORTED', { name: data.name })); + return this; + } + + source = util.normalizeInputSource(source); + + if (Buffer.isBuffer(source)) { + data.sourceType = 'buffer'; + } else if (util.isStream(source)) { + data.sourceType = 'stream'; + } else { + this.emit('error', new ArchiverError('INPUTSTEAMBUFFERREQUIRED', { name: data.name })); + return this; + } + + this._entriesCount++; + this._queue.push({ + data: data, + source: source + }); + + return this; +}; + +/** + * Appends a directory and its files, recursively, given its dirpath. + * + * @param {String} dirpath The source directory path. + * @param {String} destpath The destination path within the archive. + * @param {(EntryData|Function)} data See also [ZipEntryData]{@link ZipEntryData} and + * [TarEntryData]{@link TarEntryData}. + * @return {this} + */ +Archiver.prototype.directory = function(dirpath, destpath, data) { + if (this._state.finalize || this._state.aborted) { + this.emit('error', new ArchiverError('QUEUECLOSED')); + return this; + } + + if (typeof dirpath !== 'string' || dirpath.length === 0) { + this.emit('error', new ArchiverError('DIRECTORYDIRPATHREQUIRED')); + return this; + } + + this._pending++; + + if (destpath === false) { + destpath = ''; + } else if (typeof destpath !== 'string'){ + destpath = dirpath; + } + + var dataFunction = false; + if (typeof data === 'function') { + dataFunction = data; + data = {}; + } else if (typeof data !== 'object') { + data = {}; + } + + var globOptions = { + stat: false, + dot: true, + cwd: dirpath + }; + + function onGlobEnd() { + this._pending--; + this._maybeFinalize(); + } + + function onGlobError(err) { + this.emit('error', err); + } + + function onGlobMatch(match){ + var ignoreMatch = false; + var entryData = _.extend({}, data); + entryData.name = match; + entryData.prefix = destpath; + match = globber._makeAbs(match); + + try { + if (dataFunction) { + entryData = dataFunction(entryData); + + if (entryData === false) { + ignoreMatch = true; + } else if (typeof entryData !== 'object') { + throw new ArchiverError('DIRECTORYFUNCTIONINVALIDDATA', { dirpath: dirpath }); + } + } + } catch(e) { + this.emit('error', e); + return; + } + + if (ignoreMatch) { + return; + } + + this._append(match, entryData); + } + + var globber = glob('**', globOptions); + globber.on('error', onGlobError.bind(this)); + globber.on('match', onGlobMatch.bind(this)); + globber.on('end', onGlobEnd.bind(this)); + + return this; +}; + +/** + * Appends a file given its filepath using a + * [lazystream]{@link https://github.com/jpommerening/node-lazystream} wrapper to + * prevent issues with open file limits. + * + * When the instance has received, processed, and emitted the file, the `entry` + * event is fired. + * + * @param {String} filepath The source filepath. + * @param {EntryData} data See also [ZipEntryData]{@link ZipEntryData} and + * [TarEntryData]{@link TarEntryData}. + * @return {this} + */ +Archiver.prototype.file = function(filepath, data) { + if (this._state.finalize || this._state.aborted) { + this.emit('error', new ArchiverError('QUEUECLOSED')); + return this; + } + + if (typeof filepath !== 'string' || filepath.length === 0) { + this.emit('error', new ArchiverError('FILEFILEPATHREQUIRED')); + return this; + } + + this._append(filepath, data); + + return this; +}; + +/** + * Appends multiple files that match a glob pattern. + * + * @param {String} pattern The [glob pattern]{@link https://github.com/isaacs/node-glob#glob-primer} to match. + * @param {Object} options See [node-glob]{@link https://github.com/isaacs/node-glob#options}. + * @param {EntryData} data See also [ZipEntryData]{@link ZipEntryData} and + * [TarEntryData]{@link TarEntryData}. + * @return {this} + */ +Archiver.prototype.glob = function(pattern, options, data) { + this._pending++; + + options = util.defaults(options, { + stat: false + }); + + function onGlobEnd() { + this._pending--; + this._maybeFinalize(); + } + + function onGlobError(err) { + this.emit('error', err); + } + + function onGlobMatch(match){ + var entryData = _.extend({}, data); + + if (options.cwd) { + entryData.name = match; + match = globber._makeAbs(match); + } + + this._append(match, entryData); + } + + var globber = glob(pattern, options); + globber.on('error', onGlobError.bind(this)); + globber.on('match', onGlobMatch.bind(this)); + globber.on('end', onGlobEnd.bind(this)); + + return this; +}; + +/** + * Finalizes the instance and prevents further appending to the archive + * structure (queue will continue til drained). + * + * The `end`, `close` or `finish` events on the destination stream may fire + * right after calling this method so you should set listeners beforehand to + * properly detect stream completion. + * + * @return {this} + */ +Archiver.prototype.finalize = function() { + if (this._state.aborted) { + this.emit('error', new ArchiverError('ABORTED')); + return this; + } + + if (this._state.finalize) { + this.emit('error', new ArchiverError('FINALIZING')); + return this; + } + + this._state.finalize = true; + + if (this._pending === 0 && this._queue.idle() && this._statQueue.idle()) { + this._finalize(); + } + + var self = this; + + return new Promise(function(resolve, reject) { + var errored; + + self._module.on('end', function() { + if (!errored) { + resolve(); + } + }) + + self._module.on('error', function(err) { + errored = true; + reject(err); + }) + }) +}; + +/** + * Sets the module format name used for archiving. + * + * @param {String} format The name of the format. + * @return {this} + */ +Archiver.prototype.setFormat = function(format) { + if (this._format) { + this.emit('error', new ArchiverError('FORMATSET')); + return this; + } + + this._format = format; + + return this; +}; + +/** + * Sets the module used for archiving. + * + * @param {Function} module The function for archiver to interact with. + * @return {this} + */ +Archiver.prototype.setModule = function(module) { + if (this._state.aborted) { + this.emit('error', new ArchiverError('ABORTED')); + return this; + } + + if (this._state.module) { + this.emit('error', new ArchiverError('MODULESET')); + return this; + } + + this._module = module; + this._modulePipe(); + + return this; +}; + +/** + * Appends a symlink to the instance. + * + * This does NOT interact with filesystem and is used for programmatically creating symlinks. + * + * @param {String} filepath The symlink path (within archive). + * @param {String} target The target path (within archive). + * @return {this} + */ +Archiver.prototype.symlink = function(filepath, target) { + if (this._state.finalize || this._state.aborted) { + this.emit('error', new ArchiverError('QUEUECLOSED')); + return this; + } + + if (typeof filepath !== 'string' || filepath.length === 0) { + this.emit('error', new ArchiverError('SYMLINKFILEPATHREQUIRED')); + return this; + } + + if (typeof target !== 'string' || target.length === 0) { + this.emit('error', new ArchiverError('SYMLINKTARGETREQUIRED', { filepath: filepath })); + return this; + } + + if (!this._moduleSupports('symlink')) { + this.emit('error', new ArchiverError('SYMLINKNOTSUPPORTED', { filepath: filepath })); + return this; + } + + var data = {}; + data.type = 'symlink'; + data.name = filepath.replace(/\\/g, '/'); + data.linkname = target.replace(/\\/g, '/'); + data.sourceType = 'buffer'; + + this._entriesCount++; + this._queue.push({ + data: data, + source: new Buffer(0) + }); + + return this; +}; + +/** + * Returns the current length (in bytes) that has been emitted. + * + * @return {Number} + */ +Archiver.prototype.pointer = function() { + return this._pointer; +}; + +/** + * Middleware-like helper that has yet to be fully implemented. + * + * @private + * @param {Function} plugin + * @return {this} + */ +Archiver.prototype.use = function(plugin) { + this._streams.push(plugin); + return this; +}; + +module.exports = Archiver; + +/** + * @typedef {Object} CoreOptions + * @global + * @property {Number} [statConcurrency=4] Sets the number of workers used to + * process the internal fs stat queue. + */ + +/** + * @typedef {Object} TransformOptions + * @property {Boolean} [allowHalfOpen=true] If set to false, then the stream + * will automatically end the readable side when the writable side ends and vice + * versa. + * @property {Boolean} [readableObjectMode=false] Sets objectMode for readable + * side of the stream. Has no effect if objectMode is true. + * @property {Boolean} [writableObjectMode=false] Sets objectMode for writable + * side of the stream. Has no effect if objectMode is true. + * @property {Boolean} [decodeStrings=true] Whether or not to decode strings + * into Buffers before passing them to _write(). `Writable` + * @property {String} [encoding=NULL] If specified, then buffers will be decoded + * to strings using the specified encoding. `Readable` + * @property {Number} [highWaterMark=16kb] The maximum number of bytes to store + * in the internal buffer before ceasing to read from the underlying resource. + * `Readable` `Writable` + * @property {Boolean} [objectMode=false] Whether this stream should behave as a + * stream of objects. Meaning that stream.read(n) returns a single value instead + * of a Buffer of size n. `Readable` `Writable` + */ + +/** + * @typedef {Object} EntryData + * @property {String} name Sets the entry name including internal path. + * @property {(String|Date)} [date=NOW()] Sets the entry date. + * @property {Number} [mode=D:0755/F:0644] Sets the entry permissions. + * @property {String} [prefix] Sets a path prefix for the entry name. Useful + * when working with methods like `directory` or `glob`. + * @property {fs.Stats} [stats] Sets the fs stat data for this entry allowing + * for reduction of fs stat calls when stat data is already known. + */ + +/** + * @typedef {Object} ErrorData + * @property {String} message The message of the error. + * @property {String} code The error code assigned to this error. + * @property {String} data Additional data provided for reporting or debugging (where available). + */ + +/** + * @typedef {Object} ProgressData + * @property {Object} entries + * @property {Number} entries.total Number of entries that have been appended. + * @property {Number} entries.processed Number of entries that have been processed. + * @property {Object} fs + * @property {Number} fs.totalBytes Number of bytes that have been appended. Calculated asynchronously and might not be accurate: it growth while entries are added. (based on fs.Stats) + * @property {Number} fs.processedBytes Number of bytes that have been processed. (based on fs.Stats) + */ diff --git a/node_modules/archiver/lib/error.js b/node_modules/archiver/lib/error.js index 6bcb0ae1a..381cf8612 100644 --- a/node_modules/archiver/lib/error.js +++ b/node_modules/archiver/lib/error.js @@ -1,40 +1,40 @@ -/** - * Archiver Core - * - * @ignore - * @license [MIT]{@link https://github.com/archiverjs/node-archiver/blob/master/LICENSE} - * @copyright (c) 2012-2014 Chris Talkington, contributors. - */ - -var util = require('util'); - -const ERROR_CODES = { - 'ABORTED': 'archive was aborted', - 'DIRECTORYDIRPATHREQUIRED': 'diretory dirpath argument must be a non-empty string value', - 'DIRECTORYFUNCTIONINVALIDDATA': 'invalid data returned by directory custom data function', - 'ENTRYNAMEREQUIRED': 'entry name must be a non-empty string value', - 'FILEFILEPATHREQUIRED': 'file filepath argument must be a non-empty string value', - 'FINALIZING': 'archive already finalizing', - 'QUEUECLOSED': 'queue closed', - 'NOENDMETHOD': 'no suitable finalize/end method defined by module', - 'DIRECTORYNOTSUPPORTED': 'support for directory entries not defined by module', - 'FORMATSET': 'archive format already set', - 'INPUTSTEAMBUFFERREQUIRED': 'input source must be valid Stream or Buffer instance', - 'MODULESET': 'module already set', - 'SYMLINKNOTSUPPORTED': 'support for symlink entries not defined by module', - 'SYMLINKFILEPATHREQUIRED': 'symlink filepath argument must be a non-empty string value', - 'SYMLINKTARGETREQUIRED': 'symlink target argument must be a non-empty string value', - 'ENTRYNOTSUPPORTED': 'entry not supported' -}; - -function ArchiverError(code, data) { - Error.captureStackTrace(this, this.constructor); - //this.name = this.constructor.name; - this.message = ERROR_CODES[code] || code; - this.code = code; - this.data = data; -} - -util.inherits(ArchiverError, Error); - +/** + * Archiver Core + * + * @ignore + * @license [MIT]{@link https://github.com/archiverjs/node-archiver/blob/master/LICENSE} + * @copyright (c) 2012-2014 Chris Talkington, contributors. + */ + +var util = require('util'); + +const ERROR_CODES = { + 'ABORTED': 'archive was aborted', + 'DIRECTORYDIRPATHREQUIRED': 'diretory dirpath argument must be a non-empty string value', + 'DIRECTORYFUNCTIONINVALIDDATA': 'invalid data returned by directory custom data function', + 'ENTRYNAMEREQUIRED': 'entry name must be a non-empty string value', + 'FILEFILEPATHREQUIRED': 'file filepath argument must be a non-empty string value', + 'FINALIZING': 'archive already finalizing', + 'QUEUECLOSED': 'queue closed', + 'NOENDMETHOD': 'no suitable finalize/end method defined by module', + 'DIRECTORYNOTSUPPORTED': 'support for directory entries not defined by module', + 'FORMATSET': 'archive format already set', + 'INPUTSTEAMBUFFERREQUIRED': 'input source must be valid Stream or Buffer instance', + 'MODULESET': 'module already set', + 'SYMLINKNOTSUPPORTED': 'support for symlink entries not defined by module', + 'SYMLINKFILEPATHREQUIRED': 'symlink filepath argument must be a non-empty string value', + 'SYMLINKTARGETREQUIRED': 'symlink target argument must be a non-empty string value', + 'ENTRYNOTSUPPORTED': 'entry not supported' +}; + +function ArchiverError(code, data) { + Error.captureStackTrace(this, this.constructor); + //this.name = this.constructor.name; + this.message = ERROR_CODES[code] || code; + this.code = code; + this.data = data; +} + +util.inherits(ArchiverError, Error); + exports = module.exports = ArchiverError; \ No newline at end of file diff --git a/node_modules/archiver/lib/plugins/json.js b/node_modules/archiver/lib/plugins/json.js index caf63de94..c8dce444d 100644 --- a/node_modules/archiver/lib/plugins/json.js +++ b/node_modules/archiver/lib/plugins/json.js @@ -1,110 +1,110 @@ -/** - * JSON Format Plugin - * - * @module plugins/json - * @license [MIT]{@link https://github.com/archiverjs/node-archiver/blob/master/LICENSE} - * @copyright (c) 2012-2014 Chris Talkington, contributors. - */ -var inherits = require('util').inherits; -var Transform = require('readable-stream').Transform; - -var crc32 = require('buffer-crc32'); -var util = require('archiver-utils'); - -/** - * @constructor - * @param {(JsonOptions|TransformOptions)} options - */ -var Json = function(options) { - if (!(this instanceof Json)) { - return new Json(options); - } - - options = this.options = util.defaults(options, {}); - - Transform.call(this, options); - - this.supports = { - directory: true, - symlink: true - }; - - this.files = []; -}; - -inherits(Json, Transform); - -/** - * [_transform description] - * - * @private - * @param {Buffer} chunk - * @param {String} encoding - * @param {Function} callback - * @return void - */ -Json.prototype._transform = function(chunk, encoding, callback) { - callback(null, chunk); -}; - -/** - * [_writeStringified description] - * - * @private - * @return void - */ -Json.prototype._writeStringified = function() { - var fileString = JSON.stringify(this.files); - this.write(fileString); -}; - -/** - * [append description] - * - * @param {(Buffer|Stream)} source - * @param {EntryData} data - * @param {Function} callback - * @return void - */ -Json.prototype.append = function(source, data, callback) { - var self = this; - - data.crc32 = 0; - - function onend(err, sourceBuffer) { - if (err) { - callback(err); - return; - } - - data.size = sourceBuffer.length || 0; - data.crc32 = crc32.unsigned(sourceBuffer); - - self.files.push(data); - - callback(null, data); - } - - if (data.sourceType === 'buffer') { - onend(null, source); - } else if (data.sourceType === 'stream') { - util.collectStream(source, onend); - } -}; - -/** - * [finalize description] - * - * @return void - */ -Json.prototype.finalize = function() { - this._writeStringified(); - this.end(); -}; - -module.exports = Json; - -/** - * @typedef {Object} JsonOptions - * @global - */ +/** + * JSON Format Plugin + * + * @module plugins/json + * @license [MIT]{@link https://github.com/archiverjs/node-archiver/blob/master/LICENSE} + * @copyright (c) 2012-2014 Chris Talkington, contributors. + */ +var inherits = require('util').inherits; +var Transform = require('readable-stream').Transform; + +var crc32 = require('buffer-crc32'); +var util = require('archiver-utils'); + +/** + * @constructor + * @param {(JsonOptions|TransformOptions)} options + */ +var Json = function(options) { + if (!(this instanceof Json)) { + return new Json(options); + } + + options = this.options = util.defaults(options, {}); + + Transform.call(this, options); + + this.supports = { + directory: true, + symlink: true + }; + + this.files = []; +}; + +inherits(Json, Transform); + +/** + * [_transform description] + * + * @private + * @param {Buffer} chunk + * @param {String} encoding + * @param {Function} callback + * @return void + */ +Json.prototype._transform = function(chunk, encoding, callback) { + callback(null, chunk); +}; + +/** + * [_writeStringified description] + * + * @private + * @return void + */ +Json.prototype._writeStringified = function() { + var fileString = JSON.stringify(this.files); + this.write(fileString); +}; + +/** + * [append description] + * + * @param {(Buffer|Stream)} source + * @param {EntryData} data + * @param {Function} callback + * @return void + */ +Json.prototype.append = function(source, data, callback) { + var self = this; + + data.crc32 = 0; + + function onend(err, sourceBuffer) { + if (err) { + callback(err); + return; + } + + data.size = sourceBuffer.length || 0; + data.crc32 = crc32.unsigned(sourceBuffer); + + self.files.push(data); + + callback(null, data); + } + + if (data.sourceType === 'buffer') { + onend(null, source); + } else if (data.sourceType === 'stream') { + util.collectStream(source, onend); + } +}; + +/** + * [finalize description] + * + * @return void + */ +Json.prototype.finalize = function() { + this._writeStringified(); + this.end(); +}; + +module.exports = Json; + +/** + * @typedef {Object} JsonOptions + * @global + */ diff --git a/node_modules/archiver/lib/plugins/tar.js b/node_modules/archiver/lib/plugins/tar.js index 41e70b9cb..36885a098 100644 --- a/node_modules/archiver/lib/plugins/tar.js +++ b/node_modules/archiver/lib/plugins/tar.js @@ -1,167 +1,167 @@ -/** - * TAR Format Plugin - * - * @module plugins/tar - * @license [MIT]{@link https://github.com/archiverjs/node-archiver/blob/master/LICENSE} - * @copyright (c) 2012-2014 Chris Talkington, contributors. - */ -var zlib = require('zlib'); - -var engine = require('tar-stream'); -var util = require('archiver-utils'); - -/** - * @constructor - * @param {TarOptions} options - */ -var Tar = function(options) { - if (!(this instanceof Tar)) { - return new Tar(options); - } - - options = this.options = util.defaults(options, { - gzip: false - }); - - if (typeof options.gzipOptions !== 'object') { - options.gzipOptions = {}; - } - - this.supports = { - directory: true, - symlink: true - }; - - this.engine = engine.pack(options); - this.compressor = false; - - if (options.gzip) { - this.compressor = zlib.createGzip(options.gzipOptions); - this.compressor.on('error', this._onCompressorError.bind(this)); - } -}; - -/** - * [_onCompressorError description] - * - * @private - * @param {Error} err - * @return void - */ -Tar.prototype._onCompressorError = function(err) { - this.engine.emit('error', err); -}; - -/** - * [append description] - * - * @param {(Buffer|Stream)} source - * @param {TarEntryData} data - * @param {Function} callback - * @return void - */ -Tar.prototype.append = function(source, data, callback) { - var self = this; - - data.mtime = data.date; - - function append(err, sourceBuffer) { - if (err) { - callback(err); - return; - } - - self.engine.entry(data, sourceBuffer, function(err) { - callback(err, data); - }); - } - - if (data.sourceType === 'buffer') { - append(null, source); - } else if (data.sourceType === 'stream' && data._stats) { - data.size = data._stats.size; - - var entry = self.engine.entry(data, function(err) { - callback(err, data); - }); - - source.pipe(entry); - } else if (data.sourceType === 'stream') { - util.collectStream(source, append); - } -}; - -/** - * [finalize description] - * - * @return void - */ -Tar.prototype.finalize = function() { - this.engine.finalize(); -}; - -/** - * [on description] - * - * @return this.engine - */ -Tar.prototype.on = function() { - return this.engine.on.apply(this.engine, arguments); -}; - -/** - * [pipe description] - * - * @param {String} destination - * @param {Object} options - * @return this.engine - */ -Tar.prototype.pipe = function(destination, options) { - if (this.compressor) { - return this.engine.pipe.apply(this.engine, [this.compressor]).pipe(destination, options); - } else { - return this.engine.pipe.apply(this.engine, arguments); - } -}; - -/** - * [unpipe description] - * - * @return this.engine - */ -Tar.prototype.unpipe = function() { - if (this.compressor) { - return this.compressor.unpipe.apply(this.compressor, arguments); - } else { - return this.engine.unpipe.apply(this.engine, arguments); - } -}; - -module.exports = Tar; - -/** - * @typedef {Object} TarOptions - * @global - * @property {Boolean} [gzip=false] Compress the tar archive using gzip. - * @property {Object} [gzipOptions] Passed to [zlib]{@link https://nodejs.org/api/zlib.html#zlib_class_options} - * to control compression. - * @property {*} [*] See [tar-stream]{@link https://github.com/mafintosh/tar-stream} documentation for additional properties. - */ - -/** - * @typedef {Object} TarEntryData - * @global - * @property {String} name Sets the entry name including internal path. - * @property {(String|Date)} [date=NOW()] Sets the entry date. - * @property {Number} [mode=D:0755/F:0644] Sets the entry permissions. - * @property {String} [prefix] Sets a path prefix for the entry name. Useful - * when working with methods like `directory` or `glob`. - * @property {fs.Stats} [stats] Sets the fs stat data for this entry allowing - * for reduction of fs stat calls when stat data is already known. - */ - -/** - * TarStream Module - * @external TarStream - * @see {@link https://github.com/mafintosh/tar-stream} - */ +/** + * TAR Format Plugin + * + * @module plugins/tar + * @license [MIT]{@link https://github.com/archiverjs/node-archiver/blob/master/LICENSE} + * @copyright (c) 2012-2014 Chris Talkington, contributors. + */ +var zlib = require('zlib'); + +var engine = require('tar-stream'); +var util = require('archiver-utils'); + +/** + * @constructor + * @param {TarOptions} options + */ +var Tar = function(options) { + if (!(this instanceof Tar)) { + return new Tar(options); + } + + options = this.options = util.defaults(options, { + gzip: false + }); + + if (typeof options.gzipOptions !== 'object') { + options.gzipOptions = {}; + } + + this.supports = { + directory: true, + symlink: true + }; + + this.engine = engine.pack(options); + this.compressor = false; + + if (options.gzip) { + this.compressor = zlib.createGzip(options.gzipOptions); + this.compressor.on('error', this._onCompressorError.bind(this)); + } +}; + +/** + * [_onCompressorError description] + * + * @private + * @param {Error} err + * @return void + */ +Tar.prototype._onCompressorError = function(err) { + this.engine.emit('error', err); +}; + +/** + * [append description] + * + * @param {(Buffer|Stream)} source + * @param {TarEntryData} data + * @param {Function} callback + * @return void + */ +Tar.prototype.append = function(source, data, callback) { + var self = this; + + data.mtime = data.date; + + function append(err, sourceBuffer) { + if (err) { + callback(err); + return; + } + + self.engine.entry(data, sourceBuffer, function(err) { + callback(err, data); + }); + } + + if (data.sourceType === 'buffer') { + append(null, source); + } else if (data.sourceType === 'stream' && data._stats) { + data.size = data._stats.size; + + var entry = self.engine.entry(data, function(err) { + callback(err, data); + }); + + source.pipe(entry); + } else if (data.sourceType === 'stream') { + util.collectStream(source, append); + } +}; + +/** + * [finalize description] + * + * @return void + */ +Tar.prototype.finalize = function() { + this.engine.finalize(); +}; + +/** + * [on description] + * + * @return this.engine + */ +Tar.prototype.on = function() { + return this.engine.on.apply(this.engine, arguments); +}; + +/** + * [pipe description] + * + * @param {String} destination + * @param {Object} options + * @return this.engine + */ +Tar.prototype.pipe = function(destination, options) { + if (this.compressor) { + return this.engine.pipe.apply(this.engine, [this.compressor]).pipe(destination, options); + } else { + return this.engine.pipe.apply(this.engine, arguments); + } +}; + +/** + * [unpipe description] + * + * @return this.engine + */ +Tar.prototype.unpipe = function() { + if (this.compressor) { + return this.compressor.unpipe.apply(this.compressor, arguments); + } else { + return this.engine.unpipe.apply(this.engine, arguments); + } +}; + +module.exports = Tar; + +/** + * @typedef {Object} TarOptions + * @global + * @property {Boolean} [gzip=false] Compress the tar archive using gzip. + * @property {Object} [gzipOptions] Passed to [zlib]{@link https://nodejs.org/api/zlib.html#zlib_class_options} + * to control compression. + * @property {*} [*] See [tar-stream]{@link https://github.com/mafintosh/tar-stream} documentation for additional properties. + */ + +/** + * @typedef {Object} TarEntryData + * @global + * @property {String} name Sets the entry name including internal path. + * @property {(String|Date)} [date=NOW()] Sets the entry date. + * @property {Number} [mode=D:0755/F:0644] Sets the entry permissions. + * @property {String} [prefix] Sets a path prefix for the entry name. Useful + * when working with methods like `directory` or `glob`. + * @property {fs.Stats} [stats] Sets the fs stat data for this entry allowing + * for reduction of fs stat calls when stat data is already known. + */ + +/** + * TarStream Module + * @external TarStream + * @see {@link https://github.com/mafintosh/tar-stream} + */ diff --git a/node_modules/archiver/lib/plugins/zip.js b/node_modules/archiver/lib/plugins/zip.js index 2474ed70e..c1c46f915 100644 --- a/node_modules/archiver/lib/plugins/zip.js +++ b/node_modules/archiver/lib/plugins/zip.js @@ -1,116 +1,116 @@ -/** - * ZIP Format Plugin - * - * @module plugins/zip - * @license [MIT]{@link https://github.com/archiverjs/node-archiver/blob/master/LICENSE} - * @copyright (c) 2012-2014 Chris Talkington, contributors. - */ -var engine = require('zip-stream'); -var util = require('archiver-utils'); - -/** - * @constructor - * @param {ZipOptions} [options] - * @param {String} [options.comment] Sets the zip archive comment. - * @param {Boolean} [options.forceLocalTime=false] Forces the archive to contain local file times instead of UTC. - * @param {Boolean} [options.forceZip64=false] Forces the archive to contain ZIP64 headers. - * @param {Boolean} [options.store=false] Sets the compression method to STORE. - * @param {Object} [options.zlib] Passed to [zlib]{@link https://nodejs.org/api/zlib.html#zlib_class_options} - */ -var Zip = function(options) { - if (!(this instanceof Zip)) { - return new Zip(options); - } - - options = this.options = util.defaults(options, { - comment: '', - forceUTC: false, - store: false - }); - - this.supports = { - directory: true, - symlink: true - }; - - this.engine = new engine(options); -}; - -/** - * @param {(Buffer|Stream)} source - * @param {ZipEntryData} data - * @param {String} data.name Sets the entry name including internal path. - * @param {(String|Date)} [data.date=NOW()] Sets the entry date. - * @param {Number} [data.mode=D:0755/F:0644] Sets the entry permissions. - * @param {String} [data.prefix] Sets a path prefix for the entry name. Useful - * when working with methods like `directory` or `glob`. - * @param {fs.Stats} [data.stats] Sets the fs stat data for this entry allowing - * for reduction of fs stat calls when stat data is already known. - * @param {Boolean} [data.store=ZipOptions.store] Sets the compression method to STORE. - * @param {Function} callback - * @return void - */ -Zip.prototype.append = function(source, data, callback) { - this.engine.entry(source, data, callback); -}; - -/** - * @return void - */ -Zip.prototype.finalize = function() { - this.engine.finalize(); -}; - -/** - * @return this.engine - */ -Zip.prototype.on = function() { - return this.engine.on.apply(this.engine, arguments); -}; - -/** - * @return this.engine - */ -Zip.prototype.pipe = function() { - return this.engine.pipe.apply(this.engine, arguments); -}; - -/** - * @return this.engine - */ -Zip.prototype.unpipe = function() { - return this.engine.unpipe.apply(this.engine, arguments); -}; - -module.exports = Zip; - -/** - * @typedef {Object} ZipOptions - * @global - * @property {String} [comment] Sets the zip archive comment. - * @property {Boolean} [forceLocalTime=false] Forces the archive to contain local file times instead of UTC. - * @property {Boolean} [forceZip64=false] Forces the archive to contain ZIP64 headers. - * @property {Boolean} [store=false] Sets the compression method to STORE. - * @property {Object} [zlib] Passed to [zlib]{@link https://nodejs.org/api/zlib.html#zlib_class_options} - * to control compression. - * @property {*} [*] See [zip-stream]{@link https://archiverjs.com/zip-stream/ZipStream.html} documentation for current list of properties. - */ - -/** - * @typedef {Object} ZipEntryData - * @global - * @property {String} name Sets the entry name including internal path. - * @property {(String|Date)} [date=NOW()] Sets the entry date. - * @property {Number} [mode=D:0755/F:0644] Sets the entry permissions. - * @property {String} [prefix] Sets a path prefix for the entry name. Useful - * when working with methods like `directory` or `glob`. - * @property {fs.Stats} [stats] Sets the fs stat data for this entry allowing - * for reduction of fs stat calls when stat data is already known. - * @property {Boolean} [store=ZipOptions.store] Sets the compression method to STORE. - */ - -/** - * ZipStream Module - * @external ZipStream - * @see {@link https://archiverjs.com/zip-stream/ZipStream.html} - */ +/** + * ZIP Format Plugin + * + * @module plugins/zip + * @license [MIT]{@link https://github.com/archiverjs/node-archiver/blob/master/LICENSE} + * @copyright (c) 2012-2014 Chris Talkington, contributors. + */ +var engine = require('zip-stream'); +var util = require('archiver-utils'); + +/** + * @constructor + * @param {ZipOptions} [options] + * @param {String} [options.comment] Sets the zip archive comment. + * @param {Boolean} [options.forceLocalTime=false] Forces the archive to contain local file times instead of UTC. + * @param {Boolean} [options.forceZip64=false] Forces the archive to contain ZIP64 headers. + * @param {Boolean} [options.store=false] Sets the compression method to STORE. + * @param {Object} [options.zlib] Passed to [zlib]{@link https://nodejs.org/api/zlib.html#zlib_class_options} + */ +var Zip = function(options) { + if (!(this instanceof Zip)) { + return new Zip(options); + } + + options = this.options = util.defaults(options, { + comment: '', + forceUTC: false, + store: false + }); + + this.supports = { + directory: true, + symlink: true + }; + + this.engine = new engine(options); +}; + +/** + * @param {(Buffer|Stream)} source + * @param {ZipEntryData} data + * @param {String} data.name Sets the entry name including internal path. + * @param {(String|Date)} [data.date=NOW()] Sets the entry date. + * @param {Number} [data.mode=D:0755/F:0644] Sets the entry permissions. + * @param {String} [data.prefix] Sets a path prefix for the entry name. Useful + * when working with methods like `directory` or `glob`. + * @param {fs.Stats} [data.stats] Sets the fs stat data for this entry allowing + * for reduction of fs stat calls when stat data is already known. + * @param {Boolean} [data.store=ZipOptions.store] Sets the compression method to STORE. + * @param {Function} callback + * @return void + */ +Zip.prototype.append = function(source, data, callback) { + this.engine.entry(source, data, callback); +}; + +/** + * @return void + */ +Zip.prototype.finalize = function() { + this.engine.finalize(); +}; + +/** + * @return this.engine + */ +Zip.prototype.on = function() { + return this.engine.on.apply(this.engine, arguments); +}; + +/** + * @return this.engine + */ +Zip.prototype.pipe = function() { + return this.engine.pipe.apply(this.engine, arguments); +}; + +/** + * @return this.engine + */ +Zip.prototype.unpipe = function() { + return this.engine.unpipe.apply(this.engine, arguments); +}; + +module.exports = Zip; + +/** + * @typedef {Object} ZipOptions + * @global + * @property {String} [comment] Sets the zip archive comment. + * @property {Boolean} [forceLocalTime=false] Forces the archive to contain local file times instead of UTC. + * @property {Boolean} [forceZip64=false] Forces the archive to contain ZIP64 headers. + * @property {Boolean} [store=false] Sets the compression method to STORE. + * @property {Object} [zlib] Passed to [zlib]{@link https://nodejs.org/api/zlib.html#zlib_class_options} + * to control compression. + * @property {*} [*] See [zip-stream]{@link https://archiverjs.com/zip-stream/ZipStream.html} documentation for current list of properties. + */ + +/** + * @typedef {Object} ZipEntryData + * @global + * @property {String} name Sets the entry name including internal path. + * @property {(String|Date)} [date=NOW()] Sets the entry date. + * @property {Number} [mode=D:0755/F:0644] Sets the entry permissions. + * @property {String} [prefix] Sets a path prefix for the entry name. Useful + * when working with methods like `directory` or `glob`. + * @property {fs.Stats} [stats] Sets the fs stat data for this entry allowing + * for reduction of fs stat calls when stat data is already known. + * @property {Boolean} [store=ZipOptions.store] Sets the compression method to STORE. + */ + +/** + * ZipStream Module + * @external ZipStream + * @see {@link https://archiverjs.com/zip-stream/ZipStream.html} + */ diff --git a/node_modules/archiver/package.json b/node_modules/archiver/package.json index d74df4ded..06abff2d1 100644 --- a/node_modules/archiver/package.json +++ b/node_modules/archiver/package.json @@ -1,66 +1,62 @@ -{ - "name": "archiver", - "version": "2.1.1", - "description": "a streaming interface for archive generation", - "homepage": "https://github.com/archiverjs/node-archiver", - "author": { - "name": "Chris Talkington", - "url": "http://christalkington.com/" - }, - "repository": { - "type": "git", - "url": "https://github.com/archiverjs/node-archiver.git" - }, - "bugs": { - "url": "https://github.com/archiverjs/node-archiver/issues" - }, - "license": "MIT", - "main": "index.js", - "files": [ - "index.js", - "lib" - ], - "engines": { - "node": ">= 4" - }, - "scripts": { - "test": "mocha --reporter dot", - "jsdoc": "jsdoc -c jsdoc.json README.md", - "bench": "node benchmark/simple/pack-zip.js" - }, - "dependencies": { - "archiver-utils": "^1.3.0", - "async": "^2.0.0", - "buffer-crc32": "^0.2.1", - "glob": "^7.0.0", - "lodash": "^4.8.0", - "readable-stream": "^2.0.0", - "tar-stream": "^1.5.0", - "zip-stream": "^1.2.0" - }, - "devDependencies": { - "archiver-jsdoc-theme": "^1.0.0", - "jsdoc": "~3.4.0", - "chai": "^4.0.0", - "mocha": "^3.1.1", - "rimraf": "^2.4.2", - "mkdirp": "^0.5.0", - "stream-bench": "^0.1.2", - "tar": "^3.1.0", - "yauzl": "^2.3.1" - }, - "keywords": [ - "archive", - "archiver", - "stream", - "zip", - "tar" - ], - "publishConfig": { - "registry": "https://registry.npmjs.org/" - } - -,"_resolved": "https://registry.npmjs.org/archiver/-/archiver-2.1.1.tgz" -,"_integrity": "sha1-/2YrSnggFJSj7lRNOjP+dJZQnrw=" -,"_from": "archiver@2.1.1" -} \ No newline at end of file +{ + "name": "archiver", + "version": "2.1.1", + "description": "a streaming interface for archive generation", + "homepage": "https://github.com/archiverjs/node-archiver", + "author": { + "name": "Chris Talkington", + "url": "http://christalkington.com/" + }, + "repository": { + "type": "git", + "url": "https://github.com/archiverjs/node-archiver.git" + }, + "bugs": { + "url": "https://github.com/archiverjs/node-archiver/issues" + }, + "license": "MIT", + "main": "index.js", + "files": [ + "index.js", + "lib" + ], + "engines": { + "node": ">= 4" + }, + "scripts": { + "test": "mocha --reporter dot", + "jsdoc": "jsdoc -c jsdoc.json README.md", + "bench": "node benchmark/simple/pack-zip.js" + }, + "dependencies": { + "archiver-utils": "^1.3.0", + "async": "^2.0.0", + "buffer-crc32": "^0.2.1", + "glob": "^7.0.0", + "lodash": "^4.8.0", + "readable-stream": "^2.0.0", + "tar-stream": "^1.5.0", + "zip-stream": "^1.2.0" + }, + "devDependencies": { + "archiver-jsdoc-theme": "^1.0.0", + "jsdoc": "~3.4.0", + "chai": "^4.0.0", + "mocha": "^3.1.1", + "rimraf": "^2.4.2", + "mkdirp": "^0.5.0", + "stream-bench": "^0.1.2", + "tar": "^3.1.0", + "yauzl": "^2.3.1" + }, + "keywords": [ + "archive", + "archiver", + "stream", + "zip", + "tar" + ], + "publishConfig": { + "registry": "https://registry.npmjs.org/" + } +} diff --git a/node_modules/arr-diff/LICENSE b/node_modules/arr-diff/LICENSE old mode 100644 new mode 100755 diff --git a/node_modules/arr-flatten/LICENSE b/node_modules/arr-flatten/LICENSE old mode 100644 new mode 100755 diff --git a/node_modules/arr-flatten/README.md b/node_modules/arr-flatten/README.md old mode 100644 new mode 100755 diff --git a/node_modules/array-unique/LICENSE b/node_modules/array-unique/LICENSE old mode 100644 new mode 100755 diff --git a/node_modules/array-unique/README.md b/node_modules/array-unique/README.md old mode 100644 new mode 100755 diff --git a/node_modules/atob/bin/atob.js b/node_modules/atob/bin/atob.js old mode 100644 new mode 100755 diff --git a/node_modules/azure-actions-appservice-rest/node_modules/@types/node/LICENSE b/node_modules/azure-actions-appservice-rest/node_modules/@types/node/LICENSE old mode 100644 new mode 100755 diff --git a/node_modules/azure-actions-appservice-rest/node_modules/@types/node/README.md b/node_modules/azure-actions-appservice-rest/node_modules/@types/node/README.md old mode 100644 new mode 100755 index 51b96f3f9..0451206f1 --- a/node_modules/azure-actions-appservice-rest/node_modules/@types/node/README.md +++ b/node_modules/azure-actions-appservice-rest/node_modules/@types/node/README.md @@ -1,16 +1,16 @@ -# Installation -> `npm install --save @types/node` - -# Summary -This package contains type definitions for Node.js (http://nodejs.org/). - -# Details -Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node/v14. - -### Additional Details - * Last updated: Mon, 07 Jun 2021 23:01:26 GMT - * Dependencies: none - * Global values: `Buffer`, `__dirname`, `__filename`, `clearImmediate`, `clearInterval`, `clearTimeout`, `console`, `exports`, `global`, `module`, `process`, `queueMicrotask`, `require`, `setImmediate`, `setInterval`, `setTimeout` - -# Credits -These definitions were written by [Microsoft TypeScript](https://github.com/Microsoft), [DefinitelyTyped](https://github.com/DefinitelyTyped), [Alberto Schiabel](https://github.com/jkomyno), [Alvis HT Tang](https://github.com/alvis), [Andrew Makarov](https://github.com/r3nya), [Benjamin Toueg](https://github.com/btoueg), [Chigozirim C.](https://github.com/smac89), [David Junger](https://github.com/touffy), [Deividas Bakanas](https://github.com/DeividasBakanas), [Eugene Y. Q. Shen](https://github.com/eyqs), [Hannes Magnusson](https://github.com/Hannes-Magnusson-CK), [Hoàng Văn Khải](https://github.com/KSXGitHub), [Huw](https://github.com/hoo29), [Kelvin Jin](https://github.com/kjin), [Klaus Meinhardt](https://github.com/ajafff), [Lishude](https://github.com/islishude), [Mariusz Wiktorczyk](https://github.com/mwiktorczyk), [Mohsen Azimi](https://github.com/mohsen1), [Nicolas Even](https://github.com/n-e), [Nikita Galkin](https://github.com/galkin), [Parambir Singh](https://github.com/parambirs), [Sebastian Silbermann](https://github.com/eps1lon), [Simon Schick](https://github.com/SimonSchick), [Thomas den Hollander](https://github.com/ThomasdenH), [Wilco Bakker](https://github.com/WilcoBakker), [wwwy3y3](https://github.com/wwwy3y3), [Samuel Ainsworth](https://github.com/samuela), [Kyle Uehlein](https://github.com/kuehlein), [Thanik Bhongbhibhat](https://github.com/bhongy), [Marcin Kopacz](https://github.com/chyzwar), [Trivikram Kamat](https://github.com/trivikr), [Minh Son Nguyen](https://github.com/nguymin4), [Junxiao Shi](https://github.com/yoursunny), [Ilia Baryshnikov](https://github.com/qwelias), [ExE Boss](https://github.com/ExE-Boss), [Surasak Chaisurin](https://github.com/Ryan-Willpower), [Piotr Błażejewicz](https://github.com/peterblazejewicz), [Anna Henningsen](https://github.com/addaleax), [Jason Kwok](https://github.com/JasonHK), [Victor Perin](https://github.com/victorperin), [Yongsheng Zhang](https://github.com/ZYSzys), and [Bond](https://github.com/bondz). +# Installation +> `npm install --save @types/node` + +# Summary +This package contains type definitions for Node.js (http://nodejs.org/). + +# Details +Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node/v14. + +### Additional Details + * Last updated: Mon, 07 Jun 2021 23:01:26 GMT + * Dependencies: none + * Global values: `Buffer`, `__dirname`, `__filename`, `clearImmediate`, `clearInterval`, `clearTimeout`, `console`, `exports`, `global`, `module`, `process`, `queueMicrotask`, `require`, `setImmediate`, `setInterval`, `setTimeout` + +# Credits +These definitions were written by [Microsoft TypeScript](https://github.com/Microsoft), [DefinitelyTyped](https://github.com/DefinitelyTyped), [Alberto Schiabel](https://github.com/jkomyno), [Alvis HT Tang](https://github.com/alvis), [Andrew Makarov](https://github.com/r3nya), [Benjamin Toueg](https://github.com/btoueg), [Chigozirim C.](https://github.com/smac89), [David Junger](https://github.com/touffy), [Deividas Bakanas](https://github.com/DeividasBakanas), [Eugene Y. Q. Shen](https://github.com/eyqs), [Hannes Magnusson](https://github.com/Hannes-Magnusson-CK), [Hoàng Văn Khải](https://github.com/KSXGitHub), [Huw](https://github.com/hoo29), [Kelvin Jin](https://github.com/kjin), [Klaus Meinhardt](https://github.com/ajafff), [Lishude](https://github.com/islishude), [Mariusz Wiktorczyk](https://github.com/mwiktorczyk), [Mohsen Azimi](https://github.com/mohsen1), [Nicolas Even](https://github.com/n-e), [Nikita Galkin](https://github.com/galkin), [Parambir Singh](https://github.com/parambirs), [Sebastian Silbermann](https://github.com/eps1lon), [Simon Schick](https://github.com/SimonSchick), [Thomas den Hollander](https://github.com/ThomasdenH), [Wilco Bakker](https://github.com/WilcoBakker), [wwwy3y3](https://github.com/wwwy3y3), [Samuel Ainsworth](https://github.com/samuela), [Kyle Uehlein](https://github.com/kuehlein), [Thanik Bhongbhibhat](https://github.com/bhongy), [Marcin Kopacz](https://github.com/chyzwar), [Trivikram Kamat](https://github.com/trivikr), [Minh Son Nguyen](https://github.com/nguymin4), [Junxiao Shi](https://github.com/yoursunny), [Ilia Baryshnikov](https://github.com/qwelias), [ExE Boss](https://github.com/ExE-Boss), [Surasak Chaisurin](https://github.com/Ryan-Willpower), [Piotr Błażejewicz](https://github.com/peterblazejewicz), [Anna Henningsen](https://github.com/addaleax), [Jason Kwok](https://github.com/JasonHK), [Victor Perin](https://github.com/victorperin), [Yongsheng Zhang](https://github.com/ZYSzys), and [Bond](https://github.com/bondz). diff --git a/node_modules/azure-actions-appservice-rest/node_modules/@types/node/assert.d.ts b/node_modules/azure-actions-appservice-rest/node_modules/@types/node/assert.d.ts old mode 100644 new mode 100755 diff --git a/node_modules/azure-actions-appservice-rest/node_modules/@types/node/async_hooks.d.ts b/node_modules/azure-actions-appservice-rest/node_modules/@types/node/async_hooks.d.ts old mode 100644 new mode 100755 diff --git a/node_modules/azure-actions-appservice-rest/node_modules/@types/node/base.d.ts b/node_modules/azure-actions-appservice-rest/node_modules/@types/node/base.d.ts old mode 100644 new mode 100755 diff --git a/node_modules/azure-actions-appservice-rest/node_modules/@types/node/buffer.d.ts b/node_modules/azure-actions-appservice-rest/node_modules/@types/node/buffer.d.ts old mode 100644 new mode 100755 diff --git a/node_modules/azure-actions-appservice-rest/node_modules/@types/node/child_process.d.ts b/node_modules/azure-actions-appservice-rest/node_modules/@types/node/child_process.d.ts old mode 100644 new mode 100755 diff --git a/node_modules/azure-actions-appservice-rest/node_modules/@types/node/cluster.d.ts b/node_modules/azure-actions-appservice-rest/node_modules/@types/node/cluster.d.ts old mode 100644 new mode 100755 diff --git a/node_modules/azure-actions-appservice-rest/node_modules/@types/node/console.d.ts b/node_modules/azure-actions-appservice-rest/node_modules/@types/node/console.d.ts old mode 100644 new mode 100755 diff --git a/node_modules/azure-actions-appservice-rest/node_modules/@types/node/constants.d.ts b/node_modules/azure-actions-appservice-rest/node_modules/@types/node/constants.d.ts old mode 100644 new mode 100755 diff --git a/node_modules/azure-actions-appservice-rest/node_modules/@types/node/crypto.d.ts b/node_modules/azure-actions-appservice-rest/node_modules/@types/node/crypto.d.ts old mode 100644 new mode 100755 diff --git a/node_modules/azure-actions-appservice-rest/node_modules/@types/node/dgram.d.ts b/node_modules/azure-actions-appservice-rest/node_modules/@types/node/dgram.d.ts old mode 100644 new mode 100755 diff --git a/node_modules/azure-actions-appservice-rest/node_modules/@types/node/dns.d.ts b/node_modules/azure-actions-appservice-rest/node_modules/@types/node/dns.d.ts old mode 100644 new mode 100755 diff --git a/node_modules/azure-actions-appservice-rest/node_modules/@types/node/domain.d.ts b/node_modules/azure-actions-appservice-rest/node_modules/@types/node/domain.d.ts old mode 100644 new mode 100755 diff --git a/node_modules/azure-actions-appservice-rest/node_modules/@types/node/events.d.ts b/node_modules/azure-actions-appservice-rest/node_modules/@types/node/events.d.ts old mode 100644 new mode 100755 diff --git a/node_modules/azure-actions-appservice-rest/node_modules/@types/node/fs.d.ts b/node_modules/azure-actions-appservice-rest/node_modules/@types/node/fs.d.ts old mode 100644 new mode 100755 diff --git a/node_modules/azure-actions-appservice-rest/node_modules/@types/node/fs/promises.d.ts b/node_modules/azure-actions-appservice-rest/node_modules/@types/node/fs/promises.d.ts old mode 100644 new mode 100755 diff --git a/node_modules/azure-actions-appservice-rest/node_modules/@types/node/globals.d.ts b/node_modules/azure-actions-appservice-rest/node_modules/@types/node/globals.d.ts old mode 100644 new mode 100755 diff --git a/node_modules/azure-actions-appservice-rest/node_modules/@types/node/globals.global.d.ts b/node_modules/azure-actions-appservice-rest/node_modules/@types/node/globals.global.d.ts old mode 100644 new mode 100755 diff --git a/node_modules/azure-actions-appservice-rest/node_modules/@types/node/http.d.ts b/node_modules/azure-actions-appservice-rest/node_modules/@types/node/http.d.ts old mode 100644 new mode 100755 diff --git a/node_modules/azure-actions-appservice-rest/node_modules/@types/node/http2.d.ts b/node_modules/azure-actions-appservice-rest/node_modules/@types/node/http2.d.ts old mode 100644 new mode 100755 diff --git a/node_modules/azure-actions-appservice-rest/node_modules/@types/node/https.d.ts b/node_modules/azure-actions-appservice-rest/node_modules/@types/node/https.d.ts old mode 100644 new mode 100755 diff --git a/node_modules/azure-actions-appservice-rest/node_modules/@types/node/index.d.ts b/node_modules/azure-actions-appservice-rest/node_modules/@types/node/index.d.ts old mode 100644 new mode 100755 diff --git a/node_modules/azure-actions-appservice-rest/node_modules/@types/node/inspector.d.ts b/node_modules/azure-actions-appservice-rest/node_modules/@types/node/inspector.d.ts old mode 100644 new mode 100755 diff --git a/node_modules/azure-actions-appservice-rest/node_modules/@types/node/module.d.ts b/node_modules/azure-actions-appservice-rest/node_modules/@types/node/module.d.ts old mode 100644 new mode 100755 diff --git a/node_modules/azure-actions-appservice-rest/node_modules/@types/node/net.d.ts b/node_modules/azure-actions-appservice-rest/node_modules/@types/node/net.d.ts old mode 100644 new mode 100755 diff --git a/node_modules/azure-actions-appservice-rest/node_modules/@types/node/os.d.ts b/node_modules/azure-actions-appservice-rest/node_modules/@types/node/os.d.ts old mode 100644 new mode 100755 diff --git a/node_modules/azure-actions-appservice-rest/node_modules/@types/node/package.json b/node_modules/azure-actions-appservice-rest/node_modules/@types/node/package.json old mode 100644 new mode 100755 diff --git a/node_modules/azure-actions-appservice-rest/node_modules/@types/node/path.d.ts b/node_modules/azure-actions-appservice-rest/node_modules/@types/node/path.d.ts old mode 100644 new mode 100755 diff --git a/node_modules/azure-actions-appservice-rest/node_modules/@types/node/perf_hooks.d.ts b/node_modules/azure-actions-appservice-rest/node_modules/@types/node/perf_hooks.d.ts old mode 100644 new mode 100755 diff --git a/node_modules/azure-actions-appservice-rest/node_modules/@types/node/process.d.ts b/node_modules/azure-actions-appservice-rest/node_modules/@types/node/process.d.ts old mode 100644 new mode 100755 diff --git a/node_modules/azure-actions-appservice-rest/node_modules/@types/node/punycode.d.ts b/node_modules/azure-actions-appservice-rest/node_modules/@types/node/punycode.d.ts old mode 100644 new mode 100755 diff --git a/node_modules/azure-actions-appservice-rest/node_modules/@types/node/querystring.d.ts b/node_modules/azure-actions-appservice-rest/node_modules/@types/node/querystring.d.ts old mode 100644 new mode 100755 diff --git a/node_modules/azure-actions-appservice-rest/node_modules/@types/node/readline.d.ts b/node_modules/azure-actions-appservice-rest/node_modules/@types/node/readline.d.ts old mode 100644 new mode 100755 diff --git a/node_modules/azure-actions-appservice-rest/node_modules/@types/node/repl.d.ts b/node_modules/azure-actions-appservice-rest/node_modules/@types/node/repl.d.ts old mode 100644 new mode 100755 diff --git a/node_modules/azure-actions-appservice-rest/node_modules/@types/node/stream.d.ts b/node_modules/azure-actions-appservice-rest/node_modules/@types/node/stream.d.ts old mode 100644 new mode 100755 diff --git a/node_modules/azure-actions-appservice-rest/node_modules/@types/node/string_decoder.d.ts b/node_modules/azure-actions-appservice-rest/node_modules/@types/node/string_decoder.d.ts old mode 100644 new mode 100755 diff --git a/node_modules/azure-actions-appservice-rest/node_modules/@types/node/timers.d.ts b/node_modules/azure-actions-appservice-rest/node_modules/@types/node/timers.d.ts old mode 100644 new mode 100755 diff --git a/node_modules/azure-actions-appservice-rest/node_modules/@types/node/tls.d.ts b/node_modules/azure-actions-appservice-rest/node_modules/@types/node/tls.d.ts old mode 100644 new mode 100755 diff --git a/node_modules/azure-actions-appservice-rest/node_modules/@types/node/trace_events.d.ts b/node_modules/azure-actions-appservice-rest/node_modules/@types/node/trace_events.d.ts old mode 100644 new mode 100755 diff --git a/node_modules/azure-actions-appservice-rest/node_modules/@types/node/ts3.6/assert.d.ts b/node_modules/azure-actions-appservice-rest/node_modules/@types/node/ts3.6/assert.d.ts old mode 100644 new mode 100755 diff --git a/node_modules/azure-actions-appservice-rest/node_modules/@types/node/ts3.6/base.d.ts b/node_modules/azure-actions-appservice-rest/node_modules/@types/node/ts3.6/base.d.ts old mode 100644 new mode 100755 diff --git a/node_modules/azure-actions-appservice-rest/node_modules/@types/node/ts3.6/index.d.ts b/node_modules/azure-actions-appservice-rest/node_modules/@types/node/ts3.6/index.d.ts old mode 100644 new mode 100755 diff --git a/node_modules/azure-actions-appservice-rest/node_modules/@types/node/tty.d.ts b/node_modules/azure-actions-appservice-rest/node_modules/@types/node/tty.d.ts old mode 100644 new mode 100755 diff --git a/node_modules/azure-actions-appservice-rest/node_modules/@types/node/url.d.ts b/node_modules/azure-actions-appservice-rest/node_modules/@types/node/url.d.ts old mode 100644 new mode 100755 diff --git a/node_modules/azure-actions-appservice-rest/node_modules/@types/node/util.d.ts b/node_modules/azure-actions-appservice-rest/node_modules/@types/node/util.d.ts old mode 100644 new mode 100755 diff --git a/node_modules/azure-actions-appservice-rest/node_modules/@types/node/v8.d.ts b/node_modules/azure-actions-appservice-rest/node_modules/@types/node/v8.d.ts old mode 100644 new mode 100755 diff --git a/node_modules/azure-actions-appservice-rest/node_modules/@types/node/vm.d.ts b/node_modules/azure-actions-appservice-rest/node_modules/@types/node/vm.d.ts old mode 100644 new mode 100755 diff --git a/node_modules/azure-actions-appservice-rest/node_modules/@types/node/wasi.d.ts b/node_modules/azure-actions-appservice-rest/node_modules/@types/node/wasi.d.ts old mode 100644 new mode 100755 diff --git a/node_modules/azure-actions-appservice-rest/node_modules/@types/node/worker_threads.d.ts b/node_modules/azure-actions-appservice-rest/node_modules/@types/node/worker_threads.d.ts old mode 100644 new mode 100755 diff --git a/node_modules/azure-actions-appservice-rest/node_modules/@types/node/zlib.d.ts b/node_modules/azure-actions-appservice-rest/node_modules/@types/node/zlib.d.ts old mode 100644 new mode 100755 diff --git a/node_modules/azure-actions-utility/fileTransformationUtility.d.ts b/node_modules/azure-actions-utility/fileTransformationUtility.d.ts index 06e5e22a4..e3e239f76 100644 --- a/node_modules/azure-actions-utility/fileTransformationUtility.d.ts +++ b/node_modules/azure-actions-utility/fileTransformationUtility.d.ts @@ -1,5 +1,5 @@ -import { PackageType } from './packageUtility'; -export declare class FileTransformUtility { - private static rootDirectoryPath; - static applyTransformations(webPackage: string, parameters: string, packageType: PackageType): Promise; -} +import { PackageType } from './packageUtility'; +export declare class FileTransformUtility { + private static rootDirectoryPath; + static applyTransformations(webPackage: string, parameters: string, packageType: PackageType): Promise; +} diff --git a/node_modules/azure-actions-utility/fileTransformationUtility.js b/node_modules/azure-actions-utility/fileTransformationUtility.js index 1b7a142af..cbe74bc04 100644 --- a/node_modules/azure-actions-utility/fileTransformationUtility.js +++ b/node_modules/azure-actions-utility/fileTransformationUtility.js @@ -1,106 +1,106 @@ -"use strict"; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -Object.defineProperty(exports, "__esModule", { value: true }); -const packageUtility_1 = require("./packageUtility"); -const parameterParserUtility_1 = require("./parameterParserUtility"); -const core = require("@actions/core"); -const fs = require("fs"); -const path = require("path"); -const util = require("util"); -var deployUtility = require('./utility'); -class FileTransformUtility { - static applyTransformations(webPackage, parameters, packageType) { - return __awaiter(this, void 0, void 0, function* () { - console.log("##[debug]WebConfigParameters is " + parameters); - if (parameters) { - var folderPath = yield deployUtility.generateTemporaryFolderForDeployment(false, webPackage, packageType); - if (parameters) { - console.log('##[debug]parsing web.config parameters'); - var webConfigParameters = parameterParserUtility_1.parse(parameters); - addWebConfigFile(folderPath, webConfigParameters, this.rootDirectoryPath); - } - var output = yield deployUtility.archiveFolderForDeployment(false, folderPath); - webPackage = output.webDeployPkg; - } - else { - console.log('##[debug]File Tranformation not enabled'); - } - return webPackage; - }); - } -} -exports.FileTransformUtility = FileTransformUtility; -FileTransformUtility.rootDirectoryPath = "D:\\home\\site\\wwwroot"; -function addWebConfigFile(folderPath, webConfigParameters, rootDirectoryPath) { - //Generate the web.config file if it does not already exist. - var webConfigPath = path.join(folderPath, "web.config"); - if (!packageUtility_1.exist(webConfigPath)) { - try { - // Create web.config - var appType = webConfigParameters['appType'].value; - console.log('##[debug]Generating Web.config file for App type: ' + appType); - delete webConfigParameters['appType']; - var selectedAppTypeParams = addMissingParametersValue(appType, webConfigParameters); - if (appType == 'java_springboot') { - if (util.isNullOrUndefined(webConfigParameters['JAR_PATH']) - || util.isNullOrUndefined(webConfigParameters['JAR_PATH'].value) - || webConfigParameters['JAR_PATH'].value.length <= 0) { - throw Error('Java jar path is not present'); - } - selectedAppTypeParams['JAR_PATH'] = rootDirectoryPath + "\\" + webConfigParameters['JAR_PATH'].value; - } - generateWebConfigFile(webConfigPath, appType, selectedAppTypeParams); - console.log("Successfully generated web.config file"); - } - catch (error) { - throw new Error("Failed to generate web.config. " + error); - } - } - else { - console.log("web.config file already exists. Not generating."); - } -} -function addMissingParametersValue(appType, webConfigParameters) { - var paramDefaultValue = { - 'java_springboot': { - 'JAVA_PATH': '%JAVA_HOME%\\bin\\java.exe', - 'JAR_PATH': '', - 'ADDITIONAL_DEPLOYMENT_OPTIONS': '' - } - }; - var selectedAppTypeParams = paramDefaultValue[appType]; - var resultAppTypeParams = {}; - for (var paramAtttribute in selectedAppTypeParams) { - if (webConfigParameters[paramAtttribute]) { - core.debug("param Attribute'" + paramAtttribute + "' values provided as: " + webConfigParameters[paramAtttribute].value); - resultAppTypeParams[paramAtttribute] = webConfigParameters[paramAtttribute].value; - } - else { - core.debug("param Attribute '" + paramAtttribute + "' is not provided. Overriding the value with '" + selectedAppTypeParams[paramAtttribute] + "'"); - resultAppTypeParams[paramAtttribute] = selectedAppTypeParams[paramAtttribute]; - } - } - return resultAppTypeParams; -} -function generateWebConfigFile(webConfigTargetPath, appType, substitutionParameters) { - // Get the template path for the given appType - var webConfigTemplatePath = path.join(__dirname, './WebConfigTemplates', appType.toLowerCase()); - var webConfigContent = fs.readFileSync(webConfigTemplatePath, 'utf8'); - webConfigContent = replaceMultiple(webConfigContent, substitutionParameters); - fs.writeFileSync(webConfigTargetPath, webConfigContent, { encoding: "utf8" }); -} -function replaceMultiple(text, substitutions) { - for (var key in substitutions) { - core.debug('Replacing: ' + '{' + key + '} with: ' + substitutions[key]); - text = text.replace(new RegExp('{' + key + '}', 'g'), substitutions[key]); - } - return text; -} +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const packageUtility_1 = require("./packageUtility"); +const parameterParserUtility_1 = require("./parameterParserUtility"); +const core = require("@actions/core"); +const fs = require("fs"); +const path = require("path"); +const util = require("util"); +var deployUtility = require('./utility'); +class FileTransformUtility { + static applyTransformations(webPackage, parameters, packageType) { + return __awaiter(this, void 0, void 0, function* () { + console.log("##[debug]WebConfigParameters is " + parameters); + if (parameters) { + var folderPath = yield deployUtility.generateTemporaryFolderForDeployment(false, webPackage, packageType); + if (parameters) { + console.log('##[debug]parsing web.config parameters'); + var webConfigParameters = parameterParserUtility_1.parse(parameters); + addWebConfigFile(folderPath, webConfigParameters, this.rootDirectoryPath); + } + var output = yield deployUtility.archiveFolderForDeployment(false, folderPath); + webPackage = output.webDeployPkg; + } + else { + console.log('##[debug]File Tranformation not enabled'); + } + return webPackage; + }); + } +} +exports.FileTransformUtility = FileTransformUtility; +FileTransformUtility.rootDirectoryPath = "D:\\home\\site\\wwwroot"; +function addWebConfigFile(folderPath, webConfigParameters, rootDirectoryPath) { + //Generate the web.config file if it does not already exist. + var webConfigPath = path.join(folderPath, "web.config"); + if (!packageUtility_1.exist(webConfigPath)) { + try { + // Create web.config + var appType = webConfigParameters['appType'].value; + console.log('##[debug]Generating Web.config file for App type: ' + appType); + delete webConfigParameters['appType']; + var selectedAppTypeParams = addMissingParametersValue(appType, webConfigParameters); + if (appType == 'java_springboot') { + if (util.isNullOrUndefined(webConfigParameters['JAR_PATH']) + || util.isNullOrUndefined(webConfigParameters['JAR_PATH'].value) + || webConfigParameters['JAR_PATH'].value.length <= 0) { + throw Error('Java jar path is not present'); + } + selectedAppTypeParams['JAR_PATH'] = rootDirectoryPath + "\\" + webConfigParameters['JAR_PATH'].value; + } + generateWebConfigFile(webConfigPath, appType, selectedAppTypeParams); + console.log("Successfully generated web.config file"); + } + catch (error) { + throw new Error("Failed to generate web.config. " + error); + } + } + else { + console.log("web.config file already exists. Not generating."); + } +} +function addMissingParametersValue(appType, webConfigParameters) { + var paramDefaultValue = { + 'java_springboot': { + 'JAVA_PATH': '%JAVA_HOME%\\bin\\java.exe', + 'JAR_PATH': '', + 'ADDITIONAL_DEPLOYMENT_OPTIONS': '' + } + }; + var selectedAppTypeParams = paramDefaultValue[appType]; + var resultAppTypeParams = {}; + for (var paramAtttribute in selectedAppTypeParams) { + if (webConfigParameters[paramAtttribute]) { + core.debug("param Attribute'" + paramAtttribute + "' values provided as: " + webConfigParameters[paramAtttribute].value); + resultAppTypeParams[paramAtttribute] = webConfigParameters[paramAtttribute].value; + } + else { + core.debug("param Attribute '" + paramAtttribute + "' is not provided. Overriding the value with '" + selectedAppTypeParams[paramAtttribute] + "'"); + resultAppTypeParams[paramAtttribute] = selectedAppTypeParams[paramAtttribute]; + } + } + return resultAppTypeParams; +} +function generateWebConfigFile(webConfigTargetPath, appType, substitutionParameters) { + // Get the template path for the given appType + var webConfigTemplatePath = path.join(__dirname, './WebConfigTemplates', appType.toLowerCase()); + var webConfigContent = fs.readFileSync(webConfigTemplatePath, 'utf8'); + webConfigContent = replaceMultiple(webConfigContent, substitutionParameters); + fs.writeFileSync(webConfigTargetPath, webConfigContent, { encoding: "utf8" }); +} +function replaceMultiple(text, substitutions) { + for (var key in substitutions) { + core.debug('Replacing: ' + '{' + key + '} with: ' + substitutions[key]); + text = text.replace(new RegExp('{' + key + '}', 'g'), substitutions[key]); + } + return text; +} diff --git a/node_modules/azure-actions-utility/package.json b/node_modules/azure-actions-utility/package.json index 64e507f1f..8663ce083 100644 --- a/node_modules/azure-actions-utility/package.json +++ b/node_modules/azure-actions-utility/package.json @@ -37,8 +37,4 @@ "q": "^1.4.1", "shelljs": "^0.3.0" } - -,"_resolved": "https://registry.npmjs.org/azure-actions-utility/-/azure-actions-utility-1.0.3.tgz" -,"_integrity": "sha512-lLaarW71FBhSEvuN+UEQ4vidLDfcCl67wW6Zu95g+/rgeohRF/5vuVsABLtGmcw7eIjxMoDDfR3SSbBf5rvBKg==" -,"_from": "azure-actions-utility@1.0.3" -} \ No newline at end of file +} diff --git a/node_modules/azure-actions-utility/packageUtility.d.ts b/node_modules/azure-actions-utility/packageUtility.d.ts index 2679c7bd5..89e090e66 100644 --- a/node_modules/azure-actions-utility/packageUtility.d.ts +++ b/node_modules/azure-actions-utility/packageUtility.d.ts @@ -1,19 +1,19 @@ -export declare enum PackageType { - war = 0, - zip = 1, - jar = 2, - folder = 3 -} -export declare class PackageUtility { - static getPackagePath(packagePath: string): string; -} -export declare class Package { - constructor(packagePath: string); - getPath(): string; - isMSBuildPackage(): Promise; - getPackageType(): PackageType; - private _path; - private _isMSBuildPackage?; - private _packageType?; -} -export declare function exist(path: any): boolean; +export declare enum PackageType { + war = 0, + zip = 1, + jar = 2, + folder = 3 +} +export declare class PackageUtility { + static getPackagePath(packagePath: string): string; +} +export declare class Package { + constructor(packagePath: string); + getPath(): string; + isMSBuildPackage(): Promise; + getPackageType(): PackageType; + private _path; + private _isMSBuildPackage?; + private _packageType?; +} +export declare function exist(path: any): boolean; diff --git a/node_modules/azure-actions-utility/packageUtility.js b/node_modules/azure-actions-utility/packageUtility.js index 24c8d9f1e..11a7e9e45 100644 --- a/node_modules/azure-actions-utility/packageUtility.js +++ b/node_modules/azure-actions-utility/packageUtility.js @@ -1,99 +1,99 @@ -"use strict"; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -Object.defineProperty(exports, "__esModule", { value: true }); -const core = require("@actions/core"); -const fs = require("fs"); -const utility = require("./utility"); -const zipUtility = require("./ziputility"); -var PackageType; -(function (PackageType) { - PackageType[PackageType["war"] = 0] = "war"; - PackageType[PackageType["zip"] = 1] = "zip"; - PackageType[PackageType["jar"] = 2] = "jar"; - PackageType[PackageType["folder"] = 3] = "folder"; -})(PackageType = exports.PackageType || (exports.PackageType = {})); -class PackageUtility { - static getPackagePath(packagePath) { - var availablePackages = utility.findfiles(packagePath); - if (availablePackages.length == 0) { - throw new Error('No package found with specified pattern: ' + packagePath); - } - if (availablePackages.length > 1) { - throw new Error('More than one package matched with specified pattern: ' + packagePath + '. Please restrain the search pattern.'); - } - return availablePackages[0]; - } -} -exports.PackageUtility = PackageUtility; -class Package { - constructor(packagePath) { - this._path = PackageUtility.getPackagePath(packagePath); - this._isMSBuildPackage = undefined; - } - getPath() { - return this._path; - } - isMSBuildPackage() { - return __awaiter(this, void 0, void 0, function* () { - if (this._isMSBuildPackage == undefined) { - this._isMSBuildPackage = (yield this.getPackageType()) != PackageType.folder && (yield zipUtility.checkIfFilesExistsInZip(this._path, ["parameters.xml", "systeminfo.xml"])); - core.debug("Is the package an msdeploy package : " + this._isMSBuildPackage); - } - return this._isMSBuildPackage; - }); - } - getPackageType() { - if (this._packageType == undefined) { - if (!exist(this._path)) { - throw new Error('Invalidwebapppackageorfolderpathprovided' + this._path); - } - else { - if (this._path.toLowerCase().endsWith('.war')) { - this._packageType = PackageType.war; - core.debug("This is war package "); - } - else if (this._path.toLowerCase().endsWith('.jar')) { - this._packageType = PackageType.jar; - core.debug("This is jar package "); - } - else if (this._path.toLowerCase().endsWith('.zip')) { - this._packageType = PackageType.zip; - core.debug("This is zip package "); - } - else if (fs.statSync(this._path).isDirectory()) { - this._packageType = PackageType.folder; - core.debug("This is folder package "); - } - else { - throw new Error('Invalid App Service package or folder path provided: ' + this._path); - } - } - } - return this._packageType; - } -} -exports.Package = Package; -function exist(path) { - var exist = false; - try { - exist = path && fs.statSync(path) != null; - } - catch (err) { - if (err && err.code === 'ENOENT') { - exist = false; - } - else { - throw err; - } - } - return exist; -} -exports.exist = exist; +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const core = require("@actions/core"); +const fs = require("fs"); +const utility = require("./utility"); +const zipUtility = require("./ziputility"); +var PackageType; +(function (PackageType) { + PackageType[PackageType["war"] = 0] = "war"; + PackageType[PackageType["zip"] = 1] = "zip"; + PackageType[PackageType["jar"] = 2] = "jar"; + PackageType[PackageType["folder"] = 3] = "folder"; +})(PackageType = exports.PackageType || (exports.PackageType = {})); +class PackageUtility { + static getPackagePath(packagePath) { + var availablePackages = utility.findfiles(packagePath); + if (availablePackages.length == 0) { + throw new Error('No package found with specified pattern: ' + packagePath); + } + if (availablePackages.length > 1) { + throw new Error('More than one package matched with specified pattern: ' + packagePath + '. Please restrain the search pattern.'); + } + return availablePackages[0]; + } +} +exports.PackageUtility = PackageUtility; +class Package { + constructor(packagePath) { + this._path = PackageUtility.getPackagePath(packagePath); + this._isMSBuildPackage = undefined; + } + getPath() { + return this._path; + } + isMSBuildPackage() { + return __awaiter(this, void 0, void 0, function* () { + if (this._isMSBuildPackage == undefined) { + this._isMSBuildPackage = (yield this.getPackageType()) != PackageType.folder && (yield zipUtility.checkIfFilesExistsInZip(this._path, ["parameters.xml", "systeminfo.xml"])); + core.debug("Is the package an msdeploy package : " + this._isMSBuildPackage); + } + return this._isMSBuildPackage; + }); + } + getPackageType() { + if (this._packageType == undefined) { + if (!exist(this._path)) { + throw new Error('Invalidwebapppackageorfolderpathprovided' + this._path); + } + else { + if (this._path.toLowerCase().endsWith('.war')) { + this._packageType = PackageType.war; + core.debug("This is war package "); + } + else if (this._path.toLowerCase().endsWith('.jar')) { + this._packageType = PackageType.jar; + core.debug("This is jar package "); + } + else if (this._path.toLowerCase().endsWith('.zip')) { + this._packageType = PackageType.zip; + core.debug("This is zip package "); + } + else if (fs.statSync(this._path).isDirectory()) { + this._packageType = PackageType.folder; + core.debug("This is folder package "); + } + else { + throw new Error('Invalid App Service package or folder path provided: ' + this._path); + } + } + } + return this._packageType; + } +} +exports.Package = Package; +function exist(path) { + var exist = false; + try { + exist = path && fs.statSync(path) != null; + } + catch (err) { + if (err && err.code === 'ENOENT') { + exist = false; + } + else { + throw err; + } + } + return exist; +} +exports.exist = exist; diff --git a/node_modules/azure-actions-utility/parameterParserUtility.d.ts b/node_modules/azure-actions-utility/parameterParserUtility.d.ts index 3e03eeb2f..45f305751 100644 --- a/node_modules/azure-actions-utility/parameterParserUtility.d.ts +++ b/node_modules/azure-actions-utility/parameterParserUtility.d.ts @@ -1,3 +1,3 @@ -export declare function parse(input: string): { - [key: string]: any; -}; +export declare function parse(input: string): { + [key: string]: any; +}; diff --git a/node_modules/azure-actions-utility/parameterParserUtility.js b/node_modules/azure-actions-utility/parameterParserUtility.js index 83fe8cb49..bbc085043 100644 --- a/node_modules/azure-actions-utility/parameterParserUtility.js +++ b/node_modules/azure-actions-utility/parameterParserUtility.js @@ -1,123 +1,123 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -function parse(input) { - var result = {}; - var index = 0; - var obj = { name: "", value: "" }; - while (index < input.length) { - var literalData = findLiteral(input, index); - var nextIndex = literalData.currentPosition; - var specialCharacterFlag = literalData.specialCharacterFlag; - var literal = input.substr(index, nextIndex - index).trim(); - if (isName(literal, specialCharacterFlag)) { - if (obj.name) { - result[obj.name] = { value: obj.value }; - obj = { name: "", value: "" }; - } - obj.name = literal.substr(1, literal.length); - } - else { - obj.value = literal; - result[obj.name] = { value: obj.value }; - obj = { name: "", value: "" }; - } - index = nextIndex + 1; - } - if (obj.name) { - result[obj.name] = { value: obj.value }; - } - for (var name in result) { - result[name].value = result[name].value.replace(/^"(.*)"$/, '$1'); - } - return result; -} -exports.parse = parse; -function isName(literal, specialCharacterFlag) { - return literal[0] === '-' && !specialCharacterFlag && isNaN(Number(literal)); -} -function findLiteral(input, currentPosition) { - var specialCharacterFlag = false; - for (; currentPosition < input.length; currentPosition++) { - if (input[currentPosition] == " " || input[currentPosition] == "\t") { - for (; currentPosition < input.length; currentPosition++) { - if (input[currentPosition + 1] != " " && input[currentPosition + 1] != "\t") { - break; - } - } - break; - } - else if (input[currentPosition] == "(") { - currentPosition = findClosingBracketIndex(input, currentPosition + 1, ")"); - specialCharacterFlag = true; - } - else if (input[currentPosition] == "[") { - currentPosition = findClosingBracketIndex(input, currentPosition + 1, "]"); - specialCharacterFlag = true; - } - else if (input[currentPosition] == "{") { - currentPosition = findClosingBracketIndex(input, currentPosition + 1, "}"); - specialCharacterFlag = true; - } - else if (input[currentPosition] == "\"") { - //keep going till this one closes - currentPosition = findClosingQuoteIndex(input, currentPosition + 1, "\""); - specialCharacterFlag = true; - } - else if (input[currentPosition] == "'") { - //keep going till this one closes - currentPosition = findClosingQuoteIndex(input, currentPosition + 1, "'"); - specialCharacterFlag = true; - } - else if (input[currentPosition] == "`") { - currentPosition++; - specialCharacterFlag = true; - if (currentPosition >= input.length) { - break; - } - } - } - return { currentPosition: currentPosition, specialCharacterFlag: specialCharacterFlag }; -} -function findClosingBracketIndex(input, currentPosition, closingBracket) { - for (; currentPosition < input.length; currentPosition++) { - if (input[currentPosition] == closingBracket) { - break; - } - else if (input[currentPosition] == "(") { - currentPosition = findClosingBracketIndex(input, currentPosition + 1, ")"); - } - else if (input[currentPosition] == "[") { - currentPosition = findClosingBracketIndex(input, currentPosition + 1, "]"); - } - else if (input[currentPosition] == "{") { - currentPosition = findClosingBracketIndex(input, currentPosition + 1, "}"); - } - else if (input[currentPosition] == "\"") { - currentPosition = findClosingQuoteIndex(input, currentPosition + 1, "\""); - } - else if (input[currentPosition] == "'") { - currentPosition = findClosingQuoteIndex(input, currentPosition + 1, "'"); - } - else if (input[currentPosition] == "`") { - currentPosition++; - if (currentPosition >= input.length) { - break; - } - } - } - return currentPosition; -} -function findClosingQuoteIndex(input, currentPosition, closingQuote) { - for (; currentPosition < input.length; currentPosition++) { - if (input[currentPosition] == closingQuote) { - break; - } - else if (input[currentPosition] == "`") { - currentPosition++; - if (currentPosition >= input.length) { - break; - } - } - } - return currentPosition; -} +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +function parse(input) { + var result = {}; + var index = 0; + var obj = { name: "", value: "" }; + while (index < input.length) { + var literalData = findLiteral(input, index); + var nextIndex = literalData.currentPosition; + var specialCharacterFlag = literalData.specialCharacterFlag; + var literal = input.substr(index, nextIndex - index).trim(); + if (isName(literal, specialCharacterFlag)) { + if (obj.name) { + result[obj.name] = { value: obj.value }; + obj = { name: "", value: "" }; + } + obj.name = literal.substr(1, literal.length); + } + else { + obj.value = literal; + result[obj.name] = { value: obj.value }; + obj = { name: "", value: "" }; + } + index = nextIndex + 1; + } + if (obj.name) { + result[obj.name] = { value: obj.value }; + } + for (var name in result) { + result[name].value = result[name].value.replace(/^"(.*)"$/, '$1'); + } + return result; +} +exports.parse = parse; +function isName(literal, specialCharacterFlag) { + return literal[0] === '-' && !specialCharacterFlag && isNaN(Number(literal)); +} +function findLiteral(input, currentPosition) { + var specialCharacterFlag = false; + for (; currentPosition < input.length; currentPosition++) { + if (input[currentPosition] == " " || input[currentPosition] == "\t") { + for (; currentPosition < input.length; currentPosition++) { + if (input[currentPosition + 1] != " " && input[currentPosition + 1] != "\t") { + break; + } + } + break; + } + else if (input[currentPosition] == "(") { + currentPosition = findClosingBracketIndex(input, currentPosition + 1, ")"); + specialCharacterFlag = true; + } + else if (input[currentPosition] == "[") { + currentPosition = findClosingBracketIndex(input, currentPosition + 1, "]"); + specialCharacterFlag = true; + } + else if (input[currentPosition] == "{") { + currentPosition = findClosingBracketIndex(input, currentPosition + 1, "}"); + specialCharacterFlag = true; + } + else if (input[currentPosition] == "\"") { + //keep going till this one closes + currentPosition = findClosingQuoteIndex(input, currentPosition + 1, "\""); + specialCharacterFlag = true; + } + else if (input[currentPosition] == "'") { + //keep going till this one closes + currentPosition = findClosingQuoteIndex(input, currentPosition + 1, "'"); + specialCharacterFlag = true; + } + else if (input[currentPosition] == "`") { + currentPosition++; + specialCharacterFlag = true; + if (currentPosition >= input.length) { + break; + } + } + } + return { currentPosition: currentPosition, specialCharacterFlag: specialCharacterFlag }; +} +function findClosingBracketIndex(input, currentPosition, closingBracket) { + for (; currentPosition < input.length; currentPosition++) { + if (input[currentPosition] == closingBracket) { + break; + } + else if (input[currentPosition] == "(") { + currentPosition = findClosingBracketIndex(input, currentPosition + 1, ")"); + } + else if (input[currentPosition] == "[") { + currentPosition = findClosingBracketIndex(input, currentPosition + 1, "]"); + } + else if (input[currentPosition] == "{") { + currentPosition = findClosingBracketIndex(input, currentPosition + 1, "}"); + } + else if (input[currentPosition] == "\"") { + currentPosition = findClosingQuoteIndex(input, currentPosition + 1, "\""); + } + else if (input[currentPosition] == "'") { + currentPosition = findClosingQuoteIndex(input, currentPosition + 1, "'"); + } + else if (input[currentPosition] == "`") { + currentPosition++; + if (currentPosition >= input.length) { + break; + } + } + } + return currentPosition; +} +function findClosingQuoteIndex(input, currentPosition, closingQuote) { + for (; currentPosition < input.length; currentPosition++) { + if (input[currentPosition] == closingQuote) { + break; + } + else if (input[currentPosition] == "`") { + currentPosition++; + if (currentPosition >= input.length) { + break; + } + } + } + return currentPosition; +} diff --git a/node_modules/azure-actions-utility/utility.d.ts b/node_modules/azure-actions-utility/utility.d.ts index 44c2c6a95..f667a81bb 100644 --- a/node_modules/azure-actions-utility/utility.d.ts +++ b/node_modules/azure-actions-utility/utility.d.ts @@ -1,11 +1,11 @@ -import { PackageType } from './packageUtility'; -export declare function findfiles(filepath: any): string[]; -export declare function generateTemporaryFolderOrZipPath(folderPath: string, isFolder: boolean): any; -export declare function copyDirectory(sourceDirectory: string, destDirectory: string): void; -export declare function generateTemporaryFolderForDeployment(isFolderBasedDeployment: boolean, webDeployPkg: string, packageType: PackageType): Promise; -export declare function archiveFolderForDeployment(isFolderBasedDeployment: boolean, folderPath: string): Promise<{ - "webDeployPkg": any; - "tempPackagePath": any; -}>; -export declare function getFileNameFromPath(filePath: string, extension?: string): string; -export declare function getTempDirectory(): string; +import { PackageType } from './packageUtility'; +export declare function findfiles(filepath: any): string[]; +export declare function generateTemporaryFolderOrZipPath(folderPath: string, isFolder: boolean): any; +export declare function copyDirectory(sourceDirectory: string, destDirectory: string): void; +export declare function generateTemporaryFolderForDeployment(isFolderBasedDeployment: boolean, webDeployPkg: string, packageType: PackageType): Promise; +export declare function archiveFolderForDeployment(isFolderBasedDeployment: boolean, folderPath: string): Promise<{ + "webDeployPkg": any; + "tempPackagePath": any; +}>; +export declare function getFileNameFromPath(filePath: string, extension?: string): string; +export declare function getTempDirectory(): string; diff --git a/node_modules/azure-actions-utility/utility.js b/node_modules/azure-actions-utility/utility.js index 3f577f058..d9c024bb2 100644 --- a/node_modules/azure-actions-utility/utility.js +++ b/node_modules/azure-actions-utility/utility.js @@ -1,150 +1,150 @@ -"use strict"; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -Object.defineProperty(exports, "__esModule", { value: true }); -const path = require("path"); -const fs = require("fs"); -const os = require("os"); -const packageUtility_1 = require("./packageUtility"); -const utilityHelperFunctions_1 = require("./utilityHelperFunctions"); -const zipUtility = require("./ziputility"); -const core = require("@actions/core"); -function findfiles(filepath) { - core.debug("Finding files matching input: " + filepath); - var filesList; - if (filepath.indexOf('*') == -1 && filepath.indexOf('?') == -1) { - // No pattern found, check literal path to a single file - if (packageUtility_1.exist(filepath)) { - filesList = [filepath]; - } - else { - core.debug('No matching files were found with search pattern: ' + filepath); - return []; - } - } - else { - var firstWildcardIndex = function (str) { - var idx = str.indexOf('*'); - var idxOfWildcard = str.indexOf('?'); - if (idxOfWildcard > -1) { - return (idx > -1) ? - Math.min(idx, idxOfWildcard) : idxOfWildcard; - } - return idx; - }; - // Find app files matching the specified pattern - core.debug('Matching glob pattern: ' + filepath); - // First find the most complete path without any matching patterns - var idx = firstWildcardIndex(filepath); - core.debug('Index of first wildcard: ' + idx); - var slicedPath = filepath.slice(0, idx); - var findPathRoot = path.dirname(slicedPath); - if (slicedPath.endsWith("\\") || slicedPath.endsWith("/")) { - findPathRoot = slicedPath; - } - core.debug('find root dir: ' + findPathRoot); - // Now we get a list of all files under this root - var allFiles = utilityHelperFunctions_1.find(findPathRoot); - // Now matching the pattern against all files - filesList = utilityHelperFunctions_1.match(allFiles, filepath, '', { matchBase: true, nocase: !!os.type().match(/^Win/) }); - // Fail if no matching files were found - if (!filesList || filesList.length == 0) { - core.debug('No matching files were found with search pattern: ' + filepath); - return []; - } - } - return filesList; -} -exports.findfiles = findfiles; -function generateTemporaryFolderOrZipPath(folderPath, isFolder) { - var randomString = Math.random().toString().split('.')[1]; - var tempPath = path.join(folderPath, 'temp_web_package_' + randomString + (isFolder ? "" : ".zip")); - if (packageUtility_1.exist(tempPath)) { - return generateTemporaryFolderOrZipPath(folderPath, isFolder); - } - return tempPath; -} -exports.generateTemporaryFolderOrZipPath = generateTemporaryFolderOrZipPath; -function copyDirectory(sourceDirectory, destDirectory) { - if (!packageUtility_1.exist(destDirectory)) { - utilityHelperFunctions_1.mkdirP(destDirectory); - } - var listSrcDirectory = utilityHelperFunctions_1.find(sourceDirectory); - for (var srcDirPath of listSrcDirectory) { - var relativePath = srcDirPath.substring(sourceDirectory.length); - var destinationPath = path.join(destDirectory, relativePath); - if (fs.statSync(srcDirPath).isDirectory()) { - utilityHelperFunctions_1.mkdirP(destinationPath); - } - else { - if (!packageUtility_1.exist(path.dirname(destinationPath))) { - utilityHelperFunctions_1.mkdirP(path.dirname(destinationPath)); - } - core.debug('copy file from: ' + srcDirPath + ' to: ' + destinationPath); - utilityHelperFunctions_1.cp(srcDirPath, destinationPath, '-f', false); - } - } -} -exports.copyDirectory = copyDirectory; -function generateTemporaryFolderForDeployment(isFolderBasedDeployment, webDeployPkg, packageType) { - return __awaiter(this, void 0, void 0, function* () { - var folderName = `${process.env.RUNNER_TEMP}`; - var folderPath = generateTemporaryFolderOrZipPath(folderName, true); - if (isFolderBasedDeployment || packageType === packageUtility_1.PackageType.jar) { - core.debug('Copying Web Packge: ' + webDeployPkg + ' to temporary location: ' + folderPath); - copyDirectory(webDeployPkg, folderPath); - if (packageType === packageUtility_1.PackageType.jar && this.getFileNameFromPath(webDeployPkg, ".jar") != "app") { - let src = path.join(folderPath, getFileNameFromPath(webDeployPkg)); - let dest = path.join(folderPath, "app.jar"); - core.debug("Renaming " + src + " to " + dest); - fs.renameSync(src, dest); - } - core.debug('Copied Web Package: ' + webDeployPkg + ' to temporary location: ' + folderPath + ' successfully.'); - } - else { - yield zipUtility.unzip(webDeployPkg, folderPath); - } - return folderPath; - }); -} -exports.generateTemporaryFolderForDeployment = generateTemporaryFolderForDeployment; -function archiveFolderForDeployment(isFolderBasedDeployment, folderPath) { - return __awaiter(this, void 0, void 0, function* () { - var webDeployPkg; - if (isFolderBasedDeployment) { - webDeployPkg = folderPath; - } - else { - var tempWebPackageZip = generateTemporaryFolderOrZipPath(`${process.env.RUNNER_TEMP}`, false); - webDeployPkg = yield zipUtility.archiveFolder(folderPath, "", tempWebPackageZip); - } - return { - "webDeployPkg": webDeployPkg, - "tempPackagePath": webDeployPkg - }; - }); -} -exports.archiveFolderForDeployment = archiveFolderForDeployment; -function getFileNameFromPath(filePath, extension) { - var isWindows = os.type().match(/^Win/); - var fileName; - if (isWindows) { - fileName = path.win32.basename(filePath, extension); - } - else { - fileName = path.posix.basename(filePath, extension); - } - return fileName; -} -exports.getFileNameFromPath = getFileNameFromPath; -function getTempDirectory() { - return `${process.env.RUNNER_TEMP}` || os.tmpdir(); -} -exports.getTempDirectory = getTempDirectory; +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const path = require("path"); +const fs = require("fs"); +const os = require("os"); +const packageUtility_1 = require("./packageUtility"); +const utilityHelperFunctions_1 = require("./utilityHelperFunctions"); +const zipUtility = require("./ziputility"); +const core = require("@actions/core"); +function findfiles(filepath) { + core.debug("Finding files matching input: " + filepath); + var filesList; + if (filepath.indexOf('*') == -1 && filepath.indexOf('?') == -1) { + // No pattern found, check literal path to a single file + if (packageUtility_1.exist(filepath)) { + filesList = [filepath]; + } + else { + core.debug('No matching files were found with search pattern: ' + filepath); + return []; + } + } + else { + var firstWildcardIndex = function (str) { + var idx = str.indexOf('*'); + var idxOfWildcard = str.indexOf('?'); + if (idxOfWildcard > -1) { + return (idx > -1) ? + Math.min(idx, idxOfWildcard) : idxOfWildcard; + } + return idx; + }; + // Find app files matching the specified pattern + core.debug('Matching glob pattern: ' + filepath); + // First find the most complete path without any matching patterns + var idx = firstWildcardIndex(filepath); + core.debug('Index of first wildcard: ' + idx); + var slicedPath = filepath.slice(0, idx); + var findPathRoot = path.dirname(slicedPath); + if (slicedPath.endsWith("\\") || slicedPath.endsWith("/")) { + findPathRoot = slicedPath; + } + core.debug('find root dir: ' + findPathRoot); + // Now we get a list of all files under this root + var allFiles = utilityHelperFunctions_1.find(findPathRoot); + // Now matching the pattern against all files + filesList = utilityHelperFunctions_1.match(allFiles, filepath, '', { matchBase: true, nocase: !!os.type().match(/^Win/) }); + // Fail if no matching files were found + if (!filesList || filesList.length == 0) { + core.debug('No matching files were found with search pattern: ' + filepath); + return []; + } + } + return filesList; +} +exports.findfiles = findfiles; +function generateTemporaryFolderOrZipPath(folderPath, isFolder) { + var randomString = Math.random().toString().split('.')[1]; + var tempPath = path.join(folderPath, 'temp_web_package_' + randomString + (isFolder ? "" : ".zip")); + if (packageUtility_1.exist(tempPath)) { + return generateTemporaryFolderOrZipPath(folderPath, isFolder); + } + return tempPath; +} +exports.generateTemporaryFolderOrZipPath = generateTemporaryFolderOrZipPath; +function copyDirectory(sourceDirectory, destDirectory) { + if (!packageUtility_1.exist(destDirectory)) { + utilityHelperFunctions_1.mkdirP(destDirectory); + } + var listSrcDirectory = utilityHelperFunctions_1.find(sourceDirectory); + for (var srcDirPath of listSrcDirectory) { + var relativePath = srcDirPath.substring(sourceDirectory.length); + var destinationPath = path.join(destDirectory, relativePath); + if (fs.statSync(srcDirPath).isDirectory()) { + utilityHelperFunctions_1.mkdirP(destinationPath); + } + else { + if (!packageUtility_1.exist(path.dirname(destinationPath))) { + utilityHelperFunctions_1.mkdirP(path.dirname(destinationPath)); + } + core.debug('copy file from: ' + srcDirPath + ' to: ' + destinationPath); + utilityHelperFunctions_1.cp(srcDirPath, destinationPath, '-f', false); + } + } +} +exports.copyDirectory = copyDirectory; +function generateTemporaryFolderForDeployment(isFolderBasedDeployment, webDeployPkg, packageType) { + return __awaiter(this, void 0, void 0, function* () { + var folderName = `${process.env.RUNNER_TEMP}`; + var folderPath = generateTemporaryFolderOrZipPath(folderName, true); + if (isFolderBasedDeployment || packageType === packageUtility_1.PackageType.jar) { + core.debug('Copying Web Packge: ' + webDeployPkg + ' to temporary location: ' + folderPath); + copyDirectory(webDeployPkg, folderPath); + if (packageType === packageUtility_1.PackageType.jar && this.getFileNameFromPath(webDeployPkg, ".jar") != "app") { + let src = path.join(folderPath, getFileNameFromPath(webDeployPkg)); + let dest = path.join(folderPath, "app.jar"); + core.debug("Renaming " + src + " to " + dest); + fs.renameSync(src, dest); + } + core.debug('Copied Web Package: ' + webDeployPkg + ' to temporary location: ' + folderPath + ' successfully.'); + } + else { + yield zipUtility.unzip(webDeployPkg, folderPath); + } + return folderPath; + }); +} +exports.generateTemporaryFolderForDeployment = generateTemporaryFolderForDeployment; +function archiveFolderForDeployment(isFolderBasedDeployment, folderPath) { + return __awaiter(this, void 0, void 0, function* () { + var webDeployPkg; + if (isFolderBasedDeployment) { + webDeployPkg = folderPath; + } + else { + var tempWebPackageZip = generateTemporaryFolderOrZipPath(`${process.env.RUNNER_TEMP}`, false); + webDeployPkg = yield zipUtility.archiveFolder(folderPath, "", tempWebPackageZip); + } + return { + "webDeployPkg": webDeployPkg, + "tempPackagePath": webDeployPkg + }; + }); +} +exports.archiveFolderForDeployment = archiveFolderForDeployment; +function getFileNameFromPath(filePath, extension) { + var isWindows = os.type().match(/^Win/); + var fileName; + if (isWindows) { + fileName = path.win32.basename(filePath, extension); + } + else { + fileName = path.posix.basename(filePath, extension); + } + return fileName; +} +exports.getFileNameFromPath = getFileNameFromPath; +function getTempDirectory() { + return `${process.env.RUNNER_TEMP}` || os.tmpdir(); +} +exports.getTempDirectory = getTempDirectory; diff --git a/node_modules/azure-actions-utility/utilityHelperFunctions.d.ts b/node_modules/azure-actions-utility/utilityHelperFunctions.d.ts index d1718292b..17936e1d1 100644 --- a/node_modules/azure-actions-utility/utilityHelperFunctions.d.ts +++ b/node_modules/azure-actions-utility/utilityHelperFunctions.d.ts @@ -1,19 +1,19 @@ -export declare function cp(source: string, dest: string, options?: string, continueOnError?: boolean): void; -export declare function _checkShell(cmd: string, continueOnError?: boolean): void; -export declare function mkdirP(p: string): void; -export declare function find(findPath: string): string[]; -interface MatchOptions { - debug?: boolean; - nobrace?: boolean; - noglobstar?: boolean; - dot?: boolean; - noext?: boolean; - nocase?: boolean; - nonull?: boolean; - matchBase?: boolean; - nocomment?: boolean; - nonegate?: boolean; - flipNegate?: boolean; -} -export declare function match(list: string[], patterns: string[] | string, patternRoot?: string, options?: MatchOptions): string[]; -export {}; +export declare function cp(source: string, dest: string, options?: string, continueOnError?: boolean): void; +export declare function _checkShell(cmd: string, continueOnError?: boolean): void; +export declare function mkdirP(p: string): void; +export declare function find(findPath: string): string[]; +interface MatchOptions { + debug?: boolean; + nobrace?: boolean; + noglobstar?: boolean; + dot?: boolean; + noext?: boolean; + nocase?: boolean; + nonull?: boolean; + matchBase?: boolean; + nocomment?: boolean; + nonegate?: boolean; + flipNegate?: boolean; +} +export declare function match(list: string[], patterns: string[] | string, patternRoot?: string, options?: MatchOptions): string[]; +export {}; diff --git a/node_modules/azure-actions-utility/utilityHelperFunctions.js b/node_modules/azure-actions-utility/utilityHelperFunctions.js index 379d1ff5e..640c9a561 100644 --- a/node_modules/azure-actions-utility/utilityHelperFunctions.js +++ b/node_modules/azure-actions-utility/utilityHelperFunctions.js @@ -1,354 +1,354 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const core = require("@actions/core"); -const path = require("path"); -const fs = require("fs"); -var shell = require('shelljs'); -var minimatch = require('minimatch'); -function cp(source, dest, options, continueOnError) { - if (options) { - shell.cp(options, source, dest); - } - else { - shell.cp(source, dest); - } - _checkShell('cp', continueOnError); -} -exports.cp = cp; -function _checkShell(cmd, continueOnError) { - var se = shell.error(); - if (se) { - core.debug(cmd + ' failed'); - var errMsg = 'Failed ' + cmd + ': ' + se; - core.debug(errMsg); - if (!continueOnError) { - throw new Error(errMsg); - } - } -} -exports._checkShell = _checkShell; -function mkdirP(p) { - if (!p) { - throw new Error('p not supplied'); - } - // build a stack of directories to create - let stack = []; - let testDir = p; - while (true) { - // validate the loop is not out of control - if (stack.length >= (process.env['TASKLIB_TEST_MKDIRP_FAILSAFE'] || 1000)) { - // let the framework throw - core.debug('loop is out of control'); - fs.mkdirSync(p); - return; - } - core.debug(`testing directory '${testDir}'`); - let stats; - try { - stats = fs.statSync(testDir); - } - catch (err) { - if (err.code == 'ENOENT') { - // validate the directory is not the drive root - let parentDir = path.dirname(testDir); - if (testDir == parentDir) { - throw new Error('Unable to create directory ' + p + '. Root directory does not exist: ' + testDir); - } - // push the dir and test the parent - stack.push(testDir); - testDir = parentDir; - continue; - } - else if (err.code == 'UNKNOWN') { - throw new Error('Unable to create directory ' + p + '. Unable to verify the directory exists: ' + testDir + '. If directory is a file share, please verify the share name is correct, the share is online, and the current process has permission to access the share.'); - } - else { - throw err; - } - } - if (!stats.isDirectory()) { - throw new Error('Unable to create directory ' + p + '. Conflicting file exists: ' + testDir); - } - // testDir exists - break; - } - // create each directory - while (stack.length) { - let dir = stack.pop(); // non-null because `stack.length` was truthy - core.debug(`mkdir '${dir}'`); - try { - fs.mkdirSync(dir); - } - catch (err) { - throw new Error('Unable to create directory ' + p + ' . ' + err.message); - } - } -} -exports.mkdirP = mkdirP; -function find(findPath) { - if (!findPath) { - core.debug('no path specified'); - return []; - } - // normalize the path, otherwise the first result is inconsistently formatted from the rest of the results - // because path.join() performs normalization. - findPath = path.normalize(findPath); - // debug trace the parameters - core.debug(`findPath: '${findPath}'`); - // return empty if not exists - try { - fs.lstatSync(findPath); - } - catch (err) { - if (err.code == 'ENOENT') { - core.debug('0 results'); - return []; - } - throw err; - } - try { - let result = []; - // push the first item - let stack = [new _FindItem(findPath, 1)]; - let traversalChain = []; // used to detect cycles - while (stack.length) { - // pop the next item and push to the result array - let item = stack.pop(); // non-null because `stack.length` was truthy - result.push(item.path); - // stat the item. the stat info is used further below to determine whether to traverse deeper - // - // stat returns info about the target of a symlink (or symlink chain), - // lstat returns info about a symlink itself - let stats; - // use lstat (not following symlinks) - stats = fs.lstatSync(item.path); - // note, isDirectory() returns false for the lstat of a symlink - if (stats.isDirectory()) { - core.debug(` ${item.path} (directory)`); - // push the child items in reverse onto the stack - let childLevel = item.level + 1; - let childItems = fs.readdirSync(item.path) - .map((childName) => new _FindItem(path.join(item.path, childName), childLevel)); - for (var i = childItems.length - 1; i >= 0; i--) { - stack.push(childItems[i]); - } - } - else { - core.debug(` ${item.path} (file)`); - } - } - core.debug(`${result.length} results`); - return result; - } - catch (err) { - throw new Error('Failed find: ' + err.message); - } -} -exports.find = find; -class _FindItem { - constructor(path, level) { - this.path = path; - this.level = level; - } -} -function _getDefaultMatchOptions() { - return { - debug: false, - nobrace: true, - noglobstar: false, - dot: true, - noext: false, - nocase: process.platform == 'win32', - nonull: false, - matchBase: false, - nocomment: false, - nonegate: false, - flipNegate: false - }; -} -function _debugMatchOptions(options) { - core.debug(`matchOptions.debug: '${options.debug}'`); - core.debug(`matchOptions.nobrace: '${options.nobrace}'`); - core.debug(`matchOptions.noglobstar: '${options.noglobstar}'`); - core.debug(`matchOptions.dot: '${options.dot}'`); - core.debug(`matchOptions.noext: '${options.noext}'`); - core.debug(`matchOptions.nocase: '${options.nocase}'`); - core.debug(`matchOptions.nonull: '${options.nonull}'`); - core.debug(`matchOptions.matchBase: '${options.matchBase}'`); - core.debug(`matchOptions.nocomment: '${options.nocomment}'`); - core.debug(`matchOptions.nonegate: '${options.nonegate}'`); - core.debug(`matchOptions.flipNegate: '${options.flipNegate}'`); -} -function match(list, patterns, patternRoot, options) { - // trace parameters - core.debug(`patternRoot: '${patternRoot}'`); - options = options || _getDefaultMatchOptions(); // default match options - _debugMatchOptions(options); - // convert pattern to an array - if (typeof patterns == 'string') { - patterns = [patterns]; - } - // hashtable to keep track of matches - let map = {}; - let originalOptions = options; - for (let pattern of patterns) { - core.debug(`pattern: '${pattern}'`); - // trim and skip empty - pattern = (pattern || '').trim(); - if (!pattern) { - core.debug('skipping empty pattern'); - continue; - } - // clone match options - let options = _cloneMatchOptions(originalOptions); - // skip comments - if (!options.nocomment && _startsWith(pattern, '#')) { - core.debug('skipping comment'); - continue; - } - // set nocomment - brace expansion could result in a leading '#' - options.nocomment = true; - // determine whether pattern is include or exclude - let negateCount = 0; - if (!options.nonegate) { - while (pattern.charAt(negateCount) == '!') { - negateCount++; - } - pattern = pattern.substring(negateCount); // trim leading '!' - if (negateCount) { - core.debug(`trimmed leading '!'. pattern: '${pattern}'`); - } - } - let isIncludePattern = negateCount == 0 || - (negateCount % 2 == 0 && !options.flipNegate) || - (negateCount % 2 == 1 && options.flipNegate); - // set nonegate - brace expansion could result in a leading '!' - options.nonegate = true; - options.flipNegate = false; - // expand braces - required to accurately root patterns - let expanded; - let preExpanded = pattern; - if (options.nobrace) { - expanded = [pattern]; - } - else { - // convert slashes on Windows before calling braceExpand(). unfortunately this means braces cannot - // be escaped on Windows, this limitation is consistent with current limitations of minimatch (3.0.3). - core.debug('expanding braces'); - let convertedPattern = process.platform == 'win32' ? pattern.replace(/\\/g, '/') : pattern; - expanded = minimatch.braceExpand(convertedPattern); - } - // set nobrace - options.nobrace = true; - for (let pattern of expanded) { - if (expanded.length != 1 || pattern != preExpanded) { - core.debug(`pattern: '${pattern}'`); - } - // trim and skip empty - pattern = (pattern || '').trim(); - if (!pattern) { - core.debug('skipping empty pattern'); - continue; - } - // root the pattern when all of the following conditions are true: - if (patternRoot && // patternRoot supplied - !_isRooted(pattern) && // AND pattern not rooted - // AND matchBase:false or not basename only - (!options.matchBase || (process.platform == 'win32' ? pattern.replace(/\\/g, '/') : pattern).indexOf('/') >= 0)) { - pattern = _ensureRooted(patternRoot, pattern); - core.debug(`rooted pattern: '${pattern}'`); - } - if (isIncludePattern) { - // apply the pattern - core.debug('applying include pattern against original list'); - let matchResults = minimatch.match(list, pattern, options); - core.debug(matchResults.length + ' matches'); - // union the results - for (let matchResult of matchResults) { - map[matchResult] = true; - } - } - else { - // apply the pattern - core.debug('applying exclude pattern against original list'); - let matchResults = minimatch.match(list, pattern, options); - core.debug(matchResults.length + ' matches'); - // substract the results - for (let matchResult of matchResults) { - delete map[matchResult]; - } - } - } - } - // return a filtered version of the original list (preserves order and prevents duplication) - let result = list.filter((item) => map.hasOwnProperty(item)); - core.debug(result.length + ' final results'); - return result; -} -exports.match = match; -function _cloneMatchOptions(matchOptions) { - return { - debug: matchOptions.debug, - nobrace: matchOptions.nobrace, - noglobstar: matchOptions.noglobstar, - dot: matchOptions.dot, - noext: matchOptions.noext, - nocase: matchOptions.nocase, - nonull: matchOptions.nonull, - matchBase: matchOptions.matchBase, - nocomment: matchOptions.nocomment, - nonegate: matchOptions.nonegate, - flipNegate: matchOptions.flipNegate - }; -} -function _startsWith(str, start) { - return str.slice(0, start.length) == start; -} -function _isRooted(p) { - p = _normalizeSeparators(p); - if (!p) { - throw new Error('isRooted() parameter "p" cannot be empty'); - } - if (process.platform == 'win32') { - return _startsWith(p, '\\') || // e.g. \ or \hello or \\hello - /^[A-Z]:/i.test(p); // e.g. C: or C:\hello - } - return _startsWith(p, '/'); // e.g. /hello -} -function _ensureRooted(root, p) { - if (!root) { - throw new Error('ensureRooted() parameter "root" cannot be empty'); - } - if (!p) { - throw new Error('ensureRooted() parameter "p" cannot be empty'); - } - if (_isRooted(p)) { - return p; - } - if (process.platform == 'win32' && root.match(/^[A-Z]:$/i)) { // e.g. C: - return root + p; - } - // ensure root ends with a separator - if (_endsWith(root, '/') || (process.platform == 'win32' && _endsWith(root, '\\'))) { - // root already ends with a separator - } - else { - root += path.sep; // append separator - } - return root + p; -} -function _normalizeSeparators(p) { - p = p || ''; - if (process.platform == 'win32') { - // convert slashes on Windows - p = p.replace(/\//g, '\\'); - // remove redundant slashes - let isUnc = /^\\\\+[^\\]/.test(p); // e.g. \\hello - return (isUnc ? '\\' : '') + p.replace(/\\\\+/g, '\\'); // preserve leading // for UNC - } - // remove redundant slashes - return p.replace(/\/\/+/g, '/'); -} -function _endsWith(str, end) { - return str.slice(-end.length) == end; -} +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const core = require("@actions/core"); +const path = require("path"); +const fs = require("fs"); +var shell = require('shelljs'); +var minimatch = require('minimatch'); +function cp(source, dest, options, continueOnError) { + if (options) { + shell.cp(options, source, dest); + } + else { + shell.cp(source, dest); + } + _checkShell('cp', continueOnError); +} +exports.cp = cp; +function _checkShell(cmd, continueOnError) { + var se = shell.error(); + if (se) { + core.debug(cmd + ' failed'); + var errMsg = 'Failed ' + cmd + ': ' + se; + core.debug(errMsg); + if (!continueOnError) { + throw new Error(errMsg); + } + } +} +exports._checkShell = _checkShell; +function mkdirP(p) { + if (!p) { + throw new Error('p not supplied'); + } + // build a stack of directories to create + let stack = []; + let testDir = p; + while (true) { + // validate the loop is not out of control + if (stack.length >= (process.env['TASKLIB_TEST_MKDIRP_FAILSAFE'] || 1000)) { + // let the framework throw + core.debug('loop is out of control'); + fs.mkdirSync(p); + return; + } + core.debug(`testing directory '${testDir}'`); + let stats; + try { + stats = fs.statSync(testDir); + } + catch (err) { + if (err.code == 'ENOENT') { + // validate the directory is not the drive root + let parentDir = path.dirname(testDir); + if (testDir == parentDir) { + throw new Error('Unable to create directory ' + p + '. Root directory does not exist: ' + testDir); + } + // push the dir and test the parent + stack.push(testDir); + testDir = parentDir; + continue; + } + else if (err.code == 'UNKNOWN') { + throw new Error('Unable to create directory ' + p + '. Unable to verify the directory exists: ' + testDir + '. If directory is a file share, please verify the share name is correct, the share is online, and the current process has permission to access the share.'); + } + else { + throw err; + } + } + if (!stats.isDirectory()) { + throw new Error('Unable to create directory ' + p + '. Conflicting file exists: ' + testDir); + } + // testDir exists + break; + } + // create each directory + while (stack.length) { + let dir = stack.pop(); // non-null because `stack.length` was truthy + core.debug(`mkdir '${dir}'`); + try { + fs.mkdirSync(dir); + } + catch (err) { + throw new Error('Unable to create directory ' + p + ' . ' + err.message); + } + } +} +exports.mkdirP = mkdirP; +function find(findPath) { + if (!findPath) { + core.debug('no path specified'); + return []; + } + // normalize the path, otherwise the first result is inconsistently formatted from the rest of the results + // because path.join() performs normalization. + findPath = path.normalize(findPath); + // debug trace the parameters + core.debug(`findPath: '${findPath}'`); + // return empty if not exists + try { + fs.lstatSync(findPath); + } + catch (err) { + if (err.code == 'ENOENT') { + core.debug('0 results'); + return []; + } + throw err; + } + try { + let result = []; + // push the first item + let stack = [new _FindItem(findPath, 1)]; + let traversalChain = []; // used to detect cycles + while (stack.length) { + // pop the next item and push to the result array + let item = stack.pop(); // non-null because `stack.length` was truthy + result.push(item.path); + // stat the item. the stat info is used further below to determine whether to traverse deeper + // + // stat returns info about the target of a symlink (or symlink chain), + // lstat returns info about a symlink itself + let stats; + // use lstat (not following symlinks) + stats = fs.lstatSync(item.path); + // note, isDirectory() returns false for the lstat of a symlink + if (stats.isDirectory()) { + core.debug(` ${item.path} (directory)`); + // push the child items in reverse onto the stack + let childLevel = item.level + 1; + let childItems = fs.readdirSync(item.path) + .map((childName) => new _FindItem(path.join(item.path, childName), childLevel)); + for (var i = childItems.length - 1; i >= 0; i--) { + stack.push(childItems[i]); + } + } + else { + core.debug(` ${item.path} (file)`); + } + } + core.debug(`${result.length} results`); + return result; + } + catch (err) { + throw new Error('Failed find: ' + err.message); + } +} +exports.find = find; +class _FindItem { + constructor(path, level) { + this.path = path; + this.level = level; + } +} +function _getDefaultMatchOptions() { + return { + debug: false, + nobrace: true, + noglobstar: false, + dot: true, + noext: false, + nocase: process.platform == 'win32', + nonull: false, + matchBase: false, + nocomment: false, + nonegate: false, + flipNegate: false + }; +} +function _debugMatchOptions(options) { + core.debug(`matchOptions.debug: '${options.debug}'`); + core.debug(`matchOptions.nobrace: '${options.nobrace}'`); + core.debug(`matchOptions.noglobstar: '${options.noglobstar}'`); + core.debug(`matchOptions.dot: '${options.dot}'`); + core.debug(`matchOptions.noext: '${options.noext}'`); + core.debug(`matchOptions.nocase: '${options.nocase}'`); + core.debug(`matchOptions.nonull: '${options.nonull}'`); + core.debug(`matchOptions.matchBase: '${options.matchBase}'`); + core.debug(`matchOptions.nocomment: '${options.nocomment}'`); + core.debug(`matchOptions.nonegate: '${options.nonegate}'`); + core.debug(`matchOptions.flipNegate: '${options.flipNegate}'`); +} +function match(list, patterns, patternRoot, options) { + // trace parameters + core.debug(`patternRoot: '${patternRoot}'`); + options = options || _getDefaultMatchOptions(); // default match options + _debugMatchOptions(options); + // convert pattern to an array + if (typeof patterns == 'string') { + patterns = [patterns]; + } + // hashtable to keep track of matches + let map = {}; + let originalOptions = options; + for (let pattern of patterns) { + core.debug(`pattern: '${pattern}'`); + // trim and skip empty + pattern = (pattern || '').trim(); + if (!pattern) { + core.debug('skipping empty pattern'); + continue; + } + // clone match options + let options = _cloneMatchOptions(originalOptions); + // skip comments + if (!options.nocomment && _startsWith(pattern, '#')) { + core.debug('skipping comment'); + continue; + } + // set nocomment - brace expansion could result in a leading '#' + options.nocomment = true; + // determine whether pattern is include or exclude + let negateCount = 0; + if (!options.nonegate) { + while (pattern.charAt(negateCount) == '!') { + negateCount++; + } + pattern = pattern.substring(negateCount); // trim leading '!' + if (negateCount) { + core.debug(`trimmed leading '!'. pattern: '${pattern}'`); + } + } + let isIncludePattern = negateCount == 0 || + (negateCount % 2 == 0 && !options.flipNegate) || + (negateCount % 2 == 1 && options.flipNegate); + // set nonegate - brace expansion could result in a leading '!' + options.nonegate = true; + options.flipNegate = false; + // expand braces - required to accurately root patterns + let expanded; + let preExpanded = pattern; + if (options.nobrace) { + expanded = [pattern]; + } + else { + // convert slashes on Windows before calling braceExpand(). unfortunately this means braces cannot + // be escaped on Windows, this limitation is consistent with current limitations of minimatch (3.0.3). + core.debug('expanding braces'); + let convertedPattern = process.platform == 'win32' ? pattern.replace(/\\/g, '/') : pattern; + expanded = minimatch.braceExpand(convertedPattern); + } + // set nobrace + options.nobrace = true; + for (let pattern of expanded) { + if (expanded.length != 1 || pattern != preExpanded) { + core.debug(`pattern: '${pattern}'`); + } + // trim and skip empty + pattern = (pattern || '').trim(); + if (!pattern) { + core.debug('skipping empty pattern'); + continue; + } + // root the pattern when all of the following conditions are true: + if (patternRoot && // patternRoot supplied + !_isRooted(pattern) && // AND pattern not rooted + // AND matchBase:false or not basename only + (!options.matchBase || (process.platform == 'win32' ? pattern.replace(/\\/g, '/') : pattern).indexOf('/') >= 0)) { + pattern = _ensureRooted(patternRoot, pattern); + core.debug(`rooted pattern: '${pattern}'`); + } + if (isIncludePattern) { + // apply the pattern + core.debug('applying include pattern against original list'); + let matchResults = minimatch.match(list, pattern, options); + core.debug(matchResults.length + ' matches'); + // union the results + for (let matchResult of matchResults) { + map[matchResult] = true; + } + } + else { + // apply the pattern + core.debug('applying exclude pattern against original list'); + let matchResults = minimatch.match(list, pattern, options); + core.debug(matchResults.length + ' matches'); + // substract the results + for (let matchResult of matchResults) { + delete map[matchResult]; + } + } + } + } + // return a filtered version of the original list (preserves order and prevents duplication) + let result = list.filter((item) => map.hasOwnProperty(item)); + core.debug(result.length + ' final results'); + return result; +} +exports.match = match; +function _cloneMatchOptions(matchOptions) { + return { + debug: matchOptions.debug, + nobrace: matchOptions.nobrace, + noglobstar: matchOptions.noglobstar, + dot: matchOptions.dot, + noext: matchOptions.noext, + nocase: matchOptions.nocase, + nonull: matchOptions.nonull, + matchBase: matchOptions.matchBase, + nocomment: matchOptions.nocomment, + nonegate: matchOptions.nonegate, + flipNegate: matchOptions.flipNegate + }; +} +function _startsWith(str, start) { + return str.slice(0, start.length) == start; +} +function _isRooted(p) { + p = _normalizeSeparators(p); + if (!p) { + throw new Error('isRooted() parameter "p" cannot be empty'); + } + if (process.platform == 'win32') { + return _startsWith(p, '\\') || // e.g. \ or \hello or \\hello + /^[A-Z]:/i.test(p); // e.g. C: or C:\hello + } + return _startsWith(p, '/'); // e.g. /hello +} +function _ensureRooted(root, p) { + if (!root) { + throw new Error('ensureRooted() parameter "root" cannot be empty'); + } + if (!p) { + throw new Error('ensureRooted() parameter "p" cannot be empty'); + } + if (_isRooted(p)) { + return p; + } + if (process.platform == 'win32' && root.match(/^[A-Z]:$/i)) { // e.g. C: + return root + p; + } + // ensure root ends with a separator + if (_endsWith(root, '/') || (process.platform == 'win32' && _endsWith(root, '\\'))) { + // root already ends with a separator + } + else { + root += path.sep; // append separator + } + return root + p; +} +function _normalizeSeparators(p) { + p = p || ''; + if (process.platform == 'win32') { + // convert slashes on Windows + p = p.replace(/\//g, '\\'); + // remove redundant slashes + let isUnc = /^\\\\+[^\\]/.test(p); // e.g. \\hello + return (isUnc ? '\\' : '') + p.replace(/\\\\+/g, '\\'); // preserve leading // for UNC + } + // remove redundant slashes + return p.replace(/\/\/+/g, '/'); +} +function _endsWith(str, end) { + return str.slice(-end.length) == end; +} diff --git a/node_modules/azure-actions-utility/ziputility.d.ts b/node_modules/azure-actions-utility/ziputility.d.ts index 84dd08cf8..f1245ee73 100644 --- a/node_modules/azure-actions-utility/ziputility.d.ts +++ b/node_modules/azure-actions-utility/ziputility.d.ts @@ -1,7 +1,7 @@ -export declare function unzip(zipLocation: any, unzipLocation: any): Promise; -export declare function archiveFolder(folderPath: any, targetPath: any, zipName: any): Promise; -/** - * Returns array of files present in archived package - */ -export declare function getArchivedEntries(archivedPackage: string): Promise; -export declare function checkIfFilesExistsInZip(archivedPackage: string, files: string[]): any; +export declare function unzip(zipLocation: any, unzipLocation: any): Promise; +export declare function archiveFolder(folderPath: any, targetPath: any, zipName: any): Promise; +/** + * Returns array of files present in archived package + */ +export declare function getArchivedEntries(archivedPackage: string): Promise; +export declare function checkIfFilesExistsInZip(archivedPackage: string, files: string[]): any; diff --git a/node_modules/azure-actions-utility/ziputility.js b/node_modules/azure-actions-utility/ziputility.js index 5ba13b9e9..fdcc6bf6f 100644 --- a/node_modules/azure-actions-utility/ziputility.js +++ b/node_modules/azure-actions-utility/ziputility.js @@ -1,110 +1,110 @@ -"use strict"; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -Object.defineProperty(exports, "__esModule", { value: true }); -const core = require("@actions/core"); -const io = require("@actions/io"); -const path = require("path"); -const Q = require("q"); -const fs = require("fs"); -const StreamZip = require("node-stream-zip"); -var DecompressZip = require('decompress-zip'); -var archiver = require('archiver'); -const packageUtility_1 = require("./packageUtility"); -function unzip(zipLocation, unzipLocation) { - return __awaiter(this, void 0, void 0, function* () { - var defer = Q.defer(); - if (packageUtility_1.exist(unzipLocation)) { - yield io.rmRF(unzipLocation); - } - var unzipper = new DecompressZip(zipLocation); - console.log('extracting ' + zipLocation + ' to ' + unzipLocation); - unzipper.on('error', function (error) { - defer.reject(error); - }); - unzipper.on('extract', function (log) { - console.log('extracted ' + zipLocation + ' to ' + unzipLocation + ' Successfully'); - defer.resolve(unzipLocation); - }); - unzipper.extract({ - path: unzipLocation - }); - return defer.promise; - }); -} -exports.unzip = unzip; -function archiveFolder(folderPath, targetPath, zipName) { - return __awaiter(this, void 0, void 0, function* () { - var defer = Q.defer(); - core.debug('Archiving ' + folderPath + ' to ' + zipName); - var outputZipPath = path.join(targetPath, zipName); - var output = fs.createWriteStream(outputZipPath); - var archive = archiver('zip'); - output.on('close', function () { - core.debug('Successfully created archive ' + zipName); - defer.resolve(outputZipPath); - }); - output.on('error', function (error) { - defer.reject(error); - }); - archive.pipe(output); - archive.directory(folderPath, '/'); - archive.finalize(); - return defer.promise; - }); -} -exports.archiveFolder = archiveFolder; -/** - * Returns array of files present in archived package - */ -function getArchivedEntries(archivedPackage) { - return __awaiter(this, void 0, void 0, function* () { - var deferred = Q.defer(); - var unzipper = new DecompressZip(archivedPackage); - unzipper.on('error', function (error) { - deferred.reject(error); - }); - unzipper.on('list', function (files) { - var packageComponent = { - "entries": files - }; - deferred.resolve(packageComponent); - }); - unzipper.list(); - return deferred.promise; - }); -} -exports.getArchivedEntries = getArchivedEntries; -function checkIfFilesExistsInZip(archivedPackage, files) { - let deferred = Q.defer(); - for (let i = 0; i < files.length; i++) { - files[i] = files[i].toLowerCase(); - } - const zip = new StreamZip({ - file: archivedPackage, - storeEntries: true, - skipEntryNameValidation: true - }); - zip.on('ready', () => { - let fileCount = 0; - for (let entry in zip.entries()) { - if (files.indexOf(entry.toLowerCase()) != -1) { - fileCount += 1; - } - } - zip.close(); - deferred.resolve(fileCount == files.length); - }); - zip.on('error', error => { - deferred.reject(error); - }); - return deferred.promise; -} -exports.checkIfFilesExistsInZip = checkIfFilesExistsInZip; +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const core = require("@actions/core"); +const io = require("@actions/io"); +const path = require("path"); +const Q = require("q"); +const fs = require("fs"); +const StreamZip = require("node-stream-zip"); +var DecompressZip = require('decompress-zip'); +var archiver = require('archiver'); +const packageUtility_1 = require("./packageUtility"); +function unzip(zipLocation, unzipLocation) { + return __awaiter(this, void 0, void 0, function* () { + var defer = Q.defer(); + if (packageUtility_1.exist(unzipLocation)) { + yield io.rmRF(unzipLocation); + } + var unzipper = new DecompressZip(zipLocation); + console.log('extracting ' + zipLocation + ' to ' + unzipLocation); + unzipper.on('error', function (error) { + defer.reject(error); + }); + unzipper.on('extract', function (log) { + console.log('extracted ' + zipLocation + ' to ' + unzipLocation + ' Successfully'); + defer.resolve(unzipLocation); + }); + unzipper.extract({ + path: unzipLocation + }); + return defer.promise; + }); +} +exports.unzip = unzip; +function archiveFolder(folderPath, targetPath, zipName) { + return __awaiter(this, void 0, void 0, function* () { + var defer = Q.defer(); + core.debug('Archiving ' + folderPath + ' to ' + zipName); + var outputZipPath = path.join(targetPath, zipName); + var output = fs.createWriteStream(outputZipPath); + var archive = archiver('zip'); + output.on('close', function () { + core.debug('Successfully created archive ' + zipName); + defer.resolve(outputZipPath); + }); + output.on('error', function (error) { + defer.reject(error); + }); + archive.pipe(output); + archive.directory(folderPath, '/'); + archive.finalize(); + return defer.promise; + }); +} +exports.archiveFolder = archiveFolder; +/** + * Returns array of files present in archived package + */ +function getArchivedEntries(archivedPackage) { + return __awaiter(this, void 0, void 0, function* () { + var deferred = Q.defer(); + var unzipper = new DecompressZip(archivedPackage); + unzipper.on('error', function (error) { + deferred.reject(error); + }); + unzipper.on('list', function (files) { + var packageComponent = { + "entries": files + }; + deferred.resolve(packageComponent); + }); + unzipper.list(); + return deferred.promise; + }); +} +exports.getArchivedEntries = getArchivedEntries; +function checkIfFilesExistsInZip(archivedPackage, files) { + let deferred = Q.defer(); + for (let i = 0; i < files.length; i++) { + files[i] = files[i].toLowerCase(); + } + const zip = new StreamZip({ + file: archivedPackage, + storeEntries: true, + skipEntryNameValidation: true + }); + zip.on('ready', () => { + let fileCount = 0; + for (let entry in zip.entries()) { + if (files.indexOf(entry.toLowerCase()) != -1) { + fileCount += 1; + } + } + zip.close(); + deferred.resolve(fileCount == files.length); + }); + zip.on('error', error => { + deferred.reject(error); + }); + return deferred.promise; +} +exports.checkIfFilesExistsInZip = checkIfFilesExistsInZip; diff --git a/node_modules/azure-actions-webclient/package.json b/node_modules/azure-actions-webclient/package.json index c851a9890..2695a3b37 100644 --- a/node_modules/azure-actions-webclient/package.json +++ b/node_modules/azure-actions-webclient/package.json @@ -1,66 +1,37 @@ -{ - "_from": "azure-actions-webclient@^1.1.0", - "_id": "azure-actions-webclient@1.1.0", - "_inBundle": false, - "_integrity": "sha512-NbTOiGCuJvLSGg18Rc/DUV2VsyI6deSCeO7Lp/81gFt/EjvrOrH+3pp8kl1CHGAvRXkwvQsyeKEMdiOBk0/5eg==", - "_location": "/azure-actions-webclient", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "azure-actions-webclient@^1.1.0", - "name": "azure-actions-webclient", - "escapedName": "azure-actions-webclient", - "rawSpec": "^1.1.0", - "saveSpec": null, - "fetchSpec": "^1.1.0" - }, - "_requiredBy": [ - "/", - "/azure-actions-appservice-rest" - ], - "_resolved": "https://registry.npmjs.org/azure-actions-webclient/-/azure-actions-webclient-1.1.0.tgz", - "_shasum": "acb09cacb4f8d5ff2f6bea9f5dad3a0005989709", - "_spec": "azure-actions-webclient@^1.1.0", - "_where": "E:\\Repos\\GHActions\\webapps-deploy", - "author": { - "name": "Sumiran Aggarwal", - "email": "suaggar@microsoft.com" - }, - "bugs": { - "url": "https://github.com/Microsoft/pipelines-appservice-lib/issues" - }, - "bundleDependencies": false, - "dependencies": { - "@actions/core": "^1.1.3", - "@actions/exec": "^1.0.1", - "@actions/io": "^1.0.1", - "fs": "0.0.1-security", - "q": "^1.5.1", - "querystring": "^0.2.0", - "typed-rest-client": "^1.5.0", - "util": "^0.12.1" - }, - "deprecated": false, - "description": "Authorize to azure and make rest calls", - "devDependencies": { - "typescript": "^3.6.3" - }, - "homepage": "https://github.com/Microsoft/pipelines-appservice-lib/tree/master/packages/webclient", - "keywords": [ - "webclient", - "actions" - ], - "license": "MIT", - "name": "azure-actions-webclient", - "repository": { - "type": "git", - "url": "git+https://github.com/Microsoft/pipelines-appservice-lib.git" - }, - "scripts": { - "build": "tsc", - "copypackage": "copy package.json lib", - "dist": "npm run build && npm run copypackage && cd lib && npm publish" - }, - "version": "1.1.0" -} +{ + "name": "azure-actions-webclient", + "version": "1.1.0", + "description": "Authorize to azure and make rest calls", + "keywords": [ + "webclient", + "actions" + ], + "scripts": { + "build": "tsc", + "copypackage": "copy package.json lib", + "dist": "npm run build && npm run copypackage && cd lib && npm publish" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/Microsoft/pipelines-appservice-lib.git" + }, + "author": "Sumiran Aggarwal ", + "license": "MIT", + "bugs": { + "url": "https://github.com/Microsoft/pipelines-appservice-lib/issues" + }, + "homepage": "https://github.com/Microsoft/pipelines-appservice-lib/tree/master/packages/webclient", + "devDependencies": { + "typescript": "^3.6.3" + }, + "dependencies": { + "@actions/core": "^1.1.3", + "@actions/exec": "^1.0.1", + "@actions/io": "^1.0.1", + "fs": "0.0.1-security", + "q": "^1.5.1", + "querystring": "^0.2.0", + "typed-rest-client": "^1.5.0", + "util": "^0.12.1" + } +} diff --git a/node_modules/babel-jest/build/ts3.4/index.d.ts b/node_modules/babel-jest/build/ts3.4/index.d.ts index 520333047..859a96446 100644 --- a/node_modules/babel-jest/build/ts3.4/index.d.ts +++ b/node_modules/babel-jest/build/ts3.4/index.d.ts @@ -1,15 +1,15 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import { Transformer } from '@jest/transform'; -import { TransformOptions } from '@babel/core'; -interface BabelJestTransformer extends Transformer { - canInstrument: true; -} -declare const transformer: BabelJestTransformer & { - createTransformer: (options?: TransformOptions) => BabelJestTransformer; -}; -export = transformer; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import { Transformer } from '@jest/transform'; +import { TransformOptions } from '@babel/core'; +interface BabelJestTransformer extends Transformer { + canInstrument: true; +} +declare const transformer: BabelJestTransformer & { + createTransformer: (options?: TransformOptions) => BabelJestTransformer; +}; +export = transformer; diff --git a/node_modules/babel-jest/build/ts3.4/loadBabelConfig.d.ts b/node_modules/babel-jest/build/ts3.4/loadBabelConfig.d.ts index 7e667b29d..84e9e8506 100644 --- a/node_modules/babel-jest/build/ts3.4/loadBabelConfig.d.ts +++ b/node_modules/babel-jest/build/ts3.4/loadBabelConfig.d.ts @@ -1,7 +1,7 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -export { loadPartialConfig } from '@babel/core'; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +export { loadPartialConfig } from '@babel/core'; diff --git a/node_modules/babel-plugin-jest-hoist/build/ts3.4/index.d.ts b/node_modules/babel-plugin-jest-hoist/build/ts3.4/index.d.ts index fe9178b27..f775d53d3 100644 --- a/node_modules/babel-plugin-jest-hoist/build/ts3.4/index.d.ts +++ b/node_modules/babel-plugin-jest-hoist/build/ts3.4/index.d.ts @@ -1,14 +1,14 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ -import { Identifier } from '@babel/types'; -import { PluginObj } from '@babel/core'; -declare const _default: () => PluginObj<{ - declareJestObjGetterIdentifier: () => Identifier; - jestObjGetterIdentifier?: Identifier | undefined; -}>; -export default _default; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + */ +import { Identifier } from '@babel/types'; +import { PluginObj } from '@babel/core'; +declare const _default: () => PluginObj<{ + declareJestObjGetterIdentifier: () => Identifier; + jestObjGetterIdentifier?: Identifier | undefined; +}>; +export default _default; diff --git a/node_modules/balanced-match/package.json b/node_modules/balanced-match/package.json index 5fc21da86..61349c6ed 100644 --- a/node_modules/balanced-match/package.json +++ b/node_modules/balanced-match/package.json @@ -46,8 +46,4 @@ "android-browser/4.2..latest" ] } - -,"_resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz" -,"_integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" -,"_from": "balanced-match@1.0.0" -} \ No newline at end of file +} diff --git a/node_modules/base64-js/package.json b/node_modules/base64-js/package.json index c5a792d4c..fcd84f78f 100644 --- a/node_modules/base64-js/package.json +++ b/node_modules/base64-js/package.json @@ -29,8 +29,4 @@ "test": "npm run lint && npm run unit", "unit": "tape test/*.js" } - -,"_resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.3.1.tgz" -,"_integrity": "sha512-mLQ4i2QO1ytvGWFWmcngKO//JXAQueZvwEKtjgQFM4jIK0kU+ytMfplL8j+n5mspOfjHwoAg+9yhb7BwAHm36g==" -,"_from": "base64-js@1.3.1" -} \ No newline at end of file +} diff --git a/node_modules/binary/package.json b/node_modules/binary/package.json index e085c89dc..c71efb44f 100644 --- a/node_modules/binary/package.json +++ b/node_modules/binary/package.json @@ -35,8 +35,4 @@ "engine" : { "node" : ">=0.4.0" } - -,"_resolved": "https://registry.npmjs.org/binary/-/binary-0.3.0.tgz" -,"_integrity": "sha1-n2BVO8XOjDOG87VTz/R0Yq3sqnk=" -,"_from": "binary@0.3.0" -} \ No newline at end of file +} diff --git a/node_modules/brace-expansion/package.json b/node_modules/brace-expansion/package.json index 99f83cd7d..a18faa8fd 100644 --- a/node_modules/brace-expansion/package.json +++ b/node_modules/brace-expansion/package.json @@ -44,8 +44,4 @@ "android-browser/4.2..latest" ] } - -,"_resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz" -,"_integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==" -,"_from": "brace-expansion@1.1.11" -} \ No newline at end of file +} diff --git a/node_modules/bs-logger/CHANGELOG.md b/node_modules/bs-logger/CHANGELOG.md old mode 100644 new mode 100755 diff --git a/node_modules/bs-logger/README.md b/node_modules/bs-logger/README.md old mode 100644 new mode 100755 diff --git a/node_modules/bs-logger/package.json b/node_modules/bs-logger/package.json old mode 100644 new mode 100755 diff --git a/node_modules/buffer-alloc-unsafe/package.json b/node_modules/buffer-alloc-unsafe/package.json index fcc03de7a..c2ab9042b 100644 --- a/node_modules/buffer-alloc-unsafe/package.json +++ b/node_modules/buffer-alloc-unsafe/package.json @@ -21,8 +21,4 @@ "ponyfill", "unsafe allocate" ] - -,"_resolved": "https://registry.npmjs.org/buffer-alloc-unsafe/-/buffer-alloc-unsafe-1.1.0.tgz" -,"_integrity": "sha512-TEM2iMIEQdJ2yjPJoSIsldnleVaAk1oW3DBVUykyOLsEsFmEc9kn+SFFPz+gl54KQNxlDnAwCXosOS9Okx2xAg==" -,"_from": "buffer-alloc-unsafe@1.1.0" -} \ No newline at end of file +} diff --git a/node_modules/buffer-alloc/package.json b/node_modules/buffer-alloc/package.json index 04142df25..a8a3c3acf 100644 --- a/node_modules/buffer-alloc/package.json +++ b/node_modules/buffer-alloc/package.json @@ -23,8 +23,4 @@ "buffer allocate", "buffer" ] - -,"_resolved": "https://registry.npmjs.org/buffer-alloc/-/buffer-alloc-1.2.0.tgz" -,"_integrity": "sha512-CFsHQgjtW1UChdXgbyJGtnm+O/uLQeZdtbDo8mfUgYXCHSM1wgrVxXm6bSyrUuErEb+4sYVGCzASBRot7zyrow==" -,"_from": "buffer-alloc@1.2.0" -} \ No newline at end of file +} diff --git a/node_modules/buffer-crc32/package.json b/node_modules/buffer-crc32/package.json index 400bced90..e896bec58 100644 --- a/node_modules/buffer-crc32/package.json +++ b/node_modules/buffer-crc32/package.json @@ -36,8 +36,4 @@ "files": [ "index.js" ] - -,"_resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz" -,"_integrity": "sha1-DTM+PwDqxQqhRUq9MO+MKl2ackI=" -,"_from": "buffer-crc32@0.2.13" -} \ No newline at end of file +} diff --git a/node_modules/buffer-fill/package.json b/node_modules/buffer-fill/package.json index 702f4e962..b8f67c586 100644 --- a/node_modules/buffer-fill/package.json +++ b/node_modules/buffer-fill/package.json @@ -13,8 +13,4 @@ "buffer-alloc-unsafe": "^1.1.0", "standard": "^7.1.2" } - -,"_resolved": "https://registry.npmjs.org/buffer-fill/-/buffer-fill-1.0.0.tgz" -,"_integrity": "sha1-+PeLdniYiO858gXNY39o5wISKyw=" -,"_from": "buffer-fill@1.0.0" -} \ No newline at end of file +} diff --git a/node_modules/buffer/package.json b/node_modules/buffer/package.json index 49c7dbb65..9d9c6e071 100644 --- a/node_modules/buffer/package.json +++ b/node_modules/buffer/package.json @@ -76,8 +76,4 @@ "perf/**/*.js" ] } - -,"_resolved": "https://registry.npmjs.org/buffer/-/buffer-5.4.3.tgz" -,"_integrity": "sha512-zvj65TkFeIt3i6aj5bIvJDzjjQQGs4o/sNoezg1F1kYap9Nu2jcUdpwzRSJTHMMzG0H7bZkn4rNQpImhuxWX2A==" -,"_from": "buffer@5.4.3" -} \ No newline at end of file +} diff --git a/node_modules/buffers/package.json b/node_modules/buffers/package.json index 4c9b7ed55..0e5d23cf0 100644 --- a/node_modules/buffers/package.json +++ b/node_modules/buffers/package.json @@ -11,8 +11,4 @@ "engines" : { "node" : ">=0.2.0" } - -,"_resolved": "https://registry.npmjs.org/buffers/-/buffers-0.1.1.tgz" -,"_integrity": "sha1-skV5w77U1tOWru5tmorn9Ugqt7s=" -,"_from": "buffers@0.1.1" -} \ No newline at end of file +} diff --git a/node_modules/chainsaw/index.js b/node_modules/chainsaw/index.js old mode 100644 new mode 100755 diff --git a/node_modules/chainsaw/package.json b/node_modules/chainsaw/package.json index 75c9f5625..d237f56cb 100644 --- a/node_modules/chainsaw/package.json +++ b/node_modules/chainsaw/package.json @@ -20,8 +20,4 @@ "author" : "James Halliday (http://substack.net)", "license" : "MIT/X11", "engine" : { "node" : ">=0.4.0" } - -,"_resolved": "https://registry.npmjs.org/chainsaw/-/chainsaw-0.1.0.tgz" -,"_integrity": "sha1-XqtQsor+WAdNDVgpE4iCi15fvJg=" -,"_from": "chainsaw@0.1.0" -} \ No newline at end of file +} diff --git a/node_modules/color-name/LICENSE b/node_modules/color-name/LICENSE index 4d9802a89..c6b100125 100644 --- a/node_modules/color-name/LICENSE +++ b/node_modules/color-name/LICENSE @@ -1,8 +1,8 @@ -The MIT License (MIT) -Copyright (c) 2015 Dmitry Ivanov - -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 MIT License (MIT) +Copyright (c) 2015 Dmitry Ivanov + +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. \ No newline at end of file diff --git a/node_modules/color-name/README.md b/node_modules/color-name/README.md index 3611a6b52..932b97917 100644 --- a/node_modules/color-name/README.md +++ b/node_modules/color-name/README.md @@ -1,11 +1,11 @@ -A JSON with color names and its values. Based on http://dev.w3.org/csswg/css-color/#named-colors. - -[![NPM](https://nodei.co/npm/color-name.png?mini=true)](https://nodei.co/npm/color-name/) - - -```js -var colors = require('color-name'); -colors.red //[255,0,0] -``` - - +A JSON with color names and its values. Based on http://dev.w3.org/csswg/css-color/#named-colors. + +[![NPM](https://nodei.co/npm/color-name.png?mini=true)](https://nodei.co/npm/color-name/) + + +```js +var colors = require('color-name'); +colors.red //[255,0,0] +``` + + diff --git a/node_modules/color-name/index.js b/node_modules/color-name/index.js index e42aa68a5..b7c198a6f 100644 --- a/node_modules/color-name/index.js +++ b/node_modules/color-name/index.js @@ -1,152 +1,152 @@ -'use strict' - -module.exports = { - "aliceblue": [240, 248, 255], - "antiquewhite": [250, 235, 215], - "aqua": [0, 255, 255], - "aquamarine": [127, 255, 212], - "azure": [240, 255, 255], - "beige": [245, 245, 220], - "bisque": [255, 228, 196], - "black": [0, 0, 0], - "blanchedalmond": [255, 235, 205], - "blue": [0, 0, 255], - "blueviolet": [138, 43, 226], - "brown": [165, 42, 42], - "burlywood": [222, 184, 135], - "cadetblue": [95, 158, 160], - "chartreuse": [127, 255, 0], - "chocolate": [210, 105, 30], - "coral": [255, 127, 80], - "cornflowerblue": [100, 149, 237], - "cornsilk": [255, 248, 220], - "crimson": [220, 20, 60], - "cyan": [0, 255, 255], - "darkblue": [0, 0, 139], - "darkcyan": [0, 139, 139], - "darkgoldenrod": [184, 134, 11], - "darkgray": [169, 169, 169], - "darkgreen": [0, 100, 0], - "darkgrey": [169, 169, 169], - "darkkhaki": [189, 183, 107], - "darkmagenta": [139, 0, 139], - "darkolivegreen": [85, 107, 47], - "darkorange": [255, 140, 0], - "darkorchid": [153, 50, 204], - "darkred": [139, 0, 0], - "darksalmon": [233, 150, 122], - "darkseagreen": [143, 188, 143], - "darkslateblue": [72, 61, 139], - "darkslategray": [47, 79, 79], - "darkslategrey": [47, 79, 79], - "darkturquoise": [0, 206, 209], - "darkviolet": [148, 0, 211], - "deeppink": [255, 20, 147], - "deepskyblue": [0, 191, 255], - "dimgray": [105, 105, 105], - "dimgrey": [105, 105, 105], - "dodgerblue": [30, 144, 255], - "firebrick": [178, 34, 34], - "floralwhite": [255, 250, 240], - "forestgreen": [34, 139, 34], - "fuchsia": [255, 0, 255], - "gainsboro": [220, 220, 220], - "ghostwhite": [248, 248, 255], - "gold": [255, 215, 0], - "goldenrod": [218, 165, 32], - "gray": [128, 128, 128], - "green": [0, 128, 0], - "greenyellow": [173, 255, 47], - "grey": [128, 128, 128], - "honeydew": [240, 255, 240], - "hotpink": [255, 105, 180], - "indianred": [205, 92, 92], - "indigo": [75, 0, 130], - "ivory": [255, 255, 240], - "khaki": [240, 230, 140], - "lavender": [230, 230, 250], - "lavenderblush": [255, 240, 245], - "lawngreen": [124, 252, 0], - "lemonchiffon": [255, 250, 205], - "lightblue": [173, 216, 230], - "lightcoral": [240, 128, 128], - "lightcyan": [224, 255, 255], - "lightgoldenrodyellow": [250, 250, 210], - "lightgray": [211, 211, 211], - "lightgreen": [144, 238, 144], - "lightgrey": [211, 211, 211], - "lightpink": [255, 182, 193], - "lightsalmon": [255, 160, 122], - "lightseagreen": [32, 178, 170], - "lightskyblue": [135, 206, 250], - "lightslategray": [119, 136, 153], - "lightslategrey": [119, 136, 153], - "lightsteelblue": [176, 196, 222], - "lightyellow": [255, 255, 224], - "lime": [0, 255, 0], - "limegreen": [50, 205, 50], - "linen": [250, 240, 230], - "magenta": [255, 0, 255], - "maroon": [128, 0, 0], - "mediumaquamarine": [102, 205, 170], - "mediumblue": [0, 0, 205], - "mediumorchid": [186, 85, 211], - "mediumpurple": [147, 112, 219], - "mediumseagreen": [60, 179, 113], - "mediumslateblue": [123, 104, 238], - "mediumspringgreen": [0, 250, 154], - "mediumturquoise": [72, 209, 204], - "mediumvioletred": [199, 21, 133], - "midnightblue": [25, 25, 112], - "mintcream": [245, 255, 250], - "mistyrose": [255, 228, 225], - "moccasin": [255, 228, 181], - "navajowhite": [255, 222, 173], - "navy": [0, 0, 128], - "oldlace": [253, 245, 230], - "olive": [128, 128, 0], - "olivedrab": [107, 142, 35], - "orange": [255, 165, 0], - "orangered": [255, 69, 0], - "orchid": [218, 112, 214], - "palegoldenrod": [238, 232, 170], - "palegreen": [152, 251, 152], - "paleturquoise": [175, 238, 238], - "palevioletred": [219, 112, 147], - "papayawhip": [255, 239, 213], - "peachpuff": [255, 218, 185], - "peru": [205, 133, 63], - "pink": [255, 192, 203], - "plum": [221, 160, 221], - "powderblue": [176, 224, 230], - "purple": [128, 0, 128], - "rebeccapurple": [102, 51, 153], - "red": [255, 0, 0], - "rosybrown": [188, 143, 143], - "royalblue": [65, 105, 225], - "saddlebrown": [139, 69, 19], - "salmon": [250, 128, 114], - "sandybrown": [244, 164, 96], - "seagreen": [46, 139, 87], - "seashell": [255, 245, 238], - "sienna": [160, 82, 45], - "silver": [192, 192, 192], - "skyblue": [135, 206, 235], - "slateblue": [106, 90, 205], - "slategray": [112, 128, 144], - "slategrey": [112, 128, 144], - "snow": [255, 250, 250], - "springgreen": [0, 255, 127], - "steelblue": [70, 130, 180], - "tan": [210, 180, 140], - "teal": [0, 128, 128], - "thistle": [216, 191, 216], - "tomato": [255, 99, 71], - "turquoise": [64, 224, 208], - "violet": [238, 130, 238], - "wheat": [245, 222, 179], - "white": [255, 255, 255], - "whitesmoke": [245, 245, 245], - "yellow": [255, 255, 0], - "yellowgreen": [154, 205, 50] -}; +'use strict' + +module.exports = { + "aliceblue": [240, 248, 255], + "antiquewhite": [250, 235, 215], + "aqua": [0, 255, 255], + "aquamarine": [127, 255, 212], + "azure": [240, 255, 255], + "beige": [245, 245, 220], + "bisque": [255, 228, 196], + "black": [0, 0, 0], + "blanchedalmond": [255, 235, 205], + "blue": [0, 0, 255], + "blueviolet": [138, 43, 226], + "brown": [165, 42, 42], + "burlywood": [222, 184, 135], + "cadetblue": [95, 158, 160], + "chartreuse": [127, 255, 0], + "chocolate": [210, 105, 30], + "coral": [255, 127, 80], + "cornflowerblue": [100, 149, 237], + "cornsilk": [255, 248, 220], + "crimson": [220, 20, 60], + "cyan": [0, 255, 255], + "darkblue": [0, 0, 139], + "darkcyan": [0, 139, 139], + "darkgoldenrod": [184, 134, 11], + "darkgray": [169, 169, 169], + "darkgreen": [0, 100, 0], + "darkgrey": [169, 169, 169], + "darkkhaki": [189, 183, 107], + "darkmagenta": [139, 0, 139], + "darkolivegreen": [85, 107, 47], + "darkorange": [255, 140, 0], + "darkorchid": [153, 50, 204], + "darkred": [139, 0, 0], + "darksalmon": [233, 150, 122], + "darkseagreen": [143, 188, 143], + "darkslateblue": [72, 61, 139], + "darkslategray": [47, 79, 79], + "darkslategrey": [47, 79, 79], + "darkturquoise": [0, 206, 209], + "darkviolet": [148, 0, 211], + "deeppink": [255, 20, 147], + "deepskyblue": [0, 191, 255], + "dimgray": [105, 105, 105], + "dimgrey": [105, 105, 105], + "dodgerblue": [30, 144, 255], + "firebrick": [178, 34, 34], + "floralwhite": [255, 250, 240], + "forestgreen": [34, 139, 34], + "fuchsia": [255, 0, 255], + "gainsboro": [220, 220, 220], + "ghostwhite": [248, 248, 255], + "gold": [255, 215, 0], + "goldenrod": [218, 165, 32], + "gray": [128, 128, 128], + "green": [0, 128, 0], + "greenyellow": [173, 255, 47], + "grey": [128, 128, 128], + "honeydew": [240, 255, 240], + "hotpink": [255, 105, 180], + "indianred": [205, 92, 92], + "indigo": [75, 0, 130], + "ivory": [255, 255, 240], + "khaki": [240, 230, 140], + "lavender": [230, 230, 250], + "lavenderblush": [255, 240, 245], + "lawngreen": [124, 252, 0], + "lemonchiffon": [255, 250, 205], + "lightblue": [173, 216, 230], + "lightcoral": [240, 128, 128], + "lightcyan": [224, 255, 255], + "lightgoldenrodyellow": [250, 250, 210], + "lightgray": [211, 211, 211], + "lightgreen": [144, 238, 144], + "lightgrey": [211, 211, 211], + "lightpink": [255, 182, 193], + "lightsalmon": [255, 160, 122], + "lightseagreen": [32, 178, 170], + "lightskyblue": [135, 206, 250], + "lightslategray": [119, 136, 153], + "lightslategrey": [119, 136, 153], + "lightsteelblue": [176, 196, 222], + "lightyellow": [255, 255, 224], + "lime": [0, 255, 0], + "limegreen": [50, 205, 50], + "linen": [250, 240, 230], + "magenta": [255, 0, 255], + "maroon": [128, 0, 0], + "mediumaquamarine": [102, 205, 170], + "mediumblue": [0, 0, 205], + "mediumorchid": [186, 85, 211], + "mediumpurple": [147, 112, 219], + "mediumseagreen": [60, 179, 113], + "mediumslateblue": [123, 104, 238], + "mediumspringgreen": [0, 250, 154], + "mediumturquoise": [72, 209, 204], + "mediumvioletred": [199, 21, 133], + "midnightblue": [25, 25, 112], + "mintcream": [245, 255, 250], + "mistyrose": [255, 228, 225], + "moccasin": [255, 228, 181], + "navajowhite": [255, 222, 173], + "navy": [0, 0, 128], + "oldlace": [253, 245, 230], + "olive": [128, 128, 0], + "olivedrab": [107, 142, 35], + "orange": [255, 165, 0], + "orangered": [255, 69, 0], + "orchid": [218, 112, 214], + "palegoldenrod": [238, 232, 170], + "palegreen": [152, 251, 152], + "paleturquoise": [175, 238, 238], + "palevioletred": [219, 112, 147], + "papayawhip": [255, 239, 213], + "peachpuff": [255, 218, 185], + "peru": [205, 133, 63], + "pink": [255, 192, 203], + "plum": [221, 160, 221], + "powderblue": [176, 224, 230], + "purple": [128, 0, 128], + "rebeccapurple": [102, 51, 153], + "red": [255, 0, 0], + "rosybrown": [188, 143, 143], + "royalblue": [65, 105, 225], + "saddlebrown": [139, 69, 19], + "salmon": [250, 128, 114], + "sandybrown": [244, 164, 96], + "seagreen": [46, 139, 87], + "seashell": [255, 245, 238], + "sienna": [160, 82, 45], + "silver": [192, 192, 192], + "skyblue": [135, 206, 235], + "slateblue": [106, 90, 205], + "slategray": [112, 128, 144], + "slategrey": [112, 128, 144], + "snow": [255, 250, 250], + "springgreen": [0, 255, 127], + "steelblue": [70, 130, 180], + "tan": [210, 180, 140], + "teal": [0, 128, 128], + "thistle": [216, 191, 216], + "tomato": [255, 99, 71], + "turquoise": [64, 224, 208], + "violet": [238, 130, 238], + "wheat": [245, 222, 179], + "white": [255, 255, 255], + "whitesmoke": [245, 245, 245], + "yellow": [255, 255, 0], + "yellowgreen": [154, 205, 50] +}; diff --git a/node_modules/color-name/package.json b/node_modules/color-name/package.json index 7acc90285..782dd8287 100644 --- a/node_modules/color-name/package.json +++ b/node_modules/color-name/package.json @@ -1,28 +1,28 @@ -{ - "name": "color-name", - "version": "1.1.4", - "description": "A list of color names and its values", - "main": "index.js", - "files": [ - "index.js" - ], - "scripts": { - "test": "node test.js" - }, - "repository": { - "type": "git", - "url": "git@github.com:colorjs/color-name.git" - }, - "keywords": [ - "color-name", - "color", - "color-keyword", - "keyword" - ], - "author": "DY ", - "license": "MIT", - "bugs": { - "url": "https://github.com/colorjs/color-name/issues" - }, - "homepage": "https://github.com/colorjs/color-name" -} +{ + "name": "color-name", + "version": "1.1.4", + "description": "A list of color names and its values", + "main": "index.js", + "files": [ + "index.js" + ], + "scripts": { + "test": "node test.js" + }, + "repository": { + "type": "git", + "url": "git@github.com:colorjs/color-name.git" + }, + "keywords": [ + "color-name", + "color", + "color-keyword", + "keyword" + ], + "author": "DY ", + "license": "MIT", + "bugs": { + "url": "https://github.com/colorjs/color-name/issues" + }, + "homepage": "https://github.com/colorjs/color-name" +} diff --git a/node_modules/component-emitter/History.md b/node_modules/component-emitter/History.md index e9fb4bc56..30d07d69c 100644 --- a/node_modules/component-emitter/History.md +++ b/node_modules/component-emitter/History.md @@ -1,75 +1,75 @@ - -1.3.0 / 2018-04-15 -================== - - * removed bower support - * expose emitter on `exports` - * prevent de-optimization from using `arguments` - -1.2.1 / 2016-04-18 -================== - - * enable client side use - -1.2.0 / 2014-02-12 -================== - - * prefix events with `$` to support object prototype method names - -1.1.3 / 2014-06-20 -================== - - * republish for npm - * add LICENSE file - -1.1.2 / 2014-02-10 -================== - - * package: rename to "component-emitter" - * package: update "main" and "component" fields - * Add license to Readme (same format as the other components) - * created .npmignore - * travis stuff - -1.1.1 / 2013-12-01 -================== - - * fix .once adding .on to the listener - * docs: Emitter#off() - * component: add `.repo` prop - -1.1.0 / 2013-10-20 -================== - - * add `.addEventListener()` and `.removeEventListener()` aliases - -1.0.1 / 2013-06-27 -================== - - * add support for legacy ie - -1.0.0 / 2013-02-26 -================== - - * add `.off()` support for removing all listeners - -0.0.6 / 2012-10-08 -================== - - * add `this._callbacks` initialization to prevent funky gotcha - -0.0.5 / 2012-09-07 -================== - - * fix `Emitter.call(this)` usage - -0.0.3 / 2012-07-11 -================== - - * add `.listeners()` - * rename `.has()` to `.hasListeners()` - -0.0.2 / 2012-06-28 -================== - - * fix `.off()` with `.once()`-registered callbacks + +1.3.0 / 2018-04-15 +================== + + * removed bower support + * expose emitter on `exports` + * prevent de-optimization from using `arguments` + +1.2.1 / 2016-04-18 +================== + + * enable client side use + +1.2.0 / 2014-02-12 +================== + + * prefix events with `$` to support object prototype method names + +1.1.3 / 2014-06-20 +================== + + * republish for npm + * add LICENSE file + +1.1.2 / 2014-02-10 +================== + + * package: rename to "component-emitter" + * package: update "main" and "component" fields + * Add license to Readme (same format as the other components) + * created .npmignore + * travis stuff + +1.1.1 / 2013-12-01 +================== + + * fix .once adding .on to the listener + * docs: Emitter#off() + * component: add `.repo` prop + +1.1.0 / 2013-10-20 +================== + + * add `.addEventListener()` and `.removeEventListener()` aliases + +1.0.1 / 2013-06-27 +================== + + * add support for legacy ie + +1.0.0 / 2013-02-26 +================== + + * add `.off()` support for removing all listeners + +0.0.6 / 2012-10-08 +================== + + * add `this._callbacks` initialization to prevent funky gotcha + +0.0.5 / 2012-09-07 +================== + + * fix `Emitter.call(this)` usage + +0.0.3 / 2012-07-11 +================== + + * add `.listeners()` + * rename `.has()` to `.hasListeners()` + +0.0.2 / 2012-06-28 +================== + + * fix `.off()` with `.once()`-registered callbacks diff --git a/node_modules/component-emitter/LICENSE b/node_modules/component-emitter/LICENSE index de5169273..d6e43f2bd 100644 --- a/node_modules/component-emitter/LICENSE +++ b/node_modules/component-emitter/LICENSE @@ -1,24 +1,24 @@ -(The MIT License) - -Copyright (c) 2014 Component contributors - -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. +(The MIT License) + +Copyright (c) 2014 Component contributors + +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/node_modules/component-emitter/Readme.md b/node_modules/component-emitter/Readme.md index 0f3f9b9fc..046641119 100644 --- a/node_modules/component-emitter/Readme.md +++ b/node_modules/component-emitter/Readme.md @@ -1,74 +1,74 @@ -# Emitter [![Build Status](https://travis-ci.org/component/emitter.png)](https://travis-ci.org/component/emitter) - - Event emitter component. - -## Installation - -``` -$ component install component/emitter -``` - -## API - -### Emitter(obj) - - The `Emitter` may also be used as a mixin. For example - a "plain" object may become an emitter, or you may - extend an existing prototype. - - As an `Emitter` instance: - -```js -var Emitter = require('emitter'); -var emitter = new Emitter; -emitter.emit('something'); -``` - - As a mixin: - -```js -var Emitter = require('emitter'); -var user = { name: 'tobi' }; -Emitter(user); - -user.emit('im a user'); -``` - - As a prototype mixin: - -```js -var Emitter = require('emitter'); -Emitter(User.prototype); -``` - -### Emitter#on(event, fn) - - Register an `event` handler `fn`. - -### Emitter#once(event, fn) - - Register a single-shot `event` handler `fn`, - removed immediately after it is invoked the - first time. - -### Emitter#off(event, fn) - - * Pass `event` and `fn` to remove a listener. - * Pass `event` to remove all listeners on that event. - * Pass nothing to remove all listeners on all events. - -### Emitter#emit(event, ...) - - Emit an `event` with variable option args. - -### Emitter#listeners(event) - - Return an array of callbacks, or an empty array. - -### Emitter#hasListeners(event) - - Check if this emitter has `event` handlers. - -## License - -MIT +# Emitter [![Build Status](https://travis-ci.org/component/emitter.png)](https://travis-ci.org/component/emitter) + + Event emitter component. + +## Installation + +``` +$ component install component/emitter +``` + +## API + +### Emitter(obj) + + The `Emitter` may also be used as a mixin. For example + a "plain" object may become an emitter, or you may + extend an existing prototype. + + As an `Emitter` instance: + +```js +var Emitter = require('emitter'); +var emitter = new Emitter; +emitter.emit('something'); +``` + + As a mixin: + +```js +var Emitter = require('emitter'); +var user = { name: 'tobi' }; +Emitter(user); + +user.emit('im a user'); +``` + + As a prototype mixin: + +```js +var Emitter = require('emitter'); +Emitter(User.prototype); +``` + +### Emitter#on(event, fn) + + Register an `event` handler `fn`. + +### Emitter#once(event, fn) + + Register a single-shot `event` handler `fn`, + removed immediately after it is invoked the + first time. + +### Emitter#off(event, fn) + + * Pass `event` and `fn` to remove a listener. + * Pass `event` to remove all listeners on that event. + * Pass nothing to remove all listeners on all events. + +### Emitter#emit(event, ...) + + Emit an `event` with variable option args. + +### Emitter#listeners(event) + + Return an array of callbacks, or an empty array. + +### Emitter#hasListeners(event) + + Check if this emitter has `event` handlers. + +## License + +MIT diff --git a/node_modules/component-emitter/index.js b/node_modules/component-emitter/index.js index 6d7ed0ab3..7e375c252 100644 --- a/node_modules/component-emitter/index.js +++ b/node_modules/component-emitter/index.js @@ -1,175 +1,175 @@ - -/** - * Expose `Emitter`. - */ - -if (typeof module !== 'undefined') { - module.exports = Emitter; -} - -/** - * Initialize a new `Emitter`. - * - * @api public - */ - -function Emitter(obj) { - if (obj) return mixin(obj); -}; - -/** - * Mixin the emitter properties. - * - * @param {Object} obj - * @return {Object} - * @api private - */ - -function mixin(obj) { - for (var key in Emitter.prototype) { - obj[key] = Emitter.prototype[key]; - } - return obj; -} - -/** - * Listen on the given `event` with `fn`. - * - * @param {String} event - * @param {Function} fn - * @return {Emitter} - * @api public - */ - -Emitter.prototype.on = -Emitter.prototype.addEventListener = function(event, fn){ - this._callbacks = this._callbacks || {}; - (this._callbacks['$' + event] = this._callbacks['$' + event] || []) - .push(fn); - return this; -}; - -/** - * Adds an `event` listener that will be invoked a single - * time then automatically removed. - * - * @param {String} event - * @param {Function} fn - * @return {Emitter} - * @api public - */ - -Emitter.prototype.once = function(event, fn){ - function on() { - this.off(event, on); - fn.apply(this, arguments); - } - - on.fn = fn; - this.on(event, on); - return this; -}; - -/** - * Remove the given callback for `event` or all - * registered callbacks. - * - * @param {String} event - * @param {Function} fn - * @return {Emitter} - * @api public - */ - -Emitter.prototype.off = -Emitter.prototype.removeListener = -Emitter.prototype.removeAllListeners = -Emitter.prototype.removeEventListener = function(event, fn){ - this._callbacks = this._callbacks || {}; - - // all - if (0 == arguments.length) { - this._callbacks = {}; - return this; - } - - // specific event - var callbacks = this._callbacks['$' + event]; - if (!callbacks) return this; - - // remove all handlers - if (1 == arguments.length) { - delete this._callbacks['$' + event]; - return this; - } - - // remove specific handler - var cb; - for (var i = 0; i < callbacks.length; i++) { - cb = callbacks[i]; - if (cb === fn || cb.fn === fn) { - callbacks.splice(i, 1); - break; - } - } - - // Remove event specific arrays for event types that no - // one is subscribed for to avoid memory leak. - if (callbacks.length === 0) { - delete this._callbacks['$' + event]; - } - - return this; -}; - -/** - * Emit `event` with the given args. - * - * @param {String} event - * @param {Mixed} ... - * @return {Emitter} - */ - -Emitter.prototype.emit = function(event){ - this._callbacks = this._callbacks || {}; - - var args = new Array(arguments.length - 1) - , callbacks = this._callbacks['$' + event]; - - for (var i = 1; i < arguments.length; i++) { - args[i - 1] = arguments[i]; - } - - if (callbacks) { - callbacks = callbacks.slice(0); - for (var i = 0, len = callbacks.length; i < len; ++i) { - callbacks[i].apply(this, args); - } - } - - return this; -}; - -/** - * Return array of callbacks for `event`. - * - * @param {String} event - * @return {Array} - * @api public - */ - -Emitter.prototype.listeners = function(event){ - this._callbacks = this._callbacks || {}; - return this._callbacks['$' + event] || []; -}; - -/** - * Check if this emitter has `event` handlers. - * - * @param {String} event - * @return {Boolean} - * @api public - */ - -Emitter.prototype.hasListeners = function(event){ - return !! this.listeners(event).length; -}; + +/** + * Expose `Emitter`. + */ + +if (typeof module !== 'undefined') { + module.exports = Emitter; +} + +/** + * Initialize a new `Emitter`. + * + * @api public + */ + +function Emitter(obj) { + if (obj) return mixin(obj); +}; + +/** + * Mixin the emitter properties. + * + * @param {Object} obj + * @return {Object} + * @api private + */ + +function mixin(obj) { + for (var key in Emitter.prototype) { + obj[key] = Emitter.prototype[key]; + } + return obj; +} + +/** + * Listen on the given `event` with `fn`. + * + * @param {String} event + * @param {Function} fn + * @return {Emitter} + * @api public + */ + +Emitter.prototype.on = +Emitter.prototype.addEventListener = function(event, fn){ + this._callbacks = this._callbacks || {}; + (this._callbacks['$' + event] = this._callbacks['$' + event] || []) + .push(fn); + return this; +}; + +/** + * Adds an `event` listener that will be invoked a single + * time then automatically removed. + * + * @param {String} event + * @param {Function} fn + * @return {Emitter} + * @api public + */ + +Emitter.prototype.once = function(event, fn){ + function on() { + this.off(event, on); + fn.apply(this, arguments); + } + + on.fn = fn; + this.on(event, on); + return this; +}; + +/** + * Remove the given callback for `event` or all + * registered callbacks. + * + * @param {String} event + * @param {Function} fn + * @return {Emitter} + * @api public + */ + +Emitter.prototype.off = +Emitter.prototype.removeListener = +Emitter.prototype.removeAllListeners = +Emitter.prototype.removeEventListener = function(event, fn){ + this._callbacks = this._callbacks || {}; + + // all + if (0 == arguments.length) { + this._callbacks = {}; + return this; + } + + // specific event + var callbacks = this._callbacks['$' + event]; + if (!callbacks) return this; + + // remove all handlers + if (1 == arguments.length) { + delete this._callbacks['$' + event]; + return this; + } + + // remove specific handler + var cb; + for (var i = 0; i < callbacks.length; i++) { + cb = callbacks[i]; + if (cb === fn || cb.fn === fn) { + callbacks.splice(i, 1); + break; + } + } + + // Remove event specific arrays for event types that no + // one is subscribed for to avoid memory leak. + if (callbacks.length === 0) { + delete this._callbacks['$' + event]; + } + + return this; +}; + +/** + * Emit `event` with the given args. + * + * @param {String} event + * @param {Mixed} ... + * @return {Emitter} + */ + +Emitter.prototype.emit = function(event){ + this._callbacks = this._callbacks || {}; + + var args = new Array(arguments.length - 1) + , callbacks = this._callbacks['$' + event]; + + for (var i = 1; i < arguments.length; i++) { + args[i - 1] = arguments[i]; + } + + if (callbacks) { + callbacks = callbacks.slice(0); + for (var i = 0, len = callbacks.length; i < len; ++i) { + callbacks[i].apply(this, args); + } + } + + return this; +}; + +/** + * Return array of callbacks for `event`. + * + * @param {String} event + * @return {Array} + * @api public + */ + +Emitter.prototype.listeners = function(event){ + this._callbacks = this._callbacks || {}; + return this._callbacks['$' + event] || []; +}; + +/** + * Check if this emitter has `event` handlers. + * + * @param {String} event + * @return {Boolean} + * @api public + */ + +Emitter.prototype.hasListeners = function(event){ + return !! this.listeners(event).length; +}; diff --git a/node_modules/compress-commons/LICENSE b/node_modules/compress-commons/LICENSE index 56420a6a0..819b403f0 100644 --- a/node_modules/compress-commons/LICENSE +++ b/node_modules/compress-commons/LICENSE @@ -1,22 +1,22 @@ -Copyright (c) 2014 Chris Talkington, contributors. - -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 +Copyright (c) 2014 Chris Talkington, contributors. + +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. \ No newline at end of file diff --git a/node_modules/compress-commons/README.md b/node_modules/compress-commons/README.md index 785bf832f..04eec191b 100644 --- a/node_modules/compress-commons/README.md +++ b/node_modules/compress-commons/README.md @@ -1,25 +1,25 @@ -# Compress Commons v1.2.1 [![Build Status](https://travis-ci.org/archiverjs/node-compress-commons.svg?branch=master)](https://travis-ci.org/archiverjs/node-compress-commons) [![Build status](https://ci.appveyor.com/api/projects/status/fx3066dufdpar0it/branch/master?svg=true)](https://ci.appveyor.com/project/ctalkington/node-compress-commons/branch/master) - -Compress Commons is a library that defines a common interface for working with archive formats within node. - -[![NPM](https://nodei.co/npm/compress-commons.png)](https://nodei.co/npm/compress-commons/) - -## Install - -```bash -npm install compress-commons --save -``` - -You can also use `npm install https://github.com/archiverjs/node-compress-commons/archive/master.tar.gz` to test upcoming versions. - -## Things of Interest - -- [Changelog](https://github.com/archiverjs/node-compress-commons/releases) -- [Contributing](https://github.com/archiverjs/node-compress-commons/blob/master/CONTRIBUTING.md) -- [MIT License](https://github.com/archiverjs/node-compress-commons/blob/master/LICENSE-MIT) - -## Credits - -Concept inspired by [Apache Commons Compress](http://commons.apache.org/proper/commons-compress/)™. - +# Compress Commons v1.2.1 [![Build Status](https://travis-ci.org/archiverjs/node-compress-commons.svg?branch=master)](https://travis-ci.org/archiverjs/node-compress-commons) [![Build status](https://ci.appveyor.com/api/projects/status/fx3066dufdpar0it/branch/master?svg=true)](https://ci.appveyor.com/project/ctalkington/node-compress-commons/branch/master) + +Compress Commons is a library that defines a common interface for working with archive formats within node. + +[![NPM](https://nodei.co/npm/compress-commons.png)](https://nodei.co/npm/compress-commons/) + +## Install + +```bash +npm install compress-commons --save +``` + +You can also use `npm install https://github.com/archiverjs/node-compress-commons/archive/master.tar.gz` to test upcoming versions. + +## Things of Interest + +- [Changelog](https://github.com/archiverjs/node-compress-commons/releases) +- [Contributing](https://github.com/archiverjs/node-compress-commons/blob/master/CONTRIBUTING.md) +- [MIT License](https://github.com/archiverjs/node-compress-commons/blob/master/LICENSE-MIT) + +## Credits + +Concept inspired by [Apache Commons Compress](http://commons.apache.org/proper/commons-compress/)™. + Some logic derived from [Apache Commons Compress](http://commons.apache.org/proper/commons-compress/)™ and [OpenJDK 7](http://openjdk.java.net/). \ No newline at end of file diff --git a/node_modules/compress-commons/lib/archivers/archive-entry.js b/node_modules/compress-commons/lib/archivers/archive-entry.js index 86bc59886..fda0bd1cf 100644 --- a/node_modules/compress-commons/lib/archivers/archive-entry.js +++ b/node_modules/compress-commons/lib/archivers/archive-entry.js @@ -1,16 +1,16 @@ -/** - * node-compress-commons - * - * Copyright (c) 2014 Chris Talkington, contributors. - * Licensed under the MIT license. - * https://github.com/archiverjs/node-compress-commons/blob/master/LICENSE-MIT - */ -var ArchiveEntry = module.exports = function() {}; - -ArchiveEntry.prototype.getName = function() {}; - -ArchiveEntry.prototype.getSize = function() {}; - -ArchiveEntry.prototype.getLastModifiedDate = function() {}; - +/** + * node-compress-commons + * + * Copyright (c) 2014 Chris Talkington, contributors. + * Licensed under the MIT license. + * https://github.com/archiverjs/node-compress-commons/blob/master/LICENSE-MIT + */ +var ArchiveEntry = module.exports = function() {}; + +ArchiveEntry.prototype.getName = function() {}; + +ArchiveEntry.prototype.getSize = function() {}; + +ArchiveEntry.prototype.getLastModifiedDate = function() {}; + ArchiveEntry.prototype.isDirectory = function() {}; \ No newline at end of file diff --git a/node_modules/compress-commons/lib/archivers/archive-output-stream.js b/node_modules/compress-commons/lib/archivers/archive-output-stream.js index b5fa4939c..f98da7b0d 100644 --- a/node_modules/compress-commons/lib/archivers/archive-output-stream.js +++ b/node_modules/compress-commons/lib/archivers/archive-output-stream.js @@ -1,117 +1,117 @@ -/** - * node-compress-commons - * - * Copyright (c) 2014 Chris Talkington, contributors. - * Licensed under the MIT license. - * https://github.com/archiverjs/node-compress-commons/blob/master/LICENSE-MIT - */ -var inherits = require('util').inherits; -var Transform = require('readable-stream').Transform; - -var ArchiveEntry = require('./archive-entry'); -var util = require('../util'); - -var ArchiveOutputStream = module.exports = function(options) { - if (!(this instanceof ArchiveOutputStream)) { - return new ArchiveOutputStream(options); - } - - Transform.call(this, options); - - this.offset = 0; - this._archive = { - finish: false, - finished: false, - processing: false - }; -}; - -inherits(ArchiveOutputStream, Transform); - -ArchiveOutputStream.prototype._appendBuffer = function(zae, source, callback) { - // scaffold only -}; - -ArchiveOutputStream.prototype._appendStream = function(zae, source, callback) { - // scaffold only -}; - -ArchiveOutputStream.prototype._emitErrorCallback = function(err) { - if (err) { - this.emit('error', err); - } -}; - -ArchiveOutputStream.prototype._finish = function(ae) { - // scaffold only -}; - -ArchiveOutputStream.prototype._normalizeEntry = function(ae) { - // scaffold only -}; - -ArchiveOutputStream.prototype._transform = function(chunk, encoding, callback) { - callback(null, chunk); -}; - -ArchiveOutputStream.prototype.entry = function(ae, source, callback) { - source = source || null; - - if (typeof callback !== 'function') { - callback = this._emitErrorCallback.bind(this); - } - - if (!(ae instanceof ArchiveEntry)) { - callback(new Error('not a valid instance of ArchiveEntry')); - return; - } - - if (this._archive.finish || this._archive.finished) { - callback(new Error('unacceptable entry after finish')); - return; - } - - if (this._archive.processing) { - callback(new Error('already processing an entry')); - return; - } - - this._archive.processing = true; - this._normalizeEntry(ae); - this._entry = ae; - - source = util.normalizeInputSource(source); - - if (Buffer.isBuffer(source)) { - this._appendBuffer(ae, source, callback); - } else if (util.isStream(source)) { - this._appendStream(ae, source, callback); - } else { - this._archive.processing = false; - callback(new Error('input source must be valid Stream or Buffer instance')); - return; - } - - return this; -}; - -ArchiveOutputStream.prototype.finish = function() { - if (this._archive.processing) { - this._archive.finish = true; - return; - } - - this._finish(); -}; - -ArchiveOutputStream.prototype.getBytesWritten = function() { - return this.offset; -}; - -ArchiveOutputStream.prototype.write = function(chunk, cb) { - if (chunk) { - this.offset += chunk.length; - } - - return Transform.prototype.write.call(this, chunk, cb); +/** + * node-compress-commons + * + * Copyright (c) 2014 Chris Talkington, contributors. + * Licensed under the MIT license. + * https://github.com/archiverjs/node-compress-commons/blob/master/LICENSE-MIT + */ +var inherits = require('util').inherits; +var Transform = require('readable-stream').Transform; + +var ArchiveEntry = require('./archive-entry'); +var util = require('../util'); + +var ArchiveOutputStream = module.exports = function(options) { + if (!(this instanceof ArchiveOutputStream)) { + return new ArchiveOutputStream(options); + } + + Transform.call(this, options); + + this.offset = 0; + this._archive = { + finish: false, + finished: false, + processing: false + }; +}; + +inherits(ArchiveOutputStream, Transform); + +ArchiveOutputStream.prototype._appendBuffer = function(zae, source, callback) { + // scaffold only +}; + +ArchiveOutputStream.prototype._appendStream = function(zae, source, callback) { + // scaffold only +}; + +ArchiveOutputStream.prototype._emitErrorCallback = function(err) { + if (err) { + this.emit('error', err); + } +}; + +ArchiveOutputStream.prototype._finish = function(ae) { + // scaffold only +}; + +ArchiveOutputStream.prototype._normalizeEntry = function(ae) { + // scaffold only +}; + +ArchiveOutputStream.prototype._transform = function(chunk, encoding, callback) { + callback(null, chunk); +}; + +ArchiveOutputStream.prototype.entry = function(ae, source, callback) { + source = source || null; + + if (typeof callback !== 'function') { + callback = this._emitErrorCallback.bind(this); + } + + if (!(ae instanceof ArchiveEntry)) { + callback(new Error('not a valid instance of ArchiveEntry')); + return; + } + + if (this._archive.finish || this._archive.finished) { + callback(new Error('unacceptable entry after finish')); + return; + } + + if (this._archive.processing) { + callback(new Error('already processing an entry')); + return; + } + + this._archive.processing = true; + this._normalizeEntry(ae); + this._entry = ae; + + source = util.normalizeInputSource(source); + + if (Buffer.isBuffer(source)) { + this._appendBuffer(ae, source, callback); + } else if (util.isStream(source)) { + this._appendStream(ae, source, callback); + } else { + this._archive.processing = false; + callback(new Error('input source must be valid Stream or Buffer instance')); + return; + } + + return this; +}; + +ArchiveOutputStream.prototype.finish = function() { + if (this._archive.processing) { + this._archive.finish = true; + return; + } + + this._finish(); +}; + +ArchiveOutputStream.prototype.getBytesWritten = function() { + return this.offset; +}; + +ArchiveOutputStream.prototype.write = function(chunk, cb) { + if (chunk) { + this.offset += chunk.length; + } + + return Transform.prototype.write.call(this, chunk, cb); }; \ No newline at end of file diff --git a/node_modules/compress-commons/lib/archivers/zip/constants.js b/node_modules/compress-commons/lib/archivers/zip/constants.js index f2bea8196..34181ecf8 100644 --- a/node_modules/compress-commons/lib/archivers/zip/constants.js +++ b/node_modules/compress-commons/lib/archivers/zip/constants.js @@ -1,71 +1,71 @@ -/** - * node-compress-commons - * - * Copyright (c) 2014 Chris Talkington, contributors. - * Licensed under the MIT license. - * https://github.com/archiverjs/node-compress-commons/blob/master/LICENSE-MIT - */ -module.exports = { - WORD: 4, - DWORD: 8, - EMPTY: new Buffer(0), - - SHORT: 2, - SHORT_MASK: 0xffff, - SHORT_SHIFT: 16, - SHORT_ZERO: new Buffer(Array(2)), - LONG: 4, - LONG_ZERO: new Buffer(Array(4)), - - MIN_VERSION_INITIAL: 10, - MIN_VERSION_DATA_DESCRIPTOR: 20, - MIN_VERSION_ZIP64: 45, - VERSION_MADEBY: 45, - - METHOD_STORED: 0, - METHOD_DEFLATED: 8, - - PLATFORM_UNIX: 3, - PLATFORM_FAT: 0, - - SIG_LFH: 0x04034b50, - SIG_DD: 0x08074b50, - SIG_CFH: 0x02014b50, - SIG_EOCD: 0x06054b50, - SIG_ZIP64_EOCD: 0x06064B50, - SIG_ZIP64_EOCD_LOC: 0x07064B50, - - ZIP64_MAGIC_SHORT: 0xffff, - ZIP64_MAGIC: 0xffffffff, - ZIP64_EXTRA_ID: 0x0001, - - ZLIB_NO_COMPRESSION: 0, - ZLIB_BEST_SPEED: 1, - ZLIB_BEST_COMPRESSION: 9, - ZLIB_DEFAULT_COMPRESSION: -1, - - MODE_MASK: 0xFFF, - DEFAULT_FILE_MODE: 33188, // 010644 = -rw-r--r-- = S_IFREG | S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH - DEFAULT_DIR_MODE: 16877, // 040755 = drwxr-xr-x = S_IFDIR | S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH - - EXT_FILE_ATTR_DIR: 1106051088, // 010173200020 = drwxr-xr-x = (((S_IFDIR | 0755) << 16) | S_DOS_D) - EXT_FILE_ATTR_FILE: 2175008800, // 020151000040 = -rw-r--r-- = (((S_IFREG | 0644) << 16) | S_DOS_A) >>> 0 - - // Unix file types - S_IFMT: 61440, // 0170000 type of file mask - S_IFIFO: 4096, // 010000 named pipe (fifo) - S_IFCHR: 8192, // 020000 character special - S_IFDIR: 16384, // 040000 directory - S_IFBLK: 24576, // 060000 block special - S_IFREG: 32768, // 0100000 regular - S_IFLNK: 40960, // 0120000 symbolic link - S_IFSOCK: 49152, // 0140000 socket - - // DOS file type flags - S_DOS_A: 32, // 040 Archive - S_DOS_D: 16, // 020 Directory - S_DOS_V: 8, // 010 Volume - S_DOS_S: 4, // 04 System - S_DOS_H: 2, // 02 Hidden - S_DOS_R: 1 // 01 Read Only -}; +/** + * node-compress-commons + * + * Copyright (c) 2014 Chris Talkington, contributors. + * Licensed under the MIT license. + * https://github.com/archiverjs/node-compress-commons/blob/master/LICENSE-MIT + */ +module.exports = { + WORD: 4, + DWORD: 8, + EMPTY: new Buffer(0), + + SHORT: 2, + SHORT_MASK: 0xffff, + SHORT_SHIFT: 16, + SHORT_ZERO: new Buffer(Array(2)), + LONG: 4, + LONG_ZERO: new Buffer(Array(4)), + + MIN_VERSION_INITIAL: 10, + MIN_VERSION_DATA_DESCRIPTOR: 20, + MIN_VERSION_ZIP64: 45, + VERSION_MADEBY: 45, + + METHOD_STORED: 0, + METHOD_DEFLATED: 8, + + PLATFORM_UNIX: 3, + PLATFORM_FAT: 0, + + SIG_LFH: 0x04034b50, + SIG_DD: 0x08074b50, + SIG_CFH: 0x02014b50, + SIG_EOCD: 0x06054b50, + SIG_ZIP64_EOCD: 0x06064B50, + SIG_ZIP64_EOCD_LOC: 0x07064B50, + + ZIP64_MAGIC_SHORT: 0xffff, + ZIP64_MAGIC: 0xffffffff, + ZIP64_EXTRA_ID: 0x0001, + + ZLIB_NO_COMPRESSION: 0, + ZLIB_BEST_SPEED: 1, + ZLIB_BEST_COMPRESSION: 9, + ZLIB_DEFAULT_COMPRESSION: -1, + + MODE_MASK: 0xFFF, + DEFAULT_FILE_MODE: 33188, // 010644 = -rw-r--r-- = S_IFREG | S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH + DEFAULT_DIR_MODE: 16877, // 040755 = drwxr-xr-x = S_IFDIR | S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH + + EXT_FILE_ATTR_DIR: 1106051088, // 010173200020 = drwxr-xr-x = (((S_IFDIR | 0755) << 16) | S_DOS_D) + EXT_FILE_ATTR_FILE: 2175008800, // 020151000040 = -rw-r--r-- = (((S_IFREG | 0644) << 16) | S_DOS_A) >>> 0 + + // Unix file types + S_IFMT: 61440, // 0170000 type of file mask + S_IFIFO: 4096, // 010000 named pipe (fifo) + S_IFCHR: 8192, // 020000 character special + S_IFDIR: 16384, // 040000 directory + S_IFBLK: 24576, // 060000 block special + S_IFREG: 32768, // 0100000 regular + S_IFLNK: 40960, // 0120000 symbolic link + S_IFSOCK: 49152, // 0140000 socket + + // DOS file type flags + S_DOS_A: 32, // 040 Archive + S_DOS_D: 16, // 020 Directory + S_DOS_V: 8, // 010 Volume + S_DOS_S: 4, // 04 System + S_DOS_H: 2, // 02 Hidden + S_DOS_R: 1 // 01 Read Only +}; diff --git a/node_modules/compress-commons/lib/archivers/zip/general-purpose-bit.js b/node_modules/compress-commons/lib/archivers/zip/general-purpose-bit.js index 62703996a..08b62b896 100644 --- a/node_modules/compress-commons/lib/archivers/zip/general-purpose-bit.js +++ b/node_modules/compress-commons/lib/archivers/zip/general-purpose-bit.js @@ -1,101 +1,101 @@ -/** - * node-compress-commons - * - * Copyright (c) 2014 Chris Talkington, contributors. - * Licensed under the MIT license. - * https://github.com/archiverjs/node-compress-commons/blob/master/LICENSE-MIT - */ -var zipUtil = require('./util'); - -var DATA_DESCRIPTOR_FLAG = 1 << 3; -var ENCRYPTION_FLAG = 1 << 0; -var NUMBER_OF_SHANNON_FANO_TREES_FLAG = 1 << 2; -var SLIDING_DICTIONARY_SIZE_FLAG = 1 << 1; -var STRONG_ENCRYPTION_FLAG = 1 << 6; -var UFT8_NAMES_FLAG = 1 << 11; - -var GeneralPurposeBit = module.exports = function() { - if (!(this instanceof GeneralPurposeBit)) { - return new GeneralPurposeBit(); - } - - this.descriptor = false; - this.encryption = false; - this.utf8 = false; - this.numberOfShannonFanoTrees = 0; - this.strongEncryption = false; - this.slidingDictionarySize = 0; - - return this; -}; - -GeneralPurposeBit.prototype.encode = function() { - return zipUtil.getShortBytes( - (this.descriptor ? DATA_DESCRIPTOR_FLAG : 0) | - (this.utf8 ? UFT8_NAMES_FLAG : 0) | - (this.encryption ? ENCRYPTION_FLAG : 0) | - (this.strongEncryption ? STRONG_ENCRYPTION_FLAG : 0) - ); -}; - -GeneralPurposeBit.prototype.parse = function(buf, offset) { - var flag = zipUtil.getShortBytesValue(buf, offset); - var gbp = new GeneralPurposeBit(); - - gbp.useDataDescriptor((flag & DATA_DESCRIPTOR_FLAG) !== 0); - gbp.useUTF8ForNames((flag & UFT8_NAMES_FLAG) !== 0); - gbp.useStrongEncryption((flag & STRONG_ENCRYPTION_FLAG) !== 0); - gbp.useEncryption((flag & ENCRYPTION_FLAG) !== 0); - gbp.setSlidingDictionarySize((flag & SLIDING_DICTIONARY_SIZE_FLAG) !== 0 ? 8192 : 4096); - gbp.setNumberOfShannonFanoTrees((flag & NUMBER_OF_SHANNON_FANO_TREES_FLAG) !== 0 ? 3 : 2); - - return gbp; -}; - -GeneralPurposeBit.prototype.setNumberOfShannonFanoTrees = function(n) { - this.numberOfShannonFanoTrees = n; -}; - -GeneralPurposeBit.prototype.getNumberOfShannonFanoTrees = function() { - return this.numberOfShannonFanoTrees; -}; - -GeneralPurposeBit.prototype.setSlidingDictionarySize = function(n) { - this.slidingDictionarySize = n; -}; - -GeneralPurposeBit.prototype.getSlidingDictionarySize = function() { - return this.slidingDictionarySize; -}; - -GeneralPurposeBit.prototype.useDataDescriptor = function(b) { - this.descriptor = b; -}; - -GeneralPurposeBit.prototype.usesDataDescriptor = function() { - return this.descriptor; -}; - -GeneralPurposeBit.prototype.useEncryption = function(b) { - this.encryption = b; -}; - -GeneralPurposeBit.prototype.usesEncryption = function() { - return this.encryption; -}; - -GeneralPurposeBit.prototype.useStrongEncryption = function(b) { - this.strongEncryption = b; -}; - -GeneralPurposeBit.prototype.usesStrongEncryption = function() { - return this.strongEncryption; -}; - -GeneralPurposeBit.prototype.useUTF8ForNames = function(b) { - this.utf8 = b; -}; - -GeneralPurposeBit.prototype.usesUTF8ForNames = function() { - return this.utf8; +/** + * node-compress-commons + * + * Copyright (c) 2014 Chris Talkington, contributors. + * Licensed under the MIT license. + * https://github.com/archiverjs/node-compress-commons/blob/master/LICENSE-MIT + */ +var zipUtil = require('./util'); + +var DATA_DESCRIPTOR_FLAG = 1 << 3; +var ENCRYPTION_FLAG = 1 << 0; +var NUMBER_OF_SHANNON_FANO_TREES_FLAG = 1 << 2; +var SLIDING_DICTIONARY_SIZE_FLAG = 1 << 1; +var STRONG_ENCRYPTION_FLAG = 1 << 6; +var UFT8_NAMES_FLAG = 1 << 11; + +var GeneralPurposeBit = module.exports = function() { + if (!(this instanceof GeneralPurposeBit)) { + return new GeneralPurposeBit(); + } + + this.descriptor = false; + this.encryption = false; + this.utf8 = false; + this.numberOfShannonFanoTrees = 0; + this.strongEncryption = false; + this.slidingDictionarySize = 0; + + return this; +}; + +GeneralPurposeBit.prototype.encode = function() { + return zipUtil.getShortBytes( + (this.descriptor ? DATA_DESCRIPTOR_FLAG : 0) | + (this.utf8 ? UFT8_NAMES_FLAG : 0) | + (this.encryption ? ENCRYPTION_FLAG : 0) | + (this.strongEncryption ? STRONG_ENCRYPTION_FLAG : 0) + ); +}; + +GeneralPurposeBit.prototype.parse = function(buf, offset) { + var flag = zipUtil.getShortBytesValue(buf, offset); + var gbp = new GeneralPurposeBit(); + + gbp.useDataDescriptor((flag & DATA_DESCRIPTOR_FLAG) !== 0); + gbp.useUTF8ForNames((flag & UFT8_NAMES_FLAG) !== 0); + gbp.useStrongEncryption((flag & STRONG_ENCRYPTION_FLAG) !== 0); + gbp.useEncryption((flag & ENCRYPTION_FLAG) !== 0); + gbp.setSlidingDictionarySize((flag & SLIDING_DICTIONARY_SIZE_FLAG) !== 0 ? 8192 : 4096); + gbp.setNumberOfShannonFanoTrees((flag & NUMBER_OF_SHANNON_FANO_TREES_FLAG) !== 0 ? 3 : 2); + + return gbp; +}; + +GeneralPurposeBit.prototype.setNumberOfShannonFanoTrees = function(n) { + this.numberOfShannonFanoTrees = n; +}; + +GeneralPurposeBit.prototype.getNumberOfShannonFanoTrees = function() { + return this.numberOfShannonFanoTrees; +}; + +GeneralPurposeBit.prototype.setSlidingDictionarySize = function(n) { + this.slidingDictionarySize = n; +}; + +GeneralPurposeBit.prototype.getSlidingDictionarySize = function() { + return this.slidingDictionarySize; +}; + +GeneralPurposeBit.prototype.useDataDescriptor = function(b) { + this.descriptor = b; +}; + +GeneralPurposeBit.prototype.usesDataDescriptor = function() { + return this.descriptor; +}; + +GeneralPurposeBit.prototype.useEncryption = function(b) { + this.encryption = b; +}; + +GeneralPurposeBit.prototype.usesEncryption = function() { + return this.encryption; +}; + +GeneralPurposeBit.prototype.useStrongEncryption = function(b) { + this.strongEncryption = b; +}; + +GeneralPurposeBit.prototype.usesStrongEncryption = function() { + return this.strongEncryption; +}; + +GeneralPurposeBit.prototype.useUTF8ForNames = function(b) { + this.utf8 = b; +}; + +GeneralPurposeBit.prototype.usesUTF8ForNames = function() { + return this.utf8; }; \ No newline at end of file diff --git a/node_modules/compress-commons/lib/archivers/zip/unix-stat.js b/node_modules/compress-commons/lib/archivers/zip/unix-stat.js index 1326cd1d8..d8d27c8b3 100644 --- a/node_modules/compress-commons/lib/archivers/zip/unix-stat.js +++ b/node_modules/compress-commons/lib/archivers/zip/unix-stat.js @@ -1,53 +1,53 @@ -/** - * node-compress-commons - * - * Copyright (c) 2014 Chris Talkington, contributors. - * Licensed under the MIT license. - * https://github.com/archiverjs/node-compress-commons/blob/master/LICENSE-MIT - */ -module.exports = { - /** - * Bits used for permissions (and sticky bit) - */ - PERM_MASK: 4095, // 07777 - - /** - * Bits used to indicate the filesystem object type. - */ - FILE_TYPE_FLAG: 61440, // 0170000 - - /** - * Indicates symbolic links. - */ - LINK_FLAG: 40960, // 0120000 - - /** - * Indicates plain files. - */ - FILE_FLAG: 32768, // 0100000 - - /** - * Indicates directories. - */ - DIR_FLAG: 16384, // 040000 - - // ---------------------------------------------------------- - // somewhat arbitrary choices that are quite common for shared - // installations - // ----------------------------------------------------------- - - /** - * Default permissions for symbolic links. - */ - DEFAULT_LINK_PERM: 511, // 0777 - - /** - * Default permissions for directories. - */ - DEFAULT_DIR_PERM: 493, // 0755 - - /** - * Default permissions for plain files. - */ - DEFAULT_FILE_PERM: 420 // 0644 +/** + * node-compress-commons + * + * Copyright (c) 2014 Chris Talkington, contributors. + * Licensed under the MIT license. + * https://github.com/archiverjs/node-compress-commons/blob/master/LICENSE-MIT + */ +module.exports = { + /** + * Bits used for permissions (and sticky bit) + */ + PERM_MASK: 4095, // 07777 + + /** + * Bits used to indicate the filesystem object type. + */ + FILE_TYPE_FLAG: 61440, // 0170000 + + /** + * Indicates symbolic links. + */ + LINK_FLAG: 40960, // 0120000 + + /** + * Indicates plain files. + */ + FILE_FLAG: 32768, // 0100000 + + /** + * Indicates directories. + */ + DIR_FLAG: 16384, // 040000 + + // ---------------------------------------------------------- + // somewhat arbitrary choices that are quite common for shared + // installations + // ----------------------------------------------------------- + + /** + * Default permissions for symbolic links. + */ + DEFAULT_LINK_PERM: 511, // 0777 + + /** + * Default permissions for directories. + */ + DEFAULT_DIR_PERM: 493, // 0755 + + /** + * Default permissions for plain files. + */ + DEFAULT_FILE_PERM: 420 // 0644 }; \ No newline at end of file diff --git a/node_modules/compress-commons/lib/archivers/zip/util.js b/node_modules/compress-commons/lib/archivers/zip/util.js index 2b16c1483..d3ca45e14 100644 --- a/node_modules/compress-commons/lib/archivers/zip/util.js +++ b/node_modules/compress-commons/lib/archivers/zip/util.js @@ -1,74 +1,74 @@ -/** - * node-compress-commons - * - * Copyright (c) 2014 Chris Talkington, contributors. - * Licensed under the MIT license. - * https://github.com/archiverjs/node-compress-commons/blob/master/LICENSE-MIT - */ -var util = module.exports = {}; - -util.dateToDos = function(d, forceLocalTime) { - forceLocalTime = forceLocalTime || false; - - var year = forceLocalTime ? d.getFullYear() : d.getUTCFullYear(); - - if (year < 1980) { - return 2162688; // 1980-1-1 00:00:00 - } else if (year >= 2044) { - return 2141175677; // 2043-12-31 23:59:58 - } - - var val = { - year: year, - month: forceLocalTime ? d.getMonth() : d.getUTCMonth(), - date: forceLocalTime ? d.getDate() : d.getUTCDate(), - hours: forceLocalTime ? d.getHours() : d.getUTCHours(), - minutes: forceLocalTime ? d.getMinutes() : d.getUTCMinutes(), - seconds: forceLocalTime ? d.getSeconds() : d.getUTCSeconds() - }; - - return ((val.year - 1980) << 25) | ((val.month + 1) << 21) | (val.date << 16) | - (val.hours << 11) | (val.minutes << 5) | (val.seconds / 2); -}; - -util.dosToDate = function(dos) { - return new Date(((dos >> 25) & 0x7f) + 1980, ((dos >> 21) & 0x0f) - 1, (dos >> 16) & 0x1f, (dos >> 11) & 0x1f, (dos >> 5) & 0x3f, (dos & 0x1f) << 1); -}; - -util.fromDosTime = function(buf) { - return util.dosToDate(buf.readUInt32LE()); -}; - -util.getEightBytes = function(v) { - var buf = new Buffer(8); - buf.writeUInt32LE(v % 0x0100000000, 0); - buf.writeUInt32LE((v / 0x0100000000) | 0, 4); - - return buf; -}; - -util.getShortBytes = function(v) { - var buf = new Buffer(2); - buf.writeUInt16LE((v & 0xFFFF) >>> 0, 0); - - return buf; -}; - -util.getShortBytesValue = function(buf, offset) { - return buf.readUInt16LE(offset); -}; - -util.getLongBytes = function(v) { - var buf = new Buffer(4); - buf.writeUInt32LE((v & 0xFFFFFFFF) >>> 0, 0); - - return buf; -}; - -util.getLongBytesValue = function(buf, offset) { - return buf.readUInt32LE(offset); -}; - -util.toDosTime = function(d) { - return util.getLongBytes(util.dateToDos(d)); +/** + * node-compress-commons + * + * Copyright (c) 2014 Chris Talkington, contributors. + * Licensed under the MIT license. + * https://github.com/archiverjs/node-compress-commons/blob/master/LICENSE-MIT + */ +var util = module.exports = {}; + +util.dateToDos = function(d, forceLocalTime) { + forceLocalTime = forceLocalTime || false; + + var year = forceLocalTime ? d.getFullYear() : d.getUTCFullYear(); + + if (year < 1980) { + return 2162688; // 1980-1-1 00:00:00 + } else if (year >= 2044) { + return 2141175677; // 2043-12-31 23:59:58 + } + + var val = { + year: year, + month: forceLocalTime ? d.getMonth() : d.getUTCMonth(), + date: forceLocalTime ? d.getDate() : d.getUTCDate(), + hours: forceLocalTime ? d.getHours() : d.getUTCHours(), + minutes: forceLocalTime ? d.getMinutes() : d.getUTCMinutes(), + seconds: forceLocalTime ? d.getSeconds() : d.getUTCSeconds() + }; + + return ((val.year - 1980) << 25) | ((val.month + 1) << 21) | (val.date << 16) | + (val.hours << 11) | (val.minutes << 5) | (val.seconds / 2); +}; + +util.dosToDate = function(dos) { + return new Date(((dos >> 25) & 0x7f) + 1980, ((dos >> 21) & 0x0f) - 1, (dos >> 16) & 0x1f, (dos >> 11) & 0x1f, (dos >> 5) & 0x3f, (dos & 0x1f) << 1); +}; + +util.fromDosTime = function(buf) { + return util.dosToDate(buf.readUInt32LE()); +}; + +util.getEightBytes = function(v) { + var buf = new Buffer(8); + buf.writeUInt32LE(v % 0x0100000000, 0); + buf.writeUInt32LE((v / 0x0100000000) | 0, 4); + + return buf; +}; + +util.getShortBytes = function(v) { + var buf = new Buffer(2); + buf.writeUInt16LE((v & 0xFFFF) >>> 0, 0); + + return buf; +}; + +util.getShortBytesValue = function(buf, offset) { + return buf.readUInt16LE(offset); +}; + +util.getLongBytes = function(v) { + var buf = new Buffer(4); + buf.writeUInt32LE((v & 0xFFFFFFFF) >>> 0, 0); + + return buf; +}; + +util.getLongBytesValue = function(buf, offset) { + return buf.readUInt32LE(offset); +}; + +util.toDosTime = function(d) { + return util.getLongBytes(util.dateToDos(d)); }; \ No newline at end of file diff --git a/node_modules/compress-commons/lib/archivers/zip/zip-archive-entry.js b/node_modules/compress-commons/lib/archivers/zip/zip-archive-entry.js index 9ab9ac1c4..92b4eee23 100644 --- a/node_modules/compress-commons/lib/archivers/zip/zip-archive-entry.js +++ b/node_modules/compress-commons/lib/archivers/zip/zip-archive-entry.js @@ -1,406 +1,406 @@ -/** - * node-compress-commons - * - * Copyright (c) 2014 Chris Talkington, contributors. - * Licensed under the MIT license. - * https://github.com/archiverjs/node-compress-commons/blob/master/LICENSE-MIT - */ -var inherits = require('util').inherits; -var normalizePath = require('normalize-path'); - -var ArchiveEntry = require('../archive-entry'); -var GeneralPurposeBit = require('./general-purpose-bit'); -var UnixStat = require('./unix-stat'); - -var constants = require('./constants'); -var zipUtil = require('./util'); - -var ZipArchiveEntry = module.exports = function(name) { - if (!(this instanceof ZipArchiveEntry)) { - return new ZipArchiveEntry(name); - } - - ArchiveEntry.call(this); - - this.platform = constants.PLATFORM_FAT; - this.method = -1; - - this.name = null; - this.size = 0; - this.csize = 0; - this.gpb = new GeneralPurposeBit(); - this.crc = 0; - this.time = -1; - - this.minver = constants.MIN_VERSION_INITIAL; - this.mode = -1; - this.extra = null; - this.exattr = 0; - this.inattr = 0; - this.comment = null; - - if (name) { - this.setName(name); - } -}; - -inherits(ZipArchiveEntry, ArchiveEntry); - -/** - * Returns the extra fields related to the entry. - * - * @returns {Buffer} - */ -ZipArchiveEntry.prototype.getCentralDirectoryExtra = function() { - return this.getExtra(); -}; - -/** - * Returns the comment set for the entry. - * - * @returns {string} - */ -ZipArchiveEntry.prototype.getComment = function() { - return this.comment !== null ? this.comment : ''; -}; - -/** - * Returns the compressed size of the entry. - * - * @returns {number} - */ -ZipArchiveEntry.prototype.getCompressedSize = function() { - return this.csize; -}; - -/** - * Returns the CRC32 digest for the entry. - * - * @returns {number} - */ -ZipArchiveEntry.prototype.getCrc = function() { - return this.crc; -}; - -/** - * Returns the external file attributes for the entry. - * - * @returns {number} - */ -ZipArchiveEntry.prototype.getExternalAttributes = function() { - return this.exattr; -}; - -/** - * Returns the extra fields related to the entry. - * - * @returns {Buffer} - */ -ZipArchiveEntry.prototype.getExtra = function() { - return this.extra !== null ? this.extra : constants.EMPTY; -}; - -/** - * Returns the general purpose bits related to the entry. - * - * @returns {GeneralPurposeBit} - */ -ZipArchiveEntry.prototype.getGeneralPurposeBit = function() { - return this.gpb; -}; - -/** - * Returns the internal file attributes for the entry. - * - * @returns {number} - */ -ZipArchiveEntry.prototype.getInternalAttributes = function() { - return this.inattr; -}; - -/** - * Returns the last modified date of the entry. - * - * @returns {number} - */ -ZipArchiveEntry.prototype.getLastModifiedDate = function() { - return this.getTime(); -}; - -/** - * Returns the extra fields related to the entry. - * - * @returns {Buffer} - */ -ZipArchiveEntry.prototype.getLocalFileDataExtra = function() { - return this.getExtra(); -}; - -/** - * Returns the compression method used on the entry. - * - * @returns {number} - */ -ZipArchiveEntry.prototype.getMethod = function() { - return this.method; -}; - -/** - * Returns the filename of the entry. - * - * @returns {string} - */ -ZipArchiveEntry.prototype.getName = function() { - return this.name; -}; - -/** - * Returns the platform on which the entry was made. - * - * @returns {number} - */ -ZipArchiveEntry.prototype.getPlatform = function() { - return this.platform; -}; - -/** - * Returns the size of the entry. - * - * @returns {number} - */ -ZipArchiveEntry.prototype.getSize = function() { - return this.size; -}; - -/** - * Returns a date object representing the last modified date of the entry. - * - * @returns {number|Date} - */ -ZipArchiveEntry.prototype.getTime = function() { - return this.time !== -1 ? zipUtil.dosToDate(this.time) : -1; -}; - -/** - * Returns the DOS timestamp for the entry. - * - * @returns {number} - */ -ZipArchiveEntry.prototype.getTimeDos = function() { - return this.time !== -1 ? this.time : 0; -}; - -/** - * Returns the UNIX file permissions for the entry. - * - * @returns {number} - */ -ZipArchiveEntry.prototype.getUnixMode = function() { - return this.platform !== constants.PLATFORM_UNIX ? 0 : ((this.getExternalAttributes() >> constants.SHORT_SHIFT) & constants.SHORT_MASK); -}; - -/** - * Returns the version of ZIP needed to extract the entry. - * - * @returns {number} - */ -ZipArchiveEntry.prototype.getVersionNeededToExtract = function() { - return this.minver; -}; - -/** - * Sets the comment of the entry. - * - * @param comment - */ -ZipArchiveEntry.prototype.setComment = function(comment) { - if (Buffer.byteLength(comment) !== comment.length) { - this.getGeneralPurposeBit().useUTF8ForNames(true); - } - - this.comment = comment; -}; - -/** - * Sets the compressed size of the entry. - * - * @param size - */ -ZipArchiveEntry.prototype.setCompressedSize = function(size) { - if (size < 0) { - throw new Error('invalid entry compressed size'); - } - - this.csize = size; -}; - -/** - * Sets the checksum of the entry. - * - * @param crc - */ -ZipArchiveEntry.prototype.setCrc = function(crc) { - if (crc < 0) { - throw new Error('invalid entry crc32'); - } - - this.crc = crc; -}; - -/** - * Sets the external file attributes of the entry. - * - * @param attr - */ -ZipArchiveEntry.prototype.setExternalAttributes = function(attr) { - this.exattr = attr >>> 0; -}; - -/** - * Sets the extra fields related to the entry. - * - * @param extra - */ -ZipArchiveEntry.prototype.setExtra = function(extra) { - this.extra = extra; -}; - -/** - * Sets the general purpose bits related to the entry. - * - * @param gpb - */ -ZipArchiveEntry.prototype.setGeneralPurposeBit = function(gpb) { - if (!(gpb instanceof GeneralPurposeBit)) { - throw new Error('invalid entry GeneralPurposeBit'); - } - - this.gpb = gpb; -}; - -/** - * Sets the internal file attributes of the entry. - * - * @param attr - */ -ZipArchiveEntry.prototype.setInternalAttributes = function(attr) { - this.inattr = attr; -}; - -/** - * Sets the compression method of the entry. - * - * @param method - */ -ZipArchiveEntry.prototype.setMethod = function(method) { - if (method < 0) { - throw new Error('invalid entry compression method'); - } - - this.method = method; -}; - -/** - * Sets the name of the entry. - * - * @param name - */ -ZipArchiveEntry.prototype.setName = function(name) { - name = normalizePath(name, false).replace(/^\w+:/, '').replace(/^(\.\.\/|\/)+/, ''); - - if (Buffer.byteLength(name) !== name.length) { - this.getGeneralPurposeBit().useUTF8ForNames(true); - } - - this.name = name; -}; - -/** - * Sets the platform on which the entry was made. - * - * @param platform - */ -ZipArchiveEntry.prototype.setPlatform = function(platform) { - this.platform = platform; -}; - -/** - * Sets the size of the entry. - * - * @param size - */ -ZipArchiveEntry.prototype.setSize = function(size) { - if (size < 0) { - throw new Error('invalid entry size'); - } - - this.size = size; -}; - -/** - * Sets the time of the entry. - * - * @param time - * @param forceLocalTime - */ -ZipArchiveEntry.prototype.setTime = function(time, forceLocalTime) { - if (!(time instanceof Date)) { - throw new Error('invalid entry time'); - } - - this.time = zipUtil.dateToDos(time, forceLocalTime); -}; - -/** - * Sets the UNIX file permissions for the entry. - * - * @param mode - */ -ZipArchiveEntry.prototype.setUnixMode = function(mode) { - mode |= this.isDirectory() ? constants.S_IFDIR : constants.S_IFREG; - - var extattr = 0; - extattr |= (mode << constants.SHORT_SHIFT) | (this.isDirectory() ? constants.S_DOS_D : constants.S_DOS_A); - - this.setExternalAttributes(extattr); - this.mode = mode & constants.MODE_MASK; - this.platform = constants.PLATFORM_UNIX; -}; - -/** - * Sets the version of ZIP needed to extract this entry. - * - * @param minver - */ -ZipArchiveEntry.prototype.setVersionNeededToExtract = function(minver) { - this.minver = minver; -}; - -/** - * Returns true if this entry represents a directory. - * - * @returns {boolean} - */ -ZipArchiveEntry.prototype.isDirectory = function() { - return this.getName().slice(-1) === '/'; -}; - -/** - * Returns true if this entry represents a unix symlink, - * in which case the entry's content contains the target path - * for the symlink. - * - * @returns {boolean} - */ -ZipArchiveEntry.prototype.isUnixSymlink = function() { - return (this.getUnixMode() & UnixStat.FILE_TYPE_FLAG) === UnixStat.LINK_FLAG; -}; - -/** - * Returns true if this entry is using the ZIP64 extension of ZIP. - * - * @returns {boolean} - */ -ZipArchiveEntry.prototype.isZip64 = function() { - return this.csize > constants.ZIP64_MAGIC || this.size > constants.ZIP64_MAGIC; -}; +/** + * node-compress-commons + * + * Copyright (c) 2014 Chris Talkington, contributors. + * Licensed under the MIT license. + * https://github.com/archiverjs/node-compress-commons/blob/master/LICENSE-MIT + */ +var inherits = require('util').inherits; +var normalizePath = require('normalize-path'); + +var ArchiveEntry = require('../archive-entry'); +var GeneralPurposeBit = require('./general-purpose-bit'); +var UnixStat = require('./unix-stat'); + +var constants = require('./constants'); +var zipUtil = require('./util'); + +var ZipArchiveEntry = module.exports = function(name) { + if (!(this instanceof ZipArchiveEntry)) { + return new ZipArchiveEntry(name); + } + + ArchiveEntry.call(this); + + this.platform = constants.PLATFORM_FAT; + this.method = -1; + + this.name = null; + this.size = 0; + this.csize = 0; + this.gpb = new GeneralPurposeBit(); + this.crc = 0; + this.time = -1; + + this.minver = constants.MIN_VERSION_INITIAL; + this.mode = -1; + this.extra = null; + this.exattr = 0; + this.inattr = 0; + this.comment = null; + + if (name) { + this.setName(name); + } +}; + +inherits(ZipArchiveEntry, ArchiveEntry); + +/** + * Returns the extra fields related to the entry. + * + * @returns {Buffer} + */ +ZipArchiveEntry.prototype.getCentralDirectoryExtra = function() { + return this.getExtra(); +}; + +/** + * Returns the comment set for the entry. + * + * @returns {string} + */ +ZipArchiveEntry.prototype.getComment = function() { + return this.comment !== null ? this.comment : ''; +}; + +/** + * Returns the compressed size of the entry. + * + * @returns {number} + */ +ZipArchiveEntry.prototype.getCompressedSize = function() { + return this.csize; +}; + +/** + * Returns the CRC32 digest for the entry. + * + * @returns {number} + */ +ZipArchiveEntry.prototype.getCrc = function() { + return this.crc; +}; + +/** + * Returns the external file attributes for the entry. + * + * @returns {number} + */ +ZipArchiveEntry.prototype.getExternalAttributes = function() { + return this.exattr; +}; + +/** + * Returns the extra fields related to the entry. + * + * @returns {Buffer} + */ +ZipArchiveEntry.prototype.getExtra = function() { + return this.extra !== null ? this.extra : constants.EMPTY; +}; + +/** + * Returns the general purpose bits related to the entry. + * + * @returns {GeneralPurposeBit} + */ +ZipArchiveEntry.prototype.getGeneralPurposeBit = function() { + return this.gpb; +}; + +/** + * Returns the internal file attributes for the entry. + * + * @returns {number} + */ +ZipArchiveEntry.prototype.getInternalAttributes = function() { + return this.inattr; +}; + +/** + * Returns the last modified date of the entry. + * + * @returns {number} + */ +ZipArchiveEntry.prototype.getLastModifiedDate = function() { + return this.getTime(); +}; + +/** + * Returns the extra fields related to the entry. + * + * @returns {Buffer} + */ +ZipArchiveEntry.prototype.getLocalFileDataExtra = function() { + return this.getExtra(); +}; + +/** + * Returns the compression method used on the entry. + * + * @returns {number} + */ +ZipArchiveEntry.prototype.getMethod = function() { + return this.method; +}; + +/** + * Returns the filename of the entry. + * + * @returns {string} + */ +ZipArchiveEntry.prototype.getName = function() { + return this.name; +}; + +/** + * Returns the platform on which the entry was made. + * + * @returns {number} + */ +ZipArchiveEntry.prototype.getPlatform = function() { + return this.platform; +}; + +/** + * Returns the size of the entry. + * + * @returns {number} + */ +ZipArchiveEntry.prototype.getSize = function() { + return this.size; +}; + +/** + * Returns a date object representing the last modified date of the entry. + * + * @returns {number|Date} + */ +ZipArchiveEntry.prototype.getTime = function() { + return this.time !== -1 ? zipUtil.dosToDate(this.time) : -1; +}; + +/** + * Returns the DOS timestamp for the entry. + * + * @returns {number} + */ +ZipArchiveEntry.prototype.getTimeDos = function() { + return this.time !== -1 ? this.time : 0; +}; + +/** + * Returns the UNIX file permissions for the entry. + * + * @returns {number} + */ +ZipArchiveEntry.prototype.getUnixMode = function() { + return this.platform !== constants.PLATFORM_UNIX ? 0 : ((this.getExternalAttributes() >> constants.SHORT_SHIFT) & constants.SHORT_MASK); +}; + +/** + * Returns the version of ZIP needed to extract the entry. + * + * @returns {number} + */ +ZipArchiveEntry.prototype.getVersionNeededToExtract = function() { + return this.minver; +}; + +/** + * Sets the comment of the entry. + * + * @param comment + */ +ZipArchiveEntry.prototype.setComment = function(comment) { + if (Buffer.byteLength(comment) !== comment.length) { + this.getGeneralPurposeBit().useUTF8ForNames(true); + } + + this.comment = comment; +}; + +/** + * Sets the compressed size of the entry. + * + * @param size + */ +ZipArchiveEntry.prototype.setCompressedSize = function(size) { + if (size < 0) { + throw new Error('invalid entry compressed size'); + } + + this.csize = size; +}; + +/** + * Sets the checksum of the entry. + * + * @param crc + */ +ZipArchiveEntry.prototype.setCrc = function(crc) { + if (crc < 0) { + throw new Error('invalid entry crc32'); + } + + this.crc = crc; +}; + +/** + * Sets the external file attributes of the entry. + * + * @param attr + */ +ZipArchiveEntry.prototype.setExternalAttributes = function(attr) { + this.exattr = attr >>> 0; +}; + +/** + * Sets the extra fields related to the entry. + * + * @param extra + */ +ZipArchiveEntry.prototype.setExtra = function(extra) { + this.extra = extra; +}; + +/** + * Sets the general purpose bits related to the entry. + * + * @param gpb + */ +ZipArchiveEntry.prototype.setGeneralPurposeBit = function(gpb) { + if (!(gpb instanceof GeneralPurposeBit)) { + throw new Error('invalid entry GeneralPurposeBit'); + } + + this.gpb = gpb; +}; + +/** + * Sets the internal file attributes of the entry. + * + * @param attr + */ +ZipArchiveEntry.prototype.setInternalAttributes = function(attr) { + this.inattr = attr; +}; + +/** + * Sets the compression method of the entry. + * + * @param method + */ +ZipArchiveEntry.prototype.setMethod = function(method) { + if (method < 0) { + throw new Error('invalid entry compression method'); + } + + this.method = method; +}; + +/** + * Sets the name of the entry. + * + * @param name + */ +ZipArchiveEntry.prototype.setName = function(name) { + name = normalizePath(name, false).replace(/^\w+:/, '').replace(/^(\.\.\/|\/)+/, ''); + + if (Buffer.byteLength(name) !== name.length) { + this.getGeneralPurposeBit().useUTF8ForNames(true); + } + + this.name = name; +}; + +/** + * Sets the platform on which the entry was made. + * + * @param platform + */ +ZipArchiveEntry.prototype.setPlatform = function(platform) { + this.platform = platform; +}; + +/** + * Sets the size of the entry. + * + * @param size + */ +ZipArchiveEntry.prototype.setSize = function(size) { + if (size < 0) { + throw new Error('invalid entry size'); + } + + this.size = size; +}; + +/** + * Sets the time of the entry. + * + * @param time + * @param forceLocalTime + */ +ZipArchiveEntry.prototype.setTime = function(time, forceLocalTime) { + if (!(time instanceof Date)) { + throw new Error('invalid entry time'); + } + + this.time = zipUtil.dateToDos(time, forceLocalTime); +}; + +/** + * Sets the UNIX file permissions for the entry. + * + * @param mode + */ +ZipArchiveEntry.prototype.setUnixMode = function(mode) { + mode |= this.isDirectory() ? constants.S_IFDIR : constants.S_IFREG; + + var extattr = 0; + extattr |= (mode << constants.SHORT_SHIFT) | (this.isDirectory() ? constants.S_DOS_D : constants.S_DOS_A); + + this.setExternalAttributes(extattr); + this.mode = mode & constants.MODE_MASK; + this.platform = constants.PLATFORM_UNIX; +}; + +/** + * Sets the version of ZIP needed to extract this entry. + * + * @param minver + */ +ZipArchiveEntry.prototype.setVersionNeededToExtract = function(minver) { + this.minver = minver; +}; + +/** + * Returns true if this entry represents a directory. + * + * @returns {boolean} + */ +ZipArchiveEntry.prototype.isDirectory = function() { + return this.getName().slice(-1) === '/'; +}; + +/** + * Returns true if this entry represents a unix symlink, + * in which case the entry's content contains the target path + * for the symlink. + * + * @returns {boolean} + */ +ZipArchiveEntry.prototype.isUnixSymlink = function() { + return (this.getUnixMode() & UnixStat.FILE_TYPE_FLAG) === UnixStat.LINK_FLAG; +}; + +/** + * Returns true if this entry is using the ZIP64 extension of ZIP. + * + * @returns {boolean} + */ +ZipArchiveEntry.prototype.isZip64 = function() { + return this.csize > constants.ZIP64_MAGIC || this.size > constants.ZIP64_MAGIC; +}; diff --git a/node_modules/compress-commons/lib/archivers/zip/zip-archive-output-stream.js b/node_modules/compress-commons/lib/archivers/zip/zip-archive-output-stream.js index 91d0ff22d..7c3934e81 100644 --- a/node_modules/compress-commons/lib/archivers/zip/zip-archive-output-stream.js +++ b/node_modules/compress-commons/lib/archivers/zip/zip-archive-output-stream.js @@ -1,440 +1,440 @@ -/** - * node-compress-commons - * - * Copyright (c) 2014 Chris Talkington, contributors. - * Licensed under the MIT license. - * https://github.com/archiverjs/node-compress-commons/blob/master/LICENSE-MIT - */ -var inherits = require('util').inherits; -var crc32 = require('buffer-crc32'); -var CRC32Stream = require('crc32-stream'); -var DeflateCRC32Stream = CRC32Stream.DeflateCRC32Stream; - -var ArchiveOutputStream = require('../archive-output-stream'); -var ZipArchiveEntry = require('./zip-archive-entry'); -var GeneralPurposeBit = require('./general-purpose-bit'); - -var constants = require('./constants'); -var util = require('../../util'); -var zipUtil = require('./util'); - -var ZipArchiveOutputStream = module.exports = function(options) { - if (!(this instanceof ZipArchiveOutputStream)) { - return new ZipArchiveOutputStream(options); - } - - options = this.options = this._defaults(options); - - ArchiveOutputStream.call(this, options); - - this._entry = null; - this._entries = []; - this._archive = { - centralLength: 0, - centralOffset: 0, - comment: '', - finish: false, - finished: false, - processing: false, - forceZip64: options.forceZip64, - forceLocalTime: options.forceLocalTime - }; -}; - -inherits(ZipArchiveOutputStream, ArchiveOutputStream); - -ZipArchiveOutputStream.prototype._afterAppend = function(ae) { - this._entries.push(ae); - - if (ae.getGeneralPurposeBit().usesDataDescriptor()) { - this._writeDataDescriptor(ae); - } - - this._archive.processing = false; - this._entry = null; - - if (this._archive.finish && !this._archive.finished) { - this._finish(); - } -}; - -ZipArchiveOutputStream.prototype._appendBuffer = function(ae, source, callback) { - if (source.length === 0) { - ae.setMethod(constants.METHOD_STORED); - } - - var method = ae.getMethod(); - - if (method === constants.METHOD_STORED) { - ae.setSize(source.length); - ae.setCompressedSize(source.length); - ae.setCrc(crc32.unsigned(source)); - } - - this._writeLocalFileHeader(ae); - - if (method === constants.METHOD_STORED) { - this.write(source); - this._afterAppend(ae); - callback(null, ae); - return; - } else if (method === constants.METHOD_DEFLATED) { - this._smartStream(ae, callback).end(source); - return; - } else { - callback(new Error('compression method ' + method + ' not implemented')); - return; - } -}; - -ZipArchiveOutputStream.prototype._appendStream = function(ae, source, callback) { - ae.getGeneralPurposeBit().useDataDescriptor(true); - ae.setVersionNeededToExtract(constants.MIN_VERSION_DATA_DESCRIPTOR); - - this._writeLocalFileHeader(ae); - - var smart = this._smartStream(ae, callback); - source.once('error', function(err) { - smart.emit('error', err); - smart.end(); - }) - source.pipe(smart); -}; - -ZipArchiveOutputStream.prototype._defaults = function(o) { - if (typeof o !== 'object') { - o = {}; - } - - if (typeof o.zlib !== 'object') { - o.zlib = {}; - } - - if (typeof o.zlib.level !== 'number') { - o.zlib.level = constants.ZLIB_BEST_SPEED; - } - - o.forceZip64 = !!o.forceZip64; - o.forceLocalTime = !!o.forceLocalTime; - - return o; -}; - -ZipArchiveOutputStream.prototype._finish = function() { - this._archive.centralOffset = this.offset; - - this._entries.forEach(function(ae) { - this._writeCentralFileHeader(ae); - }.bind(this)); - - this._archive.centralLength = this.offset - this._archive.centralOffset; - - if (this.isZip64()) { - this._writeCentralDirectoryZip64(); - } - - this._writeCentralDirectoryEnd(); - - this._archive.processing = false; - this._archive.finish = true; - this._archive.finished = true; - this.end(); -}; - -ZipArchiveOutputStream.prototype._normalizeEntry = function(ae) { - if (ae.getMethod() === -1) { - ae.setMethod(constants.METHOD_DEFLATED); - } - - if (ae.getMethod() === constants.METHOD_DEFLATED) { - ae.getGeneralPurposeBit().useDataDescriptor(true); - ae.setVersionNeededToExtract(constants.MIN_VERSION_DATA_DESCRIPTOR); - } - - if (ae.getTime() === -1) { - ae.setTime(new Date(), this._archive.forceLocalTime); - } - - ae._offsets = { - file: 0, - data: 0, - contents: 0, - }; -}; - -ZipArchiveOutputStream.prototype._smartStream = function(ae, callback) { - var deflate = ae.getMethod() === constants.METHOD_DEFLATED; - var process = deflate ? new DeflateCRC32Stream(this.options.zlib) : new CRC32Stream(); - var error = null; - - function handleStuff() { - var digest = process.digest().readUInt32BE(0); - ae.setCrc(digest); - ae.setSize(process.size()); - ae.setCompressedSize(process.size(true)); - this._afterAppend(ae); - callback(error, ae); - } - - process.once('end', handleStuff.bind(this)); - process.once('error', function(err) { - error = err; - }); - - process.pipe(this, { end: false }); - - return process; -}; - -ZipArchiveOutputStream.prototype._writeCentralDirectoryEnd = function() { - var records = this._entries.length; - var size = this._archive.centralLength; - var offset = this._archive.centralOffset; - - if (this.isZip64()) { - records = constants.ZIP64_MAGIC_SHORT; - size = constants.ZIP64_MAGIC; - offset = constants.ZIP64_MAGIC; - } - - // signature - this.write(zipUtil.getLongBytes(constants.SIG_EOCD)); - - // disk numbers - this.write(constants.SHORT_ZERO); - this.write(constants.SHORT_ZERO); - - // number of entries - this.write(zipUtil.getShortBytes(records)); - this.write(zipUtil.getShortBytes(records)); - - // length and location of CD - this.write(zipUtil.getLongBytes(size)); - this.write(zipUtil.getLongBytes(offset)); - - // archive comment - var comment = this.getComment(); - var commentLength = Buffer.byteLength(comment); - this.write(zipUtil.getShortBytes(commentLength)); - this.write(comment); -}; - -ZipArchiveOutputStream.prototype._writeCentralDirectoryZip64 = function() { - // signature - this.write(zipUtil.getLongBytes(constants.SIG_ZIP64_EOCD)); - - // size of the ZIP64 EOCD record - this.write(zipUtil.getEightBytes(44)); - - // version made by - this.write(zipUtil.getShortBytes(constants.MIN_VERSION_ZIP64)); - - // version to extract - this.write(zipUtil.getShortBytes(constants.MIN_VERSION_ZIP64)); - - // disk numbers - this.write(constants.LONG_ZERO); - this.write(constants.LONG_ZERO); - - // number of entries - this.write(zipUtil.getEightBytes(this._entries.length)); - this.write(zipUtil.getEightBytes(this._entries.length)); - - // length and location of CD - this.write(zipUtil.getEightBytes(this._archive.centralLength)); - this.write(zipUtil.getEightBytes(this._archive.centralOffset)); - - // extensible data sector - // not implemented at this time - - // end of central directory locator - this.write(zipUtil.getLongBytes(constants.SIG_ZIP64_EOCD_LOC)); - - // disk number holding the ZIP64 EOCD record - this.write(constants.LONG_ZERO); - - // relative offset of the ZIP64 EOCD record - this.write(zipUtil.getEightBytes(this._archive.centralOffset + this._archive.centralLength)); - - // total number of disks - this.write(zipUtil.getLongBytes(1)); -}; - -ZipArchiveOutputStream.prototype._writeCentralFileHeader = function(ae) { - var gpb = ae.getGeneralPurposeBit(); - var method = ae.getMethod(); - var offsets = ae._offsets; - - var size = ae.getSize(); - var compressedSize = ae.getCompressedSize(); - - if (ae.isZip64() || offsets.file > constants.ZIP64_MAGIC) { - size = constants.ZIP64_MAGIC; - compressedSize = constants.ZIP64_MAGIC; - - ae.setVersionNeededToExtract(constants.MIN_VERSION_ZIP64); - - var extraBuf = Buffer.concat([ - zipUtil.getShortBytes(constants.ZIP64_EXTRA_ID), - zipUtil.getShortBytes(24), - zipUtil.getEightBytes(ae.getSize()), - zipUtil.getEightBytes(ae.getCompressedSize()), - zipUtil.getEightBytes(offsets.file) - ], 28); - - ae.setExtra(extraBuf); - } - - // signature - this.write(zipUtil.getLongBytes(constants.SIG_CFH)); - - // version made by - this.write(zipUtil.getShortBytes((ae.getPlatform() << 8) | constants.VERSION_MADEBY)); - - // version to extract and general bit flag - this.write(zipUtil.getShortBytes(ae.getVersionNeededToExtract())); - this.write(gpb.encode()); - - // compression method - this.write(zipUtil.getShortBytes(method)); - - // datetime - this.write(zipUtil.getLongBytes(ae.getTimeDos())); - - // crc32 checksum - this.write(zipUtil.getLongBytes(ae.getCrc())); - - // sizes - this.write(zipUtil.getLongBytes(compressedSize)); - this.write(zipUtil.getLongBytes(size)); - - var name = ae.getName(); - var comment = ae.getComment(); - var extra = ae.getCentralDirectoryExtra(); - - if (gpb.usesUTF8ForNames()) { - name = new Buffer(name); - comment = new Buffer(comment); - } - - // name length - this.write(zipUtil.getShortBytes(name.length)); - - // extra length - this.write(zipUtil.getShortBytes(extra.length)); - - // comments length - this.write(zipUtil.getShortBytes(comment.length)); - - // disk number start - this.write(constants.SHORT_ZERO); - - // internal attributes - this.write(zipUtil.getShortBytes(ae.getInternalAttributes())); - - // external attributes - this.write(zipUtil.getLongBytes(ae.getExternalAttributes())); - - // relative offset of LFH - if (offsets.file > constants.ZIP64_MAGIC) { - this.write(zipUtil.getLongBytes(constants.ZIP64_MAGIC)); - } else { - this.write(zipUtil.getLongBytes(offsets.file)); - } - - // name - this.write(name); - - // extra - this.write(extra); - - // comment - this.write(comment); -}; - -ZipArchiveOutputStream.prototype._writeDataDescriptor = function(ae) { - // signature - this.write(zipUtil.getLongBytes(constants.SIG_DD)); - - // crc32 checksum - this.write(zipUtil.getLongBytes(ae.getCrc())); - - // sizes - if (ae.isZip64()) { - this.write(zipUtil.getEightBytes(ae.getCompressedSize())); - this.write(zipUtil.getEightBytes(ae.getSize())); - } else { - this.write(zipUtil.getLongBytes(ae.getCompressedSize())); - this.write(zipUtil.getLongBytes(ae.getSize())); - } -}; - -ZipArchiveOutputStream.prototype._writeLocalFileHeader = function(ae) { - var gpb = ae.getGeneralPurposeBit(); - var method = ae.getMethod(); - var name = ae.getName(); - var extra = ae.getLocalFileDataExtra(); - - if (ae.isZip64()) { - gpb.useDataDescriptor(true); - ae.setVersionNeededToExtract(constants.MIN_VERSION_ZIP64); - } - - if (gpb.usesUTF8ForNames()) { - name = new Buffer(name); - } - - ae._offsets.file = this.offset; - - // signature - this.write(zipUtil.getLongBytes(constants.SIG_LFH)); - - // version to extract and general bit flag - this.write(zipUtil.getShortBytes(ae.getVersionNeededToExtract())); - this.write(gpb.encode()); - - // compression method - this.write(zipUtil.getShortBytes(method)); - - // datetime - this.write(zipUtil.getLongBytes(ae.getTimeDos())); - - ae._offsets.data = this.offset; - - // crc32 checksum and sizes - if (gpb.usesDataDescriptor()) { - this.write(constants.LONG_ZERO); - this.write(constants.LONG_ZERO); - this.write(constants.LONG_ZERO); - } else { - this.write(zipUtil.getLongBytes(ae.getCrc())); - this.write(zipUtil.getLongBytes(ae.getCompressedSize())); - this.write(zipUtil.getLongBytes(ae.getSize())); - } - - // name length - this.write(zipUtil.getShortBytes(name.length)); - - // extra length - this.write(zipUtil.getShortBytes(extra.length)); - - // name - this.write(name); - - // extra - this.write(extra); - - ae._offsets.contents = this.offset; -}; - -ZipArchiveOutputStream.prototype.getComment = function(comment) { - return this._archive.comment !== null ? this._archive.comment : ''; -}; - -ZipArchiveOutputStream.prototype.isZip64 = function() { - return this._archive.forceZip64 || this._entries.length > constants.ZIP64_MAGIC_SHORT || this._archive.centralLength > constants.ZIP64_MAGIC || this._archive.centralOffset > constants.ZIP64_MAGIC; -}; - -ZipArchiveOutputStream.prototype.setComment = function(comment) { - this._archive.comment = comment; -}; +/** + * node-compress-commons + * + * Copyright (c) 2014 Chris Talkington, contributors. + * Licensed under the MIT license. + * https://github.com/archiverjs/node-compress-commons/blob/master/LICENSE-MIT + */ +var inherits = require('util').inherits; +var crc32 = require('buffer-crc32'); +var CRC32Stream = require('crc32-stream'); +var DeflateCRC32Stream = CRC32Stream.DeflateCRC32Stream; + +var ArchiveOutputStream = require('../archive-output-stream'); +var ZipArchiveEntry = require('./zip-archive-entry'); +var GeneralPurposeBit = require('./general-purpose-bit'); + +var constants = require('./constants'); +var util = require('../../util'); +var zipUtil = require('./util'); + +var ZipArchiveOutputStream = module.exports = function(options) { + if (!(this instanceof ZipArchiveOutputStream)) { + return new ZipArchiveOutputStream(options); + } + + options = this.options = this._defaults(options); + + ArchiveOutputStream.call(this, options); + + this._entry = null; + this._entries = []; + this._archive = { + centralLength: 0, + centralOffset: 0, + comment: '', + finish: false, + finished: false, + processing: false, + forceZip64: options.forceZip64, + forceLocalTime: options.forceLocalTime + }; +}; + +inherits(ZipArchiveOutputStream, ArchiveOutputStream); + +ZipArchiveOutputStream.prototype._afterAppend = function(ae) { + this._entries.push(ae); + + if (ae.getGeneralPurposeBit().usesDataDescriptor()) { + this._writeDataDescriptor(ae); + } + + this._archive.processing = false; + this._entry = null; + + if (this._archive.finish && !this._archive.finished) { + this._finish(); + } +}; + +ZipArchiveOutputStream.prototype._appendBuffer = function(ae, source, callback) { + if (source.length === 0) { + ae.setMethod(constants.METHOD_STORED); + } + + var method = ae.getMethod(); + + if (method === constants.METHOD_STORED) { + ae.setSize(source.length); + ae.setCompressedSize(source.length); + ae.setCrc(crc32.unsigned(source)); + } + + this._writeLocalFileHeader(ae); + + if (method === constants.METHOD_STORED) { + this.write(source); + this._afterAppend(ae); + callback(null, ae); + return; + } else if (method === constants.METHOD_DEFLATED) { + this._smartStream(ae, callback).end(source); + return; + } else { + callback(new Error('compression method ' + method + ' not implemented')); + return; + } +}; + +ZipArchiveOutputStream.prototype._appendStream = function(ae, source, callback) { + ae.getGeneralPurposeBit().useDataDescriptor(true); + ae.setVersionNeededToExtract(constants.MIN_VERSION_DATA_DESCRIPTOR); + + this._writeLocalFileHeader(ae); + + var smart = this._smartStream(ae, callback); + source.once('error', function(err) { + smart.emit('error', err); + smart.end(); + }) + source.pipe(smart); +}; + +ZipArchiveOutputStream.prototype._defaults = function(o) { + if (typeof o !== 'object') { + o = {}; + } + + if (typeof o.zlib !== 'object') { + o.zlib = {}; + } + + if (typeof o.zlib.level !== 'number') { + o.zlib.level = constants.ZLIB_BEST_SPEED; + } + + o.forceZip64 = !!o.forceZip64; + o.forceLocalTime = !!o.forceLocalTime; + + return o; +}; + +ZipArchiveOutputStream.prototype._finish = function() { + this._archive.centralOffset = this.offset; + + this._entries.forEach(function(ae) { + this._writeCentralFileHeader(ae); + }.bind(this)); + + this._archive.centralLength = this.offset - this._archive.centralOffset; + + if (this.isZip64()) { + this._writeCentralDirectoryZip64(); + } + + this._writeCentralDirectoryEnd(); + + this._archive.processing = false; + this._archive.finish = true; + this._archive.finished = true; + this.end(); +}; + +ZipArchiveOutputStream.prototype._normalizeEntry = function(ae) { + if (ae.getMethod() === -1) { + ae.setMethod(constants.METHOD_DEFLATED); + } + + if (ae.getMethod() === constants.METHOD_DEFLATED) { + ae.getGeneralPurposeBit().useDataDescriptor(true); + ae.setVersionNeededToExtract(constants.MIN_VERSION_DATA_DESCRIPTOR); + } + + if (ae.getTime() === -1) { + ae.setTime(new Date(), this._archive.forceLocalTime); + } + + ae._offsets = { + file: 0, + data: 0, + contents: 0, + }; +}; + +ZipArchiveOutputStream.prototype._smartStream = function(ae, callback) { + var deflate = ae.getMethod() === constants.METHOD_DEFLATED; + var process = deflate ? new DeflateCRC32Stream(this.options.zlib) : new CRC32Stream(); + var error = null; + + function handleStuff() { + var digest = process.digest().readUInt32BE(0); + ae.setCrc(digest); + ae.setSize(process.size()); + ae.setCompressedSize(process.size(true)); + this._afterAppend(ae); + callback(error, ae); + } + + process.once('end', handleStuff.bind(this)); + process.once('error', function(err) { + error = err; + }); + + process.pipe(this, { end: false }); + + return process; +}; + +ZipArchiveOutputStream.prototype._writeCentralDirectoryEnd = function() { + var records = this._entries.length; + var size = this._archive.centralLength; + var offset = this._archive.centralOffset; + + if (this.isZip64()) { + records = constants.ZIP64_MAGIC_SHORT; + size = constants.ZIP64_MAGIC; + offset = constants.ZIP64_MAGIC; + } + + // signature + this.write(zipUtil.getLongBytes(constants.SIG_EOCD)); + + // disk numbers + this.write(constants.SHORT_ZERO); + this.write(constants.SHORT_ZERO); + + // number of entries + this.write(zipUtil.getShortBytes(records)); + this.write(zipUtil.getShortBytes(records)); + + // length and location of CD + this.write(zipUtil.getLongBytes(size)); + this.write(zipUtil.getLongBytes(offset)); + + // archive comment + var comment = this.getComment(); + var commentLength = Buffer.byteLength(comment); + this.write(zipUtil.getShortBytes(commentLength)); + this.write(comment); +}; + +ZipArchiveOutputStream.prototype._writeCentralDirectoryZip64 = function() { + // signature + this.write(zipUtil.getLongBytes(constants.SIG_ZIP64_EOCD)); + + // size of the ZIP64 EOCD record + this.write(zipUtil.getEightBytes(44)); + + // version made by + this.write(zipUtil.getShortBytes(constants.MIN_VERSION_ZIP64)); + + // version to extract + this.write(zipUtil.getShortBytes(constants.MIN_VERSION_ZIP64)); + + // disk numbers + this.write(constants.LONG_ZERO); + this.write(constants.LONG_ZERO); + + // number of entries + this.write(zipUtil.getEightBytes(this._entries.length)); + this.write(zipUtil.getEightBytes(this._entries.length)); + + // length and location of CD + this.write(zipUtil.getEightBytes(this._archive.centralLength)); + this.write(zipUtil.getEightBytes(this._archive.centralOffset)); + + // extensible data sector + // not implemented at this time + + // end of central directory locator + this.write(zipUtil.getLongBytes(constants.SIG_ZIP64_EOCD_LOC)); + + // disk number holding the ZIP64 EOCD record + this.write(constants.LONG_ZERO); + + // relative offset of the ZIP64 EOCD record + this.write(zipUtil.getEightBytes(this._archive.centralOffset + this._archive.centralLength)); + + // total number of disks + this.write(zipUtil.getLongBytes(1)); +}; + +ZipArchiveOutputStream.prototype._writeCentralFileHeader = function(ae) { + var gpb = ae.getGeneralPurposeBit(); + var method = ae.getMethod(); + var offsets = ae._offsets; + + var size = ae.getSize(); + var compressedSize = ae.getCompressedSize(); + + if (ae.isZip64() || offsets.file > constants.ZIP64_MAGIC) { + size = constants.ZIP64_MAGIC; + compressedSize = constants.ZIP64_MAGIC; + + ae.setVersionNeededToExtract(constants.MIN_VERSION_ZIP64); + + var extraBuf = Buffer.concat([ + zipUtil.getShortBytes(constants.ZIP64_EXTRA_ID), + zipUtil.getShortBytes(24), + zipUtil.getEightBytes(ae.getSize()), + zipUtil.getEightBytes(ae.getCompressedSize()), + zipUtil.getEightBytes(offsets.file) + ], 28); + + ae.setExtra(extraBuf); + } + + // signature + this.write(zipUtil.getLongBytes(constants.SIG_CFH)); + + // version made by + this.write(zipUtil.getShortBytes((ae.getPlatform() << 8) | constants.VERSION_MADEBY)); + + // version to extract and general bit flag + this.write(zipUtil.getShortBytes(ae.getVersionNeededToExtract())); + this.write(gpb.encode()); + + // compression method + this.write(zipUtil.getShortBytes(method)); + + // datetime + this.write(zipUtil.getLongBytes(ae.getTimeDos())); + + // crc32 checksum + this.write(zipUtil.getLongBytes(ae.getCrc())); + + // sizes + this.write(zipUtil.getLongBytes(compressedSize)); + this.write(zipUtil.getLongBytes(size)); + + var name = ae.getName(); + var comment = ae.getComment(); + var extra = ae.getCentralDirectoryExtra(); + + if (gpb.usesUTF8ForNames()) { + name = new Buffer(name); + comment = new Buffer(comment); + } + + // name length + this.write(zipUtil.getShortBytes(name.length)); + + // extra length + this.write(zipUtil.getShortBytes(extra.length)); + + // comments length + this.write(zipUtil.getShortBytes(comment.length)); + + // disk number start + this.write(constants.SHORT_ZERO); + + // internal attributes + this.write(zipUtil.getShortBytes(ae.getInternalAttributes())); + + // external attributes + this.write(zipUtil.getLongBytes(ae.getExternalAttributes())); + + // relative offset of LFH + if (offsets.file > constants.ZIP64_MAGIC) { + this.write(zipUtil.getLongBytes(constants.ZIP64_MAGIC)); + } else { + this.write(zipUtil.getLongBytes(offsets.file)); + } + + // name + this.write(name); + + // extra + this.write(extra); + + // comment + this.write(comment); +}; + +ZipArchiveOutputStream.prototype._writeDataDescriptor = function(ae) { + // signature + this.write(zipUtil.getLongBytes(constants.SIG_DD)); + + // crc32 checksum + this.write(zipUtil.getLongBytes(ae.getCrc())); + + // sizes + if (ae.isZip64()) { + this.write(zipUtil.getEightBytes(ae.getCompressedSize())); + this.write(zipUtil.getEightBytes(ae.getSize())); + } else { + this.write(zipUtil.getLongBytes(ae.getCompressedSize())); + this.write(zipUtil.getLongBytes(ae.getSize())); + } +}; + +ZipArchiveOutputStream.prototype._writeLocalFileHeader = function(ae) { + var gpb = ae.getGeneralPurposeBit(); + var method = ae.getMethod(); + var name = ae.getName(); + var extra = ae.getLocalFileDataExtra(); + + if (ae.isZip64()) { + gpb.useDataDescriptor(true); + ae.setVersionNeededToExtract(constants.MIN_VERSION_ZIP64); + } + + if (gpb.usesUTF8ForNames()) { + name = new Buffer(name); + } + + ae._offsets.file = this.offset; + + // signature + this.write(zipUtil.getLongBytes(constants.SIG_LFH)); + + // version to extract and general bit flag + this.write(zipUtil.getShortBytes(ae.getVersionNeededToExtract())); + this.write(gpb.encode()); + + // compression method + this.write(zipUtil.getShortBytes(method)); + + // datetime + this.write(zipUtil.getLongBytes(ae.getTimeDos())); + + ae._offsets.data = this.offset; + + // crc32 checksum and sizes + if (gpb.usesDataDescriptor()) { + this.write(constants.LONG_ZERO); + this.write(constants.LONG_ZERO); + this.write(constants.LONG_ZERO); + } else { + this.write(zipUtil.getLongBytes(ae.getCrc())); + this.write(zipUtil.getLongBytes(ae.getCompressedSize())); + this.write(zipUtil.getLongBytes(ae.getSize())); + } + + // name length + this.write(zipUtil.getShortBytes(name.length)); + + // extra length + this.write(zipUtil.getShortBytes(extra.length)); + + // name + this.write(name); + + // extra + this.write(extra); + + ae._offsets.contents = this.offset; +}; + +ZipArchiveOutputStream.prototype.getComment = function(comment) { + return this._archive.comment !== null ? this._archive.comment : ''; +}; + +ZipArchiveOutputStream.prototype.isZip64 = function() { + return this._archive.forceZip64 || this._entries.length > constants.ZIP64_MAGIC_SHORT || this._archive.centralLength > constants.ZIP64_MAGIC || this._archive.centralOffset > constants.ZIP64_MAGIC; +}; + +ZipArchiveOutputStream.prototype.setComment = function(comment) { + this._archive.comment = comment; +}; diff --git a/node_modules/compress-commons/lib/compress-commons.js b/node_modules/compress-commons/lib/compress-commons.js index ef3bc1dbe..f80b8da30 100644 --- a/node_modules/compress-commons/lib/compress-commons.js +++ b/node_modules/compress-commons/lib/compress-commons.js @@ -1,13 +1,13 @@ -/** - * node-compress-commons - * - * Copyright (c) 2014 Chris Talkington, contributors. - * Licensed under the MIT license. - * https://github.com/archiverjs/node-compress-commons/blob/master/LICENSE-MIT - */ -module.exports = { - ArchiveEntry: require('./archivers/archive-entry'), - ZipArchiveEntry: require('./archivers/zip/zip-archive-entry'), - ArchiveOutputStream: require('./archivers/archive-output-stream'), - ZipArchiveOutputStream: require('./archivers/zip/zip-archive-output-stream') +/** + * node-compress-commons + * + * Copyright (c) 2014 Chris Talkington, contributors. + * Licensed under the MIT license. + * https://github.com/archiverjs/node-compress-commons/blob/master/LICENSE-MIT + */ +module.exports = { + ArchiveEntry: require('./archivers/archive-entry'), + ZipArchiveEntry: require('./archivers/zip/zip-archive-entry'), + ArchiveOutputStream: require('./archivers/archive-output-stream'), + ZipArchiveOutputStream: require('./archivers/zip/zip-archive-output-stream') }; \ No newline at end of file diff --git a/node_modules/compress-commons/lib/util/index.js b/node_modules/compress-commons/lib/util/index.js index 67cd1f18f..76474aa5b 100644 --- a/node_modules/compress-commons/lib/util/index.js +++ b/node_modules/compress-commons/lib/util/index.js @@ -1,30 +1,30 @@ -/** - * node-compress-commons - * - * Copyright (c) 2014 Chris Talkington, contributors. - * Licensed under the MIT license. - * https://github.com/archiverjs/node-compress-commons/blob/master/LICENSE-MIT - */ -var Stream = require('stream').Stream; -var PassThrough = require('readable-stream').PassThrough; - -var util = module.exports = {}; - -util.isStream = function(source) { - return source instanceof Stream; -}; - -util.normalizeInputSource = function(source) { - if (source === null) { - return new Buffer(0); - } else if (typeof source === 'string') { - return new Buffer(source); - } else if (util.isStream(source) && !source._readableState) { - var normalized = new PassThrough(); - source.pipe(normalized); - - return normalized; - } - - return source; +/** + * node-compress-commons + * + * Copyright (c) 2014 Chris Talkington, contributors. + * Licensed under the MIT license. + * https://github.com/archiverjs/node-compress-commons/blob/master/LICENSE-MIT + */ +var Stream = require('stream').Stream; +var PassThrough = require('readable-stream').PassThrough; + +var util = module.exports = {}; + +util.isStream = function(source) { + return source instanceof Stream; +}; + +util.normalizeInputSource = function(source) { + if (source === null) { + return new Buffer(0); + } else if (typeof source === 'string') { + return new Buffer(source); + } else if (util.isStream(source) && !source._readableState) { + var normalized = new PassThrough(); + source.pipe(normalized); + + return normalized; + } + + return source; }; \ No newline at end of file diff --git a/node_modules/compress-commons/package.json b/node_modules/compress-commons/package.json index 10b497263..4f43ba3a4 100644 --- a/node_modules/compress-commons/package.json +++ b/node_modules/compress-commons/package.json @@ -1,52 +1,48 @@ -{ - "name": "compress-commons", - "version": "1.2.2", - "description": "a library that defines a common interface for working with archive formats within node", - "homepage": "https://github.com/archiverjs/node-compress-commons", - "author": { - "name": "Chris Talkington", - "url": "http://christalkington.com/" - }, - "repository": { - "type": "git", - "url": "https://github.com/archiverjs/node-compress-commons.git" - }, - "bugs": { - "url": "https://github.com/archiverjs/node-compress-commons/issues" - }, - "license": "MIT", - "main": "lib/compress-commons.js", - "files": [ - "lib" - ], - "engines": { - "node": ">= 0.10.0" - }, - "scripts": { - "test": "mocha --reporter dot" - }, - "dependencies": { - "buffer-crc32": "^0.2.1", - "crc32-stream": "^2.0.0", - "normalize-path": "^2.0.0", - "readable-stream": "^2.0.0" - }, - "devDependencies": { - "chai": "^3.4.0", - "mocha": "^3.2.0", - "rimraf": "^2.4.3", - "mkdirp": "^0.5.0" - }, - "keywords": [ - "compress", - "commons", - "archive" - ], - "publishConfig": { - "registry": "https://registry.npmjs.org/" - } - -,"_resolved": "https://registry.npmjs.org/compress-commons/-/compress-commons-1.2.2.tgz" -,"_integrity": "sha1-UkqfEJA/OoEzibAiXSfEi7dRiQ8=" -,"_from": "compress-commons@1.2.2" +{ + "name": "compress-commons", + "version": "1.2.2", + "description": "a library that defines a common interface for working with archive formats within node", + "homepage": "https://github.com/archiverjs/node-compress-commons", + "author": { + "name": "Chris Talkington", + "url": "http://christalkington.com/" + }, + "repository": { + "type": "git", + "url": "https://github.com/archiverjs/node-compress-commons.git" + }, + "bugs": { + "url": "https://github.com/archiverjs/node-compress-commons/issues" + }, + "license": "MIT", + "main": "lib/compress-commons.js", + "files": [ + "lib" + ], + "engines": { + "node": ">= 0.10.0" + }, + "scripts": { + "test": "mocha --reporter dot" + }, + "dependencies": { + "buffer-crc32": "^0.2.1", + "crc32-stream": "^2.0.0", + "normalize-path": "^2.0.0", + "readable-stream": "^2.0.0" + }, + "devDependencies": { + "chai": "^3.4.0", + "mocha": "^3.2.0", + "rimraf": "^2.4.3", + "mkdirp": "^0.5.0" + }, + "keywords": [ + "compress", + "commons", + "archive" + ], + "publishConfig": { + "registry": "https://registry.npmjs.org/" + } } \ No newline at end of file diff --git a/node_modules/concat-map/package.json b/node_modules/concat-map/package.json index 03d173495..d3640e6b0 100644 --- a/node_modules/concat-map/package.json +++ b/node_modules/concat-map/package.json @@ -40,8 +40,4 @@ "opera" : [ 12 ] } } - -,"_resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz" -,"_integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" -,"_from": "concat-map@0.0.1" -} \ No newline at end of file +} diff --git a/node_modules/core-util-is/package.json b/node_modules/core-util-is/package.json index 3c6ef7365..3368e9519 100644 --- a/node_modules/core-util-is/package.json +++ b/node_modules/core-util-is/package.json @@ -29,8 +29,4 @@ "devDependencies": { "tap": "^2.3.0" } - -,"_resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz" -,"_integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" -,"_from": "core-util-is@1.0.2" -} \ No newline at end of file +} diff --git a/node_modules/crc/package.json b/node_modules/crc/package.json index 1f4f74957..7daaf45fa 100644 --- a/node_modules/crc/package.json +++ b/node_modules/crc/package.json @@ -50,8 +50,4 @@ "dependencies": { "buffer": "^5.1.0" } - -,"_resolved": "https://registry.npmjs.org/crc/-/crc-3.8.0.tgz" -,"_integrity": "sha512-iX3mfgcTMIq3ZKLIsVFAbv7+Mc10kxabAGQb8HvjA1o3T1PIYprbakQ65d3I+2HGHt6nSKkM9PYjgoJO2KcFBQ==" -,"_from": "crc@3.8.0" -} \ No newline at end of file +} diff --git a/node_modules/crc32-stream/CHANGELOG.md b/node_modules/crc32-stream/CHANGELOG.md index d3319fa56..2dd648590 100644 --- a/node_modules/crc32-stream/CHANGELOG.md +++ b/node_modules/crc32-stream/CHANGELOG.md @@ -1,12 +1,12 @@ -## Changelog - -**2.0.0** — _February 13, 2017_ — [Diff](https://github.com/archiverjs/node-crc32-stream/compare/1.0.1...2.0.0) - -- adopt nodejs core Hash API (GH #4) - -**1.0.1** — _January 12, 2016_ — [Diff](https://github.com/archiverjs/node-crc32-stream/compare/1.0.0...1.0.1) - -- Switch to node-crc for performance (GH #3) -- bump deps to ensure latest versions are used. - +## Changelog + +**2.0.0** — _February 13, 2017_ — [Diff](https://github.com/archiverjs/node-crc32-stream/compare/1.0.1...2.0.0) + +- adopt nodejs core Hash API (GH #4) + +**1.0.1** — _January 12, 2016_ — [Diff](https://github.com/archiverjs/node-crc32-stream/compare/1.0.0...1.0.1) + +- Switch to node-crc for performance (GH #3) +- bump deps to ensure latest versions are used. + [Release Archive](https://github.com/archiverjs/node-crc32-stream/releases) \ No newline at end of file diff --git a/node_modules/crc32-stream/LICENSE b/node_modules/crc32-stream/LICENSE index 56420a6a0..819b403f0 100644 --- a/node_modules/crc32-stream/LICENSE +++ b/node_modules/crc32-stream/LICENSE @@ -1,22 +1,22 @@ -Copyright (c) 2014 Chris Talkington, contributors. - -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 +Copyright (c) 2014 Chris Talkington, contributors. + +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. \ No newline at end of file diff --git a/node_modules/crc32-stream/README.md b/node_modules/crc32-stream/README.md index e9c61da5a..a0b508054 100644 --- a/node_modules/crc32-stream/README.md +++ b/node_modules/crc32-stream/README.md @@ -1,79 +1,79 @@ -# crc32-stream v2.0.0 [![Build Status](https://travis-ci.org/archiverjs/node-crc32-stream.svg?branch=master)](https://travis-ci.org/archiverjs/node-crc32-stream) [![Build status](https://ci.appveyor.com/api/projects/status/sy60s39cmyvd60i3/branch/master?svg=true)](https://ci.appveyor.com/project/ctalkington/node-crc32-stream/branch/master) - -crc32-stream is a streaming CRC32 checksumer. It uses [buffer-crc32](https://www.npmjs.org/package/buffer-crc32) behind the scenes to reliably handle binary data and fancy character sets. Data is passed through untouched. - -### Install - -```bash -npm install crc32-stream --save -``` - -You can also use `npm install https://github.com/archiverjs/node-crc32-stream/archive/master.tar.gz` to test upcoming versions. - -### Usage - -#### CRC32Stream - -Inherits [Transform Stream](http://nodejs.org/api/stream.html#stream_class_stream_transform) options and methods. - -```js -var CRC32Stream = require('crc32-stream'); - -var source = fs.createReadStream('file.txt'); -var checksum = new CRC32Stream(); - -checksum.on('end', function(err) { - // do something with checksum.digest() here -}); - -// either pipe it -source.pipe(checksum); - -// or write it -checksum.write('string'); -checksum.end(); -``` - -#### DeflateCRC32Stream - -Inherits [zlib.DeflateRaw](http://nodejs.org/api/zlib.html#zlib_class_zlib_deflateraw) options and methods. - -```js -var DeflateCRC32Stream = require('crc32-stream').DeflateCRC32Stream; - -var source = fs.createReadStream('file.txt'); -var checksum = new DeflateCRC32Stream(); - -checksum.on('end', function(err) { - // do something with checksum.digest() here -}); - -// either pipe it -source.pipe(checksum); - -// or write it -checksum.write('string'); -checksum.end(); -``` - -### Instance API - -#### digest() - -Returns the checksum digest in unsigned form. - -#### hex() - -Returns the hexadecimal representation of the checksum digest. (ie E81722F0) - -#### size(compressed) - -Returns the raw size/length of passed-through data. - -If `compressed` is `true`, it returns compressed length instead. (DeflateCRC32Stream) - -## Things of Interest - -- [Changelog](https://github.com/archiverjs/node-crc32-stream/releases) -- [Contributing](https://github.com/archiverjs/node-crc32-stream/blob/master/CONTRIBUTING.md) +# crc32-stream v2.0.0 [![Build Status](https://travis-ci.org/archiverjs/node-crc32-stream.svg?branch=master)](https://travis-ci.org/archiverjs/node-crc32-stream) [![Build status](https://ci.appveyor.com/api/projects/status/sy60s39cmyvd60i3/branch/master?svg=true)](https://ci.appveyor.com/project/ctalkington/node-crc32-stream/branch/master) + +crc32-stream is a streaming CRC32 checksumer. It uses [buffer-crc32](https://www.npmjs.org/package/buffer-crc32) behind the scenes to reliably handle binary data and fancy character sets. Data is passed through untouched. + +### Install + +```bash +npm install crc32-stream --save +``` + +You can also use `npm install https://github.com/archiverjs/node-crc32-stream/archive/master.tar.gz` to test upcoming versions. + +### Usage + +#### CRC32Stream + +Inherits [Transform Stream](http://nodejs.org/api/stream.html#stream_class_stream_transform) options and methods. + +```js +var CRC32Stream = require('crc32-stream'); + +var source = fs.createReadStream('file.txt'); +var checksum = new CRC32Stream(); + +checksum.on('end', function(err) { + // do something with checksum.digest() here +}); + +// either pipe it +source.pipe(checksum); + +// or write it +checksum.write('string'); +checksum.end(); +``` + +#### DeflateCRC32Stream + +Inherits [zlib.DeflateRaw](http://nodejs.org/api/zlib.html#zlib_class_zlib_deflateraw) options and methods. + +```js +var DeflateCRC32Stream = require('crc32-stream').DeflateCRC32Stream; + +var source = fs.createReadStream('file.txt'); +var checksum = new DeflateCRC32Stream(); + +checksum.on('end', function(err) { + // do something with checksum.digest() here +}); + +// either pipe it +source.pipe(checksum); + +// or write it +checksum.write('string'); +checksum.end(); +``` + +### Instance API + +#### digest() + +Returns the checksum digest in unsigned form. + +#### hex() + +Returns the hexadecimal representation of the checksum digest. (ie E81722F0) + +#### size(compressed) + +Returns the raw size/length of passed-through data. + +If `compressed` is `true`, it returns compressed length instead. (DeflateCRC32Stream) + +## Things of Interest + +- [Changelog](https://github.com/archiverjs/node-crc32-stream/releases) +- [Contributing](https://github.com/archiverjs/node-crc32-stream/blob/master/CONTRIBUTING.md) - [MIT License](https://github.com/archiverjs/node-crc32-stream/blob/master/LICENSE-MIT) \ No newline at end of file diff --git a/node_modules/crc32-stream/lib/crc32-stream.js b/node_modules/crc32-stream/lib/crc32-stream.js index 32c5205c7..f0b0ee6c7 100644 --- a/node_modules/crc32-stream/lib/crc32-stream.js +++ b/node_modules/crc32-stream/lib/crc32-stream.js @@ -1,44 +1,44 @@ -/** - * node-crc32-stream - * - * Copyright (c) 2014 Chris Talkington, contributors. - * Licensed under the MIT license. - * https://github.com/archiverjs/node-crc32-stream/blob/master/LICENSE-MIT - */ -var inherits = require('util').inherits; -var Transform = require('readable-stream').Transform; - -var crc32 = require('crc').crc32; - -var CRC32Stream = module.exports = function CRC32Stream(options) { - Transform.call(this, options); - this.checksum = new Buffer(4); - this.checksum.writeInt32BE(0, 0); - - this.rawSize = 0; -}; - -inherits(CRC32Stream, Transform); - -CRC32Stream.prototype._transform = function(chunk, encoding, callback) { - if (chunk) { - this.checksum = crc32(chunk, this.checksum); - this.rawSize += chunk.length; - } - - callback(null, chunk); -}; - -CRC32Stream.prototype.digest = function(encoding) { - var checksum = new Buffer(4); - checksum.writeUInt32BE(this.checksum >>> 0, 0); - return encoding ? checksum.toString(encoding) : checksum; -}; - -CRC32Stream.prototype.hex = function() { - return this.digest('hex').toUpperCase(); -}; - -CRC32Stream.prototype.size = function() { - return this.rawSize; -}; +/** + * node-crc32-stream + * + * Copyright (c) 2014 Chris Talkington, contributors. + * Licensed under the MIT license. + * https://github.com/archiverjs/node-crc32-stream/blob/master/LICENSE-MIT + */ +var inherits = require('util').inherits; +var Transform = require('readable-stream').Transform; + +var crc32 = require('crc').crc32; + +var CRC32Stream = module.exports = function CRC32Stream(options) { + Transform.call(this, options); + this.checksum = new Buffer(4); + this.checksum.writeInt32BE(0, 0); + + this.rawSize = 0; +}; + +inherits(CRC32Stream, Transform); + +CRC32Stream.prototype._transform = function(chunk, encoding, callback) { + if (chunk) { + this.checksum = crc32(chunk, this.checksum); + this.rawSize += chunk.length; + } + + callback(null, chunk); +}; + +CRC32Stream.prototype.digest = function(encoding) { + var checksum = new Buffer(4); + checksum.writeUInt32BE(this.checksum >>> 0, 0); + return encoding ? checksum.toString(encoding) : checksum; +}; + +CRC32Stream.prototype.hex = function() { + return this.digest('hex').toUpperCase(); +}; + +CRC32Stream.prototype.size = function() { + return this.rawSize; +}; diff --git a/node_modules/crc32-stream/lib/deflate-crc32-stream.js b/node_modules/crc32-stream/lib/deflate-crc32-stream.js index 978a766fc..d55c2032c 100644 --- a/node_modules/crc32-stream/lib/deflate-crc32-stream.js +++ b/node_modules/crc32-stream/lib/deflate-crc32-stream.js @@ -1,69 +1,69 @@ -/** - * node-crc32-stream - * - * Copyright (c) 2014 Chris Talkington, contributors. - * Licensed under the MIT license. - * https://github.com/archiverjs/node-crc32-stream/blob/master/LICENSE-MIT - */ -var zlib = require('zlib'); -var inherits = require('util').inherits; - -var crc32 = require('crc').crc32; - -var DeflateCRC32Stream = module.exports = function (options) { - zlib.DeflateRaw.call(this, options); - - this.checksum = new Buffer(4); - this.checksum.writeInt32BE(0, 0); - - this.rawSize = 0; - this.compressedSize = 0; - - // BC v0.8 - if (typeof zlib.DeflateRaw.prototype.push !== 'function') { - this.on('data', function(chunk) { - if (chunk) { - this.compressedSize += chunk.length; - } - }); - } -}; - -inherits(DeflateCRC32Stream, zlib.DeflateRaw); - -DeflateCRC32Stream.prototype.push = function(chunk, encoding) { - if (chunk) { - this.compressedSize += chunk.length; - } - - return zlib.DeflateRaw.prototype.push.call(this, chunk, encoding); -}; - -DeflateCRC32Stream.prototype.write = function(chunk, enc, cb) { - if (chunk) { - this.checksum = crc32(chunk, this.checksum); - this.rawSize += chunk.length; - } - - return zlib.DeflateRaw.prototype.write.call(this, chunk, enc, cb); -}; - -DeflateCRC32Stream.prototype.digest = function(encoding) { - var checksum = new Buffer(4); - checksum.writeUInt32BE(this.checksum >>> 0, 0); - return encoding ? checksum.toString(encoding) : checksum; -}; - -DeflateCRC32Stream.prototype.hex = function() { - return this.digest('hex').toUpperCase(); -}; - -DeflateCRC32Stream.prototype.size = function(compressed) { - compressed = compressed || false; - - if (compressed) { - return this.compressedSize; - } else { - return this.rawSize; - } -}; +/** + * node-crc32-stream + * + * Copyright (c) 2014 Chris Talkington, contributors. + * Licensed under the MIT license. + * https://github.com/archiverjs/node-crc32-stream/blob/master/LICENSE-MIT + */ +var zlib = require('zlib'); +var inherits = require('util').inherits; + +var crc32 = require('crc').crc32; + +var DeflateCRC32Stream = module.exports = function (options) { + zlib.DeflateRaw.call(this, options); + + this.checksum = new Buffer(4); + this.checksum.writeInt32BE(0, 0); + + this.rawSize = 0; + this.compressedSize = 0; + + // BC v0.8 + if (typeof zlib.DeflateRaw.prototype.push !== 'function') { + this.on('data', function(chunk) { + if (chunk) { + this.compressedSize += chunk.length; + } + }); + } +}; + +inherits(DeflateCRC32Stream, zlib.DeflateRaw); + +DeflateCRC32Stream.prototype.push = function(chunk, encoding) { + if (chunk) { + this.compressedSize += chunk.length; + } + + return zlib.DeflateRaw.prototype.push.call(this, chunk, encoding); +}; + +DeflateCRC32Stream.prototype.write = function(chunk, enc, cb) { + if (chunk) { + this.checksum = crc32(chunk, this.checksum); + this.rawSize += chunk.length; + } + + return zlib.DeflateRaw.prototype.write.call(this, chunk, enc, cb); +}; + +DeflateCRC32Stream.prototype.digest = function(encoding) { + var checksum = new Buffer(4); + checksum.writeUInt32BE(this.checksum >>> 0, 0); + return encoding ? checksum.toString(encoding) : checksum; +}; + +DeflateCRC32Stream.prototype.hex = function() { + return this.digest('hex').toUpperCase(); +}; + +DeflateCRC32Stream.prototype.size = function(compressed) { + compressed = compressed || false; + + if (compressed) { + return this.compressedSize; + } else { + return this.rawSize; + } +}; diff --git a/node_modules/crc32-stream/lib/index.js b/node_modules/crc32-stream/lib/index.js index e26ea25d3..31187e38e 100644 --- a/node_modules/crc32-stream/lib/index.js +++ b/node_modules/crc32-stream/lib/index.js @@ -1,10 +1,10 @@ -/** - * node-crc32-stream - * - * Copyright (c) 2014 Chris Talkington, contributors. - * Licensed under the MIT license. - * https://github.com/archiverjs/node-crc32-stream/blob/master/LICENSE-MIT - */ -exports = module.exports = require('./crc32-stream'); -exports.CRC32Stream = exports; +/** + * node-crc32-stream + * + * Copyright (c) 2014 Chris Talkington, contributors. + * Licensed under the MIT license. + * https://github.com/archiverjs/node-crc32-stream/blob/master/LICENSE-MIT + */ +exports = module.exports = require('./crc32-stream'); +exports.CRC32Stream = exports; exports.DeflateCRC32Stream = require('./deflate-crc32-stream'); \ No newline at end of file diff --git a/node_modules/crc32-stream/package.json b/node_modules/crc32-stream/package.json index b3af1ce0c..d7ecbb3b5 100644 --- a/node_modules/crc32-stream/package.json +++ b/node_modules/crc32-stream/package.json @@ -1,49 +1,45 @@ -{ - "name": "crc32-stream", - "version": "2.0.0", - "description": "a streaming CRC32 checksumer", - "homepage": "https://github.com/archiverjs/node-crc32-stream", - "author": { - "name": "Chris Talkington", - "url": "http://christalkington.com/" - }, - "repository": { - "type": "git", - "url": "https://github.com/archiverjs/node-crc32-stream.git" - }, - "bugs": { - "url": "https://github.com/archiverjs/node-crc32-stream/issues" - }, - "license": "MIT", - "main": "lib/index.js", - "files": [ - "lib" - ], - "engines": { - "node": ">= 0.10.0" - }, - "scripts": { - "test": "mocha --reporter dot" - }, - "dependencies": { - "crc": "^3.4.4", - "readable-stream": "^2.0.0" - }, - "devDependencies": { - "chai": "^3.4.0", - "mocha": "^3.2.0" - }, - "keywords": [ - "crc32-stream", - "crc32", - "stream", - "checksum" - ], - "publishConfig": { - "registry": "https://registry.npmjs.org/" - } - -,"_resolved": "https://registry.npmjs.org/crc32-stream/-/crc32-stream-2.0.0.tgz" -,"_integrity": "sha1-483TtN8xaN10494/u8t7KX/pCPQ=" -,"_from": "crc32-stream@2.0.0" -} \ No newline at end of file +{ + "name": "crc32-stream", + "version": "2.0.0", + "description": "a streaming CRC32 checksumer", + "homepage": "https://github.com/archiverjs/node-crc32-stream", + "author": { + "name": "Chris Talkington", + "url": "http://christalkington.com/" + }, + "repository": { + "type": "git", + "url": "https://github.com/archiverjs/node-crc32-stream.git" + }, + "bugs": { + "url": "https://github.com/archiverjs/node-crc32-stream/issues" + }, + "license": "MIT", + "main": "lib/index.js", + "files": [ + "lib" + ], + "engines": { + "node": ">= 0.10.0" + }, + "scripts": { + "test": "mocha --reporter dot" + }, + "dependencies": { + "crc": "^3.4.4", + "readable-stream": "^2.0.0" + }, + "devDependencies": { + "chai": "^3.4.0", + "mocha": "^3.2.0" + }, + "keywords": [ + "crc32-stream", + "crc32", + "stream", + "checksum" + ], + "publishConfig": { + "registry": "https://registry.npmjs.org/" + } +} diff --git a/node_modules/cross-spawn/node_modules/.bin/semver b/node_modules/cross-spawn/node_modules/.bin/semver deleted file mode 100644 index 86cee84b6..000000000 --- a/node_modules/cross-spawn/node_modules/.bin/semver +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") - -case `uname` in - *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;; -esac - -if [ -x "$basedir/node" ]; then - exec "$basedir/node" "$basedir/../semver/bin/semver" "$@" -else - exec node "$basedir/../semver/bin/semver" "$@" -fi diff --git a/node_modules/cross-spawn/node_modules/.bin/semver b/node_modules/cross-spawn/node_modules/.bin/semver new file mode 120000 index 000000000..317eb293d --- /dev/null +++ b/node_modules/cross-spawn/node_modules/.bin/semver @@ -0,0 +1 @@ +../semver/bin/semver \ No newline at end of file diff --git a/node_modules/cross-spawn/node_modules/.bin/semver.cmd b/node_modules/cross-spawn/node_modules/.bin/semver.cmd deleted file mode 100644 index 22d9286cd..000000000 --- a/node_modules/cross-spawn/node_modules/.bin/semver.cmd +++ /dev/null @@ -1,17 +0,0 @@ -@ECHO off -GOTO start -:find_dp0 -SET dp0=%~dp0 -EXIT /b -:start -SETLOCAL -CALL :find_dp0 - -IF EXIST "%dp0%\node.exe" ( - SET "_prog=%dp0%\node.exe" -) ELSE ( - SET "_prog=node" - SET PATHEXT=%PATHEXT:;.JS;=;% -) - -endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\semver\bin\semver" %* diff --git a/node_modules/cross-spawn/node_modules/.bin/semver.ps1 b/node_modules/cross-spawn/node_modules/.bin/semver.ps1 deleted file mode 100644 index 98c1b093f..000000000 --- a/node_modules/cross-spawn/node_modules/.bin/semver.ps1 +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env pwsh -$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent - -$exe="" -if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { - # Fix case when both the Windows and Linux builds of Node - # are installed in the same directory - $exe=".exe" -} -$ret=0 -if (Test-Path "$basedir/node$exe") { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "$basedir/node$exe" "$basedir/../semver/bin/semver" $args - } else { - & "$basedir/node$exe" "$basedir/../semver/bin/semver" $args - } - $ret=$LASTEXITCODE -} else { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "node$exe" "$basedir/../semver/bin/semver" $args - } else { - & "node$exe" "$basedir/../semver/bin/semver" $args - } - $ret=$LASTEXITCODE -} -exit $ret diff --git a/node_modules/cross-spawn/node_modules/.bin/which b/node_modules/cross-spawn/node_modules/.bin/which deleted file mode 100644 index c51820f2f..000000000 --- a/node_modules/cross-spawn/node_modules/.bin/which +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") - -case `uname` in - *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;; -esac - -if [ -x "$basedir/node" ]; then - exec "$basedir/node" "$basedir/../which/bin/which" "$@" -else - exec node "$basedir/../which/bin/which" "$@" -fi diff --git a/node_modules/cross-spawn/node_modules/.bin/which b/node_modules/cross-spawn/node_modules/.bin/which new file mode 120000 index 000000000..f62471c85 --- /dev/null +++ b/node_modules/cross-spawn/node_modules/.bin/which @@ -0,0 +1 @@ +../which/bin/which \ No newline at end of file diff --git a/node_modules/cross-spawn/node_modules/.bin/which.cmd b/node_modules/cross-spawn/node_modules/.bin/which.cmd deleted file mode 100644 index ead37d628..000000000 --- a/node_modules/cross-spawn/node_modules/.bin/which.cmd +++ /dev/null @@ -1,17 +0,0 @@ -@ECHO off -GOTO start -:find_dp0 -SET dp0=%~dp0 -EXIT /b -:start -SETLOCAL -CALL :find_dp0 - -IF EXIST "%dp0%\node.exe" ( - SET "_prog=%dp0%\node.exe" -) ELSE ( - SET "_prog=node" - SET PATHEXT=%PATHEXT:;.JS;=;% -) - -endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\which\bin\which" %* diff --git a/node_modules/cross-spawn/node_modules/.bin/which.ps1 b/node_modules/cross-spawn/node_modules/.bin/which.ps1 deleted file mode 100644 index 1437a3b6e..000000000 --- a/node_modules/cross-spawn/node_modules/.bin/which.ps1 +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env pwsh -$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent - -$exe="" -if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { - # Fix case when both the Windows and Linux builds of Node - # are installed in the same directory - $exe=".exe" -} -$ret=0 -if (Test-Path "$basedir/node$exe") { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "$basedir/node$exe" "$basedir/../which/bin/which" $args - } else { - & "$basedir/node$exe" "$basedir/../which/bin/which" $args - } - $ret=$LASTEXITCODE -} else { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "node$exe" "$basedir/../which/bin/which" $args - } else { - & "node$exe" "$basedir/../which/bin/which" $args - } - $ret=$LASTEXITCODE -} -exit $ret diff --git a/node_modules/cross-spawn/node_modules/semver/bin/semver b/node_modules/cross-spawn/node_modules/semver/bin/semver old mode 100644 new mode 100755 diff --git a/node_modules/cross-spawn/node_modules/which/bin/which b/node_modules/cross-spawn/node_modules/which/bin/which old mode 100644 new mode 100755 diff --git a/node_modules/decompress-zip/bin/decompress-zip b/node_modules/decompress-zip/bin/decompress-zip old mode 100644 new mode 100755 diff --git a/node_modules/decompress-zip/node_modules/isarray/package.json b/node_modules/decompress-zip/node_modules/isarray/package.json index 49631b520..5a1e9c109 100644 --- a/node_modules/decompress-zip/node_modules/isarray/package.json +++ b/node_modules/decompress-zip/node_modules/isarray/package.json @@ -22,8 +22,4 @@ "url": "http://juliangruber.com" }, "license": "MIT" - -,"_resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz" -,"_integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=" -,"_from": "isarray@0.0.1" -} \ No newline at end of file +} diff --git a/node_modules/decompress-zip/node_modules/readable-stream/package.json b/node_modules/decompress-zip/node_modules/readable-stream/package.json index 5ecba3c63..0bb83ed06 100644 --- a/node_modules/decompress-zip/node_modules/readable-stream/package.json +++ b/node_modules/decompress-zip/node_modules/readable-stream/package.json @@ -29,8 +29,4 @@ }, "author": "Isaac Z. Schlueter (http://blog.izs.me/)", "license": "MIT" - -,"_resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz" -,"_integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=" -,"_from": "readable-stream@1.1.14" -} \ No newline at end of file +} diff --git a/node_modules/decompress-zip/node_modules/string_decoder/package.json b/node_modules/decompress-zip/node_modules/string_decoder/package.json index 9614dec60..f2dd499c4 100644 --- a/node_modules/decompress-zip/node_modules/string_decoder/package.json +++ b/node_modules/decompress-zip/node_modules/string_decoder/package.json @@ -22,8 +22,4 @@ "browserify" ], "license": "MIT" - -,"_resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz" -,"_integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=" -,"_from": "string_decoder@0.10.31" -} \ No newline at end of file +} diff --git a/node_modules/deep-is/package.json b/node_modules/deep-is/package.json index 10b4c04c5..63628f0d0 100644 --- a/node_modules/deep-is/package.json +++ b/node_modules/deep-is/package.json @@ -58,8 +58,4 @@ ] } } - -,"_resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz" -,"_integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=" -,"_from": "deep-is@0.1.3" -} \ No newline at end of file +} diff --git a/node_modules/diff-sequences/build/ts3.4/index.d.ts b/node_modules/diff-sequences/build/ts3.4/index.d.ts index 46c9001b7..cb7ac8db7 100644 --- a/node_modules/diff-sequences/build/ts3.4/index.d.ts +++ b/node_modules/diff-sequences/build/ts3.4/index.d.ts @@ -1,19 +1,19 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ -declare type IsCommon = (aIndex: number, // caller can assume: 0 <= aIndex && aIndex < aLength -bIndex: number) => boolean; -declare type FoundSubsequence = (nCommon: number, // caller can assume: 0 < nCommon -aCommon: number, // caller can assume: 0 <= aCommon && aCommon < aLength -bCommon: number) => void; -export declare type Callbacks = { - foundSubsequence: FoundSubsequence; - isCommon: IsCommon; -}; -declare const _default: (aLength: number, bLength: number, isCommon: IsCommon, foundSubsequence: FoundSubsequence) => void; -export default _default; -//# sourceMappingURL=index.d.ts.map +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + */ +declare type IsCommon = (aIndex: number, // caller can assume: 0 <= aIndex && aIndex < aLength +bIndex: number) => boolean; +declare type FoundSubsequence = (nCommon: number, // caller can assume: 0 < nCommon +aCommon: number, // caller can assume: 0 <= aCommon && aCommon < aLength +bCommon: number) => void; +export declare type Callbacks = { + foundSubsequence: FoundSubsequence; + isCommon: IsCommon; +}; +declare const _default: (aLength: number, bLength: number, isCommon: IsCommon, foundSubsequence: FoundSubsequence) => void; +export default _default; +//# sourceMappingURL=index.d.ts.map diff --git a/node_modules/ecc-jsbn/LICENSE b/node_modules/ecc-jsbn/LICENSE old mode 100644 new mode 100755 diff --git a/node_modules/ecc-jsbn/README.md b/node_modules/ecc-jsbn/README.md old mode 100644 new mode 100755 diff --git a/node_modules/ecc-jsbn/index.js b/node_modules/ecc-jsbn/index.js old mode 100644 new mode 100755 diff --git a/node_modules/ecc-jsbn/lib/LICENSE-jsbn b/node_modules/ecc-jsbn/lib/LICENSE-jsbn old mode 100644 new mode 100755 diff --git a/node_modules/ecc-jsbn/lib/ec.js b/node_modules/ecc-jsbn/lib/ec.js old mode 100644 new mode 100755 diff --git a/node_modules/ecc-jsbn/lib/sec.js b/node_modules/ecc-jsbn/lib/sec.js old mode 100644 new mode 100755 diff --git a/node_modules/ecc-jsbn/package.json b/node_modules/ecc-jsbn/package.json old mode 100644 new mode 100755 diff --git a/node_modules/ecc-jsbn/test.js b/node_modules/ecc-jsbn/test.js old mode 100644 new mode 100755 diff --git a/node_modules/end-of-stream/package.json b/node_modules/end-of-stream/package.json index f723fae9d..b75bbf0fd 100644 --- a/node_modules/end-of-stream/package.json +++ b/node_modules/end-of-stream/package.json @@ -34,8 +34,4 @@ "devDependencies": { "tape": "^4.11.0" } - -,"_resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz" -,"_integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==" -,"_from": "end-of-stream@1.4.4" -} \ No newline at end of file +} diff --git a/node_modules/escodegen/bin/escodegen.js b/node_modules/escodegen/bin/escodegen.js old mode 100644 new mode 100755 diff --git a/node_modules/escodegen/bin/esgenerate.js b/node_modules/escodegen/bin/esgenerate.js old mode 100644 new mode 100755 diff --git a/node_modules/escodegen/node_modules/.bin/esparse b/node_modules/escodegen/node_modules/.bin/esparse deleted file mode 100644 index 1cc1c96ff..000000000 --- a/node_modules/escodegen/node_modules/.bin/esparse +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") - -case `uname` in - *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;; -esac - -if [ -x "$basedir/node" ]; then - exec "$basedir/node" "$basedir/../esprima/bin/esparse.js" "$@" -else - exec node "$basedir/../esprima/bin/esparse.js" "$@" -fi diff --git a/node_modules/escodegen/node_modules/.bin/esparse b/node_modules/escodegen/node_modules/.bin/esparse new file mode 120000 index 000000000..7423b18b2 --- /dev/null +++ b/node_modules/escodegen/node_modules/.bin/esparse @@ -0,0 +1 @@ +../esprima/bin/esparse.js \ No newline at end of file diff --git a/node_modules/escodegen/node_modules/.bin/esparse.cmd b/node_modules/escodegen/node_modules/.bin/esparse.cmd deleted file mode 100644 index 2ca6d502e..000000000 --- a/node_modules/escodegen/node_modules/.bin/esparse.cmd +++ /dev/null @@ -1,17 +0,0 @@ -@ECHO off -GOTO start -:find_dp0 -SET dp0=%~dp0 -EXIT /b -:start -SETLOCAL -CALL :find_dp0 - -IF EXIST "%dp0%\node.exe" ( - SET "_prog=%dp0%\node.exe" -) ELSE ( - SET "_prog=node" - SET PATHEXT=%PATHEXT:;.JS;=;% -) - -endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\esprima\bin\esparse.js" %* diff --git a/node_modules/escodegen/node_modules/.bin/esparse.ps1 b/node_modules/escodegen/node_modules/.bin/esparse.ps1 deleted file mode 100644 index f19ed7301..000000000 --- a/node_modules/escodegen/node_modules/.bin/esparse.ps1 +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env pwsh -$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent - -$exe="" -if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { - # Fix case when both the Windows and Linux builds of Node - # are installed in the same directory - $exe=".exe" -} -$ret=0 -if (Test-Path "$basedir/node$exe") { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "$basedir/node$exe" "$basedir/../esprima/bin/esparse.js" $args - } else { - & "$basedir/node$exe" "$basedir/../esprima/bin/esparse.js" $args - } - $ret=$LASTEXITCODE -} else { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "node$exe" "$basedir/../esprima/bin/esparse.js" $args - } else { - & "node$exe" "$basedir/../esprima/bin/esparse.js" $args - } - $ret=$LASTEXITCODE -} -exit $ret diff --git a/node_modules/escodegen/node_modules/.bin/esvalidate b/node_modules/escodegen/node_modules/.bin/esvalidate deleted file mode 100644 index 91a4c9b5f..000000000 --- a/node_modules/escodegen/node_modules/.bin/esvalidate +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") - -case `uname` in - *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;; -esac - -if [ -x "$basedir/node" ]; then - exec "$basedir/node" "$basedir/../esprima/bin/esvalidate.js" "$@" -else - exec node "$basedir/../esprima/bin/esvalidate.js" "$@" -fi diff --git a/node_modules/escodegen/node_modules/.bin/esvalidate b/node_modules/escodegen/node_modules/.bin/esvalidate new file mode 120000 index 000000000..16069effb --- /dev/null +++ b/node_modules/escodegen/node_modules/.bin/esvalidate @@ -0,0 +1 @@ +../esprima/bin/esvalidate.js \ No newline at end of file diff --git a/node_modules/escodegen/node_modules/.bin/esvalidate.cmd b/node_modules/escodegen/node_modules/.bin/esvalidate.cmd deleted file mode 100644 index 4c41643ef..000000000 --- a/node_modules/escodegen/node_modules/.bin/esvalidate.cmd +++ /dev/null @@ -1,17 +0,0 @@ -@ECHO off -GOTO start -:find_dp0 -SET dp0=%~dp0 -EXIT /b -:start -SETLOCAL -CALL :find_dp0 - -IF EXIST "%dp0%\node.exe" ( - SET "_prog=%dp0%\node.exe" -) ELSE ( - SET "_prog=node" - SET PATHEXT=%PATHEXT:;.JS;=;% -) - -endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\esprima\bin\esvalidate.js" %* diff --git a/node_modules/escodegen/node_modules/.bin/esvalidate.ps1 b/node_modules/escodegen/node_modules/.bin/esvalidate.ps1 deleted file mode 100644 index 23699d11e..000000000 --- a/node_modules/escodegen/node_modules/.bin/esvalidate.ps1 +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env pwsh -$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent - -$exe="" -if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { - # Fix case when both the Windows and Linux builds of Node - # are installed in the same directory - $exe=".exe" -} -$ret=0 -if (Test-Path "$basedir/node$exe") { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "$basedir/node$exe" "$basedir/../esprima/bin/esvalidate.js" $args - } else { - & "$basedir/node$exe" "$basedir/../esprima/bin/esvalidate.js" $args - } - $ret=$LASTEXITCODE -} else { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "node$exe" "$basedir/../esprima/bin/esvalidate.js" $args - } else { - & "node$exe" "$basedir/../esprima/bin/esvalidate.js" $args - } - $ret=$LASTEXITCODE -} -exit $ret diff --git a/node_modules/escodegen/node_modules/esprima/bin/esparse.js b/node_modules/escodegen/node_modules/esprima/bin/esparse.js old mode 100644 new mode 100755 diff --git a/node_modules/escodegen/node_modules/esprima/bin/esvalidate.js b/node_modules/escodegen/node_modules/esprima/bin/esvalidate.js old mode 100644 new mode 100755 diff --git a/node_modules/esprima/bin/esparse.js b/node_modules/esprima/bin/esparse.js old mode 100644 new mode 100755 diff --git a/node_modules/esprima/bin/esvalidate.js b/node_modules/esprima/bin/esvalidate.js old mode 100644 new mode 100755 diff --git a/node_modules/estraverse/package.json b/node_modules/estraverse/package.json index 60e708ce0..113823867 100644 --- a/node_modules/estraverse/package.json +++ b/node_modules/estraverse/package.json @@ -37,8 +37,4 @@ "lint": "jshint estraverse.js", "unit-test": "mocha --compilers js:babel-register" } - -,"_resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz" -,"_integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==" -,"_from": "estraverse@4.3.0" -} \ No newline at end of file +} diff --git a/node_modules/esutils/package.json b/node_modules/esutils/package.json index 6446b57f2..8396f4cee 100644 --- a/node_modules/esutils/package.json +++ b/node_modules/esutils/package.json @@ -41,8 +41,4 @@ "unit-test": "mocha --compilers coffee:coffee-script -R spec", "generate-regex": "node tools/generate-identifier-regex.js" } - -,"_resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz" -,"_integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==" -,"_from": "esutils@2.0.3" -} \ No newline at end of file +} diff --git a/node_modules/exit/test/fixtures/create-files.sh b/node_modules/exit/test/fixtures/create-files.sh old mode 100644 new mode 100755 diff --git a/node_modules/expect/build/ts3.4/asymmetricMatchers.d.ts b/node_modules/expect/build/ts3.4/asymmetricMatchers.d.ts index 3e26a23e5..6fc0c2b51 100644 --- a/node_modules/expect/build/ts3.4/asymmetricMatchers.d.ts +++ b/node_modules/expect/build/ts3.4/asymmetricMatchers.d.ts @@ -1,60 +1,60 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ -export declare class AsymmetricMatcher { - protected sample: T; - $$typeof: symbol; - inverse?: boolean; - constructor(sample: T); -} -declare class Any extends AsymmetricMatcher { - constructor(sample: unknown); - asymmetricMatch(other: unknown): boolean; - toString(): string; - getExpectedType(): string; - toAsymmetricMatcher(): string; -} -declare class Anything extends AsymmetricMatcher { - asymmetricMatch(other: unknown): boolean; - toString(): string; - toAsymmetricMatcher(): string; -} -declare class ArrayContaining extends AsymmetricMatcher> { - constructor(sample: Array, inverse?: boolean); - asymmetricMatch(other: Array): boolean; - toString(): string; - getExpectedType(): string; -} -declare class ObjectContaining extends AsymmetricMatcher> { - constructor(sample: Record, inverse?: boolean); - asymmetricMatch(other: any): boolean; - toString(): string; - getExpectedType(): string; -} -declare class StringContaining extends AsymmetricMatcher { - constructor(sample: string, inverse?: boolean); - asymmetricMatch(other: string): boolean; - toString(): string; - getExpectedType(): string; -} -declare class StringMatching extends AsymmetricMatcher { - constructor(sample: string | RegExp, inverse?: boolean); - asymmetricMatch(other: string): boolean; - toString(): string; - getExpectedType(): string; -} -export declare const any: (expectedObject: unknown) => Any; -export declare const anything: () => Anything; -export declare const arrayContaining: (sample: unknown[]) => ArrayContaining; -export declare const arrayNotContaining: (sample: unknown[]) => ArrayContaining; -export declare const objectContaining: (sample: Record) => ObjectContaining; -export declare const objectNotContaining: (sample: Record) => ObjectContaining; -export declare const stringContaining: (expected: string) => StringContaining; -export declare const stringNotContaining: (expected: string) => StringContaining; -export declare const stringMatching: (expected: string | RegExp) => StringMatching; -export declare const stringNotMatching: (expected: string | RegExp) => StringMatching; -export {}; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + */ +export declare class AsymmetricMatcher { + protected sample: T; + $$typeof: symbol; + inverse?: boolean; + constructor(sample: T); +} +declare class Any extends AsymmetricMatcher { + constructor(sample: unknown); + asymmetricMatch(other: unknown): boolean; + toString(): string; + getExpectedType(): string; + toAsymmetricMatcher(): string; +} +declare class Anything extends AsymmetricMatcher { + asymmetricMatch(other: unknown): boolean; + toString(): string; + toAsymmetricMatcher(): string; +} +declare class ArrayContaining extends AsymmetricMatcher> { + constructor(sample: Array, inverse?: boolean); + asymmetricMatch(other: Array): boolean; + toString(): string; + getExpectedType(): string; +} +declare class ObjectContaining extends AsymmetricMatcher> { + constructor(sample: Record, inverse?: boolean); + asymmetricMatch(other: any): boolean; + toString(): string; + getExpectedType(): string; +} +declare class StringContaining extends AsymmetricMatcher { + constructor(sample: string, inverse?: boolean); + asymmetricMatch(other: string): boolean; + toString(): string; + getExpectedType(): string; +} +declare class StringMatching extends AsymmetricMatcher { + constructor(sample: string | RegExp, inverse?: boolean); + asymmetricMatch(other: string): boolean; + toString(): string; + getExpectedType(): string; +} +export declare const any: (expectedObject: unknown) => Any; +export declare const anything: () => Anything; +export declare const arrayContaining: (sample: unknown[]) => ArrayContaining; +export declare const arrayNotContaining: (sample: unknown[]) => ArrayContaining; +export declare const objectContaining: (sample: Record) => ObjectContaining; +export declare const objectNotContaining: (sample: Record) => ObjectContaining; +export declare const stringContaining: (expected: string) => StringContaining; +export declare const stringNotContaining: (expected: string) => StringContaining; +export declare const stringMatching: (expected: string | RegExp) => StringMatching; +export declare const stringNotMatching: (expected: string | RegExp) => StringMatching; +export {}; diff --git a/node_modules/expect/build/ts3.4/extractExpectedAssertionsErrors.d.ts b/node_modules/expect/build/ts3.4/extractExpectedAssertionsErrors.d.ts index 224c093cb..5b2d97fcd 100644 --- a/node_modules/expect/build/ts3.4/extractExpectedAssertionsErrors.d.ts +++ b/node_modules/expect/build/ts3.4/extractExpectedAssertionsErrors.d.ts @@ -1,17 +1,17 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ -declare const extractExpectedAssertionsErrors: () => ({ - actual: any; - error: any; - expected: number; -} | { - actual: string; - error: any; - expected: string; -})[]; -export default extractExpectedAssertionsErrors; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + */ +declare const extractExpectedAssertionsErrors: () => ({ + actual: any; + error: any; + expected: number; +} | { + actual: string; + error: any; + expected: string; +})[]; +export default extractExpectedAssertionsErrors; diff --git a/node_modules/expect/build/ts3.4/fakeChalk.d.ts b/node_modules/expect/build/ts3.4/fakeChalk.d.ts index 604059fcb..97d13bade 100644 --- a/node_modules/expect/build/ts3.4/fakeChalk.d.ts +++ b/node_modules/expect/build/ts3.4/fakeChalk.d.ts @@ -1,10 +1,10 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -declare const allColorsAsFunc: { - [x: string]: (str: string) => string; -}; -export = allColorsAsFunc; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +declare const allColorsAsFunc: { + [x: string]: (str: string) => string; +}; +export = allColorsAsFunc; diff --git a/node_modules/expect/build/ts3.4/index.d.ts b/node_modules/expect/build/ts3.4/index.d.ts index cd317c4b7..35d0e45a4 100644 --- a/node_modules/expect/build/ts3.4/index.d.ts +++ b/node_modules/expect/build/ts3.4/index.d.ts @@ -1,15 +1,15 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ -import { Expect, MatcherState as JestMatcherState, Matchers as MatcherInterface } from './types'; -declare const expectExport: Expect; -declare namespace expectExport { - type MatcherState = JestMatcherState; - interface Matchers extends MatcherInterface { - } -} -export = expectExport; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + */ +import { Expect, MatcherState as JestMatcherState, Matchers as MatcherInterface } from './types'; +declare const expectExport: Expect; +declare namespace expectExport { + type MatcherState = JestMatcherState; + interface Matchers extends MatcherInterface { + } +} +export = expectExport; diff --git a/node_modules/expect/build/ts3.4/jasmineUtils.d.ts b/node_modules/expect/build/ts3.4/jasmineUtils.d.ts index 596d5709c..de9f2d179 100644 --- a/node_modules/expect/build/ts3.4/jasmineUtils.d.ts +++ b/node_modules/expect/build/ts3.4/jasmineUtils.d.ts @@ -1,8 +1,8 @@ -import { Tester } from './types'; -export declare function equals(a: unknown, b: unknown, customTesters?: Array, strictCheck?: boolean): boolean; -export declare function isA(typeName: string, value: unknown): boolean; -export declare function fnNameFor(func: Function): string; -export declare function isUndefined(obj: any): boolean; -export declare function hasProperty(obj: object | null, property: string): boolean; -export declare function isImmutableUnorderedKeyed(maybeKeyed: any): boolean; -export declare function isImmutableUnorderedSet(maybeSet: any): boolean; +import { Tester } from './types'; +export declare function equals(a: unknown, b: unknown, customTesters?: Array, strictCheck?: boolean): boolean; +export declare function isA(typeName: string, value: unknown): boolean; +export declare function fnNameFor(func: Function): string; +export declare function isUndefined(obj: any): boolean; +export declare function hasProperty(obj: object | null, property: string): boolean; +export declare function isImmutableUnorderedKeyed(maybeKeyed: any): boolean; +export declare function isImmutableUnorderedSet(maybeSet: any): boolean; diff --git a/node_modules/expect/build/ts3.4/jestMatchersObject.d.ts b/node_modules/expect/build/ts3.4/jestMatchersObject.d.ts index 97af59132..bb431ed8f 100644 --- a/node_modules/expect/build/ts3.4/jestMatchersObject.d.ts +++ b/node_modules/expect/build/ts3.4/jestMatchersObject.d.ts @@ -1,13 +1,13 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ -import { Expect, MatchersObject } from './types'; -export declare const INTERNAL_MATCHER_FLAG: unique symbol; -export declare const getState: () => any; -export declare const setState: (state: object) => void; -export declare const getMatchers: () => MatchersObject; -export declare const setMatchers: (matchers: MatchersObject, isInternal: boolean, expect: Expect) => void; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + */ +import { Expect, MatchersObject } from './types'; +export declare const INTERNAL_MATCHER_FLAG: unique symbol; +export declare const getState: () => any; +export declare const setState: (state: object) => void; +export declare const getMatchers: () => MatchersObject; +export declare const setMatchers: (matchers: MatchersObject, isInternal: boolean, expect: Expect) => void; diff --git a/node_modules/expect/build/ts3.4/matchers.d.ts b/node_modules/expect/build/ts3.4/matchers.d.ts index 133e7a88d..46d94174b 100644 --- a/node_modules/expect/build/ts3.4/matchers.d.ts +++ b/node_modules/expect/build/ts3.4/matchers.d.ts @@ -1,10 +1,10 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ -import { MatchersObject } from './types'; -declare const matchers: MatchersObject; -export default matchers; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + */ +import { MatchersObject } from './types'; +declare const matchers: MatchersObject; +export default matchers; diff --git a/node_modules/expect/build/ts3.4/print.d.ts b/node_modules/expect/build/ts3.4/print.d.ts index dbac181a4..6eeef1e90 100644 --- a/node_modules/expect/build/ts3.4/print.d.ts +++ b/node_modules/expect/build/ts3.4/print.d.ts @@ -1,15 +1,15 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ -export declare const printReceivedStringContainExpectedSubstring: (received: string, start: number, length: number) => string; -export declare const printReceivedStringContainExpectedResult: (received: string, result: RegExpExecArray | null) => string; -export declare const printReceivedArrayContainExpectedItem: (received: unknown[], index: number) => string; -export declare const printCloseTo: (receivedDiff: number, expectedDiff: number, precision: number, isNot: boolean) => string; -export declare const printExpectedConstructorName: (label: string, expected: Function) => string; -export declare const printExpectedConstructorNameNot: (label: string, expected: Function) => string; -export declare const printReceivedConstructorName: (label: string, received: Function) => string; -export declare const printReceivedConstructorNameNot: (label: string, received: Function, expected: Function) => string; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + */ +export declare const printReceivedStringContainExpectedSubstring: (received: string, start: number, length: number) => string; +export declare const printReceivedStringContainExpectedResult: (received: string, result: RegExpExecArray | null) => string; +export declare const printReceivedArrayContainExpectedItem: (received: unknown[], index: number) => string; +export declare const printCloseTo: (receivedDiff: number, expectedDiff: number, precision: number, isNot: boolean) => string; +export declare const printExpectedConstructorName: (label: string, expected: Function) => string; +export declare const printExpectedConstructorNameNot: (label: string, expected: Function) => string; +export declare const printReceivedConstructorName: (label: string, received: Function) => string; +export declare const printReceivedConstructorNameNot: (label: string, received: Function, expected: Function) => string; diff --git a/node_modules/expect/build/ts3.4/spyMatchers.d.ts b/node_modules/expect/build/ts3.4/spyMatchers.d.ts index d224509a3..9e8307399 100644 --- a/node_modules/expect/build/ts3.4/spyMatchers.d.ts +++ b/node_modules/expect/build/ts3.4/spyMatchers.d.ts @@ -1,9 +1,9 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import { MatchersObject } from './types'; -declare const spyMatchers: MatchersObject; -export default spyMatchers; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import { MatchersObject } from './types'; +declare const spyMatchers: MatchersObject; +export default spyMatchers; diff --git a/node_modules/expect/build/ts3.4/toThrowMatchers.d.ts b/node_modules/expect/build/ts3.4/toThrowMatchers.d.ts index a894c8ea6..3e826f9e2 100644 --- a/node_modules/expect/build/ts3.4/toThrowMatchers.d.ts +++ b/node_modules/expect/build/ts3.4/toThrowMatchers.d.ts @@ -1,11 +1,11 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ -import { MatchersObject, RawMatcherFn } from './types'; -export declare const createMatcher: (matcherName: string, fromPromise?: boolean | undefined) => RawMatcherFn; -declare const matchers: MatchersObject; -export default matchers; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + */ +import { MatchersObject, RawMatcherFn } from './types'; +export declare const createMatcher: (matcherName: string, fromPromise?: boolean | undefined) => RawMatcherFn; +declare const matchers: MatchersObject; +export default matchers; diff --git a/node_modules/expect/build/ts3.4/types.d.ts b/node_modules/expect/build/ts3.4/types.d.ts index 17989048f..679fb04c3 100644 --- a/node_modules/expect/build/ts3.4/types.d.ts +++ b/node_modules/expect/build/ts3.4/types.d.ts @@ -1,325 +1,325 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ -import { Config } from '@jest/types'; -import * as jestMatcherUtils from 'jest-matcher-utils'; -import { INTERNAL_MATCHER_FLAG } from './jestMatchersObject'; -export declare type SyncExpectationResult = { - pass: boolean; - message: () => string; -}; -export declare type AsyncExpectationResult = Promise; -export declare type ExpectationResult = SyncExpectationResult | AsyncExpectationResult; -export declare type RawMatcherFn = { - (received: any, expected: any, options?: any): ExpectationResult; - [INTERNAL_MATCHER_FLAG]?: boolean; -}; -export declare type ThrowingMatcherFn = (actual: any) => void; -export declare type PromiseMatcherFn = (actual: any) => Promise; -export declare type Tester = (a: any, b: any) => boolean | undefined; -export declare type MatcherState = { - assertionCalls: number; - currentTestName?: string; - dontThrow?: () => void; - error?: Error; - equals: (a: unknown, b: unknown, customTesters?: Array, strictCheck?: boolean) => boolean; - expand?: boolean; - expectedAssertionsNumber?: number; - isExpectingAssertions?: boolean; - isNot: boolean; - promise: string; - suppressedErrors: Array; - testPath?: Config.Path; - utils: typeof jestMatcherUtils & { - iterableEquality: Tester; - subsetEquality: Tester; - }; -}; -export declare type AsymmetricMatcher = Record; -export declare type MatchersObject = { - [id: string]: RawMatcherFn; -}; -export declare type Expect = { - (actual: T): Matchers; - addSnapshotSerializer(arg0: any): void; - assertions(arg0: number): void; - extend(arg0: any): void; - extractExpectedAssertionsErrors: () => Array<{ - actual: string | number; - error: Error; - expected: string; - }>; - getState(): MatcherState; - hasAssertions(): void; - setState(arg0: any): void; - any(expectedObject: any): AsymmetricMatcher; - anything(): AsymmetricMatcher; - arrayContaining(sample: Array): AsymmetricMatcher; - objectContaining(sample: Record): AsymmetricMatcher; - stringContaining(expected: string): AsymmetricMatcher; - stringMatching(expected: string | RegExp): AsymmetricMatcher; - [id: string]: AsymmetricMatcher; - not: { - [id: string]: AsymmetricMatcher; - }; -}; -interface Constructable { - new (...args: Array): unknown; -} -export interface Matchers { - /** - * Ensures the last call to a mock function was provided specific args. - */ - lastCalledWith(...args: Array): R; - /** - * Ensure that the last call to a mock function has returned a specified value. - */ - lastReturnedWith(value: unknown): R; - /** - * If you know how to test something, `.not` lets you test its opposite. - */ - not: Matchers; - /** - * Ensure that a mock function is called with specific arguments on an Nth call. - */ - nthCalledWith(nthCall: number, ...args: Array): R; - /** - * Ensure that the nth call to a mock function has returned a specified value. - */ - nthReturnedWith(n: number, value: unknown): R; - /** - * Use resolves to unwrap the value of a fulfilled promise so any other - * matcher can be chained. If the promise is rejected the assertion fails. - */ - resolves: Matchers>; - /** - * Unwraps the reason of a rejected promise so any other matcher can be chained. - * If the promise is fulfilled the assertion fails. - */ - rejects: Matchers>; - /** - * Checks that a value is what you expect. It uses `===` to check strict equality. - * Don't use `toBe` with floating-point numbers. - */ - toBe(expected: unknown): R; - /** - * Ensures that a mock function is called. - */ - toBeCalled(): R; - /** - * Ensures that a mock function is called an exact number of times. - */ - toBeCalledTimes(expected: number): R; - /** - * Ensure that a mock function is called with specific arguments. - */ - toBeCalledWith(...args: Array): R; - /** - * Using exact equality with floating point numbers is a bad idea. - * Rounding means that intuitive things fail. - * The default for numDigits is 2. - */ - toBeCloseTo(expected: number, numDigits?: number): R; - /** - * Ensure that a variable is not undefined. - */ - toBeDefined(): R; - /** - * When you don't care what a value is, you just want to - * ensure a value is false in a boolean context. - */ - toBeFalsy(): R; - /** - * For comparing floating point numbers. - */ - toBeGreaterThan(expected: number | bigint): R; - /** - * For comparing floating point numbers. - */ - toBeGreaterThanOrEqual(expected: number | bigint): R; - /** - * Ensure that an object is an instance of a class. - * This matcher uses `instanceof` underneath. - */ - toBeInstanceOf(expected: Function): R; - /** - * For comparing floating point numbers. - */ - toBeLessThan(expected: number | bigint): R; - /** - * For comparing floating point numbers. - */ - toBeLessThanOrEqual(expected: number | bigint): R; - /** - * This is the same as `.toBe(null)` but the error messages are a bit nicer. - * So use `.toBeNull()` when you want to check that something is null. - */ - toBeNull(): R; - /** - * Use when you don't care what a value is, you just want to ensure a value - * is true in a boolean context. In JavaScript, there are six falsy values: - * `false`, `0`, `''`, `null`, `undefined`, and `NaN`. Everything else is truthy. - */ - toBeTruthy(): R; - /** - * Used to check that a variable is undefined. - */ - toBeUndefined(): R; - /** - * Used to check that a variable is NaN. - */ - toBeNaN(): R; - /** - * Used when you want to check that an item is in a list. - * For testing the items in the list, this uses `===`, a strict equality check. - */ - toContain(expected: unknown): R; - /** - * Used when you want to check that an item is in a list. - * For testing the items in the list, this matcher recursively checks the - * equality of all fields, rather than checking for object identity. - */ - toContainEqual(expected: unknown): R; - /** - * Used when you want to check that two objects have the same value. - * This matcher recursively checks the equality of all fields, rather than checking for object identity. - */ - toEqual(expected: unknown): R; - /** - * Ensures that a mock function is called. - */ - toHaveBeenCalled(): R; - /** - * Ensures that a mock function is called an exact number of times. - */ - toHaveBeenCalledTimes(expected: number): R; - /** - * Ensure that a mock function is called with specific arguments. - */ - toHaveBeenCalledWith(...args: Array): R; - /** - * Ensure that a mock function is called with specific arguments on an Nth call. - */ - toHaveBeenNthCalledWith(nthCall: number, ...args: Array): R; - /** - * If you have a mock function, you can use `.toHaveBeenLastCalledWith` - * to test what arguments it was last called with. - */ - toHaveBeenLastCalledWith(...args: Array): R; - /** - * Use to test the specific value that a mock function last returned. - * If the last call to the mock function threw an error, then this matcher will fail - * no matter what value you provided as the expected return value. - */ - toHaveLastReturnedWith(expected: unknown): R; - /** - * Used to check that an object has a `.length` property - * and it is set to a certain numeric value. - */ - toHaveLength(expected: number): R; - /** - * Use to test the specific value that a mock function returned for the nth call. - * If the nth call to the mock function threw an error, then this matcher will fail - * no matter what value you provided as the expected return value. - */ - toHaveNthReturnedWith(nthCall: number, expected: unknown): R; - /** - * Use to check if property at provided reference keyPath exists for an object. - * For checking deeply nested properties in an object you may use dot notation or an array containing - * the keyPath for deep references. - * - * Optionally, you can provide a value to check if it's equal to the value present at keyPath - * on the target object. This matcher uses 'deep equality' (like `toEqual()`) and recursively checks - * the equality of all fields. - * - * @example - * - * expect(houseForSale).toHaveProperty('kitchen.area', 20); - */ - toHaveProperty(keyPath: string | Array, value?: unknown): R; - /** - * Use to test that the mock function successfully returned (i.e., did not throw an error) at least one time - */ - toHaveReturned(): R; - /** - * Use to ensure that a mock function returned successfully (i.e., did not throw an error) an exact number of times. - * Any calls to the mock function that throw an error are not counted toward the number of times the function returned. - */ - toHaveReturnedTimes(expected: number): R; - /** - * Use to ensure that a mock function returned a specific value. - */ - toHaveReturnedWith(expected: unknown): R; - /** - * Check that a string matches a regular expression. - */ - toMatch(expected: string | RegExp): R; - /** - * Used to check that a JavaScript object matches a subset of the properties of an object - */ - toMatchObject(expected: Record | Array): R; - /** - * Ensure that a mock function has returned (as opposed to thrown) at least once. - */ - toReturn(): R; - /** - * Ensure that a mock function has returned (as opposed to thrown) a specified number of times. - */ - toReturnTimes(count: number): R; - /** - * Ensure that a mock function has returned a specified value at least once. - */ - toReturnWith(value: unknown): R; - /** - * Use to test that objects have the same types as well as structure. - */ - toStrictEqual(expected: unknown): R; - /** - * Used to test that a function throws when it is called. - */ - toThrow(error?: string | Constructable | RegExp | Error): R; - /** - * If you want to test that a specific error is thrown inside a function. - */ - toThrowError(error?: string | Constructable | RegExp | Error): R; - /** - * This ensures that a value matches the most recent snapshot with property matchers. - * Check out [the Snapshot Testing guide](https://jestjs.io/docs/en/snapshot-testing) for more information. - */ - toMatchSnapshot(propertyMatchers: Partial, snapshotName?: string): R; - /** - * This ensures that a value matches the most recent snapshot. - * Check out [the Snapshot Testing guide](https://jestjs.io/docs/en/snapshot-testing) for more information. - */ - toMatchSnapshot(snapshotName?: string): R; - /** - * This ensures that a value matches the most recent snapshot with property matchers. - * Instead of writing the snapshot value to a .snap file, it will be written into the source code automatically. - * Check out [the Snapshot Testing guide](https://jestjs.io/docs/en/snapshot-testing) for more information. - */ - toMatchInlineSnapshot(propertyMatchers: Partial, snapshot?: string): R; - /** - * This ensures that a value matches the most recent snapshot with property matchers. - * Instead of writing the snapshot value to a .snap file, it will be written into the source code automatically. - * Check out [the Snapshot Testing guide](https://jestjs.io/docs/en/snapshot-testing) for more information. - */ - toMatchInlineSnapshot(snapshot?: string): R; - /** - * Used to test that a function throws a error matching the most recent snapshot when it is called. - */ - toThrowErrorMatchingSnapshot(): R; - /** - * Used to test that a function throws a error matching the most recent snapshot when it is called. - * Instead of writing the snapshot value to a .snap file, it will be written into the source code automatically. - */ - toThrowErrorMatchingInlineSnapshot(snapshot?: string): R; -} -export {}; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + */ +import { Config } from '@jest/types'; +import * as jestMatcherUtils from 'jest-matcher-utils'; +import { INTERNAL_MATCHER_FLAG } from './jestMatchersObject'; +export declare type SyncExpectationResult = { + pass: boolean; + message: () => string; +}; +export declare type AsyncExpectationResult = Promise; +export declare type ExpectationResult = SyncExpectationResult | AsyncExpectationResult; +export declare type RawMatcherFn = { + (received: any, expected: any, options?: any): ExpectationResult; + [INTERNAL_MATCHER_FLAG]?: boolean; +}; +export declare type ThrowingMatcherFn = (actual: any) => void; +export declare type PromiseMatcherFn = (actual: any) => Promise; +export declare type Tester = (a: any, b: any) => boolean | undefined; +export declare type MatcherState = { + assertionCalls: number; + currentTestName?: string; + dontThrow?: () => void; + error?: Error; + equals: (a: unknown, b: unknown, customTesters?: Array, strictCheck?: boolean) => boolean; + expand?: boolean; + expectedAssertionsNumber?: number; + isExpectingAssertions?: boolean; + isNot: boolean; + promise: string; + suppressedErrors: Array; + testPath?: Config.Path; + utils: typeof jestMatcherUtils & { + iterableEquality: Tester; + subsetEquality: Tester; + }; +}; +export declare type AsymmetricMatcher = Record; +export declare type MatchersObject = { + [id: string]: RawMatcherFn; +}; +export declare type Expect = { + (actual: T): Matchers; + addSnapshotSerializer(arg0: any): void; + assertions(arg0: number): void; + extend(arg0: any): void; + extractExpectedAssertionsErrors: () => Array<{ + actual: string | number; + error: Error; + expected: string; + }>; + getState(): MatcherState; + hasAssertions(): void; + setState(arg0: any): void; + any(expectedObject: any): AsymmetricMatcher; + anything(): AsymmetricMatcher; + arrayContaining(sample: Array): AsymmetricMatcher; + objectContaining(sample: Record): AsymmetricMatcher; + stringContaining(expected: string): AsymmetricMatcher; + stringMatching(expected: string | RegExp): AsymmetricMatcher; + [id: string]: AsymmetricMatcher; + not: { + [id: string]: AsymmetricMatcher; + }; +}; +interface Constructable { + new (...args: Array): unknown; +} +export interface Matchers { + /** + * Ensures the last call to a mock function was provided specific args. + */ + lastCalledWith(...args: Array): R; + /** + * Ensure that the last call to a mock function has returned a specified value. + */ + lastReturnedWith(value: unknown): R; + /** + * If you know how to test something, `.not` lets you test its opposite. + */ + not: Matchers; + /** + * Ensure that a mock function is called with specific arguments on an Nth call. + */ + nthCalledWith(nthCall: number, ...args: Array): R; + /** + * Ensure that the nth call to a mock function has returned a specified value. + */ + nthReturnedWith(n: number, value: unknown): R; + /** + * Use resolves to unwrap the value of a fulfilled promise so any other + * matcher can be chained. If the promise is rejected the assertion fails. + */ + resolves: Matchers>; + /** + * Unwraps the reason of a rejected promise so any other matcher can be chained. + * If the promise is fulfilled the assertion fails. + */ + rejects: Matchers>; + /** + * Checks that a value is what you expect. It uses `===` to check strict equality. + * Don't use `toBe` with floating-point numbers. + */ + toBe(expected: unknown): R; + /** + * Ensures that a mock function is called. + */ + toBeCalled(): R; + /** + * Ensures that a mock function is called an exact number of times. + */ + toBeCalledTimes(expected: number): R; + /** + * Ensure that a mock function is called with specific arguments. + */ + toBeCalledWith(...args: Array): R; + /** + * Using exact equality with floating point numbers is a bad idea. + * Rounding means that intuitive things fail. + * The default for numDigits is 2. + */ + toBeCloseTo(expected: number, numDigits?: number): R; + /** + * Ensure that a variable is not undefined. + */ + toBeDefined(): R; + /** + * When you don't care what a value is, you just want to + * ensure a value is false in a boolean context. + */ + toBeFalsy(): R; + /** + * For comparing floating point numbers. + */ + toBeGreaterThan(expected: number | bigint): R; + /** + * For comparing floating point numbers. + */ + toBeGreaterThanOrEqual(expected: number | bigint): R; + /** + * Ensure that an object is an instance of a class. + * This matcher uses `instanceof` underneath. + */ + toBeInstanceOf(expected: Function): R; + /** + * For comparing floating point numbers. + */ + toBeLessThan(expected: number | bigint): R; + /** + * For comparing floating point numbers. + */ + toBeLessThanOrEqual(expected: number | bigint): R; + /** + * This is the same as `.toBe(null)` but the error messages are a bit nicer. + * So use `.toBeNull()` when you want to check that something is null. + */ + toBeNull(): R; + /** + * Use when you don't care what a value is, you just want to ensure a value + * is true in a boolean context. In JavaScript, there are six falsy values: + * `false`, `0`, `''`, `null`, `undefined`, and `NaN`. Everything else is truthy. + */ + toBeTruthy(): R; + /** + * Used to check that a variable is undefined. + */ + toBeUndefined(): R; + /** + * Used to check that a variable is NaN. + */ + toBeNaN(): R; + /** + * Used when you want to check that an item is in a list. + * For testing the items in the list, this uses `===`, a strict equality check. + */ + toContain(expected: unknown): R; + /** + * Used when you want to check that an item is in a list. + * For testing the items in the list, this matcher recursively checks the + * equality of all fields, rather than checking for object identity. + */ + toContainEqual(expected: unknown): R; + /** + * Used when you want to check that two objects have the same value. + * This matcher recursively checks the equality of all fields, rather than checking for object identity. + */ + toEqual(expected: unknown): R; + /** + * Ensures that a mock function is called. + */ + toHaveBeenCalled(): R; + /** + * Ensures that a mock function is called an exact number of times. + */ + toHaveBeenCalledTimes(expected: number): R; + /** + * Ensure that a mock function is called with specific arguments. + */ + toHaveBeenCalledWith(...args: Array): R; + /** + * Ensure that a mock function is called with specific arguments on an Nth call. + */ + toHaveBeenNthCalledWith(nthCall: number, ...args: Array): R; + /** + * If you have a mock function, you can use `.toHaveBeenLastCalledWith` + * to test what arguments it was last called with. + */ + toHaveBeenLastCalledWith(...args: Array): R; + /** + * Use to test the specific value that a mock function last returned. + * If the last call to the mock function threw an error, then this matcher will fail + * no matter what value you provided as the expected return value. + */ + toHaveLastReturnedWith(expected: unknown): R; + /** + * Used to check that an object has a `.length` property + * and it is set to a certain numeric value. + */ + toHaveLength(expected: number): R; + /** + * Use to test the specific value that a mock function returned for the nth call. + * If the nth call to the mock function threw an error, then this matcher will fail + * no matter what value you provided as the expected return value. + */ + toHaveNthReturnedWith(nthCall: number, expected: unknown): R; + /** + * Use to check if property at provided reference keyPath exists for an object. + * For checking deeply nested properties in an object you may use dot notation or an array containing + * the keyPath for deep references. + * + * Optionally, you can provide a value to check if it's equal to the value present at keyPath + * on the target object. This matcher uses 'deep equality' (like `toEqual()`) and recursively checks + * the equality of all fields. + * + * @example + * + * expect(houseForSale).toHaveProperty('kitchen.area', 20); + */ + toHaveProperty(keyPath: string | Array, value?: unknown): R; + /** + * Use to test that the mock function successfully returned (i.e., did not throw an error) at least one time + */ + toHaveReturned(): R; + /** + * Use to ensure that a mock function returned successfully (i.e., did not throw an error) an exact number of times. + * Any calls to the mock function that throw an error are not counted toward the number of times the function returned. + */ + toHaveReturnedTimes(expected: number): R; + /** + * Use to ensure that a mock function returned a specific value. + */ + toHaveReturnedWith(expected: unknown): R; + /** + * Check that a string matches a regular expression. + */ + toMatch(expected: string | RegExp): R; + /** + * Used to check that a JavaScript object matches a subset of the properties of an object + */ + toMatchObject(expected: Record | Array): R; + /** + * Ensure that a mock function has returned (as opposed to thrown) at least once. + */ + toReturn(): R; + /** + * Ensure that a mock function has returned (as opposed to thrown) a specified number of times. + */ + toReturnTimes(count: number): R; + /** + * Ensure that a mock function has returned a specified value at least once. + */ + toReturnWith(value: unknown): R; + /** + * Use to test that objects have the same types as well as structure. + */ + toStrictEqual(expected: unknown): R; + /** + * Used to test that a function throws when it is called. + */ + toThrow(error?: string | Constructable | RegExp | Error): R; + /** + * If you want to test that a specific error is thrown inside a function. + */ + toThrowError(error?: string | Constructable | RegExp | Error): R; + /** + * This ensures that a value matches the most recent snapshot with property matchers. + * Check out [the Snapshot Testing guide](https://jestjs.io/docs/en/snapshot-testing) for more information. + */ + toMatchSnapshot(propertyMatchers: Partial, snapshotName?: string): R; + /** + * This ensures that a value matches the most recent snapshot. + * Check out [the Snapshot Testing guide](https://jestjs.io/docs/en/snapshot-testing) for more information. + */ + toMatchSnapshot(snapshotName?: string): R; + /** + * This ensures that a value matches the most recent snapshot with property matchers. + * Instead of writing the snapshot value to a .snap file, it will be written into the source code automatically. + * Check out [the Snapshot Testing guide](https://jestjs.io/docs/en/snapshot-testing) for more information. + */ + toMatchInlineSnapshot(propertyMatchers: Partial, snapshot?: string): R; + /** + * This ensures that a value matches the most recent snapshot with property matchers. + * Instead of writing the snapshot value to a .snap file, it will be written into the source code automatically. + * Check out [the Snapshot Testing guide](https://jestjs.io/docs/en/snapshot-testing) for more information. + */ + toMatchInlineSnapshot(snapshot?: string): R; + /** + * Used to test that a function throws a error matching the most recent snapshot when it is called. + */ + toThrowErrorMatchingSnapshot(): R; + /** + * Used to test that a function throws a error matching the most recent snapshot when it is called. + * Instead of writing the snapshot value to a .snap file, it will be written into the source code automatically. + */ + toThrowErrorMatchingInlineSnapshot(snapshot?: string): R; +} +export {}; diff --git a/node_modules/expect/build/ts3.4/utils.d.ts b/node_modules/expect/build/ts3.4/utils.d.ts index fa3304b2d..d7a769b80 100644 --- a/node_modules/expect/build/ts3.4/utils.d.ts +++ b/node_modules/expect/build/ts3.4/utils.d.ts @@ -1,25 +1,25 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ -declare type GetPath = { - hasEndProp?: boolean; - lastTraversedObject: unknown; - traversedPath: Array; - value?: unknown; -}; -export declare const hasOwnProperty: (object: object, key: string) => boolean; -export declare const getPath: (object: Record, propertyPath: string | string[]) => GetPath; -export declare const getObjectSubset: (object: any, subset: any, seenReferences?: WeakMap) => any; -export declare const iterableEquality: (a: any, b: any, aStack?: any[], bStack?: any[]) => boolean | undefined; -export declare const subsetEquality: (object: any, subset: any) => boolean | undefined; -export declare const typeEquality: (a: any, b: any) => boolean | undefined; -export declare const sparseArrayEquality: (a: unknown, b: unknown) => boolean | undefined; -export declare const partition: (items: T[], predicate: (arg: T) => boolean) => [T[], T[]]; -export declare const isError: (value: unknown) => value is Error; -export declare function emptyObject(obj: any): boolean; -export declare const isOneline: (expected: unknown, received: unknown) => boolean; -export {}; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + */ +declare type GetPath = { + hasEndProp?: boolean; + lastTraversedObject: unknown; + traversedPath: Array; + value?: unknown; +}; +export declare const hasOwnProperty: (object: object, key: string) => boolean; +export declare const getPath: (object: Record, propertyPath: string | string[]) => GetPath; +export declare const getObjectSubset: (object: any, subset: any, seenReferences?: WeakMap) => any; +export declare const iterableEquality: (a: any, b: any, aStack?: any[], bStack?: any[]) => boolean | undefined; +export declare const subsetEquality: (object: any, subset: any) => boolean | undefined; +export declare const typeEquality: (a: any, b: any) => boolean | undefined; +export declare const sparseArrayEquality: (a: unknown, b: unknown) => boolean | undefined; +export declare const partition: (items: T[], predicate: (arg: T) => boolean) => [T[], T[]]; +export declare const isError: (value: unknown) => value is Error; +export declare function emptyObject(obj: any): boolean; +export declare const isOneline: (expected: unknown, received: unknown) => boolean; +export {}; diff --git a/node_modules/fast-levenshtein/package.json b/node_modules/fast-levenshtein/package.json index 15cdfe163..5b4736d45 100644 --- a/node_modules/fast-levenshtein/package.json +++ b/node_modules/fast-levenshtein/package.json @@ -36,8 +36,4 @@ ], "author": "Ramesh Nair (http://www.hiddentao.com/)", "license": "MIT" - -,"_resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz" -,"_integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=" -,"_from": "fast-levenshtein@2.0.6" -} \ No newline at end of file +} diff --git a/node_modules/fs-constants/package.json b/node_modules/fs-constants/package.json index 4b4ad3a3a..6f2b8f24c 100644 --- a/node_modules/fs-constants/package.json +++ b/node_modules/fs-constants/package.json @@ -16,8 +16,4 @@ "url": "https://github.com/mafintosh/fs-constants/issues" }, "homepage": "https://github.com/mafintosh/fs-constants" - -,"_resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz" -,"_integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==" -,"_from": "fs-constants@1.0.0" -} \ No newline at end of file +} diff --git a/node_modules/fs.realpath/package.json b/node_modules/fs.realpath/package.json index fba1ff9a4..3edc57d21 100644 --- a/node_modules/fs.realpath/package.json +++ b/node_modules/fs.realpath/package.json @@ -23,8 +23,4 @@ "old.js", "index.js" ] - -,"_resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz" -,"_integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" -,"_from": "fs.realpath@1.0.0" -} \ No newline at end of file +} diff --git a/node_modules/fs/package.json b/node_modules/fs/package.json index 819721e5b..11661b039 100644 --- a/node_modules/fs/package.json +++ b/node_modules/fs/package.json @@ -17,8 +17,4 @@ "url": "https://github.com/npm/security-holder/issues" }, "homepage": "https://github.com/npm/security-holder#readme" - -,"_resolved": "https://registry.npmjs.org/fs/-/fs-0.0.1-security.tgz" -,"_integrity": "sha1-invTcYa23d84E/I4WLV+yq9eQdQ=" -,"_from": "fs@0.0.1-security" -} \ No newline at end of file +} diff --git a/node_modules/glob/package.json b/node_modules/glob/package.json index 715f73a54..6477c3070 100644 --- a/node_modules/glob/package.json +++ b/node_modules/glob/package.json @@ -43,8 +43,4 @@ "funding": { "url": "https://github.com/sponsors/isaacs" } - -,"_resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz" -,"_integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==" -,"_from": "glob@7.1.6" -} \ No newline at end of file +} diff --git a/node_modules/ieee754/package.json b/node_modules/ieee754/package.json index 971b8ac79..14faec608 100644 --- a/node_modules/ieee754/package.json +++ b/node_modules/ieee754/package.json @@ -34,8 +34,4 @@ "test-browser-local": "airtap --local -- test/*.js", "test-node": "tape test/*.js" } - -,"_resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.13.tgz" -,"_integrity": "sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg==" -,"_from": "ieee754@1.1.13" -} \ No newline at end of file +} diff --git a/node_modules/import-local/fixtures/cli.js b/node_modules/import-local/fixtures/cli.js old mode 100644 new mode 100755 diff --git a/node_modules/inflight/package.json b/node_modules/inflight/package.json index 102b3be3a..6084d3509 100644 --- a/node_modules/inflight/package.json +++ b/node_modules/inflight/package.json @@ -26,8 +26,4 @@ }, "homepage": "https://github.com/isaacs/inflight", "license": "ISC" - -,"_resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz" -,"_integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=" -,"_from": "inflight@1.0.6" -} \ No newline at end of file +} diff --git a/node_modules/inherits/package.json b/node_modules/inherits/package.json index 7e156d1e2..37b4366b8 100644 --- a/node_modules/inherits/package.json +++ b/node_modules/inherits/package.json @@ -26,8 +26,4 @@ "inherits.js", "inherits_browser.js" ] - -,"_resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz" -,"_integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" -,"_from": "inherits@2.0.4" -} \ No newline at end of file +} diff --git a/node_modules/is-ci/bin.js b/node_modules/is-ci/bin.js old mode 100644 new mode 100755 diff --git a/node_modules/is-docker/cli.js b/node_modules/is-docker/cli.js old mode 100644 new mode 100755 diff --git a/node_modules/isarray/package.json b/node_modules/isarray/package.json index 87111e7e4..1a4317a9c 100644 --- a/node_modules/isarray/package.json +++ b/node_modules/isarray/package.json @@ -42,8 +42,4 @@ "scripts": { "test": "tape test.js" } - -,"_resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz" -,"_integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" -,"_from": "isarray@1.0.0" -} \ No newline at end of file +} diff --git a/node_modules/jest-changed-files/build/ts3.4/git.d.ts b/node_modules/jest-changed-files/build/ts3.4/git.d.ts index 4c7351c29..1229673f4 100644 --- a/node_modules/jest-changed-files/build/ts3.4/git.d.ts +++ b/node_modules/jest-changed-files/build/ts3.4/git.d.ts @@ -1,10 +1,10 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ -import { SCMAdapter } from './types'; -declare const adapter: SCMAdapter; -export default adapter; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + */ +import { SCMAdapter } from './types'; +declare const adapter: SCMAdapter; +export default adapter; diff --git a/node_modules/jest-changed-files/build/ts3.4/hg.d.ts b/node_modules/jest-changed-files/build/ts3.4/hg.d.ts index 4c7351c29..1229673f4 100644 --- a/node_modules/jest-changed-files/build/ts3.4/hg.d.ts +++ b/node_modules/jest-changed-files/build/ts3.4/hg.d.ts @@ -1,10 +1,10 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ -import { SCMAdapter } from './types'; -declare const adapter: SCMAdapter; -export default adapter; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + */ +import { SCMAdapter } from './types'; +declare const adapter: SCMAdapter; +export default adapter; diff --git a/node_modules/jest-changed-files/build/ts3.4/index.d.ts b/node_modules/jest-changed-files/build/ts3.4/index.d.ts index b67677da9..7615c744a 100644 --- a/node_modules/jest-changed-files/build/ts3.4/index.d.ts +++ b/node_modules/jest-changed-files/build/ts3.4/index.d.ts @@ -1,11 +1,11 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ -import { ChangedFilesPromise, Options, Repos } from './types'; -export { ChangedFiles, ChangedFilesPromise } from './types'; -export declare const getChangedFilesForRoots: (roots: string[], options: Options) => ChangedFilesPromise; -export declare const findRepos: (roots: string[]) => Promise; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + */ +import { ChangedFilesPromise, Options, Repos } from './types'; +export { ChangedFiles, ChangedFilesPromise } from './types'; +export declare const getChangedFilesForRoots: (roots: string[], options: Options) => ChangedFilesPromise; +export declare const findRepos: (roots: string[]) => Promise; diff --git a/node_modules/jest-changed-files/build/ts3.4/types.d.ts b/node_modules/jest-changed-files/build/ts3.4/types.d.ts index 07e4a22e9..01db00a25 100644 --- a/node_modules/jest-changed-files/build/ts3.4/types.d.ts +++ b/node_modules/jest-changed-files/build/ts3.4/types.d.ts @@ -1,28 +1,28 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import { Config } from '@jest/types'; -export declare type Options = { - lastCommit?: boolean; - withAncestor?: boolean; - changedSince?: string; - includePaths?: Array; -}; -declare type Paths = Set; -export declare type Repos = { - git: Paths; - hg: Paths; -}; -export declare type ChangedFiles = { - repos: Repos; - changedFiles: Paths; -}; -export declare type ChangedFilesPromise = Promise; -export declare type SCMAdapter = { - findChangedFiles: (cwd: Config.Path, options: Options) => Promise>; - getRoot: (cwd: Config.Path) => Promise; -}; -export {}; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import { Config } from '@jest/types'; +export declare type Options = { + lastCommit?: boolean; + withAncestor?: boolean; + changedSince?: string; + includePaths?: Array; +}; +declare type Paths = Set; +export declare type Repos = { + git: Paths; + hg: Paths; +}; +export declare type ChangedFiles = { + repos: Repos; + changedFiles: Paths; +}; +export declare type ChangedFilesPromise = Promise; +export declare type SCMAdapter = { + findChangedFiles: (cwd: Config.Path, options: Options) => Promise>; + getRoot: (cwd: Config.Path) => Promise; +}; +export {}; diff --git a/node_modules/jest-cli/bin/jest.js b/node_modules/jest-cli/bin/jest.js old mode 100644 new mode 100755 diff --git a/node_modules/jest-cli/build/ts3.4/cli/args.d.ts b/node_modules/jest-cli/build/ts3.4/cli/args.d.ts index cceeb1e97..f3c31b8dc 100644 --- a/node_modules/jest-cli/build/ts3.4/cli/args.d.ts +++ b/node_modules/jest-cli/build/ts3.4/cli/args.d.ts @@ -1,497 +1,497 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import { Config } from '@jest/types'; -export declare function check(argv: Config.Argv): true; -export declare const usage = "Usage: $0 [--config=] [TestPathPattern]"; -export declare const docs = "Documentation: https://jestjs.io/"; -export declare const options: { - readonly all: { - readonly default: undefined; - readonly description: string; - readonly type: "boolean"; - }; - readonly automock: { - readonly default: undefined; - readonly description: "Automock all files by default."; - readonly type: "boolean"; - }; - readonly bail: { - readonly alias: "b"; - readonly default: undefined; - readonly description: "Exit the test suite immediately after `n` number of failing tests."; - readonly type: "boolean"; - }; - readonly browser: { - readonly default: undefined; - readonly description: string; - readonly type: "boolean"; - }; - readonly cache: { - readonly default: undefined; - readonly description: string; - readonly type: "boolean"; - }; - readonly cacheDirectory: { - readonly description: string; - readonly type: "string"; - }; - readonly changedFilesWithAncestor: { - readonly default: undefined; - readonly description: string; - readonly type: "boolean"; - }; - readonly changedSince: { - readonly description: string; - readonly nargs: 1; - readonly type: "string"; - }; - readonly ci: { - readonly default: boolean; - readonly description: string; - readonly type: "boolean"; - }; - readonly clearCache: { - readonly default: undefined; - readonly description: string; - readonly type: "boolean"; - }; - readonly clearMocks: { - readonly default: undefined; - readonly description: string; - readonly type: "boolean"; - }; - readonly collectCoverage: { - readonly default: undefined; - readonly description: "Alias for --coverage."; - readonly type: "boolean"; - }; - readonly collectCoverageFrom: { - readonly description: string; - readonly type: "string"; - }; - readonly collectCoverageOnlyFrom: { - readonly description: "Explicit list of paths coverage will be restricted to."; - readonly string: true; - readonly type: "array"; - }; - readonly color: { - readonly default: undefined; - readonly description: string; - readonly type: "boolean"; - }; - readonly colors: { - readonly default: undefined; - readonly description: "Alias for `--color`."; - readonly type: "boolean"; - }; - readonly config: { - readonly alias: "c"; - readonly description: string; - readonly type: "string"; - }; - readonly coverage: { - readonly default: undefined; - readonly description: string; - readonly type: "boolean"; - }; - readonly coverageDirectory: { - readonly description: "The directory where Jest should output its coverage files."; - readonly type: "string"; - }; - readonly coveragePathIgnorePatterns: { - readonly description: string; - readonly string: true; - readonly type: "array"; - }; - readonly coverageProvider: { - readonly choices: readonly ["babel", "v8"]; - readonly description: "Select between Babel and V8 to collect coverage"; - }; - readonly coverageReporters: { - readonly description: string; - readonly string: true; - readonly type: "array"; - }; - readonly coverageThreshold: { - readonly description: string; - readonly type: "string"; - }; - readonly debug: { - readonly default: undefined; - readonly description: "Print debugging info about your jest config."; - readonly type: "boolean"; - }; - readonly detectLeaks: { - readonly default: false; - readonly description: string; - readonly type: "boolean"; - }; - readonly detectOpenHandles: { - readonly default: false; - readonly description: string; - readonly type: "boolean"; - }; - readonly env: { - readonly description: string; - readonly type: "string"; - }; - readonly errorOnDeprecated: { - readonly default: false; - readonly description: "Make calling deprecated APIs throw helpful error messages."; - readonly type: "boolean"; - }; - readonly expand: { - readonly alias: "e"; - readonly default: undefined; - readonly description: "Use this flag to show full diffs instead of a patch."; - readonly type: "boolean"; - }; - readonly filter: { - readonly default: undefined; - readonly description: string; - readonly type: "string"; - }; - readonly findRelatedTests: { - readonly default: undefined; - readonly description: string; - readonly type: "boolean"; - }; - readonly forceExit: { - readonly default: undefined; - readonly description: string; - readonly type: "boolean"; - }; - readonly globalSetup: { - readonly description: "The path to a module that runs before All Tests."; - readonly type: "string"; - }; - readonly globalTeardown: { - readonly description: "The path to a module that runs after All Tests."; - readonly type: "string"; - }; - readonly globals: { - readonly description: string; - readonly type: "string"; - }; - readonly haste: { - readonly description: "A JSON string with map of variables for the haste module system"; - readonly type: "string"; - }; - readonly init: { - readonly description: "Generate a basic configuration file"; - readonly type: "boolean"; - }; - readonly json: { - readonly default: undefined; - readonly description: string; - readonly type: "boolean"; - }; - readonly lastCommit: { - readonly default: undefined; - readonly description: string; - readonly type: "boolean"; - }; - readonly listTests: { - readonly default: false; - readonly description: string; - readonly type: "boolean"; - }; - readonly logHeapUsage: { - readonly default: undefined; - readonly description: string; - readonly type: "boolean"; - }; - readonly mapCoverage: { - readonly default: undefined; - readonly description: string; - readonly type: "boolean"; - }; - readonly maxConcurrency: { - readonly default: 5; - readonly description: string; - readonly type: "number"; - }; - readonly maxWorkers: { - readonly alias: "w"; - readonly description: string; - readonly type: "string"; - }; - readonly moduleDirectories: { - readonly description: string; - readonly string: true; - readonly type: "array"; - }; - readonly moduleFileExtensions: { - readonly description: string; - readonly string: true; - readonly type: "array"; - }; - readonly moduleNameMapper: { - readonly description: string; - readonly type: "string"; - }; - readonly modulePathIgnorePatterns: { - readonly description: string; - readonly string: true; - readonly type: "array"; - }; - readonly modulePaths: { - readonly description: string; - readonly string: true; - readonly type: "array"; - }; - readonly noStackTrace: { - readonly default: undefined; - readonly description: "Disables stack trace in test results output"; - readonly type: "boolean"; - }; - readonly notify: { - readonly default: undefined; - readonly description: "Activates notifications for test results."; - readonly type: "boolean"; - }; - readonly notifyMode: { - readonly default: "failure-change"; - readonly description: "Specifies when notifications will appear for test results."; - readonly type: "string"; - }; - readonly onlyChanged: { - readonly alias: "o"; - readonly default: undefined; - readonly description: string; - readonly type: "boolean"; - }; - readonly onlyFailures: { - readonly alias: "f"; - readonly default: undefined; - readonly description: "Run tests that failed in the previous execution."; - readonly type: "boolean"; - }; - readonly outputFile: { - readonly description: string; - readonly type: "string"; - }; - readonly passWithNoTests: { - readonly default: false; - readonly description: "Will not fail if no tests are found (for example while using `--testPathPattern`.)"; - readonly type: "boolean"; - }; - readonly preset: { - readonly description: "A preset that is used as a base for Jest's configuration."; - readonly type: "string"; - }; - readonly prettierPath: { - readonly default: undefined; - readonly description: "The path to the \"prettier\" module used for inline snapshots."; - readonly type: "string"; - }; - readonly projects: { - readonly description: string; - readonly string: true; - readonly type: "array"; - }; - readonly reporters: { - readonly description: "A list of custom reporters for the test suite."; - readonly string: true; - readonly type: "array"; - }; - readonly resetMocks: { - readonly default: undefined; - readonly description: string; - readonly type: "boolean"; - }; - readonly resetModules: { - readonly default: undefined; - readonly description: string; - readonly type: "boolean"; - }; - readonly resolver: { - readonly description: "A JSON string which allows the use of a custom resolver."; - readonly type: "string"; - }; - readonly restoreMocks: { - readonly default: undefined; - readonly description: string; - readonly type: "boolean"; - }; - readonly rootDir: { - readonly description: string; - readonly type: "string"; - }; - readonly roots: { - readonly description: string; - readonly string: true; - readonly type: "array"; - }; - readonly runInBand: { - readonly alias: "i"; - readonly default: undefined; - readonly description: string; - readonly type: "boolean"; - }; - readonly runTestsByPath: { - readonly default: false; - readonly description: string; - readonly type: "boolean"; - }; - readonly runner: { - readonly description: "Allows to use a custom runner instead of Jest's default test runner."; - readonly type: "string"; - }; - readonly setupFiles: { - readonly description: string; - readonly string: true; - readonly type: "array"; - }; - readonly setupFilesAfterEnv: { - readonly description: string; - readonly string: true; - readonly type: "array"; - }; - readonly showConfig: { - readonly default: undefined; - readonly description: "Print your jest config and then exits."; - readonly type: "boolean"; - }; - readonly silent: { - readonly default: undefined; - readonly description: "Prevent tests from printing messages through the console."; - readonly type: "boolean"; - }; - readonly skipFilter: { - readonly default: undefined; - readonly description: string; - readonly type: "boolean"; - }; - readonly snapshotSerializers: { - readonly description: string; - readonly string: true; - readonly type: "array"; - }; - readonly testEnvironment: { - readonly description: "Alias for --env"; - readonly type: "string"; - }; - readonly testEnvironmentOptions: { - readonly description: string; - readonly type: "string"; - }; - readonly testFailureExitCode: { - readonly description: "Exit code of `jest` command if the test run failed"; - readonly type: "string"; - }; - readonly testLocationInResults: { - readonly default: false; - readonly description: "Add `location` information to the test results"; - readonly type: "boolean"; - }; - readonly testMatch: { - readonly description: "The glob patterns Jest uses to detect test files."; - readonly string: true; - readonly type: "array"; - }; - readonly testNamePattern: { - readonly alias: "t"; - readonly description: "Run only tests with a name that matches the regex pattern."; - readonly type: "string"; - }; - readonly testPathIgnorePatterns: { - readonly description: string; - readonly string: true; - readonly type: "array"; - }; - readonly testPathPattern: { - readonly description: string; - readonly string: true; - readonly type: "array"; - }; - readonly testRegex: { - readonly description: "A string or array of string regexp patterns that Jest uses to detect test files."; - readonly string: true; - readonly type: "array"; - }; - readonly testResultsProcessor: { - readonly description: string; - readonly type: "string"; - }; - readonly testRunner: { - readonly description: string; - readonly type: "string"; - }; - readonly testSequencer: { - readonly description: string; - readonly type: "string"; - }; - readonly testTimeout: { - readonly description: "This option sets the default timeouts of test cases."; - readonly type: "number"; - }; - readonly testURL: { - readonly description: "This option sets the URL for the jsdom environment."; - readonly type: "string"; - }; - readonly timers: { - readonly description: string; - readonly type: "string"; - }; - readonly transform: { - readonly description: string; - readonly type: "string"; - }; - readonly transformIgnorePatterns: { - readonly description: string; - readonly string: true; - readonly type: "array"; - }; - readonly unmockedModulePathPatterns: { - readonly description: string; - readonly string: true; - readonly type: "array"; - }; - readonly updateSnapshot: { - readonly alias: "u"; - readonly default: undefined; - readonly description: string; - readonly type: "boolean"; - }; - readonly useStderr: { - readonly default: undefined; - readonly description: "Divert all output to stderr."; - readonly type: "boolean"; - }; - readonly verbose: { - readonly default: undefined; - readonly description: "Display individual test results with the test suite hierarchy."; - readonly type: "boolean"; - }; - readonly version: { - readonly alias: "v"; - readonly default: undefined; - readonly description: "Print the version and exit"; - readonly type: "boolean"; - }; - readonly watch: { - readonly default: undefined; - readonly description: string; - readonly type: "boolean"; - }; - readonly watchAll: { - readonly default: undefined; - readonly description: string; - readonly type: "boolean"; - }; - readonly watchPathIgnorePatterns: { - readonly description: string; - readonly string: true; - readonly type: "array"; - }; - readonly watchman: { - readonly default: undefined; - readonly description: string; - readonly type: "boolean"; - }; -}; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import { Config } from '@jest/types'; +export declare function check(argv: Config.Argv): true; +export declare const usage = "Usage: $0 [--config=] [TestPathPattern]"; +export declare const docs = "Documentation: https://jestjs.io/"; +export declare const options: { + readonly all: { + readonly default: undefined; + readonly description: string; + readonly type: "boolean"; + }; + readonly automock: { + readonly default: undefined; + readonly description: "Automock all files by default."; + readonly type: "boolean"; + }; + readonly bail: { + readonly alias: "b"; + readonly default: undefined; + readonly description: "Exit the test suite immediately after `n` number of failing tests."; + readonly type: "boolean"; + }; + readonly browser: { + readonly default: undefined; + readonly description: string; + readonly type: "boolean"; + }; + readonly cache: { + readonly default: undefined; + readonly description: string; + readonly type: "boolean"; + }; + readonly cacheDirectory: { + readonly description: string; + readonly type: "string"; + }; + readonly changedFilesWithAncestor: { + readonly default: undefined; + readonly description: string; + readonly type: "boolean"; + }; + readonly changedSince: { + readonly description: string; + readonly nargs: 1; + readonly type: "string"; + }; + readonly ci: { + readonly default: boolean; + readonly description: string; + readonly type: "boolean"; + }; + readonly clearCache: { + readonly default: undefined; + readonly description: string; + readonly type: "boolean"; + }; + readonly clearMocks: { + readonly default: undefined; + readonly description: string; + readonly type: "boolean"; + }; + readonly collectCoverage: { + readonly default: undefined; + readonly description: "Alias for --coverage."; + readonly type: "boolean"; + }; + readonly collectCoverageFrom: { + readonly description: string; + readonly type: "string"; + }; + readonly collectCoverageOnlyFrom: { + readonly description: "Explicit list of paths coverage will be restricted to."; + readonly string: true; + readonly type: "array"; + }; + readonly color: { + readonly default: undefined; + readonly description: string; + readonly type: "boolean"; + }; + readonly colors: { + readonly default: undefined; + readonly description: "Alias for `--color`."; + readonly type: "boolean"; + }; + readonly config: { + readonly alias: "c"; + readonly description: string; + readonly type: "string"; + }; + readonly coverage: { + readonly default: undefined; + readonly description: string; + readonly type: "boolean"; + }; + readonly coverageDirectory: { + readonly description: "The directory where Jest should output its coverage files."; + readonly type: "string"; + }; + readonly coveragePathIgnorePatterns: { + readonly description: string; + readonly string: true; + readonly type: "array"; + }; + readonly coverageProvider: { + readonly choices: readonly ["babel", "v8"]; + readonly description: "Select between Babel and V8 to collect coverage"; + }; + readonly coverageReporters: { + readonly description: string; + readonly string: true; + readonly type: "array"; + }; + readonly coverageThreshold: { + readonly description: string; + readonly type: "string"; + }; + readonly debug: { + readonly default: undefined; + readonly description: "Print debugging info about your jest config."; + readonly type: "boolean"; + }; + readonly detectLeaks: { + readonly default: false; + readonly description: string; + readonly type: "boolean"; + }; + readonly detectOpenHandles: { + readonly default: false; + readonly description: string; + readonly type: "boolean"; + }; + readonly env: { + readonly description: string; + readonly type: "string"; + }; + readonly errorOnDeprecated: { + readonly default: false; + readonly description: "Make calling deprecated APIs throw helpful error messages."; + readonly type: "boolean"; + }; + readonly expand: { + readonly alias: "e"; + readonly default: undefined; + readonly description: "Use this flag to show full diffs instead of a patch."; + readonly type: "boolean"; + }; + readonly filter: { + readonly default: undefined; + readonly description: string; + readonly type: "string"; + }; + readonly findRelatedTests: { + readonly default: undefined; + readonly description: string; + readonly type: "boolean"; + }; + readonly forceExit: { + readonly default: undefined; + readonly description: string; + readonly type: "boolean"; + }; + readonly globalSetup: { + readonly description: "The path to a module that runs before All Tests."; + readonly type: "string"; + }; + readonly globalTeardown: { + readonly description: "The path to a module that runs after All Tests."; + readonly type: "string"; + }; + readonly globals: { + readonly description: string; + readonly type: "string"; + }; + readonly haste: { + readonly description: "A JSON string with map of variables for the haste module system"; + readonly type: "string"; + }; + readonly init: { + readonly description: "Generate a basic configuration file"; + readonly type: "boolean"; + }; + readonly json: { + readonly default: undefined; + readonly description: string; + readonly type: "boolean"; + }; + readonly lastCommit: { + readonly default: undefined; + readonly description: string; + readonly type: "boolean"; + }; + readonly listTests: { + readonly default: false; + readonly description: string; + readonly type: "boolean"; + }; + readonly logHeapUsage: { + readonly default: undefined; + readonly description: string; + readonly type: "boolean"; + }; + readonly mapCoverage: { + readonly default: undefined; + readonly description: string; + readonly type: "boolean"; + }; + readonly maxConcurrency: { + readonly default: 5; + readonly description: string; + readonly type: "number"; + }; + readonly maxWorkers: { + readonly alias: "w"; + readonly description: string; + readonly type: "string"; + }; + readonly moduleDirectories: { + readonly description: string; + readonly string: true; + readonly type: "array"; + }; + readonly moduleFileExtensions: { + readonly description: string; + readonly string: true; + readonly type: "array"; + }; + readonly moduleNameMapper: { + readonly description: string; + readonly type: "string"; + }; + readonly modulePathIgnorePatterns: { + readonly description: string; + readonly string: true; + readonly type: "array"; + }; + readonly modulePaths: { + readonly description: string; + readonly string: true; + readonly type: "array"; + }; + readonly noStackTrace: { + readonly default: undefined; + readonly description: "Disables stack trace in test results output"; + readonly type: "boolean"; + }; + readonly notify: { + readonly default: undefined; + readonly description: "Activates notifications for test results."; + readonly type: "boolean"; + }; + readonly notifyMode: { + readonly default: "failure-change"; + readonly description: "Specifies when notifications will appear for test results."; + readonly type: "string"; + }; + readonly onlyChanged: { + readonly alias: "o"; + readonly default: undefined; + readonly description: string; + readonly type: "boolean"; + }; + readonly onlyFailures: { + readonly alias: "f"; + readonly default: undefined; + readonly description: "Run tests that failed in the previous execution."; + readonly type: "boolean"; + }; + readonly outputFile: { + readonly description: string; + readonly type: "string"; + }; + readonly passWithNoTests: { + readonly default: false; + readonly description: "Will not fail if no tests are found (for example while using `--testPathPattern`.)"; + readonly type: "boolean"; + }; + readonly preset: { + readonly description: "A preset that is used as a base for Jest's configuration."; + readonly type: "string"; + }; + readonly prettierPath: { + readonly default: undefined; + readonly description: "The path to the \"prettier\" module used for inline snapshots."; + readonly type: "string"; + }; + readonly projects: { + readonly description: string; + readonly string: true; + readonly type: "array"; + }; + readonly reporters: { + readonly description: "A list of custom reporters for the test suite."; + readonly string: true; + readonly type: "array"; + }; + readonly resetMocks: { + readonly default: undefined; + readonly description: string; + readonly type: "boolean"; + }; + readonly resetModules: { + readonly default: undefined; + readonly description: string; + readonly type: "boolean"; + }; + readonly resolver: { + readonly description: "A JSON string which allows the use of a custom resolver."; + readonly type: "string"; + }; + readonly restoreMocks: { + readonly default: undefined; + readonly description: string; + readonly type: "boolean"; + }; + readonly rootDir: { + readonly description: string; + readonly type: "string"; + }; + readonly roots: { + readonly description: string; + readonly string: true; + readonly type: "array"; + }; + readonly runInBand: { + readonly alias: "i"; + readonly default: undefined; + readonly description: string; + readonly type: "boolean"; + }; + readonly runTestsByPath: { + readonly default: false; + readonly description: string; + readonly type: "boolean"; + }; + readonly runner: { + readonly description: "Allows to use a custom runner instead of Jest's default test runner."; + readonly type: "string"; + }; + readonly setupFiles: { + readonly description: string; + readonly string: true; + readonly type: "array"; + }; + readonly setupFilesAfterEnv: { + readonly description: string; + readonly string: true; + readonly type: "array"; + }; + readonly showConfig: { + readonly default: undefined; + readonly description: "Print your jest config and then exits."; + readonly type: "boolean"; + }; + readonly silent: { + readonly default: undefined; + readonly description: "Prevent tests from printing messages through the console."; + readonly type: "boolean"; + }; + readonly skipFilter: { + readonly default: undefined; + readonly description: string; + readonly type: "boolean"; + }; + readonly snapshotSerializers: { + readonly description: string; + readonly string: true; + readonly type: "array"; + }; + readonly testEnvironment: { + readonly description: "Alias for --env"; + readonly type: "string"; + }; + readonly testEnvironmentOptions: { + readonly description: string; + readonly type: "string"; + }; + readonly testFailureExitCode: { + readonly description: "Exit code of `jest` command if the test run failed"; + readonly type: "string"; + }; + readonly testLocationInResults: { + readonly default: false; + readonly description: "Add `location` information to the test results"; + readonly type: "boolean"; + }; + readonly testMatch: { + readonly description: "The glob patterns Jest uses to detect test files."; + readonly string: true; + readonly type: "array"; + }; + readonly testNamePattern: { + readonly alias: "t"; + readonly description: "Run only tests with a name that matches the regex pattern."; + readonly type: "string"; + }; + readonly testPathIgnorePatterns: { + readonly description: string; + readonly string: true; + readonly type: "array"; + }; + readonly testPathPattern: { + readonly description: string; + readonly string: true; + readonly type: "array"; + }; + readonly testRegex: { + readonly description: "A string or array of string regexp patterns that Jest uses to detect test files."; + readonly string: true; + readonly type: "array"; + }; + readonly testResultsProcessor: { + readonly description: string; + readonly type: "string"; + }; + readonly testRunner: { + readonly description: string; + readonly type: "string"; + }; + readonly testSequencer: { + readonly description: string; + readonly type: "string"; + }; + readonly testTimeout: { + readonly description: "This option sets the default timeouts of test cases."; + readonly type: "number"; + }; + readonly testURL: { + readonly description: "This option sets the URL for the jsdom environment."; + readonly type: "string"; + }; + readonly timers: { + readonly description: string; + readonly type: "string"; + }; + readonly transform: { + readonly description: string; + readonly type: "string"; + }; + readonly transformIgnorePatterns: { + readonly description: string; + readonly string: true; + readonly type: "array"; + }; + readonly unmockedModulePathPatterns: { + readonly description: string; + readonly string: true; + readonly type: "array"; + }; + readonly updateSnapshot: { + readonly alias: "u"; + readonly default: undefined; + readonly description: string; + readonly type: "boolean"; + }; + readonly useStderr: { + readonly default: undefined; + readonly description: "Divert all output to stderr."; + readonly type: "boolean"; + }; + readonly verbose: { + readonly default: undefined; + readonly description: "Display individual test results with the test suite hierarchy."; + readonly type: "boolean"; + }; + readonly version: { + readonly alias: "v"; + readonly default: undefined; + readonly description: "Print the version and exit"; + readonly type: "boolean"; + }; + readonly watch: { + readonly default: undefined; + readonly description: string; + readonly type: "boolean"; + }; + readonly watchAll: { + readonly default: undefined; + readonly description: string; + readonly type: "boolean"; + }; + readonly watchPathIgnorePatterns: { + readonly description: string; + readonly string: true; + readonly type: "array"; + }; + readonly watchman: { + readonly default: undefined; + readonly description: string; + readonly type: "boolean"; + }; +}; diff --git a/node_modules/jest-cli/build/ts3.4/cli/index.d.ts b/node_modules/jest-cli/build/ts3.4/cli/index.d.ts index 463e9af10..66112a9c9 100644 --- a/node_modules/jest-cli/build/ts3.4/cli/index.d.ts +++ b/node_modules/jest-cli/build/ts3.4/cli/index.d.ts @@ -1,96 +1,96 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import { Config } from '@jest/types'; -import yargs = require('yargs'); -export declare function run(maybeArgv?: Array, project?: Config.Path): Promise; -export declare const buildArgv: (maybeArgv?: string[] | undefined) => yargs.Arguments>; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import { Config } from '@jest/types'; +import yargs = require('yargs'); +export declare function run(maybeArgv?: Array, project?: Config.Path): Promise; +export declare const buildArgv: (maybeArgv?: string[] | undefined) => yargs.Arguments>; diff --git a/node_modules/jest-cli/build/ts3.4/index.d.ts b/node_modules/jest-cli/build/ts3.4/index.d.ts index 00cb5feef..fabb97bf5 100644 --- a/node_modules/jest-cli/build/ts3.4/index.d.ts +++ b/node_modules/jest-cli/build/ts3.4/index.d.ts @@ -1,7 +1,7 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -export { run } from './cli'; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +export { run } from './cli'; diff --git a/node_modules/jest-cli/build/ts3.4/init/errors.d.ts b/node_modules/jest-cli/build/ts3.4/init/errors.d.ts index 426fdc0f1..7b456e5f0 100644 --- a/node_modules/jest-cli/build/ts3.4/init/errors.d.ts +++ b/node_modules/jest-cli/build/ts3.4/init/errors.d.ts @@ -1,12 +1,12 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -export declare class NotFoundPackageJsonError extends Error { - constructor(rootDir: string); -} -export declare class MalformedPackageJsonError extends Error { - constructor(packageJsonPath: string); -} +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +export declare class NotFoundPackageJsonError extends Error { + constructor(rootDir: string); +} +export declare class MalformedPackageJsonError extends Error { + constructor(packageJsonPath: string); +} diff --git a/node_modules/jest-cli/build/ts3.4/init/generate_config_file.d.ts b/node_modules/jest-cli/build/ts3.4/init/generate_config_file.d.ts index c5afd8d3f..fd763f558 100644 --- a/node_modules/jest-cli/build/ts3.4/init/generate_config_file.d.ts +++ b/node_modules/jest-cli/build/ts3.4/init/generate_config_file.d.ts @@ -1,8 +1,8 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -declare const generateConfigFile: (results: Record, generateEsm?: boolean) => string; -export default generateConfigFile; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +declare const generateConfigFile: (results: Record, generateEsm?: boolean) => string; +export default generateConfigFile; diff --git a/node_modules/jest-cli/build/ts3.4/init/index.d.ts b/node_modules/jest-cli/build/ts3.4/init/index.d.ts index b11e02189..c713b6985 100644 --- a/node_modules/jest-cli/build/ts3.4/init/index.d.ts +++ b/node_modules/jest-cli/build/ts3.4/init/index.d.ts @@ -1,8 +1,8 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -declare const _default: (rootDir?: string) => Promise; -export default _default; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +declare const _default: (rootDir?: string) => Promise; +export default _default; diff --git a/node_modules/jest-cli/build/ts3.4/init/modify_package_json.d.ts b/node_modules/jest-cli/build/ts3.4/init/modify_package_json.d.ts index 199b42671..dcdb9557e 100644 --- a/node_modules/jest-cli/build/ts3.4/init/modify_package_json.d.ts +++ b/node_modules/jest-cli/build/ts3.4/init/modify_package_json.d.ts @@ -1,12 +1,12 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import { ProjectPackageJson } from './types'; -declare const modifyPackageJson: ({ projectPackageJson, shouldModifyScripts, }: { - projectPackageJson: ProjectPackageJson; - shouldModifyScripts: boolean; -}) => string; -export default modifyPackageJson; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import { ProjectPackageJson } from './types'; +declare const modifyPackageJson: ({ projectPackageJson, shouldModifyScripts, }: { + projectPackageJson: ProjectPackageJson; + shouldModifyScripts: boolean; +}) => string; +export default modifyPackageJson; diff --git a/node_modules/jest-cli/build/ts3.4/init/questions.d.ts b/node_modules/jest-cli/build/ts3.4/init/questions.d.ts index 05113773d..7fddb3159 100644 --- a/node_modules/jest-cli/build/ts3.4/init/questions.d.ts +++ b/node_modules/jest-cli/build/ts3.4/init/questions.d.ts @@ -1,10 +1,10 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import { PromptObject } from 'prompts'; -declare const defaultQuestions: Array; -export default defaultQuestions; -export declare const testScriptQuestion: PromptObject; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import { PromptObject } from 'prompts'; +declare const defaultQuestions: Array; +export default defaultQuestions; +export declare const testScriptQuestion: PromptObject; diff --git a/node_modules/jest-cli/build/ts3.4/init/types.d.ts b/node_modules/jest-cli/build/ts3.4/init/types.d.ts index 5be97888a..28b2349b0 100644 --- a/node_modules/jest-cli/build/ts3.4/init/types.d.ts +++ b/node_modules/jest-cli/build/ts3.4/init/types.d.ts @@ -1,12 +1,12 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import { Config } from '@jest/types'; -export declare type ProjectPackageJson = { - jest?: Partial; - scripts?: Record; - type?: 'commonjs' | 'module'; -}; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import { Config } from '@jest/types'; +export declare type ProjectPackageJson = { + jest?: Partial; + scripts?: Record; + type?: 'commonjs' | 'module'; +}; diff --git a/node_modules/jest-config/build/ts3.4/Defaults.d.ts b/node_modules/jest-config/build/ts3.4/Defaults.d.ts index 02cc6589f..737e754a3 100644 --- a/node_modules/jest-config/build/ts3.4/Defaults.d.ts +++ b/node_modules/jest-config/build/ts3.4/Defaults.d.ts @@ -1,9 +1,9 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import { Config } from '@jest/types'; -declare const defaultOptions: Config.DefaultOptions; -export default defaultOptions; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import { Config } from '@jest/types'; +declare const defaultOptions: Config.DefaultOptions; +export default defaultOptions; diff --git a/node_modules/jest-config/build/ts3.4/Deprecated.d.ts b/node_modules/jest-config/build/ts3.4/Deprecated.d.ts index 58f67ccbb..300fde004 100644 --- a/node_modules/jest-config/build/ts3.4/Deprecated.d.ts +++ b/node_modules/jest-config/build/ts3.4/Deprecated.d.ts @@ -1,8 +1,8 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -declare const _default: Record; -export default _default; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +declare const _default: Record; +export default _default; diff --git a/node_modules/jest-config/build/ts3.4/Descriptions.d.ts b/node_modules/jest-config/build/ts3.4/Descriptions.d.ts index e1a414685..c09ca21c0 100644 --- a/node_modules/jest-config/build/ts3.4/Descriptions.d.ts +++ b/node_modules/jest-config/build/ts3.4/Descriptions.d.ts @@ -1,11 +1,11 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import { Config } from '@jest/types'; -declare const descriptions: { - [key in keyof Config.InitialOptions]: string; -}; -export default descriptions; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import { Config } from '@jest/types'; +declare const descriptions: { + [key in keyof Config.InitialOptions]: string; +}; +export default descriptions; diff --git a/node_modules/jest-config/build/ts3.4/ReporterValidationErrors.d.ts b/node_modules/jest-config/build/ts3.4/ReporterValidationErrors.d.ts index 95f0a5c72..19b29e48a 100644 --- a/node_modules/jest-config/build/ts3.4/ReporterValidationErrors.d.ts +++ b/node_modules/jest-config/build/ts3.4/ReporterValidationErrors.d.ts @@ -1,19 +1,19 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import { Config } from '@jest/types'; -import { ValidationError } from 'jest-validate'; -/** - * Reporter Validation Error is thrown if the given arguments - * within the reporter are not valid. - * - * This is a highly specific reporter error and in the future will be - * merged with jest-validate. Till then, we can make use of it. It works - * and that's what counts most at this time. - */ -export declare function createReporterError(reporterIndex: number, reporterValue: Array | string): ValidationError; -export declare function createArrayReporterError(arrayReporter: Config.ReporterConfig, reporterIndex: number, valueIndex: number, value: string | Record, expectedType: string, valueName: string): ValidationError; -export declare function validateReporters(reporterConfig: Array): boolean; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import { Config } from '@jest/types'; +import { ValidationError } from 'jest-validate'; +/** + * Reporter Validation Error is thrown if the given arguments + * within the reporter are not valid. + * + * This is a highly specific reporter error and in the future will be + * merged with jest-validate. Till then, we can make use of it. It works + * and that's what counts most at this time. + */ +export declare function createReporterError(reporterIndex: number, reporterValue: Array | string): ValidationError; +export declare function createArrayReporterError(arrayReporter: Config.ReporterConfig, reporterIndex: number, valueIndex: number, value: string | Record, expectedType: string, valueName: string): ValidationError; +export declare function validateReporters(reporterConfig: Array): boolean; diff --git a/node_modules/jest-config/build/ts3.4/ValidConfig.d.ts b/node_modules/jest-config/build/ts3.4/ValidConfig.d.ts index 5036ba235..b5cf88923 100644 --- a/node_modules/jest-config/build/ts3.4/ValidConfig.d.ts +++ b/node_modules/jest-config/build/ts3.4/ValidConfig.d.ts @@ -1,9 +1,9 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import { Config } from '@jest/types'; -declare const initialOptions: Config.InitialOptions; -export default initialOptions; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import { Config } from '@jest/types'; +declare const initialOptions: Config.InitialOptions; +export default initialOptions; diff --git a/node_modules/jest-config/build/ts3.4/color.d.ts b/node_modules/jest-config/build/ts3.4/color.d.ts index 199baac4a..fff8d0e1b 100644 --- a/node_modules/jest-config/build/ts3.4/color.d.ts +++ b/node_modules/jest-config/build/ts3.4/color.d.ts @@ -1,7 +1,7 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -export declare const getDisplayNameColor: (seed?: string | undefined) => "hex" | "bold" | "reset" | "black" | "red" | "green" | "yellow" | "blue" | "magenta" | "cyan" | "white" | "gray" | "grey" | "blackBright" | "redBright" | "greenBright" | "yellowBright" | "blueBright" | "magentaBright" | "cyanBright" | "whiteBright" | "bgBlack" | "bgRed" | "bgGreen" | "bgYellow" | "bgBlue" | "bgMagenta" | "bgCyan" | "bgWhite" | "bgGray" | "bgGrey" | "bgBlackBright" | "bgRedBright" | "bgGreenBright" | "bgYellowBright" | "bgBlueBright" | "bgMagentaBright" | "bgCyanBright" | "bgWhiteBright" | "dim" | "italic" | "underline" | "inverse" | "hidden" | "strikethrough" | "visible" | "Instance" | "level" | "keyword" | "rgb" | "hsl" | "hsv" | "hwb" | "ansi" | "ansi256" | "bgHex" | "bgKeyword" | "bgRgb" | "bgHsl" | "bgHsv" | "bgHwb" | "bgAnsi" | "bgAnsi256" | "supportsColor" | "Level" | "Color" | "ForegroundColor" | "BackgroundColor" | "Modifiers" | "stderr"; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +export declare const getDisplayNameColor: (seed?: string | undefined) => "hex" | "bold" | "reset" | "black" | "red" | "green" | "yellow" | "blue" | "magenta" | "cyan" | "white" | "gray" | "grey" | "blackBright" | "redBright" | "greenBright" | "yellowBright" | "blueBright" | "magentaBright" | "cyanBright" | "whiteBright" | "bgBlack" | "bgRed" | "bgGreen" | "bgYellow" | "bgBlue" | "bgMagenta" | "bgCyan" | "bgWhite" | "bgGray" | "bgGrey" | "bgBlackBright" | "bgRedBright" | "bgGreenBright" | "bgYellowBright" | "bgBlueBright" | "bgMagentaBright" | "bgCyanBright" | "bgWhiteBright" | "dim" | "italic" | "underline" | "inverse" | "hidden" | "strikethrough" | "visible" | "Instance" | "level" | "keyword" | "rgb" | "hsl" | "hsv" | "hwb" | "ansi" | "ansi256" | "bgHex" | "bgKeyword" | "bgRgb" | "bgHsl" | "bgHsv" | "bgHwb" | "bgAnsi" | "bgAnsi256" | "supportsColor" | "Level" | "Color" | "ForegroundColor" | "BackgroundColor" | "Modifiers" | "stderr"; diff --git a/node_modules/jest-config/build/ts3.4/constants.d.ts b/node_modules/jest-config/build/ts3.4/constants.d.ts index fb9b1a2af..5826c91ac 100644 --- a/node_modules/jest-config/build/ts3.4/constants.d.ts +++ b/node_modules/jest-config/build/ts3.4/constants.d.ts @@ -1,16 +1,16 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -export declare const NODE_MODULES: string; -export declare const DEFAULT_JS_PATTERN = "^.+\\.[jt]sx?$"; -export declare const DEFAULT_REPORTER_LABEL = "default"; -export declare const PACKAGE_JSON = "package.json"; -export declare const JEST_CONFIG_BASE_NAME = "jest.config"; -export declare const JEST_CONFIG_EXT_CJS = ".cjs"; -export declare const JEST_CONFIG_EXT_MJS = ".mjs"; -export declare const JEST_CONFIG_EXT_JS = ".js"; -export declare const JEST_CONFIG_EXT_JSON = ".json"; -export declare const JEST_CONFIG_EXT_ORDER: readonly string[]; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +export declare const NODE_MODULES: string; +export declare const DEFAULT_JS_PATTERN = "^.+\\.[jt]sx?$"; +export declare const DEFAULT_REPORTER_LABEL = "default"; +export declare const PACKAGE_JSON = "package.json"; +export declare const JEST_CONFIG_BASE_NAME = "jest.config"; +export declare const JEST_CONFIG_EXT_CJS = ".cjs"; +export declare const JEST_CONFIG_EXT_MJS = ".mjs"; +export declare const JEST_CONFIG_EXT_JS = ".js"; +export declare const JEST_CONFIG_EXT_JSON = ".json"; +export declare const JEST_CONFIG_EXT_ORDER: readonly string[]; diff --git a/node_modules/jest-config/build/ts3.4/getCacheDirectory.d.ts b/node_modules/jest-config/build/ts3.4/getCacheDirectory.d.ts index e2767bc38..909b6a326 100644 --- a/node_modules/jest-config/build/ts3.4/getCacheDirectory.d.ts +++ b/node_modules/jest-config/build/ts3.4/getCacheDirectory.d.ts @@ -1,8 +1,8 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -declare const getCacheDirectory: () => string; -export default getCacheDirectory; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +declare const getCacheDirectory: () => string; +export default getCacheDirectory; diff --git a/node_modules/jest-config/build/ts3.4/getMaxWorkers.d.ts b/node_modules/jest-config/build/ts3.4/getMaxWorkers.d.ts index c09acf0c0..9f1e1be5b 100644 --- a/node_modules/jest-config/build/ts3.4/getMaxWorkers.d.ts +++ b/node_modules/jest-config/build/ts3.4/getMaxWorkers.d.ts @@ -1,8 +1,8 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import { Config } from '@jest/types'; -export default function getMaxWorkers(argv: Partial>, defaultOptions?: Partial>): number; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import { Config } from '@jest/types'; +export default function getMaxWorkers(argv: Partial>, defaultOptions?: Partial>): number; diff --git a/node_modules/jest-config/build/ts3.4/importEsm.d.ts b/node_modules/jest-config/build/ts3.4/importEsm.d.ts index 269f9371d..8d5075b99 100644 --- a/node_modules/jest-config/build/ts3.4/importEsm.d.ts +++ b/node_modules/jest-config/build/ts3.4/importEsm.d.ts @@ -1,10 +1,10 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -declare const _default: (specifier: string) => Promise<{ - default: unknown; -}>; -export default _default; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +declare const _default: (specifier: string) => Promise<{ + default: unknown; +}>; +export default _default; diff --git a/node_modules/jest-config/build/ts3.4/index.d.ts b/node_modules/jest-config/build/ts3.4/index.d.ts index 9c9422596..3e83aab91 100644 --- a/node_modules/jest-config/build/ts3.4/index.d.ts +++ b/node_modules/jest-config/build/ts3.4/index.d.ts @@ -1,27 +1,27 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import { Config } from '@jest/types'; -export { getTestEnvironment, isJSONString } from './utils'; -export { default as normalize } from './normalize'; -export { default as deprecationEntries } from './Deprecated'; -export { replaceRootDirInPath } from './utils'; -export { default as defaults } from './Defaults'; -export { default as descriptions } from './Descriptions'; -import * as constants from './constants'; -export { constants }; -declare type ReadConfig = { - configPath: Config.Path | null | undefined; - globalConfig: Config.GlobalConfig; - hasDeprecationWarnings: boolean; - projectConfig: Config.ProjectConfig; -}; -export declare function readConfig(argv: Config.Argv, packageRootOrConfig: Config.Path | Config.InitialOptions, skipArgvConfigOption?: boolean, parentConfigPath?: Config.Path | null, projectIndex?: number): Promise; -export declare function readConfigs(argv: Config.Argv, projectPaths: Array): Promise<{ - globalConfig: Config.GlobalConfig; - configs: Array; - hasDeprecationWarnings: boolean; -}>; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import { Config } from '@jest/types'; +export { getTestEnvironment, isJSONString } from './utils'; +export { default as normalize } from './normalize'; +export { default as deprecationEntries } from './Deprecated'; +export { replaceRootDirInPath } from './utils'; +export { default as defaults } from './Defaults'; +export { default as descriptions } from './Descriptions'; +import * as constants from './constants'; +export { constants }; +declare type ReadConfig = { + configPath: Config.Path | null | undefined; + globalConfig: Config.GlobalConfig; + hasDeprecationWarnings: boolean; + projectConfig: Config.ProjectConfig; +}; +export declare function readConfig(argv: Config.Argv, packageRootOrConfig: Config.Path | Config.InitialOptions, skipArgvConfigOption?: boolean, parentConfigPath?: Config.Path | null, projectIndex?: number): Promise; +export declare function readConfigs(argv: Config.Argv, projectPaths: Array): Promise<{ + globalConfig: Config.GlobalConfig; + configs: Array; + hasDeprecationWarnings: boolean; +}>; diff --git a/node_modules/jest-config/build/ts3.4/normalize.d.ts b/node_modules/jest-config/build/ts3.4/normalize.d.ts index 31300b6dd..0a2c63c31 100644 --- a/node_modules/jest-config/build/ts3.4/normalize.d.ts +++ b/node_modules/jest-config/build/ts3.4/normalize.d.ts @@ -1,13 +1,13 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import { Config } from '@jest/types'; -declare type AllOptions = Config.ProjectConfig & Config.GlobalConfig; -export default function normalize(initialOptions: Config.InitialOptions, argv: Config.Argv, configPath?: Config.Path | null, projectIndex?: number): { - hasDeprecationWarnings: boolean; - options: AllOptions; -}; -export {}; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import { Config } from '@jest/types'; +declare type AllOptions = Config.ProjectConfig & Config.GlobalConfig; +export default function normalize(initialOptions: Config.InitialOptions, argv: Config.Argv, configPath?: Config.Path | null, projectIndex?: number): { + hasDeprecationWarnings: boolean; + options: AllOptions; +}; +export {}; diff --git a/node_modules/jest-config/build/ts3.4/readConfigFileAndSetRootDir.d.ts b/node_modules/jest-config/build/ts3.4/readConfigFileAndSetRootDir.d.ts index 34b29c94f..68d5f183e 100644 --- a/node_modules/jest-config/build/ts3.4/readConfigFileAndSetRootDir.d.ts +++ b/node_modules/jest-config/build/ts3.4/readConfigFileAndSetRootDir.d.ts @@ -1,8 +1,8 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import { Config } from '@jest/types'; -export default function readConfigFileAndSetRootDir(configPath: Config.Path): Promise; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import { Config } from '@jest/types'; +export default function readConfigFileAndSetRootDir(configPath: Config.Path): Promise; diff --git a/node_modules/jest-config/build/ts3.4/resolveConfigPath.d.ts b/node_modules/jest-config/build/ts3.4/resolveConfigPath.d.ts index 4dfebc97c..8b65c64d1 100644 --- a/node_modules/jest-config/build/ts3.4/resolveConfigPath.d.ts +++ b/node_modules/jest-config/build/ts3.4/resolveConfigPath.d.ts @@ -1,8 +1,8 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -declare const _default: (pathToResolve: string, cwd: string) => string; -export default _default; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +declare const _default: (pathToResolve: string, cwd: string) => string; +export default _default; diff --git a/node_modules/jest-config/build/ts3.4/setFromArgv.d.ts b/node_modules/jest-config/build/ts3.4/setFromArgv.d.ts index 764ed6cab..9aa83e4be 100644 --- a/node_modules/jest-config/build/ts3.4/setFromArgv.d.ts +++ b/node_modules/jest-config/build/ts3.4/setFromArgv.d.ts @@ -1,8 +1,8 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import { Config } from '@jest/types'; -export default function setFromArgv(options: Config.InitialOptions, argv: Config.Argv): Config.InitialOptions; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import { Config } from '@jest/types'; +export default function setFromArgv(options: Config.InitialOptions, argv: Config.Argv): Config.InitialOptions; diff --git a/node_modules/jest-config/build/ts3.4/utils.d.ts b/node_modules/jest-config/build/ts3.4/utils.d.ts index 6994cdbc0..31c63e10d 100644 --- a/node_modules/jest-config/build/ts3.4/utils.d.ts +++ b/node_modules/jest-config/build/ts3.4/utils.d.ts @@ -1,74 +1,74 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import { Config } from '@jest/types'; -declare type ResolveOptions = { - rootDir: Config.Path; - key: string; - filePath: Config.Path; - optional?: boolean; -}; -export declare const BULLET: string; -export declare const DOCUMENTATION_NOTE: string; -export declare const resolve: (resolver: string | null | undefined, { key, filePath, rootDir, optional }: ResolveOptions) => string; -export declare const escapeGlobCharacters: (path: string) => string; -export declare const replaceRootDirInPath: (rootDir: string, filePath: string) => string; -declare type OrArray = T | Array; -declare type ReplaceRootDirConfigObj = Record; -declare type ReplaceRootDirConfigValues = OrArray | OrArray | OrArray; -export declare const _replaceRootDirTags: (rootDir: string, config: T) => T; -export declare const resolveWithPrefix: (resolver: string | null | undefined, { filePath, humanOptionName, optionName, prefix, rootDir, }: { - filePath: string; - humanOptionName: string; - optionName: string; - prefix: string; - rootDir: string; -}) => string; -/** - * Finds the test environment to use: - * - * 1. looks for jest-environment- relative to project. - * 1. looks for jest-environment- relative to Jest. - * 1. looks for relative to project. - * 1. looks for relative to Jest. - */ -export declare const getTestEnvironment: ({ rootDir, testEnvironment: filePath, }: { - rootDir: string; - testEnvironment: string; -}) => string; -/** - * Finds the watch plugins to use: - * - * 1. looks for jest-watch- relative to project. - * 1. looks for jest-watch- relative to Jest. - * 1. looks for relative to project. - * 1. looks for relative to Jest. - */ -export declare const getWatchPlugin: (resolver: string | null | undefined, { filePath, rootDir }: { - filePath: string; - rootDir: string; -}) => string; -/** - * Finds the runner to use: - * - * 1. looks for jest-runner- relative to project. - * 1. looks for jest-runner- relative to Jest. - * 1. looks for relative to project. - * 1. looks for relative to Jest. - */ -export declare const getRunner: (resolver: string | null | undefined, { filePath, rootDir }: { - filePath: string; - rootDir: string; -}) => string; -declare type JSONString = string & { - readonly $$type: never; -}; -export declare const isJSONString: (text?: string | JSONString | undefined) => text is JSONString; -export declare const getSequencer: (resolver: string | null | undefined, { filePath, rootDir }: { - filePath: string; - rootDir: string; -}) => string; -export {}; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import { Config } from '@jest/types'; +declare type ResolveOptions = { + rootDir: Config.Path; + key: string; + filePath: Config.Path; + optional?: boolean; +}; +export declare const BULLET: string; +export declare const DOCUMENTATION_NOTE: string; +export declare const resolve: (resolver: string | null | undefined, { key, filePath, rootDir, optional }: ResolveOptions) => string; +export declare const escapeGlobCharacters: (path: string) => string; +export declare const replaceRootDirInPath: (rootDir: string, filePath: string) => string; +declare type OrArray = T | Array; +declare type ReplaceRootDirConfigObj = Record; +declare type ReplaceRootDirConfigValues = OrArray | OrArray | OrArray; +export declare const _replaceRootDirTags: (rootDir: string, config: T) => T; +export declare const resolveWithPrefix: (resolver: string | null | undefined, { filePath, humanOptionName, optionName, prefix, rootDir, }: { + filePath: string; + humanOptionName: string; + optionName: string; + prefix: string; + rootDir: string; +}) => string; +/** + * Finds the test environment to use: + * + * 1. looks for jest-environment- relative to project. + * 1. looks for jest-environment- relative to Jest. + * 1. looks for relative to project. + * 1. looks for relative to Jest. + */ +export declare const getTestEnvironment: ({ rootDir, testEnvironment: filePath, }: { + rootDir: string; + testEnvironment: string; +}) => string; +/** + * Finds the watch plugins to use: + * + * 1. looks for jest-watch- relative to project. + * 1. looks for jest-watch- relative to Jest. + * 1. looks for relative to project. + * 1. looks for relative to Jest. + */ +export declare const getWatchPlugin: (resolver: string | null | undefined, { filePath, rootDir }: { + filePath: string; + rootDir: string; +}) => string; +/** + * Finds the runner to use: + * + * 1. looks for jest-runner- relative to project. + * 1. looks for jest-runner- relative to Jest. + * 1. looks for relative to project. + * 1. looks for relative to Jest. + */ +export declare const getRunner: (resolver: string | null | undefined, { filePath, rootDir }: { + filePath: string; + rootDir: string; +}) => string; +declare type JSONString = string & { + readonly $$type: never; +}; +export declare const isJSONString: (text?: string | JSONString | undefined) => text is JSONString; +export declare const getSequencer: (resolver: string | null | undefined, { filePath, rootDir }: { + filePath: string; + rootDir: string; +}) => string; +export {}; diff --git a/node_modules/jest-config/build/ts3.4/validatePattern.d.ts b/node_modules/jest-config/build/ts3.4/validatePattern.d.ts index 8f15207c5..8f8c0746a 100644 --- a/node_modules/jest-config/build/ts3.4/validatePattern.d.ts +++ b/node_modules/jest-config/build/ts3.4/validatePattern.d.ts @@ -1,7 +1,7 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -export default function validatePattern(pattern?: string): boolean; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +export default function validatePattern(pattern?: string): boolean; diff --git a/node_modules/jest-diff/build/ts3.4/cleanupSemantic.d.ts b/node_modules/jest-diff/build/ts3.4/cleanupSemantic.d.ts index bc74b6022..447a3c4e6 100644 --- a/node_modules/jest-diff/build/ts3.4/cleanupSemantic.d.ts +++ b/node_modules/jest-diff/build/ts3.4/cleanupSemantic.d.ts @@ -1,57 +1,57 @@ -/** - * Diff Match and Patch - * Copyright 2018 The diff-match-patch Authors. - * https://github.com/google/diff-match-patch - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * @fileoverview Computes the difference between two texts to create a patch. - * Applies the patch onto another text, allowing for errors. - * @author fraser@google.com (Neil Fraser) - */ -/** - * CHANGES by pedrottimark to diff_match_patch_uncompressed.ts file: - * - * 1. Delete anything not needed to use diff_cleanupSemantic method - * 2. Convert from prototype properties to var declarations - * 3. Convert Diff to class from constructor and prototype - * 4. Add type annotations for arguments and return values - * 5. Add exports - */ -/** - * The data structure representing a diff is an array of tuples: - * [[DIFF_DELETE, 'Hello'], [DIFF_INSERT, 'Goodbye'], [DIFF_EQUAL, ' world.']] - * which means: delete 'Hello', add 'Goodbye' and keep ' world.' - */ -declare var DIFF_DELETE: number; -declare var DIFF_INSERT: number; -declare var DIFF_EQUAL: number; -/** - * Class representing one diff tuple. - * Attempts to look like a two-element array (which is what this used to be). - * @param {number} op Operation, one of: DIFF_DELETE, DIFF_INSERT, DIFF_EQUAL. - * @param {string} text Text to be deleted, inserted, or retained. - * @constructor - */ -declare class Diff { - 0: number; - 1: string; - constructor(op: number, text: string); -} -/** - * Reduce the number of edits by eliminating semantically trivial equalities. - * @param {!Array.} diffs Array of diff tuples. - */ -declare var diff_cleanupSemantic: (diffs: Diff[]) => void; -export { Diff, DIFF_EQUAL, DIFF_DELETE, DIFF_INSERT, diff_cleanupSemantic as cleanupSemantic, }; +/** + * Diff Match and Patch + * Copyright 2018 The diff-match-patch Authors. + * https://github.com/google/diff-match-patch + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * @fileoverview Computes the difference between two texts to create a patch. + * Applies the patch onto another text, allowing for errors. + * @author fraser@google.com (Neil Fraser) + */ +/** + * CHANGES by pedrottimark to diff_match_patch_uncompressed.ts file: + * + * 1. Delete anything not needed to use diff_cleanupSemantic method + * 2. Convert from prototype properties to var declarations + * 3. Convert Diff to class from constructor and prototype + * 4. Add type annotations for arguments and return values + * 5. Add exports + */ +/** + * The data structure representing a diff is an array of tuples: + * [[DIFF_DELETE, 'Hello'], [DIFF_INSERT, 'Goodbye'], [DIFF_EQUAL, ' world.']] + * which means: delete 'Hello', add 'Goodbye' and keep ' world.' + */ +declare var DIFF_DELETE: number; +declare var DIFF_INSERT: number; +declare var DIFF_EQUAL: number; +/** + * Class representing one diff tuple. + * Attempts to look like a two-element array (which is what this used to be). + * @param {number} op Operation, one of: DIFF_DELETE, DIFF_INSERT, DIFF_EQUAL. + * @param {string} text Text to be deleted, inserted, or retained. + * @constructor + */ +declare class Diff { + 0: number; + 1: string; + constructor(op: number, text: string); +} +/** + * Reduce the number of edits by eliminating semantically trivial equalities. + * @param {!Array.} diffs Array of diff tuples. + */ +declare var diff_cleanupSemantic: (diffs: Diff[]) => void; +export { Diff, DIFF_EQUAL, DIFF_DELETE, DIFF_INSERT, diff_cleanupSemantic as cleanupSemantic, }; diff --git a/node_modules/jest-diff/build/ts3.4/constants.d.ts b/node_modules/jest-diff/build/ts3.4/constants.d.ts index c72de0c4e..efd4af425 100644 --- a/node_modules/jest-diff/build/ts3.4/constants.d.ts +++ b/node_modules/jest-diff/build/ts3.4/constants.d.ts @@ -1,8 +1,8 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -export declare const NO_DIFF_MESSAGE: string; -export declare const SIMILAR_MESSAGE: string; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +export declare const NO_DIFF_MESSAGE: string; +export declare const SIMILAR_MESSAGE: string; diff --git a/node_modules/jest-diff/build/ts3.4/diffLines.d.ts b/node_modules/jest-diff/build/ts3.4/diffLines.d.ts index fc861ee65..47b5028c7 100644 --- a/node_modules/jest-diff/build/ts3.4/diffLines.d.ts +++ b/node_modules/jest-diff/build/ts3.4/diffLines.d.ts @@ -1,11 +1,11 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import { Diff } from './cleanupSemantic'; -import { DiffOptions } from './types'; -export declare const diffLinesUnified: (aLines: string[], bLines: string[], options?: DiffOptions | undefined) => string; -export declare const diffLinesUnified2: (aLinesDisplay: string[], bLinesDisplay: string[], aLinesCompare: string[], bLinesCompare: string[], options?: DiffOptions | undefined) => string; -export declare const diffLinesRaw: (aLines: string[], bLines: string[]) => Diff[]; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import { Diff } from './cleanupSemantic'; +import { DiffOptions } from './types'; +export declare const diffLinesUnified: (aLines: string[], bLines: string[], options?: DiffOptions | undefined) => string; +export declare const diffLinesUnified2: (aLinesDisplay: string[], bLinesDisplay: string[], aLinesCompare: string[], bLinesCompare: string[], options?: DiffOptions | undefined) => string; +export declare const diffLinesRaw: (aLines: string[], bLines: string[]) => Diff[]; diff --git a/node_modules/jest-diff/build/ts3.4/diffStrings.d.ts b/node_modules/jest-diff/build/ts3.4/diffStrings.d.ts index 305014ddd..a753cfda4 100644 --- a/node_modules/jest-diff/build/ts3.4/diffStrings.d.ts +++ b/node_modules/jest-diff/build/ts3.4/diffStrings.d.ts @@ -1,9 +1,9 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import { Diff } from './cleanupSemantic'; -declare const diffStrings: (a: string, b: string) => Diff[]; -export default diffStrings; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import { Diff } from './cleanupSemantic'; +declare const diffStrings: (a: string, b: string) => Diff[]; +export default diffStrings; diff --git a/node_modules/jest-diff/build/ts3.4/getAlignedDiffs.d.ts b/node_modules/jest-diff/build/ts3.4/getAlignedDiffs.d.ts index e285c6280..70d83399f 100644 --- a/node_modules/jest-diff/build/ts3.4/getAlignedDiffs.d.ts +++ b/node_modules/jest-diff/build/ts3.4/getAlignedDiffs.d.ts @@ -1,10 +1,10 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import { Diff } from './cleanupSemantic'; -import { DiffOptionsColor } from './types'; -declare const getAlignedDiffs: (diffs: Diff[], changeColor: DiffOptionsColor) => Diff[]; -export default getAlignedDiffs; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import { Diff } from './cleanupSemantic'; +import { DiffOptionsColor } from './types'; +declare const getAlignedDiffs: (diffs: Diff[], changeColor: DiffOptionsColor) => Diff[]; +export default getAlignedDiffs; diff --git a/node_modules/jest-diff/build/ts3.4/index.d.ts b/node_modules/jest-diff/build/ts3.4/index.d.ts index e8e8a28cf..c55cddef0 100644 --- a/node_modules/jest-diff/build/ts3.4/index.d.ts +++ b/node_modules/jest-diff/build/ts3.4/index.d.ts @@ -1,16 +1,16 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import { DIFF_DELETE, DIFF_EQUAL, DIFF_INSERT, Diff } from './cleanupSemantic'; -import { diffLinesRaw, diffLinesUnified, diffLinesUnified2 } from './diffLines'; -import { diffStringsRaw, diffStringsUnified } from './printDiffs'; -import { DiffOptions } from './types'; -export { DiffOptions, DiffOptionsColor } from './types'; -export { diffLinesRaw, diffLinesUnified, diffLinesUnified2 }; -export { diffStringsRaw, diffStringsUnified }; -export { DIFF_DELETE, DIFF_EQUAL, DIFF_INSERT, Diff }; -declare function diff(a: any, b: any, options?: DiffOptions): string | null; -export default diff; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import { DIFF_DELETE, DIFF_EQUAL, DIFF_INSERT, Diff } from './cleanupSemantic'; +import { diffLinesRaw, diffLinesUnified, diffLinesUnified2 } from './diffLines'; +import { diffStringsRaw, diffStringsUnified } from './printDiffs'; +import { DiffOptions } from './types'; +export { DiffOptions, DiffOptionsColor } from './types'; +export { diffLinesRaw, diffLinesUnified, diffLinesUnified2 }; +export { diffStringsRaw, diffStringsUnified }; +export { DIFF_DELETE, DIFF_EQUAL, DIFF_INSERT, Diff }; +declare function diff(a: any, b: any, options?: DiffOptions): string | null; +export default diff; diff --git a/node_modules/jest-diff/build/ts3.4/joinAlignedDiffs.d.ts b/node_modules/jest-diff/build/ts3.4/joinAlignedDiffs.d.ts index ad17f08f2..bd7dc997f 100644 --- a/node_modules/jest-diff/build/ts3.4/joinAlignedDiffs.d.ts +++ b/node_modules/jest-diff/build/ts3.4/joinAlignedDiffs.d.ts @@ -1,10 +1,10 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import { Diff } from './cleanupSemantic'; -import { DiffOptionsNormalized } from './types'; -export declare const joinAlignedDiffsNoExpand: (diffs: Diff[], options: DiffOptionsNormalized) => string; -export declare const joinAlignedDiffsExpand: (diffs: Diff[], options: DiffOptionsNormalized) => string; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import { Diff } from './cleanupSemantic'; +import { DiffOptionsNormalized } from './types'; +export declare const joinAlignedDiffsNoExpand: (diffs: Diff[], options: DiffOptionsNormalized) => string; +export declare const joinAlignedDiffsExpand: (diffs: Diff[], options: DiffOptionsNormalized) => string; diff --git a/node_modules/jest-diff/build/ts3.4/normalizeDiffOptions.d.ts b/node_modules/jest-diff/build/ts3.4/normalizeDiffOptions.d.ts index 1ef9fee0f..8d17b229a 100644 --- a/node_modules/jest-diff/build/ts3.4/normalizeDiffOptions.d.ts +++ b/node_modules/jest-diff/build/ts3.4/normalizeDiffOptions.d.ts @@ -1,9 +1,9 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import { DiffOptions, DiffOptionsNormalized } from './types'; -export declare const noColor: (string: string) => string; -export declare const normalizeDiffOptions: (options?: DiffOptions) => DiffOptionsNormalized; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import { DiffOptions, DiffOptionsNormalized } from './types'; +export declare const noColor: (string: string) => string; +export declare const normalizeDiffOptions: (options?: DiffOptions) => DiffOptionsNormalized; diff --git a/node_modules/jest-diff/build/ts3.4/printDiffs.d.ts b/node_modules/jest-diff/build/ts3.4/printDiffs.d.ts index 04193fca3..7d6e29908 100644 --- a/node_modules/jest-diff/build/ts3.4/printDiffs.d.ts +++ b/node_modules/jest-diff/build/ts3.4/printDiffs.d.ts @@ -1,22 +1,22 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import { Diff } from './cleanupSemantic'; -import { DiffOptions, DiffOptionsNormalized } from './types'; -export declare const printDeleteLine: (line: string, isFirstOrLast: boolean, { aColor, aIndicator, changeLineTrailingSpaceColor, emptyFirstOrLastLinePlaceholder, }: DiffOptionsNormalized) => string; -export declare const printInsertLine: (line: string, isFirstOrLast: boolean, { bColor, bIndicator, changeLineTrailingSpaceColor, emptyFirstOrLastLinePlaceholder, }: DiffOptionsNormalized) => string; -export declare const printCommonLine: (line: string, isFirstOrLast: boolean, { commonColor, commonIndicator, commonLineTrailingSpaceColor, emptyFirstOrLastLinePlaceholder, }: DiffOptionsNormalized) => string; -export declare const hasCommonDiff: (diffs: Diff[], isMultiline: boolean) => boolean; -export declare type ChangeCounts = { - a: number; - b: number; -}; -export declare const countChanges: (diffs: Diff[]) => ChangeCounts; -export declare const printAnnotation: ({ aAnnotation, aColor, aIndicator, bAnnotation, bColor, bIndicator, includeChangeCounts, omitAnnotationLines, }: DiffOptionsNormalized, changeCounts: ChangeCounts) => string; -export declare const printDiffLines: (diffs: Diff[], options: DiffOptionsNormalized) => string; -export declare const createPatchMark: (aStart: number, aEnd: number, bStart: number, bEnd: number, { patchColor }: DiffOptionsNormalized) => string; -export declare const diffStringsUnified: (a: string, b: string, options?: DiffOptions | undefined) => string; -export declare const diffStringsRaw: (a: string, b: string, cleanup: boolean) => Diff[]; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import { Diff } from './cleanupSemantic'; +import { DiffOptions, DiffOptionsNormalized } from './types'; +export declare const printDeleteLine: (line: string, isFirstOrLast: boolean, { aColor, aIndicator, changeLineTrailingSpaceColor, emptyFirstOrLastLinePlaceholder, }: DiffOptionsNormalized) => string; +export declare const printInsertLine: (line: string, isFirstOrLast: boolean, { bColor, bIndicator, changeLineTrailingSpaceColor, emptyFirstOrLastLinePlaceholder, }: DiffOptionsNormalized) => string; +export declare const printCommonLine: (line: string, isFirstOrLast: boolean, { commonColor, commonIndicator, commonLineTrailingSpaceColor, emptyFirstOrLastLinePlaceholder, }: DiffOptionsNormalized) => string; +export declare const hasCommonDiff: (diffs: Diff[], isMultiline: boolean) => boolean; +export declare type ChangeCounts = { + a: number; + b: number; +}; +export declare const countChanges: (diffs: Diff[]) => ChangeCounts; +export declare const printAnnotation: ({ aAnnotation, aColor, aIndicator, bAnnotation, bColor, bIndicator, includeChangeCounts, omitAnnotationLines, }: DiffOptionsNormalized, changeCounts: ChangeCounts) => string; +export declare const printDiffLines: (diffs: Diff[], options: DiffOptionsNormalized) => string; +export declare const createPatchMark: (aStart: number, aEnd: number, bStart: number, bEnd: number, { patchColor }: DiffOptionsNormalized) => string; +export declare const diffStringsUnified: (a: string, b: string, options?: DiffOptions | undefined) => string; +export declare const diffStringsRaw: (a: string, b: string, cleanup: boolean) => Diff[]; diff --git a/node_modules/jest-diff/build/ts3.4/types.d.ts b/node_modules/jest-diff/build/ts3.4/types.d.ts index 03e476d31..9a6f6c90e 100644 --- a/node_modules/jest-diff/build/ts3.4/types.d.ts +++ b/node_modules/jest-diff/build/ts3.4/types.d.ts @@ -1,45 +1,45 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -export declare type DiffOptionsColor = (arg: string) => string; -export declare type DiffOptions = { - aAnnotation?: string; - aColor?: DiffOptionsColor; - aIndicator?: string; - bAnnotation?: string; - bColor?: DiffOptionsColor; - bIndicator?: string; - changeColor?: DiffOptionsColor; - changeLineTrailingSpaceColor?: DiffOptionsColor; - commonColor?: DiffOptionsColor; - commonIndicator?: string; - commonLineTrailingSpaceColor?: DiffOptionsColor; - contextLines?: number; - emptyFirstOrLastLinePlaceholder?: string; - expand?: boolean; - includeChangeCounts?: boolean; - omitAnnotationLines?: boolean; - patchColor?: DiffOptionsColor; -}; -export declare type DiffOptionsNormalized = { - aAnnotation: string; - aColor: DiffOptionsColor; - aIndicator: string; - bAnnotation: string; - bColor: DiffOptionsColor; - bIndicator: string; - changeColor: DiffOptionsColor; - changeLineTrailingSpaceColor: DiffOptionsColor; - commonColor: DiffOptionsColor; - commonIndicator: string; - commonLineTrailingSpaceColor: DiffOptionsColor; - contextLines: number; - emptyFirstOrLastLinePlaceholder: string; - expand: boolean; - includeChangeCounts: boolean; - omitAnnotationLines: boolean; - patchColor: DiffOptionsColor; -}; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +export declare type DiffOptionsColor = (arg: string) => string; +export declare type DiffOptions = { + aAnnotation?: string; + aColor?: DiffOptionsColor; + aIndicator?: string; + bAnnotation?: string; + bColor?: DiffOptionsColor; + bIndicator?: string; + changeColor?: DiffOptionsColor; + changeLineTrailingSpaceColor?: DiffOptionsColor; + commonColor?: DiffOptionsColor; + commonIndicator?: string; + commonLineTrailingSpaceColor?: DiffOptionsColor; + contextLines?: number; + emptyFirstOrLastLinePlaceholder?: string; + expand?: boolean; + includeChangeCounts?: boolean; + omitAnnotationLines?: boolean; + patchColor?: DiffOptionsColor; +}; +export declare type DiffOptionsNormalized = { + aAnnotation: string; + aColor: DiffOptionsColor; + aIndicator: string; + bAnnotation: string; + bColor: DiffOptionsColor; + bIndicator: string; + changeColor: DiffOptionsColor; + changeLineTrailingSpaceColor: DiffOptionsColor; + commonColor: DiffOptionsColor; + commonIndicator: string; + commonLineTrailingSpaceColor: DiffOptionsColor; + contextLines: number; + emptyFirstOrLastLinePlaceholder: string; + expand: boolean; + includeChangeCounts: boolean; + omitAnnotationLines: boolean; + patchColor: DiffOptionsColor; +}; diff --git a/node_modules/jest-docblock/build/ts3.4/index.d.ts b/node_modules/jest-docblock/build/ts3.4/index.d.ts index 1bdd2d42b..3f3d67840 100644 --- a/node_modules/jest-docblock/build/ts3.4/index.d.ts +++ b/node_modules/jest-docblock/build/ts3.4/index.d.ts @@ -1,20 +1,20 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -declare type Pragmas = Record>; -export declare function extract(contents: string): string; -export declare function strip(contents: string): string; -export declare function parse(docblock: string): Pragmas; -export declare function parseWithComments(docblock: string): { - comments: string; - pragmas: Pragmas; -}; -export declare function print({ comments, pragmas, }: { - comments?: string; - pragmas?: Pragmas; -}): string; -export {}; -//# sourceMappingURL=index.d.ts.map +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +declare type Pragmas = Record>; +export declare function extract(contents: string): string; +export declare function strip(contents: string): string; +export declare function parse(docblock: string): Pragmas; +export declare function parseWithComments(docblock: string): { + comments: string; + pragmas: Pragmas; +}; +export declare function print({ comments, pragmas, }: { + comments?: string; + pragmas?: Pragmas; +}): string; +export {}; +//# sourceMappingURL=index.d.ts.map diff --git a/node_modules/jest-each/build/ts3.4/bind.d.ts b/node_modules/jest-each/build/ts3.4/bind.d.ts index 3cff61acb..928c823eb 100644 --- a/node_modules/jest-each/build/ts3.4/bind.d.ts +++ b/node_modules/jest-each/build/ts3.4/bind.d.ts @@ -1,16 +1,16 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ -import { Global } from '@jest/types'; -export declare type EachTests = Array<{ - title: string; - arguments: Array; -}>; -declare type TestFn = (done?: Global.DoneFn) => Promise | void | undefined; -declare type GlobalCallback = (testName: string, fn: TestFn, timeout?: number) => void; -declare const _default: (cb: GlobalCallback, supportsDone?: boolean) => (table: Global.EachTable, ...taggedTemplateData: Global.TemplateData) => (title: string, test: Global.EachTestFn, timeout?: number | undefined) => void; -export default _default; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + */ +import { Global } from '@jest/types'; +export declare type EachTests = Array<{ + title: string; + arguments: Array; +}>; +declare type TestFn = (done?: Global.DoneFn) => Promise | void | undefined; +declare type GlobalCallback = (testName: string, fn: TestFn, timeout?: number) => void; +declare const _default: (cb: GlobalCallback, supportsDone?: boolean) => (table: Global.EachTable, ...taggedTemplateData: Global.TemplateData) => (title: string, test: Global.EachTestFn, timeout?: number | undefined) => void; +export default _default; diff --git a/node_modules/jest-each/build/ts3.4/index.d.ts b/node_modules/jest-each/build/ts3.4/index.d.ts index cae05841a..86d900ed3 100644 --- a/node_modules/jest-each/build/ts3.4/index.d.ts +++ b/node_modules/jest-each/build/ts3.4/index.d.ts @@ -1,58 +1,58 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ -import { Global } from '@jest/types'; -import bind from './bind'; -declare type Global = Global.Global; -declare const each: { - (table: Global.EachTable, ...data: Global.TemplateData): { - describe: { - (title: string, suite: Global.EachTestFn, timeout?: number | undefined): void; - skip: (title: string, test: Global.EachTestFn, timeout?: number | undefined) => void; - only: (title: string, test: Global.EachTestFn, timeout?: number | undefined) => void; - }; - fdescribe: (title: string, test: Global.EachTestFn, timeout?: number | undefined) => void; - fit: (title: string, test: Global.EachTestFn, timeout?: number | undefined) => void; - it: { - (title: string, test: Global.EachTestFn, timeout?: number | undefined): void; - skip: (title: string, test: Global.EachTestFn, timeout?: number | undefined) => void; - only: (title: string, test: Global.EachTestFn, timeout?: number | undefined) => void; - }; - test: { - (title: string, test: Global.EachTestFn, timeout?: number | undefined): void; - skip: (title: string, test: Global.EachTestFn, timeout?: number | undefined) => void; - only: (title: string, test: Global.EachTestFn, timeout?: number | undefined) => void; - }; - xdescribe: (title: string, test: Global.EachTestFn, timeout?: number | undefined) => void; - xit: (title: string, test: Global.EachTestFn, timeout?: number | undefined) => void; - xtest: (title: string, test: Global.EachTestFn, timeout?: number | undefined) => void; - }; - withGlobal(g: Global.Global): (table: Global.EachTable, ...data: Global.TemplateData) => { - describe: { - (title: string, suite: Global.EachTestFn, timeout?: number | undefined): void; - skip: (title: string, test: Global.EachTestFn, timeout?: number | undefined) => void; - only: (title: string, test: Global.EachTestFn, timeout?: number | undefined) => void; - }; - fdescribe: (title: string, test: Global.EachTestFn, timeout?: number | undefined) => void; - fit: (title: string, test: Global.EachTestFn, timeout?: number | undefined) => void; - it: { - (title: string, test: Global.EachTestFn, timeout?: number | undefined): void; - skip: (title: string, test: Global.EachTestFn, timeout?: number | undefined) => void; - only: (title: string, test: Global.EachTestFn, timeout?: number | undefined) => void; - }; - test: { - (title: string, test: Global.EachTestFn, timeout?: number | undefined): void; - skip: (title: string, test: Global.EachTestFn, timeout?: number | undefined) => void; - only: (title: string, test: Global.EachTestFn, timeout?: number | undefined) => void; - }; - xdescribe: (title: string, test: Global.EachTestFn, timeout?: number | undefined) => void; - xit: (title: string, test: Global.EachTestFn, timeout?: number | undefined) => void; - xtest: (title: string, test: Global.EachTestFn, timeout?: number | undefined) => void; - }; -}; -export { bind }; -export default each; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + */ +import { Global } from '@jest/types'; +import bind from './bind'; +declare type Global = Global.Global; +declare const each: { + (table: Global.EachTable, ...data: Global.TemplateData): { + describe: { + (title: string, suite: Global.EachTestFn, timeout?: number | undefined): void; + skip: (title: string, test: Global.EachTestFn, timeout?: number | undefined) => void; + only: (title: string, test: Global.EachTestFn, timeout?: number | undefined) => void; + }; + fdescribe: (title: string, test: Global.EachTestFn, timeout?: number | undefined) => void; + fit: (title: string, test: Global.EachTestFn, timeout?: number | undefined) => void; + it: { + (title: string, test: Global.EachTestFn, timeout?: number | undefined): void; + skip: (title: string, test: Global.EachTestFn, timeout?: number | undefined) => void; + only: (title: string, test: Global.EachTestFn, timeout?: number | undefined) => void; + }; + test: { + (title: string, test: Global.EachTestFn, timeout?: number | undefined): void; + skip: (title: string, test: Global.EachTestFn, timeout?: number | undefined) => void; + only: (title: string, test: Global.EachTestFn, timeout?: number | undefined) => void; + }; + xdescribe: (title: string, test: Global.EachTestFn, timeout?: number | undefined) => void; + xit: (title: string, test: Global.EachTestFn, timeout?: number | undefined) => void; + xtest: (title: string, test: Global.EachTestFn, timeout?: number | undefined) => void; + }; + withGlobal(g: Global.Global): (table: Global.EachTable, ...data: Global.TemplateData) => { + describe: { + (title: string, suite: Global.EachTestFn, timeout?: number | undefined): void; + skip: (title: string, test: Global.EachTestFn, timeout?: number | undefined) => void; + only: (title: string, test: Global.EachTestFn, timeout?: number | undefined) => void; + }; + fdescribe: (title: string, test: Global.EachTestFn, timeout?: number | undefined) => void; + fit: (title: string, test: Global.EachTestFn, timeout?: number | undefined) => void; + it: { + (title: string, test: Global.EachTestFn, timeout?: number | undefined): void; + skip: (title: string, test: Global.EachTestFn, timeout?: number | undefined) => void; + only: (title: string, test: Global.EachTestFn, timeout?: number | undefined) => void; + }; + test: { + (title: string, test: Global.EachTestFn, timeout?: number | undefined): void; + skip: (title: string, test: Global.EachTestFn, timeout?: number | undefined) => void; + only: (title: string, test: Global.EachTestFn, timeout?: number | undefined) => void; + }; + xdescribe: (title: string, test: Global.EachTestFn, timeout?: number | undefined) => void; + xit: (title: string, test: Global.EachTestFn, timeout?: number | undefined) => void; + xtest: (title: string, test: Global.EachTestFn, timeout?: number | undefined) => void; + }; +}; +export { bind }; +export default each; diff --git a/node_modules/jest-each/build/ts3.4/table/array.d.ts b/node_modules/jest-each/build/ts3.4/table/array.d.ts index ac761bc72..8729dfdff 100644 --- a/node_modules/jest-each/build/ts3.4/table/array.d.ts +++ b/node_modules/jest-each/build/ts3.4/table/array.d.ts @@ -1,11 +1,11 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ -import { Global } from '@jest/types'; -import { EachTests } from '../bind'; -declare const _default: (title: string, arrayTable: Global.ArrayTable) => EachTests; -export default _default; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + */ +import { Global } from '@jest/types'; +import { EachTests } from '../bind'; +declare const _default: (title: string, arrayTable: Global.ArrayTable) => EachTests; +export default _default; diff --git a/node_modules/jest-each/build/ts3.4/table/template.d.ts b/node_modules/jest-each/build/ts3.4/table/template.d.ts index febcc916b..202f055ee 100644 --- a/node_modules/jest-each/build/ts3.4/table/template.d.ts +++ b/node_modules/jest-each/build/ts3.4/table/template.d.ts @@ -1,19 +1,19 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ -import { Global } from '@jest/types'; -import { EachTests } from '../bind'; -declare type Template = Record; -declare type Headings = Array; -declare const _default: (title: string, headings: Headings, row: Global.Row) => EachTests; -export default _default; -export declare function getPath(obj: Obj, path: [A, B, C, D, E]): Obj[A][B][C][D][E]; -export declare function getPath(obj: Obj, path: [A, B, C, D]): Obj[A][B][C][D]; -export declare function getPath(obj: Obj, path: [A, B, C]): Obj[A][B][C]; -export declare function getPath(obj: Obj, path: [A, B]): Obj[A][B]; -export declare function getPath(obj: Obj, path: [A]): Obj[A]; -export declare function getPath(obj: Obj, path: Array): unknown; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + */ +import { Global } from '@jest/types'; +import { EachTests } from '../bind'; +declare type Template = Record; +declare type Headings = Array; +declare const _default: (title: string, headings: Headings, row: Global.Row) => EachTests; +export default _default; +export declare function getPath(obj: Obj, path: [A, B, C, D, E]): Obj[A][B][C][D][E]; +export declare function getPath(obj: Obj, path: [A, B, C, D]): Obj[A][B][C][D]; +export declare function getPath(obj: Obj, path: [A, B, C]): Obj[A][B][C]; +export declare function getPath(obj: Obj, path: [A, B]): Obj[A][B]; +export declare function getPath(obj: Obj, path: [A]): Obj[A]; +export declare function getPath(obj: Obj, path: Array): unknown; diff --git a/node_modules/jest-each/build/ts3.4/validation.d.ts b/node_modules/jest-each/build/ts3.4/validation.d.ts index c064799a0..41aea0d91 100644 --- a/node_modules/jest-each/build/ts3.4/validation.d.ts +++ b/node_modules/jest-each/build/ts3.4/validation.d.ts @@ -1,10 +1,10 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ -import { Global } from '@jest/types'; -export declare const validateArrayTable: (table: unknown) => void; -export declare const validateTemplateTableHeadings: (headings: string[], data: Global.TemplateData) => void; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + */ +import { Global } from '@jest/types'; +export declare const validateArrayTable: (table: unknown) => void; +export declare const validateTemplateTableHeadings: (headings: string[], data: Global.TemplateData) => void; diff --git a/node_modules/jest-environment-jsdom/build/ts3.4/index.d.ts b/node_modules/jest-environment-jsdom/build/ts3.4/index.d.ts index b5284f697..7b1b22a8e 100644 --- a/node_modules/jest-environment-jsdom/build/ts3.4/index.d.ts +++ b/node_modules/jest-environment-jsdom/build/ts3.4/index.d.ts @@ -1,34 +1,34 @@ -/// -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -/// -import { Script } from 'vm'; -import { Config, Global } from '@jest/types'; -import { ModuleMocker } from 'jest-mock'; -import { JestFakeTimers as LegacyFakeTimers, LolexFakeTimers } from '@jest/fake-timers'; -import { EnvironmentContext, JestEnvironment } from '@jest/environment'; -import { JSDOM } from 'jsdom'; -declare type Win = Window & Global.Global & { - Error: { - stackTraceLimit: number; - }; -}; -declare class JSDOMEnvironment implements JestEnvironment { - dom: JSDOM | null; - fakeTimers: LegacyFakeTimers | null; - fakeTimersLolex: LolexFakeTimers | null; - global: Win; - errorEventListener: ((event: Event & { - error: Error; - }) => void) | null; - moduleMocker: ModuleMocker | null; - constructor(config: Config.ProjectConfig, options?: EnvironmentContext); - setup(): Promise; - teardown(): Promise; - runScript(script: Script): T | null; -} -export = JSDOMEnvironment; +/// +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +/// +import { Script } from 'vm'; +import { Config, Global } from '@jest/types'; +import { ModuleMocker } from 'jest-mock'; +import { JestFakeTimers as LegacyFakeTimers, LolexFakeTimers } from '@jest/fake-timers'; +import { EnvironmentContext, JestEnvironment } from '@jest/environment'; +import { JSDOM } from 'jsdom'; +declare type Win = Window & Global.Global & { + Error: { + stackTraceLimit: number; + }; +}; +declare class JSDOMEnvironment implements JestEnvironment { + dom: JSDOM | null; + fakeTimers: LegacyFakeTimers | null; + fakeTimersLolex: LolexFakeTimers | null; + global: Win; + errorEventListener: ((event: Event & { + error: Error; + }) => void) | null; + moduleMocker: ModuleMocker | null; + constructor(config: Config.ProjectConfig, options?: EnvironmentContext); + setup(): Promise; + teardown(): Promise; + runScript(script: Script): T | null; +} +export = JSDOMEnvironment; diff --git a/node_modules/jest-environment-node/build/ts3.4/index.d.ts b/node_modules/jest-environment-node/build/ts3.4/index.d.ts index eeb616401..4ebfa1949 100644 --- a/node_modules/jest-environment-node/build/ts3.4/index.d.ts +++ b/node_modules/jest-environment-node/build/ts3.4/index.d.ts @@ -1,31 +1,31 @@ -/// -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -/// -import { Context, Script } from 'vm'; -import { Config, Global } from '@jest/types'; -import { ModuleMocker } from 'jest-mock'; -import { JestFakeTimers as LegacyFakeTimers, LolexFakeTimers } from '@jest/fake-timers'; -import { JestEnvironment } from '@jest/environment'; -declare type Timer = { - id: number; - ref: () => Timer; - unref: () => Timer; -}; -declare class NodeEnvironment implements JestEnvironment { - context: Context | null; - fakeTimers: LegacyFakeTimers | null; - fakeTimersLolex: LolexFakeTimers | null; - global: Global.Global; - moduleMocker: ModuleMocker | null; - constructor(config: Config.ProjectConfig); - setup(): Promise; - teardown(): Promise; - runScript(script: Script): T | null; - getVmContext(): Context | null; -} -export = NodeEnvironment; +/// +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +/// +import { Context, Script } from 'vm'; +import { Config, Global } from '@jest/types'; +import { ModuleMocker } from 'jest-mock'; +import { JestFakeTimers as LegacyFakeTimers, LolexFakeTimers } from '@jest/fake-timers'; +import { JestEnvironment } from '@jest/environment'; +declare type Timer = { + id: number; + ref: () => Timer; + unref: () => Timer; +}; +declare class NodeEnvironment implements JestEnvironment { + context: Context | null; + fakeTimers: LegacyFakeTimers | null; + fakeTimersLolex: LolexFakeTimers | null; + global: Global.Global; + moduleMocker: ModuleMocker | null; + constructor(config: Config.ProjectConfig); + setup(): Promise; + teardown(): Promise; + runScript(script: Script): T | null; + getVmContext(): Context | null; +} +export = NodeEnvironment; diff --git a/node_modules/jest-get-type/build/ts3.4/index.d.ts b/node_modules/jest-get-type/build/ts3.4/index.d.ts index f31d124eb..ceeabdd20 100644 --- a/node_modules/jest-get-type/build/ts3.4/index.d.ts +++ b/node_modules/jest-get-type/build/ts3.4/index.d.ts @@ -1,13 +1,13 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -declare type ValueType = 'array' | 'bigint' | 'boolean' | 'function' | 'null' | 'number' | 'object' | 'regexp' | 'map' | 'set' | 'date' | 'string' | 'symbol' | 'undefined'; -declare function getType(value: unknown): ValueType; -declare namespace getType { - var isPrimitive: (value: unknown) => boolean; -} -export = getType; -//# sourceMappingURL=index.d.ts.map +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +declare type ValueType = 'array' | 'bigint' | 'boolean' | 'function' | 'null' | 'number' | 'object' | 'regexp' | 'map' | 'set' | 'date' | 'string' | 'symbol' | 'undefined'; +declare function getType(value: unknown): ValueType; +declare namespace getType { + var isPrimitive: (value: unknown) => boolean; +} +export = getType; +//# sourceMappingURL=index.d.ts.map diff --git a/node_modules/jest-haste-map/build/ts3.4/HasteFS.d.ts b/node_modules/jest-haste-map/build/ts3.4/HasteFS.d.ts index 8dc77e299..8b59b9b35 100644 --- a/node_modules/jest-haste-map/build/ts3.4/HasteFS.d.ts +++ b/node_modules/jest-haste-map/build/ts3.4/HasteFS.d.ts @@ -1,27 +1,27 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import { Config } from '@jest/types'; -import { FileData } from './types'; -export default class HasteFS { - private readonly _rootDir; - private readonly _files; - constructor({ rootDir, files }: { - rootDir: Config.Path; - files: FileData; - }); - getModuleName(file: Config.Path): string | null; - getSize(file: Config.Path): number | null; - getDependencies(file: Config.Path): Array | null; - getSha1(file: Config.Path): string | null; - exists(file: Config.Path): boolean; - getAllFiles(): Array; - getFileIterator(): Iterable; - getAbsoluteFileIterator(): Iterable; - matchFiles(pattern: RegExp | string): Array; - matchFilesWithGlob(globs: Array, root: Config.Path | null): Set; - private _getFileData; -} +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import { Config } from '@jest/types'; +import { FileData } from './types'; +export default class HasteFS { + private readonly _rootDir; + private readonly _files; + constructor({ rootDir, files }: { + rootDir: Config.Path; + files: FileData; + }); + getModuleName(file: Config.Path): string | null; + getSize(file: Config.Path): number | null; + getDependencies(file: Config.Path): Array | null; + getSha1(file: Config.Path): string | null; + exists(file: Config.Path): boolean; + getAllFiles(): Array; + getFileIterator(): Iterable; + getAbsoluteFileIterator(): Iterable; + matchFiles(pattern: RegExp | string): Array; + matchFilesWithGlob(globs: Array, root: Config.Path | null): Set; + private _getFileData; +} diff --git a/node_modules/jest-haste-map/build/ts3.4/ModuleMap.d.ts b/node_modules/jest-haste-map/build/ts3.4/ModuleMap.d.ts index bb1466a8b..d15ece8be 100644 --- a/node_modules/jest-haste-map/build/ts3.4/ModuleMap.d.ts +++ b/node_modules/jest-haste-map/build/ts3.4/ModuleMap.d.ts @@ -1,48 +1,48 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import { Config } from '@jest/types'; -import { DuplicatesSet, HTypeValue, MockData, ModuleMapData, RawModuleMap } from './types'; -declare type ValueType = T extends Map ? V : never; -export declare type SerializableModuleMap = { - duplicates: ReadonlyArray<[string, [string, [string, [string, number]]]]>; - map: ReadonlyArray<[string, ValueType]>; - mocks: ReadonlyArray<[string, ValueType]>; - rootDir: Config.Path; -}; -export default class ModuleMap { - static DuplicateHasteCandidatesError: typeof DuplicateHasteCandidatesError; - private readonly _raw; - private json; - private static mapToArrayRecursive; - private static mapFromArrayRecursive; - constructor(raw: RawModuleMap); - getModule(name: string, platform?: string | null, supportsNativePlatform?: boolean | null, type?: HTypeValue | null): Config.Path | null; - getPackage(name: string, platform: string | null | undefined, _supportsNativePlatform: boolean | null): Config.Path | null; - getMockModule(name: string): Config.Path | undefined; - getRawModuleMap(): RawModuleMap; - toJSON(): SerializableModuleMap; - static fromJSON(serializableModuleMap: SerializableModuleMap): ModuleMap; - /** - * When looking up a module's data, we walk through each eligible platform for - * the query. For each platform, we want to check if there are known - * duplicates for that name+platform pair. The duplication logic normally - * removes elements from the `map` object, but we want to check upfront to be - * extra sure. If metadata exists both in the `duplicates` object and the - * `map`, this would be a bug. - */ - private _getModuleMetadata; - private _assertNoDuplicates; - static create(rootDir: Config.Path): ModuleMap; -} -declare class DuplicateHasteCandidatesError extends Error { - hasteName: string; - platform: string | null; - supportsNativePlatform: boolean; - duplicatesSet: DuplicatesSet; - constructor(name: string, platform: string, supportsNativePlatform: boolean, duplicatesSet: DuplicatesSet); -} -export {}; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import { Config } from '@jest/types'; +import { DuplicatesSet, HTypeValue, MockData, ModuleMapData, RawModuleMap } from './types'; +declare type ValueType = T extends Map ? V : never; +export declare type SerializableModuleMap = { + duplicates: ReadonlyArray<[string, [string, [string, [string, number]]]]>; + map: ReadonlyArray<[string, ValueType]>; + mocks: ReadonlyArray<[string, ValueType]>; + rootDir: Config.Path; +}; +export default class ModuleMap { + static DuplicateHasteCandidatesError: typeof DuplicateHasteCandidatesError; + private readonly _raw; + private json; + private static mapToArrayRecursive; + private static mapFromArrayRecursive; + constructor(raw: RawModuleMap); + getModule(name: string, platform?: string | null, supportsNativePlatform?: boolean | null, type?: HTypeValue | null): Config.Path | null; + getPackage(name: string, platform: string | null | undefined, _supportsNativePlatform: boolean | null): Config.Path | null; + getMockModule(name: string): Config.Path | undefined; + getRawModuleMap(): RawModuleMap; + toJSON(): SerializableModuleMap; + static fromJSON(serializableModuleMap: SerializableModuleMap): ModuleMap; + /** + * When looking up a module's data, we walk through each eligible platform for + * the query. For each platform, we want to check if there are known + * duplicates for that name+platform pair. The duplication logic normally + * removes elements from the `map` object, but we want to check upfront to be + * extra sure. If metadata exists both in the `duplicates` object and the + * `map`, this would be a bug. + */ + private _getModuleMetadata; + private _assertNoDuplicates; + static create(rootDir: Config.Path): ModuleMap; +} +declare class DuplicateHasteCandidatesError extends Error { + hasteName: string; + platform: string | null; + supportsNativePlatform: boolean; + duplicatesSet: DuplicatesSet; + constructor(name: string, platform: string, supportsNativePlatform: boolean, duplicatesSet: DuplicatesSet); +} +export {}; diff --git a/node_modules/jest-haste-map/build/ts3.4/blacklist.d.ts b/node_modules/jest-haste-map/build/ts3.4/blacklist.d.ts index c29223113..3e4b6d28e 100644 --- a/node_modules/jest-haste-map/build/ts3.4/blacklist.d.ts +++ b/node_modules/jest-haste-map/build/ts3.4/blacklist.d.ts @@ -1,8 +1,8 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -declare const extensions: Set; -export default extensions; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +declare const extensions: Set; +export default extensions; diff --git a/node_modules/jest-haste-map/build/ts3.4/constants.d.ts b/node_modules/jest-haste-map/build/ts3.4/constants.d.ts index 2a1f63d88..dc7c09aba 100644 --- a/node_modules/jest-haste-map/build/ts3.4/constants.d.ts +++ b/node_modules/jest-haste-map/build/ts3.4/constants.d.ts @@ -1,9 +1,9 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import { HType } from './types'; -declare const constants: HType; -export default constants; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import { HType } from './types'; +declare const constants: HType; +export default constants; diff --git a/node_modules/jest-haste-map/build/ts3.4/crawlers/node.d.ts b/node_modules/jest-haste-map/build/ts3.4/crawlers/node.d.ts index edb972a98..352296ca6 100644 --- a/node_modules/jest-haste-map/build/ts3.4/crawlers/node.d.ts +++ b/node_modules/jest-haste-map/build/ts3.4/crawlers/node.d.ts @@ -1,12 +1,12 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import { CrawlerOptions, FileData, InternalHasteMap } from '../types'; -declare const _default: (options: CrawlerOptions) => Promise<{ - removedFiles: FileData; - hasteMap: InternalHasteMap; -}>; -export = _default; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import { CrawlerOptions, FileData, InternalHasteMap } from '../types'; +declare const _default: (options: CrawlerOptions) => Promise<{ + removedFiles: FileData; + hasteMap: InternalHasteMap; +}>; +export = _default; diff --git a/node_modules/jest-haste-map/build/ts3.4/crawlers/watchman.d.ts b/node_modules/jest-haste-map/build/ts3.4/crawlers/watchman.d.ts index cbf507e20..b1ddb443b 100644 --- a/node_modules/jest-haste-map/build/ts3.4/crawlers/watchman.d.ts +++ b/node_modules/jest-haste-map/build/ts3.4/crawlers/watchman.d.ts @@ -1,13 +1,13 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import { CrawlerOptions, FileData, InternalHasteMap } from '../types'; -declare const _default: (options: CrawlerOptions) => Promise<{ - changedFiles?: FileData | undefined; - removedFiles: FileData; - hasteMap: InternalHasteMap; -}>; -export = _default; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import { CrawlerOptions, FileData, InternalHasteMap } from '../types'; +declare const _default: (options: CrawlerOptions) => Promise<{ + changedFiles?: FileData | undefined; + removedFiles: FileData; + hasteMap: InternalHasteMap; +}>; +export = _default; diff --git a/node_modules/jest-haste-map/build/ts3.4/getMockName.d.ts b/node_modules/jest-haste-map/build/ts3.4/getMockName.d.ts index dbd08cd16..befc2f3f0 100644 --- a/node_modules/jest-haste-map/build/ts3.4/getMockName.d.ts +++ b/node_modules/jest-haste-map/build/ts3.4/getMockName.d.ts @@ -1,8 +1,8 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -declare const getMockName: (filePath: string) => string; -export default getMockName; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +declare const getMockName: (filePath: string) => string; +export default getMockName; diff --git a/node_modules/jest-haste-map/build/ts3.4/index.d.ts b/node_modules/jest-haste-map/build/ts3.4/index.d.ts index 75cd9b296..c141aab5e 100644 --- a/node_modules/jest-haste-map/build/ts3.4/index.d.ts +++ b/node_modules/jest-haste-map/build/ts3.4/index.d.ts @@ -1,191 +1,191 @@ -/// -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -/// -import { EventEmitter } from 'events'; -import { Config } from '@jest/types'; -import H from './constants'; -import HasteFS from './HasteFS'; -import HasteModuleMap, { SerializableModuleMap as HasteSerializableModuleMap } from './ModuleMap'; -import { ChangeEvent, HasteRegExp, InternalHasteMap, HasteMap as InternalHasteMapObject } from './types'; -declare type HType = typeof H; -declare type Options = { - cacheDirectory?: string; - computeDependencies?: boolean; - computeSha1?: boolean; - console?: Console; - dependencyExtractor?: string | null; - extensions: Array; - forceNodeFilesystemAPI?: boolean; - hasteImplModulePath?: string; - ignorePattern?: HasteRegExp; - maxWorkers: number; - mocksPattern?: string; - name: string; - platforms: Array; - providesModuleNodeModules?: Array; - resetCache?: boolean; - retainAllFiles: boolean; - rootDir: string; - roots: Array; - skipPackageJson?: boolean; - throwOnModuleCollision?: boolean; - useWatchman?: boolean; - watch?: boolean; -}; -declare namespace HasteMap { - type ModuleMap = HasteModuleMap; - type SerializableModuleMap = HasteSerializableModuleMap; - type FS = HasteFS; - type HasteMapObject = InternalHasteMapObject; - type HasteChangeEvent = ChangeEvent; -} -/** - * HasteMap is a JavaScript implementation of Facebook's haste module system. - * - * This implementation is inspired by https://github.com/facebook/node-haste - * and was built with for high-performance in large code repositories with - * hundreds of thousands of files. This implementation is scalable and provides - * predictable performance. - * - * Because the haste map creation and synchronization is critical to startup - * performance and most tasks are blocked by I/O this class makes heavy use of - * synchronous operations. It uses worker processes for parallelizing file - * access and metadata extraction. - * - * The data structures created by `jest-haste-map` can be used directly from the - * cache without further processing. The metadata objects in the `files` and - * `map` objects contain cross-references: a metadata object from one can look - * up the corresponding metadata object in the other map. Note that in most - * projects, the number of files will be greater than the number of haste - * modules one module can refer to many files based on platform extensions. - * - * type HasteMap = { - * clocks: WatchmanClocks, - * files: {[filepath: string]: FileMetaData}, - * map: {[id: string]: ModuleMapItem}, - * mocks: {[id: string]: string}, - * } - * - * // Watchman clocks are used for query synchronization and file system deltas. - * type WatchmanClocks = {[filepath: string]: string}; - * - * type FileMetaData = { - * id: ?string, // used to look up module metadata objects in `map`. - * mtime: number, // check for outdated files. - * size: number, // size of the file in bytes. - * visited: boolean, // whether the file has been parsed or not. - * dependencies: Array, // all relative dependencies of this file. - * sha1: ?string, // SHA-1 of the file, if requested via options. - * }; - * - * // Modules can be targeted to a specific platform based on the file name. - * // Example: platform.ios.js and Platform.android.js will both map to the same - * // `Platform` module. The platform should be specified during resolution. - * type ModuleMapItem = {[platform: string]: ModuleMetaData}; - * - * // - * type ModuleMetaData = { - * path: string, // the path to look up the file object in `files`. - * type: string, // the module type (either `package` or `module`). - * }; - * - * Note that the data structures described above are conceptual only. The actual - * implementation uses arrays and constant keys for metadata storage. Instead of - * `{id: 'flatMap', mtime: 3421, size: 42, visited: true, dependencies: []}` the real - * representation is similar to `['flatMap', 3421, 42, 1, []]` to save storage space - * and reduce parse and write time of a big JSON blob. - * - * The HasteMap is created as follows: - * 1. read data from the cache or create an empty structure. - * - * 2. crawl the file system. - * * empty cache: crawl the entire file system. - * * cache available: - * * if watchman is available: get file system delta changes. - * * if watchman is unavailable: crawl the entire file system. - * * build metadata objects for every file. This builds the `files` part of - * the `HasteMap`. - * - * 3. parse and extract metadata from changed files. - * * this is done in parallel over worker processes to improve performance. - * * the worst case is to parse all files. - * * the best case is no file system access and retrieving all data from - * the cache. - * * the average case is a small number of changed files. - * - * 4. serialize the new `HasteMap` in a cache file. - * Worker processes can directly access the cache through `HasteMap.read()`. - * - */ -declare class HasteMap extends EventEmitter { - private _buildPromise; - private _cachePath; - private _changeInterval?; - private _console; - private _options; - private _watchers; - private _whitelist; - private _worker; - constructor(options: Options); - static getCacheFilePath(tmpdir: Config.Path, name: string, ...extra: Array): string; - getCacheFilePath(): string; - build(): Promise; - /** - * 1. read data from the cache or create an empty structure. - */ - read(): InternalHasteMap; - readModuleMap(): HasteModuleMap; - /** - * 2. crawl the file system. - */ - private _buildFileMap; - /** - * 3. parse and extract metadata from changed files. - */ - private _processFile; - private _buildHasteMap; - private _cleanup; - /** - * 4. serialize the new `HasteMap` in a cache file. - */ - private _persist; - /** - * Creates workers or parses files and extracts metadata in-process. - */ - private _getWorker; - private _crawl; - /** - * Watch mode - */ - private _watch; - /** - * This function should be called when the file under `filePath` is removed - * or changed. When that happens, we want to figure out if that file was - * part of a group of files that had the same ID. If it was, we want to - * remove it from the group. Furthermore, if there is only one file - * remaining in the group, then we want to restore that single file as the - * correct resolution for its ID, and cleanup the duplicates index. - */ - private _recoverDuplicates; - end(): Promise; - /** - * Helpers - */ - private _ignore; - private _isNodeModulesDir; - private _createEmptyMap; - static H: HType; - static DuplicateError: typeof DuplicateError; - static ModuleMap: typeof HasteModuleMap; -} -declare class DuplicateError extends Error { - mockPath1: string; - mockPath2: string; - constructor(mockPath1: string, mockPath2: string); -} -export = HasteMap; +/// +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +/// +import { EventEmitter } from 'events'; +import { Config } from '@jest/types'; +import H from './constants'; +import HasteFS from './HasteFS'; +import HasteModuleMap, { SerializableModuleMap as HasteSerializableModuleMap } from './ModuleMap'; +import { ChangeEvent, HasteRegExp, InternalHasteMap, HasteMap as InternalHasteMapObject } from './types'; +declare type HType = typeof H; +declare type Options = { + cacheDirectory?: string; + computeDependencies?: boolean; + computeSha1?: boolean; + console?: Console; + dependencyExtractor?: string | null; + extensions: Array; + forceNodeFilesystemAPI?: boolean; + hasteImplModulePath?: string; + ignorePattern?: HasteRegExp; + maxWorkers: number; + mocksPattern?: string; + name: string; + platforms: Array; + providesModuleNodeModules?: Array; + resetCache?: boolean; + retainAllFiles: boolean; + rootDir: string; + roots: Array; + skipPackageJson?: boolean; + throwOnModuleCollision?: boolean; + useWatchman?: boolean; + watch?: boolean; +}; +declare namespace HasteMap { + type ModuleMap = HasteModuleMap; + type SerializableModuleMap = HasteSerializableModuleMap; + type FS = HasteFS; + type HasteMapObject = InternalHasteMapObject; + type HasteChangeEvent = ChangeEvent; +} +/** + * HasteMap is a JavaScript implementation of Facebook's haste module system. + * + * This implementation is inspired by https://github.com/facebook/node-haste + * and was built with for high-performance in large code repositories with + * hundreds of thousands of files. This implementation is scalable and provides + * predictable performance. + * + * Because the haste map creation and synchronization is critical to startup + * performance and most tasks are blocked by I/O this class makes heavy use of + * synchronous operations. It uses worker processes for parallelizing file + * access and metadata extraction. + * + * The data structures created by `jest-haste-map` can be used directly from the + * cache without further processing. The metadata objects in the `files` and + * `map` objects contain cross-references: a metadata object from one can look + * up the corresponding metadata object in the other map. Note that in most + * projects, the number of files will be greater than the number of haste + * modules one module can refer to many files based on platform extensions. + * + * type HasteMap = { + * clocks: WatchmanClocks, + * files: {[filepath: string]: FileMetaData}, + * map: {[id: string]: ModuleMapItem}, + * mocks: {[id: string]: string}, + * } + * + * // Watchman clocks are used for query synchronization and file system deltas. + * type WatchmanClocks = {[filepath: string]: string}; + * + * type FileMetaData = { + * id: ?string, // used to look up module metadata objects in `map`. + * mtime: number, // check for outdated files. + * size: number, // size of the file in bytes. + * visited: boolean, // whether the file has been parsed or not. + * dependencies: Array, // all relative dependencies of this file. + * sha1: ?string, // SHA-1 of the file, if requested via options. + * }; + * + * // Modules can be targeted to a specific platform based on the file name. + * // Example: platform.ios.js and Platform.android.js will both map to the same + * // `Platform` module. The platform should be specified during resolution. + * type ModuleMapItem = {[platform: string]: ModuleMetaData}; + * + * // + * type ModuleMetaData = { + * path: string, // the path to look up the file object in `files`. + * type: string, // the module type (either `package` or `module`). + * }; + * + * Note that the data structures described above are conceptual only. The actual + * implementation uses arrays and constant keys for metadata storage. Instead of + * `{id: 'flatMap', mtime: 3421, size: 42, visited: true, dependencies: []}` the real + * representation is similar to `['flatMap', 3421, 42, 1, []]` to save storage space + * and reduce parse and write time of a big JSON blob. + * + * The HasteMap is created as follows: + * 1. read data from the cache or create an empty structure. + * + * 2. crawl the file system. + * * empty cache: crawl the entire file system. + * * cache available: + * * if watchman is available: get file system delta changes. + * * if watchman is unavailable: crawl the entire file system. + * * build metadata objects for every file. This builds the `files` part of + * the `HasteMap`. + * + * 3. parse and extract metadata from changed files. + * * this is done in parallel over worker processes to improve performance. + * * the worst case is to parse all files. + * * the best case is no file system access and retrieving all data from + * the cache. + * * the average case is a small number of changed files. + * + * 4. serialize the new `HasteMap` in a cache file. + * Worker processes can directly access the cache through `HasteMap.read()`. + * + */ +declare class HasteMap extends EventEmitter { + private _buildPromise; + private _cachePath; + private _changeInterval?; + private _console; + private _options; + private _watchers; + private _whitelist; + private _worker; + constructor(options: Options); + static getCacheFilePath(tmpdir: Config.Path, name: string, ...extra: Array): string; + getCacheFilePath(): string; + build(): Promise; + /** + * 1. read data from the cache or create an empty structure. + */ + read(): InternalHasteMap; + readModuleMap(): HasteModuleMap; + /** + * 2. crawl the file system. + */ + private _buildFileMap; + /** + * 3. parse and extract metadata from changed files. + */ + private _processFile; + private _buildHasteMap; + private _cleanup; + /** + * 4. serialize the new `HasteMap` in a cache file. + */ + private _persist; + /** + * Creates workers or parses files and extracts metadata in-process. + */ + private _getWorker; + private _crawl; + /** + * Watch mode + */ + private _watch; + /** + * This function should be called when the file under `filePath` is removed + * or changed. When that happens, we want to figure out if that file was + * part of a group of files that had the same ID. If it was, we want to + * remove it from the group. Furthermore, if there is only one file + * remaining in the group, then we want to restore that single file as the + * correct resolution for its ID, and cleanup the duplicates index. + */ + private _recoverDuplicates; + end(): Promise; + /** + * Helpers + */ + private _ignore; + private _isNodeModulesDir; + private _createEmptyMap; + static H: HType; + static DuplicateError: typeof DuplicateError; + static ModuleMap: typeof HasteModuleMap; +} +declare class DuplicateError extends Error { + mockPath1: string; + mockPath2: string; + constructor(mockPath1: string, mockPath2: string); +} +export = HasteMap; diff --git a/node_modules/jest-haste-map/build/ts3.4/lib/FSEventsWatcher.d.ts b/node_modules/jest-haste-map/build/ts3.4/lib/FSEventsWatcher.d.ts index 8ca9bd97f..2ff058ef8 100644 --- a/node_modules/jest-haste-map/build/ts3.4/lib/FSEventsWatcher.d.ts +++ b/node_modules/jest-haste-map/build/ts3.4/lib/FSEventsWatcher.d.ts @@ -1,45 +1,45 @@ -/// -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ -/// -import { EventEmitter } from 'events'; -import { Matcher } from 'anymatch'; -/** - * Export `FSEventsWatcher` class. - * Watches `dir`. - */ -declare class FSEventsWatcher extends EventEmitter { - readonly root: string; - readonly ignored?: Matcher; - readonly glob: Array; - readonly dot: boolean; - readonly hasIgnore: boolean; - readonly doIgnore: (path: string) => boolean; - readonly fsEventsWatchStopper: () => Promise; - private _tracked; - static isSupported(): boolean; - private static normalizeProxy; - private static recReaddir; - constructor(dir: string, opts: { - root: string; - ignored?: Matcher; - glob: string | Array; - dot: boolean; - }); - /** - * End watching. - */ - close(callback?: () => void): void; - private isFileIncluded; - private handleEvent; - /** - * Emit events. - */ - private _emit; -} -export = FSEventsWatcher; +/// +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + */ +/// +import { EventEmitter } from 'events'; +import { Matcher } from 'anymatch'; +/** + * Export `FSEventsWatcher` class. + * Watches `dir`. + */ +declare class FSEventsWatcher extends EventEmitter { + readonly root: string; + readonly ignored?: Matcher; + readonly glob: Array; + readonly dot: boolean; + readonly hasIgnore: boolean; + readonly doIgnore: (path: string) => boolean; + readonly fsEventsWatchStopper: () => Promise; + private _tracked; + static isSupported(): boolean; + private static normalizeProxy; + private static recReaddir; + constructor(dir: string, opts: { + root: string; + ignored?: Matcher; + glob: string | Array; + dot: boolean; + }); + /** + * End watching. + */ + close(callback?: () => void): void; + private isFileIncluded; + private handleEvent; + /** + * Emit events. + */ + private _emit; +} +export = FSEventsWatcher; diff --git a/node_modules/jest-haste-map/build/ts3.4/lib/dependencyExtractor.d.ts b/node_modules/jest-haste-map/build/ts3.4/lib/dependencyExtractor.d.ts index cb927b5ba..61748f20c 100644 --- a/node_modules/jest-haste-map/build/ts3.4/lib/dependencyExtractor.d.ts +++ b/node_modules/jest-haste-map/build/ts3.4/lib/dependencyExtractor.d.ts @@ -1,7 +1,7 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -export declare function extract(code: string): Set; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +export declare function extract(code: string): Set; diff --git a/node_modules/jest-haste-map/build/ts3.4/lib/fast_path.d.ts b/node_modules/jest-haste-map/build/ts3.4/lib/fast_path.d.ts index eaf1c6347..a3f57a869 100644 --- a/node_modules/jest-haste-map/build/ts3.4/lib/fast_path.d.ts +++ b/node_modules/jest-haste-map/build/ts3.4/lib/fast_path.d.ts @@ -1,8 +1,8 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -export declare function relative(rootDir: string, filename: string): string; -export declare function resolve(rootDir: string, relativeFilename: string): string; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +export declare function relative(rootDir: string, filename: string): string; +export declare function resolve(rootDir: string, relativeFilename: string): string; diff --git a/node_modules/jest-haste-map/build/ts3.4/lib/getPlatformExtension.d.ts b/node_modules/jest-haste-map/build/ts3.4/lib/getPlatformExtension.d.ts index 62f88defe..84bffd9af 100644 --- a/node_modules/jest-haste-map/build/ts3.4/lib/getPlatformExtension.d.ts +++ b/node_modules/jest-haste-map/build/ts3.4/lib/getPlatformExtension.d.ts @@ -1,7 +1,7 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -export default function getPlatformExtension(file: string, platforms?: Array): string | null; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +export default function getPlatformExtension(file: string, platforms?: Array): string | null; diff --git a/node_modules/jest-haste-map/build/ts3.4/lib/isRegExpSupported.d.ts b/node_modules/jest-haste-map/build/ts3.4/lib/isRegExpSupported.d.ts index ba40ca398..da4eb173a 100644 --- a/node_modules/jest-haste-map/build/ts3.4/lib/isRegExpSupported.d.ts +++ b/node_modules/jest-haste-map/build/ts3.4/lib/isRegExpSupported.d.ts @@ -1,7 +1,7 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -export default function isRegExpSupported(value: string): boolean; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +export default function isRegExpSupported(value: string): boolean; diff --git a/node_modules/jest-haste-map/build/ts3.4/lib/normalizePathSep.d.ts b/node_modules/jest-haste-map/build/ts3.4/lib/normalizePathSep.d.ts index 1490ab7f4..392dc2f6c 100644 --- a/node_modules/jest-haste-map/build/ts3.4/lib/normalizePathSep.d.ts +++ b/node_modules/jest-haste-map/build/ts3.4/lib/normalizePathSep.d.ts @@ -1,8 +1,8 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -declare let normalizePathSep: (string: string) => string; -export default normalizePathSep; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +declare let normalizePathSep: (string: string) => string; +export default normalizePathSep; diff --git a/node_modules/jest-haste-map/build/ts3.4/types.d.ts b/node_modules/jest-haste-map/build/ts3.4/types.d.ts index b4bc2fafa..9d8eddc25 100644 --- a/node_modules/jest-haste-map/build/ts3.4/types.d.ts +++ b/node_modules/jest-haste-map/build/ts3.4/types.d.ts @@ -1,96 +1,96 @@ -/// -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -/// -import { Stats } from 'graceful-fs'; -import { Config } from '@jest/types'; -import ModuleMap from './ModuleMap'; -import HasteFS from './HasteFS'; -export declare type IgnoreMatcher = (item: string) => boolean; -export declare type WorkerMessage = { - computeDependencies: boolean; - computeSha1: boolean; - dependencyExtractor?: string | null; - rootDir: string; - filePath: string; - hasteImplModulePath?: string; -}; -export declare type WorkerMetadata = { - dependencies: Array | undefined | null; - id: string | undefined | null; - module: ModuleMetaData | undefined | null; - sha1: string | undefined | null; -}; -export declare type CrawlerOptions = { - computeSha1: boolean; - data: InternalHasteMap; - extensions: Array; - forceNodeFilesystemAPI: boolean; - ignore: IgnoreMatcher; - rootDir: string; - roots: Array; -}; -export declare type HasteImpl = { - getHasteName(filePath: Config.Path): string | undefined; -}; -export declare type FileData = Map; -export declare type FileMetaData = [string, number, number, 0 | 1, string, string | null | undefined]; -export declare type MockData = Map; -export declare type ModuleMapData = Map; -export declare type WatchmanClocks = Map; -export declare type HasteRegExp = RegExp | ((str: string) => boolean); -export declare type DuplicatesSet = Map; -export declare type DuplicatesIndex = Map>; -export declare type InternalHasteMap = { - clocks: WatchmanClocks; - duplicates: DuplicatesIndex; - files: FileData; - map: ModuleMapData; - mocks: MockData; -}; -export declare type HasteMap = { - hasteFS: HasteFS; - moduleMap: ModuleMap; - __hasteMapForTest?: InternalHasteMap | null; -}; -export declare type RawModuleMap = { - rootDir: Config.Path; - duplicates: DuplicatesIndex; - map: ModuleMapData; - mocks: MockData; -}; -declare type ModuleMapItem = { - [platform: string]: ModuleMetaData; -}; -export declare type ModuleMetaData = [Config.Path, /* type */ number]; -export declare type HType = { - ID: 0; - MTIME: 1; - SIZE: 2; - VISITED: 3; - DEPENDENCIES: 4; - SHA1: 5; - PATH: 0; - TYPE: 1; - MODULE: 0; - PACKAGE: 1; - GENERIC_PLATFORM: 'g'; - NATIVE_PLATFORM: 'native'; - DEPENDENCY_DELIM: '\0'; -}; -export declare type HTypeValue = HType[keyof HType]; -export declare type EventsQueue = Array<{ - filePath: Config.Path; - stat: Stats | undefined; - type: string; -}>; -export declare type ChangeEvent = { - eventsQueue: EventsQueue; - hasteFS: HasteFS; - moduleMap: ModuleMap; -}; -export {}; +/// +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +/// +import { Stats } from 'graceful-fs'; +import { Config } from '@jest/types'; +import ModuleMap from './ModuleMap'; +import HasteFS from './HasteFS'; +export declare type IgnoreMatcher = (item: string) => boolean; +export declare type WorkerMessage = { + computeDependencies: boolean; + computeSha1: boolean; + dependencyExtractor?: string | null; + rootDir: string; + filePath: string; + hasteImplModulePath?: string; +}; +export declare type WorkerMetadata = { + dependencies: Array | undefined | null; + id: string | undefined | null; + module: ModuleMetaData | undefined | null; + sha1: string | undefined | null; +}; +export declare type CrawlerOptions = { + computeSha1: boolean; + data: InternalHasteMap; + extensions: Array; + forceNodeFilesystemAPI: boolean; + ignore: IgnoreMatcher; + rootDir: string; + roots: Array; +}; +export declare type HasteImpl = { + getHasteName(filePath: Config.Path): string | undefined; +}; +export declare type FileData = Map; +export declare type FileMetaData = [string, number, number, 0 | 1, string, string | null | undefined]; +export declare type MockData = Map; +export declare type ModuleMapData = Map; +export declare type WatchmanClocks = Map; +export declare type HasteRegExp = RegExp | ((str: string) => boolean); +export declare type DuplicatesSet = Map; +export declare type DuplicatesIndex = Map>; +export declare type InternalHasteMap = { + clocks: WatchmanClocks; + duplicates: DuplicatesIndex; + files: FileData; + map: ModuleMapData; + mocks: MockData; +}; +export declare type HasteMap = { + hasteFS: HasteFS; + moduleMap: ModuleMap; + __hasteMapForTest?: InternalHasteMap | null; +}; +export declare type RawModuleMap = { + rootDir: Config.Path; + duplicates: DuplicatesIndex; + map: ModuleMapData; + mocks: MockData; +}; +declare type ModuleMapItem = { + [platform: string]: ModuleMetaData; +}; +export declare type ModuleMetaData = [Config.Path, /* type */ number]; +export declare type HType = { + ID: 0; + MTIME: 1; + SIZE: 2; + VISITED: 3; + DEPENDENCIES: 4; + SHA1: 5; + PATH: 0; + TYPE: 1; + MODULE: 0; + PACKAGE: 1; + GENERIC_PLATFORM: 'g'; + NATIVE_PLATFORM: 'native'; + DEPENDENCY_DELIM: '\0'; +}; +export declare type HTypeValue = HType[keyof HType]; +export declare type EventsQueue = Array<{ + filePath: Config.Path; + stat: Stats | undefined; + type: string; +}>; +export declare type ChangeEvent = { + eventsQueue: EventsQueue; + hasteFS: HasteFS; + moduleMap: ModuleMap; +}; +export {}; diff --git a/node_modules/jest-haste-map/build/ts3.4/worker.d.ts b/node_modules/jest-haste-map/build/ts3.4/worker.d.ts index fc6911ed5..e3f9ed972 100644 --- a/node_modules/jest-haste-map/build/ts3.4/worker.d.ts +++ b/node_modules/jest-haste-map/build/ts3.4/worker.d.ts @@ -1,9 +1,9 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import { WorkerMessage, WorkerMetadata } from './types'; -export declare function worker(data: WorkerMessage): Promise; -export declare function getSha1(data: WorkerMessage): Promise; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import { WorkerMessage, WorkerMetadata } from './types'; +export declare function worker(data: WorkerMessage): Promise; +export declare function getSha1(data: WorkerMessage): Promise; diff --git a/node_modules/jest-jasmine2/build/ts3.4/ExpectationFailed.d.ts b/node_modules/jest-jasmine2/build/ts3.4/ExpectationFailed.d.ts index 657f1ccf2..7ecb46ba2 100644 --- a/node_modules/jest-jasmine2/build/ts3.4/ExpectationFailed.d.ts +++ b/node_modules/jest-jasmine2/build/ts3.4/ExpectationFailed.d.ts @@ -1,8 +1,8 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -export default class ExpectationFailed extends Error { -} +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +export default class ExpectationFailed extends Error { +} diff --git a/node_modules/jest-jasmine2/build/ts3.4/assertionErrorMessage.d.ts b/node_modules/jest-jasmine2/build/ts3.4/assertionErrorMessage.d.ts index 7fee55650..61190f0f8 100644 --- a/node_modules/jest-jasmine2/build/ts3.4/assertionErrorMessage.d.ts +++ b/node_modules/jest-jasmine2/build/ts3.4/assertionErrorMessage.d.ts @@ -1,10 +1,10 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import { DiffOptions } from 'jest-matcher-utils'; -import { AssertionErrorWithStack } from './types'; -declare function assertionErrorMessage(error: AssertionErrorWithStack, options: DiffOptions): string; -export default assertionErrorMessage; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import { DiffOptions } from 'jest-matcher-utils'; +import { AssertionErrorWithStack } from './types'; +declare function assertionErrorMessage(error: AssertionErrorWithStack, options: DiffOptions): string; +export default assertionErrorMessage; diff --git a/node_modules/jest-jasmine2/build/ts3.4/each.d.ts b/node_modules/jest-jasmine2/build/ts3.4/each.d.ts index 4e8ec0884..b1fd243de 100644 --- a/node_modules/jest-jasmine2/build/ts3.4/each.d.ts +++ b/node_modules/jest-jasmine2/build/ts3.4/each.d.ts @@ -1,9 +1,9 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import { JestEnvironment } from '@jest/environment'; -declare const _default: (environment: JestEnvironment) => void; -export default _default; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import { JestEnvironment } from '@jest/environment'; +declare const _default: (environment: JestEnvironment) => void; +export default _default; diff --git a/node_modules/jest-jasmine2/build/ts3.4/errorOnPrivate.d.ts b/node_modules/jest-jasmine2/build/ts3.4/errorOnPrivate.d.ts index 51ff135e7..c616127f9 100644 --- a/node_modules/jest-jasmine2/build/ts3.4/errorOnPrivate.d.ts +++ b/node_modules/jest-jasmine2/build/ts3.4/errorOnPrivate.d.ts @@ -1,8 +1,8 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import { Global } from '@jest/types'; -export declare function installErrorOnPrivate(global: Global.Global): void; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import { Global } from '@jest/types'; +export declare function installErrorOnPrivate(global: Global.Global): void; diff --git a/node_modules/jest-jasmine2/build/ts3.4/expectationResultFactory.d.ts b/node_modules/jest-jasmine2/build/ts3.4/expectationResultFactory.d.ts index 195dc9843..925fcfc4e 100644 --- a/node_modules/jest-jasmine2/build/ts3.4/expectationResultFactory.d.ts +++ b/node_modules/jest-jasmine2/build/ts3.4/expectationResultFactory.d.ts @@ -1,16 +1,16 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import { FailedAssertion } from '@jest/test-result'; -export declare type Options = { - matcherName: string; - passed: boolean; - actual?: any; - error?: any; - expected?: any; - message?: string | null; -}; -export default function expectationResultFactory(options: Options, initError?: Error): FailedAssertion; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import { FailedAssertion } from '@jest/test-result'; +export declare type Options = { + matcherName: string; + passed: boolean; + actual?: any; + error?: any; + expected?: any; + message?: string | null; +}; +export default function expectationResultFactory(options: Options, initError?: Error): FailedAssertion; diff --git a/node_modules/jest-jasmine2/build/ts3.4/index.d.ts b/node_modules/jest-jasmine2/build/ts3.4/index.d.ts index ba94c04ad..269edb2b9 100644 --- a/node_modules/jest-jasmine2/build/ts3.4/index.d.ts +++ b/node_modules/jest-jasmine2/build/ts3.4/index.d.ts @@ -1,16 +1,16 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import { Config } from '@jest/types'; -import { TestResult } from '@jest/test-result'; -import { JestEnvironment } from '@jest/environment'; -import { RuntimeType as Runtime } from 'jest-runtime'; -import { Jasmine as JestJasmine } from './types'; -declare function jasmine2(globalConfig: Config.GlobalConfig, config: Config.ProjectConfig, environment: JestEnvironment, runtime: Runtime, testPath: string): Promise; -declare namespace jasmine2 { - type Jasmine = JestJasmine; -} -export = jasmine2; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import { Config } from '@jest/types'; +import { TestResult } from '@jest/test-result'; +import { JestEnvironment } from '@jest/environment'; +import { RuntimeType as Runtime } from 'jest-runtime'; +import { Jasmine as JestJasmine } from './types'; +declare function jasmine2(globalConfig: Config.GlobalConfig, config: Config.ProjectConfig, environment: JestEnvironment, runtime: Runtime, testPath: string): Promise; +declare namespace jasmine2 { + type Jasmine = JestJasmine; +} +export = jasmine2; diff --git a/node_modules/jest-jasmine2/build/ts3.4/isError.d.ts b/node_modules/jest-jasmine2/build/ts3.4/isError.d.ts index b21d23599..15b3dc8e1 100644 --- a/node_modules/jest-jasmine2/build/ts3.4/isError.d.ts +++ b/node_modules/jest-jasmine2/build/ts3.4/isError.d.ts @@ -1,10 +1,10 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -export default function isError(potentialError: any): { - isError: boolean; - message: string | null; -}; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +export default function isError(potentialError: any): { + isError: boolean; + message: string | null; +}; diff --git a/node_modules/jest-jasmine2/build/ts3.4/jasmine/CallTracker.d.ts b/node_modules/jest-jasmine2/build/ts3.4/jasmine/CallTracker.d.ts index 1692e9c91..24b95f36c 100644 --- a/node_modules/jest-jasmine2/build/ts3.4/jasmine/CallTracker.d.ts +++ b/node_modules/jest-jasmine2/build/ts3.4/jasmine/CallTracker.d.ts @@ -1,25 +1,25 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ -export declare type Context = { - object: unknown; - args: Array; - returnValue?: unknown; -}; -declare class CallTracker { - track: (context: Context) => void; - any: () => boolean; - count: () => number; - argsFor: (index: number) => Array; - all: () => Array; - allArgs: () => Array; - first: () => Context; - mostRecent: () => Context; - reset: () => void; - constructor(); -} -export default CallTracker; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + */ +export declare type Context = { + object: unknown; + args: Array; + returnValue?: unknown; +}; +declare class CallTracker { + track: (context: Context) => void; + any: () => boolean; + count: () => number; + argsFor: (index: number) => Array; + all: () => Array; + allArgs: () => Array; + first: () => Context; + mostRecent: () => Context; + reset: () => void; + constructor(); +} +export default CallTracker; diff --git a/node_modules/jest-jasmine2/build/ts3.4/jasmine/Env.d.ts b/node_modules/jest-jasmine2/build/ts3.4/jasmine/Env.d.ts index 1befee220..8b4b9fdd3 100644 --- a/node_modules/jest-jasmine2/build/ts3.4/jasmine/Env.d.ts +++ b/node_modules/jest-jasmine2/build/ts3.4/jasmine/Env.d.ts @@ -1,42 +1,42 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ -import { AssertionErrorWithStack, Jasmine, Reporter, Spy } from '../types'; -import { default as Spec } from './Spec'; -import Suite from './Suite'; -export default function (j$: Jasmine): { - new (_options?: object | undefined): { - specFilter: (spec: Spec) => boolean; - catchExceptions: (value: unknown) => boolean; - throwOnExpectationFailure: (value: unknown) => void; - catchingExceptions: () => boolean; - topSuite: () => Suite; - fail: (error: Error | AssertionErrorWithStack) => void; - pending: (message: string) => void; - afterAll: (afterAllFunction: (done: (error?: any) => void) => void, timeout?: number | undefined) => void; - fit: (description: string, fn: (done: (error?: any) => void) => void, timeout?: number | undefined) => Spec; - throwingExpectationFailures: () => boolean; - randomizeTests: (value: unknown) => void; - randomTests: () => boolean; - seed: (value: unknown) => unknown; - execute: (runnablesToRun?: string[] | undefined, suiteTree?: Suite | undefined) => Promise; - fdescribe: (description: string, specDefinitions: Function) => Suite; - spyOn: (obj: Record, methodName: string, accessType?: "get" | "set" | "writable" | "configurable" | "enumerable" | "value" | undefined) => Spy; - beforeEach: (beforeEachFunction: (done: (error?: any) => void) => void, timeout?: number | undefined) => void; - afterEach: (afterEachFunction: (done: (error?: any) => void) => void, timeout?: number | undefined) => void; - clearReporters: () => void; - addReporter: (reporterToAdd: Reporter) => void; - it: (description: string, fn: (done: (error?: any) => void) => void, timeout?: number | undefined) => Spec; - xdescribe: (description: string, specDefinitions: Function) => Suite; - xit: (description: string, fn: (done: (error?: any) => void) => void, timeout?: number | undefined) => Spec; - beforeAll: (beforeAllFunction: (done: (error?: any) => void) => void, timeout?: number | undefined) => void; - todo: () => Spec; - provideFallbackReporter: (reporterToAdd: Reporter) => void; - allowRespy: (allow: boolean) => void; - describe: (description: string, specDefinitions: Function) => Suite; - }; -}; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + */ +import { AssertionErrorWithStack, Jasmine, Reporter, Spy } from '../types'; +import { default as Spec } from './Spec'; +import Suite from './Suite'; +export default function (j$: Jasmine): { + new (_options?: object | undefined): { + specFilter: (spec: Spec) => boolean; + catchExceptions: (value: unknown) => boolean; + throwOnExpectationFailure: (value: unknown) => void; + catchingExceptions: () => boolean; + topSuite: () => Suite; + fail: (error: Error | AssertionErrorWithStack) => void; + pending: (message: string) => void; + afterAll: (afterAllFunction: (done: (error?: any) => void) => void, timeout?: number | undefined) => void; + fit: (description: string, fn: (done: (error?: any) => void) => void, timeout?: number | undefined) => Spec; + throwingExpectationFailures: () => boolean; + randomizeTests: (value: unknown) => void; + randomTests: () => boolean; + seed: (value: unknown) => unknown; + execute: (runnablesToRun?: string[] | undefined, suiteTree?: Suite | undefined) => Promise; + fdescribe: (description: string, specDefinitions: Function) => Suite; + spyOn: (obj: Record, methodName: string, accessType?: "get" | "set" | "writable" | "configurable" | "enumerable" | "value" | undefined) => Spy; + beforeEach: (beforeEachFunction: (done: (error?: any) => void) => void, timeout?: number | undefined) => void; + afterEach: (afterEachFunction: (done: (error?: any) => void) => void, timeout?: number | undefined) => void; + clearReporters: () => void; + addReporter: (reporterToAdd: Reporter) => void; + it: (description: string, fn: (done: (error?: any) => void) => void, timeout?: number | undefined) => Spec; + xdescribe: (description: string, specDefinitions: Function) => Suite; + xit: (description: string, fn: (done: (error?: any) => void) => void, timeout?: number | undefined) => Spec; + beforeAll: (beforeAllFunction: (done: (error?: any) => void) => void, timeout?: number | undefined) => void; + todo: () => Spec; + provideFallbackReporter: (reporterToAdd: Reporter) => void; + allowRespy: (allow: boolean) => void; + describe: (description: string, specDefinitions: Function) => Suite; + }; +}; diff --git a/node_modules/jest-jasmine2/build/ts3.4/jasmine/JsApiReporter.d.ts b/node_modules/jest-jasmine2/build/ts3.4/jasmine/JsApiReporter.d.ts index e20205ef7..94098a976 100644 --- a/node_modules/jest-jasmine2/build/ts3.4/jasmine/JsApiReporter.d.ts +++ b/node_modules/jest-jasmine2/build/ts3.4/jasmine/JsApiReporter.d.ts @@ -1,31 +1,31 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ -import { Reporter, RunDetails } from '../types'; -import { SpecResult } from './Spec'; -import { SuiteResult } from './Suite'; -import Timer from './Timer'; -export default class JsApiReporter implements Reporter { - started: boolean; - finished: boolean; - runDetails: RunDetails; - jasmineStarted: (runDetails: RunDetails) => void; - jasmineDone: (runDetails: RunDetails) => void; - status: () => unknown; - executionTime: () => unknown; - suiteStarted: (result: SuiteResult) => void; - suiteDone: (result: SuiteResult) => void; - suiteResults: (index: number, length: number) => Array; - suites: () => Record; - specResults: (index: number, length: number) => Array; - specDone: (result: SpecResult) => void; - specs: () => Array; - specStarted: (spec: SpecResult) => void; - constructor(options: { - timer?: Timer; - }); -} +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + */ +import { Reporter, RunDetails } from '../types'; +import { SpecResult } from './Spec'; +import { SuiteResult } from './Suite'; +import Timer from './Timer'; +export default class JsApiReporter implements Reporter { + started: boolean; + finished: boolean; + runDetails: RunDetails; + jasmineStarted: (runDetails: RunDetails) => void; + jasmineDone: (runDetails: RunDetails) => void; + status: () => unknown; + executionTime: () => unknown; + suiteStarted: (result: SuiteResult) => void; + suiteDone: (result: SuiteResult) => void; + suiteResults: (index: number, length: number) => Array; + suites: () => Record; + specResults: (index: number, length: number) => Array; + specDone: (result: SpecResult) => void; + specs: () => Array; + specStarted: (spec: SpecResult) => void; + constructor(options: { + timer?: Timer; + }); +} diff --git a/node_modules/jest-jasmine2/build/ts3.4/jasmine/ReportDispatcher.d.ts b/node_modules/jest-jasmine2/build/ts3.4/jasmine/ReportDispatcher.d.ts index ca5189f27..2a6beb3e2 100644 --- a/node_modules/jest-jasmine2/build/ts3.4/jasmine/ReportDispatcher.d.ts +++ b/node_modules/jest-jasmine2/build/ts3.4/jasmine/ReportDispatcher.d.ts @@ -1,22 +1,22 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ -import { Reporter, RunDetails } from '../types'; -import { SpecResult } from './Spec'; -import { SuiteResult } from './Suite'; -export default class ReportDispatcher implements Reporter { - addReporter: (reporter: Reporter) => void; - provideFallbackReporter: (reporter: Reporter) => void; - clearReporters: () => void; - jasmineDone: (runDetails: RunDetails) => void; - jasmineStarted: (runDetails: RunDetails) => void; - specDone: (result: SpecResult) => void; - specStarted: (spec: SpecResult) => void; - suiteDone: (result: SuiteResult) => void; - suiteStarted: (result: SuiteResult) => void; - constructor(methods: Array); -} +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + */ +import { Reporter, RunDetails } from '../types'; +import { SpecResult } from './Spec'; +import { SuiteResult } from './Suite'; +export default class ReportDispatcher implements Reporter { + addReporter: (reporter: Reporter) => void; + provideFallbackReporter: (reporter: Reporter) => void; + clearReporters: () => void; + jasmineDone: (runDetails: RunDetails) => void; + jasmineStarted: (runDetails: RunDetails) => void; + specDone: (result: SpecResult) => void; + specStarted: (spec: SpecResult) => void; + suiteDone: (result: SuiteResult) => void; + suiteStarted: (result: SuiteResult) => void; + constructor(methods: Array); +} diff --git a/node_modules/jest-jasmine2/build/ts3.4/jasmine/Spec.d.ts b/node_modules/jest-jasmine2/build/ts3.4/jasmine/Spec.d.ts index f95acca96..42af2bc8b 100644 --- a/node_modules/jest-jasmine2/build/ts3.4/jasmine/Spec.d.ts +++ b/node_modules/jest-jasmine2/build/ts3.4/jasmine/Spec.d.ts @@ -1,81 +1,81 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ -import { Config } from '@jest/types'; -import { FailedAssertion, Milliseconds, Status } from '@jest/test-result'; -import ExpectationFailed from '../ExpectationFailed'; -import expectationResultFactory, { Options as ExpectationResultFactoryOptions } from '../expectationResultFactory'; -import { QueueableFn, default as queueRunner } from '../queueRunner'; -import { AssertionErrorWithStack } from '../types'; -export declare type Attributes = { - id: string; - resultCallback: (result: Spec['result']) => void; - description: string; - throwOnExpectationFailure: unknown; - getTestPath: () => Config.Path; - queueableFn: QueueableFn; - beforeAndAfterFns: () => { - befores: Array; - afters: Array; - }; - userContext: () => unknown; - onStart: (context: Spec) => void; - getSpecName: (spec: Spec) => string; - queueRunnerFactory: typeof queueRunner; -}; -export declare type SpecResult = { - id: string; - description: string; - fullName: string; - duration?: Milliseconds; - failedExpectations: Array; - testPath: Config.Path; - passedExpectations: Array>; - pendingReason: string; - status: Status; - __callsite?: { - getColumnNumber: () => number; - getLineNumber: () => number; - }; -}; -export default class Spec { - id: string; - description: string; - resultCallback: (result: SpecResult) => void; - queueableFn: QueueableFn; - beforeAndAfterFns: () => { - befores: Array; - afters: Array; - }; - userContext: () => unknown; - onStart: (spec: Spec) => void; - getSpecName: (spec: Spec) => string; - queueRunnerFactory: typeof queueRunner; - throwOnExpectationFailure: boolean; - initError: Error; - result: SpecResult; - disabled?: boolean; - currentRun?: ReturnType; - markedTodo?: boolean; - markedPending?: boolean; - expand?: boolean; - static pendingSpecExceptionMessage: string; - static isPendingSpecException(e: Error): boolean; - constructor(attrs: Attributes); - addExpectationResult(passed: boolean, data: ExpectationResultFactoryOptions, isError?: boolean): void; - execute(onComplete: Function, enabled: boolean): void; - cancel(): void; - onException(error: ExpectationFailed | AssertionErrorWithStack): void; - disable(): void; - pend(message?: string): void; - todo(): void; - getResult(): SpecResult; - status(enabled?: boolean): "todo" | "passed" | "failed" | "pending" | "disabled"; - isExecutable(): boolean; - getFullName(): string; - isAssertionError(error: Error): boolean; -} +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + */ +import { Config } from '@jest/types'; +import { FailedAssertion, Milliseconds, Status } from '@jest/test-result'; +import ExpectationFailed from '../ExpectationFailed'; +import expectationResultFactory, { Options as ExpectationResultFactoryOptions } from '../expectationResultFactory'; +import { QueueableFn, default as queueRunner } from '../queueRunner'; +import { AssertionErrorWithStack } from '../types'; +export declare type Attributes = { + id: string; + resultCallback: (result: Spec['result']) => void; + description: string; + throwOnExpectationFailure: unknown; + getTestPath: () => Config.Path; + queueableFn: QueueableFn; + beforeAndAfterFns: () => { + befores: Array; + afters: Array; + }; + userContext: () => unknown; + onStart: (context: Spec) => void; + getSpecName: (spec: Spec) => string; + queueRunnerFactory: typeof queueRunner; +}; +export declare type SpecResult = { + id: string; + description: string; + fullName: string; + duration?: Milliseconds; + failedExpectations: Array; + testPath: Config.Path; + passedExpectations: Array>; + pendingReason: string; + status: Status; + __callsite?: { + getColumnNumber: () => number; + getLineNumber: () => number; + }; +}; +export default class Spec { + id: string; + description: string; + resultCallback: (result: SpecResult) => void; + queueableFn: QueueableFn; + beforeAndAfterFns: () => { + befores: Array; + afters: Array; + }; + userContext: () => unknown; + onStart: (spec: Spec) => void; + getSpecName: (spec: Spec) => string; + queueRunnerFactory: typeof queueRunner; + throwOnExpectationFailure: boolean; + initError: Error; + result: SpecResult; + disabled?: boolean; + currentRun?: ReturnType; + markedTodo?: boolean; + markedPending?: boolean; + expand?: boolean; + static pendingSpecExceptionMessage: string; + static isPendingSpecException(e: Error): boolean; + constructor(attrs: Attributes); + addExpectationResult(passed: boolean, data: ExpectationResultFactoryOptions, isError?: boolean): void; + execute(onComplete: Function, enabled: boolean): void; + cancel(): void; + onException(error: ExpectationFailed | AssertionErrorWithStack): void; + disable(): void; + pend(message?: string): void; + todo(): void; + getResult(): SpecResult; + status(enabled?: boolean): "todo" | "passed" | "failed" | "pending" | "disabled"; + isExecutable(): boolean; + getFullName(): string; + isAssertionError(error: Error): boolean; +} diff --git a/node_modules/jest-jasmine2/build/ts3.4/jasmine/SpyStrategy.d.ts b/node_modules/jest-jasmine2/build/ts3.4/jasmine/SpyStrategy.d.ts index a54754d42..5664b0dc7 100644 --- a/node_modules/jest-jasmine2/build/ts3.4/jasmine/SpyStrategy.d.ts +++ b/node_modules/jest-jasmine2/build/ts3.4/jasmine/SpyStrategy.d.ts @@ -1,22 +1,22 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ -export default class SpyStrategy { - identity: () => string; - exec: (...args: Array) => unknown; - callThrough: () => unknown; - returnValue: (value: unknown) => unknown; - returnValues: () => unknown; - throwError: (something: string | Error) => unknown; - callFake: (fn: Function) => unknown; - stub: (fn: Function) => unknown; - constructor({ name, fn, getSpy, }?: { - name?: string; - fn?: Function; - getSpy?: () => unknown; - }); -} +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + */ +export default class SpyStrategy { + identity: () => string; + exec: (...args: Array) => unknown; + callThrough: () => unknown; + returnValue: (value: unknown) => unknown; + returnValues: () => unknown; + throwError: (something: string | Error) => unknown; + callFake: (fn: Function) => unknown; + stub: (fn: Function) => unknown; + constructor({ name, fn, getSpy, }?: { + name?: string; + fn?: Function; + getSpy?: () => unknown; + }); +} diff --git a/node_modules/jest-jasmine2/build/ts3.4/jasmine/Suite.d.ts b/node_modules/jest-jasmine2/build/ts3.4/jasmine/Suite.d.ts index 061bef302..7f734429a 100644 --- a/node_modules/jest-jasmine2/build/ts3.4/jasmine/Suite.d.ts +++ b/node_modules/jest-jasmine2/build/ts3.4/jasmine/Suite.d.ts @@ -1,61 +1,61 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ -import { Config } from '@jest/types'; -import expectationResultFactory from '../expectationResultFactory'; -import { QueueableFn } from '../queueRunner'; -import Spec from './Spec'; -export declare type SuiteResult = { - id: string; - description: string; - fullName: string; - failedExpectations: Array>; - testPath: Config.Path; - status?: string; -}; -export declare type Attributes = { - id: string; - parentSuite?: Suite; - description: string; - throwOnExpectationFailure?: boolean; - getTestPath: () => Config.Path; -}; -export default class Suite { - id: string; - parentSuite?: Suite; - description: string; - throwOnExpectationFailure: boolean; - beforeFns: Array; - afterFns: Array; - beforeAllFns: Array; - afterAllFns: Array; - disabled: boolean; - children: Array; - result: SuiteResult; - sharedContext?: object; - markedPending: boolean; - markedTodo: boolean; - isFocused: boolean; - constructor(attrs: Attributes); - getFullName(): string; - disable(): void; - pend(_message?: string): void; - beforeEach(fn: QueueableFn): void; - beforeAll(fn: QueueableFn): void; - afterEach(fn: QueueableFn): void; - afterAll(fn: QueueableFn): void; - addChild(child: Suite | Spec): void; - status(): "failed" | "pending" | "disabled" | "finished"; - isExecutable(): boolean; - canBeReentered(): boolean; - getResult(): SuiteResult; - sharedUserContext(): object; - clonedSharedUserContext(): object; - onException(...args: Parameters): void; - addExpectationResult(...args: Parameters): void; - execute(..._args: Array): void; -} +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + */ +import { Config } from '@jest/types'; +import expectationResultFactory from '../expectationResultFactory'; +import { QueueableFn } from '../queueRunner'; +import Spec from './Spec'; +export declare type SuiteResult = { + id: string; + description: string; + fullName: string; + failedExpectations: Array>; + testPath: Config.Path; + status?: string; +}; +export declare type Attributes = { + id: string; + parentSuite?: Suite; + description: string; + throwOnExpectationFailure?: boolean; + getTestPath: () => Config.Path; +}; +export default class Suite { + id: string; + parentSuite?: Suite; + description: string; + throwOnExpectationFailure: boolean; + beforeFns: Array; + afterFns: Array; + beforeAllFns: Array; + afterAllFns: Array; + disabled: boolean; + children: Array; + result: SuiteResult; + sharedContext?: object; + markedPending: boolean; + markedTodo: boolean; + isFocused: boolean; + constructor(attrs: Attributes); + getFullName(): string; + disable(): void; + pend(_message?: string): void; + beforeEach(fn: QueueableFn): void; + beforeAll(fn: QueueableFn): void; + afterEach(fn: QueueableFn): void; + afterAll(fn: QueueableFn): void; + addChild(child: Suite | Spec): void; + status(): "failed" | "pending" | "disabled" | "finished"; + isExecutable(): boolean; + canBeReentered(): boolean; + getResult(): SuiteResult; + sharedUserContext(): object; + clonedSharedUserContext(): object; + onException(...args: Parameters): void; + addExpectationResult(...args: Parameters): void; + execute(..._args: Array): void; +} diff --git a/node_modules/jest-jasmine2/build/ts3.4/jasmine/Timer.d.ts b/node_modules/jest-jasmine2/build/ts3.4/jasmine/Timer.d.ts index 17c97e615..dfb08fca3 100644 --- a/node_modules/jest-jasmine2/build/ts3.4/jasmine/Timer.d.ts +++ b/node_modules/jest-jasmine2/build/ts3.4/jasmine/Timer.d.ts @@ -1,14 +1,14 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ -export default class Timer { - start: () => void; - elapsed: () => number; - constructor(options?: { - now?: () => number; - }); -} +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + */ +export default class Timer { + start: () => void; + elapsed: () => number; + constructor(options?: { + now?: () => number; + }); +} diff --git a/node_modules/jest-jasmine2/build/ts3.4/jasmine/createSpy.d.ts b/node_modules/jest-jasmine2/build/ts3.4/jasmine/createSpy.d.ts index 8fba98613..9d0c1af9c 100644 --- a/node_modules/jest-jasmine2/build/ts3.4/jasmine/createSpy.d.ts +++ b/node_modules/jest-jasmine2/build/ts3.4/jasmine/createSpy.d.ts @@ -1,13 +1,13 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ -import { Spy } from '../types'; -interface Fn extends Record { - (): any; -} -declare function createSpy(name: string, originalFn: Fn): Spy; -export default createSpy; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + */ +import { Spy } from '../types'; +interface Fn extends Record { + (): any; +} +declare function createSpy(name: string, originalFn: Fn): Spy; +export default createSpy; diff --git a/node_modules/jest-jasmine2/build/ts3.4/jasmine/jasmineLight.d.ts b/node_modules/jest-jasmine2/build/ts3.4/jasmine/jasmineLight.d.ts index edccab5f4..94451557e 100644 --- a/node_modules/jest-jasmine2/build/ts3.4/jasmine/jasmineLight.d.ts +++ b/node_modules/jest-jasmine2/build/ts3.4/jasmine/jasmineLight.d.ts @@ -1,27 +1,27 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ -import { Jasmine } from '../types'; -import JsApiReporter from './JsApiReporter'; -export declare const create: (createOptions: Record) => Jasmine; -export declare const _interface: (jasmine: Jasmine, env: any) => { - describe(description: string, specDefinitions: Function): any; - xdescribe(description: string, specDefinitions: Function): any; - fdescribe(description: string, specDefinitions: Function): any; - it(): any; - xit(): any; - fit(): any; - beforeEach(): any; - afterEach(): any; - beforeAll(): any; - afterAll(): any; - pending(): any; - fail(): any; - spyOn(obj: Record, methodName: string, accessType?: string | undefined): any; - jsApiReporter: JsApiReporter; - jasmine: Jasmine; -}; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + */ +import { Jasmine } from '../types'; +import JsApiReporter from './JsApiReporter'; +export declare const create: (createOptions: Record) => Jasmine; +export declare const _interface: (jasmine: Jasmine, env: any) => { + describe(description: string, specDefinitions: Function): any; + xdescribe(description: string, specDefinitions: Function): any; + fdescribe(description: string, specDefinitions: Function): any; + it(): any; + xit(): any; + fit(): any; + beforeEach(): any; + afterEach(): any; + beforeAll(): any; + afterAll(): any; + pending(): any; + fail(): any; + spyOn(obj: Record, methodName: string, accessType?: string | undefined): any; + jsApiReporter: JsApiReporter; + jasmine: Jasmine; +}; diff --git a/node_modules/jest-jasmine2/build/ts3.4/jasmine/spyRegistry.d.ts b/node_modules/jest-jasmine2/build/ts3.4/jasmine/spyRegistry.d.ts index c9f55521b..f880e5937 100644 --- a/node_modules/jest-jasmine2/build/ts3.4/jasmine/spyRegistry.d.ts +++ b/node_modules/jest-jasmine2/build/ts3.4/jasmine/spyRegistry.d.ts @@ -1,18 +1,18 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ -import { Spy } from '../types'; -export default class SpyRegistry { - allowRespy: (allow: unknown) => void; - spyOn: (obj: Record, methodName: string, accessType?: keyof PropertyDescriptor) => Spy; - clearSpies: () => void; - respy: unknown; - private _spyOnProperty; - constructor({ currentSpies, }?: { - currentSpies?: () => Array; - }); -} +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + */ +import { Spy } from '../types'; +export default class SpyRegistry { + allowRespy: (allow: unknown) => void; + spyOn: (obj: Record, methodName: string, accessType?: keyof PropertyDescriptor) => Spy; + clearSpies: () => void; + respy: unknown; + private _spyOnProperty; + constructor({ currentSpies, }?: { + currentSpies?: () => Array; + }); +} diff --git a/node_modules/jest-jasmine2/build/ts3.4/jasmineAsyncInstall.d.ts b/node_modules/jest-jasmine2/build/ts3.4/jasmineAsyncInstall.d.ts index c26d472d2..5f3056f6c 100644 --- a/node_modules/jest-jasmine2/build/ts3.4/jasmineAsyncInstall.d.ts +++ b/node_modules/jest-jasmine2/build/ts3.4/jasmineAsyncInstall.d.ts @@ -1,12 +1,12 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -/** - * This module adds ability to test async promise code with jasmine by - * returning a promise from `it/test` and `before/afterEach/All` blocks. - */ -import { Config, Global } from '@jest/types'; -export default function jasmineAsyncInstall(globalConfig: Config.GlobalConfig, global: Global.Global): void; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +/** + * This module adds ability to test async promise code with jasmine by + * returning a promise from `it/test` and `before/afterEach/All` blocks. + */ +import { Config, Global } from '@jest/types'; +export default function jasmineAsyncInstall(globalConfig: Config.GlobalConfig, global: Global.Global): void; diff --git a/node_modules/jest-jasmine2/build/ts3.4/jestExpect.d.ts b/node_modules/jest-jasmine2/build/ts3.4/jestExpect.d.ts index 0557578a6..07b159fb8 100644 --- a/node_modules/jest-jasmine2/build/ts3.4/jestExpect.d.ts +++ b/node_modules/jest-jasmine2/build/ts3.4/jestExpect.d.ts @@ -1,10 +1,10 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -declare const _default: (config: { - expand: boolean; -}) => void; -export default _default; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +declare const _default: (config: { + expand: boolean; +}) => void; +export default _default; diff --git a/node_modules/jest-jasmine2/build/ts3.4/pTimeout.d.ts b/node_modules/jest-jasmine2/build/ts3.4/pTimeout.d.ts index 35eb08201..151699e65 100644 --- a/node_modules/jest-jasmine2/build/ts3.4/pTimeout.d.ts +++ b/node_modules/jest-jasmine2/build/ts3.4/pTimeout.d.ts @@ -1,7 +1,7 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -export default function pTimeout(promise: Promise, ms: number, clearTimeout: NodeJS.Global['clearTimeout'], setTimeout: NodeJS.Global['setTimeout'], onTimeout: () => any): Promise; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +export default function pTimeout(promise: Promise, ms: number, clearTimeout: NodeJS.Global['clearTimeout'], setTimeout: NodeJS.Global['setTimeout'], onTimeout: () => any): Promise; diff --git a/node_modules/jest-jasmine2/build/ts3.4/queueRunner.d.ts b/node_modules/jest-jasmine2/build/ts3.4/queueRunner.d.ts index 9c60f33ab..fce2cc1b1 100644 --- a/node_modules/jest-jasmine2/build/ts3.4/queueRunner.d.ts +++ b/node_modules/jest-jasmine2/build/ts3.4/queueRunner.d.ts @@ -1,26 +1,26 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -declare type Global = NodeJS.Global; -export declare type Options = { - clearTimeout: Global['clearTimeout']; - fail: (error: Error) => void; - onException: (error: Error) => void; - queueableFns: Array; - setTimeout: Global['setTimeout']; - userContext: any; -}; -export declare type QueueableFn = { - fn: (done: (error?: any) => void) => void; - timeout?: () => number; - initError?: Error; -}; -export default function queueRunner(options: Options): { - cancel: any; - catch: (onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined) => Promise; - then: (onfulfilled?: ((value: void) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise; -}; -export {}; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +declare type Global = NodeJS.Global; +export declare type Options = { + clearTimeout: Global['clearTimeout']; + fail: (error: Error) => void; + onException: (error: Error) => void; + queueableFns: Array; + setTimeout: Global['setTimeout']; + userContext: any; +}; +export declare type QueueableFn = { + fn: (done: (error?: any) => void) => void; + timeout?: () => number; + initError?: Error; +}; +export default function queueRunner(options: Options): { + cancel: any; + catch: (onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined) => Promise; + then: (onfulfilled?: ((value: void) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise; +}; +export {}; diff --git a/node_modules/jest-jasmine2/build/ts3.4/reporter.d.ts b/node_modules/jest-jasmine2/build/ts3.4/reporter.d.ts index 66efb7bb2..8202a9d0b 100644 --- a/node_modules/jest-jasmine2/build/ts3.4/reporter.d.ts +++ b/node_modules/jest-jasmine2/build/ts3.4/reporter.d.ts @@ -1,31 +1,31 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import { Config } from '@jest/types'; -import { TestResult } from '@jest/test-result'; -import { SpecResult } from './jasmine/Spec'; -import { SuiteResult } from './jasmine/Suite'; -import { Reporter, RunDetails } from './types'; -export default class Jasmine2Reporter implements Reporter { - private _testResults; - private _globalConfig; - private _config; - private _currentSuites; - private _resolve; - private _resultsPromise; - private _startTimes; - private _testPath; - constructor(globalConfig: Config.GlobalConfig, config: Config.ProjectConfig, testPath: Config.Path); - jasmineStarted(_runDetails: RunDetails): void; - specStarted(spec: SpecResult): void; - specDone(result: SpecResult): void; - suiteStarted(suite: SuiteResult): void; - suiteDone(_result: SuiteResult): void; - jasmineDone(_runDetails: RunDetails): void; - getResults(): Promise; - private _addMissingMessageToStack; - private _extractSpecResults; -} +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import { Config } from '@jest/types'; +import { TestResult } from '@jest/test-result'; +import { SpecResult } from './jasmine/Spec'; +import { SuiteResult } from './jasmine/Suite'; +import { Reporter, RunDetails } from './types'; +export default class Jasmine2Reporter implements Reporter { + private _testResults; + private _globalConfig; + private _config; + private _currentSuites; + private _resolve; + private _resultsPromise; + private _startTimes; + private _testPath; + constructor(globalConfig: Config.GlobalConfig, config: Config.ProjectConfig, testPath: Config.Path); + jasmineStarted(_runDetails: RunDetails): void; + specStarted(spec: SpecResult): void; + specDone(result: SpecResult): void; + suiteStarted(suite: SuiteResult): void; + suiteDone(_result: SuiteResult): void; + jasmineDone(_runDetails: RunDetails): void; + getResults(): Promise; + private _addMissingMessageToStack; + private _extractSpecResults; +} diff --git a/node_modules/jest-jasmine2/build/ts3.4/setup_jest_globals.d.ts b/node_modules/jest-jasmine2/build/ts3.4/setup_jest_globals.d.ts index 036f0a672..47c5da1c4 100644 --- a/node_modules/jest-jasmine2/build/ts3.4/setup_jest_globals.d.ts +++ b/node_modules/jest-jasmine2/build/ts3.4/setup_jest_globals.d.ts @@ -1,16 +1,16 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import { Config } from '@jest/types'; -import { Plugin } from 'pretty-format'; -export declare type SetupOptions = { - config: Config.ProjectConfig; - globalConfig: Config.GlobalConfig; - localRequire: (moduleName: string) => Plugin; - testPath: Config.Path; -}; -declare const _default: ({ config, globalConfig, localRequire, testPath, }: SetupOptions) => import("jest-snapshot/build/State").default; -export default _default; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import { Config } from '@jest/types'; +import { Plugin } from 'pretty-format'; +export declare type SetupOptions = { + config: Config.ProjectConfig; + globalConfig: Config.GlobalConfig; + localRequire: (moduleName: string) => Plugin; + testPath: Config.Path; +}; +declare const _default: ({ config, globalConfig, localRequire, testPath, }: SetupOptions) => import("jest-snapshot/build/State").default; +export default _default; diff --git a/node_modules/jest-jasmine2/build/ts3.4/treeProcessor.d.ts b/node_modules/jest-jasmine2/build/ts3.4/treeProcessor.d.ts index dcbc50749..87b7a469c 100644 --- a/node_modules/jest-jasmine2/build/ts3.4/treeProcessor.d.ts +++ b/node_modules/jest-jasmine2/build/ts3.4/treeProcessor.d.ts @@ -1,26 +1,26 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import Suite from './jasmine/Suite'; -declare type Options = { - nodeComplete: (suite: TreeNode) => void; - nodeStart: (suite: TreeNode) => void; - queueRunnerFactory: any; - runnableIds: Array; - tree: TreeNode; -}; -export declare type TreeNode = { - afterAllFns: Array; - beforeAllFns: Array; - disabled?: boolean; - execute: (onComplete: () => void, enabled: boolean) => void; - id: string; - onException: (error: Error) => void; - sharedUserContext: () => any; - children?: Array; -} & Pick; -export default function treeProcessor(options: Options): void; -export {}; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import Suite from './jasmine/Suite'; +declare type Options = { + nodeComplete: (suite: TreeNode) => void; + nodeStart: (suite: TreeNode) => void; + queueRunnerFactory: any; + runnableIds: Array; + tree: TreeNode; +}; +export declare type TreeNode = { + afterAllFns: Array; + beforeAllFns: Array; + disabled?: boolean; + execute: (onComplete: () => void, enabled: boolean) => void; + id: string; + onException: (error: Error) => void; + sharedUserContext: () => any; + children?: Array; +} & Pick; +export default function treeProcessor(options: Options): void; +export {}; diff --git a/node_modules/jest-jasmine2/build/ts3.4/types.d.ts b/node_modules/jest-jasmine2/build/ts3.4/types.d.ts index 2169564ed..6bdf41493 100644 --- a/node_modules/jest-jasmine2/build/ts3.4/types.d.ts +++ b/node_modules/jest-jasmine2/build/ts3.4/types.d.ts @@ -1,73 +1,73 @@ -/// -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -/// -import { AssertionError } from 'assert'; -import { Config } from '@jest/types'; -import expect = require('expect'); -import { default as Spec, SpecResult } from './jasmine/Spec'; -import JsApiReporter from './jasmine/JsApiReporter'; -import Timer from './jasmine/Timer'; -import Env from './jasmine/Env'; -import createSpy from './jasmine/createSpy'; -import ReportDispatcher from './jasmine/ReportDispatcher'; -import SpyRegistry from './jasmine/spyRegistry'; -import { default as Suite, SuiteResult } from './jasmine/Suite'; -import SpyStrategy from './jasmine/SpyStrategy'; -import CallTracker from './jasmine/CallTracker'; -export interface AssertionErrorWithStack extends AssertionError { - stack: string; -} -export declare type SyncExpectationResult = { - pass: boolean; - message: () => string; -}; -export declare type AsyncExpectationResult = Promise; -export declare type ExpectationResult = SyncExpectationResult | AsyncExpectationResult; -export declare type RawMatcherFn = (expected: any, actual: any, options?: any) => ExpectationResult; -export declare type RunDetails = { - totalSpecsDefined?: number; - failedExpectations?: SuiteResult['failedExpectations']; -}; -export declare type Reporter = { - jasmineDone: (runDetails: RunDetails) => void; - jasmineStarted: (runDetails: RunDetails) => void; - specDone: (result: SpecResult) => void; - specStarted: (spec: SpecResult) => void; - suiteDone: (result: SuiteResult) => void; - suiteStarted: (result: SuiteResult) => void; -}; -export interface Spy extends Record { - (this: Record, ...args: Array): unknown; - and: SpyStrategy; - calls: CallTracker; - restoreObjectToOriginalState?: () => void; -} -export declare type Jasmine = { - _DEFAULT_TIMEOUT_INTERVAL: number; - DEFAULT_TIMEOUT_INTERVAL: number; - currentEnv_: ReturnType['prototype']; - getEnv: (options?: object) => ReturnType['prototype']; - createSpy: typeof createSpy; - Env: ReturnType; - JsApiReporter: typeof JsApiReporter; - ReportDispatcher: typeof ReportDispatcher; - Spec: typeof Spec; - SpyRegistry: typeof SpyRegistry; - Suite: typeof Suite; - Timer: typeof Timer; - version: string; - testPath: Config.Path; - addMatchers: Function; -} & typeof expect & NodeJS.Global; -declare global { - module NodeJS { - interface Global { - expect: typeof expect; - } - } -} +/// +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +/// +import { AssertionError } from 'assert'; +import { Config } from '@jest/types'; +import expect = require('expect'); +import { default as Spec, SpecResult } from './jasmine/Spec'; +import JsApiReporter from './jasmine/JsApiReporter'; +import Timer from './jasmine/Timer'; +import Env from './jasmine/Env'; +import createSpy from './jasmine/createSpy'; +import ReportDispatcher from './jasmine/ReportDispatcher'; +import SpyRegistry from './jasmine/spyRegistry'; +import { default as Suite, SuiteResult } from './jasmine/Suite'; +import SpyStrategy from './jasmine/SpyStrategy'; +import CallTracker from './jasmine/CallTracker'; +export interface AssertionErrorWithStack extends AssertionError { + stack: string; +} +export declare type SyncExpectationResult = { + pass: boolean; + message: () => string; +}; +export declare type AsyncExpectationResult = Promise; +export declare type ExpectationResult = SyncExpectationResult | AsyncExpectationResult; +export declare type RawMatcherFn = (expected: any, actual: any, options?: any) => ExpectationResult; +export declare type RunDetails = { + totalSpecsDefined?: number; + failedExpectations?: SuiteResult['failedExpectations']; +}; +export declare type Reporter = { + jasmineDone: (runDetails: RunDetails) => void; + jasmineStarted: (runDetails: RunDetails) => void; + specDone: (result: SpecResult) => void; + specStarted: (spec: SpecResult) => void; + suiteDone: (result: SuiteResult) => void; + suiteStarted: (result: SuiteResult) => void; +}; +export interface Spy extends Record { + (this: Record, ...args: Array): unknown; + and: SpyStrategy; + calls: CallTracker; + restoreObjectToOriginalState?: () => void; +} +export declare type Jasmine = { + _DEFAULT_TIMEOUT_INTERVAL: number; + DEFAULT_TIMEOUT_INTERVAL: number; + currentEnv_: ReturnType['prototype']; + getEnv: (options?: object) => ReturnType['prototype']; + createSpy: typeof createSpy; + Env: ReturnType; + JsApiReporter: typeof JsApiReporter; + ReportDispatcher: typeof ReportDispatcher; + Spec: typeof Spec; + SpyRegistry: typeof SpyRegistry; + Suite: typeof Suite; + Timer: typeof Timer; + version: string; + testPath: Config.Path; + addMatchers: Function; +} & typeof expect & NodeJS.Global; +declare global { + module NodeJS { + interface Global { + expect: typeof expect; + } + } +} diff --git a/node_modules/jest-leak-detector/build/ts3.4/index.d.ts b/node_modules/jest-leak-detector/build/ts3.4/index.d.ts index b9ad4a642..1eb340a68 100644 --- a/node_modules/jest-leak-detector/build/ts3.4/index.d.ts +++ b/node_modules/jest-leak-detector/build/ts3.4/index.d.ts @@ -1,12 +1,12 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -export default class { - private _isReferenceBeingHeld; - constructor(value: unknown); - isLeaking(): Promise; - private _runGarbageCollector; -} +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +export default class { + private _isReferenceBeingHeld; + constructor(value: unknown); + isLeaking(): Promise; + private _runGarbageCollector; +} diff --git a/node_modules/jest-matcher-utils/build/ts3.4/Replaceable.d.ts b/node_modules/jest-matcher-utils/build/ts3.4/Replaceable.d.ts index 2901cd4bd..c59eed3a6 100644 --- a/node_modules/jest-matcher-utils/build/ts3.4/Replaceable.d.ts +++ b/node_modules/jest-matcher-utils/build/ts3.4/Replaceable.d.ts @@ -1,17 +1,17 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -declare type ReplaceableForEachCallBack = (value: any, key: any, object: any) => void; -export default class Replaceable { - object: any; - type: string; - constructor(object: any); - static isReplaceable(obj1: any, obj2: any): boolean; - forEach(cb: ReplaceableForEachCallBack): void; - get(key: any): any; - set(key: any, value: any): void; -} -export {}; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +declare type ReplaceableForEachCallBack = (value: any, key: any, object: any) => void; +export default class Replaceable { + object: any; + type: string; + constructor(object: any); + static isReplaceable(obj1: any, obj2: any): boolean; + forEach(cb: ReplaceableForEachCallBack): void; + get(key: any): any; + set(key: any, value: any): void; +} +export {}; diff --git a/node_modules/jest-matcher-utils/build/ts3.4/deepCyclicCopyReplaceable.d.ts b/node_modules/jest-matcher-utils/build/ts3.4/deepCyclicCopyReplaceable.d.ts index 4c8e32ebd..1a0220731 100644 --- a/node_modules/jest-matcher-utils/build/ts3.4/deepCyclicCopyReplaceable.d.ts +++ b/node_modules/jest-matcher-utils/build/ts3.4/deepCyclicCopyReplaceable.d.ts @@ -1,7 +1,7 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -export default function deepCyclicCopyReplaceable(value: T, cycles?: WeakMap): T; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +export default function deepCyclicCopyReplaceable(value: T, cycles?: WeakMap): T; diff --git a/node_modules/jest-matcher-utils/build/ts3.4/index.d.ts b/node_modules/jest-matcher-utils/build/ts3.4/index.d.ts index 6581157d7..d2dbf5e8b 100644 --- a/node_modules/jest-matcher-utils/build/ts3.4/index.d.ts +++ b/node_modules/jest-matcher-utils/build/ts3.4/index.d.ts @@ -1,53 +1,53 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import chalk = require('chalk'); -import { DiffOptions as ImportDiffOptions } from 'jest-diff'; -declare type MatcherHintColor = (arg: string) => string; -export declare type MatcherHintOptions = { - comment?: string; - expectedColor?: MatcherHintColor; - isDirectExpectCall?: boolean; - isNot?: boolean; - promise?: string; - receivedColor?: MatcherHintColor; - secondArgument?: string; - secondArgumentColor?: MatcherHintColor; -}; -export declare type DiffOptions = ImportDiffOptions; -export declare const EXPECTED_COLOR: chalk.Chalk; -export declare const RECEIVED_COLOR: chalk.Chalk; -export declare const INVERTED_COLOR: chalk.Chalk; -export declare const BOLD_WEIGHT: chalk.Chalk; -export declare const DIM_COLOR: chalk.Chalk; -export declare const SUGGEST_TO_CONTAIN_EQUAL: string; -export declare const stringify: (object: unknown, maxDepth?: number) => string; -export declare const highlightTrailingWhitespace: (text: string) => string; -export declare const printReceived: (object: unknown) => string; -export declare const printExpected: (value: unknown) => string; -export declare const printWithType: (name: string, value: unknown, print: (value: unknown) => string) => string; -export declare const ensureNoExpected: (expected: unknown, matcherName: string, options?: MatcherHintOptions | undefined) => void; -/** - * Ensures that `actual` is of type `number | bigint` - */ -export declare const ensureActualIsNumber: (actual: unknown, matcherName: string, options?: MatcherHintOptions | undefined) => void; -/** - * Ensures that `expected` is of type `number | bigint` - */ -export declare const ensureExpectedIsNumber: (expected: unknown, matcherName: string, options?: MatcherHintOptions | undefined) => void; -/** - * Ensures that `actual` & `expected` are of type `number | bigint` - */ -export declare const ensureNumbers: (actual: unknown, expected: unknown, matcherName: string, options?: MatcherHintOptions | undefined) => void; -export declare const ensureExpectedIsNonNegativeInteger: (expected: unknown, matcherName: string, options?: MatcherHintOptions | undefined) => void; -export declare const printDiffOrStringify: (expected: unknown, received: unknown, expectedLabel: string, receivedLabel: string, expand: boolean) => string; -export declare const diff: (a: unknown, b: unknown, options?: ImportDiffOptions | undefined) => string | null; -export declare const pluralize: (word: string, count: number) => string; -declare type PrintLabel = (string: string) => string; -export declare const getLabelPrinter: (...strings: string[]) => PrintLabel; -export declare const matcherErrorMessage: (hint: string, generic: string, specific?: string | undefined) => string; -export declare const matcherHint: (matcherName: string, received?: string, expected?: string, options?: MatcherHintOptions) => string; -export {}; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import chalk = require('chalk'); +import { DiffOptions as ImportDiffOptions } from 'jest-diff'; +declare type MatcherHintColor = (arg: string) => string; +export declare type MatcherHintOptions = { + comment?: string; + expectedColor?: MatcherHintColor; + isDirectExpectCall?: boolean; + isNot?: boolean; + promise?: string; + receivedColor?: MatcherHintColor; + secondArgument?: string; + secondArgumentColor?: MatcherHintColor; +}; +export declare type DiffOptions = ImportDiffOptions; +export declare const EXPECTED_COLOR: chalk.Chalk; +export declare const RECEIVED_COLOR: chalk.Chalk; +export declare const INVERTED_COLOR: chalk.Chalk; +export declare const BOLD_WEIGHT: chalk.Chalk; +export declare const DIM_COLOR: chalk.Chalk; +export declare const SUGGEST_TO_CONTAIN_EQUAL: string; +export declare const stringify: (object: unknown, maxDepth?: number) => string; +export declare const highlightTrailingWhitespace: (text: string) => string; +export declare const printReceived: (object: unknown) => string; +export declare const printExpected: (value: unknown) => string; +export declare const printWithType: (name: string, value: unknown, print: (value: unknown) => string) => string; +export declare const ensureNoExpected: (expected: unknown, matcherName: string, options?: MatcherHintOptions | undefined) => void; +/** + * Ensures that `actual` is of type `number | bigint` + */ +export declare const ensureActualIsNumber: (actual: unknown, matcherName: string, options?: MatcherHintOptions | undefined) => void; +/** + * Ensures that `expected` is of type `number | bigint` + */ +export declare const ensureExpectedIsNumber: (expected: unknown, matcherName: string, options?: MatcherHintOptions | undefined) => void; +/** + * Ensures that `actual` & `expected` are of type `number | bigint` + */ +export declare const ensureNumbers: (actual: unknown, expected: unknown, matcherName: string, options?: MatcherHintOptions | undefined) => void; +export declare const ensureExpectedIsNonNegativeInteger: (expected: unknown, matcherName: string, options?: MatcherHintOptions | undefined) => void; +export declare const printDiffOrStringify: (expected: unknown, received: unknown, expectedLabel: string, receivedLabel: string, expand: boolean) => string; +export declare const diff: (a: unknown, b: unknown, options?: ImportDiffOptions | undefined) => string | null; +export declare const pluralize: (word: string, count: number) => string; +declare type PrintLabel = (string: string) => string; +export declare const getLabelPrinter: (...strings: string[]) => PrintLabel; +export declare const matcherErrorMessage: (hint: string, generic: string, specific?: string | undefined) => string; +export declare const matcherHint: (matcherName: string, received?: string, expected?: string, options?: MatcherHintOptions) => string; +export {}; diff --git a/node_modules/jest-message-util/build/ts3.4/index.d.ts b/node_modules/jest-message-util/build/ts3.4/index.d.ts index 59d78f1aa..26dc0029c 100644 --- a/node_modules/jest-message-util/build/ts3.4/index.d.ts +++ b/node_modules/jest-message-util/build/ts3.4/index.d.ts @@ -1,23 +1,23 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import { Config, TestResult } from '@jest/types'; -import { Frame } from './types'; -export { Frame } from './types'; -export declare type StackTraceConfig = Pick; -export declare type StackTraceOptions = { - noStackTrace: boolean; - noCodeFrame?: boolean; -}; -export declare const formatExecError: (error: string | Error | TestResult.SerializableError | undefined, config: Pick, options: StackTraceOptions, testPath?: string | undefined, reuseMessage?: boolean | undefined) => string; -export declare const getStackTraceLines: (stack: string, options?: StackTraceOptions) => string[]; -export declare const getTopFrame: (lines: string[]) => Frame | null; -export declare const formatStackTrace: (stack: string, config: Pick, options: StackTraceOptions, testPath?: string | undefined) => string; -export declare const formatResultsErrors: (testResults: TestResult.AssertionResult[], config: Pick, options: StackTraceOptions, testPath?: string | undefined) => string | null; -export declare const separateMessageFromStack: (content: string) => { - message: string; - stack: string; -}; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import { Config, TestResult } from '@jest/types'; +import { Frame } from './types'; +export { Frame } from './types'; +export declare type StackTraceConfig = Pick; +export declare type StackTraceOptions = { + noStackTrace: boolean; + noCodeFrame?: boolean; +}; +export declare const formatExecError: (error: string | Error | TestResult.SerializableError | undefined, config: Pick, options: StackTraceOptions, testPath?: string | undefined, reuseMessage?: boolean | undefined) => string; +export declare const getStackTraceLines: (stack: string, options?: StackTraceOptions) => string[]; +export declare const getTopFrame: (lines: string[]) => Frame | null; +export declare const formatStackTrace: (stack: string, config: Pick, options: StackTraceOptions, testPath?: string | undefined) => string; +export declare const formatResultsErrors: (testResults: TestResult.AssertionResult[], config: Pick, options: StackTraceOptions, testPath?: string | undefined) => string | null; +export declare const separateMessageFromStack: (content: string) => { + message: string; + stack: string; +}; diff --git a/node_modules/jest-message-util/build/ts3.4/types.d.ts b/node_modules/jest-message-util/build/ts3.4/types.d.ts index 70bf76e4c..3270e383f 100644 --- a/node_modules/jest-message-util/build/ts3.4/types.d.ts +++ b/node_modules/jest-message-util/build/ts3.4/types.d.ts @@ -1,10 +1,10 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import { StackData } from 'stack-utils'; -export interface Frame extends StackData { - file: string; -} +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import { StackData } from 'stack-utils'; +export interface Frame extends StackData { + file: string; +} diff --git a/node_modules/jest-mock/build/ts3.4/index.d.ts b/node_modules/jest-mock/build/ts3.4/index.d.ts index da33220d7..b9f7e1bd8 100644 --- a/node_modules/jest-mock/build/ts3.4/index.d.ts +++ b/node_modules/jest-mock/build/ts3.4/index.d.ts @@ -1,134 +1,134 @@ -/// -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -/// -declare type Global = NodeJS.Global; -declare namespace JestMock { - type ModuleMocker = ModuleMockerClass; - type MockFunctionMetadataType = 'object' | 'array' | 'regexp' | 'function' | 'constant' | 'collection' | 'null' | 'undefined'; - type MockFunctionMetadata, Type = MockFunctionMetadataType> = { - ref?: number; - members?: Record>; - mockImpl?: (...args: Y) => T; - name?: string; - refID?: number; - type?: Type; - value?: T; - length?: number; - }; -} -/** - * Possible types of a MockFunctionResult. - * 'return': The call completed by returning normally. - * 'throw': The call completed by throwing a value. - * 'incomplete': The call has not completed yet. This is possible if you read - * the mock function result from within the mock function itself - * (or a function called by the mock function). - */ -declare type MockFunctionResultType = 'return' | 'throw' | 'incomplete'; -/** - * Represents the result of a single call to a mock function. - */ -declare type MockFunctionResult = { - /** - * Indicates how the call completed. - */ - type: MockFunctionResultType; - /** - * The value that was either thrown or returned by the function. - * Undefined when type === 'incomplete'. - */ - value: unknown; -}; -declare type MockFunctionState> = { - calls: Array; - instances: Array; - invocationCallOrder: Array; - /** - * List of results of calls to the mock function. - */ - results: Array; -}; -declare type NonFunctionPropertyNames = { - [K in keyof T]: T[K] extends (...args: Array) => any ? never : K; -}[keyof T] & string; -declare type FunctionPropertyNames = { - [K in keyof T]: T[K] extends (...args: Array) => any ? K : never; -}[keyof T] & string; -interface Mock = Array> extends Function, MockInstance { - new (...args: Y): T; - (...args: Y): T; -} -interface SpyInstance> extends MockInstance { -} -interface MockInstance> { - _isMockFunction: true; - _protoImpl: Function; - getMockName(): string; - getMockImplementation(): Function | undefined; - mock: MockFunctionState; - mockClear(): this; - mockReset(): this; - mockRestore(): void; - mockImplementation(fn: (...args: Y) => T): this; - mockImplementation(fn: () => Promise): this; - mockImplementationOnce(fn: (...args: Y) => T): this; - mockImplementationOnce(fn: () => Promise): this; - mockName(name: string): this; - mockReturnThis(): this; - mockReturnValue(value: T): this; - mockReturnValueOnce(value: T): this; - mockResolvedValue(value: T): this; - mockResolvedValueOnce(value: T): this; - mockRejectedValue(value: T): this; - mockRejectedValueOnce(value: T): this; -} -declare class ModuleMockerClass { - private _environmentGlobal; - private _mockState; - private _mockConfigRegistry; - private _spyState; - private _invocationCallCounter; - ModuleMocker: typeof ModuleMockerClass; - /** - * @see README.md - * @param global Global object of the test environment, used to create - * mocks - */ - constructor(global: Global); - private _getSlots; - private _ensureMockConfig; - private _ensureMockState; - private _defaultMockConfig; - private _defaultMockState; - private _makeComponent; - private _createMockFunction; - private _generateMock; - /** - * @see README.md - * @param _metadata Metadata for the mock in the schema returned by the - * getMetadata method of this module. - */ - generateFromMetadata>(_metadata: JestMock.MockFunctionMetadata): Mock; - /** - * @see README.md - * @param component The component for which to retrieve metadata. - */ - getMetadata>(component: T, _refs?: Map): JestMock.MockFunctionMetadata | null; - isMockFunction(fn: any): fn is Mock; - fn>(implementation?: (...args: Y) => T): Mock; - spyOn>(object: T, methodName: M, accessType: 'get'): SpyInstance; - spyOn>(object: T, methodName: M, accessType: 'set'): SpyInstance; - spyOn>(object: T, methodName: M): T[M] extends (...args: Array) => any ? SpyInstance, Parameters> : never; - private _spyOnProperty; - clearAllMocks(): void; - resetAllMocks(): void; - restoreAllMocks(): void; - private _typeOf; -} -declare const JestMock: ModuleMockerClass; -export = JestMock; +/// +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +/// +declare type Global = NodeJS.Global; +declare namespace JestMock { + type ModuleMocker = ModuleMockerClass; + type MockFunctionMetadataType = 'object' | 'array' | 'regexp' | 'function' | 'constant' | 'collection' | 'null' | 'undefined'; + type MockFunctionMetadata, Type = MockFunctionMetadataType> = { + ref?: number; + members?: Record>; + mockImpl?: (...args: Y) => T; + name?: string; + refID?: number; + type?: Type; + value?: T; + length?: number; + }; +} +/** + * Possible types of a MockFunctionResult. + * 'return': The call completed by returning normally. + * 'throw': The call completed by throwing a value. + * 'incomplete': The call has not completed yet. This is possible if you read + * the mock function result from within the mock function itself + * (or a function called by the mock function). + */ +declare type MockFunctionResultType = 'return' | 'throw' | 'incomplete'; +/** + * Represents the result of a single call to a mock function. + */ +declare type MockFunctionResult = { + /** + * Indicates how the call completed. + */ + type: MockFunctionResultType; + /** + * The value that was either thrown or returned by the function. + * Undefined when type === 'incomplete'. + */ + value: unknown; +}; +declare type MockFunctionState> = { + calls: Array; + instances: Array; + invocationCallOrder: Array; + /** + * List of results of calls to the mock function. + */ + results: Array; +}; +declare type NonFunctionPropertyNames = { + [K in keyof T]: T[K] extends (...args: Array) => any ? never : K; +}[keyof T] & string; +declare type FunctionPropertyNames = { + [K in keyof T]: T[K] extends (...args: Array) => any ? K : never; +}[keyof T] & string; +interface Mock = Array> extends Function, MockInstance { + new (...args: Y): T; + (...args: Y): T; +} +interface SpyInstance> extends MockInstance { +} +interface MockInstance> { + _isMockFunction: true; + _protoImpl: Function; + getMockName(): string; + getMockImplementation(): Function | undefined; + mock: MockFunctionState; + mockClear(): this; + mockReset(): this; + mockRestore(): void; + mockImplementation(fn: (...args: Y) => T): this; + mockImplementation(fn: () => Promise): this; + mockImplementationOnce(fn: (...args: Y) => T): this; + mockImplementationOnce(fn: () => Promise): this; + mockName(name: string): this; + mockReturnThis(): this; + mockReturnValue(value: T): this; + mockReturnValueOnce(value: T): this; + mockResolvedValue(value: T): this; + mockResolvedValueOnce(value: T): this; + mockRejectedValue(value: T): this; + mockRejectedValueOnce(value: T): this; +} +declare class ModuleMockerClass { + private _environmentGlobal; + private _mockState; + private _mockConfigRegistry; + private _spyState; + private _invocationCallCounter; + ModuleMocker: typeof ModuleMockerClass; + /** + * @see README.md + * @param global Global object of the test environment, used to create + * mocks + */ + constructor(global: Global); + private _getSlots; + private _ensureMockConfig; + private _ensureMockState; + private _defaultMockConfig; + private _defaultMockState; + private _makeComponent; + private _createMockFunction; + private _generateMock; + /** + * @see README.md + * @param _metadata Metadata for the mock in the schema returned by the + * getMetadata method of this module. + */ + generateFromMetadata>(_metadata: JestMock.MockFunctionMetadata): Mock; + /** + * @see README.md + * @param component The component for which to retrieve metadata. + */ + getMetadata>(component: T, _refs?: Map): JestMock.MockFunctionMetadata | null; + isMockFunction(fn: any): fn is Mock; + fn>(implementation?: (...args: Y) => T): Mock; + spyOn>(object: T, methodName: M, accessType: 'get'): SpyInstance; + spyOn>(object: T, methodName: M, accessType: 'set'): SpyInstance; + spyOn>(object: T, methodName: M): T[M] extends (...args: Array) => any ? SpyInstance, Parameters> : never; + private _spyOnProperty; + clearAllMocks(): void; + resetAllMocks(): void; + restoreAllMocks(): void; + private _typeOf; +} +declare const JestMock: ModuleMockerClass; +export = JestMock; diff --git a/node_modules/jest-regex-util/build/ts3.4/index.d.ts b/node_modules/jest-regex-util/build/ts3.4/index.d.ts index 4f93f9498..cfe660e1f 100644 --- a/node_modules/jest-regex-util/build/ts3.4/index.d.ts +++ b/node_modules/jest-regex-util/build/ts3.4/index.d.ts @@ -1,11 +1,11 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ -export declare const escapePathForRegex: (dir: string) => string; -export declare const escapeStrForRegex: (string: string) => string; -export declare const replacePathSepForRegex: (string: string) => string; -//# sourceMappingURL=index.d.ts.map +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + */ +export declare const escapePathForRegex: (dir: string) => string; +export declare const escapeStrForRegex: (string: string) => string; +export declare const replacePathSepForRegex: (string: string) => string; +//# sourceMappingURL=index.d.ts.map diff --git a/node_modules/jest-resolve-dependencies/build/ts3.4/index.d.ts b/node_modules/jest-resolve-dependencies/build/ts3.4/index.d.ts index e63ee6b93..2461c46fa 100644 --- a/node_modules/jest-resolve-dependencies/build/ts3.4/index.d.ts +++ b/node_modules/jest-resolve-dependencies/build/ts3.4/index.d.ts @@ -1,30 +1,30 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import { Config } from '@jest/types'; -import { FS as HasteFS } from 'jest-haste-map'; -import Resolver = require('jest-resolve'); -import { SnapshotResolver } from 'jest-snapshot'; -declare namespace DependencyResolver { - type ResolvedModule = { - file: Config.Path; - dependencies: Array; - }; -} -/** - * DependencyResolver is used to resolve the direct dependencies of a module or - * to retrieve a list of all transitive inverse dependencies. - */ -declare class DependencyResolver { - private _hasteFS; - private _resolver; - private _snapshotResolver; - constructor(resolver: Resolver, hasteFS: HasteFS, snapshotResolver: SnapshotResolver); - resolve(file: Config.Path, options?: Resolver.ResolveModuleConfig): Array; - resolveInverseModuleMap(paths: Set, filter: (file: Config.Path) => boolean, options?: Resolver.ResolveModuleConfig): Array; - resolveInverse(paths: Set, filter: (file: Config.Path) => boolean, options?: Resolver.ResolveModuleConfig): Array; -} -export = DependencyResolver; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import { Config } from '@jest/types'; +import { FS as HasteFS } from 'jest-haste-map'; +import Resolver = require('jest-resolve'); +import { SnapshotResolver } from 'jest-snapshot'; +declare namespace DependencyResolver { + type ResolvedModule = { + file: Config.Path; + dependencies: Array; + }; +} +/** + * DependencyResolver is used to resolve the direct dependencies of a module or + * to retrieve a list of all transitive inverse dependencies. + */ +declare class DependencyResolver { + private _hasteFS; + private _resolver; + private _snapshotResolver; + constructor(resolver: Resolver, hasteFS: HasteFS, snapshotResolver: SnapshotResolver); + resolve(file: Config.Path, options?: Resolver.ResolveModuleConfig): Array; + resolveInverseModuleMap(paths: Set, filter: (file: Config.Path) => boolean, options?: Resolver.ResolveModuleConfig): Array; + resolveInverse(paths: Set, filter: (file: Config.Path) => boolean, options?: Resolver.ResolveModuleConfig): Array; +} +export = DependencyResolver; diff --git a/node_modules/jest-resolve/build/ts3.4/ModuleNotFoundError.d.ts b/node_modules/jest-resolve/build/ts3.4/ModuleNotFoundError.d.ts index 8232c06ca..a3cb70b9d 100644 --- a/node_modules/jest-resolve/build/ts3.4/ModuleNotFoundError.d.ts +++ b/node_modules/jest-resolve/build/ts3.4/ModuleNotFoundError.d.ts @@ -1,18 +1,18 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import { Config } from '@jest/types'; -export default class ModuleNotFoundError extends Error { - code: string; - hint?: string; - requireStack?: Array; - siblingWithSimilarExtensionFound?: boolean; - moduleName?: string; - private _originalMessage?; - constructor(message: string, moduleName?: string); - buildMessage(rootDir: Config.Path): void; - static duckType(error: ModuleNotFoundError): ModuleNotFoundError; -} +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import { Config } from '@jest/types'; +export default class ModuleNotFoundError extends Error { + code: string; + hint?: string; + requireStack?: Array; + siblingWithSimilarExtensionFound?: boolean; + moduleName?: string; + private _originalMessage?; + constructor(message: string, moduleName?: string); + buildMessage(rootDir: Config.Path): void; + static duckType(error: ModuleNotFoundError): ModuleNotFoundError; +} diff --git a/node_modules/jest-resolve/build/ts3.4/defaultResolver.d.ts b/node_modules/jest-resolve/build/ts3.4/defaultResolver.d.ts index 14fc91417..846e51b9d 100644 --- a/node_modules/jest-resolve/build/ts3.4/defaultResolver.d.ts +++ b/node_modules/jest-resolve/build/ts3.4/defaultResolver.d.ts @@ -1,19 +1,19 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import { Config } from '@jest/types'; -declare type ResolverOptions = { - basedir: Config.Path; - browser?: boolean; - defaultResolver: typeof defaultResolver; - extensions?: Array; - moduleDirectory?: Array; - paths?: Array; - rootDir?: Config.Path; -}; -export default function defaultResolver(path: Config.Path, options: ResolverOptions): Config.Path; -export declare function clearDefaultResolverCache(): void; -export {}; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import { Config } from '@jest/types'; +declare type ResolverOptions = { + basedir: Config.Path; + browser?: boolean; + defaultResolver: typeof defaultResolver; + extensions?: Array; + moduleDirectory?: Array; + paths?: Array; + rootDir?: Config.Path; +}; +export default function defaultResolver(path: Config.Path, options: ResolverOptions): Config.Path; +export declare function clearDefaultResolverCache(): void; +export {}; diff --git a/node_modules/jest-resolve/build/ts3.4/index.d.ts b/node_modules/jest-resolve/build/ts3.4/index.d.ts index 6d5de4215..8c4aafb24 100644 --- a/node_modules/jest-resolve/build/ts3.4/index.d.ts +++ b/node_modules/jest-resolve/build/ts3.4/index.d.ts @@ -1,59 +1,59 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import { Config } from '@jest/types'; -import { ModuleMap } from 'jest-haste-map'; -import { ResolverConfig } from './types'; -import ModuleNotFoundError from './ModuleNotFoundError'; -import shouldLoadAsEsm from './shouldLoadAsEsm'; -declare type FindNodeModuleConfig = { - basedir: Config.Path; - browser?: boolean; - extensions?: Array; - moduleDirectory?: Array; - paths?: Array; - resolver?: Config.Path | null; - rootDir?: Config.Path; - throwIfNotFound?: boolean; -}; -declare type BooleanObject = Record; -declare namespace Resolver { - type ResolveModuleConfig = { - skipNodeResolution?: boolean; - paths?: Array; - }; -} -declare class Resolver { - private readonly _options; - private readonly _moduleMap; - private readonly _moduleIDCache; - private readonly _moduleNameCache; - private readonly _modulePathCache; - private readonly _supportsNativePlatform; - constructor(moduleMap: ModuleMap, options: ResolverConfig); - static ModuleNotFoundError: typeof ModuleNotFoundError; - static tryCastModuleNotFoundError(error: unknown): ModuleNotFoundError | null; - static clearDefaultResolverCache(): void; - static findNodeModule(path: Config.Path, options: FindNodeModuleConfig): Config.Path | null; - static unstable_shouldLoadAsEsm: typeof shouldLoadAsEsm; - resolveModuleFromDirIfExists(dirname: Config.Path, moduleName: string, options?: Resolver.ResolveModuleConfig): Config.Path | null; - resolveModule(from: Config.Path, moduleName: string, options?: Resolver.ResolveModuleConfig): Config.Path; - private _isAliasModule; - isCoreModule(moduleName: string): boolean; - getModule(name: string): Config.Path | null; - getModulePath(from: Config.Path, moduleName: string): Config.Path; - getPackage(name: string): Config.Path | null; - getMockModule(from: Config.Path, name: string): Config.Path | null; - getModulePaths(from: Config.Path): Array; - getModuleID(virtualMocks: BooleanObject, from: Config.Path, _moduleName?: string): string; - private _getModuleType; - private _getAbsolutePath; - private _getMockPath; - private _getVirtualMockPath; - private _isModuleResolved; - resolveStubModuleName(from: Config.Path, moduleName: string): Config.Path | null; -} -export = Resolver; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import { Config } from '@jest/types'; +import { ModuleMap } from 'jest-haste-map'; +import { ResolverConfig } from './types'; +import ModuleNotFoundError from './ModuleNotFoundError'; +import shouldLoadAsEsm from './shouldLoadAsEsm'; +declare type FindNodeModuleConfig = { + basedir: Config.Path; + browser?: boolean; + extensions?: Array; + moduleDirectory?: Array; + paths?: Array; + resolver?: Config.Path | null; + rootDir?: Config.Path; + throwIfNotFound?: boolean; +}; +declare type BooleanObject = Record; +declare namespace Resolver { + type ResolveModuleConfig = { + skipNodeResolution?: boolean; + paths?: Array; + }; +} +declare class Resolver { + private readonly _options; + private readonly _moduleMap; + private readonly _moduleIDCache; + private readonly _moduleNameCache; + private readonly _modulePathCache; + private readonly _supportsNativePlatform; + constructor(moduleMap: ModuleMap, options: ResolverConfig); + static ModuleNotFoundError: typeof ModuleNotFoundError; + static tryCastModuleNotFoundError(error: unknown): ModuleNotFoundError | null; + static clearDefaultResolverCache(): void; + static findNodeModule(path: Config.Path, options: FindNodeModuleConfig): Config.Path | null; + static unstable_shouldLoadAsEsm: typeof shouldLoadAsEsm; + resolveModuleFromDirIfExists(dirname: Config.Path, moduleName: string, options?: Resolver.ResolveModuleConfig): Config.Path | null; + resolveModule(from: Config.Path, moduleName: string, options?: Resolver.ResolveModuleConfig): Config.Path; + private _isAliasModule; + isCoreModule(moduleName: string): boolean; + getModule(name: string): Config.Path | null; + getModulePath(from: Config.Path, moduleName: string): Config.Path; + getPackage(name: string): Config.Path | null; + getMockModule(from: Config.Path, name: string): Config.Path | null; + getModulePaths(from: Config.Path): Array; + getModuleID(virtualMocks: BooleanObject, from: Config.Path, _moduleName?: string): string; + private _getModuleType; + private _getAbsolutePath; + private _getMockPath; + private _getVirtualMockPath; + private _isModuleResolved; + resolveStubModuleName(from: Config.Path, moduleName: string): Config.Path | null; +} +export = Resolver; diff --git a/node_modules/jest-resolve/build/ts3.4/isBuiltinModule.d.ts b/node_modules/jest-resolve/build/ts3.4/isBuiltinModule.d.ts index 70ede3ee9..74b4d2892 100644 --- a/node_modules/jest-resolve/build/ts3.4/isBuiltinModule.d.ts +++ b/node_modules/jest-resolve/build/ts3.4/isBuiltinModule.d.ts @@ -1,7 +1,7 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -export default function isBuiltinModule(module: string): boolean; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +export default function isBuiltinModule(module: string): boolean; diff --git a/node_modules/jest-resolve/build/ts3.4/nodeModulesPaths.d.ts b/node_modules/jest-resolve/build/ts3.4/nodeModulesPaths.d.ts index 3e2f09857..b91dda1d6 100644 --- a/node_modules/jest-resolve/build/ts3.4/nodeModulesPaths.d.ts +++ b/node_modules/jest-resolve/build/ts3.4/nodeModulesPaths.d.ts @@ -1,15 +1,15 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * Adapted from: https://github.com/substack/node-resolve - */ -import { Config } from '@jest/types'; -declare type NodeModulesPathsOptions = { - moduleDirectory?: Array; - paths?: Array; -}; -export default function nodeModulesPaths(basedir: Config.Path, options: NodeModulesPathsOptions): Array; -export {}; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * Adapted from: https://github.com/substack/node-resolve + */ +import { Config } from '@jest/types'; +declare type NodeModulesPathsOptions = { + moduleDirectory?: Array; + paths?: Array; +}; +export default function nodeModulesPaths(basedir: Config.Path, options: NodeModulesPathsOptions): Array; +export {}; diff --git a/node_modules/jest-resolve/build/ts3.4/shouldLoadAsEsm.d.ts b/node_modules/jest-resolve/build/ts3.4/shouldLoadAsEsm.d.ts index 8526ed63e..622770c78 100644 --- a/node_modules/jest-resolve/build/ts3.4/shouldLoadAsEsm.d.ts +++ b/node_modules/jest-resolve/build/ts3.4/shouldLoadAsEsm.d.ts @@ -1,9 +1,9 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import { Config } from '@jest/types'; -export declare function clearCachedLookups(): void; -export default function cachedShouldLoadAsEsm(path: Config.Path): boolean; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import { Config } from '@jest/types'; +export declare function clearCachedLookups(): void; +export default function cachedShouldLoadAsEsm(path: Config.Path): boolean; diff --git a/node_modules/jest-resolve/build/ts3.4/types.d.ts b/node_modules/jest-resolve/build/ts3.4/types.d.ts index 641addd64..9e06ff6ca 100644 --- a/node_modules/jest-resolve/build/ts3.4/types.d.ts +++ b/node_modules/jest-resolve/build/ts3.4/types.d.ts @@ -1,24 +1,24 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import { Config } from '@jest/types'; -export declare type ResolverConfig = { - browser?: boolean; - defaultPlatform?: string | null; - extensions: Array; - hasCoreModules: boolean; - moduleDirectories: Array; - moduleNameMapper?: Array | null; - modulePaths?: Array; - platforms?: Array; - resolver?: Config.Path | null; - rootDir: Config.Path; -}; -declare type ModuleNameMapperConfig = { - regex: RegExp; - moduleName: string | Array; -}; -export {}; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import { Config } from '@jest/types'; +export declare type ResolverConfig = { + browser?: boolean; + defaultPlatform?: string | null; + extensions: Array; + hasCoreModules: boolean; + moduleDirectories: Array; + moduleNameMapper?: Array | null; + modulePaths?: Array; + platforms?: Array; + resolver?: Config.Path | null; + rootDir: Config.Path; +}; +declare type ModuleNameMapperConfig = { + regex: RegExp; + moduleName: string | Array; +}; +export {}; diff --git a/node_modules/jest-runner/build/ts3.4/index.d.ts b/node_modules/jest-runner/build/ts3.4/index.d.ts index 942369f37..c94b82a4e 100644 --- a/node_modules/jest-runner/build/ts3.4/index.d.ts +++ b/node_modules/jest-runner/build/ts3.4/index.d.ts @@ -1,27 +1,27 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import { Config } from '@jest/types'; -import { OnTestFailure as JestOnTestFailure, OnTestStart as JestOnTestStart, OnTestSuccess as JestOnTestSuccess, Test as JestTest, TestRunnerContext as JestTestRunnerContext, TestRunnerOptions as JestTestRunnerOptions, TestWatcher as JestTestWatcher } from './types'; -declare namespace TestRunner { - type Test = JestTest; - type OnTestFailure = JestOnTestFailure; - type OnTestStart = JestOnTestStart; - type OnTestSuccess = JestOnTestSuccess; - type TestWatcher = JestTestWatcher; - type TestRunnerContext = JestTestRunnerContext; - type TestRunnerOptions = JestTestRunnerOptions; -} -declare class TestRunner { - private _globalConfig; - private _context; - readonly isSerial?: boolean; - constructor(globalConfig: Config.GlobalConfig, context?: JestTestRunnerContext); - runTests(tests: Array, watcher: JestTestWatcher, onStart: JestOnTestStart, onResult: JestOnTestSuccess, onFailure: JestOnTestFailure, options: JestTestRunnerOptions): Promise; - private _createInBandTestRun; - private _createParallelTestRun; -} -export = TestRunner; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import { Config } from '@jest/types'; +import { OnTestFailure as JestOnTestFailure, OnTestStart as JestOnTestStart, OnTestSuccess as JestOnTestSuccess, Test as JestTest, TestRunnerContext as JestTestRunnerContext, TestRunnerOptions as JestTestRunnerOptions, TestWatcher as JestTestWatcher } from './types'; +declare namespace TestRunner { + type Test = JestTest; + type OnTestFailure = JestOnTestFailure; + type OnTestStart = JestOnTestStart; + type OnTestSuccess = JestOnTestSuccess; + type TestWatcher = JestTestWatcher; + type TestRunnerContext = JestTestRunnerContext; + type TestRunnerOptions = JestTestRunnerOptions; +} +declare class TestRunner { + private _globalConfig; + private _context; + readonly isSerial?: boolean; + constructor(globalConfig: Config.GlobalConfig, context?: JestTestRunnerContext); + runTests(tests: Array, watcher: JestTestWatcher, onStart: JestOnTestStart, onResult: JestOnTestSuccess, onFailure: JestOnTestFailure, options: JestTestRunnerOptions): Promise; + private _createInBandTestRun; + private _createParallelTestRun; +} +export = TestRunner; diff --git a/node_modules/jest-runner/build/ts3.4/runTest.d.ts b/node_modules/jest-runner/build/ts3.4/runTest.d.ts index b410ea792..a5bc38a2c 100644 --- a/node_modules/jest-runner/build/ts3.4/runTest.d.ts +++ b/node_modules/jest-runner/build/ts3.4/runTest.d.ts @@ -1,12 +1,12 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ -import { Config } from '@jest/types'; -import { TestResult } from '@jest/test-result'; -import Resolver = require('jest-resolve'); -import { TestRunnerContext } from './types'; -export default function runTest(path: Config.Path, globalConfig: Config.GlobalConfig, config: Config.ProjectConfig, resolver: Resolver, context?: TestRunnerContext): Promise; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + */ +import { Config } from '@jest/types'; +import { TestResult } from '@jest/test-result'; +import Resolver = require('jest-resolve'); +import { TestRunnerContext } from './types'; +export default function runTest(path: Config.Path, globalConfig: Config.GlobalConfig, config: Config.ProjectConfig, resolver: Resolver, context?: TestRunnerContext): Promise; diff --git a/node_modules/jest-runner/build/ts3.4/testWorker.d.ts b/node_modules/jest-runner/build/ts3.4/testWorker.d.ts index 3252932af..f2b758c00 100644 --- a/node_modules/jest-runner/build/ts3.4/testWorker.d.ts +++ b/node_modules/jest-runner/build/ts3.4/testWorker.d.ts @@ -1,26 +1,26 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ -import { Config } from '@jest/types'; -import { TestResult } from '@jest/test-result'; -import HasteMap = require('jest-haste-map'); -import { TestRunnerSerializedContext } from './types'; -export declare type SerializableResolver = { - config: Config.ProjectConfig; - serializableModuleMap: HasteMap.SerializableModuleMap; -}; -declare type WorkerData = { - config: Config.ProjectConfig; - globalConfig: Config.GlobalConfig; - path: Config.Path; - context?: TestRunnerSerializedContext; -}; -export declare function setup(setupData: { - serializableResolvers: Array; -}): void; -export declare function worker({ config, globalConfig, path, context, }: WorkerData): Promise; -export {}; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + */ +import { Config } from '@jest/types'; +import { TestResult } from '@jest/test-result'; +import HasteMap = require('jest-haste-map'); +import { TestRunnerSerializedContext } from './types'; +export declare type SerializableResolver = { + config: Config.ProjectConfig; + serializableModuleMap: HasteMap.SerializableModuleMap; +}; +declare type WorkerData = { + config: Config.ProjectConfig; + globalConfig: Config.GlobalConfig; + path: Config.Path; + context?: TestRunnerSerializedContext; +}; +export declare function setup(setupData: { + serializableResolvers: Array; +}): void; +export declare function worker({ config, globalConfig, path, context, }: WorkerData): Promise; +export {}; diff --git a/node_modules/jest-runner/build/ts3.4/types.d.ts b/node_modules/jest-runner/build/ts3.4/types.d.ts index 3341024f4..5c909b2e6 100644 --- a/node_modules/jest-runner/build/ts3.4/types.d.ts +++ b/node_modules/jest-runner/build/ts3.4/types.d.ts @@ -1,53 +1,53 @@ -/// -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -/// -import { EventEmitter } from 'events'; -import { Config } from '@jest/types'; -import { SerializableError, TestResult } from '@jest/test-result'; -import { JestEnvironment } from '@jest/environment'; -import { FS as HasteFS, ModuleMap } from 'jest-haste-map'; -import HasteResolver = require('jest-resolve'); -import Runtime = require('jest-runtime'); -export declare type ErrorWithCode = Error & { - code?: string; -}; -export declare type Test = { - context: Context; - duration?: number; - path: Config.Path; -}; -export declare type Context = { - config: Config.ProjectConfig; - hasteFS: HasteFS; - moduleMap: ModuleMap; - resolver: HasteResolver; -}; -export declare type OnTestStart = (test: Test) => Promise; -export declare type OnTestFailure = (test: Test, serializableError: SerializableError) => Promise; -export declare type OnTestSuccess = (test: Test, testResult: TestResult) => Promise; -export declare type TestFramework = (globalConfig: Config.GlobalConfig, config: Config.ProjectConfig, environment: JestEnvironment, runtime: Runtime, testPath: string) => Promise; -export declare type TestRunnerOptions = { - serial: boolean; -}; -export declare type TestRunnerContext = { - changedFiles?: Set; - sourcesRelatedToTestsInChangedFiles?: Set; -}; -export declare type TestRunnerSerializedContext = { - changedFiles?: Array; - sourcesRelatedToTestsInChangedFiles?: Array; -}; -export declare type WatcherState = { - interrupted: boolean; -}; -export interface TestWatcher extends EventEmitter { - state: WatcherState; - setState(state: WatcherState): void; - isInterrupted(): boolean; - isWatchMode(): boolean; -} +/// +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +/// +import { EventEmitter } from 'events'; +import { Config } from '@jest/types'; +import { SerializableError, TestResult } from '@jest/test-result'; +import { JestEnvironment } from '@jest/environment'; +import { FS as HasteFS, ModuleMap } from 'jest-haste-map'; +import HasteResolver = require('jest-resolve'); +import Runtime = require('jest-runtime'); +export declare type ErrorWithCode = Error & { + code?: string; +}; +export declare type Test = { + context: Context; + duration?: number; + path: Config.Path; +}; +export declare type Context = { + config: Config.ProjectConfig; + hasteFS: HasteFS; + moduleMap: ModuleMap; + resolver: HasteResolver; +}; +export declare type OnTestStart = (test: Test) => Promise; +export declare type OnTestFailure = (test: Test, serializableError: SerializableError) => Promise; +export declare type OnTestSuccess = (test: Test, testResult: TestResult) => Promise; +export declare type TestFramework = (globalConfig: Config.GlobalConfig, config: Config.ProjectConfig, environment: JestEnvironment, runtime: Runtime, testPath: string) => Promise; +export declare type TestRunnerOptions = { + serial: boolean; +}; +export declare type TestRunnerContext = { + changedFiles?: Set; + sourcesRelatedToTestsInChangedFiles?: Set; +}; +export declare type TestRunnerSerializedContext = { + changedFiles?: Array; + sourcesRelatedToTestsInChangedFiles?: Array; +}; +export declare type WatcherState = { + interrupted: boolean; +}; +export interface TestWatcher extends EventEmitter { + state: WatcherState; + setState(state: WatcherState): void; + isInterrupted(): boolean; + isWatchMode(): boolean; +} diff --git a/node_modules/jest-runtime/bin/jest-runtime.js b/node_modules/jest-runtime/bin/jest-runtime.js old mode 100644 new mode 100755 diff --git a/node_modules/jest-runtime/build/ts3.4/cli/args.d.ts b/node_modules/jest-runtime/build/ts3.4/cli/args.d.ts index 0211a26e3..f5191ee83 100644 --- a/node_modules/jest-runtime/build/ts3.4/cli/args.d.ts +++ b/node_modules/jest-runtime/build/ts3.4/cli/args.d.ts @@ -1,9 +1,9 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import { Options } from 'yargs'; -export declare const usage = "Usage: $0 [--config=] "; -export declare const options: Record<'cache' | 'config' | 'debug' | 'version' | 'watchman', Options>; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import { Options } from 'yargs'; +export declare const usage = "Usage: $0 [--config=] "; +export declare const options: Record<'cache' | 'config' | 'debug' | 'version' | 'watchman', Options>; diff --git a/node_modules/jest-runtime/build/ts3.4/cli/index.d.ts b/node_modules/jest-runtime/build/ts3.4/cli/index.d.ts index f11dacf98..caae1df58 100644 --- a/node_modules/jest-runtime/build/ts3.4/cli/index.d.ts +++ b/node_modules/jest-runtime/build/ts3.4/cli/index.d.ts @@ -1,8 +1,8 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import { Config } from '@jest/types'; -export declare function run(cliArgv?: Config.Argv, cliInfo?: Array): Promise; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import { Config } from '@jest/types'; +export declare function run(cliArgv?: Config.Argv, cliInfo?: Array): Promise; diff --git a/node_modules/jest-runtime/build/ts3.4/helpers.d.ts b/node_modules/jest-runtime/build/ts3.4/helpers.d.ts index 8529b38f8..49edfd672 100644 --- a/node_modules/jest-runtime/build/ts3.4/helpers.d.ts +++ b/node_modules/jest-runtime/build/ts3.4/helpers.d.ts @@ -1,7 +1,7 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -export declare const findSiblingsWithFileExtension: (moduleFileExtensions: string[], from: string, moduleName: string) => string; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +export declare const findSiblingsWithFileExtension: (moduleFileExtensions: string[], from: string, moduleName: string) => string; diff --git a/node_modules/jest-runtime/build/ts3.4/index.d.ts b/node_modules/jest-runtime/build/ts3.4/index.d.ts index a07140965..cb8e6dded 100644 --- a/node_modules/jest-runtime/build/ts3.4/index.d.ts +++ b/node_modules/jest-runtime/build/ts3.4/index.d.ts @@ -1,124 +1,124 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import { Config } from '@jest/types'; -import { JestEnvironment } from '@jest/environment'; -import { SourceMapRegistry } from '@jest/source-map'; -import { ShouldInstrumentOptions, shouldInstrument } from '@jest/transform'; -import { V8CoverageResult } from '@jest/test-result'; -import { options as cliOptions } from './cli/args'; -import { Context as JestContext } from './types'; -import HasteMap = require('jest-haste-map'); -import Resolver = require('jest-resolve'); -declare type HasteMapOptions = { - console?: Console; - maxWorkers: number; - resetCache: boolean; - watch?: boolean; - watchman: boolean; -}; -declare type InternalModuleOptions = { - isInternalModule: boolean; - supportsDynamicImport: boolean; - supportsStaticESM: boolean; -}; -declare namespace Runtime { - type Context = JestContext; - type RuntimeType = Runtime; -} -declare class Runtime { - private _cacheFS; - private _config; - private _coverageOptions; - private _currentlyExecutingModulePath; - private _environment; - private _explicitShouldMock; - private _internalModuleRegistry; - private _isCurrentlyExecutingManualMock; - private _mockFactories; - private _mockMetaDataCache; - private _mockRegistry; - private _isolatedMockRegistry; - private _moduleMocker; - private _isolatedModuleRegistry; - private _moduleRegistry; - private _esmoduleRegistry; - private _resolver; - private _shouldAutoMock; - private _shouldMockModuleCache; - private _shouldUnmockTransitiveDependenciesCache; - private _sourceMapRegistry; - private _scriptTransformer; - private _fileTransforms; - private _v8CoverageInstrumenter; - private _v8CoverageResult; - private _transitiveShouldMock; - private _unmockList; - private _virtualMocks; - private _moduleImplementation?; - private jestObjectCaches; - constructor(config: Config.ProjectConfig, environment: JestEnvironment, resolver: Resolver, cacheFS?: Record, coverageOptions?: ShouldInstrumentOptions); - static shouldInstrument: typeof shouldInstrument; - static createContext(config: Config.ProjectConfig, options: { - console?: Console; - maxWorkers: number; - watch?: boolean; - watchman: boolean; - }): Promise; - static createHasteMap(config: Config.ProjectConfig, options?: HasteMapOptions): HasteMap; - static createResolver(config: Config.ProjectConfig, moduleMap: HasteMap.ModuleMap): Resolver; - static runCLI(args?: Config.Argv, info?: Array): Promise; - static getCLIOptions(): typeof cliOptions; - unstable_shouldLoadAsEsm: typeof import("jest-resolve/build/shouldLoadAsEsm").default; - private loadEsmModule; - private linkModules; - unstable_importModule(from: Config.Path, moduleName?: string): Promise; - private loadCjsAsEsm; - requireModule(from: Config.Path, moduleName?: string, options?: InternalModuleOptions, isRequireActual?: boolean | null): T; - requireInternalModule(from: Config.Path, to?: string): T; - requireActual(from: Config.Path, moduleName: string): T; - requireMock(from: Config.Path, moduleName: string): T; - private _loadModule; - private _getFullTransformationOptions; - requireModuleOrMock(from: Config.Path, moduleName: string): T; - isolateModules(fn: () => void): void; - resetModules(): void; - collectV8Coverage(): Promise; - stopCollectingV8Coverage(): Promise; - getAllCoverageInfoCopy(): JestEnvironment['global']['__coverage__']; - getAllV8CoverageInfoCopy(): V8CoverageResult; - getSourceMapInfo(_coveredFiles: Set): Record; - getSourceMaps(): SourceMapRegistry; - setMock(from: string, moduleName: string, mockFactory: () => unknown, options?: { - virtual?: boolean; - }): void; - restoreAllMocks(): void; - resetAllMocks(): void; - clearAllMocks(): void; - teardown(): void; - private _resolveModule; - private _requireResolve; - private _requireResolvePaths; - private _execModule; - private transformFile; - private createScriptFromCode; - private _requireCoreModule; - private _importCoreModule; - private _getMockedNativeModule; - private _generateMock; - private _shouldMock; - private _createRequireImplementation; - private _createJestObjectFor; - private _logFormattedReferenceError; - private wrapCodeInModuleWrapper; - private constructInjectedModuleParameters; - private handleExecutionError; - private getGlobalsForCjs; - private getGlobalsForEsm; - private getGlobalsFromEnvironment; - private readFile; -} -export = Runtime; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import { Config } from '@jest/types'; +import { JestEnvironment } from '@jest/environment'; +import { SourceMapRegistry } from '@jest/source-map'; +import { ShouldInstrumentOptions, shouldInstrument } from '@jest/transform'; +import { V8CoverageResult } from '@jest/test-result'; +import { options as cliOptions } from './cli/args'; +import { Context as JestContext } from './types'; +import HasteMap = require('jest-haste-map'); +import Resolver = require('jest-resolve'); +declare type HasteMapOptions = { + console?: Console; + maxWorkers: number; + resetCache: boolean; + watch?: boolean; + watchman: boolean; +}; +declare type InternalModuleOptions = { + isInternalModule: boolean; + supportsDynamicImport: boolean; + supportsStaticESM: boolean; +}; +declare namespace Runtime { + type Context = JestContext; + type RuntimeType = Runtime; +} +declare class Runtime { + private _cacheFS; + private _config; + private _coverageOptions; + private _currentlyExecutingModulePath; + private _environment; + private _explicitShouldMock; + private _internalModuleRegistry; + private _isCurrentlyExecutingManualMock; + private _mockFactories; + private _mockMetaDataCache; + private _mockRegistry; + private _isolatedMockRegistry; + private _moduleMocker; + private _isolatedModuleRegistry; + private _moduleRegistry; + private _esmoduleRegistry; + private _resolver; + private _shouldAutoMock; + private _shouldMockModuleCache; + private _shouldUnmockTransitiveDependenciesCache; + private _sourceMapRegistry; + private _scriptTransformer; + private _fileTransforms; + private _v8CoverageInstrumenter; + private _v8CoverageResult; + private _transitiveShouldMock; + private _unmockList; + private _virtualMocks; + private _moduleImplementation?; + private jestObjectCaches; + constructor(config: Config.ProjectConfig, environment: JestEnvironment, resolver: Resolver, cacheFS?: Record, coverageOptions?: ShouldInstrumentOptions); + static shouldInstrument: typeof shouldInstrument; + static createContext(config: Config.ProjectConfig, options: { + console?: Console; + maxWorkers: number; + watch?: boolean; + watchman: boolean; + }): Promise; + static createHasteMap(config: Config.ProjectConfig, options?: HasteMapOptions): HasteMap; + static createResolver(config: Config.ProjectConfig, moduleMap: HasteMap.ModuleMap): Resolver; + static runCLI(args?: Config.Argv, info?: Array): Promise; + static getCLIOptions(): typeof cliOptions; + unstable_shouldLoadAsEsm: typeof import("jest-resolve/build/shouldLoadAsEsm").default; + private loadEsmModule; + private linkModules; + unstable_importModule(from: Config.Path, moduleName?: string): Promise; + private loadCjsAsEsm; + requireModule(from: Config.Path, moduleName?: string, options?: InternalModuleOptions, isRequireActual?: boolean | null): T; + requireInternalModule(from: Config.Path, to?: string): T; + requireActual(from: Config.Path, moduleName: string): T; + requireMock(from: Config.Path, moduleName: string): T; + private _loadModule; + private _getFullTransformationOptions; + requireModuleOrMock(from: Config.Path, moduleName: string): T; + isolateModules(fn: () => void): void; + resetModules(): void; + collectV8Coverage(): Promise; + stopCollectingV8Coverage(): Promise; + getAllCoverageInfoCopy(): JestEnvironment['global']['__coverage__']; + getAllV8CoverageInfoCopy(): V8CoverageResult; + getSourceMapInfo(_coveredFiles: Set): Record; + getSourceMaps(): SourceMapRegistry; + setMock(from: string, moduleName: string, mockFactory: () => unknown, options?: { + virtual?: boolean; + }): void; + restoreAllMocks(): void; + resetAllMocks(): void; + clearAllMocks(): void; + teardown(): void; + private _resolveModule; + private _requireResolve; + private _requireResolvePaths; + private _execModule; + private transformFile; + private createScriptFromCode; + private _requireCoreModule; + private _importCoreModule; + private _getMockedNativeModule; + private _generateMock; + private _shouldMock; + private _createRequireImplementation; + private _createJestObjectFor; + private _logFormattedReferenceError; + private wrapCodeInModuleWrapper; + private constructInjectedModuleParameters; + private handleExecutionError; + private getGlobalsForCjs; + private getGlobalsForEsm; + private getGlobalsFromEnvironment; + private readFile; +} +export = Runtime; diff --git a/node_modules/jest-runtime/build/ts3.4/types.d.ts b/node_modules/jest-runtime/build/ts3.4/types.d.ts index 40825fa34..5e805dfb7 100644 --- a/node_modules/jest-runtime/build/ts3.4/types.d.ts +++ b/node_modules/jest-runtime/build/ts3.4/types.d.ts @@ -1,15 +1,15 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import { Config } from '@jest/types'; -import HasteResolver = require('jest-resolve'); -import { FS as HasteFS, ModuleMap } from 'jest-haste-map'; -export declare type Context = { - config: Config.ProjectConfig; - hasteFS: HasteFS; - moduleMap: ModuleMap; - resolver: HasteResolver; -}; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import { Config } from '@jest/types'; +import HasteResolver = require('jest-resolve'); +import { FS as HasteFS, ModuleMap } from 'jest-haste-map'; +export declare type Context = { + config: Config.ProjectConfig; + hasteFS: HasteFS; + moduleMap: ModuleMap; + resolver: HasteResolver; +}; diff --git a/node_modules/jest-runtime/build/ts3.4/version.d.ts b/node_modules/jest-runtime/build/ts3.4/version.d.ts index f74a8838d..695b66319 100644 --- a/node_modules/jest-runtime/build/ts3.4/version.d.ts +++ b/node_modules/jest-runtime/build/ts3.4/version.d.ts @@ -1,7 +1,7 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -export declare const VERSION: string; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +export declare const VERSION: string; diff --git a/node_modules/jest-serializer/build/ts3.4/index.d.ts b/node_modules/jest-serializer/build/ts3.4/index.d.ts index 54a71aaf5..159ff4cb7 100644 --- a/node_modules/jest-serializer/build/ts3.4/index.d.ts +++ b/node_modules/jest-serializer/build/ts3.4/index.d.ts @@ -1,22 +1,22 @@ -/// -/// -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -/// -/// -declare type Path = string; -export declare function deserialize(buffer: Buffer): any; -export declare function serialize(content: unknown): Buffer; -export declare function readFileSync(filePath: Path): any; -export declare function writeFileSync(filePath: Path, content: unknown): void; -declare const _default: { - deserialize: typeof deserialize; - readFileSync: typeof readFileSync; - serialize: typeof serialize; - writeFileSync: typeof writeFileSync; -}; -export default _default; +/// +/// +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +/// +/// +declare type Path = string; +export declare function deserialize(buffer: Buffer): any; +export declare function serialize(content: unknown): Buffer; +export declare function readFileSync(filePath: Path): any; +export declare function writeFileSync(filePath: Path, content: unknown): void; +declare const _default: { + deserialize: typeof deserialize; + readFileSync: typeof readFileSync; + serialize: typeof serialize; + writeFileSync: typeof writeFileSync; +}; +export default _default; diff --git a/node_modules/jest-snapshot/build/ts3.4/State.d.ts b/node_modules/jest-snapshot/build/ts3.4/State.d.ts index ebeb420a4..64189ac92 100644 --- a/node_modules/jest-snapshot/build/ts3.4/State.d.ts +++ b/node_modules/jest-snapshot/build/ts3.4/State.d.ts @@ -1,61 +1,61 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import { Config } from '@jest/types'; -export declare type SnapshotStateOptions = { - updateSnapshot: Config.SnapshotUpdateState; - getPrettier: () => null | typeof import('prettier'); - getBabelTraverse: () => Function; - expand?: boolean; -}; -export declare type SnapshotMatchOptions = { - testName: string; - received: unknown; - key?: string; - inlineSnapshot?: string; - isInline: boolean; - error?: Error; -}; -declare type SnapshotReturnOptions = { - actual: string; - count: number; - expected?: string; - key: string; - pass: boolean; -}; -declare type SaveStatus = { - deleted: boolean; - saved: boolean; -}; -export default class SnapshotState { - private _counters; - private _dirty; - private _index; - private _updateSnapshot; - private _snapshotData; - private _initialData; - private _snapshotPath; - private _inlineSnapshots; - private _uncheckedKeys; - private _getBabelTraverse; - private _getPrettier; - added: number; - expand: boolean; - matched: number; - unmatched: number; - updated: number; - constructor(snapshotPath: Config.Path, options: SnapshotStateOptions); - markSnapshotsAsCheckedForTest(testName: string): void; - private _addSnapshot; - clear(): void; - save(): SaveStatus; - getUncheckedCount(): number; - getUncheckedKeys(): Array; - removeUncheckedKeys(): void; - match({ testName, received, key, inlineSnapshot, isInline, error, }: SnapshotMatchOptions): SnapshotReturnOptions; - fail(testName: string, _received: unknown, key?: string): string; -} -export {}; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import { Config } from '@jest/types'; +export declare type SnapshotStateOptions = { + updateSnapshot: Config.SnapshotUpdateState; + getPrettier: () => null | typeof import('prettier'); + getBabelTraverse: () => Function; + expand?: boolean; +}; +export declare type SnapshotMatchOptions = { + testName: string; + received: unknown; + key?: string; + inlineSnapshot?: string; + isInline: boolean; + error?: Error; +}; +declare type SnapshotReturnOptions = { + actual: string; + count: number; + expected?: string; + key: string; + pass: boolean; +}; +declare type SaveStatus = { + deleted: boolean; + saved: boolean; +}; +export default class SnapshotState { + private _counters; + private _dirty; + private _index; + private _updateSnapshot; + private _snapshotData; + private _initialData; + private _snapshotPath; + private _inlineSnapshots; + private _uncheckedKeys; + private _getBabelTraverse; + private _getPrettier; + added: number; + expand: boolean; + matched: number; + unmatched: number; + updated: number; + constructor(snapshotPath: Config.Path, options: SnapshotStateOptions); + markSnapshotsAsCheckedForTest(testName: string): void; + private _addSnapshot; + clear(): void; + save(): SaveStatus; + getUncheckedCount(): number; + getUncheckedKeys(): Array; + removeUncheckedKeys(): void; + match({ testName, received, key, inlineSnapshot, isInline, error, }: SnapshotMatchOptions): SnapshotReturnOptions; + fail(testName: string, _received: unknown, key?: string): string; +} +export {}; diff --git a/node_modules/jest-snapshot/build/ts3.4/colors.d.ts b/node_modules/jest-snapshot/build/ts3.4/colors.d.ts index 23e290582..b061bc83c 100644 --- a/node_modules/jest-snapshot/build/ts3.4/colors.d.ts +++ b/node_modules/jest-snapshot/build/ts3.4/colors.d.ts @@ -1,15 +1,15 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -export declare const aForeground2 = 90; -export declare const aBackground2 = 225; -export declare const bForeground2 = 23; -export declare const bBackground2 = 195; -export declare type RGB = [number, number, number]; -export declare const aForeground3: RGB; -export declare const aBackground3: RGB; -export declare const bForeground3: RGB; -export declare const bBackground3: RGB; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +export declare const aForeground2 = 90; +export declare const aBackground2 = 225; +export declare const bForeground2 = 23; +export declare const bBackground2 = 195; +export declare type RGB = [number, number, number]; +export declare const aForeground3: RGB; +export declare const aBackground3: RGB; +export declare const bForeground3: RGB; +export declare const bBackground3: RGB; diff --git a/node_modules/jest-snapshot/build/ts3.4/dedentLines.d.ts b/node_modules/jest-snapshot/build/ts3.4/dedentLines.d.ts index 0a3ea2111..e97d8c993 100644 --- a/node_modules/jest-snapshot/build/ts3.4/dedentLines.d.ts +++ b/node_modules/jest-snapshot/build/ts3.4/dedentLines.d.ts @@ -1,7 +1,7 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -export declare const dedentLines: (input: string[]) => string[] | null; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +export declare const dedentLines: (input: string[]) => string[] | null; diff --git a/node_modules/jest-snapshot/build/ts3.4/index.d.ts b/node_modules/jest-snapshot/build/ts3.4/index.d.ts index 6a1268bad..29ccc71a2 100644 --- a/node_modules/jest-snapshot/build/ts3.4/index.d.ts +++ b/node_modules/jest-snapshot/build/ts3.4/index.d.ts @@ -1,105 +1,105 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import { Config } from '@jest/types'; -import { SnapshotResolver as JestSnapshotResolver } from './snapshot_resolver'; -import SnapshotState from './State'; -import { Context } from './types'; -import * as utils from './utils'; -declare const JestSnapshot: { - EXTENSION: string; - SnapshotState: typeof SnapshotState; - addSerializer: (plugin: import("pretty-format/build/types").Plugin) => void; - buildSnapshotResolver: (config: Config.ProjectConfig) => JestSnapshotResolver; - cleanup: (hasteFS: import("jest-haste-map/build/HasteFS").default, update: Config.SnapshotUpdateState, snapshotResolver: JestSnapshotResolver, testPathIgnorePatterns?: string[] | undefined) => { - filesRemoved: number; - filesRemovedList: string[]; - }; - getSerializers: () => import("pretty-format/build/types").Plugins; - isSnapshotPath: (path: string) => boolean; - toMatchInlineSnapshot: (this: Context, received: any, propertiesOrSnapshot?: string | object | undefined, inlineSnapshot?: string | undefined) => { - message: () => string; - name: string; - pass: boolean; - actual?: undefined; - expected?: undefined; - } | { - message: () => string; - pass: boolean; - name?: undefined; - actual?: undefined; - expected?: undefined; - } | { - actual: string; - expected: string | undefined; - message: () => string; - name: string; - pass: boolean; - }; - toMatchSnapshot: (this: Context, received: any, propertiesOrHint?: string | object | undefined, hint?: string | undefined) => { - message: () => string; - name: string; - pass: boolean; - actual?: undefined; - expected?: undefined; - } | { - message: () => string; - pass: boolean; - name?: undefined; - actual?: undefined; - expected?: undefined; - } | { - actual: string; - expected: string | undefined; - message: () => string; - name: string; - pass: boolean; - }; - toThrowErrorMatchingInlineSnapshot: (this: Context, received: any, inlineSnapshot?: string | undefined, fromPromise?: boolean | undefined) => { - message: () => string; - name: string; - pass: boolean; - actual?: undefined; - expected?: undefined; - } | { - message: () => string; - pass: boolean; - name?: undefined; - actual?: undefined; - expected?: undefined; - } | { - actual: string; - expected: string | undefined; - message: () => string; - name: string; - pass: boolean; - }; - toThrowErrorMatchingSnapshot: (this: Context, received: any, hint: string | undefined, fromPromise: boolean) => { - message: () => string; - name: string; - pass: boolean; - actual?: undefined; - expected?: undefined; - } | { - message: () => string; - pass: boolean; - name?: undefined; - actual?: undefined; - expected?: undefined; - } | { - actual: string; - expected: string | undefined; - message: () => string; - name: string; - pass: boolean; - }; - utils: typeof utils; -}; -declare namespace JestSnapshot { - type SnapshotResolver = JestSnapshotResolver; - type SnapshotStateType = SnapshotState; -} -export = JestSnapshot; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import { Config } from '@jest/types'; +import { SnapshotResolver as JestSnapshotResolver } from './snapshot_resolver'; +import SnapshotState from './State'; +import { Context } from './types'; +import * as utils from './utils'; +declare const JestSnapshot: { + EXTENSION: string; + SnapshotState: typeof SnapshotState; + addSerializer: (plugin: import("pretty-format/build/types").Plugin) => void; + buildSnapshotResolver: (config: Config.ProjectConfig) => JestSnapshotResolver; + cleanup: (hasteFS: import("jest-haste-map/build/HasteFS").default, update: Config.SnapshotUpdateState, snapshotResolver: JestSnapshotResolver, testPathIgnorePatterns?: string[] | undefined) => { + filesRemoved: number; + filesRemovedList: string[]; + }; + getSerializers: () => import("pretty-format/build/types").Plugins; + isSnapshotPath: (path: string) => boolean; + toMatchInlineSnapshot: (this: Context, received: any, propertiesOrSnapshot?: string | object | undefined, inlineSnapshot?: string | undefined) => { + message: () => string; + name: string; + pass: boolean; + actual?: undefined; + expected?: undefined; + } | { + message: () => string; + pass: boolean; + name?: undefined; + actual?: undefined; + expected?: undefined; + } | { + actual: string; + expected: string | undefined; + message: () => string; + name: string; + pass: boolean; + }; + toMatchSnapshot: (this: Context, received: any, propertiesOrHint?: string | object | undefined, hint?: string | undefined) => { + message: () => string; + name: string; + pass: boolean; + actual?: undefined; + expected?: undefined; + } | { + message: () => string; + pass: boolean; + name?: undefined; + actual?: undefined; + expected?: undefined; + } | { + actual: string; + expected: string | undefined; + message: () => string; + name: string; + pass: boolean; + }; + toThrowErrorMatchingInlineSnapshot: (this: Context, received: any, inlineSnapshot?: string | undefined, fromPromise?: boolean | undefined) => { + message: () => string; + name: string; + pass: boolean; + actual?: undefined; + expected?: undefined; + } | { + message: () => string; + pass: boolean; + name?: undefined; + actual?: undefined; + expected?: undefined; + } | { + actual: string; + expected: string | undefined; + message: () => string; + name: string; + pass: boolean; + }; + toThrowErrorMatchingSnapshot: (this: Context, received: any, hint: string | undefined, fromPromise: boolean) => { + message: () => string; + name: string; + pass: boolean; + actual?: undefined; + expected?: undefined; + } | { + message: () => string; + pass: boolean; + name?: undefined; + actual?: undefined; + expected?: undefined; + } | { + actual: string; + expected: string | undefined; + message: () => string; + name: string; + pass: boolean; + }; + utils: typeof utils; +}; +declare namespace JestSnapshot { + type SnapshotResolver = JestSnapshotResolver; + type SnapshotStateType = SnapshotState; +} +export = JestSnapshot; diff --git a/node_modules/jest-snapshot/build/ts3.4/inline_snapshots.d.ts b/node_modules/jest-snapshot/build/ts3.4/inline_snapshots.d.ts index b5fea9901..9b9456f4c 100644 --- a/node_modules/jest-snapshot/build/ts3.4/inline_snapshots.d.ts +++ b/node_modules/jest-snapshot/build/ts3.4/inline_snapshots.d.ts @@ -1,12 +1,12 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import { Frame } from 'jest-message-util'; -export declare type InlineSnapshot = { - snapshot: string; - frame: Frame; -}; -export declare function saveInlineSnapshots(snapshots: Array, prettier: typeof import('prettier') | null, babelTraverse: Function): void; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import { Frame } from 'jest-message-util'; +export declare type InlineSnapshot = { + snapshot: string; + frame: Frame; +}; +export declare function saveInlineSnapshots(snapshots: Array, prettier: typeof import('prettier') | null, babelTraverse: Function): void; diff --git a/node_modules/jest-snapshot/build/ts3.4/mock_serializer.d.ts b/node_modules/jest-snapshot/build/ts3.4/mock_serializer.d.ts index a8397c125..6084863de 100644 --- a/node_modules/jest-snapshot/build/ts3.4/mock_serializer.d.ts +++ b/node_modules/jest-snapshot/build/ts3.4/mock_serializer.d.ts @@ -1,11 +1,11 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import { NewPlugin } from 'pretty-format'; -export declare const serialize: NewPlugin['serialize']; -export declare const test: NewPlugin['test']; -declare const plugin: NewPlugin; -export default plugin; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import { NewPlugin } from 'pretty-format'; +export declare const serialize: NewPlugin['serialize']; +export declare const test: NewPlugin['test']; +declare const plugin: NewPlugin; +export default plugin; diff --git a/node_modules/jest-snapshot/build/ts3.4/plugins.d.ts b/node_modules/jest-snapshot/build/ts3.4/plugins.d.ts index df5ac739f..b3cd8bc3f 100644 --- a/node_modules/jest-snapshot/build/ts3.4/plugins.d.ts +++ b/node_modules/jest-snapshot/build/ts3.4/plugins.d.ts @@ -1,8 +1,8 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -export declare const addSerializer: (plugin: import("pretty-format/build/types").Plugin) => void; -export declare const getSerializers: () => import("pretty-format/build/types").Plugins; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +export declare const addSerializer: (plugin: import("pretty-format/build/types").Plugin) => void; +export declare const getSerializers: () => import("pretty-format/build/types").Plugins; diff --git a/node_modules/jest-snapshot/build/ts3.4/printSnapshot.d.ts b/node_modules/jest-snapshot/build/ts3.4/printSnapshot.d.ts index fba12c3ba..38eb88412 100644 --- a/node_modules/jest-snapshot/build/ts3.4/printSnapshot.d.ts +++ b/node_modules/jest-snapshot/build/ts3.4/printSnapshot.d.ts @@ -1,22 +1,22 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import chalk = require('chalk'); -import { DiffOptionsColor } from 'jest-diff'; -import { MatchSnapshotConfig } from './types'; -export declare const getSnapshotColorForChalkInstance: (chalkInstance: chalk.Chalk) => DiffOptionsColor; -export declare const getReceivedColorForChalkInstance: (chalkInstance: chalk.Chalk) => DiffOptionsColor; -export declare const aSnapshotColor: DiffOptionsColor; -export declare const bReceivedColor: DiffOptionsColor; -export declare const noColor: (string: string) => string; -export declare const HINT_ARG = "hint"; -export declare const SNAPSHOT_ARG = "snapshot"; -export declare const PROPERTIES_ARG = "properties"; -export declare const matcherHintFromConfig: ({ context: { isNot, promise }, hint, inlineSnapshot, matcherName, properties, }: MatchSnapshotConfig, isUpdatable: boolean) => string; -export declare const printExpected: (val: unknown) => string; -export declare const printReceived: (val: unknown) => string; -export declare const printPropertiesAndReceived: (properties: object, received: object, expand: boolean) => string; -export declare const printSnapshotAndReceived: (a: string, b: string, received: unknown, expand: boolean) => string; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import chalk = require('chalk'); +import { DiffOptionsColor } from 'jest-diff'; +import { MatchSnapshotConfig } from './types'; +export declare const getSnapshotColorForChalkInstance: (chalkInstance: chalk.Chalk) => DiffOptionsColor; +export declare const getReceivedColorForChalkInstance: (chalkInstance: chalk.Chalk) => DiffOptionsColor; +export declare const aSnapshotColor: DiffOptionsColor; +export declare const bReceivedColor: DiffOptionsColor; +export declare const noColor: (string: string) => string; +export declare const HINT_ARG = "hint"; +export declare const SNAPSHOT_ARG = "snapshot"; +export declare const PROPERTIES_ARG = "properties"; +export declare const matcherHintFromConfig: ({ context: { isNot, promise }, hint, inlineSnapshot, matcherName, properties, }: MatchSnapshotConfig, isUpdatable: boolean) => string; +export declare const printExpected: (val: unknown) => string; +export declare const printReceived: (val: unknown) => string; +export declare const printPropertiesAndReceived: (properties: object, received: object, expand: boolean) => string; +export declare const printSnapshotAndReceived: (a: string, b: string, received: unknown, expand: boolean) => string; diff --git a/node_modules/jest-snapshot/build/ts3.4/snapshot_resolver.d.ts b/node_modules/jest-snapshot/build/ts3.4/snapshot_resolver.d.ts index c07f8e5b2..0dcd2c996 100644 --- a/node_modules/jest-snapshot/build/ts3.4/snapshot_resolver.d.ts +++ b/node_modules/jest-snapshot/build/ts3.4/snapshot_resolver.d.ts @@ -1,16 +1,16 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import { Config } from '@jest/types'; -export declare type SnapshotResolver = { - testPathForConsistencyCheck: string; - resolveSnapshotPath(testPath: Config.Path, extension?: string): Config.Path; - resolveTestPath(snapshotPath: Config.Path, extension?: string): Config.Path; -}; -export declare const EXTENSION = "snap"; -export declare const DOT_EXTENSION: string; -export declare const isSnapshotPath: (path: string) => boolean; -export declare const buildSnapshotResolver: (config: Config.ProjectConfig) => SnapshotResolver; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import { Config } from '@jest/types'; +export declare type SnapshotResolver = { + testPathForConsistencyCheck: string; + resolveSnapshotPath(testPath: Config.Path, extension?: string): Config.Path; + resolveTestPath(snapshotPath: Config.Path, extension?: string): Config.Path; +}; +export declare const EXTENSION = "snap"; +export declare const DOT_EXTENSION: string; +export declare const isSnapshotPath: (path: string) => boolean; +export declare const buildSnapshotResolver: (config: Config.ProjectConfig) => SnapshotResolver; diff --git a/node_modules/jest-snapshot/build/ts3.4/types.d.ts b/node_modules/jest-snapshot/build/ts3.4/types.d.ts index 3626bb348..3aa6c33ce 100644 --- a/node_modules/jest-snapshot/build/ts3.4/types.d.ts +++ b/node_modules/jest-snapshot/build/ts3.4/types.d.ts @@ -1,21 +1,21 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import { MatcherState } from 'expect'; -import SnapshotState from './State'; -export declare type Context = MatcherState & { - snapshotState: SnapshotState; -}; -export declare type MatchSnapshotConfig = { - context: Context; - hint?: string; - inlineSnapshot?: string; - isInline: boolean; - matcherName: string; - properties?: object; - received: any; -}; -export declare type SnapshotData = Record; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import { MatcherState } from 'expect'; +import SnapshotState from './State'; +export declare type Context = MatcherState & { + snapshotState: SnapshotState; +}; +export declare type MatchSnapshotConfig = { + context: Context; + hint?: string; + inlineSnapshot?: string; + isInline: boolean; + matcherName: string; + properties?: object; + received: any; +}; +export declare type SnapshotData = Record; diff --git a/node_modules/jest-snapshot/build/ts3.4/utils.d.ts b/node_modules/jest-snapshot/build/ts3.4/utils.d.ts index 162bc0e09..47922315e 100644 --- a/node_modules/jest-snapshot/build/ts3.4/utils.d.ts +++ b/node_modules/jest-snapshot/build/ts3.4/utils.d.ts @@ -1,26 +1,26 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import { Config } from '@jest/types'; -export declare const SNAPSHOT_VERSION = "1"; -export declare const SNAPSHOT_GUIDE_LINK = "https://goo.gl/fbAQLP"; -export declare const SNAPSHOT_VERSION_WARNING: string; -export declare const testNameToKey: (testName: string, count: number) => string; -export declare const keyToTestName: (key: string) => string; -export declare const getSnapshotData: (snapshotPath: string, update: Config.SnapshotUpdateState) => { - data: Record; - dirty: boolean; -}; -export declare const addExtraLineBreaks: (string: string) => string; -export declare const removeExtraLineBreaks: (string: string) => string; -export declare const removeLinesBeforeExternalMatcherTrap: (stack: string) => string; -export declare const serialize: (val: unknown, indent?: number) => string; -export declare const minify: (val: unknown) => string; -export declare const deserializeString: (stringified: string) => string; -export declare const escapeBacktickString: (str: string) => string; -export declare const ensureDirectoryExists: (filePath: string) => void; -export declare const saveSnapshotFile: (snapshotData: Record, snapshotPath: string) => void; -export declare const deepMerge: (target: any, source: any) => any; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import { Config } from '@jest/types'; +export declare const SNAPSHOT_VERSION = "1"; +export declare const SNAPSHOT_GUIDE_LINK = "https://goo.gl/fbAQLP"; +export declare const SNAPSHOT_VERSION_WARNING: string; +export declare const testNameToKey: (testName: string, count: number) => string; +export declare const keyToTestName: (key: string) => string; +export declare const getSnapshotData: (snapshotPath: string, update: Config.SnapshotUpdateState) => { + data: Record; + dirty: boolean; +}; +export declare const addExtraLineBreaks: (string: string) => string; +export declare const removeExtraLineBreaks: (string: string) => string; +export declare const removeLinesBeforeExternalMatcherTrap: (stack: string) => string; +export declare const serialize: (val: unknown, indent?: number) => string; +export declare const minify: (val: unknown) => string; +export declare const deserializeString: (stringified: string) => string; +export declare const escapeBacktickString: (str: string) => string; +export declare const ensureDirectoryExists: (filePath: string) => void; +export declare const saveSnapshotFile: (snapshotData: Record, snapshotPath: string) => void; +export declare const deepMerge: (target: any, source: any) => any; diff --git a/node_modules/jest-util/build/ts3.4/ErrorWithStack.d.ts b/node_modules/jest-util/build/ts3.4/ErrorWithStack.d.ts index 2698f3621..aac678b4b 100644 --- a/node_modules/jest-util/build/ts3.4/ErrorWithStack.d.ts +++ b/node_modules/jest-util/build/ts3.4/ErrorWithStack.d.ts @@ -1,9 +1,9 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -export default class ErrorWithStack extends Error { - constructor(message: string | undefined, callsite: Function); -} +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +export default class ErrorWithStack extends Error { + constructor(message: string | undefined, callsite: Function); +} diff --git a/node_modules/jest-util/build/ts3.4/clearLine.d.ts b/node_modules/jest-util/build/ts3.4/clearLine.d.ts index 1dd9cf72d..76d82ffd7 100644 --- a/node_modules/jest-util/build/ts3.4/clearLine.d.ts +++ b/node_modules/jest-util/build/ts3.4/clearLine.d.ts @@ -1,9 +1,9 @@ -/// -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -/// -export default function clearLine(stream: NodeJS.WriteStream): void; +/// +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +/// +export default function clearLine(stream: NodeJS.WriteStream): void; diff --git a/node_modules/jest-util/build/ts3.4/convertDescriptorToString.d.ts b/node_modules/jest-util/build/ts3.4/convertDescriptorToString.d.ts index 4d406660b..fdff75357 100644 --- a/node_modules/jest-util/build/ts3.4/convertDescriptorToString.d.ts +++ b/node_modules/jest-util/build/ts3.4/convertDescriptorToString.d.ts @@ -1,7 +1,7 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -export default function convertDescriptorToString(descriptor: T): T | string; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +export default function convertDescriptorToString(descriptor: T): T | string; diff --git a/node_modules/jest-util/build/ts3.4/createDirectory.d.ts b/node_modules/jest-util/build/ts3.4/createDirectory.d.ts index d8739e7b0..e6e5c118d 100644 --- a/node_modules/jest-util/build/ts3.4/createDirectory.d.ts +++ b/node_modules/jest-util/build/ts3.4/createDirectory.d.ts @@ -1,8 +1,8 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import { Config } from '@jest/types'; -export default function createDirectory(path: Config.Path): void; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import { Config } from '@jest/types'; +export default function createDirectory(path: Config.Path): void; diff --git a/node_modules/jest-util/build/ts3.4/createProcessObject.d.ts b/node_modules/jest-util/build/ts3.4/createProcessObject.d.ts index deb73218f..08d8ffc81 100644 --- a/node_modules/jest-util/build/ts3.4/createProcessObject.d.ts +++ b/node_modules/jest-util/build/ts3.4/createProcessObject.d.ts @@ -1,9 +1,9 @@ -/// -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -/// -export default function (): NodeJS.Process; +/// +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +/// +export default function (): NodeJS.Process; diff --git a/node_modules/jest-util/build/ts3.4/deepCyclicCopy.d.ts b/node_modules/jest-util/build/ts3.4/deepCyclicCopy.d.ts index f8bd716c5..7d217ce54 100644 --- a/node_modules/jest-util/build/ts3.4/deepCyclicCopy.d.ts +++ b/node_modules/jest-util/build/ts3.4/deepCyclicCopy.d.ts @@ -1,11 +1,11 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -export declare type DeepCyclicCopyOptions = { - blacklist?: Set; - keepPrototype?: boolean; -}; -export default function deepCyclicCopy(value: T, options?: DeepCyclicCopyOptions, cycles?: WeakMap): T; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +export declare type DeepCyclicCopyOptions = { + blacklist?: Set; + keepPrototype?: boolean; +}; +export default function deepCyclicCopy(value: T, options?: DeepCyclicCopyOptions, cycles?: WeakMap): T; diff --git a/node_modules/jest-util/build/ts3.4/index.d.ts b/node_modules/jest-util/build/ts3.4/index.d.ts index 039c35d72..3580ca090 100644 --- a/node_modules/jest-util/build/ts3.4/index.d.ts +++ b/node_modules/jest-util/build/ts3.4/index.d.ts @@ -1,22 +1,22 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -export { default as clearLine } from './clearLine'; -export { default as createDirectory } from './createDirectory'; -export { default as ErrorWithStack } from './ErrorWithStack'; -export { default as installCommonGlobals } from './installCommonGlobals'; -export { default as interopRequireDefault } from './interopRequireDefault'; -export { default as isInteractive } from './isInteractive'; -export { default as isPromise } from './isPromise'; -export { default as setGlobal } from './setGlobal'; -export { default as deepCyclicCopy } from './deepCyclicCopy'; -export { default as convertDescriptorToString } from './convertDescriptorToString'; -import * as specialChars from './specialChars'; -export { default as replacePathSepForGlob } from './replacePathSepForGlob'; -export { default as testPathPatternToRegExp } from './testPathPatternToRegExp'; -import * as preRunMessage from './preRunMessage'; -export { default as pluralize } from './pluralize'; -export { preRunMessage, specialChars }; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +export { default as clearLine } from './clearLine'; +export { default as createDirectory } from './createDirectory'; +export { default as ErrorWithStack } from './ErrorWithStack'; +export { default as installCommonGlobals } from './installCommonGlobals'; +export { default as interopRequireDefault } from './interopRequireDefault'; +export { default as isInteractive } from './isInteractive'; +export { default as isPromise } from './isPromise'; +export { default as setGlobal } from './setGlobal'; +export { default as deepCyclicCopy } from './deepCyclicCopy'; +export { default as convertDescriptorToString } from './convertDescriptorToString'; +import * as specialChars from './specialChars'; +export { default as replacePathSepForGlob } from './replacePathSepForGlob'; +export { default as testPathPatternToRegExp } from './testPathPatternToRegExp'; +import * as preRunMessage from './preRunMessage'; +export { default as pluralize } from './pluralize'; +export { preRunMessage, specialChars }; diff --git a/node_modules/jest-util/build/ts3.4/installCommonGlobals.d.ts b/node_modules/jest-util/build/ts3.4/installCommonGlobals.d.ts index c4f4258ef..6172b11aa 100644 --- a/node_modules/jest-util/build/ts3.4/installCommonGlobals.d.ts +++ b/node_modules/jest-util/build/ts3.4/installCommonGlobals.d.ts @@ -1,10 +1,10 @@ -/// -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -/// -import { Config } from '@jest/types'; -export default function (globalObject: NodeJS.Global, globals: Config.ConfigGlobals): NodeJS.Global & Config.ConfigGlobals; +/// +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +/// +import { Config } from '@jest/types'; +export default function (globalObject: NodeJS.Global, globals: Config.ConfigGlobals): NodeJS.Global & Config.ConfigGlobals; diff --git a/node_modules/jest-util/build/ts3.4/interopRequireDefault.d.ts b/node_modules/jest-util/build/ts3.4/interopRequireDefault.d.ts index 91b66e4fc..c45d3822b 100644 --- a/node_modules/jest-util/build/ts3.4/interopRequireDefault.d.ts +++ b/node_modules/jest-util/build/ts3.4/interopRequireDefault.d.ts @@ -1,7 +1,7 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -export default function interopRequireDefault(obj: any): any; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +export default function interopRequireDefault(obj: any): any; diff --git a/node_modules/jest-util/build/ts3.4/isInteractive.d.ts b/node_modules/jest-util/build/ts3.4/isInteractive.d.ts index 57ddbf0a7..41ca9c378 100644 --- a/node_modules/jest-util/build/ts3.4/isInteractive.d.ts +++ b/node_modules/jest-util/build/ts3.4/isInteractive.d.ts @@ -1,8 +1,8 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -declare const _default: boolean; -export default _default; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +declare const _default: boolean; +export default _default; diff --git a/node_modules/jest-util/build/ts3.4/isPromise.d.ts b/node_modules/jest-util/build/ts3.4/isPromise.d.ts index ea8589b90..f8468b080 100644 --- a/node_modules/jest-util/build/ts3.4/isPromise.d.ts +++ b/node_modules/jest-util/build/ts3.4/isPromise.d.ts @@ -1,8 +1,8 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -declare const isPromise: (candidate: unknown) => candidate is Promise; -export default isPromise; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +declare const isPromise: (candidate: unknown) => candidate is Promise; +export default isPromise; diff --git a/node_modules/jest-util/build/ts3.4/pluralize.d.ts b/node_modules/jest-util/build/ts3.4/pluralize.d.ts index 9be305792..da811e85b 100644 --- a/node_modules/jest-util/build/ts3.4/pluralize.d.ts +++ b/node_modules/jest-util/build/ts3.4/pluralize.d.ts @@ -1,7 +1,7 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -export default function pluralize(word: string, count: number): string; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +export default function pluralize(word: string, count: number): string; diff --git a/node_modules/jest-util/build/ts3.4/preRunMessage.d.ts b/node_modules/jest-util/build/ts3.4/preRunMessage.d.ts index c1648fea4..e85209b17 100644 --- a/node_modules/jest-util/build/ts3.4/preRunMessage.d.ts +++ b/node_modules/jest-util/build/ts3.4/preRunMessage.d.ts @@ -1,10 +1,10 @@ -/// -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -/// -export declare const print: (stream: NodeJS.WriteStream) => void; -export declare const remove: (stream: NodeJS.WriteStream) => void; +/// +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +/// +export declare const print: (stream: NodeJS.WriteStream) => void; +export declare const remove: (stream: NodeJS.WriteStream) => void; diff --git a/node_modules/jest-util/build/ts3.4/replacePathSepForGlob.d.ts b/node_modules/jest-util/build/ts3.4/replacePathSepForGlob.d.ts index f91fc824d..ed3a3d3a7 100644 --- a/node_modules/jest-util/build/ts3.4/replacePathSepForGlob.d.ts +++ b/node_modules/jest-util/build/ts3.4/replacePathSepForGlob.d.ts @@ -1,8 +1,8 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import { Config } from '@jest/types'; -export default function replacePathSepForGlob(path: Config.Path): Config.Glob; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import { Config } from '@jest/types'; +export default function replacePathSepForGlob(path: Config.Path): Config.Glob; diff --git a/node_modules/jest-util/build/ts3.4/setGlobal.d.ts b/node_modules/jest-util/build/ts3.4/setGlobal.d.ts index 436c149ba..a0d4c05e0 100644 --- a/node_modules/jest-util/build/ts3.4/setGlobal.d.ts +++ b/node_modules/jest-util/build/ts3.4/setGlobal.d.ts @@ -1,10 +1,10 @@ -/// -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -/// -declare const _default: (globalToMutate: NodeJS.Global | Window, key: string, value: unknown) => void; -export default _default; +/// +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +/// +declare const _default: (globalToMutate: NodeJS.Global | Window, key: string, value: unknown) => void; +export default _default; diff --git a/node_modules/jest-util/build/ts3.4/specialChars.d.ts b/node_modules/jest-util/build/ts3.4/specialChars.d.ts index 1a50d4954..4cf33054d 100644 --- a/node_modules/jest-util/build/ts3.4/specialChars.d.ts +++ b/node_modules/jest-util/build/ts3.4/specialChars.d.ts @@ -1,14 +1,14 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -export declare const ARROW = " \u203A "; -export declare const ICONS: { - failed: string; - pending: string; - success: string; - todo: string; -}; -export declare const CLEAR: string; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +export declare const ARROW = " \u203A "; +export declare const ICONS: { + failed: string; + pending: string; + success: string; + todo: string; +}; +export declare const CLEAR: string; diff --git a/node_modules/jest-util/build/ts3.4/testPathPatternToRegExp.d.ts b/node_modules/jest-util/build/ts3.4/testPathPatternToRegExp.d.ts index 8f0954a4d..953688fbe 100644 --- a/node_modules/jest-util/build/ts3.4/testPathPatternToRegExp.d.ts +++ b/node_modules/jest-util/build/ts3.4/testPathPatternToRegExp.d.ts @@ -1,8 +1,8 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -declare const _default: (testPathPattern: string) => RegExp; -export default _default; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +declare const _default: (testPathPattern: string) => RegExp; +export default _default; diff --git a/node_modules/jest-validate/build/ts3.4/condition.d.ts b/node_modules/jest-validate/build/ts3.4/condition.d.ts index 1cce38fd0..2a86e0d0b 100644 --- a/node_modules/jest-validate/build/ts3.4/condition.d.ts +++ b/node_modules/jest-validate/build/ts3.4/condition.d.ts @@ -1,9 +1,9 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -export declare function getValues(validOption: T): Array; -export declare function validationCondition(option: unknown, validOption: unknown): boolean; -export declare function multipleValidOptions>(...args: T): T[number]; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +export declare function getValues(validOption: T): Array; +export declare function validationCondition(option: unknown, validOption: unknown): boolean; +export declare function multipleValidOptions>(...args: T): T[number]; diff --git a/node_modules/jest-validate/build/ts3.4/defaultConfig.d.ts b/node_modules/jest-validate/build/ts3.4/defaultConfig.d.ts index df312bfdf..b0fd26500 100644 --- a/node_modules/jest-validate/build/ts3.4/defaultConfig.d.ts +++ b/node_modules/jest-validate/build/ts3.4/defaultConfig.d.ts @@ -1,9 +1,9 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import { ValidationOptions } from './types'; -declare const validationOptions: ValidationOptions; -export default validationOptions; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import { ValidationOptions } from './types'; +declare const validationOptions: ValidationOptions; +export default validationOptions; diff --git a/node_modules/jest-validate/build/ts3.4/deprecated.d.ts b/node_modules/jest-validate/build/ts3.4/deprecated.d.ts index ecd4eb927..0e21998c5 100644 --- a/node_modules/jest-validate/build/ts3.4/deprecated.d.ts +++ b/node_modules/jest-validate/build/ts3.4/deprecated.d.ts @@ -1,8 +1,8 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import { ValidationOptions } from './types'; -export declare const deprecationWarning: (config: Record, option: string, deprecatedOptions: Record, options: ValidationOptions) => boolean; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import { ValidationOptions } from './types'; +export declare const deprecationWarning: (config: Record, option: string, deprecatedOptions: Record, options: ValidationOptions) => boolean; diff --git a/node_modules/jest-validate/build/ts3.4/errors.d.ts b/node_modules/jest-validate/build/ts3.4/errors.d.ts index 26d06c411..6c2dd888a 100644 --- a/node_modules/jest-validate/build/ts3.4/errors.d.ts +++ b/node_modules/jest-validate/build/ts3.4/errors.d.ts @@ -1,8 +1,8 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import { ValidationOptions } from './types'; -export declare const errorMessage: (option: string, received: unknown, defaultValue: unknown, options: ValidationOptions, path?: string[] | undefined) => void; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import { ValidationOptions } from './types'; +export declare const errorMessage: (option: string, received: unknown, defaultValue: unknown, options: ValidationOptions, path?: string[] | undefined) => void; diff --git a/node_modules/jest-validate/build/ts3.4/exampleConfig.d.ts b/node_modules/jest-validate/build/ts3.4/exampleConfig.d.ts index 7871e47f1..581c6aaa1 100644 --- a/node_modules/jest-validate/build/ts3.4/exampleConfig.d.ts +++ b/node_modules/jest-validate/build/ts3.4/exampleConfig.d.ts @@ -1,9 +1,9 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import { ValidationOptions } from './types'; -declare const config: ValidationOptions; -export default config; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import { ValidationOptions } from './types'; +declare const config: ValidationOptions; +export default config; diff --git a/node_modules/jest-validate/build/ts3.4/index.d.ts b/node_modules/jest-validate/build/ts3.4/index.d.ts index 586ceebdc..a19c1d9a4 100644 --- a/node_modules/jest-validate/build/ts3.4/index.d.ts +++ b/node_modules/jest-validate/build/ts3.4/index.d.ts @@ -1,10 +1,10 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -export { ValidationError, createDidYouMeanMessage, format, logValidationWarning, } from './utils'; -export { default as validate } from './validate'; -export { default as validateCLIOptions } from './validateCLIOptions'; -export { multipleValidOptions } from './condition'; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +export { ValidationError, createDidYouMeanMessage, format, logValidationWarning, } from './utils'; +export { default as validate } from './validate'; +export { default as validateCLIOptions } from './validateCLIOptions'; +export { multipleValidOptions } from './condition'; diff --git a/node_modules/jest-validate/build/ts3.4/types.d.ts b/node_modules/jest-validate/build/ts3.4/types.d.ts index 0a7424bd3..12e451897 100644 --- a/node_modules/jest-validate/build/ts3.4/types.d.ts +++ b/node_modules/jest-validate/build/ts3.4/types.d.ts @@ -1,25 +1,25 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -declare type Title = { - deprecation?: string; - error?: string; - warning?: string; -}; -export declare type DeprecatedOptions = Record; -export declare type ValidationOptions = { - comment?: string; - condition?: (option: any, validOption: any) => boolean; - deprecate?: (config: Record, option: string, deprecatedOptions: DeprecatedOptions, options: ValidationOptions) => boolean; - deprecatedConfig?: DeprecatedOptions; - error?: (option: string, received: any, defaultValue: any, options: ValidationOptions, path?: Array) => void; - exampleConfig: Record; - recursive?: boolean; - recursiveBlacklist?: Array; - title?: Title; - unknown?: (config: Record, exampleConfig: Record, option: string, options: ValidationOptions, path?: Array) => void; -}; -export {}; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +declare type Title = { + deprecation?: string; + error?: string; + warning?: string; +}; +export declare type DeprecatedOptions = Record; +export declare type ValidationOptions = { + comment?: string; + condition?: (option: any, validOption: any) => boolean; + deprecate?: (config: Record, option: string, deprecatedOptions: DeprecatedOptions, options: ValidationOptions) => boolean; + deprecatedConfig?: DeprecatedOptions; + error?: (option: string, received: any, defaultValue: any, options: ValidationOptions, path?: Array) => void; + exampleConfig: Record; + recursive?: boolean; + recursiveBlacklist?: Array; + title?: Title; + unknown?: (config: Record, exampleConfig: Record, option: string, options: ValidationOptions, path?: Array) => void; +}; +export {}; diff --git a/node_modules/jest-validate/build/ts3.4/utils.d.ts b/node_modules/jest-validate/build/ts3.4/utils.d.ts index a5bb34f64..4f3fede7e 100644 --- a/node_modules/jest-validate/build/ts3.4/utils.d.ts +++ b/node_modules/jest-validate/build/ts3.4/utils.d.ts @@ -1,18 +1,18 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -export declare const DEPRECATION: string; -export declare const ERROR: string; -export declare const WARNING: string; -export declare const format: (value: unknown) => string; -export declare const formatPrettyObject: (value: unknown) => string; -export declare class ValidationError extends Error { - name: string; - message: string; - constructor(name: string, message: string, comment?: string | null); -} -export declare const logValidationWarning: (name: string, message: string, comment?: string | null | undefined) => void; -export declare const createDidYouMeanMessage: (unrecognized: string, allowedOptions: string[]) => string; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +export declare const DEPRECATION: string; +export declare const ERROR: string; +export declare const WARNING: string; +export declare const format: (value: unknown) => string; +export declare const formatPrettyObject: (value: unknown) => string; +export declare class ValidationError extends Error { + name: string; + message: string; + constructor(name: string, message: string, comment?: string | null); +} +export declare const logValidationWarning: (name: string, message: string, comment?: string | null | undefined) => void; +export declare const createDidYouMeanMessage: (unrecognized: string, allowedOptions: string[]) => string; diff --git a/node_modules/jest-validate/build/ts3.4/validate.d.ts b/node_modules/jest-validate/build/ts3.4/validate.d.ts index 5a16a6d45..74e6a1472 100644 --- a/node_modules/jest-validate/build/ts3.4/validate.d.ts +++ b/node_modules/jest-validate/build/ts3.4/validate.d.ts @@ -1,12 +1,12 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import { ValidationOptions } from './types'; -declare const validate: (config: Record, options: ValidationOptions) => { - hasDeprecationWarnings: boolean; - isValid: boolean; -}; -export default validate; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import { ValidationOptions } from './types'; +declare const validate: (config: Record, options: ValidationOptions) => { + hasDeprecationWarnings: boolean; + isValid: boolean; +}; +export default validate; diff --git a/node_modules/jest-validate/build/ts3.4/validateCLIOptions.d.ts b/node_modules/jest-validate/build/ts3.4/validateCLIOptions.d.ts index 873e63e45..609e43b97 100644 --- a/node_modules/jest-validate/build/ts3.4/validateCLIOptions.d.ts +++ b/node_modules/jest-validate/build/ts3.4/validateCLIOptions.d.ts @@ -1,14 +1,14 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import { Config } from '@jest/types'; -import { Options } from 'yargs'; -import { DeprecatedOptions } from './types'; -export declare const DOCUMENTATION_NOTE: string; -export default function validateCLIOptions(argv: Config.Argv, options: { - deprecationEntries: DeprecatedOptions; - [s: string]: Options; -}, rawArgv?: Array): boolean; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import { Config } from '@jest/types'; +import { Options } from 'yargs'; +import { DeprecatedOptions } from './types'; +export declare const DOCUMENTATION_NOTE: string; +export default function validateCLIOptions(argv: Config.Argv, options: { + deprecationEntries: DeprecatedOptions; + [s: string]: Options; +}, rawArgv?: Array): boolean; diff --git a/node_modules/jest-validate/build/ts3.4/warnings.d.ts b/node_modules/jest-validate/build/ts3.4/warnings.d.ts index c13149d10..a04874161 100644 --- a/node_modules/jest-validate/build/ts3.4/warnings.d.ts +++ b/node_modules/jest-validate/build/ts3.4/warnings.d.ts @@ -1,8 +1,8 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import { ValidationOptions } from './types'; -export declare const unknownOptionWarning: (config: Record, exampleConfig: Record, option: string, options: ValidationOptions, path?: string[] | undefined) => void; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import { ValidationOptions } from './types'; +export declare const unknownOptionWarning: (config: Record, exampleConfig: Record, option: string, options: ValidationOptions, path?: string[] | undefined) => void; diff --git a/node_modules/jest-watcher/build/ts3.4/BaseWatchPlugin.d.ts b/node_modules/jest-watcher/build/ts3.4/BaseWatchPlugin.d.ts index 6615b7ce2..12c8b44ed 100644 --- a/node_modules/jest-watcher/build/ts3.4/BaseWatchPlugin.d.ts +++ b/node_modules/jest-watcher/build/ts3.4/BaseWatchPlugin.d.ts @@ -1,23 +1,23 @@ -/// -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -/// -import { Config } from '@jest/types'; -import { JestHookSubscriber, UpdateConfigCallback, UsageData, WatchPlugin } from './types'; -declare class BaseWatchPlugin implements WatchPlugin { - protected _stdin: NodeJS.ReadStream; - protected _stdout: NodeJS.WriteStream; - constructor({ stdin, stdout, }: { - stdin: NodeJS.ReadStream; - stdout: NodeJS.WriteStream; - }); - apply(_hooks: JestHookSubscriber): void; - getUsageInfo(_globalConfig: Config.GlobalConfig): UsageData | null; - onKey(_key: string): void; - run(_globalConfig: Config.GlobalConfig, _updateConfigAndRun: UpdateConfigCallback): Promise; -} -export default BaseWatchPlugin; +/// +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +/// +import { Config } from '@jest/types'; +import { JestHookSubscriber, UpdateConfigCallback, UsageData, WatchPlugin } from './types'; +declare class BaseWatchPlugin implements WatchPlugin { + protected _stdin: NodeJS.ReadStream; + protected _stdout: NodeJS.WriteStream; + constructor({ stdin, stdout, }: { + stdin: NodeJS.ReadStream; + stdout: NodeJS.WriteStream; + }); + apply(_hooks: JestHookSubscriber): void; + getUsageInfo(_globalConfig: Config.GlobalConfig): UsageData | null; + onKey(_key: string): void; + run(_globalConfig: Config.GlobalConfig, _updateConfigAndRun: UpdateConfigCallback): Promise; +} +export default BaseWatchPlugin; diff --git a/node_modules/jest-watcher/build/ts3.4/JestHooks.d.ts b/node_modules/jest-watcher/build/ts3.4/JestHooks.d.ts index 9b113e258..f450811a4 100644 --- a/node_modules/jest-watcher/build/ts3.4/JestHooks.d.ts +++ b/node_modules/jest-watcher/build/ts3.4/JestHooks.d.ts @@ -1,18 +1,18 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import { JestHookEmitter, JestHookSubscriber } from './types'; -declare type AvailableHooks = 'onFileChange' | 'onTestRunComplete' | 'shouldRunTestSuite'; -declare class JestHooks { - private _listeners; - private _subscriber; - private _emitter; - constructor(); - isUsed(hook: AvailableHooks): number; - getSubscriber(): Readonly; - getEmitter(): Readonly; -} -export default JestHooks; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import { JestHookEmitter, JestHookSubscriber } from './types'; +declare type AvailableHooks = 'onFileChange' | 'onTestRunComplete' | 'shouldRunTestSuite'; +declare class JestHooks { + private _listeners; + private _subscriber; + private _emitter; + constructor(); + isUsed(hook: AvailableHooks): number; + getSubscriber(): Readonly; + getEmitter(): Readonly; +} +export default JestHooks; diff --git a/node_modules/jest-watcher/build/ts3.4/PatternPrompt.d.ts b/node_modules/jest-watcher/build/ts3.4/PatternPrompt.d.ts index badf7ece5..097c7a567 100644 --- a/node_modules/jest-watcher/build/ts3.4/PatternPrompt.d.ts +++ b/node_modules/jest-watcher/build/ts3.4/PatternPrompt.d.ts @@ -1,21 +1,21 @@ -/// -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -/// -import Prompt from './lib/Prompt'; -import { ScrollOptions } from './types'; -export default class PatternPrompt { - protected _pipe: NodeJS.WritableStream; - protected _prompt: Prompt; - protected _entityName: string; - protected _currentUsageRows: number; - constructor(pipe: NodeJS.WritableStream, prompt: Prompt); - run(onSuccess: (value: string) => void, onCancel: () => void, options?: { - header: string; - }): void; - protected _onChange(_pattern: string, _options: ScrollOptions): void; -} +/// +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +/// +import Prompt from './lib/Prompt'; +import { ScrollOptions } from './types'; +export default class PatternPrompt { + protected _pipe: NodeJS.WritableStream; + protected _prompt: Prompt; + protected _entityName: string; + protected _currentUsageRows: number; + constructor(pipe: NodeJS.WritableStream, prompt: Prompt); + run(onSuccess: (value: string) => void, onCancel: () => void, options?: { + header: string; + }): void; + protected _onChange(_pattern: string, _options: ScrollOptions): void; +} diff --git a/node_modules/jest-watcher/build/ts3.4/constants.d.ts b/node_modules/jest-watcher/build/ts3.4/constants.d.ts index ebdfd0510..f821af578 100644 --- a/node_modules/jest-watcher/build/ts3.4/constants.d.ts +++ b/node_modules/jest-watcher/build/ts3.4/constants.d.ts @@ -1,17 +1,17 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -export declare const KEYS: { - ARROW_DOWN: string; - ARROW_LEFT: string; - ARROW_RIGHT: string; - ARROW_UP: string; - BACKSPACE: string; - CONTROL_C: string; - CONTROL_D: string; - ENTER: string; - ESCAPE: string; -}; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +export declare const KEYS: { + ARROW_DOWN: string; + ARROW_LEFT: string; + ARROW_RIGHT: string; + ARROW_UP: string; + BACKSPACE: string; + CONTROL_C: string; + CONTROL_D: string; + ENTER: string; + ESCAPE: string; +}; diff --git a/node_modules/jest-watcher/build/ts3.4/index.d.ts b/node_modules/jest-watcher/build/ts3.4/index.d.ts index b9a1ea60a..f4f341a67 100644 --- a/node_modules/jest-watcher/build/ts3.4/index.d.ts +++ b/node_modules/jest-watcher/build/ts3.4/index.d.ts @@ -1,13 +1,13 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -export { default as BaseWatchPlugin } from './BaseWatchPlugin'; -export { default as JestHook } from './JestHooks'; -export { default as PatternPrompt } from './PatternPrompt'; -export * from './constants'; -export { AllowedConfigOptions, JestHookEmitter, JestHookSubscriber, ScrollOptions, UpdateConfigCallback, UsageData, WatchPlugin, WatchPluginClass, } from './types'; -export { default as Prompt } from './lib/Prompt'; -export * from './lib/patternModeHelpers'; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +export { default as BaseWatchPlugin } from './BaseWatchPlugin'; +export { default as JestHook } from './JestHooks'; +export { default as PatternPrompt } from './PatternPrompt'; +export * from './constants'; +export { AllowedConfigOptions, JestHookEmitter, JestHookSubscriber, ScrollOptions, UpdateConfigCallback, UsageData, WatchPlugin, WatchPluginClass, } from './types'; +export { default as Prompt } from './lib/Prompt'; +export * from './lib/patternModeHelpers'; diff --git a/node_modules/jest-watcher/build/ts3.4/lib/Prompt.d.ts b/node_modules/jest-watcher/build/ts3.4/lib/Prompt.d.ts index a9f3669ff..f59456155 100644 --- a/node_modules/jest-watcher/build/ts3.4/lib/Prompt.d.ts +++ b/node_modules/jest-watcher/build/ts3.4/lib/Prompt.d.ts @@ -1,25 +1,25 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import { ScrollOptions } from '../types'; -export default class Prompt { - private _entering; - private _value; - private _onChange; - private _onSuccess; - private _onCancel; - private _offset; - private _promptLength; - private _selection; - constructor(); - private _onResize; - enter(onChange: (pattern: string, options: ScrollOptions) => void, onSuccess: (pattern: string) => void, onCancel: () => void): void; - setPromptLength(length: number): void; - setPromptSelection(selected: string): void; - put(key: string): void; - abort(): void; - isEntering(): boolean; -} +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import { ScrollOptions } from '../types'; +export default class Prompt { + private _entering; + private _value; + private _onChange; + private _onSuccess; + private _onCancel; + private _offset; + private _promptLength; + private _selection; + constructor(); + private _onResize; + enter(onChange: (pattern: string, options: ScrollOptions) => void, onSuccess: (pattern: string) => void, onCancel: () => void): void; + setPromptLength(length: number): void; + setPromptSelection(selected: string): void; + put(key: string): void; + abort(): void; + isEntering(): boolean; +} diff --git a/node_modules/jest-watcher/build/ts3.4/lib/colorize.d.ts b/node_modules/jest-watcher/build/ts3.4/lib/colorize.d.ts index 9cecdb948..f31d3b1a9 100644 --- a/node_modules/jest-watcher/build/ts3.4/lib/colorize.d.ts +++ b/node_modules/jest-watcher/build/ts3.4/lib/colorize.d.ts @@ -1,8 +1,8 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -declare const _default: (str: string, start: number, end: number) => string; -export default _default; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +declare const _default: (str: string, start: number, end: number) => string; +export default _default; diff --git a/node_modules/jest-watcher/build/ts3.4/lib/formatTestNameByPattern.d.ts b/node_modules/jest-watcher/build/ts3.4/lib/formatTestNameByPattern.d.ts index 57f795ffa..adbd3e011 100644 --- a/node_modules/jest-watcher/build/ts3.4/lib/formatTestNameByPattern.d.ts +++ b/node_modules/jest-watcher/build/ts3.4/lib/formatTestNameByPattern.d.ts @@ -1,8 +1,8 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -declare const _default: (testName: string, pattern: string, width: number) => string; -export default _default; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +declare const _default: (testName: string, pattern: string, width: number) => string; +export default _default; diff --git a/node_modules/jest-watcher/build/ts3.4/lib/patternModeHelpers.d.ts b/node_modules/jest-watcher/build/ts3.4/lib/patternModeHelpers.d.ts index f9ee53ef9..1ce7594fc 100644 --- a/node_modules/jest-watcher/build/ts3.4/lib/patternModeHelpers.d.ts +++ b/node_modules/jest-watcher/build/ts3.4/lib/patternModeHelpers.d.ts @@ -1,10 +1,10 @@ -/// -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -/// -export declare const printPatternCaret: (pattern: string, pipe: NodeJS.WritableStream) => void; -export declare const printRestoredPatternCaret: (pattern: string, currentUsageRows: number, pipe: NodeJS.WritableStream) => void; +/// +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +/// +export declare const printPatternCaret: (pattern: string, pipe: NodeJS.WritableStream) => void; +export declare const printRestoredPatternCaret: (pattern: string, currentUsageRows: number, pipe: NodeJS.WritableStream) => void; diff --git a/node_modules/jest-watcher/build/ts3.4/lib/scroll.d.ts b/node_modules/jest-watcher/build/ts3.4/lib/scroll.d.ts index 3392a85f2..46679cb67 100644 --- a/node_modules/jest-watcher/build/ts3.4/lib/scroll.d.ts +++ b/node_modules/jest-watcher/build/ts3.4/lib/scroll.d.ts @@ -1,12 +1,12 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import { ScrollOptions } from '../types'; -export default function scroll(size: number, { offset, max }: ScrollOptions): { - end: number; - index: number; - start: number; -}; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import { ScrollOptions } from '../types'; +export default function scroll(size: number, { offset, max }: ScrollOptions): { + end: number; + index: number; + start: number; +}; diff --git a/node_modules/jest-watcher/build/ts3.4/types.d.ts b/node_modules/jest-watcher/build/ts3.4/types.d.ts index 1537ae18d..718c5b8f6 100644 --- a/node_modules/jest-watcher/build/ts3.4/types.d.ts +++ b/node_modules/jest-watcher/build/ts3.4/types.d.ts @@ -1,60 +1,60 @@ -/// -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -/// -import { Config } from '@jest/types'; -import { AggregatedResult } from '@jest/test-result'; -declare type TestSuiteInfo = { - config: Config.ProjectConfig; - duration?: number; - testPath: string; -}; -export declare type JestHookExposedFS = { - projects: Array<{ - config: Config.ProjectConfig; - testPaths: Array; - }>; -}; -export declare type FileChange = (fs: JestHookExposedFS) => void; -export declare type ShouldRunTestSuite = (testSuiteInfo: TestSuiteInfo) => Promise; -export declare type TestRunComplete = (results: AggregatedResult) => void; -export declare type JestHookSubscriber = { - onFileChange: (fn: FileChange) => void; - onTestRunComplete: (fn: TestRunComplete) => void; - shouldRunTestSuite: (fn: ShouldRunTestSuite) => void; -}; -export declare type JestHookEmitter = { - onFileChange: (fs: JestHookExposedFS) => void; - onTestRunComplete: (results: AggregatedResult) => void; - shouldRunTestSuite: (testSuiteInfo: TestSuiteInfo) => Promise | boolean; -}; -export declare type UsageData = { - key: string; - prompt: string; -}; -export declare type AllowedConfigOptions = Partial & { - mode: 'watch' | 'watchAll'; -}>; -export declare type UpdateConfigCallback = (config?: AllowedConfigOptions) => void; -export interface WatchPlugin { - isInternal?: boolean; - apply?: (hooks: JestHookSubscriber) => void; - getUsageInfo?: (globalConfig: Config.GlobalConfig) => UsageData | null; - onKey?: (value: string) => void; - run?: (globalConfig: Config.GlobalConfig, updateConfigAndRun: UpdateConfigCallback) => Promise; -} -export interface WatchPluginClass { - new (options: { - stdin: NodeJS.ReadStream; - stdout: NodeJS.WriteStream; - }): WatchPlugin; -} -export declare type ScrollOptions = { - offset: number; - max: number; -}; -export {}; +/// +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +/// +import { Config } from '@jest/types'; +import { AggregatedResult } from '@jest/test-result'; +declare type TestSuiteInfo = { + config: Config.ProjectConfig; + duration?: number; + testPath: string; +}; +export declare type JestHookExposedFS = { + projects: Array<{ + config: Config.ProjectConfig; + testPaths: Array; + }>; +}; +export declare type FileChange = (fs: JestHookExposedFS) => void; +export declare type ShouldRunTestSuite = (testSuiteInfo: TestSuiteInfo) => Promise; +export declare type TestRunComplete = (results: AggregatedResult) => void; +export declare type JestHookSubscriber = { + onFileChange: (fn: FileChange) => void; + onTestRunComplete: (fn: TestRunComplete) => void; + shouldRunTestSuite: (fn: ShouldRunTestSuite) => void; +}; +export declare type JestHookEmitter = { + onFileChange: (fs: JestHookExposedFS) => void; + onTestRunComplete: (results: AggregatedResult) => void; + shouldRunTestSuite: (testSuiteInfo: TestSuiteInfo) => Promise | boolean; +}; +export declare type UsageData = { + key: string; + prompt: string; +}; +export declare type AllowedConfigOptions = Partial & { + mode: 'watch' | 'watchAll'; +}>; +export declare type UpdateConfigCallback = (config?: AllowedConfigOptions) => void; +export interface WatchPlugin { + isInternal?: boolean; + apply?: (hooks: JestHookSubscriber) => void; + getUsageInfo?: (globalConfig: Config.GlobalConfig) => UsageData | null; + onKey?: (value: string) => void; + run?: (globalConfig: Config.GlobalConfig, updateConfigAndRun: UpdateConfigCallback) => Promise; +} +export interface WatchPluginClass { + new (options: { + stdin: NodeJS.ReadStream; + stdout: NodeJS.WriteStream; + }): WatchPlugin; +} +export declare type ScrollOptions = { + offset: number; + max: number; +}; +export {}; diff --git a/node_modules/jest-worker/build/ts3.4/Farm.d.ts b/node_modules/jest-worker/build/ts3.4/Farm.d.ts index b312d1192..7ebd93196 100644 --- a/node_modules/jest-worker/build/ts3.4/Farm.d.ts +++ b/node_modules/jest-worker/build/ts3.4/Farm.d.ts @@ -1,26 +1,26 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import { FarmOptions } from './types'; -export default class Farm { - private _computeWorkerKey; - private _cacheKeys; - private _callback; - private _last; - private _locks; - private _numOfWorkers; - private _offset; - private _queue; - constructor(numOfWorkers: number, callback: Function, computeWorkerKey?: FarmOptions['computeWorkerKey']); - doWork(method: string, ...args: Array): Promise; - private _getNextTask; - private _process; - private _enqueue; - private _push; - private _lock; - private _unlock; - private _isLocked; -} +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import { FarmOptions } from './types'; +export default class Farm { + private _computeWorkerKey; + private _cacheKeys; + private _callback; + private _last; + private _locks; + private _numOfWorkers; + private _offset; + private _queue; + constructor(numOfWorkers: number, callback: Function, computeWorkerKey?: FarmOptions['computeWorkerKey']); + doWork(method: string, ...args: Array): Promise; + private _getNextTask; + private _process; + private _enqueue; + private _push; + private _lock; + private _unlock; + private _isLocked; +} diff --git a/node_modules/jest-worker/build/ts3.4/WorkerPool.d.ts b/node_modules/jest-worker/build/ts3.4/WorkerPool.d.ts index fe3e12ae1..b26700686 100644 --- a/node_modules/jest-worker/build/ts3.4/WorkerPool.d.ts +++ b/node_modules/jest-worker/build/ts3.4/WorkerPool.d.ts @@ -1,13 +1,13 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import BaseWorkerPool from './base/BaseWorkerPool'; -import { ChildMessage, OnEnd, OnStart, WorkerInterface, WorkerOptions, WorkerPoolInterface } from './types'; -declare class WorkerPool extends BaseWorkerPool implements WorkerPoolInterface { - send(workerId: number, request: ChildMessage, onStart: OnStart, onEnd: OnEnd): void; - createWorker(workerOptions: WorkerOptions): WorkerInterface; -} -export default WorkerPool; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import BaseWorkerPool from './base/BaseWorkerPool'; +import { ChildMessage, OnEnd, OnStart, WorkerInterface, WorkerOptions, WorkerPoolInterface } from './types'; +declare class WorkerPool extends BaseWorkerPool implements WorkerPoolInterface { + send(workerId: number, request: ChildMessage, onStart: OnStart, onEnd: OnEnd): void; + createWorker(workerOptions: WorkerOptions): WorkerInterface; +} +export default WorkerPool; diff --git a/node_modules/jest-worker/build/ts3.4/base/BaseWorkerPool.d.ts b/node_modules/jest-worker/build/ts3.4/base/BaseWorkerPool.d.ts index d27b20911..dbfdad521 100644 --- a/node_modules/jest-worker/build/ts3.4/base/BaseWorkerPool.d.ts +++ b/node_modules/jest-worker/build/ts3.4/base/BaseWorkerPool.d.ts @@ -1,22 +1,22 @@ -/// -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -/// -import { PoolExitResult, WorkerInterface, WorkerOptions, WorkerPoolOptions } from '../types'; -export default class BaseWorkerPool { - private readonly _stderr; - private readonly _stdout; - protected readonly _options: WorkerPoolOptions; - private readonly _workers; - constructor(workerPath: string, options: WorkerPoolOptions); - getStderr(): NodeJS.ReadableStream; - getStdout(): NodeJS.ReadableStream; - getWorkers(): Array; - getWorkerById(workerId: number): WorkerInterface; - createWorker(_workerOptions: WorkerOptions): WorkerInterface; - end(): Promise; -} +/// +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +/// +import { PoolExitResult, WorkerInterface, WorkerOptions, WorkerPoolOptions } from '../types'; +export default class BaseWorkerPool { + private readonly _stderr; + private readonly _stdout; + protected readonly _options: WorkerPoolOptions; + private readonly _workers; + constructor(workerPath: string, options: WorkerPoolOptions); + getStderr(): NodeJS.ReadableStream; + getStdout(): NodeJS.ReadableStream; + getWorkers(): Array; + getWorkerById(workerId: number): WorkerInterface; + createWorker(_workerOptions: WorkerOptions): WorkerInterface; + end(): Promise; +} diff --git a/node_modules/jest-worker/build/ts3.4/index.d.ts b/node_modules/jest-worker/build/ts3.4/index.d.ts index f5722f024..b288a55e4 100644 --- a/node_modules/jest-worker/build/ts3.4/index.d.ts +++ b/node_modules/jest-worker/build/ts3.4/index.d.ts @@ -1,46 +1,46 @@ -/// -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -/// -import { FarmOptions, PoolExitResult } from './types'; -/** - * The Jest farm (publicly called "Worker") is a class that allows you to queue - * methods across multiple child processes, in order to parallelize work. This - * is done by providing an absolute path to a module that will be loaded on each - * of the child processes, and bridged to the main process. - * - * Bridged methods are specified by using the "exposedMethods" property of the - * "options" object. This is an array of strings, where each of them corresponds - * to the exported name in the loaded module. - * - * You can also control the amount of workers by using the "numWorkers" property - * of the "options" object, and the settings passed to fork the process through - * the "forkOptions" property. The amount of workers defaults to the amount of - * CPUS minus one. - * - * Queueing calls can be done in two ways: - * - Standard method: calls will be redirected to the first available worker, - * so they will get executed as soon as they can. - * - * - Sticky method: if a "computeWorkerKey" method is provided within the - * config, the resulting string of this method will be used as a key. - * Every time this key is returned, it is guaranteed that your job will be - * processed by the same worker. This is specially useful if your workers - * are caching results. - */ -export default class JestWorker { - private _ending; - private _farm; - private _options; - private _workerPool; - constructor(workerPath: string, options?: FarmOptions); - private _bindExposedWorkerMethods; - private _callFunctionWithArgs; - getStderr(): NodeJS.ReadableStream; - getStdout(): NodeJS.ReadableStream; - end(): Promise; -} +/// +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +/// +import { FarmOptions, PoolExitResult } from './types'; +/** + * The Jest farm (publicly called "Worker") is a class that allows you to queue + * methods across multiple child processes, in order to parallelize work. This + * is done by providing an absolute path to a module that will be loaded on each + * of the child processes, and bridged to the main process. + * + * Bridged methods are specified by using the "exposedMethods" property of the + * "options" object. This is an array of strings, where each of them corresponds + * to the exported name in the loaded module. + * + * You can also control the amount of workers by using the "numWorkers" property + * of the "options" object, and the settings passed to fork the process through + * the "forkOptions" property. The amount of workers defaults to the amount of + * CPUS minus one. + * + * Queueing calls can be done in two ways: + * - Standard method: calls will be redirected to the first available worker, + * so they will get executed as soon as they can. + * + * - Sticky method: if a "computeWorkerKey" method is provided within the + * config, the resulting string of this method will be used as a key. + * Every time this key is returned, it is guaranteed that your job will be + * processed by the same worker. This is specially useful if your workers + * are caching results. + */ +export default class JestWorker { + private _ending; + private _farm; + private _options; + private _workerPool; + constructor(workerPath: string, options?: FarmOptions); + private _bindExposedWorkerMethods; + private _callFunctionWithArgs; + getStderr(): NodeJS.ReadableStream; + getStdout(): NodeJS.ReadableStream; + end(): Promise; +} diff --git a/node_modules/jest-worker/build/ts3.4/types.d.ts b/node_modules/jest-worker/build/ts3.4/types.d.ts index 1f4251d97..b821efe88 100644 --- a/node_modules/jest-worker/build/ts3.4/types.d.ts +++ b/node_modules/jest-worker/build/ts3.4/types.d.ts @@ -1,103 +1,103 @@ -/// -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -/// -import { EventEmitter } from 'events'; -import { ForkOptions } from 'child_process'; -export declare const CHILD_MESSAGE_INITIALIZE: 0; -export declare const CHILD_MESSAGE_CALL: 1; -export declare const CHILD_MESSAGE_END: 2; -export declare const PARENT_MESSAGE_OK: 0; -export declare const PARENT_MESSAGE_CLIENT_ERROR: 1; -export declare const PARENT_MESSAGE_SETUP_ERROR: 2; -export declare type PARENT_MESSAGE_ERROR = typeof PARENT_MESSAGE_CLIENT_ERROR | typeof PARENT_MESSAGE_SETUP_ERROR; -export interface WorkerPoolInterface { - getStderr(): NodeJS.ReadableStream; - getStdout(): NodeJS.ReadableStream; - getWorkers(): Array; - createWorker(options: WorkerOptions): WorkerInterface; - send(workerId: number, request: ChildMessage, onStart: OnStart, onEnd: OnEnd): void; - end(): Promise; -} -export interface WorkerInterface { - send(request: ChildMessage, onProcessStart: OnStart, onProcessEnd: OnEnd): void; - waitForExit(): Promise; - forceExit(): void; - getWorkerId(): number; - getStderr(): NodeJS.ReadableStream | null; - getStdout(): NodeJS.ReadableStream | null; -} -export declare type PoolExitResult = { - forceExited: boolean; -}; -export { ForkOptions }; -export declare type FarmOptions = { - computeWorkerKey?: (method: string, ...args: Array) => string | null; - exposedMethods?: ReadonlyArray; - forkOptions?: ForkOptions; - setupArgs?: Array; - maxRetries?: number; - numWorkers?: number; - WorkerPool?: (workerPath: string, options?: WorkerPoolOptions) => WorkerPoolInterface; - enableWorkerThreads?: boolean; -}; -export declare type WorkerPoolOptions = { - setupArgs: Array; - forkOptions: ForkOptions; - maxRetries: number; - numWorkers: number; - enableWorkerThreads: boolean; -}; -export declare type WorkerOptions = { - forkOptions: ForkOptions; - setupArgs: Array; - maxRetries: number; - workerId: number; - workerPath: string; -}; -export declare type MessagePort = typeof EventEmitter & { - postMessage(message: unknown): void; -}; -export declare type MessageChannel = { - port1: MessagePort; - port2: MessagePort; -}; -export declare type ChildMessageInitialize = [typeof CHILD_MESSAGE_INITIALIZE, // type -boolean, // processed -string, // file -// file -// file -Array | undefined, // setupArgs -// setupArgs -// setupArgs -MessagePort | undefined]; -export declare type ChildMessageCall = [typeof CHILD_MESSAGE_CALL, // type -boolean, // processed -string, // method -Array]; -export declare type ChildMessageEnd = [typeof CHILD_MESSAGE_END, // type -boolean]; -export declare type ChildMessage = ChildMessageInitialize | ChildMessageCall | ChildMessageEnd; -export declare type ParentMessageOk = [typeof PARENT_MESSAGE_OK, // type -unknown]; -export declare type ParentMessageError = [PARENT_MESSAGE_ERROR, // type -string, // constructor -string, // message -string, // stack -unknown]; -export declare type ParentMessage = ParentMessageOk | ParentMessageError; -export declare type OnStart = (worker: WorkerInterface) => void; -export declare type OnEnd = (err: Error | null, result: unknown) => void; -export declare type QueueChildMessage = { - request: ChildMessage; - onStart: OnStart; - onEnd: OnEnd; -}; -export declare type QueueItem = { - task: QueueChildMessage; - next: QueueItem | null; -}; +/// +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +/// +import { EventEmitter } from 'events'; +import { ForkOptions } from 'child_process'; +export declare const CHILD_MESSAGE_INITIALIZE: 0; +export declare const CHILD_MESSAGE_CALL: 1; +export declare const CHILD_MESSAGE_END: 2; +export declare const PARENT_MESSAGE_OK: 0; +export declare const PARENT_MESSAGE_CLIENT_ERROR: 1; +export declare const PARENT_MESSAGE_SETUP_ERROR: 2; +export declare type PARENT_MESSAGE_ERROR = typeof PARENT_MESSAGE_CLIENT_ERROR | typeof PARENT_MESSAGE_SETUP_ERROR; +export interface WorkerPoolInterface { + getStderr(): NodeJS.ReadableStream; + getStdout(): NodeJS.ReadableStream; + getWorkers(): Array; + createWorker(options: WorkerOptions): WorkerInterface; + send(workerId: number, request: ChildMessage, onStart: OnStart, onEnd: OnEnd): void; + end(): Promise; +} +export interface WorkerInterface { + send(request: ChildMessage, onProcessStart: OnStart, onProcessEnd: OnEnd): void; + waitForExit(): Promise; + forceExit(): void; + getWorkerId(): number; + getStderr(): NodeJS.ReadableStream | null; + getStdout(): NodeJS.ReadableStream | null; +} +export declare type PoolExitResult = { + forceExited: boolean; +}; +export { ForkOptions }; +export declare type FarmOptions = { + computeWorkerKey?: (method: string, ...args: Array) => string | null; + exposedMethods?: ReadonlyArray; + forkOptions?: ForkOptions; + setupArgs?: Array; + maxRetries?: number; + numWorkers?: number; + WorkerPool?: (workerPath: string, options?: WorkerPoolOptions) => WorkerPoolInterface; + enableWorkerThreads?: boolean; +}; +export declare type WorkerPoolOptions = { + setupArgs: Array; + forkOptions: ForkOptions; + maxRetries: number; + numWorkers: number; + enableWorkerThreads: boolean; +}; +export declare type WorkerOptions = { + forkOptions: ForkOptions; + setupArgs: Array; + maxRetries: number; + workerId: number; + workerPath: string; +}; +export declare type MessagePort = typeof EventEmitter & { + postMessage(message: unknown): void; +}; +export declare type MessageChannel = { + port1: MessagePort; + port2: MessagePort; +}; +export declare type ChildMessageInitialize = [typeof CHILD_MESSAGE_INITIALIZE, // type +boolean, // processed +string, // file +// file +// file +Array | undefined, // setupArgs +// setupArgs +// setupArgs +MessagePort | undefined]; +export declare type ChildMessageCall = [typeof CHILD_MESSAGE_CALL, // type +boolean, // processed +string, // method +Array]; +export declare type ChildMessageEnd = [typeof CHILD_MESSAGE_END, // type +boolean]; +export declare type ChildMessage = ChildMessageInitialize | ChildMessageCall | ChildMessageEnd; +export declare type ParentMessageOk = [typeof PARENT_MESSAGE_OK, // type +unknown]; +export declare type ParentMessageError = [PARENT_MESSAGE_ERROR, // type +string, // constructor +string, // message +string, // stack +unknown]; +export declare type ParentMessage = ParentMessageOk | ParentMessageError; +export declare type OnStart = (worker: WorkerInterface) => void; +export declare type OnEnd = (err: Error | null, result: unknown) => void; +export declare type QueueChildMessage = { + request: ChildMessage; + onStart: OnStart; + onEnd: OnEnd; +}; +export declare type QueueItem = { + task: QueueChildMessage; + next: QueueItem | null; +}; diff --git a/node_modules/jest-worker/build/ts3.4/workers/ChildProcessWorker.d.ts b/node_modules/jest-worker/build/ts3.4/workers/ChildProcessWorker.d.ts index 35f066f55..2787753a0 100644 --- a/node_modules/jest-worker/build/ts3.4/workers/ChildProcessWorker.d.ts +++ b/node_modules/jest-worker/build/ts3.4/workers/ChildProcessWorker.d.ts @@ -1,51 +1,51 @@ -/// -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -/// -import { ChildMessage, OnEnd, OnStart, WorkerInterface, WorkerOptions } from '../types'; -/** - * This class wraps the child process and provides a nice interface to - * communicate with. It takes care of: - * - * - Re-spawning the process if it dies. - * - Queues calls while the worker is busy. - * - Re-sends the requests if the worker blew up. - * - * The reason for queueing them here (since childProcess.send also has an - * internal queue) is because the worker could be doing asynchronous work, and - * this would lead to the child process to read its receiving buffer and start a - * second call. By queueing calls here, we don't send the next call to the - * children until we receive the result of the previous one. - * - * As soon as a request starts to be processed by a worker, its "processed" - * field is changed to "true", so that other workers which might encounter the - * same call skip it. - */ -export default class ChildProcessWorker implements WorkerInterface { - private _child; - private _options; - private _request; - private _retries; - private _onProcessEnd; - private _fakeStream; - private _stdout; - private _stderr; - private _exitPromise; - private _resolveExitPromise; - constructor(options: WorkerOptions); - initialize(): void; - private _shutdown; - private _onMessage; - private _onExit; - send(request: ChildMessage, onProcessStart: OnStart, onProcessEnd: OnEnd): void; - waitForExit(): Promise; - forceExit(): void; - getWorkerId(): number; - getStdout(): NodeJS.ReadableStream | null; - getStderr(): NodeJS.ReadableStream | null; - private _getFakeStream; -} +/// +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +/// +import { ChildMessage, OnEnd, OnStart, WorkerInterface, WorkerOptions } from '../types'; +/** + * This class wraps the child process and provides a nice interface to + * communicate with. It takes care of: + * + * - Re-spawning the process if it dies. + * - Queues calls while the worker is busy. + * - Re-sends the requests if the worker blew up. + * + * The reason for queueing them here (since childProcess.send also has an + * internal queue) is because the worker could be doing asynchronous work, and + * this would lead to the child process to read its receiving buffer and start a + * second call. By queueing calls here, we don't send the next call to the + * children until we receive the result of the previous one. + * + * As soon as a request starts to be processed by a worker, its "processed" + * field is changed to "true", so that other workers which might encounter the + * same call skip it. + */ +export default class ChildProcessWorker implements WorkerInterface { + private _child; + private _options; + private _request; + private _retries; + private _onProcessEnd; + private _fakeStream; + private _stdout; + private _stderr; + private _exitPromise; + private _resolveExitPromise; + constructor(options: WorkerOptions); + initialize(): void; + private _shutdown; + private _onMessage; + private _onExit; + send(request: ChildMessage, onProcessStart: OnStart, onProcessEnd: OnEnd): void; + waitForExit(): Promise; + forceExit(): void; + getWorkerId(): number; + getStdout(): NodeJS.ReadableStream | null; + getStderr(): NodeJS.ReadableStream | null; + private _getFakeStream; +} diff --git a/node_modules/jest-worker/build/ts3.4/workers/NodeThreadsWorker.d.ts b/node_modules/jest-worker/build/ts3.4/workers/NodeThreadsWorker.d.ts index b618a6a05..61a1a2ab0 100644 --- a/node_modules/jest-worker/build/ts3.4/workers/NodeThreadsWorker.d.ts +++ b/node_modules/jest-worker/build/ts3.4/workers/NodeThreadsWorker.d.ts @@ -1,34 +1,34 @@ -/// -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -/// -import { ChildMessage, OnEnd, OnStart, WorkerInterface, WorkerOptions } from '../types'; -export default class ExperimentalWorker implements WorkerInterface { - private _worker; - private _options; - private _request; - private _retries; - private _onProcessEnd; - private _fakeStream; - private _stdout; - private _stderr; - private _exitPromise; - private _resolveExitPromise; - private _forceExited; - constructor(options: WorkerOptions); - initialize(): void; - private _shutdown; - private _onMessage; - private _onExit; - waitForExit(): Promise; - forceExit(): void; - send(request: ChildMessage, onProcessStart: OnStart, onProcessEnd: OnEnd): void; - getWorkerId(): number; - getStdout(): NodeJS.ReadableStream | null; - getStderr(): NodeJS.ReadableStream | null; - private _getFakeStream; -} +/// +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +/// +import { ChildMessage, OnEnd, OnStart, WorkerInterface, WorkerOptions } from '../types'; +export default class ExperimentalWorker implements WorkerInterface { + private _worker; + private _options; + private _request; + private _retries; + private _onProcessEnd; + private _fakeStream; + private _stdout; + private _stderr; + private _exitPromise; + private _resolveExitPromise; + private _forceExited; + constructor(options: WorkerOptions); + initialize(): void; + private _shutdown; + private _onMessage; + private _onExit; + waitForExit(): Promise; + forceExit(): void; + send(request: ChildMessage, onProcessStart: OnStart, onProcessEnd: OnEnd): void; + getWorkerId(): number; + getStdout(): NodeJS.ReadableStream | null; + getStderr(): NodeJS.ReadableStream | null; + private _getFakeStream; +} diff --git a/node_modules/jest-worker/build/ts3.4/workers/processChild.d.ts b/node_modules/jest-worker/build/ts3.4/workers/processChild.d.ts index fac0c7e35..4fd5553a8 100644 --- a/node_modules/jest-worker/build/ts3.4/workers/processChild.d.ts +++ b/node_modules/jest-worker/build/ts3.4/workers/processChild.d.ts @@ -1,7 +1,7 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -export {}; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +export {}; diff --git a/node_modules/jest-worker/build/ts3.4/workers/threadChild.d.ts b/node_modules/jest-worker/build/ts3.4/workers/threadChild.d.ts index fac0c7e35..4fd5553a8 100644 --- a/node_modules/jest-worker/build/ts3.4/workers/threadChild.d.ts +++ b/node_modules/jest-worker/build/ts3.4/workers/threadChild.d.ts @@ -1,7 +1,7 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -export {}; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +export {}; diff --git a/node_modules/jest/bin/jest.js b/node_modules/jest/bin/jest.js old mode 100644 new mode 100755 diff --git a/node_modules/jest/build/ts3.4/jest.d.ts b/node_modules/jest/build/ts3.4/jest.d.ts index a264eabed..30f5a88dd 100644 --- a/node_modules/jest/build/ts3.4/jest.d.ts +++ b/node_modules/jest/build/ts3.4/jest.d.ts @@ -1,8 +1,8 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -export { SearchSource, TestScheduler, TestWatcher, getVersion, runCLI, } from '@jest/core'; -export { run } from 'jest-cli'; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +export { SearchSource, TestScheduler, TestWatcher, getVersion, runCLI, } from '@jest/core'; +export { run } from 'jest-cli'; diff --git a/node_modules/js-yaml/bin/js-yaml.js b/node_modules/js-yaml/bin/js-yaml.js old mode 100644 new mode 100755 diff --git a/node_modules/js-yaml/node_modules/.bin/esparse b/node_modules/js-yaml/node_modules/.bin/esparse deleted file mode 100644 index 1cc1c96ff..000000000 --- a/node_modules/js-yaml/node_modules/.bin/esparse +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") - -case `uname` in - *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;; -esac - -if [ -x "$basedir/node" ]; then - exec "$basedir/node" "$basedir/../esprima/bin/esparse.js" "$@" -else - exec node "$basedir/../esprima/bin/esparse.js" "$@" -fi diff --git a/node_modules/js-yaml/node_modules/.bin/esparse b/node_modules/js-yaml/node_modules/.bin/esparse new file mode 120000 index 000000000..7423b18b2 --- /dev/null +++ b/node_modules/js-yaml/node_modules/.bin/esparse @@ -0,0 +1 @@ +../esprima/bin/esparse.js \ No newline at end of file diff --git a/node_modules/js-yaml/node_modules/.bin/esparse.cmd b/node_modules/js-yaml/node_modules/.bin/esparse.cmd deleted file mode 100644 index 2ca6d502e..000000000 --- a/node_modules/js-yaml/node_modules/.bin/esparse.cmd +++ /dev/null @@ -1,17 +0,0 @@ -@ECHO off -GOTO start -:find_dp0 -SET dp0=%~dp0 -EXIT /b -:start -SETLOCAL -CALL :find_dp0 - -IF EXIST "%dp0%\node.exe" ( - SET "_prog=%dp0%\node.exe" -) ELSE ( - SET "_prog=node" - SET PATHEXT=%PATHEXT:;.JS;=;% -) - -endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\esprima\bin\esparse.js" %* diff --git a/node_modules/js-yaml/node_modules/.bin/esparse.ps1 b/node_modules/js-yaml/node_modules/.bin/esparse.ps1 deleted file mode 100644 index f19ed7301..000000000 --- a/node_modules/js-yaml/node_modules/.bin/esparse.ps1 +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env pwsh -$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent - -$exe="" -if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { - # Fix case when both the Windows and Linux builds of Node - # are installed in the same directory - $exe=".exe" -} -$ret=0 -if (Test-Path "$basedir/node$exe") { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "$basedir/node$exe" "$basedir/../esprima/bin/esparse.js" $args - } else { - & "$basedir/node$exe" "$basedir/../esprima/bin/esparse.js" $args - } - $ret=$LASTEXITCODE -} else { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "node$exe" "$basedir/../esprima/bin/esparse.js" $args - } else { - & "node$exe" "$basedir/../esprima/bin/esparse.js" $args - } - $ret=$LASTEXITCODE -} -exit $ret diff --git a/node_modules/js-yaml/node_modules/.bin/esvalidate b/node_modules/js-yaml/node_modules/.bin/esvalidate deleted file mode 100644 index 91a4c9b5f..000000000 --- a/node_modules/js-yaml/node_modules/.bin/esvalidate +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") - -case `uname` in - *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;; -esac - -if [ -x "$basedir/node" ]; then - exec "$basedir/node" "$basedir/../esprima/bin/esvalidate.js" "$@" -else - exec node "$basedir/../esprima/bin/esvalidate.js" "$@" -fi diff --git a/node_modules/js-yaml/node_modules/.bin/esvalidate b/node_modules/js-yaml/node_modules/.bin/esvalidate new file mode 120000 index 000000000..16069effb --- /dev/null +++ b/node_modules/js-yaml/node_modules/.bin/esvalidate @@ -0,0 +1 @@ +../esprima/bin/esvalidate.js \ No newline at end of file diff --git a/node_modules/js-yaml/node_modules/.bin/esvalidate.cmd b/node_modules/js-yaml/node_modules/.bin/esvalidate.cmd deleted file mode 100644 index 4c41643ef..000000000 --- a/node_modules/js-yaml/node_modules/.bin/esvalidate.cmd +++ /dev/null @@ -1,17 +0,0 @@ -@ECHO off -GOTO start -:find_dp0 -SET dp0=%~dp0 -EXIT /b -:start -SETLOCAL -CALL :find_dp0 - -IF EXIST "%dp0%\node.exe" ( - SET "_prog=%dp0%\node.exe" -) ELSE ( - SET "_prog=node" - SET PATHEXT=%PATHEXT:;.JS;=;% -) - -endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\esprima\bin\esvalidate.js" %* diff --git a/node_modules/js-yaml/node_modules/.bin/esvalidate.ps1 b/node_modules/js-yaml/node_modules/.bin/esvalidate.ps1 deleted file mode 100644 index 23699d11e..000000000 --- a/node_modules/js-yaml/node_modules/.bin/esvalidate.ps1 +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env pwsh -$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent - -$exe="" -if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { - # Fix case when both the Windows and Linux builds of Node - # are installed in the same directory - $exe=".exe" -} -$ret=0 -if (Test-Path "$basedir/node$exe") { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "$basedir/node$exe" "$basedir/../esprima/bin/esvalidate.js" $args - } else { - & "$basedir/node$exe" "$basedir/../esprima/bin/esvalidate.js" $args - } - $ret=$LASTEXITCODE -} else { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "node$exe" "$basedir/../esprima/bin/esvalidate.js" $args - } else { - & "node$exe" "$basedir/../esprima/bin/esvalidate.js" $args - } - $ret=$LASTEXITCODE -} -exit $ret diff --git a/node_modules/js-yaml/node_modules/esprima/bin/esparse.js b/node_modules/js-yaml/node_modules/esprima/bin/esparse.js old mode 100644 new mode 100755 diff --git a/node_modules/js-yaml/node_modules/esprima/bin/esvalidate.js b/node_modules/js-yaml/node_modules/esprima/bin/esvalidate.js old mode 100644 new mode 100755 diff --git a/node_modules/jsesc/bin/jsesc b/node_modules/jsesc/bin/jsesc old mode 100644 new mode 100755 diff --git a/node_modules/json-schema/LICENSE b/node_modules/json-schema/LICENSE index 139f008d2..824c87fa6 100644 --- a/node_modules/json-schema/LICENSE +++ b/node_modules/json-schema/LICENSE @@ -1,195 +1,195 @@ -Dojo is available under *either* the terms of the BSD 3-Clause "New" License *or* the -Academic Free License version 2.1. As a recipient of Dojo, you may choose which -license to receive this code under (except as noted in per-module LICENSE -files). Some modules may not be the copyright of the Dojo Foundation. These -modules contain explicit declarations of copyright in both the LICENSE files in -the directories in which they reside and in the code itself. No external -contributions are allowed under licenses which are fundamentally incompatible -with the AFL-2.1 OR and BSD-3-Clause licenses that Dojo is distributed under. - -The text of the AFL-2.1 and BSD-3-Clause licenses is reproduced below. - -------------------------------------------------------------------------------- -BSD 3-Clause "New" License: -********************** - -Copyright (c) 2005-2015, The Dojo Foundation -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of the Dojo Foundation nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -------------------------------------------------------------------------------- -The Academic Free License, v. 2.1: -********************************** - -This Academic Free License (the "License") applies to any original work of -authorship (the "Original Work") whose owner (the "Licensor") has placed the -following notice immediately following the copyright notice for the Original -Work: - -Licensed under the Academic Free License version 2.1 - -1) Grant of Copyright License. Licensor hereby grants You a world-wide, -royalty-free, non-exclusive, perpetual, sublicenseable license to do the -following: - -a) to reproduce the Original Work in copies; - -b) to prepare derivative works ("Derivative Works") based upon the Original -Work; - -c) to distribute copies of the Original Work and Derivative Works to the -public; - -d) to perform the Original Work publicly; and - -e) to display the Original Work publicly. - -2) Grant of Patent License. Licensor hereby grants You a world-wide, -royalty-free, non-exclusive, perpetual, sublicenseable license, under patent -claims owned or controlled by the Licensor that are embodied in the Original -Work as furnished by the Licensor, to make, use, sell and offer for sale the -Original Work and Derivative Works. - -3) Grant of Source Code License. The term "Source Code" means the preferred -form of the Original Work for making modifications to it and all available -documentation describing how to modify the Original Work. Licensor hereby -agrees to provide a machine-readable copy of the Source Code of the Original -Work along with each copy of the Original Work that Licensor distributes. -Licensor reserves the right to satisfy this obligation by placing a -machine-readable copy of the Source Code in an information repository -reasonably calculated to permit inexpensive and convenient access by You for as -long as Licensor continues to distribute the Original Work, and by publishing -the address of that information repository in a notice immediately following -the copyright notice that applies to the Original Work. - -4) Exclusions From License Grant. Neither the names of Licensor, nor the names -of any contributors to the Original Work, nor any of their trademarks or -service marks, may be used to endorse or promote products derived from this -Original Work without express prior written permission of the Licensor. Nothing -in this License shall be deemed to grant any rights to trademarks, copyrights, -patents, trade secrets or any other intellectual property of Licensor except as -expressly stated herein. No patent license is granted to make, use, sell or -offer to sell embodiments of any patent claims other than the licensed claims -defined in Section 2. No right is granted to the trademarks of Licensor even if -such marks are included in the Original Work. Nothing in this License shall be -interpreted to prohibit Licensor from licensing under different terms from this -License any Original Work that Licensor otherwise would have a right to -license. - -5) This section intentionally omitted. - -6) Attribution Rights. You must retain, in the Source Code of any Derivative -Works that You create, all copyright, patent or trademark notices from the -Source Code of the Original Work, as well as any notices of licensing and any -descriptive text identified therein as an "Attribution Notice." You must cause -the Source Code for any Derivative Works that You create to carry a prominent -Attribution Notice reasonably calculated to inform recipients that You have -modified the Original Work. - -7) Warranty of Provenance and Disclaimer of Warranty. Licensor warrants that -the copyright in and to the Original Work and the patent rights granted herein -by Licensor are owned by the Licensor or are sublicensed to You under the terms -of this License with the permission of the contributor(s) of those copyrights -and patent rights. Except as expressly stated in the immediately proceeding -sentence, the Original Work is provided under this License on an "AS IS" BASIS -and WITHOUT WARRANTY, either express or implied, including, without limitation, -the warranties of NON-INFRINGEMENT, MERCHANTABILITY or FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY OF THE ORIGINAL WORK IS WITH YOU. -This DISCLAIMER OF WARRANTY constitutes an essential part of this License. No -license to Original Work is granted hereunder except under this disclaimer. - -8) Limitation of Liability. Under no circumstances and under no legal theory, -whether in tort (including negligence), contract, or otherwise, shall the -Licensor be liable to any person for any direct, indirect, special, incidental, -or consequential damages of any character arising as a result of this License -or the use of the Original Work including, without limitation, damages for loss -of goodwill, work stoppage, computer failure or malfunction, or any and all -other commercial damages or losses. This limitation of liability shall not -apply to liability for death or personal injury resulting from Licensor's -negligence to the extent applicable law prohibits such limitation. Some -jurisdictions do not allow the exclusion or limitation of incidental or -consequential damages, so this exclusion and limitation may not apply to You. - -9) Acceptance and Termination. If You distribute copies of the Original Work or -a Derivative Work, You must make a reasonable effort under the circumstances to -obtain the express assent of recipients to the terms of this License. Nothing -else but this License (or another written agreement between Licensor and You) -grants You permission to create Derivative Works based upon the Original Work -or to exercise any of the rights granted in Section 1 herein, and any attempt -to do so except under the terms of this License (or another written agreement -between Licensor and You) is expressly prohibited by U.S. copyright law, the -equivalent laws of other countries, and by international treaty. Therefore, by -exercising any of the rights granted to You in Section 1 herein, You indicate -Your acceptance of this License and all of its terms and conditions. - -10) Termination for Patent Action. This License shall terminate automatically -and You may no longer exercise any of the rights granted to You by this License -as of the date You commence an action, including a cross-claim or counterclaim, -against Licensor or any licensee alleging that the Original Work infringes a -patent. This termination provision shall not apply for an action alleging -patent infringement by combinations of the Original Work with other software or -hardware. - -11) Jurisdiction, Venue and Governing Law. Any action or suit relating to this -License may be brought only in the courts of a jurisdiction wherein the -Licensor resides or in which Licensor conducts its primary business, and under -the laws of that jurisdiction excluding its conflict-of-law provisions. The -application of the United Nations Convention on Contracts for the International -Sale of Goods is expressly excluded. Any use of the Original Work outside the -scope of this License or after its termination shall be subject to the -requirements and penalties of the U.S. Copyright Act, 17 U.S.C. § 101 et -seq., the equivalent laws of other countries, and international treaty. This -section shall survive the termination of this License. - -12) Attorneys Fees. In any action to enforce the terms of this License or -seeking damages relating thereto, the prevailing party shall be entitled to -recover its costs and expenses, including, without limitation, reasonable -attorneys' fees and costs incurred in connection with such action, including -any appeal of such action. This section shall survive the termination of this -License. - -13) Miscellaneous. This License represents the complete agreement concerning -the subject matter hereof. If any provision of this License is held to be -unenforceable, such provision shall be reformed only to the extent necessary to -make it enforceable. - -14) Definition of "You" in This License. "You" throughout this License, whether -in upper or lower case, means an individual or a legal entity exercising rights -under, and complying with all of the terms of, this License. For legal -entities, "You" includes any entity that controls, is controlled by, or is -under common control with you. For purposes of this definition, "control" means -(i) the power, direct or indirect, to cause the direction or management of such -entity, whether by contract or otherwise, or (ii) ownership of fifty percent -(50%) or more of the outstanding shares, or (iii) beneficial ownership of such -entity. - -15) Right to Use. You may use the Original Work in all ways not otherwise -restricted or conditioned by this License or by law, and Licensor promises not -to interfere with or be responsible for such uses by You. - -This license is Copyright (C) 2003-2004 Lawrence E. Rosen. All rights reserved. -Permission is hereby granted to copy and distribute this license without -modification. This license may not be modified without the express written -permission of its copyright owner. +Dojo is available under *either* the terms of the BSD 3-Clause "New" License *or* the +Academic Free License version 2.1. As a recipient of Dojo, you may choose which +license to receive this code under (except as noted in per-module LICENSE +files). Some modules may not be the copyright of the Dojo Foundation. These +modules contain explicit declarations of copyright in both the LICENSE files in +the directories in which they reside and in the code itself. No external +contributions are allowed under licenses which are fundamentally incompatible +with the AFL-2.1 OR and BSD-3-Clause licenses that Dojo is distributed under. + +The text of the AFL-2.1 and BSD-3-Clause licenses is reproduced below. + +------------------------------------------------------------------------------- +BSD 3-Clause "New" License: +********************** + +Copyright (c) 2005-2015, The Dojo Foundation +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of the Dojo Foundation nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +------------------------------------------------------------------------------- +The Academic Free License, v. 2.1: +********************************** + +This Academic Free License (the "License") applies to any original work of +authorship (the "Original Work") whose owner (the "Licensor") has placed the +following notice immediately following the copyright notice for the Original +Work: + +Licensed under the Academic Free License version 2.1 + +1) Grant of Copyright License. Licensor hereby grants You a world-wide, +royalty-free, non-exclusive, perpetual, sublicenseable license to do the +following: + +a) to reproduce the Original Work in copies; + +b) to prepare derivative works ("Derivative Works") based upon the Original +Work; + +c) to distribute copies of the Original Work and Derivative Works to the +public; + +d) to perform the Original Work publicly; and + +e) to display the Original Work publicly. + +2) Grant of Patent License. Licensor hereby grants You a world-wide, +royalty-free, non-exclusive, perpetual, sublicenseable license, under patent +claims owned or controlled by the Licensor that are embodied in the Original +Work as furnished by the Licensor, to make, use, sell and offer for sale the +Original Work and Derivative Works. + +3) Grant of Source Code License. The term "Source Code" means the preferred +form of the Original Work for making modifications to it and all available +documentation describing how to modify the Original Work. Licensor hereby +agrees to provide a machine-readable copy of the Source Code of the Original +Work along with each copy of the Original Work that Licensor distributes. +Licensor reserves the right to satisfy this obligation by placing a +machine-readable copy of the Source Code in an information repository +reasonably calculated to permit inexpensive and convenient access by You for as +long as Licensor continues to distribute the Original Work, and by publishing +the address of that information repository in a notice immediately following +the copyright notice that applies to the Original Work. + +4) Exclusions From License Grant. Neither the names of Licensor, nor the names +of any contributors to the Original Work, nor any of their trademarks or +service marks, may be used to endorse or promote products derived from this +Original Work without express prior written permission of the Licensor. Nothing +in this License shall be deemed to grant any rights to trademarks, copyrights, +patents, trade secrets or any other intellectual property of Licensor except as +expressly stated herein. No patent license is granted to make, use, sell or +offer to sell embodiments of any patent claims other than the licensed claims +defined in Section 2. No right is granted to the trademarks of Licensor even if +such marks are included in the Original Work. Nothing in this License shall be +interpreted to prohibit Licensor from licensing under different terms from this +License any Original Work that Licensor otherwise would have a right to +license. + +5) This section intentionally omitted. + +6) Attribution Rights. You must retain, in the Source Code of any Derivative +Works that You create, all copyright, patent or trademark notices from the +Source Code of the Original Work, as well as any notices of licensing and any +descriptive text identified therein as an "Attribution Notice." You must cause +the Source Code for any Derivative Works that You create to carry a prominent +Attribution Notice reasonably calculated to inform recipients that You have +modified the Original Work. + +7) Warranty of Provenance and Disclaimer of Warranty. Licensor warrants that +the copyright in and to the Original Work and the patent rights granted herein +by Licensor are owned by the Licensor or are sublicensed to You under the terms +of this License with the permission of the contributor(s) of those copyrights +and patent rights. Except as expressly stated in the immediately proceeding +sentence, the Original Work is provided under this License on an "AS IS" BASIS +and WITHOUT WARRANTY, either express or implied, including, without limitation, +the warranties of NON-INFRINGEMENT, MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY OF THE ORIGINAL WORK IS WITH YOU. +This DISCLAIMER OF WARRANTY constitutes an essential part of this License. No +license to Original Work is granted hereunder except under this disclaimer. + +8) Limitation of Liability. Under no circumstances and under no legal theory, +whether in tort (including negligence), contract, or otherwise, shall the +Licensor be liable to any person for any direct, indirect, special, incidental, +or consequential damages of any character arising as a result of this License +or the use of the Original Work including, without limitation, damages for loss +of goodwill, work stoppage, computer failure or malfunction, or any and all +other commercial damages or losses. This limitation of liability shall not +apply to liability for death or personal injury resulting from Licensor's +negligence to the extent applicable law prohibits such limitation. Some +jurisdictions do not allow the exclusion or limitation of incidental or +consequential damages, so this exclusion and limitation may not apply to You. + +9) Acceptance and Termination. If You distribute copies of the Original Work or +a Derivative Work, You must make a reasonable effort under the circumstances to +obtain the express assent of recipients to the terms of this License. Nothing +else but this License (or another written agreement between Licensor and You) +grants You permission to create Derivative Works based upon the Original Work +or to exercise any of the rights granted in Section 1 herein, and any attempt +to do so except under the terms of this License (or another written agreement +between Licensor and You) is expressly prohibited by U.S. copyright law, the +equivalent laws of other countries, and by international treaty. Therefore, by +exercising any of the rights granted to You in Section 1 herein, You indicate +Your acceptance of this License and all of its terms and conditions. + +10) Termination for Patent Action. This License shall terminate automatically +and You may no longer exercise any of the rights granted to You by this License +as of the date You commence an action, including a cross-claim or counterclaim, +against Licensor or any licensee alleging that the Original Work infringes a +patent. This termination provision shall not apply for an action alleging +patent infringement by combinations of the Original Work with other software or +hardware. + +11) Jurisdiction, Venue and Governing Law. Any action or suit relating to this +License may be brought only in the courts of a jurisdiction wherein the +Licensor resides or in which Licensor conducts its primary business, and under +the laws of that jurisdiction excluding its conflict-of-law provisions. The +application of the United Nations Convention on Contracts for the International +Sale of Goods is expressly excluded. Any use of the Original Work outside the +scope of this License or after its termination shall be subject to the +requirements and penalties of the U.S. Copyright Act, 17 U.S.C. § 101 et +seq., the equivalent laws of other countries, and international treaty. This +section shall survive the termination of this License. + +12) Attorneys Fees. In any action to enforce the terms of this License or +seeking damages relating thereto, the prevailing party shall be entitled to +recover its costs and expenses, including, without limitation, reasonable +attorneys' fees and costs incurred in connection with such action, including +any appeal of such action. This section shall survive the termination of this +License. + +13) Miscellaneous. This License represents the complete agreement concerning +the subject matter hereof. If any provision of this License is held to be +unenforceable, such provision shall be reformed only to the extent necessary to +make it enforceable. + +14) Definition of "You" in This License. "You" throughout this License, whether +in upper or lower case, means an individual or a legal entity exercising rights +under, and complying with all of the terms of, this License. For legal +entities, "You" includes any entity that controls, is controlled by, or is +under common control with you. For purposes of this definition, "control" means +(i) the power, direct or indirect, to cause the direction or management of such +entity, whether by contract or otherwise, or (ii) ownership of fifty percent +(50%) or more of the outstanding shares, or (iii) beneficial ownership of such +entity. + +15) Right to Use. You may use the Original Work in all ways not otherwise +restricted or conditioned by this License or by law, and Licensor promises not +to interfere with or be responsible for such uses by You. + +This license is Copyright (C) 2003-2004 Lawrence E. Rosen. All rights reserved. +Permission is hereby granted to copy and distribute this license without +modification. This license may not be modified without the express written +permission of its copyright owner. diff --git a/node_modules/json-schema/README.md b/node_modules/json-schema/README.md index e23cd3051..b58623908 100644 --- a/node_modules/json-schema/README.md +++ b/node_modules/json-schema/README.md @@ -1,3 +1,3 @@ -This is a historical repository for the early development of the JSON Schema specification and implementation. This package is considered "finished": it holds the earlier draft specification and a simple, efficient, lightweight implementation of the original core elements of JSON Schema. This repository does not house the latest specifications nor does it implement the latest versions of JSON Schema. This package seeks to maintain the stability (in behavior and size) of this original implementation for the sake of the numerous packages that rely on it. For the latest JSON Schema specifications and implementations, please visit the [JSON Schema site](https://json-schema.org/) (or the [respository](https://github.com/json-schema-org/json-schema-spec)). - -Code is licensed under the AFL or BSD 3-Clause license. +This is a historical repository for the early development of the JSON Schema specification and implementation. This package is considered "finished": it holds the earlier draft specification and a simple, efficient, lightweight implementation of the original core elements of JSON Schema. This repository does not house the latest specifications nor does it implement the latest versions of JSON Schema. This package seeks to maintain the stability (in behavior and size) of this original implementation for the sake of the numerous packages that rely on it. For the latest JSON Schema specifications and implementations, please visit the [JSON Schema site](https://json-schema.org/) (or the [respository](https://github.com/json-schema-org/json-schema-spec)). + +Code is licensed under the AFL or BSD 3-Clause license. diff --git a/node_modules/json-schema/lib/links.js b/node_modules/json-schema/lib/links.js index d9a114bcb..cacb4799c 100644 --- a/node_modules/json-schema/lib/links.js +++ b/node_modules/json-schema/lib/links.js @@ -1,65 +1,65 @@ -/** - * JSON Schema link handler - * Licensed under AFL-2.1 OR BSD-3-Clause - */ -(function (root, factory) { - if (typeof define === 'function' && define.amd) { - // AMD. Register as an anonymous module. - define([], function () { - return factory(); - }); - } else if (typeof module === 'object' && module.exports) { - // Node. Does not work with strict CommonJS, but - // only CommonJS-like environments that support module.exports, - // like Node. - module.exports = factory(); - } else { - // Browser globals - root.jsonSchemaLinks = factory(); - } -}(this, function () {// setup primitive classes to be JSON Schema types -var exports = {}; -exports.cacheLinks = true; -exports.getLink = function(relation, instance, schema){ - // gets the URI of the link for the given relation based on the instance and schema - // for example: - // getLink( - // "brother", - // {"brother_id":33}, - // {links:[{rel:"brother", href:"Brother/{brother_id}"}]}) -> - // "Brother/33" - var links = schema.__linkTemplates; - if(!links){ - links = {}; - var schemaLinks = schema.links; - if(schemaLinks && schemaLinks instanceof Array){ - schemaLinks.forEach(function(link){ - /* // TODO: allow for multiple same-name relations - if(links[link.rel]){ - if(!(links[link.rel] instanceof Array)){ - links[link.rel] = [links[link.rel]]; - } - }*/ - links[link.rel] = link.href; - }); - } - if(exports.cacheLinks){ - schema.__linkTemplates = links; - } - } - var linkTemplate = links[relation]; - return linkTemplate && exports.substitute(linkTemplate, instance); -}; - -exports.substitute = function(linkTemplate, instance){ - return linkTemplate.replace(/\{([^\}]*)\}/g, function(t, property){ - var value = instance[decodeURIComponent(property)]; - if(value instanceof Array){ - // the value is an array, it should produce a URI like /Table/(4,5,8) and store.get() should handle that as an array of values - return '(' + value.join(',') + ')'; - } - return value; - }); -}; -return exports; +/** + * JSON Schema link handler + * Licensed under AFL-2.1 OR BSD-3-Clause + */ +(function (root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define([], function () { + return factory(); + }); + } else if (typeof module === 'object' && module.exports) { + // Node. Does not work with strict CommonJS, but + // only CommonJS-like environments that support module.exports, + // like Node. + module.exports = factory(); + } else { + // Browser globals + root.jsonSchemaLinks = factory(); + } +}(this, function () {// setup primitive classes to be JSON Schema types +var exports = {}; +exports.cacheLinks = true; +exports.getLink = function(relation, instance, schema){ + // gets the URI of the link for the given relation based on the instance and schema + // for example: + // getLink( + // "brother", + // {"brother_id":33}, + // {links:[{rel:"brother", href:"Brother/{brother_id}"}]}) -> + // "Brother/33" + var links = schema.__linkTemplates; + if(!links){ + links = {}; + var schemaLinks = schema.links; + if(schemaLinks && schemaLinks instanceof Array){ + schemaLinks.forEach(function(link){ + /* // TODO: allow for multiple same-name relations + if(links[link.rel]){ + if(!(links[link.rel] instanceof Array)){ + links[link.rel] = [links[link.rel]]; + } + }*/ + links[link.rel] = link.href; + }); + } + if(exports.cacheLinks){ + schema.__linkTemplates = links; + } + } + var linkTemplate = links[relation]; + return linkTemplate && exports.substitute(linkTemplate, instance); +}; + +exports.substitute = function(linkTemplate, instance){ + return linkTemplate.replace(/\{([^\}]*)\}/g, function(t, property){ + var value = instance[decodeURIComponent(property)]; + if(value instanceof Array){ + // the value is an array, it should produce a URI like /Table/(4,5,8) and store.get() should handle that as an array of values + return '(' + value.join(',') + ')'; + } + return value; + }); +}; +return exports; })); \ No newline at end of file diff --git a/node_modules/json-schema/lib/validate.js b/node_modules/json-schema/lib/validate.js index cace89e66..575973cbe 100644 --- a/node_modules/json-schema/lib/validate.js +++ b/node_modules/json-schema/lib/validate.js @@ -1,271 +1,271 @@ -/** - * JSONSchema Validator - Validates JavaScript objects using JSON Schemas - * (http://www.json.com/json-schema-proposal/) - * Licensed under AFL-2.1 OR BSD-3-Clause -To use the validator call the validate function with an instance object and an optional schema object. -If a schema is provided, it will be used to validate. If the instance object refers to a schema (self-validating), -that schema will be used to validate and the schema parameter is not necessary (if both exist, -both validations will occur). -The validate method will return an array of validation errors. If there are no errors, then an -empty list will be returned. A validation error will have two properties: -"property" which indicates which property had the error -"message" which indicates what the error was - */ -(function (root, factory) { - if (typeof define === 'function' && define.amd) { - // AMD. Register as an anonymous module. - define([], function () { - return factory(); - }); - } else if (typeof module === 'object' && module.exports) { - // Node. Does not work with strict CommonJS, but - // only CommonJS-like environments that support module.exports, - // like Node. - module.exports = factory(); - } else { - // Browser globals - root.jsonSchema = factory(); - } -}(this, function () {// setup primitive classes to be JSON Schema types -var exports = validate -exports.Integer = {type:"integer"}; -var primitiveConstructors = { - String: String, - Boolean: Boolean, - Number: Number, - Object: Object, - Array: Array, - Date: Date -} -exports.validate = validate; -function validate(/*Any*/instance,/*Object*/schema) { - // Summary: - // To use the validator call JSONSchema.validate with an instance object and an optional schema object. - // If a schema is provided, it will be used to validate. If the instance object refers to a schema (self-validating), - // that schema will be used to validate and the schema parameter is not necessary (if both exist, - // both validations will occur). - // The validate method will return an object with two properties: - // valid: A boolean indicating if the instance is valid by the schema - // errors: An array of validation errors. If there are no errors, then an - // empty list will be returned. A validation error will have two properties: - // property: which indicates which property had the error - // message: which indicates what the error was - // - return validate(instance, schema, {changing: false});//, coerce: false, existingOnly: false}); - }; -exports.checkPropertyChange = function(/*Any*/value,/*Object*/schema, /*String*/property) { - // Summary: - // The checkPropertyChange method will check to see if an value can legally be in property with the given schema - // This is slightly different than the validate method in that it will fail if the schema is readonly and it will - // not check for self-validation, it is assumed that the passed in value is already internally valid. - // The checkPropertyChange method will return the same object type as validate, see JSONSchema.validate for - // information. - // - return validate(value, schema, {changing: property || "property"}); - }; -var validate = exports._validate = function(/*Any*/instance,/*Object*/schema,/*Object*/options) { - - if (!options) options = {}; - var _changing = options.changing; - - function getType(schema){ - return schema.type || (primitiveConstructors[schema.name] == schema && schema.name.toLowerCase()); - } - var errors = []; - // validate a value against a property definition - function checkProp(value, schema, path,i){ - - var l; - path += path ? typeof i == 'number' ? '[' + i + ']' : typeof i == 'undefined' ? '' : '.' + i : i; - function addError(message){ - errors.push({property:path,message:message}); - } - - if((typeof schema != 'object' || schema instanceof Array) && (path || typeof schema != 'function') && !(schema && getType(schema))){ - if(typeof schema == 'function'){ - if(!(value instanceof schema)){ - addError("is not an instance of the class/constructor " + schema.name); - } - }else if(schema){ - addError("Invalid schema/property definition " + schema); - } - return null; - } - if(_changing && schema.readonly){ - addError("is a readonly field, it can not be changed"); - } - if(schema['extends']){ // if it extends another schema, it must pass that schema as well - checkProp(value,schema['extends'],path,i); - } - // validate a value against a type definition - function checkType(type,value){ - if(type){ - if(typeof type == 'string' && type != 'any' && - (type == 'null' ? value !== null : typeof value != type) && - !(value instanceof Array && type == 'array') && - !(value instanceof Date && type == 'date') && - !(type == 'integer' && value%1===0)){ - return [{property:path,message:value + " - " + (typeof value) + " value found, but a " + type + " is required"}]; - } - if(type instanceof Array){ - var unionErrors=[]; - for(var j = 0; j < type.length; j++){ // a union type - if(!(unionErrors=checkType(type[j],value)).length){ - break; - } - } - if(unionErrors.length){ - return unionErrors; - } - }else if(typeof type == 'object'){ - var priorErrors = errors; - errors = []; - checkProp(value,type,path); - var theseErrors = errors; - errors = priorErrors; - return theseErrors; - } - } - return []; - } - if(value === undefined){ - if(schema.required){ - addError("is missing and it is required"); - } - }else{ - errors = errors.concat(checkType(getType(schema),value)); - if(schema.disallow && !checkType(schema.disallow,value).length){ - addError(" disallowed value was matched"); - } - if(value !== null){ - if(value instanceof Array){ - if(schema.items){ - var itemsIsArray = schema.items instanceof Array; - var propDef = schema.items; - for (i = 0, l = value.length; i < l; i += 1) { - if (itemsIsArray) - propDef = schema.items[i]; - if (options.coerce) - value[i] = options.coerce(value[i], propDef); - errors.concat(checkProp(value[i],propDef,path,i)); - } - } - if(schema.minItems && value.length < schema.minItems){ - addError("There must be a minimum of " + schema.minItems + " in the array"); - } - if(schema.maxItems && value.length > schema.maxItems){ - addError("There must be a maximum of " + schema.maxItems + " in the array"); - } - }else if(schema.properties || schema.additionalProperties){ - errors.concat(checkObj(value, schema.properties, path, schema.additionalProperties)); - } - if(schema.pattern && typeof value == 'string' && !value.match(schema.pattern)){ - addError("does not match the regex pattern " + schema.pattern); - } - if(schema.maxLength && typeof value == 'string' && value.length > schema.maxLength){ - addError("may only be " + schema.maxLength + " characters long"); - } - if(schema.minLength && typeof value == 'string' && value.length < schema.minLength){ - addError("must be at least " + schema.minLength + " characters long"); - } - if(typeof schema.minimum !== 'undefined' && typeof value == typeof schema.minimum && - schema.minimum > value){ - addError("must have a minimum value of " + schema.minimum); - } - if(typeof schema.maximum !== 'undefined' && typeof value == typeof schema.maximum && - schema.maximum < value){ - addError("must have a maximum value of " + schema.maximum); - } - if(schema['enum']){ - var enumer = schema['enum']; - l = enumer.length; - var found; - for(var j = 0; j < l; j++){ - if(enumer[j]===value){ - found=1; - break; - } - } - if(!found){ - addError("does not have a value in the enumeration " + enumer.join(", ")); - } - } - if(typeof schema.maxDecimal == 'number' && - (value.toString().match(new RegExp("\\.[0-9]{" + (schema.maxDecimal + 1) + ",}")))){ - addError("may only have " + schema.maxDecimal + " digits of decimal places"); - } - } - } - return null; - } - // validate an object against a schema - function checkObj(instance,objTypeDef,path,additionalProp){ - - if(typeof objTypeDef =='object'){ - if(typeof instance != 'object' || instance instanceof Array){ - errors.push({property:path,message:"an object is required"}); - } - - for(var i in objTypeDef){ - if(objTypeDef.hasOwnProperty(i) && i != '__proto__' && i != 'constructor'){ - var value = instance.hasOwnProperty(i) ? instance[i] : undefined; - // skip _not_ specified properties - if (value === undefined && options.existingOnly) continue; - var propDef = objTypeDef[i]; - // set default - if(value === undefined && propDef["default"]){ - value = instance[i] = propDef["default"]; - } - if(options.coerce && i in instance){ - value = instance[i] = options.coerce(value, propDef); - } - checkProp(value,propDef,path,i); - } - } - } - for(i in instance){ - if(instance.hasOwnProperty(i) && !(i.charAt(0) == '_' && i.charAt(1) == '_') && objTypeDef && !objTypeDef[i] && additionalProp===false){ - if (options.filter) { - delete instance[i]; - continue; - } else { - errors.push({property:path,message:"The property " + i + - " is not defined in the schema and the schema does not allow additional properties"}); - } - } - var requires = objTypeDef && objTypeDef[i] && objTypeDef[i].requires; - if(requires && !(requires in instance)){ - errors.push({property:path,message:"the presence of the property " + i + " requires that " + requires + " also be present"}); - } - value = instance[i]; - if(additionalProp && (!(objTypeDef && typeof objTypeDef == 'object') || !(i in objTypeDef))){ - if(options.coerce){ - value = instance[i] = options.coerce(value, additionalProp); - } - checkProp(value,additionalProp,path,i); - } - if(!_changing && value && value.$schema){ - errors = errors.concat(checkProp(value,value.$schema,path,i)); - } - } - return errors; - } - if(schema){ - checkProp(instance,schema,'',_changing || ''); - } - if(!_changing && instance && instance.$schema){ - checkProp(instance,instance.$schema,'',''); - } - return {valid:!errors.length,errors:errors}; -}; -exports.mustBeValid = function(result){ - // summary: - // This checks to ensure that the result is valid and will throw an appropriate error message if it is not - // result: the result returned from checkPropertyChange or validate - if(!result.valid){ - throw new TypeError(result.errors.map(function(error){return "for property " + error.property + ': ' + error.message;}).join(", \n")); - } -} - -return exports; -})); +/** + * JSONSchema Validator - Validates JavaScript objects using JSON Schemas + * (http://www.json.com/json-schema-proposal/) + * Licensed under AFL-2.1 OR BSD-3-Clause +To use the validator call the validate function with an instance object and an optional schema object. +If a schema is provided, it will be used to validate. If the instance object refers to a schema (self-validating), +that schema will be used to validate and the schema parameter is not necessary (if both exist, +both validations will occur). +The validate method will return an array of validation errors. If there are no errors, then an +empty list will be returned. A validation error will have two properties: +"property" which indicates which property had the error +"message" which indicates what the error was + */ +(function (root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define([], function () { + return factory(); + }); + } else if (typeof module === 'object' && module.exports) { + // Node. Does not work with strict CommonJS, but + // only CommonJS-like environments that support module.exports, + // like Node. + module.exports = factory(); + } else { + // Browser globals + root.jsonSchema = factory(); + } +}(this, function () {// setup primitive classes to be JSON Schema types +var exports = validate +exports.Integer = {type:"integer"}; +var primitiveConstructors = { + String: String, + Boolean: Boolean, + Number: Number, + Object: Object, + Array: Array, + Date: Date +} +exports.validate = validate; +function validate(/*Any*/instance,/*Object*/schema) { + // Summary: + // To use the validator call JSONSchema.validate with an instance object and an optional schema object. + // If a schema is provided, it will be used to validate. If the instance object refers to a schema (self-validating), + // that schema will be used to validate and the schema parameter is not necessary (if both exist, + // both validations will occur). + // The validate method will return an object with two properties: + // valid: A boolean indicating if the instance is valid by the schema + // errors: An array of validation errors. If there are no errors, then an + // empty list will be returned. A validation error will have two properties: + // property: which indicates which property had the error + // message: which indicates what the error was + // + return validate(instance, schema, {changing: false});//, coerce: false, existingOnly: false}); + }; +exports.checkPropertyChange = function(/*Any*/value,/*Object*/schema, /*String*/property) { + // Summary: + // The checkPropertyChange method will check to see if an value can legally be in property with the given schema + // This is slightly different than the validate method in that it will fail if the schema is readonly and it will + // not check for self-validation, it is assumed that the passed in value is already internally valid. + // The checkPropertyChange method will return the same object type as validate, see JSONSchema.validate for + // information. + // + return validate(value, schema, {changing: property || "property"}); + }; +var validate = exports._validate = function(/*Any*/instance,/*Object*/schema,/*Object*/options) { + + if (!options) options = {}; + var _changing = options.changing; + + function getType(schema){ + return schema.type || (primitiveConstructors[schema.name] == schema && schema.name.toLowerCase()); + } + var errors = []; + // validate a value against a property definition + function checkProp(value, schema, path,i){ + + var l; + path += path ? typeof i == 'number' ? '[' + i + ']' : typeof i == 'undefined' ? '' : '.' + i : i; + function addError(message){ + errors.push({property:path,message:message}); + } + + if((typeof schema != 'object' || schema instanceof Array) && (path || typeof schema != 'function') && !(schema && getType(schema))){ + if(typeof schema == 'function'){ + if(!(value instanceof schema)){ + addError("is not an instance of the class/constructor " + schema.name); + } + }else if(schema){ + addError("Invalid schema/property definition " + schema); + } + return null; + } + if(_changing && schema.readonly){ + addError("is a readonly field, it can not be changed"); + } + if(schema['extends']){ // if it extends another schema, it must pass that schema as well + checkProp(value,schema['extends'],path,i); + } + // validate a value against a type definition + function checkType(type,value){ + if(type){ + if(typeof type == 'string' && type != 'any' && + (type == 'null' ? value !== null : typeof value != type) && + !(value instanceof Array && type == 'array') && + !(value instanceof Date && type == 'date') && + !(type == 'integer' && value%1===0)){ + return [{property:path,message:value + " - " + (typeof value) + " value found, but a " + type + " is required"}]; + } + if(type instanceof Array){ + var unionErrors=[]; + for(var j = 0; j < type.length; j++){ // a union type + if(!(unionErrors=checkType(type[j],value)).length){ + break; + } + } + if(unionErrors.length){ + return unionErrors; + } + }else if(typeof type == 'object'){ + var priorErrors = errors; + errors = []; + checkProp(value,type,path); + var theseErrors = errors; + errors = priorErrors; + return theseErrors; + } + } + return []; + } + if(value === undefined){ + if(schema.required){ + addError("is missing and it is required"); + } + }else{ + errors = errors.concat(checkType(getType(schema),value)); + if(schema.disallow && !checkType(schema.disallow,value).length){ + addError(" disallowed value was matched"); + } + if(value !== null){ + if(value instanceof Array){ + if(schema.items){ + var itemsIsArray = schema.items instanceof Array; + var propDef = schema.items; + for (i = 0, l = value.length; i < l; i += 1) { + if (itemsIsArray) + propDef = schema.items[i]; + if (options.coerce) + value[i] = options.coerce(value[i], propDef); + errors.concat(checkProp(value[i],propDef,path,i)); + } + } + if(schema.minItems && value.length < schema.minItems){ + addError("There must be a minimum of " + schema.minItems + " in the array"); + } + if(schema.maxItems && value.length > schema.maxItems){ + addError("There must be a maximum of " + schema.maxItems + " in the array"); + } + }else if(schema.properties || schema.additionalProperties){ + errors.concat(checkObj(value, schema.properties, path, schema.additionalProperties)); + } + if(schema.pattern && typeof value == 'string' && !value.match(schema.pattern)){ + addError("does not match the regex pattern " + schema.pattern); + } + if(schema.maxLength && typeof value == 'string' && value.length > schema.maxLength){ + addError("may only be " + schema.maxLength + " characters long"); + } + if(schema.minLength && typeof value == 'string' && value.length < schema.minLength){ + addError("must be at least " + schema.minLength + " characters long"); + } + if(typeof schema.minimum !== 'undefined' && typeof value == typeof schema.minimum && + schema.minimum > value){ + addError("must have a minimum value of " + schema.minimum); + } + if(typeof schema.maximum !== 'undefined' && typeof value == typeof schema.maximum && + schema.maximum < value){ + addError("must have a maximum value of " + schema.maximum); + } + if(schema['enum']){ + var enumer = schema['enum']; + l = enumer.length; + var found; + for(var j = 0; j < l; j++){ + if(enumer[j]===value){ + found=1; + break; + } + } + if(!found){ + addError("does not have a value in the enumeration " + enumer.join(", ")); + } + } + if(typeof schema.maxDecimal == 'number' && + (value.toString().match(new RegExp("\\.[0-9]{" + (schema.maxDecimal + 1) + ",}")))){ + addError("may only have " + schema.maxDecimal + " digits of decimal places"); + } + } + } + return null; + } + // validate an object against a schema + function checkObj(instance,objTypeDef,path,additionalProp){ + + if(typeof objTypeDef =='object'){ + if(typeof instance != 'object' || instance instanceof Array){ + errors.push({property:path,message:"an object is required"}); + } + + for(var i in objTypeDef){ + if(objTypeDef.hasOwnProperty(i) && i != '__proto__' && i != 'constructor'){ + var value = instance.hasOwnProperty(i) ? instance[i] : undefined; + // skip _not_ specified properties + if (value === undefined && options.existingOnly) continue; + var propDef = objTypeDef[i]; + // set default + if(value === undefined && propDef["default"]){ + value = instance[i] = propDef["default"]; + } + if(options.coerce && i in instance){ + value = instance[i] = options.coerce(value, propDef); + } + checkProp(value,propDef,path,i); + } + } + } + for(i in instance){ + if(instance.hasOwnProperty(i) && !(i.charAt(0) == '_' && i.charAt(1) == '_') && objTypeDef && !objTypeDef[i] && additionalProp===false){ + if (options.filter) { + delete instance[i]; + continue; + } else { + errors.push({property:path,message:"The property " + i + + " is not defined in the schema and the schema does not allow additional properties"}); + } + } + var requires = objTypeDef && objTypeDef[i] && objTypeDef[i].requires; + if(requires && !(requires in instance)){ + errors.push({property:path,message:"the presence of the property " + i + " requires that " + requires + " also be present"}); + } + value = instance[i]; + if(additionalProp && (!(objTypeDef && typeof objTypeDef == 'object') || !(i in objTypeDef))){ + if(options.coerce){ + value = instance[i] = options.coerce(value, additionalProp); + } + checkProp(value,additionalProp,path,i); + } + if(!_changing && value && value.$schema){ + errors = errors.concat(checkProp(value,value.$schema,path,i)); + } + } + return errors; + } + if(schema){ + checkProp(instance,schema,'',_changing || ''); + } + if(!_changing && instance && instance.$schema){ + checkProp(instance,instance.$schema,'',''); + } + return {valid:!errors.length,errors:errors}; +}; +exports.mustBeValid = function(result){ + // summary: + // This checks to ensure that the result is valid and will throw an appropriate error message if it is not + // result: the result returned from checkPropertyChange or validate + if(!result.valid){ + throw new TypeError(result.errors.map(function(error){return "for property " + error.property + ': ' + error.message;}).join(", \n")); + } +} + +return exports; +})); diff --git a/node_modules/json-schema/package.json b/node_modules/json-schema/package.json index d3a7dfbe2..8c1f89980 100644 --- a/node_modules/json-schema/package.json +++ b/node_modules/json-schema/package.json @@ -1,24 +1,24 @@ -{ - "name": "json-schema", - "version": "0.4.0", - "author": "Kris Zyp", - "description": "JSON Schema validation and specifications", - "maintainers":[ - {"name": "Kris Zyp", "email": "kriszyp@gmail.com"}], - "keywords": [ - "json", - "schema" - ], - "files": [ - "lib" - ], - "license": "(AFL-2.1 OR BSD-3-Clause)", - "repository": { - "type":"git", - "url":"http://github.com/kriszyp/json-schema" - }, - "directories": { "lib": "./lib" }, - "main": "./lib/validate.js", - "devDependencies": { "vows": "*" }, - "scripts": { "test": "vows --spec test/*.js" } -} +{ + "name": "json-schema", + "version": "0.4.0", + "author": "Kris Zyp", + "description": "JSON Schema validation and specifications", + "maintainers":[ + {"name": "Kris Zyp", "email": "kriszyp@gmail.com"}], + "keywords": [ + "json", + "schema" + ], + "files": [ + "lib" + ], + "license": "(AFL-2.1 OR BSD-3-Clause)", + "repository": { + "type":"git", + "url":"http://github.com/kriszyp/json-schema" + }, + "directories": { "lib": "./lib" }, + "main": "./lib/validate.js", + "devDependencies": { "vows": "*" }, + "scripts": { "test": "vows --spec test/*.js" } +} diff --git a/node_modules/json5/lib/cli.js b/node_modules/json5/lib/cli.js old mode 100644 new mode 100755 diff --git a/node_modules/jsonpath/README.md b/node_modules/jsonpath/README.md old mode 100644 new mode 100755 diff --git a/node_modules/jsonpath/lib/grammar.js b/node_modules/jsonpath/lib/grammar.js old mode 100644 new mode 100755 diff --git a/node_modules/jsonpath/lib/handlers.js b/node_modules/jsonpath/lib/handlers.js old mode 100644 new mode 100755 diff --git a/node_modules/jsonpath/lib/index.js b/node_modules/jsonpath/lib/index.js old mode 100644 new mode 100755 diff --git a/node_modules/lazystream/package.json b/node_modules/lazystream/package.json index aa6c35035..a31a48cdf 100644 --- a/node_modules/lazystream/package.json +++ b/node_modules/lazystream/package.json @@ -38,8 +38,4 @@ "streams", "stream" ] - -,"_resolved": "https://registry.npmjs.org/lazystream/-/lazystream-1.0.0.tgz" -,"_integrity": "sha1-9plf4PggOS9hOWvolGJAe7dxaOQ=" -,"_from": "lazystream@1.0.0" -} \ No newline at end of file +} diff --git a/node_modules/levn/package.json b/node_modules/levn/package.json index 300b6949d..56dfbc426 100644 --- a/node_modules/levn/package.json +++ b/node_modules/levn/package.json @@ -44,8 +44,4 @@ "mocha": "~2.3.4", "istanbul": "~0.4.1" } - -,"_resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz" -,"_integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=" -,"_from": "levn@0.3.0" -} \ No newline at end of file +} diff --git a/node_modules/micromatch/LICENSE b/node_modules/micromatch/LICENSE old mode 100644 new mode 100755 diff --git a/node_modules/minimatch/package.json b/node_modules/minimatch/package.json index 243f26056..c4514c807 100644 --- a/node_modules/minimatch/package.json +++ b/node_modules/minimatch/package.json @@ -27,8 +27,4 @@ "files": [ "minimatch.js" ] - -,"_resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz" -,"_integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==" -,"_from": "minimatch@3.0.4" -} \ No newline at end of file +} diff --git a/node_modules/mkdirp/bin/cmd.js b/node_modules/mkdirp/bin/cmd.js old mode 100644 new mode 100755 diff --git a/node_modules/mkpath/package.json b/node_modules/mkpath/package.json index bd39ff71f..85db3b1bd 100644 --- a/node_modules/mkpath/package.json +++ b/node_modules/mkpath/package.json @@ -22,8 +22,4 @@ "tap": "~0.3" }, "license": "MIT" - -,"_resolved": "https://registry.npmjs.org/mkpath/-/mkpath-0.1.0.tgz" -,"_integrity": "sha1-dVSm+Nhxg0zJe1RisSLEwSTW3pE=" -,"_from": "mkpath@0.1.0" -} \ No newline at end of file +} diff --git a/node_modules/node-fetch/node_modules/whatwg-url/lib/url-state-machine.js b/node_modules/node-fetch/node_modules/whatwg-url/lib/url-state-machine.js index 27d977a25..c25dbc2c4 100644 --- a/node_modules/node-fetch/node_modules/whatwg-url/lib/url-state-machine.js +++ b/node_modules/node-fetch/node_modules/whatwg-url/lib/url-state-machine.js @@ -1,1297 +1,1297 @@ -"use strict"; -const punycode = require("punycode"); -const tr46 = require("tr46"); - -const specialSchemes = { - ftp: 21, - file: null, - gopher: 70, - http: 80, - https: 443, - ws: 80, - wss: 443 -}; - -const failure = Symbol("failure"); - -function countSymbols(str) { - return punycode.ucs2.decode(str).length; -} - -function at(input, idx) { - const c = input[idx]; - return isNaN(c) ? undefined : String.fromCodePoint(c); -} - -function isASCIIDigit(c) { - return c >= 0x30 && c <= 0x39; -} - -function isASCIIAlpha(c) { - return (c >= 0x41 && c <= 0x5A) || (c >= 0x61 && c <= 0x7A); -} - -function isASCIIAlphanumeric(c) { - return isASCIIAlpha(c) || isASCIIDigit(c); -} - -function isASCIIHex(c) { - return isASCIIDigit(c) || (c >= 0x41 && c <= 0x46) || (c >= 0x61 && c <= 0x66); -} - -function isSingleDot(buffer) { - return buffer === "." || buffer.toLowerCase() === "%2e"; -} - -function isDoubleDot(buffer) { - buffer = buffer.toLowerCase(); - return buffer === ".." || buffer === "%2e." || buffer === ".%2e" || buffer === "%2e%2e"; -} - -function isWindowsDriveLetterCodePoints(cp1, cp2) { - return isASCIIAlpha(cp1) && (cp2 === 58 || cp2 === 124); -} - -function isWindowsDriveLetterString(string) { - return string.length === 2 && isASCIIAlpha(string.codePointAt(0)) && (string[1] === ":" || string[1] === "|"); -} - -function isNormalizedWindowsDriveLetterString(string) { - return string.length === 2 && isASCIIAlpha(string.codePointAt(0)) && string[1] === ":"; -} - -function containsForbiddenHostCodePoint(string) { - return string.search(/\u0000|\u0009|\u000A|\u000D|\u0020|#|%|\/|:|\?|@|\[|\\|\]/) !== -1; -} - -function containsForbiddenHostCodePointExcludingPercent(string) { - return string.search(/\u0000|\u0009|\u000A|\u000D|\u0020|#|\/|:|\?|@|\[|\\|\]/) !== -1; -} - -function isSpecialScheme(scheme) { - return specialSchemes[scheme] !== undefined; -} - -function isSpecial(url) { - return isSpecialScheme(url.scheme); -} - -function defaultPort(scheme) { - return specialSchemes[scheme]; -} - -function percentEncode(c) { - let hex = c.toString(16).toUpperCase(); - if (hex.length === 1) { - hex = "0" + hex; - } - - return "%" + hex; -} - -function utf8PercentEncode(c) { - const buf = new Buffer(c); - - let str = ""; - - for (let i = 0; i < buf.length; ++i) { - str += percentEncode(buf[i]); - } - - return str; -} - -function utf8PercentDecode(str) { - const input = new Buffer(str); - const output = []; - for (let i = 0; i < input.length; ++i) { - if (input[i] !== 37) { - output.push(input[i]); - } else if (input[i] === 37 && isASCIIHex(input[i + 1]) && isASCIIHex(input[i + 2])) { - output.push(parseInt(input.slice(i + 1, i + 3).toString(), 16)); - i += 2; - } else { - output.push(input[i]); - } - } - return new Buffer(output).toString(); -} - -function isC0ControlPercentEncode(c) { - return c <= 0x1F || c > 0x7E; -} - -const extraPathPercentEncodeSet = new Set([32, 34, 35, 60, 62, 63, 96, 123, 125]); -function isPathPercentEncode(c) { - return isC0ControlPercentEncode(c) || extraPathPercentEncodeSet.has(c); -} - -const extraUserinfoPercentEncodeSet = - new Set([47, 58, 59, 61, 64, 91, 92, 93, 94, 124]); -function isUserinfoPercentEncode(c) { - return isPathPercentEncode(c) || extraUserinfoPercentEncodeSet.has(c); -} - -function percentEncodeChar(c, encodeSetPredicate) { - const cStr = String.fromCodePoint(c); - - if (encodeSetPredicate(c)) { - return utf8PercentEncode(cStr); - } - - return cStr; -} - -function parseIPv4Number(input) { - let R = 10; - - if (input.length >= 2 && input.charAt(0) === "0" && input.charAt(1).toLowerCase() === "x") { - input = input.substring(2); - R = 16; - } else if (input.length >= 2 && input.charAt(0) === "0") { - input = input.substring(1); - R = 8; - } - - if (input === "") { - return 0; - } - - const regex = R === 10 ? /[^0-9]/ : (R === 16 ? /[^0-9A-Fa-f]/ : /[^0-7]/); - if (regex.test(input)) { - return failure; - } - - return parseInt(input, R); -} - -function parseIPv4(input) { - const parts = input.split("."); - if (parts[parts.length - 1] === "") { - if (parts.length > 1) { - parts.pop(); - } - } - - if (parts.length > 4) { - return input; - } - - const numbers = []; - for (const part of parts) { - if (part === "") { - return input; - } - const n = parseIPv4Number(part); - if (n === failure) { - return input; - } - - numbers.push(n); - } - - for (let i = 0; i < numbers.length - 1; ++i) { - if (numbers[i] > 255) { - return failure; - } - } - if (numbers[numbers.length - 1] >= Math.pow(256, 5 - numbers.length)) { - return failure; - } - - let ipv4 = numbers.pop(); - let counter = 0; - - for (const n of numbers) { - ipv4 += n * Math.pow(256, 3 - counter); - ++counter; - } - - return ipv4; -} - -function serializeIPv4(address) { - let output = ""; - let n = address; - - for (let i = 1; i <= 4; ++i) { - output = String(n % 256) + output; - if (i !== 4) { - output = "." + output; - } - n = Math.floor(n / 256); - } - - return output; -} - -function parseIPv6(input) { - const address = [0, 0, 0, 0, 0, 0, 0, 0]; - let pieceIndex = 0; - let compress = null; - let pointer = 0; - - input = punycode.ucs2.decode(input); - - if (input[pointer] === 58) { - if (input[pointer + 1] !== 58) { - return failure; - } - - pointer += 2; - ++pieceIndex; - compress = pieceIndex; - } - - while (pointer < input.length) { - if (pieceIndex === 8) { - return failure; - } - - if (input[pointer] === 58) { - if (compress !== null) { - return failure; - } - ++pointer; - ++pieceIndex; - compress = pieceIndex; - continue; - } - - let value = 0; - let length = 0; - - while (length < 4 && isASCIIHex(input[pointer])) { - value = value * 0x10 + parseInt(at(input, pointer), 16); - ++pointer; - ++length; - } - - if (input[pointer] === 46) { - if (length === 0) { - return failure; - } - - pointer -= length; - - if (pieceIndex > 6) { - return failure; - } - - let numbersSeen = 0; - - while (input[pointer] !== undefined) { - let ipv4Piece = null; - - if (numbersSeen > 0) { - if (input[pointer] === 46 && numbersSeen < 4) { - ++pointer; - } else { - return failure; - } - } - - if (!isASCIIDigit(input[pointer])) { - return failure; - } - - while (isASCIIDigit(input[pointer])) { - const number = parseInt(at(input, pointer)); - if (ipv4Piece === null) { - ipv4Piece = number; - } else if (ipv4Piece === 0) { - return failure; - } else { - ipv4Piece = ipv4Piece * 10 + number; - } - if (ipv4Piece > 255) { - return failure; - } - ++pointer; - } - - address[pieceIndex] = address[pieceIndex] * 0x100 + ipv4Piece; - - ++numbersSeen; - - if (numbersSeen === 2 || numbersSeen === 4) { - ++pieceIndex; - } - } - - if (numbersSeen !== 4) { - return failure; - } - - break; - } else if (input[pointer] === 58) { - ++pointer; - if (input[pointer] === undefined) { - return failure; - } - } else if (input[pointer] !== undefined) { - return failure; - } - - address[pieceIndex] = value; - ++pieceIndex; - } - - if (compress !== null) { - let swaps = pieceIndex - compress; - pieceIndex = 7; - while (pieceIndex !== 0 && swaps > 0) { - const temp = address[compress + swaps - 1]; - address[compress + swaps - 1] = address[pieceIndex]; - address[pieceIndex] = temp; - --pieceIndex; - --swaps; - } - } else if (compress === null && pieceIndex !== 8) { - return failure; - } - - return address; -} - -function serializeIPv6(address) { - let output = ""; - const seqResult = findLongestZeroSequence(address); - const compress = seqResult.idx; - let ignore0 = false; - - for (let pieceIndex = 0; pieceIndex <= 7; ++pieceIndex) { - if (ignore0 && address[pieceIndex] === 0) { - continue; - } else if (ignore0) { - ignore0 = false; - } - - if (compress === pieceIndex) { - const separator = pieceIndex === 0 ? "::" : ":"; - output += separator; - ignore0 = true; - continue; - } - - output += address[pieceIndex].toString(16); - - if (pieceIndex !== 7) { - output += ":"; - } - } - - return output; -} - -function parseHost(input, isSpecialArg) { - if (input[0] === "[") { - if (input[input.length - 1] !== "]") { - return failure; - } - - return parseIPv6(input.substring(1, input.length - 1)); - } - - if (!isSpecialArg) { - return parseOpaqueHost(input); - } - - const domain = utf8PercentDecode(input); - const asciiDomain = tr46.toASCII(domain, false, tr46.PROCESSING_OPTIONS.NONTRANSITIONAL, false); - if (asciiDomain === null) { - return failure; - } - - if (containsForbiddenHostCodePoint(asciiDomain)) { - return failure; - } - - const ipv4Host = parseIPv4(asciiDomain); - if (typeof ipv4Host === "number" || ipv4Host === failure) { - return ipv4Host; - } - - return asciiDomain; -} - -function parseOpaqueHost(input) { - if (containsForbiddenHostCodePointExcludingPercent(input)) { - return failure; - } - - let output = ""; - const decoded = punycode.ucs2.decode(input); - for (let i = 0; i < decoded.length; ++i) { - output += percentEncodeChar(decoded[i], isC0ControlPercentEncode); - } - return output; -} - -function findLongestZeroSequence(arr) { - let maxIdx = null; - let maxLen = 1; // only find elements > 1 - let currStart = null; - let currLen = 0; - - for (let i = 0; i < arr.length; ++i) { - if (arr[i] !== 0) { - if (currLen > maxLen) { - maxIdx = currStart; - maxLen = currLen; - } - - currStart = null; - currLen = 0; - } else { - if (currStart === null) { - currStart = i; - } - ++currLen; - } - } - - // if trailing zeros - if (currLen > maxLen) { - maxIdx = currStart; - maxLen = currLen; - } - - return { - idx: maxIdx, - len: maxLen - }; -} - -function serializeHost(host) { - if (typeof host === "number") { - return serializeIPv4(host); - } - - // IPv6 serializer - if (host instanceof Array) { - return "[" + serializeIPv6(host) + "]"; - } - - return host; -} - -function trimControlChars(url) { - return url.replace(/^[\u0000-\u001F\u0020]+|[\u0000-\u001F\u0020]+$/g, ""); -} - -function trimTabAndNewline(url) { - return url.replace(/\u0009|\u000A|\u000D/g, ""); -} - -function shortenPath(url) { - const path = url.path; - if (path.length === 0) { - return; - } - if (url.scheme === "file" && path.length === 1 && isNormalizedWindowsDriveLetter(path[0])) { - return; - } - - path.pop(); -} - -function includesCredentials(url) { - return url.username !== "" || url.password !== ""; -} - -function cannotHaveAUsernamePasswordPort(url) { - return url.host === null || url.host === "" || url.cannotBeABaseURL || url.scheme === "file"; -} - -function isNormalizedWindowsDriveLetter(string) { - return /^[A-Za-z]:$/.test(string); -} - -function URLStateMachine(input, base, encodingOverride, url, stateOverride) { - this.pointer = 0; - this.input = input; - this.base = base || null; - this.encodingOverride = encodingOverride || "utf-8"; - this.stateOverride = stateOverride; - this.url = url; - this.failure = false; - this.parseError = false; - - if (!this.url) { - this.url = { - scheme: "", - username: "", - password: "", - host: null, - port: null, - path: [], - query: null, - fragment: null, - - cannotBeABaseURL: false - }; - - const res = trimControlChars(this.input); - if (res !== this.input) { - this.parseError = true; - } - this.input = res; - } - - const res = trimTabAndNewline(this.input); - if (res !== this.input) { - this.parseError = true; - } - this.input = res; - - this.state = stateOverride || "scheme start"; - - this.buffer = ""; - this.atFlag = false; - this.arrFlag = false; - this.passwordTokenSeenFlag = false; - - this.input = punycode.ucs2.decode(this.input); - - for (; this.pointer <= this.input.length; ++this.pointer) { - const c = this.input[this.pointer]; - const cStr = isNaN(c) ? undefined : String.fromCodePoint(c); - - // exec state machine - const ret = this["parse " + this.state](c, cStr); - if (!ret) { - break; // terminate algorithm - } else if (ret === failure) { - this.failure = true; - break; - } - } -} - -URLStateMachine.prototype["parse scheme start"] = function parseSchemeStart(c, cStr) { - if (isASCIIAlpha(c)) { - this.buffer += cStr.toLowerCase(); - this.state = "scheme"; - } else if (!this.stateOverride) { - this.state = "no scheme"; - --this.pointer; - } else { - this.parseError = true; - return failure; - } - - return true; -}; - -URLStateMachine.prototype["parse scheme"] = function parseScheme(c, cStr) { - if (isASCIIAlphanumeric(c) || c === 43 || c === 45 || c === 46) { - this.buffer += cStr.toLowerCase(); - } else if (c === 58) { - if (this.stateOverride) { - if (isSpecial(this.url) && !isSpecialScheme(this.buffer)) { - return false; - } - - if (!isSpecial(this.url) && isSpecialScheme(this.buffer)) { - return false; - } - - if ((includesCredentials(this.url) || this.url.port !== null) && this.buffer === "file") { - return false; - } - - if (this.url.scheme === "file" && (this.url.host === "" || this.url.host === null)) { - return false; - } - } - this.url.scheme = this.buffer; - this.buffer = ""; - if (this.stateOverride) { - return false; - } - if (this.url.scheme === "file") { - if (this.input[this.pointer + 1] !== 47 || this.input[this.pointer + 2] !== 47) { - this.parseError = true; - } - this.state = "file"; - } else if (isSpecial(this.url) && this.base !== null && this.base.scheme === this.url.scheme) { - this.state = "special relative or authority"; - } else if (isSpecial(this.url)) { - this.state = "special authority slashes"; - } else if (this.input[this.pointer + 1] === 47) { - this.state = "path or authority"; - ++this.pointer; - } else { - this.url.cannotBeABaseURL = true; - this.url.path.push(""); - this.state = "cannot-be-a-base-URL path"; - } - } else if (!this.stateOverride) { - this.buffer = ""; - this.state = "no scheme"; - this.pointer = -1; - } else { - this.parseError = true; - return failure; - } - - return true; -}; - -URLStateMachine.prototype["parse no scheme"] = function parseNoScheme(c) { - if (this.base === null || (this.base.cannotBeABaseURL && c !== 35)) { - return failure; - } else if (this.base.cannotBeABaseURL && c === 35) { - this.url.scheme = this.base.scheme; - this.url.path = this.base.path.slice(); - this.url.query = this.base.query; - this.url.fragment = ""; - this.url.cannotBeABaseURL = true; - this.state = "fragment"; - } else if (this.base.scheme === "file") { - this.state = "file"; - --this.pointer; - } else { - this.state = "relative"; - --this.pointer; - } - - return true; -}; - -URLStateMachine.prototype["parse special relative or authority"] = function parseSpecialRelativeOrAuthority(c) { - if (c === 47 && this.input[this.pointer + 1] === 47) { - this.state = "special authority ignore slashes"; - ++this.pointer; - } else { - this.parseError = true; - this.state = "relative"; - --this.pointer; - } - - return true; -}; - -URLStateMachine.prototype["parse path or authority"] = function parsePathOrAuthority(c) { - if (c === 47) { - this.state = "authority"; - } else { - this.state = "path"; - --this.pointer; - } - - return true; -}; - -URLStateMachine.prototype["parse relative"] = function parseRelative(c) { - this.url.scheme = this.base.scheme; - if (isNaN(c)) { - this.url.username = this.base.username; - this.url.password = this.base.password; - this.url.host = this.base.host; - this.url.port = this.base.port; - this.url.path = this.base.path.slice(); - this.url.query = this.base.query; - } else if (c === 47) { - this.state = "relative slash"; - } else if (c === 63) { - this.url.username = this.base.username; - this.url.password = this.base.password; - this.url.host = this.base.host; - this.url.port = this.base.port; - this.url.path = this.base.path.slice(); - this.url.query = ""; - this.state = "query"; - } else if (c === 35) { - this.url.username = this.base.username; - this.url.password = this.base.password; - this.url.host = this.base.host; - this.url.port = this.base.port; - this.url.path = this.base.path.slice(); - this.url.query = this.base.query; - this.url.fragment = ""; - this.state = "fragment"; - } else if (isSpecial(this.url) && c === 92) { - this.parseError = true; - this.state = "relative slash"; - } else { - this.url.username = this.base.username; - this.url.password = this.base.password; - this.url.host = this.base.host; - this.url.port = this.base.port; - this.url.path = this.base.path.slice(0, this.base.path.length - 1); - - this.state = "path"; - --this.pointer; - } - - return true; -}; - -URLStateMachine.prototype["parse relative slash"] = function parseRelativeSlash(c) { - if (isSpecial(this.url) && (c === 47 || c === 92)) { - if (c === 92) { - this.parseError = true; - } - this.state = "special authority ignore slashes"; - } else if (c === 47) { - this.state = "authority"; - } else { - this.url.username = this.base.username; - this.url.password = this.base.password; - this.url.host = this.base.host; - this.url.port = this.base.port; - this.state = "path"; - --this.pointer; - } - - return true; -}; - -URLStateMachine.prototype["parse special authority slashes"] = function parseSpecialAuthoritySlashes(c) { - if (c === 47 && this.input[this.pointer + 1] === 47) { - this.state = "special authority ignore slashes"; - ++this.pointer; - } else { - this.parseError = true; - this.state = "special authority ignore slashes"; - --this.pointer; - } - - return true; -}; - -URLStateMachine.prototype["parse special authority ignore slashes"] = function parseSpecialAuthorityIgnoreSlashes(c) { - if (c !== 47 && c !== 92) { - this.state = "authority"; - --this.pointer; - } else { - this.parseError = true; - } - - return true; -}; - -URLStateMachine.prototype["parse authority"] = function parseAuthority(c, cStr) { - if (c === 64) { - this.parseError = true; - if (this.atFlag) { - this.buffer = "%40" + this.buffer; - } - this.atFlag = true; - - // careful, this is based on buffer and has its own pointer (this.pointer != pointer) and inner chars - const len = countSymbols(this.buffer); - for (let pointer = 0; pointer < len; ++pointer) { - const codePoint = this.buffer.codePointAt(pointer); - - if (codePoint === 58 && !this.passwordTokenSeenFlag) { - this.passwordTokenSeenFlag = true; - continue; - } - const encodedCodePoints = percentEncodeChar(codePoint, isUserinfoPercentEncode); - if (this.passwordTokenSeenFlag) { - this.url.password += encodedCodePoints; - } else { - this.url.username += encodedCodePoints; - } - } - this.buffer = ""; - } else if (isNaN(c) || c === 47 || c === 63 || c === 35 || - (isSpecial(this.url) && c === 92)) { - if (this.atFlag && this.buffer === "") { - this.parseError = true; - return failure; - } - this.pointer -= countSymbols(this.buffer) + 1; - this.buffer = ""; - this.state = "host"; - } else { - this.buffer += cStr; - } - - return true; -}; - -URLStateMachine.prototype["parse hostname"] = -URLStateMachine.prototype["parse host"] = function parseHostName(c, cStr) { - if (this.stateOverride && this.url.scheme === "file") { - --this.pointer; - this.state = "file host"; - } else if (c === 58 && !this.arrFlag) { - if (this.buffer === "") { - this.parseError = true; - return failure; - } - - const host = parseHost(this.buffer, isSpecial(this.url)); - if (host === failure) { - return failure; - } - - this.url.host = host; - this.buffer = ""; - this.state = "port"; - if (this.stateOverride === "hostname") { - return false; - } - } else if (isNaN(c) || c === 47 || c === 63 || c === 35 || - (isSpecial(this.url) && c === 92)) { - --this.pointer; - if (isSpecial(this.url) && this.buffer === "") { - this.parseError = true; - return failure; - } else if (this.stateOverride && this.buffer === "" && - (includesCredentials(this.url) || this.url.port !== null)) { - this.parseError = true; - return false; - } - - const host = parseHost(this.buffer, isSpecial(this.url)); - if (host === failure) { - return failure; - } - - this.url.host = host; - this.buffer = ""; - this.state = "path start"; - if (this.stateOverride) { - return false; - } - } else { - if (c === 91) { - this.arrFlag = true; - } else if (c === 93) { - this.arrFlag = false; - } - this.buffer += cStr; - } - - return true; -}; - -URLStateMachine.prototype["parse port"] = function parsePort(c, cStr) { - if (isASCIIDigit(c)) { - this.buffer += cStr; - } else if (isNaN(c) || c === 47 || c === 63 || c === 35 || - (isSpecial(this.url) && c === 92) || - this.stateOverride) { - if (this.buffer !== "") { - const port = parseInt(this.buffer); - if (port > Math.pow(2, 16) - 1) { - this.parseError = true; - return failure; - } - this.url.port = port === defaultPort(this.url.scheme) ? null : port; - this.buffer = ""; - } - if (this.stateOverride) { - return false; - } - this.state = "path start"; - --this.pointer; - } else { - this.parseError = true; - return failure; - } - - return true; -}; - -const fileOtherwiseCodePoints = new Set([47, 92, 63, 35]); - -URLStateMachine.prototype["parse file"] = function parseFile(c) { - this.url.scheme = "file"; - - if (c === 47 || c === 92) { - if (c === 92) { - this.parseError = true; - } - this.state = "file slash"; - } else if (this.base !== null && this.base.scheme === "file") { - if (isNaN(c)) { - this.url.host = this.base.host; - this.url.path = this.base.path.slice(); - this.url.query = this.base.query; - } else if (c === 63) { - this.url.host = this.base.host; - this.url.path = this.base.path.slice(); - this.url.query = ""; - this.state = "query"; - } else if (c === 35) { - this.url.host = this.base.host; - this.url.path = this.base.path.slice(); - this.url.query = this.base.query; - this.url.fragment = ""; - this.state = "fragment"; - } else { - if (this.input.length - this.pointer - 1 === 0 || // remaining consists of 0 code points - !isWindowsDriveLetterCodePoints(c, this.input[this.pointer + 1]) || - (this.input.length - this.pointer - 1 >= 2 && // remaining has at least 2 code points - !fileOtherwiseCodePoints.has(this.input[this.pointer + 2]))) { - this.url.host = this.base.host; - this.url.path = this.base.path.slice(); - shortenPath(this.url); - } else { - this.parseError = true; - } - - this.state = "path"; - --this.pointer; - } - } else { - this.state = "path"; - --this.pointer; - } - - return true; -}; - -URLStateMachine.prototype["parse file slash"] = function parseFileSlash(c) { - if (c === 47 || c === 92) { - if (c === 92) { - this.parseError = true; - } - this.state = "file host"; - } else { - if (this.base !== null && this.base.scheme === "file") { - if (isNormalizedWindowsDriveLetterString(this.base.path[0])) { - this.url.path.push(this.base.path[0]); - } else { - this.url.host = this.base.host; - } - } - this.state = "path"; - --this.pointer; - } - - return true; -}; - -URLStateMachine.prototype["parse file host"] = function parseFileHost(c, cStr) { - if (isNaN(c) || c === 47 || c === 92 || c === 63 || c === 35) { - --this.pointer; - if (!this.stateOverride && isWindowsDriveLetterString(this.buffer)) { - this.parseError = true; - this.state = "path"; - } else if (this.buffer === "") { - this.url.host = ""; - if (this.stateOverride) { - return false; - } - this.state = "path start"; - } else { - let host = parseHost(this.buffer, isSpecial(this.url)); - if (host === failure) { - return failure; - } - if (host === "localhost") { - host = ""; - } - this.url.host = host; - - if (this.stateOverride) { - return false; - } - - this.buffer = ""; - this.state = "path start"; - } - } else { - this.buffer += cStr; - } - - return true; -}; - -URLStateMachine.prototype["parse path start"] = function parsePathStart(c) { - if (isSpecial(this.url)) { - if (c === 92) { - this.parseError = true; - } - this.state = "path"; - - if (c !== 47 && c !== 92) { - --this.pointer; - } - } else if (!this.stateOverride && c === 63) { - this.url.query = ""; - this.state = "query"; - } else if (!this.stateOverride && c === 35) { - this.url.fragment = ""; - this.state = "fragment"; - } else if (c !== undefined) { - this.state = "path"; - if (c !== 47) { - --this.pointer; - } - } - - return true; -}; - -URLStateMachine.prototype["parse path"] = function parsePath(c) { - if (isNaN(c) || c === 47 || (isSpecial(this.url) && c === 92) || - (!this.stateOverride && (c === 63 || c === 35))) { - if (isSpecial(this.url) && c === 92) { - this.parseError = true; - } - - if (isDoubleDot(this.buffer)) { - shortenPath(this.url); - if (c !== 47 && !(isSpecial(this.url) && c === 92)) { - this.url.path.push(""); - } - } else if (isSingleDot(this.buffer) && c !== 47 && - !(isSpecial(this.url) && c === 92)) { - this.url.path.push(""); - } else if (!isSingleDot(this.buffer)) { - if (this.url.scheme === "file" && this.url.path.length === 0 && isWindowsDriveLetterString(this.buffer)) { - if (this.url.host !== "" && this.url.host !== null) { - this.parseError = true; - this.url.host = ""; - } - this.buffer = this.buffer[0] + ":"; - } - this.url.path.push(this.buffer); - } - this.buffer = ""; - if (this.url.scheme === "file" && (c === undefined || c === 63 || c === 35)) { - while (this.url.path.length > 1 && this.url.path[0] === "") { - this.parseError = true; - this.url.path.shift(); - } - } - if (c === 63) { - this.url.query = ""; - this.state = "query"; - } - if (c === 35) { - this.url.fragment = ""; - this.state = "fragment"; - } - } else { - // TODO: If c is not a URL code point and not "%", parse error. - - if (c === 37 && - (!isASCIIHex(this.input[this.pointer + 1]) || - !isASCIIHex(this.input[this.pointer + 2]))) { - this.parseError = true; - } - - this.buffer += percentEncodeChar(c, isPathPercentEncode); - } - - return true; -}; - -URLStateMachine.prototype["parse cannot-be-a-base-URL path"] = function parseCannotBeABaseURLPath(c) { - if (c === 63) { - this.url.query = ""; - this.state = "query"; - } else if (c === 35) { - this.url.fragment = ""; - this.state = "fragment"; - } else { - // TODO: Add: not a URL code point - if (!isNaN(c) && c !== 37) { - this.parseError = true; - } - - if (c === 37 && - (!isASCIIHex(this.input[this.pointer + 1]) || - !isASCIIHex(this.input[this.pointer + 2]))) { - this.parseError = true; - } - - if (!isNaN(c)) { - this.url.path[0] = this.url.path[0] + percentEncodeChar(c, isC0ControlPercentEncode); - } - } - - return true; -}; - -URLStateMachine.prototype["parse query"] = function parseQuery(c, cStr) { - if (isNaN(c) || (!this.stateOverride && c === 35)) { - if (!isSpecial(this.url) || this.url.scheme === "ws" || this.url.scheme === "wss") { - this.encodingOverride = "utf-8"; - } - - const buffer = new Buffer(this.buffer); // TODO: Use encoding override instead - for (let i = 0; i < buffer.length; ++i) { - if (buffer[i] < 0x21 || buffer[i] > 0x7E || buffer[i] === 0x22 || buffer[i] === 0x23 || - buffer[i] === 0x3C || buffer[i] === 0x3E) { - this.url.query += percentEncode(buffer[i]); - } else { - this.url.query += String.fromCodePoint(buffer[i]); - } - } - - this.buffer = ""; - if (c === 35) { - this.url.fragment = ""; - this.state = "fragment"; - } - } else { - // TODO: If c is not a URL code point and not "%", parse error. - if (c === 37 && - (!isASCIIHex(this.input[this.pointer + 1]) || - !isASCIIHex(this.input[this.pointer + 2]))) { - this.parseError = true; - } - - this.buffer += cStr; - } - - return true; -}; - -URLStateMachine.prototype["parse fragment"] = function parseFragment(c) { - if (isNaN(c)) { // do nothing - } else if (c === 0x0) { - this.parseError = true; - } else { - // TODO: If c is not a URL code point and not "%", parse error. - if (c === 37 && - (!isASCIIHex(this.input[this.pointer + 1]) || - !isASCIIHex(this.input[this.pointer + 2]))) { - this.parseError = true; - } - - this.url.fragment += percentEncodeChar(c, isC0ControlPercentEncode); - } - - return true; -}; - -function serializeURL(url, excludeFragment) { - let output = url.scheme + ":"; - if (url.host !== null) { - output += "//"; - - if (url.username !== "" || url.password !== "") { - output += url.username; - if (url.password !== "") { - output += ":" + url.password; - } - output += "@"; - } - - output += serializeHost(url.host); - - if (url.port !== null) { - output += ":" + url.port; - } - } else if (url.host === null && url.scheme === "file") { - output += "//"; - } - - if (url.cannotBeABaseURL) { - output += url.path[0]; - } else { - for (const string of url.path) { - output += "/" + string; - } - } - - if (url.query !== null) { - output += "?" + url.query; - } - - if (!excludeFragment && url.fragment !== null) { - output += "#" + url.fragment; - } - - return output; -} - -function serializeOrigin(tuple) { - let result = tuple.scheme + "://"; - result += serializeHost(tuple.host); - - if (tuple.port !== null) { - result += ":" + tuple.port; - } - - return result; -} - -module.exports.serializeURL = serializeURL; - -module.exports.serializeURLOrigin = function (url) { - // https://url.spec.whatwg.org/#concept-url-origin - switch (url.scheme) { - case "blob": - try { - return module.exports.serializeURLOrigin(module.exports.parseURL(url.path[0])); - } catch (e) { - // serializing an opaque origin returns "null" - return "null"; - } - case "ftp": - case "gopher": - case "http": - case "https": - case "ws": - case "wss": - return serializeOrigin({ - scheme: url.scheme, - host: url.host, - port: url.port - }); - case "file": - // spec says "exercise to the reader", chrome says "file://" - return "file://"; - default: - // serializing an opaque origin returns "null" - return "null"; - } -}; - -module.exports.basicURLParse = function (input, options) { - if (options === undefined) { - options = {}; - } - - const usm = new URLStateMachine(input, options.baseURL, options.encodingOverride, options.url, options.stateOverride); - if (usm.failure) { - return "failure"; - } - - return usm.url; -}; - -module.exports.setTheUsername = function (url, username) { - url.username = ""; - const decoded = punycode.ucs2.decode(username); - for (let i = 0; i < decoded.length; ++i) { - url.username += percentEncodeChar(decoded[i], isUserinfoPercentEncode); - } -}; - -module.exports.setThePassword = function (url, password) { - url.password = ""; - const decoded = punycode.ucs2.decode(password); - for (let i = 0; i < decoded.length; ++i) { - url.password += percentEncodeChar(decoded[i], isUserinfoPercentEncode); - } -}; - -module.exports.serializeHost = serializeHost; - -module.exports.cannotHaveAUsernamePasswordPort = cannotHaveAUsernamePasswordPort; - -module.exports.serializeInteger = function (integer) { - return String(integer); -}; - -module.exports.parseURL = function (input, options) { - if (options === undefined) { - options = {}; - } - - // We don't handle blobs, so this just delegates: - return module.exports.basicURLParse(input, { baseURL: options.baseURL, encodingOverride: options.encodingOverride }); -}; +"use strict"; +const punycode = require("punycode"); +const tr46 = require("tr46"); + +const specialSchemes = { + ftp: 21, + file: null, + gopher: 70, + http: 80, + https: 443, + ws: 80, + wss: 443 +}; + +const failure = Symbol("failure"); + +function countSymbols(str) { + return punycode.ucs2.decode(str).length; +} + +function at(input, idx) { + const c = input[idx]; + return isNaN(c) ? undefined : String.fromCodePoint(c); +} + +function isASCIIDigit(c) { + return c >= 0x30 && c <= 0x39; +} + +function isASCIIAlpha(c) { + return (c >= 0x41 && c <= 0x5A) || (c >= 0x61 && c <= 0x7A); +} + +function isASCIIAlphanumeric(c) { + return isASCIIAlpha(c) || isASCIIDigit(c); +} + +function isASCIIHex(c) { + return isASCIIDigit(c) || (c >= 0x41 && c <= 0x46) || (c >= 0x61 && c <= 0x66); +} + +function isSingleDot(buffer) { + return buffer === "." || buffer.toLowerCase() === "%2e"; +} + +function isDoubleDot(buffer) { + buffer = buffer.toLowerCase(); + return buffer === ".." || buffer === "%2e." || buffer === ".%2e" || buffer === "%2e%2e"; +} + +function isWindowsDriveLetterCodePoints(cp1, cp2) { + return isASCIIAlpha(cp1) && (cp2 === 58 || cp2 === 124); +} + +function isWindowsDriveLetterString(string) { + return string.length === 2 && isASCIIAlpha(string.codePointAt(0)) && (string[1] === ":" || string[1] === "|"); +} + +function isNormalizedWindowsDriveLetterString(string) { + return string.length === 2 && isASCIIAlpha(string.codePointAt(0)) && string[1] === ":"; +} + +function containsForbiddenHostCodePoint(string) { + return string.search(/\u0000|\u0009|\u000A|\u000D|\u0020|#|%|\/|:|\?|@|\[|\\|\]/) !== -1; +} + +function containsForbiddenHostCodePointExcludingPercent(string) { + return string.search(/\u0000|\u0009|\u000A|\u000D|\u0020|#|\/|:|\?|@|\[|\\|\]/) !== -1; +} + +function isSpecialScheme(scheme) { + return specialSchemes[scheme] !== undefined; +} + +function isSpecial(url) { + return isSpecialScheme(url.scheme); +} + +function defaultPort(scheme) { + return specialSchemes[scheme]; +} + +function percentEncode(c) { + let hex = c.toString(16).toUpperCase(); + if (hex.length === 1) { + hex = "0" + hex; + } + + return "%" + hex; +} + +function utf8PercentEncode(c) { + const buf = new Buffer(c); + + let str = ""; + + for (let i = 0; i < buf.length; ++i) { + str += percentEncode(buf[i]); + } + + return str; +} + +function utf8PercentDecode(str) { + const input = new Buffer(str); + const output = []; + for (let i = 0; i < input.length; ++i) { + if (input[i] !== 37) { + output.push(input[i]); + } else if (input[i] === 37 && isASCIIHex(input[i + 1]) && isASCIIHex(input[i + 2])) { + output.push(parseInt(input.slice(i + 1, i + 3).toString(), 16)); + i += 2; + } else { + output.push(input[i]); + } + } + return new Buffer(output).toString(); +} + +function isC0ControlPercentEncode(c) { + return c <= 0x1F || c > 0x7E; +} + +const extraPathPercentEncodeSet = new Set([32, 34, 35, 60, 62, 63, 96, 123, 125]); +function isPathPercentEncode(c) { + return isC0ControlPercentEncode(c) || extraPathPercentEncodeSet.has(c); +} + +const extraUserinfoPercentEncodeSet = + new Set([47, 58, 59, 61, 64, 91, 92, 93, 94, 124]); +function isUserinfoPercentEncode(c) { + return isPathPercentEncode(c) || extraUserinfoPercentEncodeSet.has(c); +} + +function percentEncodeChar(c, encodeSetPredicate) { + const cStr = String.fromCodePoint(c); + + if (encodeSetPredicate(c)) { + return utf8PercentEncode(cStr); + } + + return cStr; +} + +function parseIPv4Number(input) { + let R = 10; + + if (input.length >= 2 && input.charAt(0) === "0" && input.charAt(1).toLowerCase() === "x") { + input = input.substring(2); + R = 16; + } else if (input.length >= 2 && input.charAt(0) === "0") { + input = input.substring(1); + R = 8; + } + + if (input === "") { + return 0; + } + + const regex = R === 10 ? /[^0-9]/ : (R === 16 ? /[^0-9A-Fa-f]/ : /[^0-7]/); + if (regex.test(input)) { + return failure; + } + + return parseInt(input, R); +} + +function parseIPv4(input) { + const parts = input.split("."); + if (parts[parts.length - 1] === "") { + if (parts.length > 1) { + parts.pop(); + } + } + + if (parts.length > 4) { + return input; + } + + const numbers = []; + for (const part of parts) { + if (part === "") { + return input; + } + const n = parseIPv4Number(part); + if (n === failure) { + return input; + } + + numbers.push(n); + } + + for (let i = 0; i < numbers.length - 1; ++i) { + if (numbers[i] > 255) { + return failure; + } + } + if (numbers[numbers.length - 1] >= Math.pow(256, 5 - numbers.length)) { + return failure; + } + + let ipv4 = numbers.pop(); + let counter = 0; + + for (const n of numbers) { + ipv4 += n * Math.pow(256, 3 - counter); + ++counter; + } + + return ipv4; +} + +function serializeIPv4(address) { + let output = ""; + let n = address; + + for (let i = 1; i <= 4; ++i) { + output = String(n % 256) + output; + if (i !== 4) { + output = "." + output; + } + n = Math.floor(n / 256); + } + + return output; +} + +function parseIPv6(input) { + const address = [0, 0, 0, 0, 0, 0, 0, 0]; + let pieceIndex = 0; + let compress = null; + let pointer = 0; + + input = punycode.ucs2.decode(input); + + if (input[pointer] === 58) { + if (input[pointer + 1] !== 58) { + return failure; + } + + pointer += 2; + ++pieceIndex; + compress = pieceIndex; + } + + while (pointer < input.length) { + if (pieceIndex === 8) { + return failure; + } + + if (input[pointer] === 58) { + if (compress !== null) { + return failure; + } + ++pointer; + ++pieceIndex; + compress = pieceIndex; + continue; + } + + let value = 0; + let length = 0; + + while (length < 4 && isASCIIHex(input[pointer])) { + value = value * 0x10 + parseInt(at(input, pointer), 16); + ++pointer; + ++length; + } + + if (input[pointer] === 46) { + if (length === 0) { + return failure; + } + + pointer -= length; + + if (pieceIndex > 6) { + return failure; + } + + let numbersSeen = 0; + + while (input[pointer] !== undefined) { + let ipv4Piece = null; + + if (numbersSeen > 0) { + if (input[pointer] === 46 && numbersSeen < 4) { + ++pointer; + } else { + return failure; + } + } + + if (!isASCIIDigit(input[pointer])) { + return failure; + } + + while (isASCIIDigit(input[pointer])) { + const number = parseInt(at(input, pointer)); + if (ipv4Piece === null) { + ipv4Piece = number; + } else if (ipv4Piece === 0) { + return failure; + } else { + ipv4Piece = ipv4Piece * 10 + number; + } + if (ipv4Piece > 255) { + return failure; + } + ++pointer; + } + + address[pieceIndex] = address[pieceIndex] * 0x100 + ipv4Piece; + + ++numbersSeen; + + if (numbersSeen === 2 || numbersSeen === 4) { + ++pieceIndex; + } + } + + if (numbersSeen !== 4) { + return failure; + } + + break; + } else if (input[pointer] === 58) { + ++pointer; + if (input[pointer] === undefined) { + return failure; + } + } else if (input[pointer] !== undefined) { + return failure; + } + + address[pieceIndex] = value; + ++pieceIndex; + } + + if (compress !== null) { + let swaps = pieceIndex - compress; + pieceIndex = 7; + while (pieceIndex !== 0 && swaps > 0) { + const temp = address[compress + swaps - 1]; + address[compress + swaps - 1] = address[pieceIndex]; + address[pieceIndex] = temp; + --pieceIndex; + --swaps; + } + } else if (compress === null && pieceIndex !== 8) { + return failure; + } + + return address; +} + +function serializeIPv6(address) { + let output = ""; + const seqResult = findLongestZeroSequence(address); + const compress = seqResult.idx; + let ignore0 = false; + + for (let pieceIndex = 0; pieceIndex <= 7; ++pieceIndex) { + if (ignore0 && address[pieceIndex] === 0) { + continue; + } else if (ignore0) { + ignore0 = false; + } + + if (compress === pieceIndex) { + const separator = pieceIndex === 0 ? "::" : ":"; + output += separator; + ignore0 = true; + continue; + } + + output += address[pieceIndex].toString(16); + + if (pieceIndex !== 7) { + output += ":"; + } + } + + return output; +} + +function parseHost(input, isSpecialArg) { + if (input[0] === "[") { + if (input[input.length - 1] !== "]") { + return failure; + } + + return parseIPv6(input.substring(1, input.length - 1)); + } + + if (!isSpecialArg) { + return parseOpaqueHost(input); + } + + const domain = utf8PercentDecode(input); + const asciiDomain = tr46.toASCII(domain, false, tr46.PROCESSING_OPTIONS.NONTRANSITIONAL, false); + if (asciiDomain === null) { + return failure; + } + + if (containsForbiddenHostCodePoint(asciiDomain)) { + return failure; + } + + const ipv4Host = parseIPv4(asciiDomain); + if (typeof ipv4Host === "number" || ipv4Host === failure) { + return ipv4Host; + } + + return asciiDomain; +} + +function parseOpaqueHost(input) { + if (containsForbiddenHostCodePointExcludingPercent(input)) { + return failure; + } + + let output = ""; + const decoded = punycode.ucs2.decode(input); + for (let i = 0; i < decoded.length; ++i) { + output += percentEncodeChar(decoded[i], isC0ControlPercentEncode); + } + return output; +} + +function findLongestZeroSequence(arr) { + let maxIdx = null; + let maxLen = 1; // only find elements > 1 + let currStart = null; + let currLen = 0; + + for (let i = 0; i < arr.length; ++i) { + if (arr[i] !== 0) { + if (currLen > maxLen) { + maxIdx = currStart; + maxLen = currLen; + } + + currStart = null; + currLen = 0; + } else { + if (currStart === null) { + currStart = i; + } + ++currLen; + } + } + + // if trailing zeros + if (currLen > maxLen) { + maxIdx = currStart; + maxLen = currLen; + } + + return { + idx: maxIdx, + len: maxLen + }; +} + +function serializeHost(host) { + if (typeof host === "number") { + return serializeIPv4(host); + } + + // IPv6 serializer + if (host instanceof Array) { + return "[" + serializeIPv6(host) + "]"; + } + + return host; +} + +function trimControlChars(url) { + return url.replace(/^[\u0000-\u001F\u0020]+|[\u0000-\u001F\u0020]+$/g, ""); +} + +function trimTabAndNewline(url) { + return url.replace(/\u0009|\u000A|\u000D/g, ""); +} + +function shortenPath(url) { + const path = url.path; + if (path.length === 0) { + return; + } + if (url.scheme === "file" && path.length === 1 && isNormalizedWindowsDriveLetter(path[0])) { + return; + } + + path.pop(); +} + +function includesCredentials(url) { + return url.username !== "" || url.password !== ""; +} + +function cannotHaveAUsernamePasswordPort(url) { + return url.host === null || url.host === "" || url.cannotBeABaseURL || url.scheme === "file"; +} + +function isNormalizedWindowsDriveLetter(string) { + return /^[A-Za-z]:$/.test(string); +} + +function URLStateMachine(input, base, encodingOverride, url, stateOverride) { + this.pointer = 0; + this.input = input; + this.base = base || null; + this.encodingOverride = encodingOverride || "utf-8"; + this.stateOverride = stateOverride; + this.url = url; + this.failure = false; + this.parseError = false; + + if (!this.url) { + this.url = { + scheme: "", + username: "", + password: "", + host: null, + port: null, + path: [], + query: null, + fragment: null, + + cannotBeABaseURL: false + }; + + const res = trimControlChars(this.input); + if (res !== this.input) { + this.parseError = true; + } + this.input = res; + } + + const res = trimTabAndNewline(this.input); + if (res !== this.input) { + this.parseError = true; + } + this.input = res; + + this.state = stateOverride || "scheme start"; + + this.buffer = ""; + this.atFlag = false; + this.arrFlag = false; + this.passwordTokenSeenFlag = false; + + this.input = punycode.ucs2.decode(this.input); + + for (; this.pointer <= this.input.length; ++this.pointer) { + const c = this.input[this.pointer]; + const cStr = isNaN(c) ? undefined : String.fromCodePoint(c); + + // exec state machine + const ret = this["parse " + this.state](c, cStr); + if (!ret) { + break; // terminate algorithm + } else if (ret === failure) { + this.failure = true; + break; + } + } +} + +URLStateMachine.prototype["parse scheme start"] = function parseSchemeStart(c, cStr) { + if (isASCIIAlpha(c)) { + this.buffer += cStr.toLowerCase(); + this.state = "scheme"; + } else if (!this.stateOverride) { + this.state = "no scheme"; + --this.pointer; + } else { + this.parseError = true; + return failure; + } + + return true; +}; + +URLStateMachine.prototype["parse scheme"] = function parseScheme(c, cStr) { + if (isASCIIAlphanumeric(c) || c === 43 || c === 45 || c === 46) { + this.buffer += cStr.toLowerCase(); + } else if (c === 58) { + if (this.stateOverride) { + if (isSpecial(this.url) && !isSpecialScheme(this.buffer)) { + return false; + } + + if (!isSpecial(this.url) && isSpecialScheme(this.buffer)) { + return false; + } + + if ((includesCredentials(this.url) || this.url.port !== null) && this.buffer === "file") { + return false; + } + + if (this.url.scheme === "file" && (this.url.host === "" || this.url.host === null)) { + return false; + } + } + this.url.scheme = this.buffer; + this.buffer = ""; + if (this.stateOverride) { + return false; + } + if (this.url.scheme === "file") { + if (this.input[this.pointer + 1] !== 47 || this.input[this.pointer + 2] !== 47) { + this.parseError = true; + } + this.state = "file"; + } else if (isSpecial(this.url) && this.base !== null && this.base.scheme === this.url.scheme) { + this.state = "special relative or authority"; + } else if (isSpecial(this.url)) { + this.state = "special authority slashes"; + } else if (this.input[this.pointer + 1] === 47) { + this.state = "path or authority"; + ++this.pointer; + } else { + this.url.cannotBeABaseURL = true; + this.url.path.push(""); + this.state = "cannot-be-a-base-URL path"; + } + } else if (!this.stateOverride) { + this.buffer = ""; + this.state = "no scheme"; + this.pointer = -1; + } else { + this.parseError = true; + return failure; + } + + return true; +}; + +URLStateMachine.prototype["parse no scheme"] = function parseNoScheme(c) { + if (this.base === null || (this.base.cannotBeABaseURL && c !== 35)) { + return failure; + } else if (this.base.cannotBeABaseURL && c === 35) { + this.url.scheme = this.base.scheme; + this.url.path = this.base.path.slice(); + this.url.query = this.base.query; + this.url.fragment = ""; + this.url.cannotBeABaseURL = true; + this.state = "fragment"; + } else if (this.base.scheme === "file") { + this.state = "file"; + --this.pointer; + } else { + this.state = "relative"; + --this.pointer; + } + + return true; +}; + +URLStateMachine.prototype["parse special relative or authority"] = function parseSpecialRelativeOrAuthority(c) { + if (c === 47 && this.input[this.pointer + 1] === 47) { + this.state = "special authority ignore slashes"; + ++this.pointer; + } else { + this.parseError = true; + this.state = "relative"; + --this.pointer; + } + + return true; +}; + +URLStateMachine.prototype["parse path or authority"] = function parsePathOrAuthority(c) { + if (c === 47) { + this.state = "authority"; + } else { + this.state = "path"; + --this.pointer; + } + + return true; +}; + +URLStateMachine.prototype["parse relative"] = function parseRelative(c) { + this.url.scheme = this.base.scheme; + if (isNaN(c)) { + this.url.username = this.base.username; + this.url.password = this.base.password; + this.url.host = this.base.host; + this.url.port = this.base.port; + this.url.path = this.base.path.slice(); + this.url.query = this.base.query; + } else if (c === 47) { + this.state = "relative slash"; + } else if (c === 63) { + this.url.username = this.base.username; + this.url.password = this.base.password; + this.url.host = this.base.host; + this.url.port = this.base.port; + this.url.path = this.base.path.slice(); + this.url.query = ""; + this.state = "query"; + } else if (c === 35) { + this.url.username = this.base.username; + this.url.password = this.base.password; + this.url.host = this.base.host; + this.url.port = this.base.port; + this.url.path = this.base.path.slice(); + this.url.query = this.base.query; + this.url.fragment = ""; + this.state = "fragment"; + } else if (isSpecial(this.url) && c === 92) { + this.parseError = true; + this.state = "relative slash"; + } else { + this.url.username = this.base.username; + this.url.password = this.base.password; + this.url.host = this.base.host; + this.url.port = this.base.port; + this.url.path = this.base.path.slice(0, this.base.path.length - 1); + + this.state = "path"; + --this.pointer; + } + + return true; +}; + +URLStateMachine.prototype["parse relative slash"] = function parseRelativeSlash(c) { + if (isSpecial(this.url) && (c === 47 || c === 92)) { + if (c === 92) { + this.parseError = true; + } + this.state = "special authority ignore slashes"; + } else if (c === 47) { + this.state = "authority"; + } else { + this.url.username = this.base.username; + this.url.password = this.base.password; + this.url.host = this.base.host; + this.url.port = this.base.port; + this.state = "path"; + --this.pointer; + } + + return true; +}; + +URLStateMachine.prototype["parse special authority slashes"] = function parseSpecialAuthoritySlashes(c) { + if (c === 47 && this.input[this.pointer + 1] === 47) { + this.state = "special authority ignore slashes"; + ++this.pointer; + } else { + this.parseError = true; + this.state = "special authority ignore slashes"; + --this.pointer; + } + + return true; +}; + +URLStateMachine.prototype["parse special authority ignore slashes"] = function parseSpecialAuthorityIgnoreSlashes(c) { + if (c !== 47 && c !== 92) { + this.state = "authority"; + --this.pointer; + } else { + this.parseError = true; + } + + return true; +}; + +URLStateMachine.prototype["parse authority"] = function parseAuthority(c, cStr) { + if (c === 64) { + this.parseError = true; + if (this.atFlag) { + this.buffer = "%40" + this.buffer; + } + this.atFlag = true; + + // careful, this is based on buffer and has its own pointer (this.pointer != pointer) and inner chars + const len = countSymbols(this.buffer); + for (let pointer = 0; pointer < len; ++pointer) { + const codePoint = this.buffer.codePointAt(pointer); + + if (codePoint === 58 && !this.passwordTokenSeenFlag) { + this.passwordTokenSeenFlag = true; + continue; + } + const encodedCodePoints = percentEncodeChar(codePoint, isUserinfoPercentEncode); + if (this.passwordTokenSeenFlag) { + this.url.password += encodedCodePoints; + } else { + this.url.username += encodedCodePoints; + } + } + this.buffer = ""; + } else if (isNaN(c) || c === 47 || c === 63 || c === 35 || + (isSpecial(this.url) && c === 92)) { + if (this.atFlag && this.buffer === "") { + this.parseError = true; + return failure; + } + this.pointer -= countSymbols(this.buffer) + 1; + this.buffer = ""; + this.state = "host"; + } else { + this.buffer += cStr; + } + + return true; +}; + +URLStateMachine.prototype["parse hostname"] = +URLStateMachine.prototype["parse host"] = function parseHostName(c, cStr) { + if (this.stateOverride && this.url.scheme === "file") { + --this.pointer; + this.state = "file host"; + } else if (c === 58 && !this.arrFlag) { + if (this.buffer === "") { + this.parseError = true; + return failure; + } + + const host = parseHost(this.buffer, isSpecial(this.url)); + if (host === failure) { + return failure; + } + + this.url.host = host; + this.buffer = ""; + this.state = "port"; + if (this.stateOverride === "hostname") { + return false; + } + } else if (isNaN(c) || c === 47 || c === 63 || c === 35 || + (isSpecial(this.url) && c === 92)) { + --this.pointer; + if (isSpecial(this.url) && this.buffer === "") { + this.parseError = true; + return failure; + } else if (this.stateOverride && this.buffer === "" && + (includesCredentials(this.url) || this.url.port !== null)) { + this.parseError = true; + return false; + } + + const host = parseHost(this.buffer, isSpecial(this.url)); + if (host === failure) { + return failure; + } + + this.url.host = host; + this.buffer = ""; + this.state = "path start"; + if (this.stateOverride) { + return false; + } + } else { + if (c === 91) { + this.arrFlag = true; + } else if (c === 93) { + this.arrFlag = false; + } + this.buffer += cStr; + } + + return true; +}; + +URLStateMachine.prototype["parse port"] = function parsePort(c, cStr) { + if (isASCIIDigit(c)) { + this.buffer += cStr; + } else if (isNaN(c) || c === 47 || c === 63 || c === 35 || + (isSpecial(this.url) && c === 92) || + this.stateOverride) { + if (this.buffer !== "") { + const port = parseInt(this.buffer); + if (port > Math.pow(2, 16) - 1) { + this.parseError = true; + return failure; + } + this.url.port = port === defaultPort(this.url.scheme) ? null : port; + this.buffer = ""; + } + if (this.stateOverride) { + return false; + } + this.state = "path start"; + --this.pointer; + } else { + this.parseError = true; + return failure; + } + + return true; +}; + +const fileOtherwiseCodePoints = new Set([47, 92, 63, 35]); + +URLStateMachine.prototype["parse file"] = function parseFile(c) { + this.url.scheme = "file"; + + if (c === 47 || c === 92) { + if (c === 92) { + this.parseError = true; + } + this.state = "file slash"; + } else if (this.base !== null && this.base.scheme === "file") { + if (isNaN(c)) { + this.url.host = this.base.host; + this.url.path = this.base.path.slice(); + this.url.query = this.base.query; + } else if (c === 63) { + this.url.host = this.base.host; + this.url.path = this.base.path.slice(); + this.url.query = ""; + this.state = "query"; + } else if (c === 35) { + this.url.host = this.base.host; + this.url.path = this.base.path.slice(); + this.url.query = this.base.query; + this.url.fragment = ""; + this.state = "fragment"; + } else { + if (this.input.length - this.pointer - 1 === 0 || // remaining consists of 0 code points + !isWindowsDriveLetterCodePoints(c, this.input[this.pointer + 1]) || + (this.input.length - this.pointer - 1 >= 2 && // remaining has at least 2 code points + !fileOtherwiseCodePoints.has(this.input[this.pointer + 2]))) { + this.url.host = this.base.host; + this.url.path = this.base.path.slice(); + shortenPath(this.url); + } else { + this.parseError = true; + } + + this.state = "path"; + --this.pointer; + } + } else { + this.state = "path"; + --this.pointer; + } + + return true; +}; + +URLStateMachine.prototype["parse file slash"] = function parseFileSlash(c) { + if (c === 47 || c === 92) { + if (c === 92) { + this.parseError = true; + } + this.state = "file host"; + } else { + if (this.base !== null && this.base.scheme === "file") { + if (isNormalizedWindowsDriveLetterString(this.base.path[0])) { + this.url.path.push(this.base.path[0]); + } else { + this.url.host = this.base.host; + } + } + this.state = "path"; + --this.pointer; + } + + return true; +}; + +URLStateMachine.prototype["parse file host"] = function parseFileHost(c, cStr) { + if (isNaN(c) || c === 47 || c === 92 || c === 63 || c === 35) { + --this.pointer; + if (!this.stateOverride && isWindowsDriveLetterString(this.buffer)) { + this.parseError = true; + this.state = "path"; + } else if (this.buffer === "") { + this.url.host = ""; + if (this.stateOverride) { + return false; + } + this.state = "path start"; + } else { + let host = parseHost(this.buffer, isSpecial(this.url)); + if (host === failure) { + return failure; + } + if (host === "localhost") { + host = ""; + } + this.url.host = host; + + if (this.stateOverride) { + return false; + } + + this.buffer = ""; + this.state = "path start"; + } + } else { + this.buffer += cStr; + } + + return true; +}; + +URLStateMachine.prototype["parse path start"] = function parsePathStart(c) { + if (isSpecial(this.url)) { + if (c === 92) { + this.parseError = true; + } + this.state = "path"; + + if (c !== 47 && c !== 92) { + --this.pointer; + } + } else if (!this.stateOverride && c === 63) { + this.url.query = ""; + this.state = "query"; + } else if (!this.stateOverride && c === 35) { + this.url.fragment = ""; + this.state = "fragment"; + } else if (c !== undefined) { + this.state = "path"; + if (c !== 47) { + --this.pointer; + } + } + + return true; +}; + +URLStateMachine.prototype["parse path"] = function parsePath(c) { + if (isNaN(c) || c === 47 || (isSpecial(this.url) && c === 92) || + (!this.stateOverride && (c === 63 || c === 35))) { + if (isSpecial(this.url) && c === 92) { + this.parseError = true; + } + + if (isDoubleDot(this.buffer)) { + shortenPath(this.url); + if (c !== 47 && !(isSpecial(this.url) && c === 92)) { + this.url.path.push(""); + } + } else if (isSingleDot(this.buffer) && c !== 47 && + !(isSpecial(this.url) && c === 92)) { + this.url.path.push(""); + } else if (!isSingleDot(this.buffer)) { + if (this.url.scheme === "file" && this.url.path.length === 0 && isWindowsDriveLetterString(this.buffer)) { + if (this.url.host !== "" && this.url.host !== null) { + this.parseError = true; + this.url.host = ""; + } + this.buffer = this.buffer[0] + ":"; + } + this.url.path.push(this.buffer); + } + this.buffer = ""; + if (this.url.scheme === "file" && (c === undefined || c === 63 || c === 35)) { + while (this.url.path.length > 1 && this.url.path[0] === "") { + this.parseError = true; + this.url.path.shift(); + } + } + if (c === 63) { + this.url.query = ""; + this.state = "query"; + } + if (c === 35) { + this.url.fragment = ""; + this.state = "fragment"; + } + } else { + // TODO: If c is not a URL code point and not "%", parse error. + + if (c === 37 && + (!isASCIIHex(this.input[this.pointer + 1]) || + !isASCIIHex(this.input[this.pointer + 2]))) { + this.parseError = true; + } + + this.buffer += percentEncodeChar(c, isPathPercentEncode); + } + + return true; +}; + +URLStateMachine.prototype["parse cannot-be-a-base-URL path"] = function parseCannotBeABaseURLPath(c) { + if (c === 63) { + this.url.query = ""; + this.state = "query"; + } else if (c === 35) { + this.url.fragment = ""; + this.state = "fragment"; + } else { + // TODO: Add: not a URL code point + if (!isNaN(c) && c !== 37) { + this.parseError = true; + } + + if (c === 37 && + (!isASCIIHex(this.input[this.pointer + 1]) || + !isASCIIHex(this.input[this.pointer + 2]))) { + this.parseError = true; + } + + if (!isNaN(c)) { + this.url.path[0] = this.url.path[0] + percentEncodeChar(c, isC0ControlPercentEncode); + } + } + + return true; +}; + +URLStateMachine.prototype["parse query"] = function parseQuery(c, cStr) { + if (isNaN(c) || (!this.stateOverride && c === 35)) { + if (!isSpecial(this.url) || this.url.scheme === "ws" || this.url.scheme === "wss") { + this.encodingOverride = "utf-8"; + } + + const buffer = new Buffer(this.buffer); // TODO: Use encoding override instead + for (let i = 0; i < buffer.length; ++i) { + if (buffer[i] < 0x21 || buffer[i] > 0x7E || buffer[i] === 0x22 || buffer[i] === 0x23 || + buffer[i] === 0x3C || buffer[i] === 0x3E) { + this.url.query += percentEncode(buffer[i]); + } else { + this.url.query += String.fromCodePoint(buffer[i]); + } + } + + this.buffer = ""; + if (c === 35) { + this.url.fragment = ""; + this.state = "fragment"; + } + } else { + // TODO: If c is not a URL code point and not "%", parse error. + if (c === 37 && + (!isASCIIHex(this.input[this.pointer + 1]) || + !isASCIIHex(this.input[this.pointer + 2]))) { + this.parseError = true; + } + + this.buffer += cStr; + } + + return true; +}; + +URLStateMachine.prototype["parse fragment"] = function parseFragment(c) { + if (isNaN(c)) { // do nothing + } else if (c === 0x0) { + this.parseError = true; + } else { + // TODO: If c is not a URL code point and not "%", parse error. + if (c === 37 && + (!isASCIIHex(this.input[this.pointer + 1]) || + !isASCIIHex(this.input[this.pointer + 2]))) { + this.parseError = true; + } + + this.url.fragment += percentEncodeChar(c, isC0ControlPercentEncode); + } + + return true; +}; + +function serializeURL(url, excludeFragment) { + let output = url.scheme + ":"; + if (url.host !== null) { + output += "//"; + + if (url.username !== "" || url.password !== "") { + output += url.username; + if (url.password !== "") { + output += ":" + url.password; + } + output += "@"; + } + + output += serializeHost(url.host); + + if (url.port !== null) { + output += ":" + url.port; + } + } else if (url.host === null && url.scheme === "file") { + output += "//"; + } + + if (url.cannotBeABaseURL) { + output += url.path[0]; + } else { + for (const string of url.path) { + output += "/" + string; + } + } + + if (url.query !== null) { + output += "?" + url.query; + } + + if (!excludeFragment && url.fragment !== null) { + output += "#" + url.fragment; + } + + return output; +} + +function serializeOrigin(tuple) { + let result = tuple.scheme + "://"; + result += serializeHost(tuple.host); + + if (tuple.port !== null) { + result += ":" + tuple.port; + } + + return result; +} + +module.exports.serializeURL = serializeURL; + +module.exports.serializeURLOrigin = function (url) { + // https://url.spec.whatwg.org/#concept-url-origin + switch (url.scheme) { + case "blob": + try { + return module.exports.serializeURLOrigin(module.exports.parseURL(url.path[0])); + } catch (e) { + // serializing an opaque origin returns "null" + return "null"; + } + case "ftp": + case "gopher": + case "http": + case "https": + case "ws": + case "wss": + return serializeOrigin({ + scheme: url.scheme, + host: url.host, + port: url.port + }); + case "file": + // spec says "exercise to the reader", chrome says "file://" + return "file://"; + default: + // serializing an opaque origin returns "null" + return "null"; + } +}; + +module.exports.basicURLParse = function (input, options) { + if (options === undefined) { + options = {}; + } + + const usm = new URLStateMachine(input, options.baseURL, options.encodingOverride, options.url, options.stateOverride); + if (usm.failure) { + return "failure"; + } + + return usm.url; +}; + +module.exports.setTheUsername = function (url, username) { + url.username = ""; + const decoded = punycode.ucs2.decode(username); + for (let i = 0; i < decoded.length; ++i) { + url.username += percentEncodeChar(decoded[i], isUserinfoPercentEncode); + } +}; + +module.exports.setThePassword = function (url, password) { + url.password = ""; + const decoded = punycode.ucs2.decode(password); + for (let i = 0; i < decoded.length; ++i) { + url.password += percentEncodeChar(decoded[i], isUserinfoPercentEncode); + } +}; + +module.exports.serializeHost = serializeHost; + +module.exports.cannotHaveAUsernamePasswordPort = cannotHaveAUsernamePasswordPort; + +module.exports.serializeInteger = function (integer) { + return String(integer); +}; + +module.exports.parseURL = function (input, options) { + if (options === undefined) { + options = {}; + } + + // We don't handle blobs, so this just delegates: + return module.exports.basicURLParse(input, { baseURL: options.baseURL, encodingOverride: options.encodingOverride }); +}; diff --git a/node_modules/node-notifier/node_modules/.bin/which b/node_modules/node-notifier/node_modules/.bin/which deleted file mode 100644 index c51820f2f..000000000 --- a/node_modules/node-notifier/node_modules/.bin/which +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") - -case `uname` in - *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;; -esac - -if [ -x "$basedir/node" ]; then - exec "$basedir/node" "$basedir/../which/bin/which" "$@" -else - exec node "$basedir/../which/bin/which" "$@" -fi diff --git a/node_modules/node-notifier/node_modules/.bin/which b/node_modules/node-notifier/node_modules/.bin/which new file mode 120000 index 000000000..f62471c85 --- /dev/null +++ b/node_modules/node-notifier/node_modules/.bin/which @@ -0,0 +1 @@ +../which/bin/which \ No newline at end of file diff --git a/node_modules/node-notifier/node_modules/.bin/which.cmd b/node_modules/node-notifier/node_modules/.bin/which.cmd deleted file mode 100644 index ead37d628..000000000 --- a/node_modules/node-notifier/node_modules/.bin/which.cmd +++ /dev/null @@ -1,17 +0,0 @@ -@ECHO off -GOTO start -:find_dp0 -SET dp0=%~dp0 -EXIT /b -:start -SETLOCAL -CALL :find_dp0 - -IF EXIST "%dp0%\node.exe" ( - SET "_prog=%dp0%\node.exe" -) ELSE ( - SET "_prog=node" - SET PATHEXT=%PATHEXT:;.JS;=;% -) - -endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\which\bin\which" %* diff --git a/node_modules/node-notifier/node_modules/.bin/which.ps1 b/node_modules/node-notifier/node_modules/.bin/which.ps1 deleted file mode 100644 index 1437a3b6e..000000000 --- a/node_modules/node-notifier/node_modules/.bin/which.ps1 +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env pwsh -$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent - -$exe="" -if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { - # Fix case when both the Windows and Linux builds of Node - # are installed in the same directory - $exe=".exe" -} -$ret=0 -if (Test-Path "$basedir/node$exe") { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "$basedir/node$exe" "$basedir/../which/bin/which" $args - } else { - & "$basedir/node$exe" "$basedir/../which/bin/which" $args - } - $ret=$LASTEXITCODE -} else { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "node$exe" "$basedir/../which/bin/which" $args - } else { - & "node$exe" "$basedir/../which/bin/which" $args - } - $ret=$LASTEXITCODE -} -exit $ret diff --git a/node_modules/node-notifier/node_modules/which/bin/which b/node_modules/node-notifier/node_modules/which/bin/which old mode 100644 new mode 100755 diff --git a/node_modules/node-notifier/vendor/mac.noindex/terminal-notifier.app/Contents/MacOS/terminal-notifier b/node_modules/node-notifier/vendor/mac.noindex/terminal-notifier.app/Contents/MacOS/terminal-notifier old mode 100644 new mode 100755 diff --git a/node_modules/node-notifier/vendor/notifu/notifu.exe b/node_modules/node-notifier/vendor/notifu/notifu.exe old mode 100644 new mode 100755 diff --git a/node_modules/node-notifier/vendor/notifu/notifu64.exe b/node_modules/node-notifier/vendor/notifu/notifu64.exe old mode 100644 new mode 100755 diff --git a/node_modules/node-stream-zip/package.json b/node_modules/node-stream-zip/package.json index 809a85bb5..c5bc4d584 100644 --- a/node_modules/node-stream-zip/package.json +++ b/node_modules/node-stream-zip/package.json @@ -33,8 +33,4 @@ "devDependencies": { "nodeunit": "^0.11.3" } - -,"_resolved": "https://registry.npmjs.org/node-stream-zip/-/node-stream-zip-1.8.2.tgz" -,"_integrity": "sha512-zwP2F/R28Oqtl0gOLItk5QjJ6jEU8XO4kaUMgeqvCyXPgdCZlm8T/5qLMiNy+moJCBCiMQAaX7aVMRhT0t2vkQ==" -,"_from": "node-stream-zip@1.8.2" -} \ No newline at end of file +} diff --git a/node_modules/nopt/bin/nopt.js b/node_modules/nopt/bin/nopt.js old mode 100644 new mode 100755 diff --git a/node_modules/nopt/examples/my-program.js b/node_modules/nopt/examples/my-program.js old mode 100644 new mode 100755 diff --git a/node_modules/normalize-package-data/node_modules/.bin/semver b/node_modules/normalize-package-data/node_modules/.bin/semver deleted file mode 100644 index 86cee84b6..000000000 --- a/node_modules/normalize-package-data/node_modules/.bin/semver +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") - -case `uname` in - *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;; -esac - -if [ -x "$basedir/node" ]; then - exec "$basedir/node" "$basedir/../semver/bin/semver" "$@" -else - exec node "$basedir/../semver/bin/semver" "$@" -fi diff --git a/node_modules/normalize-package-data/node_modules/.bin/semver b/node_modules/normalize-package-data/node_modules/.bin/semver new file mode 120000 index 000000000..317eb293d --- /dev/null +++ b/node_modules/normalize-package-data/node_modules/.bin/semver @@ -0,0 +1 @@ +../semver/bin/semver \ No newline at end of file diff --git a/node_modules/normalize-package-data/node_modules/.bin/semver.cmd b/node_modules/normalize-package-data/node_modules/.bin/semver.cmd deleted file mode 100644 index 22d9286cd..000000000 --- a/node_modules/normalize-package-data/node_modules/.bin/semver.cmd +++ /dev/null @@ -1,17 +0,0 @@ -@ECHO off -GOTO start -:find_dp0 -SET dp0=%~dp0 -EXIT /b -:start -SETLOCAL -CALL :find_dp0 - -IF EXIST "%dp0%\node.exe" ( - SET "_prog=%dp0%\node.exe" -) ELSE ( - SET "_prog=node" - SET PATHEXT=%PATHEXT:;.JS;=;% -) - -endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\semver\bin\semver" %* diff --git a/node_modules/normalize-package-data/node_modules/.bin/semver.ps1 b/node_modules/normalize-package-data/node_modules/.bin/semver.ps1 deleted file mode 100644 index 98c1b093f..000000000 --- a/node_modules/normalize-package-data/node_modules/.bin/semver.ps1 +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env pwsh -$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent - -$exe="" -if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { - # Fix case when both the Windows and Linux builds of Node - # are installed in the same directory - $exe=".exe" -} -$ret=0 -if (Test-Path "$basedir/node$exe") { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "$basedir/node$exe" "$basedir/../semver/bin/semver" $args - } else { - & "$basedir/node$exe" "$basedir/../semver/bin/semver" $args - } - $ret=$LASTEXITCODE -} else { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "node$exe" "$basedir/../semver/bin/semver" $args - } else { - & "node$exe" "$basedir/../semver/bin/semver" $args - } - $ret=$LASTEXITCODE -} -exit $ret diff --git a/node_modules/normalize-package-data/node_modules/semver/bin/semver b/node_modules/normalize-package-data/node_modules/semver/bin/semver old mode 100644 new mode 100755 diff --git a/node_modules/normalize-path/package.json b/node_modules/normalize-path/package.json index 360a5e06d..c16ef9d25 100644 --- a/node_modules/normalize-path/package.json +++ b/node_modules/normalize-path/package.json @@ -75,8 +75,4 @@ "reflinks": true } } - -,"_resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz" -,"_integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=" -,"_from": "normalize-path@2.1.1" -} \ No newline at end of file +} diff --git a/node_modules/once/package.json b/node_modules/once/package.json index a498f74fd..16815b2fa 100644 --- a/node_modules/once/package.json +++ b/node_modules/once/package.json @@ -30,8 +30,4 @@ ], "author": "Isaac Z. Schlueter (http://blog.izs.me/)", "license": "ISC" - -,"_resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz" -,"_integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=" -,"_from": "once@1.4.0" -} \ No newline at end of file +} diff --git a/node_modules/optionator/package.json b/node_modules/optionator/package.json index 3dd02ff69..fbeb2f9da 100644 --- a/node_modules/optionator/package.json +++ b/node_modules/optionator/package.json @@ -41,8 +41,4 @@ "mocha": "~6.2.2", "istanbul": "~0.4.5" } - -,"_resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz" -,"_integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==" -,"_from": "optionator@0.8.3" -} \ No newline at end of file +} diff --git a/node_modules/path-is-absolute/package.json b/node_modules/path-is-absolute/package.json index a29658e3f..91196d5e9 100644 --- a/node_modules/path-is-absolute/package.json +++ b/node_modules/path-is-absolute/package.json @@ -40,8 +40,4 @@ "devDependencies": { "xo": "^0.16.0" } - -,"_resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz" -,"_integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" -,"_from": "path-is-absolute@1.0.1" -} \ No newline at end of file +} diff --git a/node_modules/path/LICENSE b/node_modules/path/LICENSE index e3d4e695a..a7e984dc7 100644 --- a/node_modules/path/LICENSE +++ b/node_modules/path/LICENSE @@ -1,18 +1,18 @@ -Copyright Joyent, Inc. and other Node contributors. All rights reserved. -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. +Copyright Joyent, Inc. and other Node contributors. All rights reserved. +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/node_modules/path/README.md b/node_modules/path/README.md index f5227af42..6e7d66816 100644 --- a/node_modules/path/README.md +++ b/node_modules/path/README.md @@ -1,15 +1,15 @@ -# path - -This is an exact copy of the NodeJS ’path’ module published to the NPM registry. - -[Documentation](http://nodejs.org/docs/latest/api/path.html) - -## Install - -```sh -$ npm install --save path -``` - -## License - -MIT +# path + +This is an exact copy of the NodeJS ’path’ module published to the NPM registry. + +[Documentation](http://nodejs.org/docs/latest/api/path.html) + +## Install + +```sh +$ npm install --save path +``` + +## License + +MIT diff --git a/node_modules/path/node_modules/inherits/package.json b/node_modules/path/node_modules/inherits/package.json index 48b9816a5..7cf62b95c 100644 --- a/node_modules/path/node_modules/inherits/package.json +++ b/node_modules/path/node_modules/inherits/package.json @@ -26,8 +26,4 @@ "inherits.js", "inherits_browser.js" ] - -,"_resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz" -,"_integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" -,"_from": "inherits@2.0.3" -} \ No newline at end of file +} diff --git a/node_modules/path/node_modules/util/package.json b/node_modules/path/node_modules/util/package.json index e007ee0db..13d19a0f7 100644 --- a/node_modules/path/node_modules/util/package.json +++ b/node_modules/path/node_modules/util/package.json @@ -32,8 +32,4 @@ "browser": { "./support/isBuffer.js": "./support/isBufferBrowser.js" } - -,"_resolved": "https://registry.npmjs.org/util/-/util-0.10.4.tgz" -,"_integrity": "sha512-0Pm9hTQ3se5ll1XihRic3FDIku70C+iHUdT/W926rSgHV5QgXsYbKZN8MSC3tJtSkhuROzvsQjAaFENRXr+19A==" -,"_from": "util@0.10.4" -} \ No newline at end of file +} diff --git a/node_modules/path/package.json b/node_modules/path/package.json index 295aa9d59..16109e34e 100644 --- a/node_modules/path/package.json +++ b/node_modules/path/package.json @@ -1,28 +1,24 @@ -{ - "author": { - "name": "Joyent", - "url": "http://www.joyent.com" - }, - "name": "path", - "description": "Node.JS path module", - "keywords": [ - "ender", - "path" - ], - "license": "MIT", - "version": "0.12.7", - "homepage": "http://nodejs.org/docs/latest/api/path.html", - "repository": { - "type": "git", - "url": "git://github.com/jinder/path.git" - }, - "main": "./path.js", - "dependencies": { - "process": "^0.11.1", - "util": "^0.10.3" - } - -,"_resolved": "https://registry.npmjs.org/path/-/path-0.12.7.tgz" -,"_integrity": "sha1-1NwqUGxM4hl+tIHr/NWzbAFAsQ8=" -,"_from": "path@0.12.7" -} \ No newline at end of file +{ + "author": { + "name": "Joyent", + "url": "http://www.joyent.com" + }, + "name": "path", + "description": "Node.JS path module", + "keywords": [ + "ender", + "path" + ], + "license": "MIT", + "version": "0.12.7", + "homepage": "http://nodejs.org/docs/latest/api/path.html", + "repository": { + "type": "git", + "url": "git://github.com/jinder/path.git" + }, + "main": "./path.js", + "dependencies": { + "process": "^0.11.1", + "util": "^0.10.3" + } +} diff --git a/node_modules/path/path.js b/node_modules/path/path.js index 937bc792c..87b8ee41b 100644 --- a/node_modules/path/path.js +++ b/node_modules/path/path.js @@ -1,628 +1,628 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// 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. - -'use strict'; - - -var isWindows = process.platform === 'win32'; -var util = require('util'); - - -// resolves . and .. elements in a path array with directory names there -// must be no slashes or device names (c:\) in the array -// (so also no leading and trailing slashes - it does not distinguish -// relative and absolute paths) -function normalizeArray(parts, allowAboveRoot) { - var res = []; - for (var i = 0; i < parts.length; i++) { - var p = parts[i]; - - // ignore empty parts - if (!p || p === '.') - continue; - - if (p === '..') { - if (res.length && res[res.length - 1] !== '..') { - res.pop(); - } else if (allowAboveRoot) { - res.push('..'); - } - } else { - res.push(p); - } - } - - return res; -} - -// returns an array with empty elements removed from either end of the input -// array or the original array if no elements need to be removed -function trimArray(arr) { - var lastIndex = arr.length - 1; - var start = 0; - for (; start <= lastIndex; start++) { - if (arr[start]) - break; - } - - var end = lastIndex; - for (; end >= 0; end--) { - if (arr[end]) - break; - } - - if (start === 0 && end === lastIndex) - return arr; - if (start > end) - return []; - return arr.slice(start, end + 1); -} - -// Regex to split a windows path into three parts: [*, device, slash, -// tail] windows-only -var splitDeviceRe = - /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/; - -// Regex to split the tail part of the above into [*, dir, basename, ext] -var splitTailRe = - /^([\s\S]*?)((?:\.{1,2}|[^\\\/]+?|)(\.[^.\/\\]*|))(?:[\\\/]*)$/; - -var win32 = {}; - -// Function to split a filename into [root, dir, basename, ext] -function win32SplitPath(filename) { - // Separate device+slash from tail - var result = splitDeviceRe.exec(filename), - device = (result[1] || '') + (result[2] || ''), - tail = result[3] || ''; - // Split the tail into dir, basename and extension - var result2 = splitTailRe.exec(tail), - dir = result2[1], - basename = result2[2], - ext = result2[3]; - return [device, dir, basename, ext]; -} - -function win32StatPath(path) { - var result = splitDeviceRe.exec(path), - device = result[1] || '', - isUnc = !!device && device[1] !== ':'; - return { - device: device, - isUnc: isUnc, - isAbsolute: isUnc || !!result[2], // UNC paths are always absolute - tail: result[3] - }; -} - -function normalizeUNCRoot(device) { - return '\\\\' + device.replace(/^[\\\/]+/, '').replace(/[\\\/]+/g, '\\'); -} - -// path.resolve([from ...], to) -win32.resolve = function() { - var resolvedDevice = '', - resolvedTail = '', - resolvedAbsolute = false; - - for (var i = arguments.length - 1; i >= -1; i--) { - var path; - if (i >= 0) { - path = arguments[i]; - } else if (!resolvedDevice) { - path = process.cwd(); - } else { - // Windows has the concept of drive-specific current working - // directories. If we've resolved a drive letter but not yet an - // absolute path, get cwd for that drive. We're sure the device is not - // an unc path at this points, because unc paths are always absolute. - path = process.env['=' + resolvedDevice]; - // Verify that a drive-local cwd was found and that it actually points - // to our drive. If not, default to the drive's root. - if (!path || path.substr(0, 3).toLowerCase() !== - resolvedDevice.toLowerCase() + '\\') { - path = resolvedDevice + '\\'; - } - } - - // Skip empty and invalid entries - if (!util.isString(path)) { - throw new TypeError('Arguments to path.resolve must be strings'); - } else if (!path) { - continue; - } - - var result = win32StatPath(path), - device = result.device, - isUnc = result.isUnc, - isAbsolute = result.isAbsolute, - tail = result.tail; - - if (device && - resolvedDevice && - device.toLowerCase() !== resolvedDevice.toLowerCase()) { - // This path points to another device so it is not applicable - continue; - } - - if (!resolvedDevice) { - resolvedDevice = device; - } - if (!resolvedAbsolute) { - resolvedTail = tail + '\\' + resolvedTail; - resolvedAbsolute = isAbsolute; - } - - if (resolvedDevice && resolvedAbsolute) { - break; - } - } - - // Convert slashes to backslashes when `resolvedDevice` points to an UNC - // root. Also squash multiple slashes into a single one where appropriate. - if (isUnc) { - resolvedDevice = normalizeUNCRoot(resolvedDevice); - } - - // At this point the path should be resolved to a full absolute path, - // but handle relative paths to be safe (might happen when process.cwd() - // fails) - - // Normalize the tail path - resolvedTail = normalizeArray(resolvedTail.split(/[\\\/]+/), - !resolvedAbsolute).join('\\'); - - return (resolvedDevice + (resolvedAbsolute ? '\\' : '') + resolvedTail) || - '.'; -}; - - -win32.normalize = function(path) { - var result = win32StatPath(path), - device = result.device, - isUnc = result.isUnc, - isAbsolute = result.isAbsolute, - tail = result.tail, - trailingSlash = /[\\\/]$/.test(tail); - - // Normalize the tail path - tail = normalizeArray(tail.split(/[\\\/]+/), !isAbsolute).join('\\'); - - if (!tail && !isAbsolute) { - tail = '.'; - } - if (tail && trailingSlash) { - tail += '\\'; - } - - // Convert slashes to backslashes when `device` points to an UNC root. - // Also squash multiple slashes into a single one where appropriate. - if (isUnc) { - device = normalizeUNCRoot(device); - } - - return device + (isAbsolute ? '\\' : '') + tail; -}; - - -win32.isAbsolute = function(path) { - return win32StatPath(path).isAbsolute; -}; - -win32.join = function() { - var paths = []; - for (var i = 0; i < arguments.length; i++) { - var arg = arguments[i]; - if (!util.isString(arg)) { - throw new TypeError('Arguments to path.join must be strings'); - } - if (arg) { - paths.push(arg); - } - } - - var joined = paths.join('\\'); - - // Make sure that the joined path doesn't start with two slashes, because - // normalize() will mistake it for an UNC path then. - // - // This step is skipped when it is very clear that the user actually - // intended to point at an UNC path. This is assumed when the first - // non-empty string arguments starts with exactly two slashes followed by - // at least one more non-slash character. - // - // Note that for normalize() to treat a path as an UNC path it needs to - // have at least 2 components, so we don't filter for that here. - // This means that the user can use join to construct UNC paths from - // a server name and a share name; for example: - // path.join('//server', 'share') -> '\\\\server\\share\') - if (!/^[\\\/]{2}[^\\\/]/.test(paths[0])) { - joined = joined.replace(/^[\\\/]{2,}/, '\\'); - } - - return win32.normalize(joined); -}; - - -// path.relative(from, to) -// it will solve the relative path from 'from' to 'to', for instance: -// from = 'C:\\orandea\\test\\aaa' -// to = 'C:\\orandea\\impl\\bbb' -// The output of the function should be: '..\\..\\impl\\bbb' -win32.relative = function(from, to) { - from = win32.resolve(from); - to = win32.resolve(to); - - // windows is not case sensitive - var lowerFrom = from.toLowerCase(); - var lowerTo = to.toLowerCase(); - - var toParts = trimArray(to.split('\\')); - - var lowerFromParts = trimArray(lowerFrom.split('\\')); - var lowerToParts = trimArray(lowerTo.split('\\')); - - var length = Math.min(lowerFromParts.length, lowerToParts.length); - var samePartsLength = length; - for (var i = 0; i < length; i++) { - if (lowerFromParts[i] !== lowerToParts[i]) { - samePartsLength = i; - break; - } - } - - if (samePartsLength == 0) { - return to; - } - - var outputParts = []; - for (var i = samePartsLength; i < lowerFromParts.length; i++) { - outputParts.push('..'); - } - - outputParts = outputParts.concat(toParts.slice(samePartsLength)); - - return outputParts.join('\\'); -}; - - -win32._makeLong = function(path) { - // Note: this will *probably* throw somewhere. - if (!util.isString(path)) - return path; - - if (!path) { - return ''; - } - - var resolvedPath = win32.resolve(path); - - if (/^[a-zA-Z]\:\\/.test(resolvedPath)) { - // path is local filesystem path, which needs to be converted - // to long UNC path. - return '\\\\?\\' + resolvedPath; - } else if (/^\\\\[^?.]/.test(resolvedPath)) { - // path is network UNC path, which needs to be converted - // to long UNC path. - return '\\\\?\\UNC\\' + resolvedPath.substring(2); - } - - return path; -}; - - -win32.dirname = function(path) { - var result = win32SplitPath(path), - root = result[0], - dir = result[1]; - - if (!root && !dir) { - // No dirname whatsoever - return '.'; - } - - if (dir) { - // It has a dirname, strip trailing slash - dir = dir.substr(0, dir.length - 1); - } - - return root + dir; -}; - - -win32.basename = function(path, ext) { - var f = win32SplitPath(path)[2]; - // TODO: make this comparison case-insensitive on windows? - if (ext && f.substr(-1 * ext.length) === ext) { - f = f.substr(0, f.length - ext.length); - } - return f; -}; - - -win32.extname = function(path) { - return win32SplitPath(path)[3]; -}; - - -win32.format = function(pathObject) { - if (!util.isObject(pathObject)) { - throw new TypeError( - "Parameter 'pathObject' must be an object, not " + typeof pathObject - ); - } - - var root = pathObject.root || ''; - - if (!util.isString(root)) { - throw new TypeError( - "'pathObject.root' must be a string or undefined, not " + - typeof pathObject.root - ); - } - - var dir = pathObject.dir; - var base = pathObject.base || ''; - if (!dir) { - return base; - } - if (dir[dir.length - 1] === win32.sep) { - return dir + base; - } - return dir + win32.sep + base; -}; - - -win32.parse = function(pathString) { - if (!util.isString(pathString)) { - throw new TypeError( - "Parameter 'pathString' must be a string, not " + typeof pathString - ); - } - var allParts = win32SplitPath(pathString); - if (!allParts || allParts.length !== 4) { - throw new TypeError("Invalid path '" + pathString + "'"); - } - return { - root: allParts[0], - dir: allParts[0] + allParts[1].slice(0, -1), - base: allParts[2], - ext: allParts[3], - name: allParts[2].slice(0, allParts[2].length - allParts[3].length) - }; -}; - - -win32.sep = '\\'; -win32.delimiter = ';'; - - -// Split a filename into [root, dir, basename, ext], unix version -// 'root' is just a slash, or nothing. -var splitPathRe = - /^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/; -var posix = {}; - - -function posixSplitPath(filename) { - return splitPathRe.exec(filename).slice(1); -} - - -// path.resolve([from ...], to) -// posix version -posix.resolve = function() { - var resolvedPath = '', - resolvedAbsolute = false; - - for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) { - var path = (i >= 0) ? arguments[i] : process.cwd(); - - // Skip empty and invalid entries - if (!util.isString(path)) { - throw new TypeError('Arguments to path.resolve must be strings'); - } else if (!path) { - continue; - } - - resolvedPath = path + '/' + resolvedPath; - resolvedAbsolute = path[0] === '/'; - } - - // At this point the path should be resolved to a full absolute path, but - // handle relative paths to be safe (might happen when process.cwd() fails) - - // Normalize the path - resolvedPath = normalizeArray(resolvedPath.split('/'), - !resolvedAbsolute).join('/'); - - return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.'; -}; - -// path.normalize(path) -// posix version -posix.normalize = function(path) { - var isAbsolute = posix.isAbsolute(path), - trailingSlash = path && path[path.length - 1] === '/'; - - // Normalize the path - path = normalizeArray(path.split('/'), !isAbsolute).join('/'); - - if (!path && !isAbsolute) { - path = '.'; - } - if (path && trailingSlash) { - path += '/'; - } - - return (isAbsolute ? '/' : '') + path; -}; - -// posix version -posix.isAbsolute = function(path) { - return path.charAt(0) === '/'; -}; - -// posix version -posix.join = function() { - var path = ''; - for (var i = 0; i < arguments.length; i++) { - var segment = arguments[i]; - if (!util.isString(segment)) { - throw new TypeError('Arguments to path.join must be strings'); - } - if (segment) { - if (!path) { - path += segment; - } else { - path += '/' + segment; - } - } - } - return posix.normalize(path); -}; - - -// path.relative(from, to) -// posix version -posix.relative = function(from, to) { - from = posix.resolve(from).substr(1); - to = posix.resolve(to).substr(1); - - var fromParts = trimArray(from.split('/')); - var toParts = trimArray(to.split('/')); - - var length = Math.min(fromParts.length, toParts.length); - var samePartsLength = length; - for (var i = 0; i < length; i++) { - if (fromParts[i] !== toParts[i]) { - samePartsLength = i; - break; - } - } - - var outputParts = []; - for (var i = samePartsLength; i < fromParts.length; i++) { - outputParts.push('..'); - } - - outputParts = outputParts.concat(toParts.slice(samePartsLength)); - - return outputParts.join('/'); -}; - - -posix._makeLong = function(path) { - return path; -}; - - -posix.dirname = function(path) { - var result = posixSplitPath(path), - root = result[0], - dir = result[1]; - - if (!root && !dir) { - // No dirname whatsoever - return '.'; - } - - if (dir) { - // It has a dirname, strip trailing slash - dir = dir.substr(0, dir.length - 1); - } - - return root + dir; -}; - - -posix.basename = function(path, ext) { - var f = posixSplitPath(path)[2]; - // TODO: make this comparison case-insensitive on windows? - if (ext && f.substr(-1 * ext.length) === ext) { - f = f.substr(0, f.length - ext.length); - } - return f; -}; - - -posix.extname = function(path) { - return posixSplitPath(path)[3]; -}; - - -posix.format = function(pathObject) { - if (!util.isObject(pathObject)) { - throw new TypeError( - "Parameter 'pathObject' must be an object, not " + typeof pathObject - ); - } - - var root = pathObject.root || ''; - - if (!util.isString(root)) { - throw new TypeError( - "'pathObject.root' must be a string or undefined, not " + - typeof pathObject.root - ); - } - - var dir = pathObject.dir ? pathObject.dir + posix.sep : ''; - var base = pathObject.base || ''; - return dir + base; -}; - - -posix.parse = function(pathString) { - if (!util.isString(pathString)) { - throw new TypeError( - "Parameter 'pathString' must be a string, not " + typeof pathString - ); - } - var allParts = posixSplitPath(pathString); - if (!allParts || allParts.length !== 4) { - throw new TypeError("Invalid path '" + pathString + "'"); - } - allParts[1] = allParts[1] || ''; - allParts[2] = allParts[2] || ''; - allParts[3] = allParts[3] || ''; - - return { - root: allParts[0], - dir: allParts[0] + allParts[1].slice(0, -1), - base: allParts[2], - ext: allParts[3], - name: allParts[2].slice(0, allParts[2].length - allParts[3].length) - }; -}; - - -posix.sep = '/'; -posix.delimiter = ':'; - - -if (isWindows) - module.exports = win32; -else /* posix */ - module.exports = posix; - -module.exports.posix = posix; -module.exports.win32 = win32; +// Copyright Joyent, Inc. and other Node contributors. +// +// 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. + +'use strict'; + + +var isWindows = process.platform === 'win32'; +var util = require('util'); + + +// resolves . and .. elements in a path array with directory names there +// must be no slashes or device names (c:\) in the array +// (so also no leading and trailing slashes - it does not distinguish +// relative and absolute paths) +function normalizeArray(parts, allowAboveRoot) { + var res = []; + for (var i = 0; i < parts.length; i++) { + var p = parts[i]; + + // ignore empty parts + if (!p || p === '.') + continue; + + if (p === '..') { + if (res.length && res[res.length - 1] !== '..') { + res.pop(); + } else if (allowAboveRoot) { + res.push('..'); + } + } else { + res.push(p); + } + } + + return res; +} + +// returns an array with empty elements removed from either end of the input +// array or the original array if no elements need to be removed +function trimArray(arr) { + var lastIndex = arr.length - 1; + var start = 0; + for (; start <= lastIndex; start++) { + if (arr[start]) + break; + } + + var end = lastIndex; + for (; end >= 0; end--) { + if (arr[end]) + break; + } + + if (start === 0 && end === lastIndex) + return arr; + if (start > end) + return []; + return arr.slice(start, end + 1); +} + +// Regex to split a windows path into three parts: [*, device, slash, +// tail] windows-only +var splitDeviceRe = + /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/; + +// Regex to split the tail part of the above into [*, dir, basename, ext] +var splitTailRe = + /^([\s\S]*?)((?:\.{1,2}|[^\\\/]+?|)(\.[^.\/\\]*|))(?:[\\\/]*)$/; + +var win32 = {}; + +// Function to split a filename into [root, dir, basename, ext] +function win32SplitPath(filename) { + // Separate device+slash from tail + var result = splitDeviceRe.exec(filename), + device = (result[1] || '') + (result[2] || ''), + tail = result[3] || ''; + // Split the tail into dir, basename and extension + var result2 = splitTailRe.exec(tail), + dir = result2[1], + basename = result2[2], + ext = result2[3]; + return [device, dir, basename, ext]; +} + +function win32StatPath(path) { + var result = splitDeviceRe.exec(path), + device = result[1] || '', + isUnc = !!device && device[1] !== ':'; + return { + device: device, + isUnc: isUnc, + isAbsolute: isUnc || !!result[2], // UNC paths are always absolute + tail: result[3] + }; +} + +function normalizeUNCRoot(device) { + return '\\\\' + device.replace(/^[\\\/]+/, '').replace(/[\\\/]+/g, '\\'); +} + +// path.resolve([from ...], to) +win32.resolve = function() { + var resolvedDevice = '', + resolvedTail = '', + resolvedAbsolute = false; + + for (var i = arguments.length - 1; i >= -1; i--) { + var path; + if (i >= 0) { + path = arguments[i]; + } else if (!resolvedDevice) { + path = process.cwd(); + } else { + // Windows has the concept of drive-specific current working + // directories. If we've resolved a drive letter but not yet an + // absolute path, get cwd for that drive. We're sure the device is not + // an unc path at this points, because unc paths are always absolute. + path = process.env['=' + resolvedDevice]; + // Verify that a drive-local cwd was found and that it actually points + // to our drive. If not, default to the drive's root. + if (!path || path.substr(0, 3).toLowerCase() !== + resolvedDevice.toLowerCase() + '\\') { + path = resolvedDevice + '\\'; + } + } + + // Skip empty and invalid entries + if (!util.isString(path)) { + throw new TypeError('Arguments to path.resolve must be strings'); + } else if (!path) { + continue; + } + + var result = win32StatPath(path), + device = result.device, + isUnc = result.isUnc, + isAbsolute = result.isAbsolute, + tail = result.tail; + + if (device && + resolvedDevice && + device.toLowerCase() !== resolvedDevice.toLowerCase()) { + // This path points to another device so it is not applicable + continue; + } + + if (!resolvedDevice) { + resolvedDevice = device; + } + if (!resolvedAbsolute) { + resolvedTail = tail + '\\' + resolvedTail; + resolvedAbsolute = isAbsolute; + } + + if (resolvedDevice && resolvedAbsolute) { + break; + } + } + + // Convert slashes to backslashes when `resolvedDevice` points to an UNC + // root. Also squash multiple slashes into a single one where appropriate. + if (isUnc) { + resolvedDevice = normalizeUNCRoot(resolvedDevice); + } + + // At this point the path should be resolved to a full absolute path, + // but handle relative paths to be safe (might happen when process.cwd() + // fails) + + // Normalize the tail path + resolvedTail = normalizeArray(resolvedTail.split(/[\\\/]+/), + !resolvedAbsolute).join('\\'); + + return (resolvedDevice + (resolvedAbsolute ? '\\' : '') + resolvedTail) || + '.'; +}; + + +win32.normalize = function(path) { + var result = win32StatPath(path), + device = result.device, + isUnc = result.isUnc, + isAbsolute = result.isAbsolute, + tail = result.tail, + trailingSlash = /[\\\/]$/.test(tail); + + // Normalize the tail path + tail = normalizeArray(tail.split(/[\\\/]+/), !isAbsolute).join('\\'); + + if (!tail && !isAbsolute) { + tail = '.'; + } + if (tail && trailingSlash) { + tail += '\\'; + } + + // Convert slashes to backslashes when `device` points to an UNC root. + // Also squash multiple slashes into a single one where appropriate. + if (isUnc) { + device = normalizeUNCRoot(device); + } + + return device + (isAbsolute ? '\\' : '') + tail; +}; + + +win32.isAbsolute = function(path) { + return win32StatPath(path).isAbsolute; +}; + +win32.join = function() { + var paths = []; + for (var i = 0; i < arguments.length; i++) { + var arg = arguments[i]; + if (!util.isString(arg)) { + throw new TypeError('Arguments to path.join must be strings'); + } + if (arg) { + paths.push(arg); + } + } + + var joined = paths.join('\\'); + + // Make sure that the joined path doesn't start with two slashes, because + // normalize() will mistake it for an UNC path then. + // + // This step is skipped when it is very clear that the user actually + // intended to point at an UNC path. This is assumed when the first + // non-empty string arguments starts with exactly two slashes followed by + // at least one more non-slash character. + // + // Note that for normalize() to treat a path as an UNC path it needs to + // have at least 2 components, so we don't filter for that here. + // This means that the user can use join to construct UNC paths from + // a server name and a share name; for example: + // path.join('//server', 'share') -> '\\\\server\\share\') + if (!/^[\\\/]{2}[^\\\/]/.test(paths[0])) { + joined = joined.replace(/^[\\\/]{2,}/, '\\'); + } + + return win32.normalize(joined); +}; + + +// path.relative(from, to) +// it will solve the relative path from 'from' to 'to', for instance: +// from = 'C:\\orandea\\test\\aaa' +// to = 'C:\\orandea\\impl\\bbb' +// The output of the function should be: '..\\..\\impl\\bbb' +win32.relative = function(from, to) { + from = win32.resolve(from); + to = win32.resolve(to); + + // windows is not case sensitive + var lowerFrom = from.toLowerCase(); + var lowerTo = to.toLowerCase(); + + var toParts = trimArray(to.split('\\')); + + var lowerFromParts = trimArray(lowerFrom.split('\\')); + var lowerToParts = trimArray(lowerTo.split('\\')); + + var length = Math.min(lowerFromParts.length, lowerToParts.length); + var samePartsLength = length; + for (var i = 0; i < length; i++) { + if (lowerFromParts[i] !== lowerToParts[i]) { + samePartsLength = i; + break; + } + } + + if (samePartsLength == 0) { + return to; + } + + var outputParts = []; + for (var i = samePartsLength; i < lowerFromParts.length; i++) { + outputParts.push('..'); + } + + outputParts = outputParts.concat(toParts.slice(samePartsLength)); + + return outputParts.join('\\'); +}; + + +win32._makeLong = function(path) { + // Note: this will *probably* throw somewhere. + if (!util.isString(path)) + return path; + + if (!path) { + return ''; + } + + var resolvedPath = win32.resolve(path); + + if (/^[a-zA-Z]\:\\/.test(resolvedPath)) { + // path is local filesystem path, which needs to be converted + // to long UNC path. + return '\\\\?\\' + resolvedPath; + } else if (/^\\\\[^?.]/.test(resolvedPath)) { + // path is network UNC path, which needs to be converted + // to long UNC path. + return '\\\\?\\UNC\\' + resolvedPath.substring(2); + } + + return path; +}; + + +win32.dirname = function(path) { + var result = win32SplitPath(path), + root = result[0], + dir = result[1]; + + if (!root && !dir) { + // No dirname whatsoever + return '.'; + } + + if (dir) { + // It has a dirname, strip trailing slash + dir = dir.substr(0, dir.length - 1); + } + + return root + dir; +}; + + +win32.basename = function(path, ext) { + var f = win32SplitPath(path)[2]; + // TODO: make this comparison case-insensitive on windows? + if (ext && f.substr(-1 * ext.length) === ext) { + f = f.substr(0, f.length - ext.length); + } + return f; +}; + + +win32.extname = function(path) { + return win32SplitPath(path)[3]; +}; + + +win32.format = function(pathObject) { + if (!util.isObject(pathObject)) { + throw new TypeError( + "Parameter 'pathObject' must be an object, not " + typeof pathObject + ); + } + + var root = pathObject.root || ''; + + if (!util.isString(root)) { + throw new TypeError( + "'pathObject.root' must be a string or undefined, not " + + typeof pathObject.root + ); + } + + var dir = pathObject.dir; + var base = pathObject.base || ''; + if (!dir) { + return base; + } + if (dir[dir.length - 1] === win32.sep) { + return dir + base; + } + return dir + win32.sep + base; +}; + + +win32.parse = function(pathString) { + if (!util.isString(pathString)) { + throw new TypeError( + "Parameter 'pathString' must be a string, not " + typeof pathString + ); + } + var allParts = win32SplitPath(pathString); + if (!allParts || allParts.length !== 4) { + throw new TypeError("Invalid path '" + pathString + "'"); + } + return { + root: allParts[0], + dir: allParts[0] + allParts[1].slice(0, -1), + base: allParts[2], + ext: allParts[3], + name: allParts[2].slice(0, allParts[2].length - allParts[3].length) + }; +}; + + +win32.sep = '\\'; +win32.delimiter = ';'; + + +// Split a filename into [root, dir, basename, ext], unix version +// 'root' is just a slash, or nothing. +var splitPathRe = + /^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/; +var posix = {}; + + +function posixSplitPath(filename) { + return splitPathRe.exec(filename).slice(1); +} + + +// path.resolve([from ...], to) +// posix version +posix.resolve = function() { + var resolvedPath = '', + resolvedAbsolute = false; + + for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) { + var path = (i >= 0) ? arguments[i] : process.cwd(); + + // Skip empty and invalid entries + if (!util.isString(path)) { + throw new TypeError('Arguments to path.resolve must be strings'); + } else if (!path) { + continue; + } + + resolvedPath = path + '/' + resolvedPath; + resolvedAbsolute = path[0] === '/'; + } + + // At this point the path should be resolved to a full absolute path, but + // handle relative paths to be safe (might happen when process.cwd() fails) + + // Normalize the path + resolvedPath = normalizeArray(resolvedPath.split('/'), + !resolvedAbsolute).join('/'); + + return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.'; +}; + +// path.normalize(path) +// posix version +posix.normalize = function(path) { + var isAbsolute = posix.isAbsolute(path), + trailingSlash = path && path[path.length - 1] === '/'; + + // Normalize the path + path = normalizeArray(path.split('/'), !isAbsolute).join('/'); + + if (!path && !isAbsolute) { + path = '.'; + } + if (path && trailingSlash) { + path += '/'; + } + + return (isAbsolute ? '/' : '') + path; +}; + +// posix version +posix.isAbsolute = function(path) { + return path.charAt(0) === '/'; +}; + +// posix version +posix.join = function() { + var path = ''; + for (var i = 0; i < arguments.length; i++) { + var segment = arguments[i]; + if (!util.isString(segment)) { + throw new TypeError('Arguments to path.join must be strings'); + } + if (segment) { + if (!path) { + path += segment; + } else { + path += '/' + segment; + } + } + } + return posix.normalize(path); +}; + + +// path.relative(from, to) +// posix version +posix.relative = function(from, to) { + from = posix.resolve(from).substr(1); + to = posix.resolve(to).substr(1); + + var fromParts = trimArray(from.split('/')); + var toParts = trimArray(to.split('/')); + + var length = Math.min(fromParts.length, toParts.length); + var samePartsLength = length; + for (var i = 0; i < length; i++) { + if (fromParts[i] !== toParts[i]) { + samePartsLength = i; + break; + } + } + + var outputParts = []; + for (var i = samePartsLength; i < fromParts.length; i++) { + outputParts.push('..'); + } + + outputParts = outputParts.concat(toParts.slice(samePartsLength)); + + return outputParts.join('/'); +}; + + +posix._makeLong = function(path) { + return path; +}; + + +posix.dirname = function(path) { + var result = posixSplitPath(path), + root = result[0], + dir = result[1]; + + if (!root && !dir) { + // No dirname whatsoever + return '.'; + } + + if (dir) { + // It has a dirname, strip trailing slash + dir = dir.substr(0, dir.length - 1); + } + + return root + dir; +}; + + +posix.basename = function(path, ext) { + var f = posixSplitPath(path)[2]; + // TODO: make this comparison case-insensitive on windows? + if (ext && f.substr(-1 * ext.length) === ext) { + f = f.substr(0, f.length - ext.length); + } + return f; +}; + + +posix.extname = function(path) { + return posixSplitPath(path)[3]; +}; + + +posix.format = function(pathObject) { + if (!util.isObject(pathObject)) { + throw new TypeError( + "Parameter 'pathObject' must be an object, not " + typeof pathObject + ); + } + + var root = pathObject.root || ''; + + if (!util.isString(root)) { + throw new TypeError( + "'pathObject.root' must be a string or undefined, not " + + typeof pathObject.root + ); + } + + var dir = pathObject.dir ? pathObject.dir + posix.sep : ''; + var base = pathObject.base || ''; + return dir + base; +}; + + +posix.parse = function(pathString) { + if (!util.isString(pathString)) { + throw new TypeError( + "Parameter 'pathString' must be a string, not " + typeof pathString + ); + } + var allParts = posixSplitPath(pathString); + if (!allParts || allParts.length !== 4) { + throw new TypeError("Invalid path '" + pathString + "'"); + } + allParts[1] = allParts[1] || ''; + allParts[2] = allParts[2] || ''; + allParts[3] = allParts[3] || ''; + + return { + root: allParts[0], + dir: allParts[0] + allParts[1].slice(0, -1), + base: allParts[2], + ext: allParts[3], + name: allParts[2].slice(0, allParts[2].length - allParts[3].length) + }; +}; + + +posix.sep = '/'; +posix.delimiter = ':'; + + +if (isWindows) + module.exports = win32; +else /* posix */ + module.exports = posix; + +module.exports.posix = posix; +module.exports.win32 = win32; diff --git a/node_modules/performance-now/test/scripts/delayed-call.coffee b/node_modules/performance-now/test/scripts/delayed-call.coffee old mode 100644 new mode 100755 diff --git a/node_modules/performance-now/test/scripts/delayed-require.coffee b/node_modules/performance-now/test/scripts/delayed-require.coffee old mode 100644 new mode 100755 diff --git a/node_modules/performance-now/test/scripts/difference.coffee b/node_modules/performance-now/test/scripts/difference.coffee old mode 100644 new mode 100755 diff --git a/node_modules/performance-now/test/scripts/initial-value.coffee b/node_modules/performance-now/test/scripts/initial-value.coffee old mode 100644 new mode 100755 diff --git a/node_modules/picomatch/CHANGELOG.md b/node_modules/picomatch/CHANGELOG.md old mode 100644 new mode 100755 diff --git a/node_modules/picomatch/LICENSE b/node_modules/picomatch/LICENSE old mode 100644 new mode 100755 diff --git a/node_modules/picomatch/README.md b/node_modules/picomatch/README.md old mode 100644 new mode 100755 diff --git a/node_modules/picomatch/index.js b/node_modules/picomatch/index.js old mode 100644 new mode 100755 diff --git a/node_modules/picomatch/lib/constants.js b/node_modules/picomatch/lib/constants.js old mode 100644 new mode 100755 diff --git a/node_modules/picomatch/lib/parse.js b/node_modules/picomatch/lib/parse.js old mode 100644 new mode 100755 diff --git a/node_modules/picomatch/lib/picomatch.js b/node_modules/picomatch/lib/picomatch.js old mode 100644 new mode 100755 diff --git a/node_modules/picomatch/lib/scan.js b/node_modules/picomatch/lib/scan.js old mode 100644 new mode 100755 diff --git a/node_modules/picomatch/lib/utils.js b/node_modules/picomatch/lib/utils.js old mode 100644 new mode 100755 diff --git a/node_modules/picomatch/package.json b/node_modules/picomatch/package.json old mode 100644 new mode 100755 diff --git a/node_modules/pn/scripts/generate.js b/node_modules/pn/scripts/generate.js old mode 100644 new mode 100755 diff --git a/node_modules/prelude-ls/package.json b/node_modules/prelude-ls/package.json index 67a9cff14..5507d3c7a 100644 --- a/node_modules/prelude-ls/package.json +++ b/node_modules/prelude-ls/package.json @@ -49,8 +49,4 @@ "browserify": "~3.24.13", "sinon": "~1.10.2" } - -,"_resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz" -,"_integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=" -,"_from": "prelude-ls@1.1.2" -} \ No newline at end of file +} diff --git a/node_modules/pretty-format/README.md b/node_modules/pretty-format/README.md old mode 100644 new mode 100755 diff --git a/node_modules/pretty-format/build/ts3.4/collections.d.ts b/node_modules/pretty-format/build/ts3.4/collections.d.ts index 7698b1292..d4fa2f312 100644 --- a/node_modules/pretty-format/build/ts3.4/collections.d.ts +++ b/node_modules/pretty-format/build/ts3.4/collections.d.ts @@ -1,32 +1,32 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ -import { Config, Printer, Refs } from './types'; -/** - * Return entries (for example, of a map) - * with spacing, indentation, and comma - * without surrounding punctuation (for example, braces) - */ -export declare function printIteratorEntries(iterator: Iterator<[unknown, unknown]>, config: Config, indentation: string, depth: number, refs: Refs, printer: Printer, separator?: string): string; -/** - * Return values (for example, of a set) - * with spacing, indentation, and comma - * without surrounding punctuation (braces or brackets) - */ -export declare function printIteratorValues(iterator: Iterator, config: Config, indentation: string, depth: number, refs: Refs, printer: Printer): string; -/** - * Return items (for example, of an array) - * with spacing, indentation, and comma - * without surrounding punctuation (for example, brackets) - **/ -export declare function printListItems(list: ArrayLike, config: Config, indentation: string, depth: number, refs: Refs, printer: Printer): string; -/** - * Return properties of an object - * with spacing, indentation, and comma - * without surrounding punctuation (for example, braces) - */ -export declare function printObjectProperties(val: Record, config: Config, indentation: string, depth: number, refs: Refs, printer: Printer): string; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + */ +import { Config, Printer, Refs } from './types'; +/** + * Return entries (for example, of a map) + * with spacing, indentation, and comma + * without surrounding punctuation (for example, braces) + */ +export declare function printIteratorEntries(iterator: Iterator<[unknown, unknown]>, config: Config, indentation: string, depth: number, refs: Refs, printer: Printer, separator?: string): string; +/** + * Return values (for example, of a set) + * with spacing, indentation, and comma + * without surrounding punctuation (braces or brackets) + */ +export declare function printIteratorValues(iterator: Iterator, config: Config, indentation: string, depth: number, refs: Refs, printer: Printer): string; +/** + * Return items (for example, of an array) + * with spacing, indentation, and comma + * without surrounding punctuation (for example, brackets) + **/ +export declare function printListItems(list: ArrayLike, config: Config, indentation: string, depth: number, refs: Refs, printer: Printer): string; +/** + * Return properties of an object + * with spacing, indentation, and comma + * without surrounding punctuation (for example, braces) + */ +export declare function printObjectProperties(val: Record, config: Config, indentation: string, depth: number, refs: Refs, printer: Printer): string; diff --git a/node_modules/pretty-format/build/ts3.4/index.d.ts b/node_modules/pretty-format/build/ts3.4/index.d.ts index 5ccab3267..7a7f23325 100644 --- a/node_modules/pretty-format/build/ts3.4/index.d.ts +++ b/node_modules/pretty-format/build/ts3.4/index.d.ts @@ -1,37 +1,37 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import * as PrettyFormat from './types'; -/** - * Returns a presentation string of your `val` object - * @param val any potential JavaScript object - * @param options Custom settings - */ -declare function prettyFormat(val: unknown, options?: PrettyFormat.OptionsReceived): string; -declare namespace prettyFormat { - var plugins: { - AsymmetricMatcher: PrettyFormat.NewPlugin; - ConvertAnsi: PrettyFormat.NewPlugin; - DOMCollection: PrettyFormat.NewPlugin; - DOMElement: PrettyFormat.NewPlugin; - Immutable: PrettyFormat.NewPlugin; - ReactElement: PrettyFormat.NewPlugin; - ReactTestComponent: PrettyFormat.NewPlugin; - }; -} -declare namespace prettyFormat { - type Colors = PrettyFormat.Colors; - type Config = PrettyFormat.Config; - type Options = PrettyFormat.Options; - type OptionsReceived = PrettyFormat.OptionsReceived; - type OldPlugin = PrettyFormat.OldPlugin; - type NewPlugin = PrettyFormat.NewPlugin; - type Plugin = PrettyFormat.Plugin; - type Plugins = PrettyFormat.Plugins; - type Refs = PrettyFormat.Refs; - type Theme = PrettyFormat.Theme; -} -export = prettyFormat; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import * as PrettyFormat from './types'; +/** + * Returns a presentation string of your `val` object + * @param val any potential JavaScript object + * @param options Custom settings + */ +declare function prettyFormat(val: unknown, options?: PrettyFormat.OptionsReceived): string; +declare namespace prettyFormat { + var plugins: { + AsymmetricMatcher: PrettyFormat.NewPlugin; + ConvertAnsi: PrettyFormat.NewPlugin; + DOMCollection: PrettyFormat.NewPlugin; + DOMElement: PrettyFormat.NewPlugin; + Immutable: PrettyFormat.NewPlugin; + ReactElement: PrettyFormat.NewPlugin; + ReactTestComponent: PrettyFormat.NewPlugin; + }; +} +declare namespace prettyFormat { + type Colors = PrettyFormat.Colors; + type Config = PrettyFormat.Config; + type Options = PrettyFormat.Options; + type OptionsReceived = PrettyFormat.OptionsReceived; + type OldPlugin = PrettyFormat.OldPlugin; + type NewPlugin = PrettyFormat.NewPlugin; + type Plugin = PrettyFormat.Plugin; + type Plugins = PrettyFormat.Plugins; + type Refs = PrettyFormat.Refs; + type Theme = PrettyFormat.Theme; +} +export = prettyFormat; diff --git a/node_modules/pretty-format/build/ts3.4/plugins/AsymmetricMatcher.d.ts b/node_modules/pretty-format/build/ts3.4/plugins/AsymmetricMatcher.d.ts index 4bb54b82b..0efba129f 100644 --- a/node_modules/pretty-format/build/ts3.4/plugins/AsymmetricMatcher.d.ts +++ b/node_modules/pretty-format/build/ts3.4/plugins/AsymmetricMatcher.d.ts @@ -1,11 +1,11 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import { NewPlugin } from '../types'; -export declare const serialize: NewPlugin['serialize']; -export declare const test: NewPlugin['test']; -declare const plugin: NewPlugin; -export default plugin; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import { NewPlugin } from '../types'; +export declare const serialize: NewPlugin['serialize']; +export declare const test: NewPlugin['test']; +declare const plugin: NewPlugin; +export default plugin; diff --git a/node_modules/pretty-format/build/ts3.4/plugins/ConvertAnsi.d.ts b/node_modules/pretty-format/build/ts3.4/plugins/ConvertAnsi.d.ts index 5adf5a447..192368b6f 100644 --- a/node_modules/pretty-format/build/ts3.4/plugins/ConvertAnsi.d.ts +++ b/node_modules/pretty-format/build/ts3.4/plugins/ConvertAnsi.d.ts @@ -1,11 +1,11 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import { NewPlugin } from '../types'; -export declare const test: NewPlugin['test']; -export declare const serialize: NewPlugin['serialize']; -declare const plugin: NewPlugin; -export default plugin; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import { NewPlugin } from '../types'; +export declare const test: NewPlugin['test']; +export declare const serialize: NewPlugin['serialize']; +declare const plugin: NewPlugin; +export default plugin; diff --git a/node_modules/pretty-format/build/ts3.4/plugins/DOMCollection.d.ts b/node_modules/pretty-format/build/ts3.4/plugins/DOMCollection.d.ts index 5adf5a447..192368b6f 100644 --- a/node_modules/pretty-format/build/ts3.4/plugins/DOMCollection.d.ts +++ b/node_modules/pretty-format/build/ts3.4/plugins/DOMCollection.d.ts @@ -1,11 +1,11 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import { NewPlugin } from '../types'; -export declare const test: NewPlugin['test']; -export declare const serialize: NewPlugin['serialize']; -declare const plugin: NewPlugin; -export default plugin; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import { NewPlugin } from '../types'; +export declare const test: NewPlugin['test']; +export declare const serialize: NewPlugin['serialize']; +declare const plugin: NewPlugin; +export default plugin; diff --git a/node_modules/pretty-format/build/ts3.4/plugins/DOMElement.d.ts b/node_modules/pretty-format/build/ts3.4/plugins/DOMElement.d.ts index 5adf5a447..192368b6f 100644 --- a/node_modules/pretty-format/build/ts3.4/plugins/DOMElement.d.ts +++ b/node_modules/pretty-format/build/ts3.4/plugins/DOMElement.d.ts @@ -1,11 +1,11 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import { NewPlugin } from '../types'; -export declare const test: NewPlugin['test']; -export declare const serialize: NewPlugin['serialize']; -declare const plugin: NewPlugin; -export default plugin; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import { NewPlugin } from '../types'; +export declare const test: NewPlugin['test']; +export declare const serialize: NewPlugin['serialize']; +declare const plugin: NewPlugin; +export default plugin; diff --git a/node_modules/pretty-format/build/ts3.4/plugins/Immutable.d.ts b/node_modules/pretty-format/build/ts3.4/plugins/Immutable.d.ts index 4bb54b82b..0efba129f 100644 --- a/node_modules/pretty-format/build/ts3.4/plugins/Immutable.d.ts +++ b/node_modules/pretty-format/build/ts3.4/plugins/Immutable.d.ts @@ -1,11 +1,11 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import { NewPlugin } from '../types'; -export declare const serialize: NewPlugin['serialize']; -export declare const test: NewPlugin['test']; -declare const plugin: NewPlugin; -export default plugin; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import { NewPlugin } from '../types'; +export declare const serialize: NewPlugin['serialize']; +export declare const test: NewPlugin['test']; +declare const plugin: NewPlugin; +export default plugin; diff --git a/node_modules/pretty-format/build/ts3.4/plugins/ReactElement.d.ts b/node_modules/pretty-format/build/ts3.4/plugins/ReactElement.d.ts index 4bb54b82b..0efba129f 100644 --- a/node_modules/pretty-format/build/ts3.4/plugins/ReactElement.d.ts +++ b/node_modules/pretty-format/build/ts3.4/plugins/ReactElement.d.ts @@ -1,11 +1,11 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import { NewPlugin } from '../types'; -export declare const serialize: NewPlugin['serialize']; -export declare const test: NewPlugin['test']; -declare const plugin: NewPlugin; -export default plugin; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import { NewPlugin } from '../types'; +export declare const serialize: NewPlugin['serialize']; +export declare const test: NewPlugin['test']; +declare const plugin: NewPlugin; +export default plugin; diff --git a/node_modules/pretty-format/build/ts3.4/plugins/ReactTestComponent.d.ts b/node_modules/pretty-format/build/ts3.4/plugins/ReactTestComponent.d.ts index 2769bc2d2..607c345ee 100644 --- a/node_modules/pretty-format/build/ts3.4/plugins/ReactTestComponent.d.ts +++ b/node_modules/pretty-format/build/ts3.4/plugins/ReactTestComponent.d.ts @@ -1,18 +1,18 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import { NewPlugin } from '../types'; -export declare type ReactTestObject = { - $$typeof: symbol; - type: string; - props?: Record; - children?: null | Array; -}; -declare type ReactTestChild = ReactTestObject | string | number; -export declare const serialize: NewPlugin['serialize']; -export declare const test: NewPlugin['test']; -declare const plugin: NewPlugin; -export default plugin; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import { NewPlugin } from '../types'; +export declare type ReactTestObject = { + $$typeof: symbol; + type: string; + props?: Record; + children?: null | Array; +}; +declare type ReactTestChild = ReactTestObject | string | number; +export declare const serialize: NewPlugin['serialize']; +export declare const test: NewPlugin['test']; +declare const plugin: NewPlugin; +export default plugin; diff --git a/node_modules/pretty-format/build/ts3.4/plugins/lib/escapeHTML.d.ts b/node_modules/pretty-format/build/ts3.4/plugins/lib/escapeHTML.d.ts index aee0d3d06..a71db71c9 100644 --- a/node_modules/pretty-format/build/ts3.4/plugins/lib/escapeHTML.d.ts +++ b/node_modules/pretty-format/build/ts3.4/plugins/lib/escapeHTML.d.ts @@ -1,7 +1,7 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -export default function escapeHTML(str: string): string; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +export default function escapeHTML(str: string): string; diff --git a/node_modules/pretty-format/build/ts3.4/plugins/lib/markup.d.ts b/node_modules/pretty-format/build/ts3.4/plugins/lib/markup.d.ts index 6945f1ad8..a547abba1 100644 --- a/node_modules/pretty-format/build/ts3.4/plugins/lib/markup.d.ts +++ b/node_modules/pretty-format/build/ts3.4/plugins/lib/markup.d.ts @@ -1,13 +1,13 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import { Config, Printer, Refs } from '../../types'; -export declare const printProps: (keys: string[], props: Record, config: Config, indentation: string, depth: number, refs: Refs, printer: Printer) => string; -export declare const printChildren: (children: any[], config: Config, indentation: string, depth: number, refs: Refs, printer: Printer) => string; -export declare const printText: (text: string, config: Config) => string; -export declare const printComment: (comment: string, config: Config) => string; -export declare const printElement: (type: string, printedProps: string, printedChildren: string, config: Config, indentation: string) => string; -export declare const printElementAsLeaf: (type: string, config: Config) => string; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import { Config, Printer, Refs } from '../../types'; +export declare const printProps: (keys: string[], props: Record, config: Config, indentation: string, depth: number, refs: Refs, printer: Printer) => string; +export declare const printChildren: (children: any[], config: Config, indentation: string, depth: number, refs: Refs, printer: Printer) => string; +export declare const printText: (text: string, config: Config) => string; +export declare const printComment: (comment: string, config: Config) => string; +export declare const printElement: (type: string, printedProps: string, printedChildren: string, config: Config, indentation: string) => string; +export declare const printElementAsLeaf: (type: string, config: Config) => string; diff --git a/node_modules/pretty-format/build/ts3.4/types.d.ts b/node_modules/pretty-format/build/ts3.4/types.d.ts index 5f1e06dbd..a201facbc 100644 --- a/node_modules/pretty-format/build/ts3.4/types.d.ts +++ b/node_modules/pretty-format/build/ts3.4/types.d.ts @@ -1,100 +1,100 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -export declare type Colors = { - comment: { - close: string; - open: string; - }; - content: { - close: string; - open: string; - }; - prop: { - close: string; - open: string; - }; - tag: { - close: string; - open: string; - }; - value: { - close: string; - open: string; - }; -}; -declare type Indent = (arg0: string) => string; -export declare type Refs = Array; -declare type Print = (arg0: unknown) => string; -export declare type Theme = { - comment: string; - content: string; - prop: string; - tag: string; - value: string; -}; -declare type ThemeReceived = { - comment?: string; - content?: string; - prop?: string; - tag?: string; - value?: string; -}; -export declare type Options = { - callToJSON: boolean; - escapeRegex: boolean; - escapeString: boolean; - highlight: boolean; - indent: number; - maxDepth: number; - min: boolean; - plugins: Plugins; - printFunctionName: boolean; - theme: Theme; -}; -export declare type OptionsReceived = { - callToJSON?: boolean; - escapeRegex?: boolean; - escapeString?: boolean; - highlight?: boolean; - indent?: number; - maxDepth?: number; - min?: boolean; - plugins?: Plugins; - printFunctionName?: boolean; - theme?: ThemeReceived; -}; -export declare type Config = { - callToJSON: boolean; - colors: Colors; - escapeRegex: boolean; - escapeString: boolean; - indent: string; - maxDepth: number; - min: boolean; - plugins: Plugins; - printFunctionName: boolean; - spacingInner: string; - spacingOuter: string; -}; -export declare type Printer = (val: unknown, config: Config, indentation: string, depth: number, refs: Refs, hasCalledToJSON?: boolean) => string; -declare type Test = (arg0: any) => boolean; -export declare type NewPlugin = { - serialize: (val: any, config: Config, indentation: string, depth: number, refs: Refs, printer: Printer) => string; - test: Test; -}; -declare type PluginOptions = { - edgeSpacing: string; - min: boolean; - spacing: string; -}; -export declare type OldPlugin = { - print: (val: unknown, print: Print, indent: Indent, options: PluginOptions, colors: Colors) => string; - test: Test; -}; -export declare type Plugin = NewPlugin | OldPlugin; -export declare type Plugins = Array; -export {}; +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +export declare type Colors = { + comment: { + close: string; + open: string; + }; + content: { + close: string; + open: string; + }; + prop: { + close: string; + open: string; + }; + tag: { + close: string; + open: string; + }; + value: { + close: string; + open: string; + }; +}; +declare type Indent = (arg0: string) => string; +export declare type Refs = Array; +declare type Print = (arg0: unknown) => string; +export declare type Theme = { + comment: string; + content: string; + prop: string; + tag: string; + value: string; +}; +declare type ThemeReceived = { + comment?: string; + content?: string; + prop?: string; + tag?: string; + value?: string; +}; +export declare type Options = { + callToJSON: boolean; + escapeRegex: boolean; + escapeString: boolean; + highlight: boolean; + indent: number; + maxDepth: number; + min: boolean; + plugins: Plugins; + printFunctionName: boolean; + theme: Theme; +}; +export declare type OptionsReceived = { + callToJSON?: boolean; + escapeRegex?: boolean; + escapeString?: boolean; + highlight?: boolean; + indent?: number; + maxDepth?: number; + min?: boolean; + plugins?: Plugins; + printFunctionName?: boolean; + theme?: ThemeReceived; +}; +export declare type Config = { + callToJSON: boolean; + colors: Colors; + escapeRegex: boolean; + escapeString: boolean; + indent: string; + maxDepth: number; + min: boolean; + plugins: Plugins; + printFunctionName: boolean; + spacingInner: string; + spacingOuter: string; +}; +export declare type Printer = (val: unknown, config: Config, indentation: string, depth: number, refs: Refs, hasCalledToJSON?: boolean) => string; +declare type Test = (arg0: any) => boolean; +export declare type NewPlugin = { + serialize: (val: any, config: Config, indentation: string, depth: number, refs: Refs, printer: Printer) => string; + test: Test; +}; +declare type PluginOptions = { + edgeSpacing: string; + min: boolean; + spacing: string; +}; +export declare type OldPlugin = { + print: (val: unknown, print: Print, indent: Indent, options: PluginOptions, colors: Colors) => string; + test: Test; +}; +export declare type Plugin = NewPlugin | OldPlugin; +export declare type Plugins = Array; +export {}; diff --git a/node_modules/process-nextick-args/package.json b/node_modules/process-nextick-args/package.json index fa573c50b..6070b723f 100644 --- a/node_modules/process-nextick-args/package.json +++ b/node_modules/process-nextick-args/package.json @@ -22,8 +22,4 @@ "devDependencies": { "tap": "~0.2.6" } - -,"_resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz" -,"_integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" -,"_from": "process-nextick-args@2.0.1" -} \ No newline at end of file +} diff --git a/node_modules/process/package.json b/node_modules/process/package.json index 234b66489..d2cfaade4 100644 --- a/node_modules/process/package.json +++ b/node_modules/process/package.json @@ -24,8 +24,4 @@ "mocha": "2.2.1", "zuul": "^3.10.3" } - -,"_resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz" -,"_integrity": "sha1-czIwDoQBYb2j5podHZGn1LwW8YI=" -,"_from": "process@0.11.10" -} \ No newline at end of file +} diff --git a/node_modules/prompts/readme.md b/node_modules/prompts/readme.md old mode 100644 new mode 100755 diff --git a/node_modules/q/package.json b/node_modules/q/package.json index 5c6a66a2e..8c3b5fe37 100644 --- a/node_modules/q/package.json +++ b/node_modules/q/package.json @@ -73,8 +73,4 @@ "directories": { "test": "./spec" } - -,"_resolved": "https://registry.npmjs.org/q/-/q-1.5.1.tgz" -,"_integrity": "sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc=" -,"_from": "q@1.5.1" -} \ No newline at end of file +} diff --git a/node_modules/querystring/Readme.md b/node_modules/querystring/Readme.md deleted file mode 100644 index 6cdc6929d..000000000 --- a/node_modules/querystring/Readme.md +++ /dev/null @@ -1,22 +0,0 @@ -# querystring - -[![NPM](https://img.shields.io/npm/v/querystring.svg)](https://npm.im/querystring) -[![gzip](https://badgen.net/bundlephobia/minzip/querystring@latest)](https://bundlephobia.com/result?p=querystring@latest) - -Node's querystring module for all engines. - -_If you want to help with evolution of this package, please see https://github.com/Gozala/querystring/issues/20 PR's welcome!_ - -## 🔧 Install - -```sh -npm i querystring -``` - -## 📖 Documentation - -Refer to [Node's documentation for `querystring`](https://nodejs.org/api/querystring.html). - -## 📜 License - -MIT © [Gozala](https://github.com/Gozala) diff --git a/node_modules/querystring/package.json b/node_modules/querystring/package.json index f8e4a1f0b..cec6f26be 100644 --- a/node_modules/querystring/package.json +++ b/node_modules/querystring/package.json @@ -1,64 +1,35 @@ { - "_from": "querystring@^0.2.0", - "_id": "querystring@0.2.1", - "_inBundle": false, - "_integrity": "sha512-wkvS7mL/JMugcup3/rMitHmd9ecIGd2lhFhK9N3UUQ450h66d1r3Y9nvXzQAW1Lq+wyx61k/1pfKS5KuKiyEbg==", - "_location": "/querystring", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "querystring@^0.2.0", - "name": "querystring", - "escapedName": "querystring", - "rawSpec": "^0.2.0", - "saveSpec": null, - "fetchSpec": "^0.2.0" - }, - "_requiredBy": [ - "/azure-actions-webclient" - ], - "_resolved": "https://registry.npmjs.org/querystring/-/querystring-0.2.1.tgz", - "_shasum": "40d77615bb09d16902a85c3e38aa8b5ed761c2dd", - "_spec": "querystring@^0.2.0", - "_where": "E:\\Repos\\GHActions\\webapps-deploy\\node_modules\\azure-actions-webclient", - "author": { - "name": "Irakli Gozalishvili", - "email": "rfobic@gmail.com" - }, - "bugs": { - "url": "http://github.com/Gozala/querystring/issues/" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Node's querystring module for all engines.", - "devDependencies": { - "retape": "~0.x.0", - "tape": "~0.1.5", - "test": "~0.x.0" - }, - "engines": { - "node": ">=0.4.x" - }, - "homepage": "https://github.com/Gozala/querystring#readme", + "name": "querystring", "id": "querystring", + "version": "0.2.1", + "description": "Node's querystring module for all engines.", "keywords": [ "commonjs", "query", "querystring" ], - "license": "MIT", + "author": "Irakli Gozalishvili ", "main": "index.js", - "name": "querystring", "repository": { "type": "git", "url": "git://github.com/Gozala/querystring.git", "web": "https://github.com/Gozala/querystring" }, + "bugs": { + "url": "http://github.com/Gozala/querystring/issues/" + }, + "devDependencies": { + "test": "~0.x.0", + "retape": "~0.x.0", + "tape": "~0.1.5" + }, + "engines": { + "node": ">=0.4.x" + }, "scripts": { "test": "npm run test-node && npm run test-tap", "test-node": "node ./test/common-index.js", "test-tap": "node ./test/tap-index.js" }, - "version": "0.2.1" + "license": "MIT" } diff --git a/node_modules/readable-stream/node_modules/safe-buffer/package.json b/node_modules/readable-stream/node_modules/safe-buffer/package.json index 9c8aef798..623fbc3f6 100644 --- a/node_modules/readable-stream/node_modules/safe-buffer/package.json +++ b/node_modules/readable-stream/node_modules/safe-buffer/package.json @@ -34,8 +34,4 @@ "scripts": { "test": "standard && tape test/*.js" } - -,"_resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz" -,"_integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" -,"_from": "safe-buffer@5.1.2" -} \ No newline at end of file +} diff --git a/node_modules/readable-stream/package.json b/node_modules/readable-stream/package.json index b2ad46c72..dbb1da6be 100644 --- a/node_modules/readable-stream/package.json +++ b/node_modules/readable-stream/package.json @@ -49,8 +49,4 @@ ] }, "license": "MIT" - -,"_resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz" -,"_integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==" -,"_from": "readable-stream@2.3.6" -} \ No newline at end of file +} diff --git a/node_modules/remove-trailing-separator/package.json b/node_modules/remove-trailing-separator/package.json index ff09aabe4..47ef27a2e 100644 --- a/node_modules/remove-trailing-separator/package.json +++ b/node_modules/remove-trailing-separator/package.json @@ -34,8 +34,4 @@ "nyc": "^8.3.0", "xo": "^0.16.0" } - -,"_resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz" -,"_integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=" -,"_from": "remove-trailing-separator@1.1.0" -} \ No newline at end of file +} diff --git a/node_modules/request/index.js b/node_modules/request/index.js old mode 100644 new mode 100755 diff --git a/node_modules/resolve-url/.jshintrc b/node_modules/resolve-url/.jshintrc index 8703acd7f..aaf335801 100644 --- a/node_modules/resolve-url/.jshintrc +++ b/node_modules/resolve-url/.jshintrc @@ -1,44 +1,44 @@ -{ - "bitwise": true, - "camelcase": true, - "curly": false, - "eqeqeq": true, - "es3": true, - "forin": true, - "immed": false, - "indent": false, - "latedef": "nofunc", - "newcap": false, - "noarg": true, - "noempty": true, - "nonew": false, - "plusplus": false, - "quotmark": false, - "undef": true, - "unused": "vars", - "strict": false, - "trailing": true, - "maxparams": 5, - "maxdepth": false, - "maxstatements": false, - "maxcomplexity": false, - "maxlen": 100, - - "asi": true, - "expr": true, - "globalstrict": true, - "smarttabs": true, - "sub": true, - - "node": true, - "browser": true, - "globals": { - "describe": false, - "it": false, - "before": false, - "beforeEach": false, - "after": false, - "afterEach": false, - "define": false - } -} +{ + "bitwise": true, + "camelcase": true, + "curly": false, + "eqeqeq": true, + "es3": true, + "forin": true, + "immed": false, + "indent": false, + "latedef": "nofunc", + "newcap": false, + "noarg": true, + "noempty": true, + "nonew": false, + "plusplus": false, + "quotmark": false, + "undef": true, + "unused": "vars", + "strict": false, + "trailing": true, + "maxparams": 5, + "maxdepth": false, + "maxstatements": false, + "maxcomplexity": false, + "maxlen": 100, + + "asi": true, + "expr": true, + "globalstrict": true, + "smarttabs": true, + "sub": true, + + "node": true, + "browser": true, + "globals": { + "describe": false, + "it": false, + "before": false, + "beforeEach": false, + "after": false, + "afterEach": false, + "define": false + } +} diff --git a/node_modules/resolve-url/readme.md b/node_modules/resolve-url/readme.md index 1f864e8de..edfff7357 100644 --- a/node_modules/resolve-url/readme.md +++ b/node_modules/resolve-url/readme.md @@ -1,83 +1,83 @@ -Overview -======== - -[![browser support](https://ci.testling.com/lydell/resolve-url.png)](https://ci.testling.com/lydell/resolve-url) - -Like Node.js’ [`path.resolve`]/[`url.resolve`] for the browser. - -```js -var resolveUrl = require("resolve-url") - -window.location -// https://example.com/articles/resolving-urls/edit - -resolveUrl("remove") -// https://example.com/articles/resolving-urls/remove - -resolveUrl("/static/scripts/app.js") -// https://example.com/static/scripts/app.js - -// Imagine /static/scripts/app.js contains `//# sourceMappingURL=../source-maps/app.js.map` -resolveUrl("/static/scripts/app.js", "../source-maps/app.js.map") -// https://example.com/static/source-maps/app.js.map - -resolveUrl("/static/scripts/app.js", "../source-maps/app.js.map", "../coffee/app.coffee") -// https://example.com/static/coffee/app.coffee - -resolveUrl("//cdn.example.com/jquery.js") -// https://cdn.example.com/jquery.js - -resolveUrl("http://foo.org/") -// http://foo.org/ -``` - - -Installation -============ - -- `npm install resolve-url` -- `bower install resolve-url` -- `component install lydell/resolve-url` - -Works with CommonJS, AMD and browser globals, through UMD. - - -Usage -===== - -### `resolveUrl(...urls)` ### - -Pass one or more urls. Resolves the last one to an absolute url, using the -previous ones and `window.location`. - -It’s like starting out on `window.location`, and then clicking links with the -urls as `href` attributes in order, from left to right. - -Unlike Node.js’ [`path.resolve`], this function always goes through all of the -arguments, from left to right. `path.resolve` goes from right to left and only -in the worst case goes through them all. Should that matter. - -Actually, the function is _really_ like clicking a lot of links in series: An -actual `` gets its `href` attribute set for each url! This means that the -url resolution of the browser is used, which makes this module really -light-weight. - -Also note that this functions deals with urls, not paths, so in that respect it -has more in common with Node.js’ [`url.resolve`]. But the arguments are more -like [`path.resolve`]. - -[`path.resolve`]: http://nodejs.org/api/path.html#path_path_resolve_from_to -[`url.resolve`]: http://nodejs.org/api/url.html#url_url_resolve_from_to - - -Tests -===== - -Run `npm test`, which lints the code and then gives you a link to open in a -browser of choice (using `testling`). - - -License -======= - -[The X11 (“MIT”) License](LICENSE). +Overview +======== + +[![browser support](https://ci.testling.com/lydell/resolve-url.png)](https://ci.testling.com/lydell/resolve-url) + +Like Node.js’ [`path.resolve`]/[`url.resolve`] for the browser. + +```js +var resolveUrl = require("resolve-url") + +window.location +// https://example.com/articles/resolving-urls/edit + +resolveUrl("remove") +// https://example.com/articles/resolving-urls/remove + +resolveUrl("/static/scripts/app.js") +// https://example.com/static/scripts/app.js + +// Imagine /static/scripts/app.js contains `//# sourceMappingURL=../source-maps/app.js.map` +resolveUrl("/static/scripts/app.js", "../source-maps/app.js.map") +// https://example.com/static/source-maps/app.js.map + +resolveUrl("/static/scripts/app.js", "../source-maps/app.js.map", "../coffee/app.coffee") +// https://example.com/static/coffee/app.coffee + +resolveUrl("//cdn.example.com/jquery.js") +// https://cdn.example.com/jquery.js + +resolveUrl("http://foo.org/") +// http://foo.org/ +``` + + +Installation +============ + +- `npm install resolve-url` +- `bower install resolve-url` +- `component install lydell/resolve-url` + +Works with CommonJS, AMD and browser globals, through UMD. + + +Usage +===== + +### `resolveUrl(...urls)` ### + +Pass one or more urls. Resolves the last one to an absolute url, using the +previous ones and `window.location`. + +It’s like starting out on `window.location`, and then clicking links with the +urls as `href` attributes in order, from left to right. + +Unlike Node.js’ [`path.resolve`], this function always goes through all of the +arguments, from left to right. `path.resolve` goes from right to left and only +in the worst case goes through them all. Should that matter. + +Actually, the function is _really_ like clicking a lot of links in series: An +actual `` gets its `href` attribute set for each url! This means that the +url resolution of the browser is used, which makes this module really +light-weight. + +Also note that this functions deals with urls, not paths, so in that respect it +has more in common with Node.js’ [`url.resolve`]. But the arguments are more +like [`path.resolve`]. + +[`path.resolve`]: http://nodejs.org/api/path.html#path_path_resolve_from_to +[`url.resolve`]: http://nodejs.org/api/url.html#url_url_resolve_from_to + + +Tests +===== + +Run `npm test`, which lints the code and then gives you a link to open in a +browser of choice (using `testling`). + + +License +======= + +[The X11 (“MIT”) License](LICENSE). diff --git a/node_modules/resolve-url/resolve-url.js b/node_modules/resolve-url/resolve-url.js index dc5c5b7b8..19e8d040e 100644 --- a/node_modules/resolve-url/resolve-url.js +++ b/node_modules/resolve-url/resolve-url.js @@ -1,47 +1,47 @@ -// Copyright 2014 Simon Lydell -// X11 (“MIT”) Licensed. (See LICENSE.) - -void (function(root, factory) { - if (typeof define === "function" && define.amd) { - define(factory) - } else if (typeof exports === "object") { - module.exports = factory() - } else { - root.resolveUrl = factory() - } -}(this, function() { - - function resolveUrl(/* ...urls */) { - var numUrls = arguments.length - - if (numUrls === 0) { - throw new Error("resolveUrl requires at least one argument; got none.") - } - - var base = document.createElement("base") - base.href = arguments[0] - - if (numUrls === 1) { - return base.href - } - - var head = document.getElementsByTagName("head")[0] - head.insertBefore(base, head.firstChild) - - var a = document.createElement("a") - var resolved - - for (var index = 1; index < numUrls; index++) { - a.href = arguments[index] - resolved = a.href - base.href = resolved - } - - head.removeChild(base) - - return resolved - } - - return resolveUrl - -})); +// Copyright 2014 Simon Lydell +// X11 (“MIT”) Licensed. (See LICENSE.) + +void (function(root, factory) { + if (typeof define === "function" && define.amd) { + define(factory) + } else if (typeof exports === "object") { + module.exports = factory() + } else { + root.resolveUrl = factory() + } +}(this, function() { + + function resolveUrl(/* ...urls */) { + var numUrls = arguments.length + + if (numUrls === 0) { + throw new Error("resolveUrl requires at least one argument; got none.") + } + + var base = document.createElement("base") + base.href = arguments[0] + + if (numUrls === 1) { + return base.href + } + + var head = document.getElementsByTagName("head")[0] + head.insertBefore(base, head.firstChild) + + var a = document.createElement("a") + var resolved + + for (var index = 1; index < numUrls; index++) { + a.href = arguments[index] + resolved = a.href + base.href = resolved + } + + head.removeChild(base) + + return resolved + } + + return resolveUrl + +})); diff --git a/node_modules/resolve-url/test/resolve-url.js b/node_modules/resolve-url/test/resolve-url.js index 7f135a7cd..18532edd3 100644 --- a/node_modules/resolve-url/test/resolve-url.js +++ b/node_modules/resolve-url/test/resolve-url.js @@ -1,70 +1,70 @@ -// Copyright 2014 Simon Lydell -// X11 (“MIT”) Licensed. (See LICENSE.) - -var test = require("tape") - -var resolveUrl = require("../") - -"use strict" - -test("resolveUrl", function(t) { - - t.plan(7) - - t.equal(typeof resolveUrl, "function", "is a function") - - t.equal( - resolveUrl("https://example.com/"), - "https://example.com/" - ) - - var loc = "https://example.com/articles/resolving-urls/edit" - - t.equal( - resolveUrl(loc, "remove"), - "https://example.com/articles/resolving-urls/remove" - ) - - t.equal( - resolveUrl(loc, "/static/scripts/app.js"), - "https://example.com/static/scripts/app.js" - ) - - t.equal( - resolveUrl(loc, "/static/scripts/app.js", "../source-maps/app.js.map"), - "https://example.com/static/source-maps/app.js.map" - ) - - t.equal( - resolveUrl(loc, "/static/scripts/app.js", "../source-maps/app.js.map", "../coffee/app.coffee"), - "https://example.com/static/coffee/app.coffee" - ) - - t.equal( - resolveUrl(loc, "//cdn.example.com/jquery.js"), - "https://cdn.example.com/jquery.js" - ) - -}) - -test("edge cases", function(t) { - - t.plan(4) - - t["throws"](resolveUrl, /at least one argument/, "throws with no arguments") - - var accidentallyUndefined - var result - t.doesNotThrow( - function() { result = resolveUrl(accidentallyUndefined) }, - "undefined is still an argument" - ) - t.ok(result.match(/\/undefined$/), "undefined is stringified") - - t.equal( - resolveUrl("http://foo.org/test", undefined, {}, ["a/b"], null), - "http://foo.org/a/null", - "arguments are stringified" - ) - -}) +// Copyright 2014 Simon Lydell +// X11 (“MIT”) Licensed. (See LICENSE.) + +var test = require("tape") + +var resolveUrl = require("../") + +"use strict" + +test("resolveUrl", function(t) { + + t.plan(7) + + t.equal(typeof resolveUrl, "function", "is a function") + + t.equal( + resolveUrl("https://example.com/"), + "https://example.com/" + ) + + var loc = "https://example.com/articles/resolving-urls/edit" + + t.equal( + resolveUrl(loc, "remove"), + "https://example.com/articles/resolving-urls/remove" + ) + + t.equal( + resolveUrl(loc, "/static/scripts/app.js"), + "https://example.com/static/scripts/app.js" + ) + + t.equal( + resolveUrl(loc, "/static/scripts/app.js", "../source-maps/app.js.map"), + "https://example.com/static/source-maps/app.js.map" + ) + + t.equal( + resolveUrl(loc, "/static/scripts/app.js", "../source-maps/app.js.map", "../coffee/app.coffee"), + "https://example.com/static/coffee/app.coffee" + ) + + t.equal( + resolveUrl(loc, "//cdn.example.com/jquery.js"), + "https://cdn.example.com/jquery.js" + ) + +}) + +test("edge cases", function(t) { + + t.plan(4) + + t["throws"](resolveUrl, /at least one argument/, "throws with no arguments") + + var accidentallyUndefined + var result + t.doesNotThrow( + function() { result = resolveUrl(accidentallyUndefined) }, + "undefined is still an argument" + ) + t.ok(result.match(/\/undefined$/), "undefined is stringified") + + t.equal( + resolveUrl("http://foo.org/test", undefined, {}, ["a/b"], null), + "http://foo.org/a/null", + "arguments are stringified" + ) + +}) diff --git a/node_modules/resolve/bin/resolve b/node_modules/resolve/bin/resolve deleted file mode 100755 index 5ee329af9..000000000 --- a/node_modules/resolve/bin/resolve +++ /dev/null @@ -1,50 +0,0 @@ -#!/usr/bin/env node - -'use strict'; - -var path = require('path'); -var fs = require('fs'); - -if ( - String(process.env.npm_lifecycle_script).slice(0, 8) !== 'resolve ' - && ( - !process.argv - || process.argv.length < 2 - || (process.argv[1] !== __filename && fs.statSync(process.argv[1]).ino !== fs.statSync(__filename).ino) - || (process.env._ && path.resolve(process.env._) !== __filename) - ) -) { - console.error('Error: `resolve` must be run directly as an executable'); - process.exit(1); -} - -var supportsPreserveSymlinkFlag = require('supports-preserve-symlinks-flag'); - -var preserveSymlinks = false; -for (var i = 2; i < process.argv.length; i += 1) { - if (process.argv[i].slice(0, 2) === '--') { - if (supportsPreserveSymlinkFlag && process.argv[i] === '--preserve-symlinks') { - preserveSymlinks = true; - } else if (process.argv[i].length > 2) { - console.error('Unknown argument ' + process.argv[i].replace(/[=].*$/, '')); - process.exit(2); - } - process.argv.splice(i, 1); - i -= 1; - if (process.argv[i] === '--') { break; } // eslint-disable-line no-restricted-syntax - } -} - -if (process.argv.length < 3) { - console.error('Error: `resolve` expects a specifier'); - process.exit(2); -} - -var resolve = require('../'); - -var result = resolve.sync(process.argv[2], { - basedir: process.cwd(), - preserveSymlinks: preserveSymlinks -}); - -console.log(result); diff --git a/node_modules/rimraf/bin.js b/node_modules/rimraf/bin.js old mode 100644 new mode 100755 diff --git a/node_modules/safe-buffer/package.json b/node_modules/safe-buffer/package.json index 29fbfe191..d532dafb3 100644 --- a/node_modules/safe-buffer/package.json +++ b/node_modules/safe-buffer/package.json @@ -34,8 +34,4 @@ "scripts": { "test": "standard && tape test/*.js" } - -,"_resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.0.tgz" -,"_integrity": "sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg==" -,"_from": "safe-buffer@5.2.0" -} \ No newline at end of file +} diff --git a/node_modules/sane/index.js b/node_modules/sane/index.js old mode 100644 new mode 100755 diff --git a/node_modules/sane/node_modules/micromatch/LICENSE b/node_modules/sane/node_modules/micromatch/LICENSE old mode 100644 new mode 100755 diff --git a/node_modules/sane/src/cli.js b/node_modules/sane/src/cli.js old mode 100644 new mode 100755 diff --git a/node_modules/sax/package.json b/node_modules/sax/package.json index 5407f5c76..d2039bf3a 100644 --- a/node_modules/sax/package.json +++ b/node_modules/sax/package.json @@ -22,8 +22,4 @@ "standard": "^8.6.0", "tap": "^10.5.1" } - -,"_resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz" -,"_integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==" -,"_from": "sax@1.2.4" -} \ No newline at end of file +} diff --git a/node_modules/semver/bin/semver.js b/node_modules/semver/bin/semver.js old mode 100644 new mode 100755 diff --git a/node_modules/shelljs/bin/shjs b/node_modules/shelljs/bin/shjs old mode 100644 new mode 100755 diff --git a/node_modules/shelljs/scripts/generate-docs.js b/node_modules/shelljs/scripts/generate-docs.js old mode 100644 new mode 100755 diff --git a/node_modules/shelljs/scripts/run-tests.js b/node_modules/shelljs/scripts/run-tests.js old mode 100644 new mode 100755 diff --git a/node_modules/sisteransi/package.json b/node_modules/sisteransi/package.json old mode 100644 new mode 100755 diff --git a/node_modules/sisteransi/readme.md b/node_modules/sisteransi/readme.md old mode 100644 new mode 100755 diff --git a/node_modules/source-map/package.json b/node_modules/source-map/package.json index fb225f899..24663417e 100644 --- a/node_modules/source-map/package.json +++ b/node_modules/source-map/package.json @@ -70,8 +70,4 @@ "webpack": "^1.12.0" }, "typings": "source-map" - -,"_resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz" -,"_integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==" -,"_from": "source-map@0.6.1" -} \ No newline at end of file +} diff --git a/node_modules/sshpk/bin/sshpk-conv b/node_modules/sshpk/bin/sshpk-conv old mode 100644 new mode 100755 diff --git a/node_modules/sshpk/bin/sshpk-sign b/node_modules/sshpk/bin/sshpk-sign old mode 100644 new mode 100755 diff --git a/node_modules/sshpk/bin/sshpk-verify b/node_modules/sshpk/bin/sshpk-verify old mode 100644 new mode 100755 diff --git a/node_modules/static-eval/package.json b/node_modules/static-eval/package.json index 8170ce0f0..3c3471e76 100644 --- a/node_modules/static-eval/package.json +++ b/node_modules/static-eval/package.json @@ -45,8 +45,4 @@ "url": "http://substack.net" }, "license": "MIT" - -,"_resolved": "https://registry.npmjs.org/static-eval/-/static-eval-2.0.2.tgz" -,"_integrity": "sha512-N/D219Hcr2bPjLxPiV+TQE++Tsmrady7TqAJugLy7Xk1EumfDWS/f5dtBbkRCGE7wKKXuYockQoj8Rm2/pVKyg==" -,"_from": "static-eval@2.0.2" -} \ No newline at end of file +} diff --git a/node_modules/string_decoder/node_modules/safe-buffer/package.json b/node_modules/string_decoder/node_modules/safe-buffer/package.json index 9c8aef798..623fbc3f6 100644 --- a/node_modules/string_decoder/node_modules/safe-buffer/package.json +++ b/node_modules/string_decoder/node_modules/safe-buffer/package.json @@ -34,8 +34,4 @@ "scripts": { "test": "standard && tape test/*.js" } - -,"_resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz" -,"_integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" -,"_from": "safe-buffer@5.1.2" -} \ No newline at end of file +} diff --git a/node_modules/string_decoder/package.json b/node_modules/string_decoder/package.json index 197f1942b..518c3eb9f 100644 --- a/node_modules/string_decoder/package.json +++ b/node_modules/string_decoder/package.json @@ -28,8 +28,4 @@ "browserify" ], "license": "MIT" - -,"_resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz" -,"_integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==" -,"_from": "string_decoder@1.1.1" -} \ No newline at end of file +} diff --git a/node_modules/tar-stream/package.json b/node_modules/tar-stream/package.json index 5cdd3ad87..e15eb270b 100644 --- a/node_modules/tar-stream/package.json +++ b/node_modules/tar-stream/package.json @@ -57,8 +57,4 @@ "type": "git", "url": "git+https://github.com/mafintosh/tar-stream.git" } - -,"_resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-1.6.2.tgz" -,"_integrity": "sha512-rzS0heiNf8Xn7/mpdSVVSMAWAoy9bfb1WOTYC78Z0UQKeKa/CWS8FOq0lKGNa8DWKAn9gxjCvMLYc5PGXYlK2A==" -,"_from": "tar-stream@1.6.2" -} \ No newline at end of file +} diff --git a/node_modules/to-buffer/package.json b/node_modules/to-buffer/package.json index 3fb0b66bc..fdc9c615e 100644 --- a/node_modules/to-buffer/package.json +++ b/node_modules/to-buffer/package.json @@ -21,8 +21,4 @@ "url": "https://github.com/mafintosh/to-buffer/issues" }, "homepage": "https://github.com/mafintosh/to-buffer" - -,"_resolved": "https://registry.npmjs.org/to-buffer/-/to-buffer-1.1.1.tgz" -,"_integrity": "sha512-lx9B5iv7msuFYE3dytT+KE5tap+rNYw+K4jVkb9R/asAb+pbBSM17jtunHplhBe6RRJdZx3Pn2Jph24O32mOVg==" -,"_from": "to-buffer@1.1.1" -} \ No newline at end of file +} diff --git a/node_modules/touch/node_modules/.bin/nopt b/node_modules/touch/node_modules/.bin/nopt deleted file mode 100644 index f1ec43bc2..000000000 --- a/node_modules/touch/node_modules/.bin/nopt +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") - -case `uname` in - *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;; -esac - -if [ -x "$basedir/node" ]; then - exec "$basedir/node" "$basedir/../nopt/bin/nopt.js" "$@" -else - exec node "$basedir/../nopt/bin/nopt.js" "$@" -fi diff --git a/node_modules/touch/node_modules/.bin/nopt b/node_modules/touch/node_modules/.bin/nopt new file mode 120000 index 000000000..6b6566ea7 --- /dev/null +++ b/node_modules/touch/node_modules/.bin/nopt @@ -0,0 +1 @@ +../nopt/bin/nopt.js \ No newline at end of file diff --git a/node_modules/touch/node_modules/.bin/nopt.cmd b/node_modules/touch/node_modules/.bin/nopt.cmd deleted file mode 100644 index a7f38b3da..000000000 --- a/node_modules/touch/node_modules/.bin/nopt.cmd +++ /dev/null @@ -1,17 +0,0 @@ -@ECHO off -GOTO start -:find_dp0 -SET dp0=%~dp0 -EXIT /b -:start -SETLOCAL -CALL :find_dp0 - -IF EXIST "%dp0%\node.exe" ( - SET "_prog=%dp0%\node.exe" -) ELSE ( - SET "_prog=node" - SET PATHEXT=%PATHEXT:;.JS;=;% -) - -endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\nopt\bin\nopt.js" %* diff --git a/node_modules/touch/node_modules/.bin/nopt.ps1 b/node_modules/touch/node_modules/.bin/nopt.ps1 deleted file mode 100644 index 9d6ba56f6..000000000 --- a/node_modules/touch/node_modules/.bin/nopt.ps1 +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env pwsh -$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent - -$exe="" -if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { - # Fix case when both the Windows and Linux builds of Node - # are installed in the same directory - $exe=".exe" -} -$ret=0 -if (Test-Path "$basedir/node$exe") { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "$basedir/node$exe" "$basedir/../nopt/bin/nopt.js" $args - } else { - & "$basedir/node$exe" "$basedir/../nopt/bin/nopt.js" $args - } - $ret=$LASTEXITCODE -} else { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "node$exe" "$basedir/../nopt/bin/nopt.js" $args - } else { - & "node$exe" "$basedir/../nopt/bin/nopt.js" $args - } - $ret=$LASTEXITCODE -} -exit $ret diff --git a/node_modules/touch/node_modules/nopt/bin/nopt.js b/node_modules/touch/node_modules/nopt/bin/nopt.js old mode 100644 new mode 100755 diff --git a/node_modules/touch/node_modules/nopt/examples/my-program.js b/node_modules/touch/node_modules/nopt/examples/my-program.js old mode 100644 new mode 100755 diff --git a/node_modules/touch/package.json b/node_modules/touch/package.json index e9369c84d..14e4d8c0b 100644 --- a/node_modules/touch/package.json +++ b/node_modules/touch/package.json @@ -12,8 +12,4 @@ "nopt": "~1.0.10" }, "license": "ISC" - -,"_resolved": "https://registry.npmjs.org/touch/-/touch-0.0.3.tgz" -,"_integrity": "sha1-Ua7z1ElXHU8oel2Hyci0kYGg2x0=" -,"_from": "touch@0.0.3" -} \ No newline at end of file +} diff --git a/node_modules/traverse/examples/json.js b/node_modules/traverse/examples/json.js old mode 100644 new mode 100755 diff --git a/node_modules/traverse/examples/leaves.js b/node_modules/traverse/examples/leaves.js old mode 100644 new mode 100755 diff --git a/node_modules/traverse/examples/negative.js b/node_modules/traverse/examples/negative.js old mode 100644 new mode 100755 diff --git a/node_modules/traverse/examples/stringify.js b/node_modules/traverse/examples/stringify.js old mode 100644 new mode 100755 diff --git a/node_modules/traverse/index.js b/node_modules/traverse/index.js old mode 100644 new mode 100755 diff --git a/node_modules/traverse/package.json b/node_modules/traverse/package.json index 6efa9fd23..5ab3fc61c 100644 --- a/node_modules/traverse/package.json +++ b/node_modules/traverse/package.json @@ -15,8 +15,4 @@ "scripts" : { "test" : "expresso" } - -,"_resolved": "https://registry.npmjs.org/traverse/-/traverse-0.3.9.tgz" -,"_integrity": "sha1-cXuPIgzAu3tE5AUUwisui7xw2Lk=" -,"_from": "traverse@0.3.9" -} \ No newline at end of file +} diff --git a/node_modules/ts-jest/cli.js b/node_modules/ts-jest/cli.js old mode 100644 new mode 100755 diff --git a/node_modules/ts-node/dist/bin-script-deprecated.js b/node_modules/ts-node/dist/bin-script-deprecated.js old mode 100644 new mode 100755 diff --git a/node_modules/ts-node/dist/bin-script.js b/node_modules/ts-node/dist/bin-script.js old mode 100644 new mode 100755 diff --git a/node_modules/ts-node/dist/bin-transpile.js b/node_modules/ts-node/dist/bin-transpile.js old mode 100644 new mode 100755 diff --git a/node_modules/ts-node/dist/bin.js b/node_modules/ts-node/dist/bin.js old mode 100644 new mode 100755 diff --git a/node_modules/type-check/package.json b/node_modules/type-check/package.json index 156d9e3c8..8c0b0213f 100644 --- a/node_modules/type-check/package.json +++ b/node_modules/type-check/package.json @@ -37,8 +37,4 @@ "istanbul": "~0.4.1", "browserify": "~12.0.1" } - -,"_resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz" -,"_integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=" -,"_from": "type-check@0.3.2" -} \ No newline at end of file +} diff --git a/node_modules/typed-rest-client/Handlers.d.ts b/node_modules/typed-rest-client/Handlers.d.ts index 780935d1e..370225564 100644 --- a/node_modules/typed-rest-client/Handlers.d.ts +++ b/node_modules/typed-rest-client/Handlers.d.ts @@ -1,4 +1,4 @@ -export { BasicCredentialHandler } from "./handlers/basiccreds"; -export { BearerCredentialHandler } from "./handlers/bearertoken"; -export { NtlmCredentialHandler } from "./handlers/ntlm"; -export { PersonalAccessTokenCredentialHandler } from "./handlers/personalaccesstoken"; +export { BasicCredentialHandler } from "./handlers/basiccreds"; +export { BearerCredentialHandler } from "./handlers/bearertoken"; +export { NtlmCredentialHandler } from "./handlers/ntlm"; +export { PersonalAccessTokenCredentialHandler } from "./handlers/personalaccesstoken"; diff --git a/node_modules/typed-rest-client/Handlers.js b/node_modules/typed-rest-client/Handlers.js index 0b9e040d7..ade3fa966 100644 --- a/node_modules/typed-rest-client/Handlers.js +++ b/node_modules/typed-rest-client/Handlers.js @@ -1,10 +1,10 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var basiccreds_1 = require("./handlers/basiccreds"); -exports.BasicCredentialHandler = basiccreds_1.BasicCredentialHandler; -var bearertoken_1 = require("./handlers/bearertoken"); -exports.BearerCredentialHandler = bearertoken_1.BearerCredentialHandler; -var ntlm_1 = require("./handlers/ntlm"); -exports.NtlmCredentialHandler = ntlm_1.NtlmCredentialHandler; -var personalaccesstoken_1 = require("./handlers/personalaccesstoken"); -exports.PersonalAccessTokenCredentialHandler = personalaccesstoken_1.PersonalAccessTokenCredentialHandler; +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var basiccreds_1 = require("./handlers/basiccreds"); +exports.BasicCredentialHandler = basiccreds_1.BasicCredentialHandler; +var bearertoken_1 = require("./handlers/bearertoken"); +exports.BearerCredentialHandler = bearertoken_1.BearerCredentialHandler; +var ntlm_1 = require("./handlers/ntlm"); +exports.NtlmCredentialHandler = ntlm_1.NtlmCredentialHandler; +var personalaccesstoken_1 = require("./handlers/personalaccesstoken"); +exports.PersonalAccessTokenCredentialHandler = personalaccesstoken_1.PersonalAccessTokenCredentialHandler; diff --git a/node_modules/typed-rest-client/HttpClient.d.ts b/node_modules/typed-rest-client/HttpClient.d.ts index b4909910f..6650d7cb8 100644 --- a/node_modules/typed-rest-client/HttpClient.d.ts +++ b/node_modules/typed-rest-client/HttpClient.d.ts @@ -1,105 +1,105 @@ -/// -import url = require("url"); -import http = require("http"); -import ifm = require('./Interfaces'); -export declare enum HttpCodes { - OK = 200, - MultipleChoices = 300, - MovedPermanently = 301, - ResourceMoved = 302, - SeeOther = 303, - NotModified = 304, - UseProxy = 305, - SwitchProxy = 306, - TemporaryRedirect = 307, - PermanentRedirect = 308, - BadRequest = 400, - Unauthorized = 401, - PaymentRequired = 402, - Forbidden = 403, - NotFound = 404, - MethodNotAllowed = 405, - NotAcceptable = 406, - ProxyAuthenticationRequired = 407, - RequestTimeout = 408, - Conflict = 409, - Gone = 410, - TooManyRequests = 429, - InternalServerError = 500, - NotImplemented = 501, - BadGateway = 502, - ServiceUnavailable = 503, - GatewayTimeout = 504 -} -export declare class HttpClientResponse implements ifm.IHttpClientResponse { - constructor(message: http.IncomingMessage); - message: http.IncomingMessage; - readBody(): Promise; -} -export interface RequestInfo { - options: http.RequestOptions; - parsedUrl: url.Url; - httpModule: any; -} -export declare function isHttps(requestUrl: string): boolean; -export declare class HttpClient implements ifm.IHttpClient { - userAgent: string | null | undefined; - handlers: ifm.IRequestHandler[]; - requestOptions: ifm.IRequestOptions; - private _ignoreSslError; - private _socketTimeout; - private _httpProxy; - private _httpProxyBypassHosts; - private _allowRedirects; - private _allowRedirectDowngrade; - private _maxRedirects; - private _allowRetries; - private _maxRetries; - private _agent; - private _proxyAgent; - private _keepAlive; - private _disposed; - private _certConfig; - private _ca; - private _cert; - private _key; - constructor(userAgent: string | null | undefined, handlers?: ifm.IRequestHandler[], requestOptions?: ifm.IRequestOptions); - options(requestUrl: string, additionalHeaders?: ifm.IHeaders): Promise; - get(requestUrl: string, additionalHeaders?: ifm.IHeaders): Promise; - del(requestUrl: string, additionalHeaders?: ifm.IHeaders): Promise; - post(requestUrl: string, data: string, additionalHeaders?: ifm.IHeaders): Promise; - patch(requestUrl: string, data: string, additionalHeaders?: ifm.IHeaders): Promise; - put(requestUrl: string, data: string, additionalHeaders?: ifm.IHeaders): Promise; - head(requestUrl: string, additionalHeaders?: ifm.IHeaders): Promise; - sendStream(verb: string, requestUrl: string, stream: NodeJS.ReadableStream, additionalHeaders?: ifm.IHeaders): Promise; - /** - * Makes a raw http request. - * All other methods such as get, post, patch, and request ultimately call this. - * Prefer get, del, post and patch - */ - request(verb: string, requestUrl: string, data: string | NodeJS.ReadableStream, headers: ifm.IHeaders): Promise; - /** - * Needs to be called if keepAlive is set to true in request options. - */ - dispose(): void; - /** - * Raw request. - * @param info - * @param data - */ - requestRaw(info: ifm.IRequestInfo, data: string | NodeJS.ReadableStream): Promise; - /** - * Raw request with callback. - * @param info - * @param data - * @param onResult - */ - requestRawWithCallback(info: ifm.IRequestInfo, data: string | NodeJS.ReadableStream, onResult: (err: any, res: ifm.IHttpClientResponse) => void): void; - private _prepareRequest; - private _isPresigned; - private _mergeHeaders; - private _getAgent; - private _getProxy; - private _isMatchInBypassProxyList; - private _performExponentialBackoff; -} +/// +import url = require("url"); +import http = require("http"); +import ifm = require('./Interfaces'); +export declare enum HttpCodes { + OK = 200, + MultipleChoices = 300, + MovedPermanently = 301, + ResourceMoved = 302, + SeeOther = 303, + NotModified = 304, + UseProxy = 305, + SwitchProxy = 306, + TemporaryRedirect = 307, + PermanentRedirect = 308, + BadRequest = 400, + Unauthorized = 401, + PaymentRequired = 402, + Forbidden = 403, + NotFound = 404, + MethodNotAllowed = 405, + NotAcceptable = 406, + ProxyAuthenticationRequired = 407, + RequestTimeout = 408, + Conflict = 409, + Gone = 410, + TooManyRequests = 429, + InternalServerError = 500, + NotImplemented = 501, + BadGateway = 502, + ServiceUnavailable = 503, + GatewayTimeout = 504 +} +export declare class HttpClientResponse implements ifm.IHttpClientResponse { + constructor(message: http.IncomingMessage); + message: http.IncomingMessage; + readBody(): Promise; +} +export interface RequestInfo { + options: http.RequestOptions; + parsedUrl: url.Url; + httpModule: any; +} +export declare function isHttps(requestUrl: string): boolean; +export declare class HttpClient implements ifm.IHttpClient { + userAgent: string | null | undefined; + handlers: ifm.IRequestHandler[]; + requestOptions: ifm.IRequestOptions; + private _ignoreSslError; + private _socketTimeout; + private _httpProxy; + private _httpProxyBypassHosts; + private _allowRedirects; + private _allowRedirectDowngrade; + private _maxRedirects; + private _allowRetries; + private _maxRetries; + private _agent; + private _proxyAgent; + private _keepAlive; + private _disposed; + private _certConfig; + private _ca; + private _cert; + private _key; + constructor(userAgent: string | null | undefined, handlers?: ifm.IRequestHandler[], requestOptions?: ifm.IRequestOptions); + options(requestUrl: string, additionalHeaders?: ifm.IHeaders): Promise; + get(requestUrl: string, additionalHeaders?: ifm.IHeaders): Promise; + del(requestUrl: string, additionalHeaders?: ifm.IHeaders): Promise; + post(requestUrl: string, data: string, additionalHeaders?: ifm.IHeaders): Promise; + patch(requestUrl: string, data: string, additionalHeaders?: ifm.IHeaders): Promise; + put(requestUrl: string, data: string, additionalHeaders?: ifm.IHeaders): Promise; + head(requestUrl: string, additionalHeaders?: ifm.IHeaders): Promise; + sendStream(verb: string, requestUrl: string, stream: NodeJS.ReadableStream, additionalHeaders?: ifm.IHeaders): Promise; + /** + * Makes a raw http request. + * All other methods such as get, post, patch, and request ultimately call this. + * Prefer get, del, post and patch + */ + request(verb: string, requestUrl: string, data: string | NodeJS.ReadableStream, headers: ifm.IHeaders): Promise; + /** + * Needs to be called if keepAlive is set to true in request options. + */ + dispose(): void; + /** + * Raw request. + * @param info + * @param data + */ + requestRaw(info: ifm.IRequestInfo, data: string | NodeJS.ReadableStream): Promise; + /** + * Raw request with callback. + * @param info + * @param data + * @param onResult + */ + requestRawWithCallback(info: ifm.IRequestInfo, data: string | NodeJS.ReadableStream, onResult: (err: any, res: ifm.IHttpClientResponse) => void): void; + private _prepareRequest; + private _isPresigned; + private _mergeHeaders; + private _getAgent; + private _getProxy; + private _isMatchInBypassProxyList; + private _performExponentialBackoff; +} diff --git a/node_modules/typed-rest-client/HttpClient.js b/node_modules/typed-rest-client/HttpClient.js index a6f036276..9da71bf73 100644 --- a/node_modules/typed-rest-client/HttpClient.js +++ b/node_modules/typed-rest-client/HttpClient.js @@ -1,501 +1,501 @@ -"use strict"; -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -Object.defineProperty(exports, "__esModule", { value: true }); -const url = require("url"); -const http = require("http"); -const https = require("https"); -const util = require("./Util"); -let fs; -let tunnel; -var HttpCodes; -(function (HttpCodes) { - HttpCodes[HttpCodes["OK"] = 200] = "OK"; - HttpCodes[HttpCodes["MultipleChoices"] = 300] = "MultipleChoices"; - HttpCodes[HttpCodes["MovedPermanently"] = 301] = "MovedPermanently"; - HttpCodes[HttpCodes["ResourceMoved"] = 302] = "ResourceMoved"; - HttpCodes[HttpCodes["SeeOther"] = 303] = "SeeOther"; - HttpCodes[HttpCodes["NotModified"] = 304] = "NotModified"; - HttpCodes[HttpCodes["UseProxy"] = 305] = "UseProxy"; - HttpCodes[HttpCodes["SwitchProxy"] = 306] = "SwitchProxy"; - HttpCodes[HttpCodes["TemporaryRedirect"] = 307] = "TemporaryRedirect"; - HttpCodes[HttpCodes["PermanentRedirect"] = 308] = "PermanentRedirect"; - HttpCodes[HttpCodes["BadRequest"] = 400] = "BadRequest"; - HttpCodes[HttpCodes["Unauthorized"] = 401] = "Unauthorized"; - HttpCodes[HttpCodes["PaymentRequired"] = 402] = "PaymentRequired"; - HttpCodes[HttpCodes["Forbidden"] = 403] = "Forbidden"; - HttpCodes[HttpCodes["NotFound"] = 404] = "NotFound"; - HttpCodes[HttpCodes["MethodNotAllowed"] = 405] = "MethodNotAllowed"; - HttpCodes[HttpCodes["NotAcceptable"] = 406] = "NotAcceptable"; - HttpCodes[HttpCodes["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired"; - HttpCodes[HttpCodes["RequestTimeout"] = 408] = "RequestTimeout"; - HttpCodes[HttpCodes["Conflict"] = 409] = "Conflict"; - HttpCodes[HttpCodes["Gone"] = 410] = "Gone"; - HttpCodes[HttpCodes["TooManyRequests"] = 429] = "TooManyRequests"; - HttpCodes[HttpCodes["InternalServerError"] = 500] = "InternalServerError"; - HttpCodes[HttpCodes["NotImplemented"] = 501] = "NotImplemented"; - HttpCodes[HttpCodes["BadGateway"] = 502] = "BadGateway"; - HttpCodes[HttpCodes["ServiceUnavailable"] = 503] = "ServiceUnavailable"; - HttpCodes[HttpCodes["GatewayTimeout"] = 504] = "GatewayTimeout"; -})(HttpCodes = exports.HttpCodes || (exports.HttpCodes = {})); -const HttpRedirectCodes = [HttpCodes.MovedPermanently, HttpCodes.ResourceMoved, HttpCodes.SeeOther, HttpCodes.TemporaryRedirect, HttpCodes.PermanentRedirect]; -const HttpResponseRetryCodes = [HttpCodes.BadGateway, HttpCodes.ServiceUnavailable, HttpCodes.GatewayTimeout]; -const NetworkRetryErrors = ['ECONNRESET', 'ENOTFOUND', 'ESOCKETTIMEDOUT', 'ETIMEDOUT', 'ECONNREFUSED']; -const RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD']; -const ExponentialBackoffCeiling = 10; -const ExponentialBackoffTimeSlice = 5; -class HttpClientResponse { - constructor(message) { - this.message = message; - } - readBody() { - return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let buffer = Buffer.alloc(0); - const encodingCharset = util.obtainContentCharset(this); - // Extract Encoding from header: 'content-encoding' - // Match `gzip`, `gzip, deflate` variations of GZIP encoding - const contentEncoding = this.message.headers['content-encoding'] || ''; - const isGzippedEncoded = new RegExp('(gzip$)|(gzip, *deflate)').test(contentEncoding); - this.message.on('data', function (data) { - const chunk = (typeof data === 'string') ? Buffer.from(data, encodingCharset) : data; - buffer = Buffer.concat([buffer, chunk]); - }).on('end', function () { - return __awaiter(this, void 0, void 0, function* () { - if (isGzippedEncoded) { // Process GZipped Response Body HERE - const gunzippedBody = yield util.decompressGzippedContent(buffer, encodingCharset); - resolve(gunzippedBody); - } - else { - resolve(buffer.toString(encodingCharset)); - } - }); - }).on('error', function (err) { - reject(err); - }); - })); - } -} -exports.HttpClientResponse = HttpClientResponse; -function isHttps(requestUrl) { - let parsedUrl = url.parse(requestUrl); - return parsedUrl.protocol === 'https:'; -} -exports.isHttps = isHttps; -var EnvironmentVariables; -(function (EnvironmentVariables) { - EnvironmentVariables["HTTP_PROXY"] = "HTTP_PROXY"; - EnvironmentVariables["HTTPS_PROXY"] = "HTTPS_PROXY"; - EnvironmentVariables["NO_PROXY"] = "NO_PROXY"; -})(EnvironmentVariables || (EnvironmentVariables = {})); -class HttpClient { - constructor(userAgent, handlers, requestOptions) { - this._ignoreSslError = false; - this._allowRedirects = true; - this._allowRedirectDowngrade = false; - this._maxRedirects = 50; - this._allowRetries = false; - this._maxRetries = 1; - this._keepAlive = false; - this._disposed = false; - this.userAgent = userAgent; - this.handlers = handlers || []; - let no_proxy = process.env[EnvironmentVariables.NO_PROXY]; - if (no_proxy) { - this._httpProxyBypassHosts = []; - no_proxy.split(',').forEach(bypass => { - this._httpProxyBypassHosts.push(util.buildProxyBypassRegexFromEnv(bypass)); - }); - } - this.requestOptions = requestOptions; - if (requestOptions) { - if (requestOptions.ignoreSslError != null) { - this._ignoreSslError = requestOptions.ignoreSslError; - } - this._socketTimeout = requestOptions.socketTimeout; - this._httpProxy = requestOptions.proxy; - if (requestOptions.proxy && requestOptions.proxy.proxyBypassHosts) { - this._httpProxyBypassHosts = []; - requestOptions.proxy.proxyBypassHosts.forEach(bypass => { - this._httpProxyBypassHosts.push(new RegExp(bypass, 'i')); - }); - } - this._certConfig = requestOptions.cert; - if (this._certConfig) { - // If using cert, need fs - fs = require('fs'); - // cache the cert content into memory, so we don't have to read it from disk every time - if (this._certConfig.caFile && fs.existsSync(this._certConfig.caFile)) { - this._ca = fs.readFileSync(this._certConfig.caFile, 'utf8'); - } - if (this._certConfig.certFile && fs.existsSync(this._certConfig.certFile)) { - this._cert = fs.readFileSync(this._certConfig.certFile, 'utf8'); - } - if (this._certConfig.keyFile && fs.existsSync(this._certConfig.keyFile)) { - this._key = fs.readFileSync(this._certConfig.keyFile, 'utf8'); - } - } - if (requestOptions.allowRedirects != null) { - this._allowRedirects = requestOptions.allowRedirects; - } - if (requestOptions.allowRedirectDowngrade != null) { - this._allowRedirectDowngrade = requestOptions.allowRedirectDowngrade; - } - if (requestOptions.maxRedirects != null) { - this._maxRedirects = Math.max(requestOptions.maxRedirects, 0); - } - if (requestOptions.keepAlive != null) { - this._keepAlive = requestOptions.keepAlive; - } - if (requestOptions.allowRetries != null) { - this._allowRetries = requestOptions.allowRetries; - } - if (requestOptions.maxRetries != null) { - this._maxRetries = requestOptions.maxRetries; - } - } - } - options(requestUrl, additionalHeaders) { - return this.request('OPTIONS', requestUrl, null, additionalHeaders || {}); - } - get(requestUrl, additionalHeaders) { - return this.request('GET', requestUrl, null, additionalHeaders || {}); - } - del(requestUrl, additionalHeaders) { - return this.request('DELETE', requestUrl, null, additionalHeaders || {}); - } - post(requestUrl, data, additionalHeaders) { - return this.request('POST', requestUrl, data, additionalHeaders || {}); - } - patch(requestUrl, data, additionalHeaders) { - return this.request('PATCH', requestUrl, data, additionalHeaders || {}); - } - put(requestUrl, data, additionalHeaders) { - return this.request('PUT', requestUrl, data, additionalHeaders || {}); - } - head(requestUrl, additionalHeaders) { - return this.request('HEAD', requestUrl, null, additionalHeaders || {}); - } - sendStream(verb, requestUrl, stream, additionalHeaders) { - return this.request(verb, requestUrl, stream, additionalHeaders); - } - /** - * Makes a raw http request. - * All other methods such as get, post, patch, and request ultimately call this. - * Prefer get, del, post and patch - */ - request(verb, requestUrl, data, headers) { - return __awaiter(this, void 0, void 0, function* () { - if (this._disposed) { - throw new Error("Client has already been disposed."); - } - let parsedUrl = url.parse(requestUrl); - let info = this._prepareRequest(verb, parsedUrl, headers); - // Only perform retries on reads since writes may not be idempotent. - let maxTries = (this._allowRetries && RetryableHttpVerbs.indexOf(verb) != -1) ? this._maxRetries + 1 : 1; - let numTries = 0; - let response; - while (numTries < maxTries) { - try { - response = yield this.requestRaw(info, data); - } - catch (err) { - numTries++; - if (err && err.code && NetworkRetryErrors.indexOf(err.code) > -1 && numTries < maxTries) { - yield this._performExponentialBackoff(numTries); - continue; - } - throw err; - } - // Check if it's an authentication challenge - if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) { - let authenticationHandler; - for (let i = 0; i < this.handlers.length; i++) { - if (this.handlers[i].canHandleAuthentication(response)) { - authenticationHandler = this.handlers[i]; - break; - } - } - if (authenticationHandler) { - return authenticationHandler.handleAuthentication(this, info, data); - } - else { - // We have received an unauthorized response but have no handlers to handle it. - // Let the response return to the caller. - return response; - } - } - let redirectsRemaining = this._maxRedirects; - while (HttpRedirectCodes.indexOf(response.message.statusCode) != -1 - && this._allowRedirects - && redirectsRemaining > 0) { - const redirectUrl = response.message.headers["location"]; - if (!redirectUrl) { - // if there's no location to redirect to, we won't - break; - } - let parsedRedirectUrl = url.parse(redirectUrl); - if (parsedUrl.protocol == 'https:' && parsedUrl.protocol != parsedRedirectUrl.protocol && !this._allowRedirectDowngrade) { - throw new Error("Redirect from HTTPS to HTTP protocol. This downgrade is not allowed for security reasons. If you want to allow this behavior, set the allowRedirectDowngrade option to true."); - } - // we need to finish reading the response before reassigning response - // which will leak the open socket. - yield response.readBody(); - // let's make the request with the new redirectUrl - info = this._prepareRequest(verb, parsedRedirectUrl, headers); - response = yield this.requestRaw(info, data); - redirectsRemaining--; - } - if (HttpResponseRetryCodes.indexOf(response.message.statusCode) == -1) { - // If not a retry code, return immediately instead of retrying - return response; - } - numTries += 1; - if (numTries < maxTries) { - yield response.readBody(); - yield this._performExponentialBackoff(numTries); - } - } - return response; - }); - } - /** - * Needs to be called if keepAlive is set to true in request options. - */ - dispose() { - if (this._agent) { - this._agent.destroy(); - } - this._disposed = true; - } - /** - * Raw request. - * @param info - * @param data - */ - requestRaw(info, data) { - return new Promise((resolve, reject) => { - let callbackForResult = function (err, res) { - if (err) { - reject(err); - } - resolve(res); - }; - this.requestRawWithCallback(info, data, callbackForResult); - }); - } - /** - * Raw request with callback. - * @param info - * @param data - * @param onResult - */ - requestRawWithCallback(info, data, onResult) { - let socket; - if (typeof (data) === 'string') { - info.options.headers["Content-Length"] = Buffer.byteLength(data, 'utf8'); - } - let callbackCalled = false; - let handleResult = (err, res) => { - if (!callbackCalled) { - callbackCalled = true; - onResult(err, res); - } - }; - let req = info.httpModule.request(info.options, (msg) => { - let res = new HttpClientResponse(msg); - handleResult(null, res); - }); - req.on('socket', (sock) => { - socket = sock; - }); - // If we ever get disconnected, we want the socket to timeout eventually - req.setTimeout(this._socketTimeout || 3 * 60000, () => { - if (socket) { - socket.destroy(); - } - handleResult(new Error('Request timeout: ' + info.options.path), null); - }); - req.on('error', function (err) { - // err has statusCode property - // res should have headers - handleResult(err, null); - }); - if (data && typeof (data) === 'string') { - req.write(data, 'utf8'); - } - if (data && typeof (data) !== 'string') { - data.on('close', function () { - req.end(); - }); - data.pipe(req); - } - else { - req.end(); - } - } - _prepareRequest(method, requestUrl, headers) { - const info = {}; - info.parsedUrl = requestUrl; - const usingSsl = info.parsedUrl.protocol === 'https:'; - info.httpModule = usingSsl ? https : http; - const defaultPort = usingSsl ? 443 : 80; - info.options = {}; - info.options.host = info.parsedUrl.hostname; - info.options.port = info.parsedUrl.port ? parseInt(info.parsedUrl.port) : defaultPort; - info.options.path = (info.parsedUrl.pathname || '') + (info.parsedUrl.search || ''); - info.options.method = method; - info.options.timeout = (this.requestOptions && this.requestOptions.socketTimeout) || this._socketTimeout; - this._socketTimeout = info.options.timeout; - info.options.headers = this._mergeHeaders(headers); - if (this.userAgent != null) { - info.options.headers["user-agent"] = this.userAgent; - } - info.options.agent = this._getAgent(info.parsedUrl); - // gives handlers an opportunity to participate - if (this.handlers && !this._isPresigned(url.format(requestUrl))) { - this.handlers.forEach((handler) => { - handler.prepareRequest(info.options); - }); - } - return info; - } - _isPresigned(requestUrl) { - if (this.requestOptions && this.requestOptions.presignedUrlPatterns) { - const patterns = this.requestOptions.presignedUrlPatterns; - for (let i = 0; i < patterns.length; i++) { - if (requestUrl.match(patterns[i])) { - return true; - } - } - } - return false; - } - _mergeHeaders(headers) { - const lowercaseKeys = obj => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {}); - if (this.requestOptions && this.requestOptions.headers) { - return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers)); - } - return lowercaseKeys(headers || {}); - } - _getAgent(parsedUrl) { - let agent; - let proxy = this._getProxy(parsedUrl); - let useProxy = proxy.proxyUrl && proxy.proxyUrl.hostname && !this._isMatchInBypassProxyList(parsedUrl); - if (this._keepAlive && useProxy) { - agent = this._proxyAgent; - } - if (this._keepAlive && !useProxy) { - agent = this._agent; - } - // if agent is already assigned use that agent. - if (!!agent) { - return agent; - } - const usingSsl = parsedUrl.protocol === 'https:'; - let maxSockets = 100; - if (!!this.requestOptions) { - maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets; - } - if (useProxy) { - // If using proxy, need tunnel - if (!tunnel) { - tunnel = require('tunnel'); - } - const agentOptions = { - maxSockets: maxSockets, - keepAlive: this._keepAlive, - proxy: { - proxyAuth: proxy.proxyAuth, - host: proxy.proxyUrl.hostname, - port: proxy.proxyUrl.port - }, - }; - let tunnelAgent; - const overHttps = proxy.proxyUrl.protocol === 'https:'; - if (usingSsl) { - tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp; - } - else { - tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp; - } - agent = tunnelAgent(agentOptions); - this._proxyAgent = agent; - } - // if reusing agent across request and tunneling agent isn't assigned create a new agent - if (this._keepAlive && !agent) { - const options = { keepAlive: this._keepAlive, maxSockets: maxSockets }; - agent = usingSsl ? new https.Agent(options) : new http.Agent(options); - this._agent = agent; - } - // if not using private agent and tunnel agent isn't setup then use global agent - if (!agent) { - agent = usingSsl ? https.globalAgent : http.globalAgent; - } - if (usingSsl && this._ignoreSslError) { - // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process - // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options - // we have to cast it to any and change it directly - agent.options = Object.assign(agent.options || {}, { rejectUnauthorized: false }); - } - if (usingSsl && this._certConfig) { - agent.options = Object.assign(agent.options || {}, { ca: this._ca, cert: this._cert, key: this._key, passphrase: this._certConfig.passphrase }); - } - return agent; - } - _getProxy(parsedUrl) { - let usingSsl = parsedUrl.protocol === 'https:'; - let proxyConfig = this._httpProxy; - // fallback to http_proxy and https_proxy env - let https_proxy = process.env[EnvironmentVariables.HTTPS_PROXY]; - let http_proxy = process.env[EnvironmentVariables.HTTP_PROXY]; - if (!proxyConfig) { - if (https_proxy && usingSsl) { - proxyConfig = { - proxyUrl: https_proxy - }; - } - else if (http_proxy) { - proxyConfig = { - proxyUrl: http_proxy - }; - } - } - let proxyUrl; - let proxyAuth; - if (proxyConfig) { - if (proxyConfig.proxyUrl.length > 0) { - proxyUrl = url.parse(proxyConfig.proxyUrl); - } - if (proxyConfig.proxyUsername || proxyConfig.proxyPassword) { - proxyAuth = proxyConfig.proxyUsername + ":" + proxyConfig.proxyPassword; - } - } - return { proxyUrl: proxyUrl, proxyAuth: proxyAuth }; - } - _isMatchInBypassProxyList(parsedUrl) { - if (!this._httpProxyBypassHosts) { - return false; - } - let bypass = false; - this._httpProxyBypassHosts.forEach(bypassHost => { - if (bypassHost.test(parsedUrl.href)) { - bypass = true; - } - }); - return bypass; - } - _performExponentialBackoff(retryNumber) { - retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber); - const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber); - return new Promise(resolve => setTimeout(() => resolve(), ms)); - } -} -exports.HttpClient = HttpClient; +"use strict"; +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const url = require("url"); +const http = require("http"); +const https = require("https"); +const util = require("./Util"); +let fs; +let tunnel; +var HttpCodes; +(function (HttpCodes) { + HttpCodes[HttpCodes["OK"] = 200] = "OK"; + HttpCodes[HttpCodes["MultipleChoices"] = 300] = "MultipleChoices"; + HttpCodes[HttpCodes["MovedPermanently"] = 301] = "MovedPermanently"; + HttpCodes[HttpCodes["ResourceMoved"] = 302] = "ResourceMoved"; + HttpCodes[HttpCodes["SeeOther"] = 303] = "SeeOther"; + HttpCodes[HttpCodes["NotModified"] = 304] = "NotModified"; + HttpCodes[HttpCodes["UseProxy"] = 305] = "UseProxy"; + HttpCodes[HttpCodes["SwitchProxy"] = 306] = "SwitchProxy"; + HttpCodes[HttpCodes["TemporaryRedirect"] = 307] = "TemporaryRedirect"; + HttpCodes[HttpCodes["PermanentRedirect"] = 308] = "PermanentRedirect"; + HttpCodes[HttpCodes["BadRequest"] = 400] = "BadRequest"; + HttpCodes[HttpCodes["Unauthorized"] = 401] = "Unauthorized"; + HttpCodes[HttpCodes["PaymentRequired"] = 402] = "PaymentRequired"; + HttpCodes[HttpCodes["Forbidden"] = 403] = "Forbidden"; + HttpCodes[HttpCodes["NotFound"] = 404] = "NotFound"; + HttpCodes[HttpCodes["MethodNotAllowed"] = 405] = "MethodNotAllowed"; + HttpCodes[HttpCodes["NotAcceptable"] = 406] = "NotAcceptable"; + HttpCodes[HttpCodes["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired"; + HttpCodes[HttpCodes["RequestTimeout"] = 408] = "RequestTimeout"; + HttpCodes[HttpCodes["Conflict"] = 409] = "Conflict"; + HttpCodes[HttpCodes["Gone"] = 410] = "Gone"; + HttpCodes[HttpCodes["TooManyRequests"] = 429] = "TooManyRequests"; + HttpCodes[HttpCodes["InternalServerError"] = 500] = "InternalServerError"; + HttpCodes[HttpCodes["NotImplemented"] = 501] = "NotImplemented"; + HttpCodes[HttpCodes["BadGateway"] = 502] = "BadGateway"; + HttpCodes[HttpCodes["ServiceUnavailable"] = 503] = "ServiceUnavailable"; + HttpCodes[HttpCodes["GatewayTimeout"] = 504] = "GatewayTimeout"; +})(HttpCodes = exports.HttpCodes || (exports.HttpCodes = {})); +const HttpRedirectCodes = [HttpCodes.MovedPermanently, HttpCodes.ResourceMoved, HttpCodes.SeeOther, HttpCodes.TemporaryRedirect, HttpCodes.PermanentRedirect]; +const HttpResponseRetryCodes = [HttpCodes.BadGateway, HttpCodes.ServiceUnavailable, HttpCodes.GatewayTimeout]; +const NetworkRetryErrors = ['ECONNRESET', 'ENOTFOUND', 'ESOCKETTIMEDOUT', 'ETIMEDOUT', 'ECONNREFUSED']; +const RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD']; +const ExponentialBackoffCeiling = 10; +const ExponentialBackoffTimeSlice = 5; +class HttpClientResponse { + constructor(message) { + this.message = message; + } + readBody() { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let buffer = Buffer.alloc(0); + const encodingCharset = util.obtainContentCharset(this); + // Extract Encoding from header: 'content-encoding' + // Match `gzip`, `gzip, deflate` variations of GZIP encoding + const contentEncoding = this.message.headers['content-encoding'] || ''; + const isGzippedEncoded = new RegExp('(gzip$)|(gzip, *deflate)').test(contentEncoding); + this.message.on('data', function (data) { + const chunk = (typeof data === 'string') ? Buffer.from(data, encodingCharset) : data; + buffer = Buffer.concat([buffer, chunk]); + }).on('end', function () { + return __awaiter(this, void 0, void 0, function* () { + if (isGzippedEncoded) { // Process GZipped Response Body HERE + const gunzippedBody = yield util.decompressGzippedContent(buffer, encodingCharset); + resolve(gunzippedBody); + } + else { + resolve(buffer.toString(encodingCharset)); + } + }); + }).on('error', function (err) { + reject(err); + }); + })); + } +} +exports.HttpClientResponse = HttpClientResponse; +function isHttps(requestUrl) { + let parsedUrl = url.parse(requestUrl); + return parsedUrl.protocol === 'https:'; +} +exports.isHttps = isHttps; +var EnvironmentVariables; +(function (EnvironmentVariables) { + EnvironmentVariables["HTTP_PROXY"] = "HTTP_PROXY"; + EnvironmentVariables["HTTPS_PROXY"] = "HTTPS_PROXY"; + EnvironmentVariables["NO_PROXY"] = "NO_PROXY"; +})(EnvironmentVariables || (EnvironmentVariables = {})); +class HttpClient { + constructor(userAgent, handlers, requestOptions) { + this._ignoreSslError = false; + this._allowRedirects = true; + this._allowRedirectDowngrade = false; + this._maxRedirects = 50; + this._allowRetries = false; + this._maxRetries = 1; + this._keepAlive = false; + this._disposed = false; + this.userAgent = userAgent; + this.handlers = handlers || []; + let no_proxy = process.env[EnvironmentVariables.NO_PROXY]; + if (no_proxy) { + this._httpProxyBypassHosts = []; + no_proxy.split(',').forEach(bypass => { + this._httpProxyBypassHosts.push(util.buildProxyBypassRegexFromEnv(bypass)); + }); + } + this.requestOptions = requestOptions; + if (requestOptions) { + if (requestOptions.ignoreSslError != null) { + this._ignoreSslError = requestOptions.ignoreSslError; + } + this._socketTimeout = requestOptions.socketTimeout; + this._httpProxy = requestOptions.proxy; + if (requestOptions.proxy && requestOptions.proxy.proxyBypassHosts) { + this._httpProxyBypassHosts = []; + requestOptions.proxy.proxyBypassHosts.forEach(bypass => { + this._httpProxyBypassHosts.push(new RegExp(bypass, 'i')); + }); + } + this._certConfig = requestOptions.cert; + if (this._certConfig) { + // If using cert, need fs + fs = require('fs'); + // cache the cert content into memory, so we don't have to read it from disk every time + if (this._certConfig.caFile && fs.existsSync(this._certConfig.caFile)) { + this._ca = fs.readFileSync(this._certConfig.caFile, 'utf8'); + } + if (this._certConfig.certFile && fs.existsSync(this._certConfig.certFile)) { + this._cert = fs.readFileSync(this._certConfig.certFile, 'utf8'); + } + if (this._certConfig.keyFile && fs.existsSync(this._certConfig.keyFile)) { + this._key = fs.readFileSync(this._certConfig.keyFile, 'utf8'); + } + } + if (requestOptions.allowRedirects != null) { + this._allowRedirects = requestOptions.allowRedirects; + } + if (requestOptions.allowRedirectDowngrade != null) { + this._allowRedirectDowngrade = requestOptions.allowRedirectDowngrade; + } + if (requestOptions.maxRedirects != null) { + this._maxRedirects = Math.max(requestOptions.maxRedirects, 0); + } + if (requestOptions.keepAlive != null) { + this._keepAlive = requestOptions.keepAlive; + } + if (requestOptions.allowRetries != null) { + this._allowRetries = requestOptions.allowRetries; + } + if (requestOptions.maxRetries != null) { + this._maxRetries = requestOptions.maxRetries; + } + } + } + options(requestUrl, additionalHeaders) { + return this.request('OPTIONS', requestUrl, null, additionalHeaders || {}); + } + get(requestUrl, additionalHeaders) { + return this.request('GET', requestUrl, null, additionalHeaders || {}); + } + del(requestUrl, additionalHeaders) { + return this.request('DELETE', requestUrl, null, additionalHeaders || {}); + } + post(requestUrl, data, additionalHeaders) { + return this.request('POST', requestUrl, data, additionalHeaders || {}); + } + patch(requestUrl, data, additionalHeaders) { + return this.request('PATCH', requestUrl, data, additionalHeaders || {}); + } + put(requestUrl, data, additionalHeaders) { + return this.request('PUT', requestUrl, data, additionalHeaders || {}); + } + head(requestUrl, additionalHeaders) { + return this.request('HEAD', requestUrl, null, additionalHeaders || {}); + } + sendStream(verb, requestUrl, stream, additionalHeaders) { + return this.request(verb, requestUrl, stream, additionalHeaders); + } + /** + * Makes a raw http request. + * All other methods such as get, post, patch, and request ultimately call this. + * Prefer get, del, post and patch + */ + request(verb, requestUrl, data, headers) { + return __awaiter(this, void 0, void 0, function* () { + if (this._disposed) { + throw new Error("Client has already been disposed."); + } + let parsedUrl = url.parse(requestUrl); + let info = this._prepareRequest(verb, parsedUrl, headers); + // Only perform retries on reads since writes may not be idempotent. + let maxTries = (this._allowRetries && RetryableHttpVerbs.indexOf(verb) != -1) ? this._maxRetries + 1 : 1; + let numTries = 0; + let response; + while (numTries < maxTries) { + try { + response = yield this.requestRaw(info, data); + } + catch (err) { + numTries++; + if (err && err.code && NetworkRetryErrors.indexOf(err.code) > -1 && numTries < maxTries) { + yield this._performExponentialBackoff(numTries); + continue; + } + throw err; + } + // Check if it's an authentication challenge + if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) { + let authenticationHandler; + for (let i = 0; i < this.handlers.length; i++) { + if (this.handlers[i].canHandleAuthentication(response)) { + authenticationHandler = this.handlers[i]; + break; + } + } + if (authenticationHandler) { + return authenticationHandler.handleAuthentication(this, info, data); + } + else { + // We have received an unauthorized response but have no handlers to handle it. + // Let the response return to the caller. + return response; + } + } + let redirectsRemaining = this._maxRedirects; + while (HttpRedirectCodes.indexOf(response.message.statusCode) != -1 + && this._allowRedirects + && redirectsRemaining > 0) { + const redirectUrl = response.message.headers["location"]; + if (!redirectUrl) { + // if there's no location to redirect to, we won't + break; + } + let parsedRedirectUrl = url.parse(redirectUrl); + if (parsedUrl.protocol == 'https:' && parsedUrl.protocol != parsedRedirectUrl.protocol && !this._allowRedirectDowngrade) { + throw new Error("Redirect from HTTPS to HTTP protocol. This downgrade is not allowed for security reasons. If you want to allow this behavior, set the allowRedirectDowngrade option to true."); + } + // we need to finish reading the response before reassigning response + // which will leak the open socket. + yield response.readBody(); + // let's make the request with the new redirectUrl + info = this._prepareRequest(verb, parsedRedirectUrl, headers); + response = yield this.requestRaw(info, data); + redirectsRemaining--; + } + if (HttpResponseRetryCodes.indexOf(response.message.statusCode) == -1) { + // If not a retry code, return immediately instead of retrying + return response; + } + numTries += 1; + if (numTries < maxTries) { + yield response.readBody(); + yield this._performExponentialBackoff(numTries); + } + } + return response; + }); + } + /** + * Needs to be called if keepAlive is set to true in request options. + */ + dispose() { + if (this._agent) { + this._agent.destroy(); + } + this._disposed = true; + } + /** + * Raw request. + * @param info + * @param data + */ + requestRaw(info, data) { + return new Promise((resolve, reject) => { + let callbackForResult = function (err, res) { + if (err) { + reject(err); + } + resolve(res); + }; + this.requestRawWithCallback(info, data, callbackForResult); + }); + } + /** + * Raw request with callback. + * @param info + * @param data + * @param onResult + */ + requestRawWithCallback(info, data, onResult) { + let socket; + if (typeof (data) === 'string') { + info.options.headers["Content-Length"] = Buffer.byteLength(data, 'utf8'); + } + let callbackCalled = false; + let handleResult = (err, res) => { + if (!callbackCalled) { + callbackCalled = true; + onResult(err, res); + } + }; + let req = info.httpModule.request(info.options, (msg) => { + let res = new HttpClientResponse(msg); + handleResult(null, res); + }); + req.on('socket', (sock) => { + socket = sock; + }); + // If we ever get disconnected, we want the socket to timeout eventually + req.setTimeout(this._socketTimeout || 3 * 60000, () => { + if (socket) { + socket.destroy(); + } + handleResult(new Error('Request timeout: ' + info.options.path), null); + }); + req.on('error', function (err) { + // err has statusCode property + // res should have headers + handleResult(err, null); + }); + if (data && typeof (data) === 'string') { + req.write(data, 'utf8'); + } + if (data && typeof (data) !== 'string') { + data.on('close', function () { + req.end(); + }); + data.pipe(req); + } + else { + req.end(); + } + } + _prepareRequest(method, requestUrl, headers) { + const info = {}; + info.parsedUrl = requestUrl; + const usingSsl = info.parsedUrl.protocol === 'https:'; + info.httpModule = usingSsl ? https : http; + const defaultPort = usingSsl ? 443 : 80; + info.options = {}; + info.options.host = info.parsedUrl.hostname; + info.options.port = info.parsedUrl.port ? parseInt(info.parsedUrl.port) : defaultPort; + info.options.path = (info.parsedUrl.pathname || '') + (info.parsedUrl.search || ''); + info.options.method = method; + info.options.timeout = (this.requestOptions && this.requestOptions.socketTimeout) || this._socketTimeout; + this._socketTimeout = info.options.timeout; + info.options.headers = this._mergeHeaders(headers); + if (this.userAgent != null) { + info.options.headers["user-agent"] = this.userAgent; + } + info.options.agent = this._getAgent(info.parsedUrl); + // gives handlers an opportunity to participate + if (this.handlers && !this._isPresigned(url.format(requestUrl))) { + this.handlers.forEach((handler) => { + handler.prepareRequest(info.options); + }); + } + return info; + } + _isPresigned(requestUrl) { + if (this.requestOptions && this.requestOptions.presignedUrlPatterns) { + const patterns = this.requestOptions.presignedUrlPatterns; + for (let i = 0; i < patterns.length; i++) { + if (requestUrl.match(patterns[i])) { + return true; + } + } + } + return false; + } + _mergeHeaders(headers) { + const lowercaseKeys = obj => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {}); + if (this.requestOptions && this.requestOptions.headers) { + return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers)); + } + return lowercaseKeys(headers || {}); + } + _getAgent(parsedUrl) { + let agent; + let proxy = this._getProxy(parsedUrl); + let useProxy = proxy.proxyUrl && proxy.proxyUrl.hostname && !this._isMatchInBypassProxyList(parsedUrl); + if (this._keepAlive && useProxy) { + agent = this._proxyAgent; + } + if (this._keepAlive && !useProxy) { + agent = this._agent; + } + // if agent is already assigned use that agent. + if (!!agent) { + return agent; + } + const usingSsl = parsedUrl.protocol === 'https:'; + let maxSockets = 100; + if (!!this.requestOptions) { + maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets; + } + if (useProxy) { + // If using proxy, need tunnel + if (!tunnel) { + tunnel = require('tunnel'); + } + const agentOptions = { + maxSockets: maxSockets, + keepAlive: this._keepAlive, + proxy: { + proxyAuth: proxy.proxyAuth, + host: proxy.proxyUrl.hostname, + port: proxy.proxyUrl.port + }, + }; + let tunnelAgent; + const overHttps = proxy.proxyUrl.protocol === 'https:'; + if (usingSsl) { + tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp; + } + else { + tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp; + } + agent = tunnelAgent(agentOptions); + this._proxyAgent = agent; + } + // if reusing agent across request and tunneling agent isn't assigned create a new agent + if (this._keepAlive && !agent) { + const options = { keepAlive: this._keepAlive, maxSockets: maxSockets }; + agent = usingSsl ? new https.Agent(options) : new http.Agent(options); + this._agent = agent; + } + // if not using private agent and tunnel agent isn't setup then use global agent + if (!agent) { + agent = usingSsl ? https.globalAgent : http.globalAgent; + } + if (usingSsl && this._ignoreSslError) { + // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process + // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options + // we have to cast it to any and change it directly + agent.options = Object.assign(agent.options || {}, { rejectUnauthorized: false }); + } + if (usingSsl && this._certConfig) { + agent.options = Object.assign(agent.options || {}, { ca: this._ca, cert: this._cert, key: this._key, passphrase: this._certConfig.passphrase }); + } + return agent; + } + _getProxy(parsedUrl) { + let usingSsl = parsedUrl.protocol === 'https:'; + let proxyConfig = this._httpProxy; + // fallback to http_proxy and https_proxy env + let https_proxy = process.env[EnvironmentVariables.HTTPS_PROXY]; + let http_proxy = process.env[EnvironmentVariables.HTTP_PROXY]; + if (!proxyConfig) { + if (https_proxy && usingSsl) { + proxyConfig = { + proxyUrl: https_proxy + }; + } + else if (http_proxy) { + proxyConfig = { + proxyUrl: http_proxy + }; + } + } + let proxyUrl; + let proxyAuth; + if (proxyConfig) { + if (proxyConfig.proxyUrl.length > 0) { + proxyUrl = url.parse(proxyConfig.proxyUrl); + } + if (proxyConfig.proxyUsername || proxyConfig.proxyPassword) { + proxyAuth = proxyConfig.proxyUsername + ":" + proxyConfig.proxyPassword; + } + } + return { proxyUrl: proxyUrl, proxyAuth: proxyAuth }; + } + _isMatchInBypassProxyList(parsedUrl) { + if (!this._httpProxyBypassHosts) { + return false; + } + let bypass = false; + this._httpProxyBypassHosts.forEach(bypassHost => { + if (bypassHost.test(parsedUrl.href)) { + bypass = true; + } + }); + return bypass; + } + _performExponentialBackoff(retryNumber) { + retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber); + const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber); + return new Promise(resolve => setTimeout(() => resolve(), ms)); + } +} +exports.HttpClient = HttpClient; diff --git a/node_modules/typed-rest-client/Index.d.ts b/node_modules/typed-rest-client/Index.d.ts index cb0ff5c3b..509db1866 100644 --- a/node_modules/typed-rest-client/Index.d.ts +++ b/node_modules/typed-rest-client/Index.d.ts @@ -1 +1 @@ -export {}; +export {}; diff --git a/node_modules/typed-rest-client/Index.js b/node_modules/typed-rest-client/Index.js index c8ad2e549..ce03781e2 100644 --- a/node_modules/typed-rest-client/Index.js +++ b/node_modules/typed-rest-client/Index.js @@ -1,2 +1,2 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/typed-rest-client/Interfaces.d.ts b/node_modules/typed-rest-client/Interfaces.d.ts index 1c949c2a0..a49716094 100644 --- a/node_modules/typed-rest-client/Interfaces.d.ts +++ b/node_modules/typed-rest-client/Interfaces.d.ts @@ -1,74 +1,74 @@ -/// -import http = require("http"); -import url = require("url"); -export interface IHeaders { - [key: string]: any; -} -export interface IBasicCredentials { - username: string; - password: string; -} -export interface IHttpClient { - options(requestUrl: string, additionalHeaders?: IHeaders): Promise; - get(requestUrl: string, additionalHeaders?: IHeaders): Promise; - del(requestUrl: string, additionalHeaders?: IHeaders): Promise; - post(requestUrl: string, data: string, additionalHeaders?: IHeaders): Promise; - patch(requestUrl: string, data: string, additionalHeaders?: IHeaders): Promise; - put(requestUrl: string, data: string, additionalHeaders?: IHeaders): Promise; - sendStream(verb: string, requestUrl: string, stream: NodeJS.ReadableStream, additionalHeaders?: IHeaders): Promise; - request(verb: string, requestUrl: string, data: string | NodeJS.ReadableStream, headers: IHeaders): Promise; - requestRaw(info: IRequestInfo, data: string | NodeJS.ReadableStream): Promise; - requestRawWithCallback(info: IRequestInfo, data: string | NodeJS.ReadableStream, onResult: (err: any, res: IHttpClientResponse) => void): void; -} -export interface IRequestHandler { - prepareRequest(options: http.RequestOptions): void; - canHandleAuthentication(response: IHttpClientResponse): boolean; - handleAuthentication(httpClient: IHttpClient, requestInfo: IRequestInfo, objs: any): Promise; -} -export interface IHttpClientResponse { - message: http.IncomingMessage; - readBody(): Promise; -} -export interface IRequestInfo { - options: http.RequestOptions; - parsedUrl: url.Url; - httpModule: any; -} -export interface IRequestOptions { - headers?: IHeaders; - socketTimeout?: number; - ignoreSslError?: boolean; - proxy?: IProxyConfiguration; - cert?: ICertConfiguration; - allowRedirects?: boolean; - allowRedirectDowngrade?: boolean; - maxRedirects?: number; - maxSockets?: number; - keepAlive?: boolean; - presignedUrlPatterns?: RegExp[]; - allowRetries?: boolean; - maxRetries?: number; -} -export interface IProxyConfiguration { - proxyUrl: string; - proxyUsername?: string; - proxyPassword?: string; - proxyBypassHosts?: string[]; -} -export interface ICertConfiguration { - caFile?: string; - certFile?: string; - keyFile?: string; - passphrase?: string; -} -export interface IRequestQueryParams { - options?: { - separator?: string; - arrayFormat?: string; - shouldAllowDots?: boolean; - shouldOnlyEncodeValues?: boolean; - }; - params: { - [name: string]: string | number | (string | number)[]; - }; -} +/// +import http = require("http"); +import url = require("url"); +export interface IHeaders { + [key: string]: any; +} +export interface IBasicCredentials { + username: string; + password: string; +} +export interface IHttpClient { + options(requestUrl: string, additionalHeaders?: IHeaders): Promise; + get(requestUrl: string, additionalHeaders?: IHeaders): Promise; + del(requestUrl: string, additionalHeaders?: IHeaders): Promise; + post(requestUrl: string, data: string, additionalHeaders?: IHeaders): Promise; + patch(requestUrl: string, data: string, additionalHeaders?: IHeaders): Promise; + put(requestUrl: string, data: string, additionalHeaders?: IHeaders): Promise; + sendStream(verb: string, requestUrl: string, stream: NodeJS.ReadableStream, additionalHeaders?: IHeaders): Promise; + request(verb: string, requestUrl: string, data: string | NodeJS.ReadableStream, headers: IHeaders): Promise; + requestRaw(info: IRequestInfo, data: string | NodeJS.ReadableStream): Promise; + requestRawWithCallback(info: IRequestInfo, data: string | NodeJS.ReadableStream, onResult: (err: any, res: IHttpClientResponse) => void): void; +} +export interface IRequestHandler { + prepareRequest(options: http.RequestOptions): void; + canHandleAuthentication(response: IHttpClientResponse): boolean; + handleAuthentication(httpClient: IHttpClient, requestInfo: IRequestInfo, objs: any): Promise; +} +export interface IHttpClientResponse { + message: http.IncomingMessage; + readBody(): Promise; +} +export interface IRequestInfo { + options: http.RequestOptions; + parsedUrl: url.Url; + httpModule: any; +} +export interface IRequestOptions { + headers?: IHeaders; + socketTimeout?: number; + ignoreSslError?: boolean; + proxy?: IProxyConfiguration; + cert?: ICertConfiguration; + allowRedirects?: boolean; + allowRedirectDowngrade?: boolean; + maxRedirects?: number; + maxSockets?: number; + keepAlive?: boolean; + presignedUrlPatterns?: RegExp[]; + allowRetries?: boolean; + maxRetries?: number; +} +export interface IProxyConfiguration { + proxyUrl: string; + proxyUsername?: string; + proxyPassword?: string; + proxyBypassHosts?: string[]; +} +export interface ICertConfiguration { + caFile?: string; + certFile?: string; + keyFile?: string; + passphrase?: string; +} +export interface IRequestQueryParams { + options?: { + separator?: string; + arrayFormat?: string; + shouldAllowDots?: boolean; + shouldOnlyEncodeValues?: boolean; + }; + params: { + [name: string]: string | number | (string | number)[]; + }; +} diff --git a/node_modules/typed-rest-client/Interfaces.js b/node_modules/typed-rest-client/Interfaces.js index 2bc6be205..6b2bf36b6 100644 --- a/node_modules/typed-rest-client/Interfaces.js +++ b/node_modules/typed-rest-client/Interfaces.js @@ -1,5 +1,5 @@ -"use strict"; -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. -Object.defineProperty(exports, "__esModule", { value: true }); -; +"use strict"; +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +Object.defineProperty(exports, "__esModule", { value: true }); +; diff --git a/node_modules/typed-rest-client/LICENSE b/node_modules/typed-rest-client/LICENSE index b0f02f4e0..0f14def2e 100644 --- a/node_modules/typed-rest-client/LICENSE +++ b/node_modules/typed-rest-client/LICENSE @@ -1,39 +1,39 @@ -Typed Rest Client for Node.js - -Copyright (c) Microsoft Corporation - -All rights reserved. - -MIT License - -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. - - -/* Node-SMB/ntlm - * https://github.com/Node-SMB/ntlm - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * - * Copyright (C) 2012 Joshua M. Clulow - */ +Typed Rest Client for Node.js + +Copyright (c) Microsoft Corporation + +All rights reserved. + +MIT License + +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. + + +/* Node-SMB/ntlm + * https://github.com/Node-SMB/ntlm + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * Copyright (C) 2012 Joshua M. Clulow + */ diff --git a/node_modules/typed-rest-client/README.md b/node_modules/typed-rest-client/README.md index bc65ffed8..97ded3acb 100644 --- a/node_modules/typed-rest-client/README.md +++ b/node_modules/typed-rest-client/README.md @@ -1,110 +1,110 @@ - -GitHub Actions status - -[![Build Status](https://dev.azure.com/ms/typed-rest-client/_apis/build/status/Microsoft.typed-rest-client?branchName=master)](https://dev.azure.com/ms/typed-rest-client/_build/latest?definitionId=42&branchName=master) - - -# Typed REST and HTTP Client with TypeScript Typings - -A lightweight REST and HTTP client optimized for use with TypeScript with generics and async await. - -## Features - - - REST and HTTP client with TypeScript generics and async/await/Promises - - Typings included so no need to acquire separately (great for intellisense and no versioning drift) - - Basic, Bearer and NTLM Support out of the box. Extensible handlers for others. - - Proxy support - - Certificate support (Self-signed server and client cert) - - Redirects supported - -Intellisense and compile support: - -![intellisense](./docs/intellisense.png) - -## Install - -``` -npm install typed-rest-client --save -``` - -Or to install the latest preview: -``` -npm install typed-rest-client@preview --save -``` - -## Samples - -See the [samples](./samples) for complete coding examples. Also see the [REST](./test/tests/resttests.ts) and [HTTP](./test/tests/httptests.ts) tests for detailed examples. - -## Errors - -### HTTP - -The HTTP client does not throw unless truly exceptional. - -* A request that successfully executes resulting in a 404, 500 etc... will return a response object with a status code and a body. -* Redirects (3xx) will be followed by default. - - -See [HTTP tests](./test/tests/httptests.ts) for detailed examples. - -### REST - -The REST client is a high-level client which uses the HTTP client. Its responsibility is to turn a body into a typed resource object. - -* A 200 will be success. -* Redirects (3xx) will be followed. -* A 404 will not throw but the result object will be null and the result statusCode will be set. -* Other 4xx and 5xx errors will throw. The status code will be attached to the error object. If a RESTful error object is returned (`{ message: xxx}`), then the error message will be that. Otherwise, it will be a generic, `Failed Request: (xxx)`. - -See [REST tests](./test/tests/resttests.ts) for detailed examples. - -## Debugging - -To enable detailed console logging of all HTTP requests and responses, set the NODE_DEBUG environment varible: - -``` -export NODE_DEBUG=http -``` - -or - -``` -set NODE_DEBUG=http -``` - - - -## Node support - -The typed-rest-client is built using the latest LTS version of Node 8. We also support the latest LTS for Node 4 and Node 6. - -## Contributing - -To contribute to this repository, see the [contribution guide](./CONTRIBUTING.md) - -To build: - -```bash -$ npm run build -``` - -To run all tests: -```bash -$ npm test -``` - -To just run unit tests: -```bash -$ npm run units -``` - -## Code of Conduct - -This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. - -## Security Issues - -Do you think there might be a security issue? -Have you been phished or identified a security vulnerability? -Please don't report it here - let us know by sending an email to secure@microsoft.com. + +GitHub Actions status + +[![Build Status](https://dev.azure.com/ms/typed-rest-client/_apis/build/status/Microsoft.typed-rest-client?branchName=master)](https://dev.azure.com/ms/typed-rest-client/_build/latest?definitionId=42&branchName=master) + + +# Typed REST and HTTP Client with TypeScript Typings + +A lightweight REST and HTTP client optimized for use with TypeScript with generics and async await. + +## Features + + - REST and HTTP client with TypeScript generics and async/await/Promises + - Typings included so no need to acquire separately (great for intellisense and no versioning drift) + - Basic, Bearer and NTLM Support out of the box. Extensible handlers for others. + - Proxy support + - Certificate support (Self-signed server and client cert) + - Redirects supported + +Intellisense and compile support: + +![intellisense](./docs/intellisense.png) + +## Install + +``` +npm install typed-rest-client --save +``` + +Or to install the latest preview: +``` +npm install typed-rest-client@preview --save +``` + +## Samples + +See the [samples](./samples) for complete coding examples. Also see the [REST](./test/tests/resttests.ts) and [HTTP](./test/tests/httptests.ts) tests for detailed examples. + +## Errors + +### HTTP + +The HTTP client does not throw unless truly exceptional. + +* A request that successfully executes resulting in a 404, 500 etc... will return a response object with a status code and a body. +* Redirects (3xx) will be followed by default. + + +See [HTTP tests](./test/tests/httptests.ts) for detailed examples. + +### REST + +The REST client is a high-level client which uses the HTTP client. Its responsibility is to turn a body into a typed resource object. + +* A 200 will be success. +* Redirects (3xx) will be followed. +* A 404 will not throw but the result object will be null and the result statusCode will be set. +* Other 4xx and 5xx errors will throw. The status code will be attached to the error object. If a RESTful error object is returned (`{ message: xxx}`), then the error message will be that. Otherwise, it will be a generic, `Failed Request: (xxx)`. + +See [REST tests](./test/tests/resttests.ts) for detailed examples. + +## Debugging + +To enable detailed console logging of all HTTP requests and responses, set the NODE_DEBUG environment varible: + +``` +export NODE_DEBUG=http +``` + +or + +``` +set NODE_DEBUG=http +``` + + + +## Node support + +The typed-rest-client is built using the latest LTS version of Node 8. We also support the latest LTS for Node 4 and Node 6. + +## Contributing + +To contribute to this repository, see the [contribution guide](./CONTRIBUTING.md) + +To build: + +```bash +$ npm run build +``` + +To run all tests: +```bash +$ npm test +``` + +To just run unit tests: +```bash +$ npm run units +``` + +## Code of Conduct + +This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. + +## Security Issues + +Do you think there might be a security issue? +Have you been phished or identified a security vulnerability? +Please don't report it here - let us know by sending an email to secure@microsoft.com. diff --git a/node_modules/typed-rest-client/RestClient.d.ts b/node_modules/typed-rest-client/RestClient.d.ts index aafbbf8a2..446706c99 100644 --- a/node_modules/typed-rest-client/RestClient.d.ts +++ b/node_modules/typed-rest-client/RestClient.d.ts @@ -1,78 +1,78 @@ -/// -import httpm = require('./HttpClient'); -import ifm = require("./Interfaces"); -export interface IRestResponse { - statusCode: number; - result: T | null; - headers: Object; -} -export interface IRequestOptions { - acceptHeader?: string; - additionalHeaders?: ifm.IHeaders; - responseProcessor?: Function; - deserializeDates?: boolean; - queryParameters?: ifm.IRequestQueryParams; -} -export declare class RestClient { - client: httpm.HttpClient; - versionParam: string; - /** - * Creates an instance of the RestClient - * @constructor - * @param {string} userAgent - userAgent for requests - * @param {string} baseUrl - (Optional) If not specified, use full urls per request. If supplied and a function passes a relative url, it will be appended to this - * @param {ifm.IRequestHandler[]} handlers - handlers are typically auth handlers (basic, bearer, ntlm supplied) - * @param {ifm.IRequestOptions} requestOptions - options for each http requests (http proxy setting, socket timeout) - */ - constructor(userAgent: string | null | undefined, baseUrl?: string, handlers?: ifm.IRequestHandler[], requestOptions?: ifm.IRequestOptions); - private _baseUrl; - /** - * Gets a resource from an endpoint - * Be aware that not found returns a null. Other error conditions reject the promise - * @param {string} requestUrl - fully qualified or relative url - * @param {IRequestOptions} requestOptions - (optional) requestOptions object - */ - options(requestUrl: string, options?: IRequestOptions): Promise>; - /** - * Gets a resource from an endpoint - * Be aware that not found returns a null. Other error conditions reject the promise - * @param {string} resource - fully qualified url or relative path - * @param {IRequestOptions} requestOptions - (optional) requestOptions object - */ - get(resource: string, options?: IRequestOptions): Promise>; - /** - * Deletes a resource from an endpoint - * Be aware that not found returns a null. Other error conditions reject the promise - * @param {string} resource - fully qualified or relative url - * @param {IRequestOptions} requestOptions - (optional) requestOptions object - */ - del(resource: string, options?: IRequestOptions): Promise>; - /** - * Creates resource(s) from an endpoint - * T type of object returned. - * Be aware that not found returns a null. Other error conditions reject the promise - * @param {string} resource - fully qualified or relative url - * @param {IRequestOptions} requestOptions - (optional) requestOptions object - */ - create(resource: string, resources: any, options?: IRequestOptions): Promise>; - /** - * Updates resource(s) from an endpoint - * T type of object returned. - * Be aware that not found returns a null. Other error conditions reject the promise - * @param {string} resource - fully qualified or relative url - * @param {IRequestOptions} requestOptions - (optional) requestOptions object - */ - update(resource: string, resources: any, options?: IRequestOptions): Promise>; - /** - * Replaces resource(s) from an endpoint - * T type of object returned. - * Be aware that not found returns a null. Other error conditions reject the promise - * @param {string} resource - fully qualified or relative url - * @param {IRequestOptions} requestOptions - (optional) requestOptions object - */ - replace(resource: string, resources: any, options?: IRequestOptions): Promise>; - uploadStream(verb: string, requestUrl: string, stream: NodeJS.ReadableStream, options?: IRequestOptions): Promise>; - private _headersFromOptions; - private static dateTimeDeserializer; - protected processResponse(res: httpm.HttpClientResponse, options: IRequestOptions): Promise>; -} +/// +import httpm = require('./HttpClient'); +import ifm = require("./Interfaces"); +export interface IRestResponse { + statusCode: number; + result: T | null; + headers: Object; +} +export interface IRequestOptions { + acceptHeader?: string; + additionalHeaders?: ifm.IHeaders; + responseProcessor?: Function; + deserializeDates?: boolean; + queryParameters?: ifm.IRequestQueryParams; +} +export declare class RestClient { + client: httpm.HttpClient; + versionParam: string; + /** + * Creates an instance of the RestClient + * @constructor + * @param {string} userAgent - userAgent for requests + * @param {string} baseUrl - (Optional) If not specified, use full urls per request. If supplied and a function passes a relative url, it will be appended to this + * @param {ifm.IRequestHandler[]} handlers - handlers are typically auth handlers (basic, bearer, ntlm supplied) + * @param {ifm.IRequestOptions} requestOptions - options for each http requests (http proxy setting, socket timeout) + */ + constructor(userAgent: string | null | undefined, baseUrl?: string, handlers?: ifm.IRequestHandler[], requestOptions?: ifm.IRequestOptions); + private _baseUrl; + /** + * Gets a resource from an endpoint + * Be aware that not found returns a null. Other error conditions reject the promise + * @param {string} requestUrl - fully qualified or relative url + * @param {IRequestOptions} requestOptions - (optional) requestOptions object + */ + options(requestUrl: string, options?: IRequestOptions): Promise>; + /** + * Gets a resource from an endpoint + * Be aware that not found returns a null. Other error conditions reject the promise + * @param {string} resource - fully qualified url or relative path + * @param {IRequestOptions} requestOptions - (optional) requestOptions object + */ + get(resource: string, options?: IRequestOptions): Promise>; + /** + * Deletes a resource from an endpoint + * Be aware that not found returns a null. Other error conditions reject the promise + * @param {string} resource - fully qualified or relative url + * @param {IRequestOptions} requestOptions - (optional) requestOptions object + */ + del(resource: string, options?: IRequestOptions): Promise>; + /** + * Creates resource(s) from an endpoint + * T type of object returned. + * Be aware that not found returns a null. Other error conditions reject the promise + * @param {string} resource - fully qualified or relative url + * @param {IRequestOptions} requestOptions - (optional) requestOptions object + */ + create(resource: string, resources: any, options?: IRequestOptions): Promise>; + /** + * Updates resource(s) from an endpoint + * T type of object returned. + * Be aware that not found returns a null. Other error conditions reject the promise + * @param {string} resource - fully qualified or relative url + * @param {IRequestOptions} requestOptions - (optional) requestOptions object + */ + update(resource: string, resources: any, options?: IRequestOptions): Promise>; + /** + * Replaces resource(s) from an endpoint + * T type of object returned. + * Be aware that not found returns a null. Other error conditions reject the promise + * @param {string} resource - fully qualified or relative url + * @param {IRequestOptions} requestOptions - (optional) requestOptions object + */ + replace(resource: string, resources: any, options?: IRequestOptions): Promise>; + uploadStream(verb: string, requestUrl: string, stream: NodeJS.ReadableStream, options?: IRequestOptions): Promise>; + private _headersFromOptions; + private static dateTimeDeserializer; + protected processResponse(res: httpm.HttpClientResponse, options: IRequestOptions): Promise>; +} diff --git a/node_modules/typed-rest-client/RestClient.js b/node_modules/typed-rest-client/RestClient.js index 33d3ff391..7a79f9962 100644 --- a/node_modules/typed-rest-client/RestClient.js +++ b/node_modules/typed-rest-client/RestClient.js @@ -1,217 +1,217 @@ -"use strict"; -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -Object.defineProperty(exports, "__esModule", { value: true }); -const httpm = require("./HttpClient"); -const util = require("./Util"); -class RestClient { - /** - * Creates an instance of the RestClient - * @constructor - * @param {string} userAgent - userAgent for requests - * @param {string} baseUrl - (Optional) If not specified, use full urls per request. If supplied and a function passes a relative url, it will be appended to this - * @param {ifm.IRequestHandler[]} handlers - handlers are typically auth handlers (basic, bearer, ntlm supplied) - * @param {ifm.IRequestOptions} requestOptions - options for each http requests (http proxy setting, socket timeout) - */ - constructor(userAgent, baseUrl, handlers, requestOptions) { - this.client = new httpm.HttpClient(userAgent, handlers, requestOptions); - if (baseUrl) { - this._baseUrl = baseUrl; - } - } - /** - * Gets a resource from an endpoint - * Be aware that not found returns a null. Other error conditions reject the promise - * @param {string} requestUrl - fully qualified or relative url - * @param {IRequestOptions} requestOptions - (optional) requestOptions object - */ - options(requestUrl, options) { - return __awaiter(this, void 0, void 0, function* () { - let url = util.getUrl(requestUrl, this._baseUrl); - let res = yield this.client.options(url, this._headersFromOptions(options)); - return this.processResponse(res, options); - }); - } - /** - * Gets a resource from an endpoint - * Be aware that not found returns a null. Other error conditions reject the promise - * @param {string} resource - fully qualified url or relative path - * @param {IRequestOptions} requestOptions - (optional) requestOptions object - */ - get(resource, options) { - return __awaiter(this, void 0, void 0, function* () { - let url = util.getUrl(resource, this._baseUrl, (options || {}).queryParameters); - let res = yield this.client.get(url, this._headersFromOptions(options)); - return this.processResponse(res, options); - }); - } - /** - * Deletes a resource from an endpoint - * Be aware that not found returns a null. Other error conditions reject the promise - * @param {string} resource - fully qualified or relative url - * @param {IRequestOptions} requestOptions - (optional) requestOptions object - */ - del(resource, options) { - return __awaiter(this, void 0, void 0, function* () { - let url = util.getUrl(resource, this._baseUrl, (options || {}).queryParameters); - let res = yield this.client.del(url, this._headersFromOptions(options)); - return this.processResponse(res, options); - }); - } - /** - * Creates resource(s) from an endpoint - * T type of object returned. - * Be aware that not found returns a null. Other error conditions reject the promise - * @param {string} resource - fully qualified or relative url - * @param {IRequestOptions} requestOptions - (optional) requestOptions object - */ - create(resource, resources, options) { - return __awaiter(this, void 0, void 0, function* () { - let url = util.getUrl(resource, this._baseUrl); - let headers = this._headersFromOptions(options, true); - let data = JSON.stringify(resources, null, 2); - let res = yield this.client.post(url, data, headers); - return this.processResponse(res, options); - }); - } - /** - * Updates resource(s) from an endpoint - * T type of object returned. - * Be aware that not found returns a null. Other error conditions reject the promise - * @param {string} resource - fully qualified or relative url - * @param {IRequestOptions} requestOptions - (optional) requestOptions object - */ - update(resource, resources, options) { - return __awaiter(this, void 0, void 0, function* () { - let url = util.getUrl(resource, this._baseUrl); - let headers = this._headersFromOptions(options, true); - let data = JSON.stringify(resources, null, 2); - let res = yield this.client.patch(url, data, headers); - return this.processResponse(res, options); - }); - } - /** - * Replaces resource(s) from an endpoint - * T type of object returned. - * Be aware that not found returns a null. Other error conditions reject the promise - * @param {string} resource - fully qualified or relative url - * @param {IRequestOptions} requestOptions - (optional) requestOptions object - */ - replace(resource, resources, options) { - return __awaiter(this, void 0, void 0, function* () { - let url = util.getUrl(resource, this._baseUrl); - let headers = this._headersFromOptions(options, true); - let data = JSON.stringify(resources, null, 2); - let res = yield this.client.put(url, data, headers); - return this.processResponse(res, options); - }); - } - uploadStream(verb, requestUrl, stream, options) { - return __awaiter(this, void 0, void 0, function* () { - let url = util.getUrl(requestUrl, this._baseUrl); - let headers = this._headersFromOptions(options, true); - let res = yield this.client.sendStream(verb, url, stream, headers); - return this.processResponse(res, options); - }); - } - _headersFromOptions(options, contentType) { - options = options || {}; - let headers = options.additionalHeaders || {}; - headers["Accept"] = options.acceptHeader || "application/json"; - if (contentType) { - let found = false; - for (let header in headers) { - if (header.toLowerCase() == "content-type") { - found = true; - } - } - if (!found) { - headers["Content-Type"] = 'application/json; charset=utf-8'; - } - } - return headers; - } - static dateTimeDeserializer(key, value) { - if (typeof value === 'string') { - let a = new Date(value); - if (!isNaN(a.valueOf())) { - return a; - } - } - return value; - } - processResponse(res, options) { - return __awaiter(this, void 0, void 0, function* () { - return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - const statusCode = res.message.statusCode; - const response = { - statusCode: statusCode, - result: null, - headers: {} - }; - // not found leads to null obj returned - if (statusCode == httpm.HttpCodes.NotFound) { - resolve(response); - } - let obj; - let contents; - // get the result from the body - try { - contents = yield res.readBody(); - if (contents && contents.length > 0) { - if (options && options.deserializeDates) { - obj = JSON.parse(contents, RestClient.dateTimeDeserializer); - } - else { - obj = JSON.parse(contents); - } - if (options && options.responseProcessor) { - response.result = options.responseProcessor(obj); - } - else { - response.result = obj; - } - } - response.headers = res.message.headers; - } - catch (err) { - // Invalid resource (contents not json); leaving result obj null - } - // note that 3xx redirects are handled by the http layer. - if (statusCode > 299) { - let msg; - // if exception/error in body, attempt to get better error - if (obj && obj.message) { - msg = obj.message; - } - else if (contents && contents.length > 0) { - // it may be the case that the exception is in the body message as string - msg = contents; - } - else { - msg = "Failed request: (" + statusCode + ")"; - } - let err = new Error(msg); - // attach statusCode and body obj (if available) to the error object - err['statusCode'] = statusCode; - if (response.result) { - err['result'] = response.result; - } - reject(err); - } - else { - resolve(response); - } - })); - }); - } -} -exports.RestClient = RestClient; +"use strict"; +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const httpm = require("./HttpClient"); +const util = require("./Util"); +class RestClient { + /** + * Creates an instance of the RestClient + * @constructor + * @param {string} userAgent - userAgent for requests + * @param {string} baseUrl - (Optional) If not specified, use full urls per request. If supplied and a function passes a relative url, it will be appended to this + * @param {ifm.IRequestHandler[]} handlers - handlers are typically auth handlers (basic, bearer, ntlm supplied) + * @param {ifm.IRequestOptions} requestOptions - options for each http requests (http proxy setting, socket timeout) + */ + constructor(userAgent, baseUrl, handlers, requestOptions) { + this.client = new httpm.HttpClient(userAgent, handlers, requestOptions); + if (baseUrl) { + this._baseUrl = baseUrl; + } + } + /** + * Gets a resource from an endpoint + * Be aware that not found returns a null. Other error conditions reject the promise + * @param {string} requestUrl - fully qualified or relative url + * @param {IRequestOptions} requestOptions - (optional) requestOptions object + */ + options(requestUrl, options) { + return __awaiter(this, void 0, void 0, function* () { + let url = util.getUrl(requestUrl, this._baseUrl); + let res = yield this.client.options(url, this._headersFromOptions(options)); + return this.processResponse(res, options); + }); + } + /** + * Gets a resource from an endpoint + * Be aware that not found returns a null. Other error conditions reject the promise + * @param {string} resource - fully qualified url or relative path + * @param {IRequestOptions} requestOptions - (optional) requestOptions object + */ + get(resource, options) { + return __awaiter(this, void 0, void 0, function* () { + let url = util.getUrl(resource, this._baseUrl, (options || {}).queryParameters); + let res = yield this.client.get(url, this._headersFromOptions(options)); + return this.processResponse(res, options); + }); + } + /** + * Deletes a resource from an endpoint + * Be aware that not found returns a null. Other error conditions reject the promise + * @param {string} resource - fully qualified or relative url + * @param {IRequestOptions} requestOptions - (optional) requestOptions object + */ + del(resource, options) { + return __awaiter(this, void 0, void 0, function* () { + let url = util.getUrl(resource, this._baseUrl, (options || {}).queryParameters); + let res = yield this.client.del(url, this._headersFromOptions(options)); + return this.processResponse(res, options); + }); + } + /** + * Creates resource(s) from an endpoint + * T type of object returned. + * Be aware that not found returns a null. Other error conditions reject the promise + * @param {string} resource - fully qualified or relative url + * @param {IRequestOptions} requestOptions - (optional) requestOptions object + */ + create(resource, resources, options) { + return __awaiter(this, void 0, void 0, function* () { + let url = util.getUrl(resource, this._baseUrl); + let headers = this._headersFromOptions(options, true); + let data = JSON.stringify(resources, null, 2); + let res = yield this.client.post(url, data, headers); + return this.processResponse(res, options); + }); + } + /** + * Updates resource(s) from an endpoint + * T type of object returned. + * Be aware that not found returns a null. Other error conditions reject the promise + * @param {string} resource - fully qualified or relative url + * @param {IRequestOptions} requestOptions - (optional) requestOptions object + */ + update(resource, resources, options) { + return __awaiter(this, void 0, void 0, function* () { + let url = util.getUrl(resource, this._baseUrl); + let headers = this._headersFromOptions(options, true); + let data = JSON.stringify(resources, null, 2); + let res = yield this.client.patch(url, data, headers); + return this.processResponse(res, options); + }); + } + /** + * Replaces resource(s) from an endpoint + * T type of object returned. + * Be aware that not found returns a null. Other error conditions reject the promise + * @param {string} resource - fully qualified or relative url + * @param {IRequestOptions} requestOptions - (optional) requestOptions object + */ + replace(resource, resources, options) { + return __awaiter(this, void 0, void 0, function* () { + let url = util.getUrl(resource, this._baseUrl); + let headers = this._headersFromOptions(options, true); + let data = JSON.stringify(resources, null, 2); + let res = yield this.client.put(url, data, headers); + return this.processResponse(res, options); + }); + } + uploadStream(verb, requestUrl, stream, options) { + return __awaiter(this, void 0, void 0, function* () { + let url = util.getUrl(requestUrl, this._baseUrl); + let headers = this._headersFromOptions(options, true); + let res = yield this.client.sendStream(verb, url, stream, headers); + return this.processResponse(res, options); + }); + } + _headersFromOptions(options, contentType) { + options = options || {}; + let headers = options.additionalHeaders || {}; + headers["Accept"] = options.acceptHeader || "application/json"; + if (contentType) { + let found = false; + for (let header in headers) { + if (header.toLowerCase() == "content-type") { + found = true; + } + } + if (!found) { + headers["Content-Type"] = 'application/json; charset=utf-8'; + } + } + return headers; + } + static dateTimeDeserializer(key, value) { + if (typeof value === 'string') { + let a = new Date(value); + if (!isNaN(a.valueOf())) { + return a; + } + } + return value; + } + processResponse(res, options) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + const statusCode = res.message.statusCode; + const response = { + statusCode: statusCode, + result: null, + headers: {} + }; + // not found leads to null obj returned + if (statusCode == httpm.HttpCodes.NotFound) { + resolve(response); + } + let obj; + let contents; + // get the result from the body + try { + contents = yield res.readBody(); + if (contents && contents.length > 0) { + if (options && options.deserializeDates) { + obj = JSON.parse(contents, RestClient.dateTimeDeserializer); + } + else { + obj = JSON.parse(contents); + } + if (options && options.responseProcessor) { + response.result = options.responseProcessor(obj); + } + else { + response.result = obj; + } + } + response.headers = res.message.headers; + } + catch (err) { + // Invalid resource (contents not json); leaving result obj null + } + // note that 3xx redirects are handled by the http layer. + if (statusCode > 299) { + let msg; + // if exception/error in body, attempt to get better error + if (obj && obj.message) { + msg = obj.message; + } + else if (contents && contents.length > 0) { + // it may be the case that the exception is in the body message as string + msg = contents; + } + else { + msg = "Failed request: (" + statusCode + ")"; + } + let err = new Error(msg); + // attach statusCode and body obj (if available) to the error object + err['statusCode'] = statusCode; + if (response.result) { + err['result'] = response.result; + } + reject(err); + } + else { + resolve(response); + } + })); + }); + } +} +exports.RestClient = RestClient; diff --git a/node_modules/typed-rest-client/ThirdPartyNotice.txt b/node_modules/typed-rest-client/ThirdPartyNotice.txt index 7bd67743d..2610c8a69 100644 --- a/node_modules/typed-rest-client/ThirdPartyNotice.txt +++ b/node_modules/typed-rest-client/ThirdPartyNotice.txt @@ -1,1318 +1,1318 @@ - -THIRD-PARTY SOFTWARE NOTICES AND INFORMATION -Do Not Translate or Localize - -This Visual Studio Team Services extension (vsts-task-lib) is based on or incorporates material from the projects listed below (Third Party IP). The original copyright notice and the license under which Microsoft received such Third Party IP, are set forth below. Such licenses and notices are provided for informational purposes only. Microsoft licenses the Third Party IP to you under the licensing terms for the Visual Studio Team Services extension. Microsoft reserves all other rights not expressly granted under this agreement, whether by implication, estoppel or otherwise. - -1. @types/glob (https://www.github.com/DefinitelyTyped/DefinitelyTyped.git) -2. @types/minimatch (https://www.github.com/DefinitelyTyped/DefinitelyTyped.git) -3. @types/mocha (https://www.github.com/DefinitelyTyped/DefinitelyTyped.git) -4. @types/node (https://www.github.com/DefinitelyTyped/DefinitelyTyped.git) -5. @types/shelljs (https://www.github.com/DefinitelyTyped/DefinitelyTyped.git) -6. balanced-match (git://github.com/juliangruber/balanced-match.git) -7. brace-expansion (git://github.com/juliangruber/brace-expansion.git) -8. browser-stdout (git+ssh://git@github.com/kumavis/browser-stdout.git) -9. commander (git+https://github.com/tj/commander.js.git) -10. concat-map (git://github.com/substack/node-concat-map.git) -11. debug (git://github.com/visionmedia/debug.git) -12. diff (git://github.com/kpdecker/jsdiff.git) -13. escape-string-regexp (git+https://github.com/sindresorhus/escape-string-regexp.git) -14. fs.realpath (git+https://github.com/isaacs/fs.realpath.git) -15. glob (git://github.com/isaacs/node-glob.git) -16. graceful-readlink (git://github.com/zhiyelee/graceful-readlink.git) -17. growl (git://github.com/tj/node-growl.git) -18. has-flag (git+https://github.com/sindresorhus/has-flag.git) -19. he (git+https://github.com/mathiasbynens/he.git) -20. inflight (git+https://github.com/npm/inflight.git) -21. inherits (git://github.com/isaacs/inherits.git) -22. interpret (git://github.com/tkellen/node-interpret.git) -23. json3 (git://github.com/bestiejs/json3.git) -24. lodash.create (git+https://github.com/lodash/lodash.git) -25. lodash.isarguments (git+https://github.com/lodash/lodash.git) -26. lodash.isarray (git+https://github.com/lodash/lodash.git) -27. lodash.keys (git+https://github.com/lodash/lodash.git) -28. lodash._baseassign (git+https://github.com/lodash/lodash.git) -29. lodash._basecopy (git+https://github.com/lodash/lodash.git) -30. lodash._basecreate (git+https://github.com/lodash/lodash.git) -31. lodash._getnative (git+https://github.com/lodash/lodash.git) -32. lodash._isiterateecall (git+https://github.com/lodash/lodash.git) -33. minimatch (git://github.com/isaacs/minimatch.git) -34. minimist (git://github.com/substack/minimist.git) -35. mkdirp (git+https://github.com/substack/node-mkdirp.git) -36. mocha (git+https://github.com/mochajs/mocha.git) -37. ms (git+https://github.com/zeit/ms.git) -38. once (git://github.com/isaacs/once.git) -39. path-is-absolute (git+https://github.com/sindresorhus/path-is-absolute.git) -40. path-parse (git+https://github.com/jbgutierrez/path-parse.git) -41. rechoir (git://github.com/tkellen/node-rechoir.git) -42. resolve (git://github.com/substack/node-resolve.git) -43. semver (git://github.com/npm/node-semver.git) -44. shelljs (git://github.com/shelljs/shelljs.git) -45. supports-color (git+https://github.com/chalk/supports-color.git) -46. tunnel (git+https://github.com/koichik/node-tunnel.git) -47. typescript (git+https://github.com/Microsoft/TypeScript.git) -48. underscore (git://github.com/jashkenas/underscore.git) -49. wrappy (git+https://github.com/npm/wrappy.git) - - -%% @types/glob NOTICES, INFORMATION, AND LICENSE BEGIN HERE -========================================= -MIT License - - Copyright (c) Microsoft Corporation. All rights reserved. - - 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 -========================================= -END OF @types/glob NOTICES, INFORMATION, AND LICENSE - -%% @types/minimatch NOTICES, INFORMATION, AND LICENSE BEGIN HERE -========================================= -MIT License - - Copyright (c) Microsoft Corporation. All rights reserved. - - 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 -========================================= -END OF @types/minimatch NOTICES, INFORMATION, AND LICENSE - -%% @types/mocha NOTICES, INFORMATION, AND LICENSE BEGIN HERE -========================================= -MIT License - - Copyright (c) Microsoft Corporation. All rights reserved. - - 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 -========================================= -END OF @types/mocha NOTICES, INFORMATION, AND LICENSE - -%% @types/node NOTICES, INFORMATION, AND LICENSE BEGIN HERE -========================================= -MIT License - - Copyright (c) Microsoft Corporation. All rights reserved. - - 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 -========================================= -END OF @types/node NOTICES, INFORMATION, AND LICENSE - -%% @types/shelljs NOTICES, INFORMATION, AND LICENSE BEGIN HERE -========================================= -MIT License - - Copyright (c) Microsoft Corporation. All rights reserved. - - 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 -========================================= -END OF @types/shelljs NOTICES, INFORMATION, AND LICENSE - -%% balanced-match NOTICES, INFORMATION, AND LICENSE BEGIN HERE -========================================= -(MIT) - -Copyright (c) 2013 Julian Gruber <julian@juliangruber.com> - -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. -========================================= -END OF balanced-match NOTICES, INFORMATION, AND LICENSE - -%% brace-expansion NOTICES, INFORMATION, AND LICENSE BEGIN HERE -========================================= -No license text available. -========================================= -END OF brace-expansion NOTICES, INFORMATION, AND LICENSE - -%% browser-stdout NOTICES, INFORMATION, AND LICENSE BEGIN HERE -========================================= -No license text available. -========================================= -END OF browser-stdout NOTICES, INFORMATION, AND LICENSE - -%% commander NOTICES, INFORMATION, AND LICENSE BEGIN HERE -========================================= -(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. -========================================= -END OF commander NOTICES, INFORMATION, AND LICENSE - -%% concat-map NOTICES, INFORMATION, AND LICENSE BEGIN HERE -========================================= -This software is released under the MIT license: - -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. -========================================= -END OF concat-map NOTICES, INFORMATION, AND LICENSE - -%% debug NOTICES, INFORMATION, AND LICENSE BEGIN HERE -========================================= -(The MIT License) - -Copyright (c) 2014 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. -========================================= -END OF debug NOTICES, INFORMATION, AND LICENSE - -%% diff NOTICES, INFORMATION, AND LICENSE BEGIN HERE -========================================= -Software License Agreement (BSD License) - -Copyright (c) 2009-2015, Kevin Decker - -All rights reserved. - -Redistribution and use of this software in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - -* Redistributions of source code must retain the above - copyright notice, this list of conditions and the - following disclaimer. - -* Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the - following disclaimer in the documentation and/or other - materials provided with the distribution. - -* Neither the name of Kevin Decker nor the names of its - contributors may be used to endorse or promote products - derived from this software without specific prior - written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -========================================= -END OF diff NOTICES, INFORMATION, AND LICENSE - -%% escape-string-regexp NOTICES, INFORMATION, AND LICENSE BEGIN HERE -========================================= -The MIT License (MIT) - -Copyright (c) Sindre Sorhus (sindresorhus.com) - -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. -========================================= -END OF escape-string-regexp NOTICES, INFORMATION, AND LICENSE - -%% fs.realpath NOTICES, INFORMATION, AND LICENSE BEGIN HERE -========================================= -The ISC License - -Copyright (c) Isaac Z. Schlueter and Contributors - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR -IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ----- - -This library bundles a version of the `fs.realpath` and `fs.realpathSync` -methods from Node.js v0.10 under the terms of the Node.js MIT license. - -Node's license follows, also included at the header of `old.js` which contains -the licensed code: - - Copyright Joyent, Inc. and other Node contributors. - - 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. -========================================= -END OF fs.realpath NOTICES, INFORMATION, AND LICENSE - -%% glob NOTICES, INFORMATION, AND LICENSE BEGIN HERE -========================================= -The ISC License - -Copyright (c) Isaac Z. Schlueter and Contributors - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR -IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -========================================= -END OF glob NOTICES, INFORMATION, AND LICENSE - -%% graceful-readlink NOTICES, INFORMATION, AND LICENSE BEGIN HERE -========================================= -The MIT License (MIT) - -Copyright (c) 2015 Zhiye Li - -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. -========================================= -END OF graceful-readlink NOTICES, INFORMATION, AND LICENSE - -%% growl NOTICES, INFORMATION, AND LICENSE BEGIN HERE -========================================= -No license text available. -========================================= -END OF growl NOTICES, INFORMATION, AND LICENSE - -%% has-flag NOTICES, INFORMATION, AND LICENSE BEGIN HERE -========================================= -The MIT License (MIT) - -Copyright (c) Sindre Sorhus (sindresorhus.com) - -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. -========================================= -END OF has-flag NOTICES, INFORMATION, AND LICENSE - -%% he NOTICES, INFORMATION, AND LICENSE BEGIN HERE -========================================= -Copyright Mathias Bynens - -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. -========================================= -END OF he NOTICES, INFORMATION, AND LICENSE - -%% inflight NOTICES, INFORMATION, AND LICENSE BEGIN HERE -========================================= -The ISC License - -Copyright (c) Isaac Z. Schlueter - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR -IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -========================================= -END OF inflight NOTICES, INFORMATION, AND LICENSE - -%% inherits NOTICES, INFORMATION, AND LICENSE BEGIN HERE -========================================= -The ISC License - -Copyright (c) Isaac Z. Schlueter - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -========================================= -END OF inherits NOTICES, INFORMATION, AND LICENSE - -%% interpret NOTICES, INFORMATION, AND LICENSE BEGIN HERE -========================================= -Copyright (c) 2014 Tyler Kellen - -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. -========================================= -END OF interpret NOTICES, INFORMATION, AND LICENSE - -%% json3 NOTICES, INFORMATION, AND LICENSE BEGIN HERE -========================================= -Copyright (c) 2012-2014 Kit Cambridge. -http://kitcambridge.be/ - -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. -========================================= -END OF json3 NOTICES, INFORMATION, AND LICENSE - -%% lodash.create NOTICES, INFORMATION, AND LICENSE BEGIN HERE -========================================= -Copyright 2012-2015 The Dojo Foundation -Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, -DocumentCloud and Investigative Reporters & Editors - -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. -========================================= -END OF lodash.create NOTICES, INFORMATION, AND LICENSE - -%% lodash.isarguments NOTICES, INFORMATION, AND LICENSE BEGIN HERE -========================================= -Copyright jQuery Foundation and other contributors - -Based on Underscore.js, copyright Jeremy Ashkenas, -DocumentCloud and Investigative Reporters & Editors - -This software consists of voluntary contributions made by many -individuals. For exact contribution history, see the revision history -available at https://github.com/lodash/lodash - -The following license applies to all parts of this software except as -documented below: - -==== - -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. - -==== - -Copyright and related rights for sample code are waived via CC0. Sample -code is defined as all source code displayed within the prose of the -documentation. - -CC0: http://creativecommons.org/publicdomain/zero/1.0/ - -==== - -Files located in the node_modules and vendor directories are externally -maintained libraries used by this software which have their own -licenses; we recommend you read them, as their terms may differ from the -terms above. -========================================= -END OF lodash.isarguments NOTICES, INFORMATION, AND LICENSE - -%% lodash.isarray NOTICES, INFORMATION, AND LICENSE BEGIN HERE -========================================= -Copyright 2012-2015 The Dojo Foundation -Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, -DocumentCloud and Investigative Reporters & Editors - -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. -========================================= -END OF lodash.isarray NOTICES, INFORMATION, AND LICENSE - -%% lodash.keys NOTICES, INFORMATION, AND LICENSE BEGIN HERE -========================================= -Copyright 2012-2015 The Dojo Foundation -Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, -DocumentCloud and Investigative Reporters & Editors - -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. -========================================= -END OF lodash.keys NOTICES, INFORMATION, AND LICENSE - -%% lodash._baseassign NOTICES, INFORMATION, AND LICENSE BEGIN HERE -========================================= -Copyright 2012-2015 The Dojo Foundation -Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, -DocumentCloud and Investigative Reporters & Editors - -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. -========================================= -END OF lodash._baseassign NOTICES, INFORMATION, AND LICENSE - -%% lodash._basecopy NOTICES, INFORMATION, AND LICENSE BEGIN HERE -========================================= -Copyright 2012-2015 The Dojo Foundation -Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, -DocumentCloud and Investigative Reporters & Editors - -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. -========================================= -END OF lodash._basecopy NOTICES, INFORMATION, AND LICENSE - -%% lodash._basecreate NOTICES, INFORMATION, AND LICENSE BEGIN HERE -========================================= -Copyright 2012-2015 The Dojo Foundation -Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, -DocumentCloud and Investigative Reporters & Editors - -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. -========================================= -END OF lodash._basecreate NOTICES, INFORMATION, AND LICENSE - -%% lodash._getnative NOTICES, INFORMATION, AND LICENSE BEGIN HERE -========================================= -Copyright 2012-2015 The Dojo Foundation -Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, -DocumentCloud and Investigative Reporters & Editors - -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. -========================================= -END OF lodash._getnative NOTICES, INFORMATION, AND LICENSE - -%% lodash._isiterateecall NOTICES, INFORMATION, AND LICENSE BEGIN HERE -========================================= -Copyright 2012-2015 The Dojo Foundation -Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, -DocumentCloud and Investigative Reporters & Editors - -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. -========================================= -END OF lodash._isiterateecall NOTICES, INFORMATION, AND LICENSE - -%% minimatch NOTICES, INFORMATION, AND LICENSE BEGIN HERE -========================================= -The ISC License - -Copyright (c) Isaac Z. Schlueter and Contributors - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR -IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -========================================= -END OF minimatch NOTICES, INFORMATION, AND LICENSE - -%% minimist NOTICES, INFORMATION, AND LICENSE BEGIN HERE -========================================= -This software is released under the MIT license: - -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. -========================================= -END OF minimist NOTICES, INFORMATION, AND LICENSE - -%% mkdirp NOTICES, INFORMATION, AND LICENSE BEGIN HERE -========================================= -Copyright 2010 James Halliday (mail@substack.net) - -This project is free software released under the MIT/X11 license: - -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. -========================================= -END OF mkdirp NOTICES, INFORMATION, AND LICENSE - -%% mocha NOTICES, INFORMATION, AND LICENSE BEGIN HERE -========================================= -(The MIT License) - -Copyright (c) 2011-2017 JS Foundation and contributors, https://js.foundation - -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. -========================================= -END OF mocha NOTICES, INFORMATION, AND LICENSE - -%% ms NOTICES, INFORMATION, AND LICENSE BEGIN HERE -========================================= -The MIT License (MIT) - -Copyright (c) 2016 Zeit, 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. -========================================= -END OF ms NOTICES, INFORMATION, AND LICENSE - -%% once NOTICES, INFORMATION, AND LICENSE BEGIN HERE -========================================= -The ISC License - -Copyright (c) Isaac Z. Schlueter and Contributors - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR -IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -========================================= -END OF once NOTICES, INFORMATION, AND LICENSE - -%% path-is-absolute NOTICES, INFORMATION, AND LICENSE BEGIN HERE -========================================= -The MIT License (MIT) - -Copyright (c) Sindre Sorhus (sindresorhus.com) - -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. -========================================= -END OF path-is-absolute NOTICES, INFORMATION, AND LICENSE - -%% path-parse NOTICES, INFORMATION, AND LICENSE BEGIN HERE -========================================= -No license text available. -========================================= -END OF path-parse NOTICES, INFORMATION, AND LICENSE - -%% rechoir NOTICES, INFORMATION, AND LICENSE BEGIN HERE -========================================= -Copyright (c) 2015 Tyler Kellen - -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. -========================================= -END OF rechoir NOTICES, INFORMATION, AND LICENSE - -%% resolve NOTICES, INFORMATION, AND LICENSE BEGIN HERE -========================================= -This software is released under the MIT license: - -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. -========================================= -END OF resolve NOTICES, INFORMATION, AND LICENSE - -%% semver NOTICES, INFORMATION, AND LICENSE BEGIN HERE -========================================= -Copyright (c) Isaac Z. Schlueter ("Author") -All rights reserved. - -The BSD License - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS -BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR -BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN -IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -========================================= -END OF semver NOTICES, INFORMATION, AND LICENSE - -%% shelljs NOTICES, INFORMATION, AND LICENSE BEGIN HERE -========================================= -Copyright (c) 2012, Artur Adib -All rights reserved. - -You may use this project under the terms of the New BSD license as follows: - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of Artur Adib nor the - names of the contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL ARTUR ADIB BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -========================================= -END OF shelljs NOTICES, INFORMATION, AND LICENSE - -%% supports-color NOTICES, INFORMATION, AND LICENSE BEGIN HERE -========================================= -The MIT License (MIT) - -Copyright (c) Sindre Sorhus (sindresorhus.com) - -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. -========================================= -END OF supports-color NOTICES, INFORMATION, AND LICENSE - -%% tunnel NOTICES, INFORMATION, AND LICENSE BEGIN HERE -========================================= -The MIT License (MIT) - -Copyright (c) 2012 Koichi Kobayashi - -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. -========================================= -END OF tunnel NOTICES, INFORMATION, AND LICENSE - -%% typescript NOTICES, INFORMATION, AND LICENSE BEGIN HERE -========================================= -Apache License - -Version 2.0, January 2004 - -http://www.apache.org/licenses/ - -TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - -1. Definitions. - -"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. - -"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. - -"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. - -"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. - -"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. - -"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. - -"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). - -"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. - -"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." - -"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. - -2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. - -3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. - -4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: - -You must give any other recipients of the Work or Derivative Works a copy of this License; and - -You must cause any modified files to carry prominent notices stating that You changed the files; and - -You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and - -If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. - -5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. - -6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. - -7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. - -8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. - -9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. - -END OF TERMS AND CONDITIONS -========================================= -END OF typescript NOTICES, INFORMATION, AND LICENSE - -%% underscore NOTICES, INFORMATION, AND LICENSE BEGIN HERE -========================================= -Copyright (c) 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative -Reporters & Editors - -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. -========================================= -END OF underscore NOTICES, INFORMATION, AND LICENSE - -%% wrappy NOTICES, INFORMATION, AND LICENSE BEGIN HERE -========================================= -The ISC License - -Copyright (c) Isaac Z. Schlueter and Contributors - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR -IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -========================================= -END OF wrappy NOTICES, INFORMATION, AND LICENSE - + +THIRD-PARTY SOFTWARE NOTICES AND INFORMATION +Do Not Translate or Localize + +This Visual Studio Team Services extension (vsts-task-lib) is based on or incorporates material from the projects listed below (Third Party IP). The original copyright notice and the license under which Microsoft received such Third Party IP, are set forth below. Such licenses and notices are provided for informational purposes only. Microsoft licenses the Third Party IP to you under the licensing terms for the Visual Studio Team Services extension. Microsoft reserves all other rights not expressly granted under this agreement, whether by implication, estoppel or otherwise. + +1. @types/glob (https://www.github.com/DefinitelyTyped/DefinitelyTyped.git) +2. @types/minimatch (https://www.github.com/DefinitelyTyped/DefinitelyTyped.git) +3. @types/mocha (https://www.github.com/DefinitelyTyped/DefinitelyTyped.git) +4. @types/node (https://www.github.com/DefinitelyTyped/DefinitelyTyped.git) +5. @types/shelljs (https://www.github.com/DefinitelyTyped/DefinitelyTyped.git) +6. balanced-match (git://github.com/juliangruber/balanced-match.git) +7. brace-expansion (git://github.com/juliangruber/brace-expansion.git) +8. browser-stdout (git+ssh://git@github.com/kumavis/browser-stdout.git) +9. commander (git+https://github.com/tj/commander.js.git) +10. concat-map (git://github.com/substack/node-concat-map.git) +11. debug (git://github.com/visionmedia/debug.git) +12. diff (git://github.com/kpdecker/jsdiff.git) +13. escape-string-regexp (git+https://github.com/sindresorhus/escape-string-regexp.git) +14. fs.realpath (git+https://github.com/isaacs/fs.realpath.git) +15. glob (git://github.com/isaacs/node-glob.git) +16. graceful-readlink (git://github.com/zhiyelee/graceful-readlink.git) +17. growl (git://github.com/tj/node-growl.git) +18. has-flag (git+https://github.com/sindresorhus/has-flag.git) +19. he (git+https://github.com/mathiasbynens/he.git) +20. inflight (git+https://github.com/npm/inflight.git) +21. inherits (git://github.com/isaacs/inherits.git) +22. interpret (git://github.com/tkellen/node-interpret.git) +23. json3 (git://github.com/bestiejs/json3.git) +24. lodash.create (git+https://github.com/lodash/lodash.git) +25. lodash.isarguments (git+https://github.com/lodash/lodash.git) +26. lodash.isarray (git+https://github.com/lodash/lodash.git) +27. lodash.keys (git+https://github.com/lodash/lodash.git) +28. lodash._baseassign (git+https://github.com/lodash/lodash.git) +29. lodash._basecopy (git+https://github.com/lodash/lodash.git) +30. lodash._basecreate (git+https://github.com/lodash/lodash.git) +31. lodash._getnative (git+https://github.com/lodash/lodash.git) +32. lodash._isiterateecall (git+https://github.com/lodash/lodash.git) +33. minimatch (git://github.com/isaacs/minimatch.git) +34. minimist (git://github.com/substack/minimist.git) +35. mkdirp (git+https://github.com/substack/node-mkdirp.git) +36. mocha (git+https://github.com/mochajs/mocha.git) +37. ms (git+https://github.com/zeit/ms.git) +38. once (git://github.com/isaacs/once.git) +39. path-is-absolute (git+https://github.com/sindresorhus/path-is-absolute.git) +40. path-parse (git+https://github.com/jbgutierrez/path-parse.git) +41. rechoir (git://github.com/tkellen/node-rechoir.git) +42. resolve (git://github.com/substack/node-resolve.git) +43. semver (git://github.com/npm/node-semver.git) +44. shelljs (git://github.com/shelljs/shelljs.git) +45. supports-color (git+https://github.com/chalk/supports-color.git) +46. tunnel (git+https://github.com/koichik/node-tunnel.git) +47. typescript (git+https://github.com/Microsoft/TypeScript.git) +48. underscore (git://github.com/jashkenas/underscore.git) +49. wrappy (git+https://github.com/npm/wrappy.git) + + +%% @types/glob NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +MIT License + + Copyright (c) Microsoft Corporation. All rights reserved. + + 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 +========================================= +END OF @types/glob NOTICES, INFORMATION, AND LICENSE + +%% @types/minimatch NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +MIT License + + Copyright (c) Microsoft Corporation. All rights reserved. + + 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 +========================================= +END OF @types/minimatch NOTICES, INFORMATION, AND LICENSE + +%% @types/mocha NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +MIT License + + Copyright (c) Microsoft Corporation. All rights reserved. + + 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 +========================================= +END OF @types/mocha NOTICES, INFORMATION, AND LICENSE + +%% @types/node NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +MIT License + + Copyright (c) Microsoft Corporation. All rights reserved. + + 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 +========================================= +END OF @types/node NOTICES, INFORMATION, AND LICENSE + +%% @types/shelljs NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +MIT License + + Copyright (c) Microsoft Corporation. All rights reserved. + + 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 +========================================= +END OF @types/shelljs NOTICES, INFORMATION, AND LICENSE + +%% balanced-match NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +(MIT) + +Copyright (c) 2013 Julian Gruber <julian@juliangruber.com> + +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. +========================================= +END OF balanced-match NOTICES, INFORMATION, AND LICENSE + +%% brace-expansion NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +No license text available. +========================================= +END OF brace-expansion NOTICES, INFORMATION, AND LICENSE + +%% browser-stdout NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +No license text available. +========================================= +END OF browser-stdout NOTICES, INFORMATION, AND LICENSE + +%% commander NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +(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. +========================================= +END OF commander NOTICES, INFORMATION, AND LICENSE + +%% concat-map NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +This software is released under the MIT license: + +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. +========================================= +END OF concat-map NOTICES, INFORMATION, AND LICENSE + +%% debug NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +(The MIT License) + +Copyright (c) 2014 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. +========================================= +END OF debug NOTICES, INFORMATION, AND LICENSE + +%% diff NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +Software License Agreement (BSD License) + +Copyright (c) 2009-2015, Kevin Decker + +All rights reserved. + +Redistribution and use of this software in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above + copyright notice, this list of conditions and the + following disclaimer. + +* Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the + following disclaimer in the documentation and/or other + materials provided with the distribution. + +* Neither the name of Kevin Decker nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior + written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR +CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER +IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT +OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +========================================= +END OF diff NOTICES, INFORMATION, AND LICENSE + +%% escape-string-regexp NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +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. +========================================= +END OF escape-string-regexp NOTICES, INFORMATION, AND LICENSE + +%% fs.realpath NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +---- + +This library bundles a version of the `fs.realpath` and `fs.realpathSync` +methods from Node.js v0.10 under the terms of the Node.js MIT license. + +Node's license follows, also included at the header of `old.js` which contains +the licensed code: + + Copyright Joyent, Inc. and other Node contributors. + + 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. +========================================= +END OF fs.realpath NOTICES, INFORMATION, AND LICENSE + +%% glob NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +========================================= +END OF glob NOTICES, INFORMATION, AND LICENSE + +%% graceful-readlink NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +The MIT License (MIT) + +Copyright (c) 2015 Zhiye Li + +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. +========================================= +END OF graceful-readlink NOTICES, INFORMATION, AND LICENSE + +%% growl NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +No license text available. +========================================= +END OF growl NOTICES, INFORMATION, AND LICENSE + +%% has-flag NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +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. +========================================= +END OF has-flag NOTICES, INFORMATION, AND LICENSE + +%% he NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +Copyright Mathias Bynens + +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. +========================================= +END OF he NOTICES, INFORMATION, AND LICENSE + +%% inflight NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +The ISC License + +Copyright (c) Isaac Z. Schlueter + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +========================================= +END OF inflight NOTICES, INFORMATION, AND LICENSE + +%% inherits NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +The ISC License + +Copyright (c) Isaac Z. Schlueter + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +========================================= +END OF inherits NOTICES, INFORMATION, AND LICENSE + +%% interpret NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +Copyright (c) 2014 Tyler Kellen + +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. +========================================= +END OF interpret NOTICES, INFORMATION, AND LICENSE + +%% json3 NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +Copyright (c) 2012-2014 Kit Cambridge. +http://kitcambridge.be/ + +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. +========================================= +END OF json3 NOTICES, INFORMATION, AND LICENSE + +%% lodash.create NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +Copyright 2012-2015 The Dojo Foundation +Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors + +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. +========================================= +END OF lodash.create NOTICES, INFORMATION, AND LICENSE + +%% lodash.isarguments NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +Copyright jQuery Foundation and other contributors + +Based on Underscore.js, copyright Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors + +This software consists of voluntary contributions made by many +individuals. For exact contribution history, see the revision history +available at https://github.com/lodash/lodash + +The following license applies to all parts of this software except as +documented below: + +==== + +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. + +==== + +Copyright and related rights for sample code are waived via CC0. Sample +code is defined as all source code displayed within the prose of the +documentation. + +CC0: http://creativecommons.org/publicdomain/zero/1.0/ + +==== + +Files located in the node_modules and vendor directories are externally +maintained libraries used by this software which have their own +licenses; we recommend you read them, as their terms may differ from the +terms above. +========================================= +END OF lodash.isarguments NOTICES, INFORMATION, AND LICENSE + +%% lodash.isarray NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +Copyright 2012-2015 The Dojo Foundation +Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors + +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. +========================================= +END OF lodash.isarray NOTICES, INFORMATION, AND LICENSE + +%% lodash.keys NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +Copyright 2012-2015 The Dojo Foundation +Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors + +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. +========================================= +END OF lodash.keys NOTICES, INFORMATION, AND LICENSE + +%% lodash._baseassign NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +Copyright 2012-2015 The Dojo Foundation +Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors + +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. +========================================= +END OF lodash._baseassign NOTICES, INFORMATION, AND LICENSE + +%% lodash._basecopy NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +Copyright 2012-2015 The Dojo Foundation +Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors + +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. +========================================= +END OF lodash._basecopy NOTICES, INFORMATION, AND LICENSE + +%% lodash._basecreate NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +Copyright 2012-2015 The Dojo Foundation +Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors + +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. +========================================= +END OF lodash._basecreate NOTICES, INFORMATION, AND LICENSE + +%% lodash._getnative NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +Copyright 2012-2015 The Dojo Foundation +Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors + +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. +========================================= +END OF lodash._getnative NOTICES, INFORMATION, AND LICENSE + +%% lodash._isiterateecall NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +Copyright 2012-2015 The Dojo Foundation +Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors + +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. +========================================= +END OF lodash._isiterateecall NOTICES, INFORMATION, AND LICENSE + +%% minimatch NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +========================================= +END OF minimatch NOTICES, INFORMATION, AND LICENSE + +%% minimist NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +This software is released under the MIT license: + +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. +========================================= +END OF minimist NOTICES, INFORMATION, AND LICENSE + +%% mkdirp NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +Copyright 2010 James Halliday (mail@substack.net) + +This project is free software released under the MIT/X11 license: + +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. +========================================= +END OF mkdirp NOTICES, INFORMATION, AND LICENSE + +%% mocha NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +(The MIT License) + +Copyright (c) 2011-2017 JS Foundation and contributors, https://js.foundation + +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. +========================================= +END OF mocha NOTICES, INFORMATION, AND LICENSE + +%% ms NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +The MIT License (MIT) + +Copyright (c) 2016 Zeit, 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. +========================================= +END OF ms NOTICES, INFORMATION, AND LICENSE + +%% once NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +========================================= +END OF once NOTICES, INFORMATION, AND LICENSE + +%% path-is-absolute NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +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. +========================================= +END OF path-is-absolute NOTICES, INFORMATION, AND LICENSE + +%% path-parse NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +No license text available. +========================================= +END OF path-parse NOTICES, INFORMATION, AND LICENSE + +%% rechoir NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +Copyright (c) 2015 Tyler Kellen + +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. +========================================= +END OF rechoir NOTICES, INFORMATION, AND LICENSE + +%% resolve NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +This software is released under the MIT license: + +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. +========================================= +END OF resolve NOTICES, INFORMATION, AND LICENSE + +%% semver NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +Copyright (c) Isaac Z. Schlueter ("Author") +All rights reserved. + +The BSD License + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS +BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN +IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +========================================= +END OF semver NOTICES, INFORMATION, AND LICENSE + +%% shelljs NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +Copyright (c) 2012, Artur Adib +All rights reserved. + +You may use this project under the terms of the New BSD license as follows: + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Artur Adib nor the + names of the contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL ARTUR ADIB BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +========================================= +END OF shelljs NOTICES, INFORMATION, AND LICENSE + +%% supports-color NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +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. +========================================= +END OF supports-color NOTICES, INFORMATION, AND LICENSE + +%% tunnel NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +The MIT License (MIT) + +Copyright (c) 2012 Koichi Kobayashi + +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. +========================================= +END OF tunnel NOTICES, INFORMATION, AND LICENSE + +%% typescript NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +Apache License + +Version 2.0, January 2004 + +http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + +"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. + +"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + +"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + +"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. + +"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. + +"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. + +"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). + +"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. + +"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." + +"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: + +You must give any other recipients of the Work or Derivative Works a copy of this License; and + +You must cause any modified files to carry prominent notices stating that You changed the files; and + +You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and + +If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS +========================================= +END OF typescript NOTICES, INFORMATION, AND LICENSE + +%% underscore NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +Copyright (c) 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative +Reporters & Editors + +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. +========================================= +END OF underscore NOTICES, INFORMATION, AND LICENSE + +%% wrappy NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +========================================= +END OF wrappy NOTICES, INFORMATION, AND LICENSE + diff --git a/node_modules/typed-rest-client/Util.d.ts b/node_modules/typed-rest-client/Util.d.ts index d0e8acd56..d4ecfbde4 100644 --- a/node_modules/typed-rest-client/Util.d.ts +++ b/node_modules/typed-rest-client/Util.d.ts @@ -1,37 +1,37 @@ -/// -import { IRequestQueryParams, IHttpClientResponse } from './Interfaces'; -/** - * creates an url from a request url and optional base url (http://server:8080) - * @param {string} resource - a fully qualified url or relative path - * @param {string} baseUrl - an optional baseUrl (http://server:8080) - * @param {IRequestOptions} options - an optional options object, could include QueryParameters e.g. - * @return {string} - resultant url - */ -export declare function getUrl(resource: string, baseUrl?: string, queryParams?: IRequestQueryParams): string; -/** - * Decompress/Decode gzip encoded JSON - * Using Node.js built-in zlib module - * - * @param {Buffer} buffer - * @param {string} charset? - optional; defaults to 'utf-8' - * @return {Promise} - */ -export declare function decompressGzippedContent(buffer: Buffer, charset?: string): Promise; -/** - * Builds a RegExp to test urls against for deciding - * wether to bypass proxy from an entry of the - * environment variable setting NO_PROXY - * - * @param {string} bypass - * @return {RegExp} - */ -export declare function buildProxyBypassRegexFromEnv(bypass: string): RegExp; -/** - * Obtain Response's Content Charset. - * Through inspecting `content-type` response header. - * It Returns 'utf-8' if NO charset specified/matched. - * - * @param {IHttpClientResponse} response - * @return {string} - Content Encoding Charset; Default=utf-8 - */ -export declare function obtainContentCharset(response: IHttpClientResponse): string; +/// +import { IRequestQueryParams, IHttpClientResponse } from './Interfaces'; +/** + * creates an url from a request url and optional base url (http://server:8080) + * @param {string} resource - a fully qualified url or relative path + * @param {string} baseUrl - an optional baseUrl (http://server:8080) + * @param {IRequestOptions} options - an optional options object, could include QueryParameters e.g. + * @return {string} - resultant url + */ +export declare function getUrl(resource: string, baseUrl?: string, queryParams?: IRequestQueryParams): string; +/** + * Decompress/Decode gzip encoded JSON + * Using Node.js built-in zlib module + * + * @param {Buffer} buffer + * @param {string} charset? - optional; defaults to 'utf-8' + * @return {Promise} + */ +export declare function decompressGzippedContent(buffer: Buffer, charset?: string): Promise; +/** + * Builds a RegExp to test urls against for deciding + * wether to bypass proxy from an entry of the + * environment variable setting NO_PROXY + * + * @param {string} bypass + * @return {RegExp} + */ +export declare function buildProxyBypassRegexFromEnv(bypass: string): RegExp; +/** + * Obtain Response's Content Charset. + * Through inspecting `content-type` response header. + * It Returns 'utf-8' if NO charset specified/matched. + * + * @param {IHttpClientResponse} response + * @return {string} - Content Encoding Charset; Default=utf-8 + */ +export declare function obtainContentCharset(response: IHttpClientResponse): string; diff --git a/node_modules/typed-rest-client/Util.js b/node_modules/typed-rest-client/Util.js index 228decc60..ed6273b56 100644 --- a/node_modules/typed-rest-client/Util.js +++ b/node_modules/typed-rest-client/Util.js @@ -1,141 +1,141 @@ -"use strict"; -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -Object.defineProperty(exports, "__esModule", { value: true }); -const qs = require("qs"); -const url = require("url"); -const path = require("path"); -const zlib = require("zlib"); -/** - * creates an url from a request url and optional base url (http://server:8080) - * @param {string} resource - a fully qualified url or relative path - * @param {string} baseUrl - an optional baseUrl (http://server:8080) - * @param {IRequestOptions} options - an optional options object, could include QueryParameters e.g. - * @return {string} - resultant url - */ -function getUrl(resource, baseUrl, queryParams) { - const pathApi = path.posix || path; - let requestUrl = ''; - if (!baseUrl) { - requestUrl = resource; - } - else if (!resource) { - requestUrl = baseUrl; - } - else { - const base = url.parse(baseUrl); - const resultantUrl = url.parse(resource); - // resource (specific per request) elements take priority - resultantUrl.protocol = resultantUrl.protocol || base.protocol; - resultantUrl.auth = resultantUrl.auth || base.auth; - resultantUrl.host = resultantUrl.host || base.host; - resultantUrl.pathname = pathApi.resolve(base.pathname, resultantUrl.pathname); - if (!resultantUrl.pathname.endsWith('/') && resource.endsWith('/')) { - resultantUrl.pathname += '/'; - } - requestUrl = url.format(resultantUrl); - } - return queryParams ? - getUrlWithParsedQueryParams(requestUrl, queryParams) : - requestUrl; -} -exports.getUrl = getUrl; -/** - * - * @param {string} requestUrl - * @param {IRequestQueryParams} queryParams - * @return {string} - Request's URL with Query Parameters appended/parsed. - */ -function getUrlWithParsedQueryParams(requestUrl, queryParams) { - const url = requestUrl.replace(/\?$/g, ''); // Clean any extra end-of-string "?" character - const parsedQueryParams = qs.stringify(queryParams.params, buildParamsStringifyOptions(queryParams)); - return `${url}${parsedQueryParams}`; -} -/** - * Build options for QueryParams Stringifying. - * - * @param {IRequestQueryParams} queryParams - * @return {object} - */ -function buildParamsStringifyOptions(queryParams) { - let options = { - addQueryPrefix: true, - delimiter: (queryParams.options || {}).separator || '&', - allowDots: (queryParams.options || {}).shouldAllowDots || false, - arrayFormat: (queryParams.options || {}).arrayFormat || 'repeat', - encodeValuesOnly: (queryParams.options || {}).shouldOnlyEncodeValues || true - }; - return options; -} -/** - * Decompress/Decode gzip encoded JSON - * Using Node.js built-in zlib module - * - * @param {Buffer} buffer - * @param {string} charset? - optional; defaults to 'utf-8' - * @return {Promise} - */ -function decompressGzippedContent(buffer, charset) { - return __awaiter(this, void 0, void 0, function* () { - return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - zlib.gunzip(buffer, function (error, buffer) { - if (error) { - reject(error); - } - resolve(buffer.toString(charset || 'utf-8')); - }); - })); - }); -} -exports.decompressGzippedContent = decompressGzippedContent; -/** - * Builds a RegExp to test urls against for deciding - * wether to bypass proxy from an entry of the - * environment variable setting NO_PROXY - * - * @param {string} bypass - * @return {RegExp} - */ -function buildProxyBypassRegexFromEnv(bypass) { - try { - // We need to keep this around for back-compat purposes - return new RegExp(bypass, 'i'); - } - catch (err) { - if (err instanceof SyntaxError && (bypass || "").startsWith("*")) { - let wildcardEscaped = bypass.replace('*', '(.*)'); - return new RegExp(wildcardEscaped, 'i'); - } - throw err; - } -} -exports.buildProxyBypassRegexFromEnv = buildProxyBypassRegexFromEnv; -/** - * Obtain Response's Content Charset. - * Through inspecting `content-type` response header. - * It Returns 'utf-8' if NO charset specified/matched. - * - * @param {IHttpClientResponse} response - * @return {string} - Content Encoding Charset; Default=utf-8 - */ -function obtainContentCharset(response) { - // Find the charset, if specified. - // Search for the `charset=CHARSET` string, not including `;,\r\n` - // Example: content-type: 'application/json;charset=utf-8' - // |__ matches would be ['charset=utf-8', 'utf-8', index: 18, input: 'application/json; charset=utf-8'] - // |_____ matches[1] would have the charset :tada: , in our example it's utf-8 - // However, if the matches Array was empty or no charset found, 'utf-8' would be returned by default. - const nodeSupportedEncodings = ['ascii', 'utf8', 'utf16le', 'ucs2', 'base64', 'binary', 'hex']; - const contentType = response.message.headers['content-type'] || ''; - const matches = contentType.match(/charset=([^;,\r\n]+)/i); - return (matches && matches[1] && nodeSupportedEncodings.indexOf(matches[1]) != -1) ? matches[1] : 'utf-8'; -} -exports.obtainContentCharset = obtainContentCharset; +"use strict"; +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const qs = require("qs"); +const url = require("url"); +const path = require("path"); +const zlib = require("zlib"); +/** + * creates an url from a request url and optional base url (http://server:8080) + * @param {string} resource - a fully qualified url or relative path + * @param {string} baseUrl - an optional baseUrl (http://server:8080) + * @param {IRequestOptions} options - an optional options object, could include QueryParameters e.g. + * @return {string} - resultant url + */ +function getUrl(resource, baseUrl, queryParams) { + const pathApi = path.posix || path; + let requestUrl = ''; + if (!baseUrl) { + requestUrl = resource; + } + else if (!resource) { + requestUrl = baseUrl; + } + else { + const base = url.parse(baseUrl); + const resultantUrl = url.parse(resource); + // resource (specific per request) elements take priority + resultantUrl.protocol = resultantUrl.protocol || base.protocol; + resultantUrl.auth = resultantUrl.auth || base.auth; + resultantUrl.host = resultantUrl.host || base.host; + resultantUrl.pathname = pathApi.resolve(base.pathname, resultantUrl.pathname); + if (!resultantUrl.pathname.endsWith('/') && resource.endsWith('/')) { + resultantUrl.pathname += '/'; + } + requestUrl = url.format(resultantUrl); + } + return queryParams ? + getUrlWithParsedQueryParams(requestUrl, queryParams) : + requestUrl; +} +exports.getUrl = getUrl; +/** + * + * @param {string} requestUrl + * @param {IRequestQueryParams} queryParams + * @return {string} - Request's URL with Query Parameters appended/parsed. + */ +function getUrlWithParsedQueryParams(requestUrl, queryParams) { + const url = requestUrl.replace(/\?$/g, ''); // Clean any extra end-of-string "?" character + const parsedQueryParams = qs.stringify(queryParams.params, buildParamsStringifyOptions(queryParams)); + return `${url}${parsedQueryParams}`; +} +/** + * Build options for QueryParams Stringifying. + * + * @param {IRequestQueryParams} queryParams + * @return {object} + */ +function buildParamsStringifyOptions(queryParams) { + let options = { + addQueryPrefix: true, + delimiter: (queryParams.options || {}).separator || '&', + allowDots: (queryParams.options || {}).shouldAllowDots || false, + arrayFormat: (queryParams.options || {}).arrayFormat || 'repeat', + encodeValuesOnly: (queryParams.options || {}).shouldOnlyEncodeValues || true + }; + return options; +} +/** + * Decompress/Decode gzip encoded JSON + * Using Node.js built-in zlib module + * + * @param {Buffer} buffer + * @param {string} charset? - optional; defaults to 'utf-8' + * @return {Promise} + */ +function decompressGzippedContent(buffer, charset) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + zlib.gunzip(buffer, function (error, buffer) { + if (error) { + reject(error); + } + resolve(buffer.toString(charset || 'utf-8')); + }); + })); + }); +} +exports.decompressGzippedContent = decompressGzippedContent; +/** + * Builds a RegExp to test urls against for deciding + * wether to bypass proxy from an entry of the + * environment variable setting NO_PROXY + * + * @param {string} bypass + * @return {RegExp} + */ +function buildProxyBypassRegexFromEnv(bypass) { + try { + // We need to keep this around for back-compat purposes + return new RegExp(bypass, 'i'); + } + catch (err) { + if (err instanceof SyntaxError && (bypass || "").startsWith("*")) { + let wildcardEscaped = bypass.replace('*', '(.*)'); + return new RegExp(wildcardEscaped, 'i'); + } + throw err; + } +} +exports.buildProxyBypassRegexFromEnv = buildProxyBypassRegexFromEnv; +/** + * Obtain Response's Content Charset. + * Through inspecting `content-type` response header. + * It Returns 'utf-8' if NO charset specified/matched. + * + * @param {IHttpClientResponse} response + * @return {string} - Content Encoding Charset; Default=utf-8 + */ +function obtainContentCharset(response) { + // Find the charset, if specified. + // Search for the `charset=CHARSET` string, not including `;,\r\n` + // Example: content-type: 'application/json;charset=utf-8' + // |__ matches would be ['charset=utf-8', 'utf-8', index: 18, input: 'application/json; charset=utf-8'] + // |_____ matches[1] would have the charset :tada: , in our example it's utf-8 + // However, if the matches Array was empty or no charset found, 'utf-8' would be returned by default. + const nodeSupportedEncodings = ['ascii', 'utf8', 'utf16le', 'ucs2', 'base64', 'binary', 'hex']; + const contentType = response.message.headers['content-type'] || ''; + const matches = contentType.match(/charset=([^;,\r\n]+)/i); + return (matches && matches[1] && nodeSupportedEncodings.indexOf(matches[1]) != -1) ? matches[1] : 'utf-8'; +} +exports.obtainContentCharset = obtainContentCharset; diff --git a/node_modules/typed-rest-client/handlers/basiccreds.d.ts b/node_modules/typed-rest-client/handlers/basiccreds.d.ts index 0cf1a336f..6378da4b7 100644 --- a/node_modules/typed-rest-client/handlers/basiccreds.d.ts +++ b/node_modules/typed-rest-client/handlers/basiccreds.d.ts @@ -1,11 +1,11 @@ -import ifm = require('../Interfaces'); -export declare class BasicCredentialHandler implements ifm.IRequestHandler { - username: string; - password: string; - allowCrossOriginAuthentication: boolean; - origin: string; - constructor(username: string, password: string, allowCrossOriginAuthentication?: boolean); - prepareRequest(options: any): void; - canHandleAuthentication(response: ifm.IHttpClientResponse): boolean; - handleAuthentication(httpClient: ifm.IHttpClient, requestInfo: ifm.IRequestInfo, objs: any): Promise; -} +import ifm = require('../Interfaces'); +export declare class BasicCredentialHandler implements ifm.IRequestHandler { + username: string; + password: string; + allowCrossOriginAuthentication: boolean; + origin: string; + constructor(username: string, password: string, allowCrossOriginAuthentication?: boolean); + prepareRequest(options: any): void; + canHandleAuthentication(response: ifm.IHttpClientResponse): boolean; + handleAuthentication(httpClient: ifm.IHttpClient, requestInfo: ifm.IRequestInfo, objs: any): Promise; +} diff --git a/node_modules/typed-rest-client/handlers/basiccreds.js b/node_modules/typed-rest-client/handlers/basiccreds.js index 3544d5f3a..648c189ca 100644 --- a/node_modules/typed-rest-client/handlers/basiccreds.js +++ b/node_modules/typed-rest-client/handlers/basiccreds.js @@ -1,31 +1,31 @@ -"use strict"; -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. -Object.defineProperty(exports, "__esModule", { value: true }); -class BasicCredentialHandler { - constructor(username, password, allowCrossOriginAuthentication) { - this.username = username; - this.password = password; - this.allowCrossOriginAuthentication = allowCrossOriginAuthentication; - } - // currently implements pre-authorization - // TODO: support preAuth = false where it hooks on 401 - prepareRequest(options) { - if (!this.origin) { - this.origin = options.host; - } - // If this is a redirection, don't set the Authorization header - if (this.origin === options.host || this.allowCrossOriginAuthentication) { - options.headers['Authorization'] = `Basic ${Buffer.from(`${this.username}:${this.password}`).toString('base64')}`; - } - options.headers['X-TFS-FedAuthRedirect'] = 'Suppress'; - } - // This handler cannot handle 401 - canHandleAuthentication(response) { - return false; - } - handleAuthentication(httpClient, requestInfo, objs) { - return null; - } -} -exports.BasicCredentialHandler = BasicCredentialHandler; +"use strict"; +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +Object.defineProperty(exports, "__esModule", { value: true }); +class BasicCredentialHandler { + constructor(username, password, allowCrossOriginAuthentication) { + this.username = username; + this.password = password; + this.allowCrossOriginAuthentication = allowCrossOriginAuthentication; + } + // currently implements pre-authorization + // TODO: support preAuth = false where it hooks on 401 + prepareRequest(options) { + if (!this.origin) { + this.origin = options.host; + } + // If this is a redirection, don't set the Authorization header + if (this.origin === options.host || this.allowCrossOriginAuthentication) { + options.headers['Authorization'] = `Basic ${Buffer.from(`${this.username}:${this.password}`).toString('base64')}`; + } + options.headers['X-TFS-FedAuthRedirect'] = 'Suppress'; + } + // This handler cannot handle 401 + canHandleAuthentication(response) { + return false; + } + handleAuthentication(httpClient, requestInfo, objs) { + return null; + } +} +exports.BasicCredentialHandler = BasicCredentialHandler; diff --git a/node_modules/typed-rest-client/handlers/bearertoken.d.ts b/node_modules/typed-rest-client/handlers/bearertoken.d.ts index f4f306f04..29a2c59da 100644 --- a/node_modules/typed-rest-client/handlers/bearertoken.d.ts +++ b/node_modules/typed-rest-client/handlers/bearertoken.d.ts @@ -1,10 +1,10 @@ -import ifm = require('../Interfaces'); -export declare class BearerCredentialHandler implements ifm.IRequestHandler { - token: string; - allowCrossOriginAuthentication: boolean; - origin: string; - constructor(token: string, allowCrossOriginAuthentication?: boolean); - prepareRequest(options: any): void; - canHandleAuthentication(response: ifm.IHttpClientResponse): boolean; - handleAuthentication(httpClient: ifm.IHttpClient, requestInfo: ifm.IRequestInfo, objs: any): Promise; -} +import ifm = require('../Interfaces'); +export declare class BearerCredentialHandler implements ifm.IRequestHandler { + token: string; + allowCrossOriginAuthentication: boolean; + origin: string; + constructor(token: string, allowCrossOriginAuthentication?: boolean); + prepareRequest(options: any): void; + canHandleAuthentication(response: ifm.IHttpClientResponse): boolean; + handleAuthentication(httpClient: ifm.IHttpClient, requestInfo: ifm.IRequestInfo, objs: any): Promise; +} diff --git a/node_modules/typed-rest-client/handlers/bearertoken.js b/node_modules/typed-rest-client/handlers/bearertoken.js index e3ff8b172..c62739d66 100644 --- a/node_modules/typed-rest-client/handlers/bearertoken.js +++ b/node_modules/typed-rest-client/handlers/bearertoken.js @@ -1,30 +1,30 @@ -"use strict"; -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. -Object.defineProperty(exports, "__esModule", { value: true }); -class BearerCredentialHandler { - constructor(token, allowCrossOriginAuthentication) { - this.token = token; - this.allowCrossOriginAuthentication = allowCrossOriginAuthentication; - } - // currently implements pre-authorization - // TODO: support preAuth = false where it hooks on 401 - prepareRequest(options) { - if (!this.origin) { - this.origin = options.host; - } - // If this is a redirection, don't set the Authorization header - if (this.origin === options.host || this.allowCrossOriginAuthentication) { - options.headers['Authorization'] = `Bearer ${this.token}`; - } - options.headers['X-TFS-FedAuthRedirect'] = 'Suppress'; - } - // This handler cannot handle 401 - canHandleAuthentication(response) { - return false; - } - handleAuthentication(httpClient, requestInfo, objs) { - return null; - } -} -exports.BearerCredentialHandler = BearerCredentialHandler; +"use strict"; +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +Object.defineProperty(exports, "__esModule", { value: true }); +class BearerCredentialHandler { + constructor(token, allowCrossOriginAuthentication) { + this.token = token; + this.allowCrossOriginAuthentication = allowCrossOriginAuthentication; + } + // currently implements pre-authorization + // TODO: support preAuth = false where it hooks on 401 + prepareRequest(options) { + if (!this.origin) { + this.origin = options.host; + } + // If this is a redirection, don't set the Authorization header + if (this.origin === options.host || this.allowCrossOriginAuthentication) { + options.headers['Authorization'] = `Bearer ${this.token}`; + } + options.headers['X-TFS-FedAuthRedirect'] = 'Suppress'; + } + // This handler cannot handle 401 + canHandleAuthentication(response) { + return false; + } + handleAuthentication(httpClient, requestInfo, objs) { + return null; + } +} +exports.BearerCredentialHandler = BearerCredentialHandler; diff --git a/node_modules/typed-rest-client/handlers/ntlm.d.ts b/node_modules/typed-rest-client/handlers/ntlm.d.ts index fb9df6433..fa3179d31 100644 --- a/node_modules/typed-rest-client/handlers/ntlm.d.ts +++ b/node_modules/typed-rest-client/handlers/ntlm.d.ts @@ -1,13 +1,13 @@ -/// -import ifm = require('../Interfaces'); -import http = require("http"); -export declare class NtlmCredentialHandler implements ifm.IRequestHandler { - private _ntlmOptions; - constructor(username: string, password: string, workstation?: string, domain?: string); - prepareRequest(options: http.RequestOptions): void; - canHandleAuthentication(response: ifm.IHttpClientResponse): boolean; - handleAuthentication(httpClient: ifm.IHttpClient, requestInfo: ifm.IRequestInfo, objs: any): Promise; - private handleAuthenticationPrivate; - private sendType1Message; - private sendType3Message; -} +/// +import ifm = require('../Interfaces'); +import http = require("http"); +export declare class NtlmCredentialHandler implements ifm.IRequestHandler { + private _ntlmOptions; + constructor(username: string, password: string, workstation?: string, domain?: string); + prepareRequest(options: http.RequestOptions): void; + canHandleAuthentication(response: ifm.IHttpClientResponse): boolean; + handleAuthentication(httpClient: ifm.IHttpClient, requestInfo: ifm.IRequestInfo, objs: any): Promise; + private handleAuthenticationPrivate; + private sendType1Message; + private sendType3Message; +} diff --git a/node_modules/typed-rest-client/handlers/ntlm.js b/node_modules/typed-rest-client/handlers/ntlm.js index bb9a14d5b..69bec4afc 100644 --- a/node_modules/typed-rest-client/handlers/ntlm.js +++ b/node_modules/typed-rest-client/handlers/ntlm.js @@ -1,137 +1,137 @@ -"use strict"; -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. -Object.defineProperty(exports, "__esModule", { value: true }); -const http = require("http"); -const https = require("https"); -const _ = require("underscore"); -const ntlm = require("../opensource/Node-SMB/lib/ntlm"); -class NtlmCredentialHandler { - constructor(username, password, workstation, domain) { - this._ntlmOptions = {}; - this._ntlmOptions.username = username; - this._ntlmOptions.password = password; - this._ntlmOptions.domain = domain || ''; - this._ntlmOptions.workstation = workstation || ''; - } - prepareRequest(options) { - // No headers or options need to be set. We keep the credentials on the handler itself. - // If a (proxy) agent is set, remove it as we don't support proxy for NTLM at this time - if (options.agent) { - delete options.agent; - } - } - canHandleAuthentication(response) { - if (response && response.message && response.message.statusCode === 401) { - // Ensure that we're talking NTLM here - // Once we have the www-authenticate header, split it so we can ensure we can talk NTLM - const wwwAuthenticate = response.message.headers['www-authenticate']; - return wwwAuthenticate && (wwwAuthenticate.split(', ').indexOf("NTLM") >= 0); - } - return false; - } - handleAuthentication(httpClient, requestInfo, objs) { - return new Promise((resolve, reject) => { - const callbackForResult = function (err, res) { - if (err) { - reject(err); - } - // We have to readbody on the response before continuing otherwise there is a hang. - res.readBody().then(() => { - resolve(res); - }); - }; - this.handleAuthenticationPrivate(httpClient, requestInfo, objs, callbackForResult); - }); - } - handleAuthenticationPrivate(httpClient, requestInfo, objs, finalCallback) { - // Set up the headers for NTLM authentication - requestInfo.options = _.extend(requestInfo.options, { - username: this._ntlmOptions.username, - password: this._ntlmOptions.password, - domain: this._ntlmOptions.domain, - workstation: this._ntlmOptions.workstation - }); - requestInfo.options.agent = httpClient.isSsl ? - new https.Agent({ keepAlive: true }) : - new http.Agent({ keepAlive: true }); - let self = this; - // The following pattern of sending the type1 message following immediately (in a setImmediate) is - // critical for the NTLM exchange to happen. If we removed setImmediate (or call in a different manner) - // the NTLM exchange will always fail with a 401. - this.sendType1Message(httpClient, requestInfo, objs, function (err, res) { - if (err) { - return finalCallback(err, null, null); - } - /// We have to readbody on the response before continuing otherwise there is a hang. - res.readBody().then(() => { - // It is critical that we have setImmediate here due to how connection requests are queued. - // If setImmediate is removed then the NTLM handshake will not work. - // setImmediate allows us to queue a second request on the same connection. If this second - // request is not queued on the connection when the first request finishes then node closes - // the connection. NTLM requires both requests to be on the same connection so we need this. - setImmediate(function () { - self.sendType3Message(httpClient, requestInfo, objs, res, finalCallback); - }); - }); - }); - } - // The following method is an adaptation of code found at https://github.com/SamDecrock/node-http-ntlm/blob/master/httpntlm.js - sendType1Message(httpClient, requestInfo, objs, finalCallback) { - const type1HexBuffer = ntlm.encodeType1(this._ntlmOptions.workstation, this._ntlmOptions.domain); - const type1msg = `NTLM ${type1HexBuffer.toString('base64')}`; - const type1options = { - headers: { - 'Connection': 'keep-alive', - 'Authorization': type1msg - }, - timeout: requestInfo.options.timeout || 0, - agent: requestInfo.httpModule, - }; - const type1info = {}; - type1info.httpModule = requestInfo.httpModule; - type1info.parsedUrl = requestInfo.parsedUrl; - type1info.options = _.extend(type1options, _.omit(requestInfo.options, 'headers')); - return httpClient.requestRawWithCallback(type1info, objs, finalCallback); - } - // The following method is an adaptation of code found at https://github.com/SamDecrock/node-http-ntlm/blob/master/httpntlm.js - sendType3Message(httpClient, requestInfo, objs, res, callback) { - if (!res.message.headers && !res.message.headers['www-authenticate']) { - throw new Error('www-authenticate not found on response of second request'); - } - /** - * Server will respond with challenge/nonce - * assigned to response's "WWW-AUTHENTICATE" header - * and should adhere to RegExp /^NTLM\s+(.+?)(,|\s+|$)/ - */ - const serverNonceRegex = /^NTLM\s+(.+?)(,|\s+|$)/; - const serverNonce = Buffer.from((res.message.headers['www-authenticate'].match(serverNonceRegex) || [])[1], 'base64'); - let type2msg; - /** - * Wrap decoding the Server's challenge/nonce in - * try-catch block to throw more comprehensive - * Error with clear message to consumer - */ - try { - type2msg = ntlm.decodeType2(serverNonce); - } - catch (error) { - throw new Error(`Decoding Server's Challenge to Obtain Type2Message failed with error: ${error.message}`); - } - const type3msg = ntlm.encodeType3(this._ntlmOptions.username, this._ntlmOptions.workstation, this._ntlmOptions.domain, type2msg, this._ntlmOptions.password).toString('base64'); - const type3options = { - headers: { - 'Authorization': `NTLM ${type3msg}`, - 'Connection': 'Close' - }, - agent: requestInfo.httpModule, - }; - const type3info = {}; - type3info.httpModule = requestInfo.httpModule; - type3info.parsedUrl = requestInfo.parsedUrl; - type3options.headers = _.extend(type3options.headers, requestInfo.options.headers); - type3info.options = _.extend(type3options, _.omit(requestInfo.options, 'headers')); - return httpClient.requestRawWithCallback(type3info, objs, callback); - } -} -exports.NtlmCredentialHandler = NtlmCredentialHandler; +"use strict"; +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +Object.defineProperty(exports, "__esModule", { value: true }); +const http = require("http"); +const https = require("https"); +const _ = require("underscore"); +const ntlm = require("../opensource/Node-SMB/lib/ntlm"); +class NtlmCredentialHandler { + constructor(username, password, workstation, domain) { + this._ntlmOptions = {}; + this._ntlmOptions.username = username; + this._ntlmOptions.password = password; + this._ntlmOptions.domain = domain || ''; + this._ntlmOptions.workstation = workstation || ''; + } + prepareRequest(options) { + // No headers or options need to be set. We keep the credentials on the handler itself. + // If a (proxy) agent is set, remove it as we don't support proxy for NTLM at this time + if (options.agent) { + delete options.agent; + } + } + canHandleAuthentication(response) { + if (response && response.message && response.message.statusCode === 401) { + // Ensure that we're talking NTLM here + // Once we have the www-authenticate header, split it so we can ensure we can talk NTLM + const wwwAuthenticate = response.message.headers['www-authenticate']; + return wwwAuthenticate && (wwwAuthenticate.split(', ').indexOf("NTLM") >= 0); + } + return false; + } + handleAuthentication(httpClient, requestInfo, objs) { + return new Promise((resolve, reject) => { + const callbackForResult = function (err, res) { + if (err) { + reject(err); + } + // We have to readbody on the response before continuing otherwise there is a hang. + res.readBody().then(() => { + resolve(res); + }); + }; + this.handleAuthenticationPrivate(httpClient, requestInfo, objs, callbackForResult); + }); + } + handleAuthenticationPrivate(httpClient, requestInfo, objs, finalCallback) { + // Set up the headers for NTLM authentication + requestInfo.options = _.extend(requestInfo.options, { + username: this._ntlmOptions.username, + password: this._ntlmOptions.password, + domain: this._ntlmOptions.domain, + workstation: this._ntlmOptions.workstation + }); + requestInfo.options.agent = httpClient.isSsl ? + new https.Agent({ keepAlive: true }) : + new http.Agent({ keepAlive: true }); + let self = this; + // The following pattern of sending the type1 message following immediately (in a setImmediate) is + // critical for the NTLM exchange to happen. If we removed setImmediate (or call in a different manner) + // the NTLM exchange will always fail with a 401. + this.sendType1Message(httpClient, requestInfo, objs, function (err, res) { + if (err) { + return finalCallback(err, null, null); + } + /// We have to readbody on the response before continuing otherwise there is a hang. + res.readBody().then(() => { + // It is critical that we have setImmediate here due to how connection requests are queued. + // If setImmediate is removed then the NTLM handshake will not work. + // setImmediate allows us to queue a second request on the same connection. If this second + // request is not queued on the connection when the first request finishes then node closes + // the connection. NTLM requires both requests to be on the same connection so we need this. + setImmediate(function () { + self.sendType3Message(httpClient, requestInfo, objs, res, finalCallback); + }); + }); + }); + } + // The following method is an adaptation of code found at https://github.com/SamDecrock/node-http-ntlm/blob/master/httpntlm.js + sendType1Message(httpClient, requestInfo, objs, finalCallback) { + const type1HexBuffer = ntlm.encodeType1(this._ntlmOptions.workstation, this._ntlmOptions.domain); + const type1msg = `NTLM ${type1HexBuffer.toString('base64')}`; + const type1options = { + headers: { + 'Connection': 'keep-alive', + 'Authorization': type1msg + }, + timeout: requestInfo.options.timeout || 0, + agent: requestInfo.httpModule, + }; + const type1info = {}; + type1info.httpModule = requestInfo.httpModule; + type1info.parsedUrl = requestInfo.parsedUrl; + type1info.options = _.extend(type1options, _.omit(requestInfo.options, 'headers')); + return httpClient.requestRawWithCallback(type1info, objs, finalCallback); + } + // The following method is an adaptation of code found at https://github.com/SamDecrock/node-http-ntlm/blob/master/httpntlm.js + sendType3Message(httpClient, requestInfo, objs, res, callback) { + if (!res.message.headers && !res.message.headers['www-authenticate']) { + throw new Error('www-authenticate not found on response of second request'); + } + /** + * Server will respond with challenge/nonce + * assigned to response's "WWW-AUTHENTICATE" header + * and should adhere to RegExp /^NTLM\s+(.+?)(,|\s+|$)/ + */ + const serverNonceRegex = /^NTLM\s+(.+?)(,|\s+|$)/; + const serverNonce = Buffer.from((res.message.headers['www-authenticate'].match(serverNonceRegex) || [])[1], 'base64'); + let type2msg; + /** + * Wrap decoding the Server's challenge/nonce in + * try-catch block to throw more comprehensive + * Error with clear message to consumer + */ + try { + type2msg = ntlm.decodeType2(serverNonce); + } + catch (error) { + throw new Error(`Decoding Server's Challenge to Obtain Type2Message failed with error: ${error.message}`); + } + const type3msg = ntlm.encodeType3(this._ntlmOptions.username, this._ntlmOptions.workstation, this._ntlmOptions.domain, type2msg, this._ntlmOptions.password).toString('base64'); + const type3options = { + headers: { + 'Authorization': `NTLM ${type3msg}`, + 'Connection': 'Close' + }, + agent: requestInfo.httpModule, + }; + const type3info = {}; + type3info.httpModule = requestInfo.httpModule; + type3info.parsedUrl = requestInfo.parsedUrl; + type3options.headers = _.extend(type3options.headers, requestInfo.options.headers); + type3info.options = _.extend(type3options, _.omit(requestInfo.options, 'headers')); + return httpClient.requestRawWithCallback(type3info, objs, callback); + } +} +exports.NtlmCredentialHandler = NtlmCredentialHandler; diff --git a/node_modules/typed-rest-client/handlers/personalaccesstoken.d.ts b/node_modules/typed-rest-client/handlers/personalaccesstoken.d.ts index 63fd45ade..dcb158e42 100644 --- a/node_modules/typed-rest-client/handlers/personalaccesstoken.d.ts +++ b/node_modules/typed-rest-client/handlers/personalaccesstoken.d.ts @@ -1,10 +1,10 @@ -import ifm = require('../Interfaces'); -export declare class PersonalAccessTokenCredentialHandler implements ifm.IRequestHandler { - token: string; - allowCrossOriginAuthentication: boolean; - origin: string; - constructor(token: string, allowCrossOriginAuthentication?: boolean); - prepareRequest(options: any): void; - canHandleAuthentication(response: ifm.IHttpClientResponse): boolean; - handleAuthentication(httpClient: ifm.IHttpClient, requestInfo: ifm.IRequestInfo, objs: any): Promise; -} +import ifm = require('../Interfaces'); +export declare class PersonalAccessTokenCredentialHandler implements ifm.IRequestHandler { + token: string; + allowCrossOriginAuthentication: boolean; + origin: string; + constructor(token: string, allowCrossOriginAuthentication?: boolean); + prepareRequest(options: any): void; + canHandleAuthentication(response: ifm.IHttpClientResponse): boolean; + handleAuthentication(httpClient: ifm.IHttpClient, requestInfo: ifm.IRequestInfo, objs: any): Promise; +} diff --git a/node_modules/typed-rest-client/handlers/personalaccesstoken.js b/node_modules/typed-rest-client/handlers/personalaccesstoken.js index 9463a6d0b..6609c097e 100644 --- a/node_modules/typed-rest-client/handlers/personalaccesstoken.js +++ b/node_modules/typed-rest-client/handlers/personalaccesstoken.js @@ -1,30 +1,30 @@ -"use strict"; -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. -Object.defineProperty(exports, "__esModule", { value: true }); -class PersonalAccessTokenCredentialHandler { - constructor(token, allowCrossOriginAuthentication) { - this.token = token; - this.allowCrossOriginAuthentication = allowCrossOriginAuthentication; - } - // currently implements pre-authorization - // TODO: support preAuth = false where it hooks on 401 - prepareRequest(options) { - if (!this.origin) { - this.origin = options.host; - } - // If this is a redirection, don't set the Authorization header - if (this.origin === options.host || this.allowCrossOriginAuthentication) { - options.headers['Authorization'] = `Basic ${Buffer.from(`PAT:${this.token}`).toString('base64')}`; - } - options.headers['X-TFS-FedAuthRedirect'] = 'Suppress'; - } - // This handler cannot handle 401 - canHandleAuthentication(response) { - return false; - } - handleAuthentication(httpClient, requestInfo, objs) { - return null; - } -} -exports.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHandler; +"use strict"; +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +Object.defineProperty(exports, "__esModule", { value: true }); +class PersonalAccessTokenCredentialHandler { + constructor(token, allowCrossOriginAuthentication) { + this.token = token; + this.allowCrossOriginAuthentication = allowCrossOriginAuthentication; + } + // currently implements pre-authorization + // TODO: support preAuth = false where it hooks on 401 + prepareRequest(options) { + if (!this.origin) { + this.origin = options.host; + } + // If this is a redirection, don't set the Authorization header + if (this.origin === options.host || this.allowCrossOriginAuthentication) { + options.headers['Authorization'] = `Basic ${Buffer.from(`PAT:${this.token}`).toString('base64')}`; + } + options.headers['X-TFS-FedAuthRedirect'] = 'Suppress'; + } + // This handler cannot handle 401 + canHandleAuthentication(response) { + return false; + } + handleAuthentication(httpClient, requestInfo, objs) { + return null; + } +} +exports.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHandler; diff --git a/node_modules/typed-rest-client/opensource/Node-SMB/README.md b/node_modules/typed-rest-client/opensource/Node-SMB/README.md index b3de18f00..c713c11c0 100644 --- a/node_modules/typed-rest-client/opensource/Node-SMB/README.md +++ b/node_modules/typed-rest-client/opensource/Node-SMB/README.md @@ -1,5 +1,5 @@ -### Reference: -The modules (common.js, ntlm.js and smbhash.js) were copied from a file of the same name at https://github.com/Node-SMB/ntlm. - -The modules has been used for the purpose of encoding and decoding the headers used during NTLM HTTP Authentication and as of this writing, it is a part of the typed-rest-client module produced by Microsoft. - +### Reference: +The modules (common.js, ntlm.js and smbhash.js) were copied from a file of the same name at https://github.com/Node-SMB/ntlm. + +The modules has been used for the purpose of encoding and decoding the headers used during NTLM HTTP Authentication and as of this writing, it is a part of the typed-rest-client module produced by Microsoft. + diff --git a/node_modules/typed-rest-client/opensource/Node-SMB/lib/common.js b/node_modules/typed-rest-client/opensource/Node-SMB/lib/common.js index 4e3a75c3e..9c77fead3 100644 --- a/node_modules/typed-rest-client/opensource/Node-SMB/lib/common.js +++ b/node_modules/typed-rest-client/opensource/Node-SMB/lib/common.js @@ -1,61 +1,61 @@ -var crypto = require('crypto'); - -function zeroextend(str, len) -{ - while (str.length < len) - str = '0' + str; - return (str); -} - -/* - * Fix (odd) parity bits in a 64-bit DES key. - */ -function oddpar(buf) -{ - for (var j = 0; j < buf.length; j++) { - var par = 1; - for (var i = 1; i < 8; i++) { - par = (par + ((buf[j] >> i) & 1)) % 2; - } - buf[j] |= par & 1; - } - return buf; -} - -/* - * Expand a 56-bit key buffer to the full 64-bits for DES. - * - * Based on code sample in: - * http://www.innovation.ch/personal/ronald/ntlm.html - */ -function expandkey(key56) -{ - var key64 = new Buffer(8); - - key64[0] = key56[0] & 0xFE; - key64[1] = ((key56[0] << 7) & 0xFF) | (key56[1] >> 1); - key64[2] = ((key56[1] << 6) & 0xFF) | (key56[2] >> 2); - key64[3] = ((key56[2] << 5) & 0xFF) | (key56[3] >> 3); - key64[4] = ((key56[3] << 4) & 0xFF) | (key56[4] >> 4); - key64[5] = ((key56[4] << 3) & 0xFF) | (key56[5] >> 5); - key64[6] = ((key56[5] << 2) & 0xFF) | (key56[6] >> 6); - key64[7] = (key56[6] << 1) & 0xFF; - - return key64; -} - -/* - * Convert a binary string to a hex string - */ -function bintohex(bin) -{ - var buf = (Buffer.isBuffer(buf) ? buf : new Buffer(bin, 'binary')); - var str = buf.toString('hex').toUpperCase(); - return zeroextend(str, 32); -} - - -module.exports.zeroextend = zeroextend; -module.exports.oddpar = oddpar; -module.exports.expandkey = expandkey; -module.exports.bintohex = bintohex; +var crypto = require('crypto'); + +function zeroextend(str, len) +{ + while (str.length < len) + str = '0' + str; + return (str); +} + +/* + * Fix (odd) parity bits in a 64-bit DES key. + */ +function oddpar(buf) +{ + for (var j = 0; j < buf.length; j++) { + var par = 1; + for (var i = 1; i < 8; i++) { + par = (par + ((buf[j] >> i) & 1)) % 2; + } + buf[j] |= par & 1; + } + return buf; +} + +/* + * Expand a 56-bit key buffer to the full 64-bits for DES. + * + * Based on code sample in: + * http://www.innovation.ch/personal/ronald/ntlm.html + */ +function expandkey(key56) +{ + var key64 = new Buffer(8); + + key64[0] = key56[0] & 0xFE; + key64[1] = ((key56[0] << 7) & 0xFF) | (key56[1] >> 1); + key64[2] = ((key56[1] << 6) & 0xFF) | (key56[2] >> 2); + key64[3] = ((key56[2] << 5) & 0xFF) | (key56[3] >> 3); + key64[4] = ((key56[3] << 4) & 0xFF) | (key56[4] >> 4); + key64[5] = ((key56[4] << 3) & 0xFF) | (key56[5] >> 5); + key64[6] = ((key56[5] << 2) & 0xFF) | (key56[6] >> 6); + key64[7] = (key56[6] << 1) & 0xFF; + + return key64; +} + +/* + * Convert a binary string to a hex string + */ +function bintohex(bin) +{ + var buf = (Buffer.isBuffer(buf) ? buf : new Buffer(bin, 'binary')); + var str = buf.toString('hex').toUpperCase(); + return zeroextend(str, 32); +} + + +module.exports.zeroextend = zeroextend; +module.exports.oddpar = oddpar; +module.exports.expandkey = expandkey; +module.exports.bintohex = bintohex; diff --git a/node_modules/typed-rest-client/opensource/Node-SMB/lib/ntlm.js b/node_modules/typed-rest-client/opensource/Node-SMB/lib/ntlm.js index b5f373171..3723bdd2a 100644 --- a/node_modules/typed-rest-client/opensource/Node-SMB/lib/ntlm.js +++ b/node_modules/typed-rest-client/opensource/Node-SMB/lib/ntlm.js @@ -1,220 +1,220 @@ -var log = console.log; -var crypto = require('crypto'); -var $ = require('./common'); -var lmhashbuf = require('./smbhash').lmhashbuf; -var nthashbuf = require('./smbhash').nthashbuf; - - -function encodeType1(hostname, ntdomain) { - hostname = hostname.toUpperCase(); - ntdomain = ntdomain.toUpperCase(); - var hostnamelen = Buffer.byteLength(hostname, 'ascii'); - var ntdomainlen = Buffer.byteLength(ntdomain, 'ascii'); - - var pos = 0; - var buf = new Buffer(32 + hostnamelen + ntdomainlen); - - buf.write('NTLMSSP', pos, 7, 'ascii'); // byte protocol[8]; - pos += 7; - buf.writeUInt8(0, pos); - pos++; - - buf.writeUInt8(0x01, pos); // byte type; - pos++; - - buf.fill(0x00, pos, pos + 3); // byte zero[3]; - pos += 3; - - buf.writeUInt16LE(0xb203, pos); // short flags; - pos += 2; - - buf.fill(0x00, pos, pos + 2); // byte zero[2]; - pos += 2; - - buf.writeUInt16LE(ntdomainlen, pos); // short dom_len; - pos += 2; - buf.writeUInt16LE(ntdomainlen, pos); // short dom_len; - pos += 2; - - var ntdomainoff = 0x20 + hostnamelen; - buf.writeUInt16LE(ntdomainoff, pos); // short dom_off; - pos += 2; - - buf.fill(0x00, pos, pos + 2); // byte zero[2]; - pos += 2; - - buf.writeUInt16LE(hostnamelen, pos); // short host_len; - pos += 2; - buf.writeUInt16LE(hostnamelen, pos); // short host_len; - pos += 2; - - buf.writeUInt16LE(0x20, pos); // short host_off; - pos += 2; - - buf.fill(0x00, pos, pos + 2); // byte zero[2]; - pos += 2; - - buf.write(hostname, 0x20, hostnamelen, 'ascii'); - buf.write(ntdomain, ntdomainoff, ntdomainlen, 'ascii'); - - return buf; -} - - -/* - * - */ -function decodeType2(buf) -{ - var proto = buf.toString('ascii', 0, 7); - if (buf[7] !== 0x00 || proto !== 'NTLMSSP') - throw new Error('magic was not NTLMSSP'); - - var type = buf.readUInt8(8); - if (type !== 0x02) - throw new Error('message was not NTLMSSP type 0x02'); - - //var msg_len = buf.readUInt16LE(16); - - //var flags = buf.readUInt16LE(20); - - var nonce = buf.slice(24, 32); - return nonce; -} - -function encodeType3(username, hostname, ntdomain, nonce, password) { - hostname = hostname.toUpperCase(); - ntdomain = ntdomain.toUpperCase(); - - var lmh = new Buffer(21); - lmhashbuf(password).copy(lmh); - lmh.fill(0x00, 16); // null pad to 21 bytes - var nth = new Buffer(21); - nthashbuf(password).copy(nth); - nth.fill(0x00, 16); // null pad to 21 bytes - - var lmr = makeResponse(lmh, nonce); - var ntr = makeResponse(nth, nonce); - - var usernamelen = Buffer.byteLength(username, 'ucs2'); - var hostnamelen = Buffer.byteLength(hostname, 'ucs2'); - var ntdomainlen = Buffer.byteLength(ntdomain, 'ucs2'); - var lmrlen = 0x18; - var ntrlen = 0x18; - - var ntdomainoff = 0x40; - var usernameoff = ntdomainoff + ntdomainlen; - var hostnameoff = usernameoff + usernamelen; - var lmroff = hostnameoff + hostnamelen; - var ntroff = lmroff + lmrlen; - - var pos = 0; - var msg_len = 64 + ntdomainlen + usernamelen + hostnamelen + lmrlen + ntrlen; - var buf = new Buffer(msg_len); - - buf.write('NTLMSSP', pos, 7, 'ascii'); // byte protocol[8]; - pos += 7; - buf.writeUInt8(0, pos); - pos++; - - buf.writeUInt8(0x03, pos); // byte type; - pos++; - - buf.fill(0x00, pos, pos + 3); // byte zero[3]; - pos += 3; - - buf.writeUInt16LE(lmrlen, pos); // short lm_resp_len; - pos += 2; - buf.writeUInt16LE(lmrlen, pos); // short lm_resp_len; - pos += 2; - buf.writeUInt16LE(lmroff, pos); // short lm_resp_off; - pos += 2; - buf.fill(0x00, pos, pos + 2); // byte zero[2]; - pos += 2; - - buf.writeUInt16LE(ntrlen, pos); // short nt_resp_len; - pos += 2; - buf.writeUInt16LE(ntrlen, pos); // short nt_resp_len; - pos += 2; - buf.writeUInt16LE(ntroff, pos); // short nt_resp_off; - pos += 2; - buf.fill(0x00, pos, pos + 2); // byte zero[2]; - pos += 2; - - buf.writeUInt16LE(ntdomainlen, pos); // short dom_len; - pos += 2; - buf.writeUInt16LE(ntdomainlen, pos); // short dom_len; - pos += 2; - buf.writeUInt16LE(ntdomainoff, pos); // short dom_off; - pos += 2; - buf.fill(0x00, pos, pos + 2); // byte zero[2]; - pos += 2; - - buf.writeUInt16LE(usernamelen, pos); // short user_len; - pos += 2; - buf.writeUInt16LE(usernamelen, pos); // short user_len; - pos += 2; - buf.writeUInt16LE(usernameoff, pos); // short user_off; - pos += 2; - buf.fill(0x00, pos, pos + 2); // byte zero[2]; - pos += 2; - - buf.writeUInt16LE(hostnamelen, pos); // short host_len; - pos += 2; - buf.writeUInt16LE(hostnamelen, pos); // short host_len; - pos += 2; - buf.writeUInt16LE(hostnameoff, pos); // short host_off; - pos += 2; - buf.fill(0x00, pos, pos + 6); // byte zero[6]; - pos += 6; - - buf.writeUInt16LE(msg_len, pos); // short msg_len; - pos += 2; - buf.fill(0x00, pos, pos + 2); // byte zero[2]; - pos += 2; - - buf.writeUInt16LE(0x8201, pos); // short flags; - pos += 2; - buf.fill(0x00, pos, pos + 2); // byte zero[2]; - pos += 2; - - buf.write(ntdomain, ntdomainoff, ntdomainlen, 'ucs2'); - buf.write(username, usernameoff, usernamelen, 'ucs2'); - buf.write(hostname, hostnameoff, hostnamelen, 'ucs2'); - lmr.copy(buf, lmroff, 0, lmrlen); - ntr.copy(buf, ntroff, 0, ntrlen); - - return buf; -} - -function makeResponse(hash, nonce) -{ - var out = new Buffer(24); - for (var i = 0; i < 3; i++) { - var keybuf = $.oddpar($.expandkey(hash.slice(i * 7, i * 7 + 7))); - var des = crypto.createCipheriv('DES-ECB', keybuf, ''); - var str = des.update(nonce.toString('binary'), 'binary', 'binary'); - out.write(str, i * 8, i * 8 + 8, 'binary'); - } - return out; -} - -exports.encodeType1 = encodeType1; -exports.decodeType2 = decodeType2; -exports.encodeType3 = encodeType3; - -// Convenience methods. - -exports.challengeHeader = function (hostname, domain) { - return 'NTLM ' + exports.encodeType1(hostname, domain).toString('base64'); -}; - -exports.responseHeader = function (res, url, domain, username, password) { - var serverNonce = new Buffer((res.headers['www-authenticate'].match(/^NTLM\s+(.+?)(,|\s+|$)/) || [])[1], 'base64'); - var hostname = require('url').parse(url).hostname; - return 'NTLM ' + exports.encodeType3(username, hostname, domain, exports.decodeType2(serverNonce), password).toString('base64') -}; - -// Import smbhash module. - -exports.smbhash = require('./smbhash'); +var log = console.log; +var crypto = require('crypto'); +var $ = require('./common'); +var lmhashbuf = require('./smbhash').lmhashbuf; +var nthashbuf = require('./smbhash').nthashbuf; + + +function encodeType1(hostname, ntdomain) { + hostname = hostname.toUpperCase(); + ntdomain = ntdomain.toUpperCase(); + var hostnamelen = Buffer.byteLength(hostname, 'ascii'); + var ntdomainlen = Buffer.byteLength(ntdomain, 'ascii'); + + var pos = 0; + var buf = new Buffer(32 + hostnamelen + ntdomainlen); + + buf.write('NTLMSSP', pos, 7, 'ascii'); // byte protocol[8]; + pos += 7; + buf.writeUInt8(0, pos); + pos++; + + buf.writeUInt8(0x01, pos); // byte type; + pos++; + + buf.fill(0x00, pos, pos + 3); // byte zero[3]; + pos += 3; + + buf.writeUInt16LE(0xb203, pos); // short flags; + pos += 2; + + buf.fill(0x00, pos, pos + 2); // byte zero[2]; + pos += 2; + + buf.writeUInt16LE(ntdomainlen, pos); // short dom_len; + pos += 2; + buf.writeUInt16LE(ntdomainlen, pos); // short dom_len; + pos += 2; + + var ntdomainoff = 0x20 + hostnamelen; + buf.writeUInt16LE(ntdomainoff, pos); // short dom_off; + pos += 2; + + buf.fill(0x00, pos, pos + 2); // byte zero[2]; + pos += 2; + + buf.writeUInt16LE(hostnamelen, pos); // short host_len; + pos += 2; + buf.writeUInt16LE(hostnamelen, pos); // short host_len; + pos += 2; + + buf.writeUInt16LE(0x20, pos); // short host_off; + pos += 2; + + buf.fill(0x00, pos, pos + 2); // byte zero[2]; + pos += 2; + + buf.write(hostname, 0x20, hostnamelen, 'ascii'); + buf.write(ntdomain, ntdomainoff, ntdomainlen, 'ascii'); + + return buf; +} + + +/* + * + */ +function decodeType2(buf) +{ + var proto = buf.toString('ascii', 0, 7); + if (buf[7] !== 0x00 || proto !== 'NTLMSSP') + throw new Error('magic was not NTLMSSP'); + + var type = buf.readUInt8(8); + if (type !== 0x02) + throw new Error('message was not NTLMSSP type 0x02'); + + //var msg_len = buf.readUInt16LE(16); + + //var flags = buf.readUInt16LE(20); + + var nonce = buf.slice(24, 32); + return nonce; +} + +function encodeType3(username, hostname, ntdomain, nonce, password) { + hostname = hostname.toUpperCase(); + ntdomain = ntdomain.toUpperCase(); + + var lmh = new Buffer(21); + lmhashbuf(password).copy(lmh); + lmh.fill(0x00, 16); // null pad to 21 bytes + var nth = new Buffer(21); + nthashbuf(password).copy(nth); + nth.fill(0x00, 16); // null pad to 21 bytes + + var lmr = makeResponse(lmh, nonce); + var ntr = makeResponse(nth, nonce); + + var usernamelen = Buffer.byteLength(username, 'ucs2'); + var hostnamelen = Buffer.byteLength(hostname, 'ucs2'); + var ntdomainlen = Buffer.byteLength(ntdomain, 'ucs2'); + var lmrlen = 0x18; + var ntrlen = 0x18; + + var ntdomainoff = 0x40; + var usernameoff = ntdomainoff + ntdomainlen; + var hostnameoff = usernameoff + usernamelen; + var lmroff = hostnameoff + hostnamelen; + var ntroff = lmroff + lmrlen; + + var pos = 0; + var msg_len = 64 + ntdomainlen + usernamelen + hostnamelen + lmrlen + ntrlen; + var buf = new Buffer(msg_len); + + buf.write('NTLMSSP', pos, 7, 'ascii'); // byte protocol[8]; + pos += 7; + buf.writeUInt8(0, pos); + pos++; + + buf.writeUInt8(0x03, pos); // byte type; + pos++; + + buf.fill(0x00, pos, pos + 3); // byte zero[3]; + pos += 3; + + buf.writeUInt16LE(lmrlen, pos); // short lm_resp_len; + pos += 2; + buf.writeUInt16LE(lmrlen, pos); // short lm_resp_len; + pos += 2; + buf.writeUInt16LE(lmroff, pos); // short lm_resp_off; + pos += 2; + buf.fill(0x00, pos, pos + 2); // byte zero[2]; + pos += 2; + + buf.writeUInt16LE(ntrlen, pos); // short nt_resp_len; + pos += 2; + buf.writeUInt16LE(ntrlen, pos); // short nt_resp_len; + pos += 2; + buf.writeUInt16LE(ntroff, pos); // short nt_resp_off; + pos += 2; + buf.fill(0x00, pos, pos + 2); // byte zero[2]; + pos += 2; + + buf.writeUInt16LE(ntdomainlen, pos); // short dom_len; + pos += 2; + buf.writeUInt16LE(ntdomainlen, pos); // short dom_len; + pos += 2; + buf.writeUInt16LE(ntdomainoff, pos); // short dom_off; + pos += 2; + buf.fill(0x00, pos, pos + 2); // byte zero[2]; + pos += 2; + + buf.writeUInt16LE(usernamelen, pos); // short user_len; + pos += 2; + buf.writeUInt16LE(usernamelen, pos); // short user_len; + pos += 2; + buf.writeUInt16LE(usernameoff, pos); // short user_off; + pos += 2; + buf.fill(0x00, pos, pos + 2); // byte zero[2]; + pos += 2; + + buf.writeUInt16LE(hostnamelen, pos); // short host_len; + pos += 2; + buf.writeUInt16LE(hostnamelen, pos); // short host_len; + pos += 2; + buf.writeUInt16LE(hostnameoff, pos); // short host_off; + pos += 2; + buf.fill(0x00, pos, pos + 6); // byte zero[6]; + pos += 6; + + buf.writeUInt16LE(msg_len, pos); // short msg_len; + pos += 2; + buf.fill(0x00, pos, pos + 2); // byte zero[2]; + pos += 2; + + buf.writeUInt16LE(0x8201, pos); // short flags; + pos += 2; + buf.fill(0x00, pos, pos + 2); // byte zero[2]; + pos += 2; + + buf.write(ntdomain, ntdomainoff, ntdomainlen, 'ucs2'); + buf.write(username, usernameoff, usernamelen, 'ucs2'); + buf.write(hostname, hostnameoff, hostnamelen, 'ucs2'); + lmr.copy(buf, lmroff, 0, lmrlen); + ntr.copy(buf, ntroff, 0, ntrlen); + + return buf; +} + +function makeResponse(hash, nonce) +{ + var out = new Buffer(24); + for (var i = 0; i < 3; i++) { + var keybuf = $.oddpar($.expandkey(hash.slice(i * 7, i * 7 + 7))); + var des = crypto.createCipheriv('DES-ECB', keybuf, ''); + var str = des.update(nonce.toString('binary'), 'binary', 'binary'); + out.write(str, i * 8, i * 8 + 8, 'binary'); + } + return out; +} + +exports.encodeType1 = encodeType1; +exports.decodeType2 = decodeType2; +exports.encodeType3 = encodeType3; + +// Convenience methods. + +exports.challengeHeader = function (hostname, domain) { + return 'NTLM ' + exports.encodeType1(hostname, domain).toString('base64'); +}; + +exports.responseHeader = function (res, url, domain, username, password) { + var serverNonce = new Buffer((res.headers['www-authenticate'].match(/^NTLM\s+(.+?)(,|\s+|$)/) || [])[1], 'base64'); + var hostname = require('url').parse(url).hostname; + return 'NTLM ' + exports.encodeType3(username, hostname, domain, exports.decodeType2(serverNonce), password).toString('base64') +}; + +// Import smbhash module. + +exports.smbhash = require('./smbhash'); diff --git a/node_modules/typed-rest-client/opensource/Node-SMB/lib/smbhash.js b/node_modules/typed-rest-client/opensource/Node-SMB/lib/smbhash.js index c99828d31..d59763959 100644 --- a/node_modules/typed-rest-client/opensource/Node-SMB/lib/smbhash.js +++ b/node_modules/typed-rest-client/opensource/Node-SMB/lib/smbhash.js @@ -1,64 +1,64 @@ -var crypto = require('crypto'); -var $ = require('./common'); - -/* - * Generate the LM Hash - */ -function lmhashbuf(inputstr) -{ - /* ASCII --> uppercase */ - var x = inputstr.substring(0, 14).toUpperCase(); - var xl = Buffer.byteLength(x, 'ascii'); - - /* null pad to 14 bytes */ - var y = new Buffer(14); - y.write(x, 0, xl, 'ascii'); - y.fill(0, xl); - - /* insert odd parity bits in key */ - var halves = [ - $.oddpar($.expandkey(y.slice(0, 7))), - $.oddpar($.expandkey(y.slice(7, 14))) - ]; - - /* DES encrypt magic number "KGS!@#$%" to two - * 8-byte ciphertexts, (ECB, no padding) - */ - var buf = new Buffer(16); - var pos = 0; - var cts = halves.forEach(function(z) { - var des = crypto.createCipheriv('DES-ECB', z, ''); - var str = des.update('KGS!@#$%', 'binary', 'binary'); - buf.write(str, pos, pos + 8, 'binary'); - pos += 8; - }); - - /* concat the two ciphertexts to form 16byte value, - * the LM hash */ - return buf; -} - -function nthashbuf(str) -{ - /* take MD4 hash of UCS-2 encoded password */ - var ucs2 = new Buffer(str, 'ucs2'); - var md4 = crypto.createHash('md4'); - md4.update(ucs2); - return new Buffer(md4.digest('binary'), 'binary'); -} - -function lmhash(is) -{ - return $.bintohex(lmhashbuf(is)); -} - -function nthash(is) -{ - return $.bintohex(nthashbuf(is)); -} - -module.exports.nthashbuf = nthashbuf; -module.exports.lmhashbuf = lmhashbuf; - -module.exports.nthash = nthash; -module.exports.lmhash = lmhash; +var crypto = require('crypto'); +var $ = require('./common'); + +/* + * Generate the LM Hash + */ +function lmhashbuf(inputstr) +{ + /* ASCII --> uppercase */ + var x = inputstr.substring(0, 14).toUpperCase(); + var xl = Buffer.byteLength(x, 'ascii'); + + /* null pad to 14 bytes */ + var y = new Buffer(14); + y.write(x, 0, xl, 'ascii'); + y.fill(0, xl); + + /* insert odd parity bits in key */ + var halves = [ + $.oddpar($.expandkey(y.slice(0, 7))), + $.oddpar($.expandkey(y.slice(7, 14))) + ]; + + /* DES encrypt magic number "KGS!@#$%" to two + * 8-byte ciphertexts, (ECB, no padding) + */ + var buf = new Buffer(16); + var pos = 0; + var cts = halves.forEach(function(z) { + var des = crypto.createCipheriv('DES-ECB', z, ''); + var str = des.update('KGS!@#$%', 'binary', 'binary'); + buf.write(str, pos, pos + 8, 'binary'); + pos += 8; + }); + + /* concat the two ciphertexts to form 16byte value, + * the LM hash */ + return buf; +} + +function nthashbuf(str) +{ + /* take MD4 hash of UCS-2 encoded password */ + var ucs2 = new Buffer(str, 'ucs2'); + var md4 = crypto.createHash('md4'); + md4.update(ucs2); + return new Buffer(md4.digest('binary'), 'binary'); +} + +function lmhash(is) +{ + return $.bintohex(lmhashbuf(is)); +} + +function nthash(is) +{ + return $.bintohex(nthashbuf(is)); +} + +module.exports.nthashbuf = nthashbuf; +module.exports.lmhashbuf = lmhashbuf; + +module.exports.nthash = nthash; +module.exports.lmhash = lmhash; diff --git a/node_modules/typed-rest-client/package.json b/node_modules/typed-rest-client/package.json index cb003c7b8..2ae8077b8 100644 --- a/node_modules/typed-rest-client/package.json +++ b/node_modules/typed-rest-client/package.json @@ -1,47 +1,47 @@ -{ - "name": "typed-rest-client", - "version": "1.8.4", - "description": "Node Rest and Http Clients for use with TypeScript", - "main": "./RestClient.js", - "scripts": { - "build": "node make.js build", - "test": "node make.js test", - "bt": "node make.js buildtest", - "samples": "node make.js samples", - "units": "node make.js units", - "validate": "node make.js validate" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/Microsoft/typed-rest-client.git" - }, - "keywords": [ - "rest", - "http", - "client", - "typescript", - "node" - ], - "author": "Microsoft Corporation", - "license": "MIT", - "bugs": { - "url": "https://github.com/Microsoft/typed-rest-client/issues" - }, - "homepage": "https://github.com/Microsoft/typed-rest-client#readme", - "devDependencies": { - "@types/mocha": "^2.2.44", - "@types/node": "^6.0.92", - "@types/shelljs": "0.7.4", - "mocha": "^3.5.3", - "nock": "9.6.1", - "react-scripts": "1.1.5", - "semver": "4.3.3", - "shelljs": "0.7.6", - "typescript": "3.1.5" - }, - "dependencies": { - "qs": "^6.9.1", - "tunnel": "0.0.6", - "underscore": "^1.12.1" - } -} +{ + "name": "typed-rest-client", + "version": "1.8.4", + "description": "Node Rest and Http Clients for use with TypeScript", + "main": "./RestClient.js", + "scripts": { + "build": "node make.js build", + "test": "node make.js test", + "bt": "node make.js buildtest", + "samples": "node make.js samples", + "units": "node make.js units", + "validate": "node make.js validate" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/Microsoft/typed-rest-client.git" + }, + "keywords": [ + "rest", + "http", + "client", + "typescript", + "node" + ], + "author": "Microsoft Corporation", + "license": "MIT", + "bugs": { + "url": "https://github.com/Microsoft/typed-rest-client/issues" + }, + "homepage": "https://github.com/Microsoft/typed-rest-client#readme", + "devDependencies": { + "@types/mocha": "^2.2.44", + "@types/node": "^6.0.92", + "@types/shelljs": "0.7.4", + "mocha": "^3.5.3", + "nock": "9.6.1", + "react-scripts": "1.1.5", + "semver": "4.3.3", + "shelljs": "0.7.6", + "typescript": "3.1.5" + }, + "dependencies": { + "qs": "^6.9.1", + "tunnel": "0.0.6", + "underscore": "^1.12.1" + } +} diff --git a/node_modules/typescript/AUTHORS.md b/node_modules/typescript/AUTHORS.md index 1f8cbe6c2..2ee14e49b 100644 --- a/node_modules/typescript/AUTHORS.md +++ b/node_modules/typescript/AUTHORS.md @@ -1,348 +1,348 @@ -TypeScript is authored by: -* Aaron Holmes -* Abubaker Bashir -* Adam Freidin -* Adi Dahiya -* Aditya Daflapurkar -* Adnan Chowdhury -* Adrian Leonhard -* Adrien Gibrat -* Ahmad Farid -* Akshar Patel -* Alan Agius -* Alex Chugaev -* Alex Eagle -* Alex Khomchenko -* Alex Ryan -* Alexander Kuvaev -* Alexander Rusakov -* Alexander Tarasyuk -* Ali Sabzevari -* Aliaksandr Radzivanovich -* Aluan Haddad -* Anatoly Ressin -* Anders Hejlsberg -* Andreas Martin -* Andrej Baran -* Andrew Casey -* Andrew Faulkner -* Andrew Ochsner -* Andrew Stegmaier -* Andrew Z Allen -* András Parditka -* Andy Hanson -* Anil Anar -* Anton Khlynovskiy -* Anton Tolmachev -* Anubha Mathur -* Armando Aguirre -* Arnaud Tournier -* Arnav Singh -* Artem Tyurin -* Arthur Ozga -* Asad Saeeduddin -* Avery Morin -* Basarat Ali Syed -* @begincalendar -* Ben Duffield -* Ben Mosher -* Benjamin Bock -* Benjamin Lichtman -* Benny Neugebauer -* Bill Ticehurst -* Blaine Bublitz -* Blake Embrey -* @bluelovers -* @bootstraponline -* Bowden Kelly -* Bowden Kenny -* Brandon Slade -* Brett Mayen -* Bryan Forbes -* Caitlin Potter -* Cameron Taggart -* @cedvdb -* Charles Pierce -* Charly POLY -* Chris Bubernak -* Christophe Vidal -* Chuck Jazdzewski -* Colby Russell -* Colin Snover -* Cotton Hou -* Cyrus Najmabadi -* Dafrok Zhang -* Dahan Gong -* Dan Corder -* Dan Freeman -* Dan Quirk -* Daniel Gooss -* Daniel Hollocher -* Daniel Król -* Daniel Lehenbauer -* Daniel Rosenwasser -* David Kmenta -* David Li -* David Sheldrick -* David Sherret -* David Souther -* David Staheli -* Denis Nedelyaev -* Derek P Sifford -* Dhruv Rajvanshi -* Dick van den Brink -* Diogo Franco (Kovensky) -* Dirk Bäumer -* Dirk Holtwick -* Dom Chen -* Donald Pipowitch -* Doug Ilijev -* @e-cloud -* Ecole Keine -* Elisée Maurer -* Elizabeth Dinella -* Emilio García-Pumarino -* Eric Grube -* Eric Tsang -* Erik Edrosa -* Erik McClenney -* Esakki Raj -* Ethan Resnick -* Ethan Rubio -* Eugene Timokhov -* Evan Martin -* Evan Sebastian -* Eyas Sharaiha -* Fabian Cook -* @falsandtru -* Filipe Silva -* @flowmemo -* Francois Wouts -* Frank Wallis -* Franklin Tse -* František Žiacik -* Gabe Moothart -* Gabriel Isenberg -* Gilad Peleg -* Godfrey Chan -* Graeme Wicksted -* Guilherme Oenning -* Guillaume Salles -* Guy Bedford -* Halasi Tamás -* Harald Niesche -* Hendrik Liebau -* Henry Mercer -* Herrington Darkholme -* Holger Jeromin -* Homa Wong -* Iain Monro -* @IdeaHunter -* Igor Novozhilov -* Ika -* Ingvar Stepanyan -* Isiah Meadows -* Ivan Enderlin -* Ivo Gabe de Wolff -* Iwata Hidetaka -* Jack Williams -* Jakub Korzeniowski -* Jakub Młokosiewicz -* James Henry -* James Whitney -* Jan Melcher -* Jason Freeman -* Jason Jarrett -* Jason Killian -* Jason Ramsay -* JBerger -* Jed Mao -* Jeffrey Morlan -* Jesse Schalken -* Jing Ma -* Jiri Tobisek -* Joe Calzaretta -* Joe Chung -* Joel Day -* Joey Wilson -* Johannes Rieken -* John Doe -* John Vilk -* Jonathan Bond-Caron -* Jonathan Park -* Jonathan Toland -* Jonathan Turner -* Jonathon Smith -* Jordi Oliveras Rovira -* Joscha Feth -* Josh Abernathy -* Josh Goldberg -* Josh Kalderimis -* Josh Soref -* Juan Luis Boya García -* Julian Williams -* Justin Bay -* Justin Johansson -* K. Preißer -* Kagami Sascha Rosylight -* Kanchalai Tanglertsampan -* Kate Miháliková -* Keith Mashinter -* Ken Howard -* Kenji Imamula -* Kerem Kat -* Kevin Donnelly -* Kevin Gibbons -* Kevin Lang -* Khải -* Kitson Kelly -* Klaus Meinhardt -* Kris Zyp -* Kyle Kelley -* Kārlis Gaņģis -* Lorant Pinter -* Lucien Greathouse -* Lukas Elmer -* Maarten Sijm -* Magnus Hiie -* Magnus Kulke -* Manish Giri -* Marin Marinov -* Marius Schulz -* Markus Johnsson -* Martin Hiller -* Martin Probst -* Martin Vseticka -* Martyn Janes -* Masahiro Wakame -* Mateusz Burzyński -* Matt Bierner -* Matt McCutchen -* Matt Mitchell -* Mattias Buelens -* Mattias Buelens -* Max Deepfield -* Maxwell Paul Brickner -* @meyer -* Micah Zoltu -* @micbou -* Michael -* Michael Bromley -* Mike Busyrev -* Mike Morearty -* Mine Starks -* Mohamed Hegazy -* Mohsen Azimi -* Myles Megyesi -* Nathan Shively-Sanders -* Nathan Yee -* Nicolas Henry -* Nicu Micleușanu -* @nieltg -* Nima Zahedi -* Noah Chen -* Noel Varanda -* Noj Vek -* Oleg Mihailik -* Oleksandr Chekhovskyi -* Omer Sheikh -* Orta Therox -* Oskar Segersva¨rd -* Oussama Ben Brahim -* Patrick Zhong -* Paul Jolly -* Paul Koerbitz -* Paul van Brenk -* @pcbro -* Pedro Maltez -* Perry Jiang -* Peter Burns -* Philip Bulley -* Philippe Voinov -* Pi Lanningham -* Piero Cangianiello -* @piloopin -* Prayag Verma -* Priyantha Lankapura -* @progre -* Punya Biswal -* Rado Kirov -* Raj Dosanjh -* Reiner Dolp -* Remo H. Jansen -* @rhysd -* Ricardo N Feliciano -* Richard Karmazín -* Richard Knoll -* Richard Sentino -* Robert Coie -* Rohit Verma -* Ron Buckton -* Rostislav Galimsky -* Rowan Wyborn -* Ryan Cavanaugh -* Ryohei Ikegami -* Sam Bostock -* Sam El-Husseini -* Sarangan Rajamanickam -* Sean Barag -* Sergey Rubanov -* Sergey Shandar -* Sergii Bezliudnyi -* Sharon Rolel -* Sheetal Nandi -* Shengping Zhong -* Shyyko Serhiy -* Simon Hürlimann -* Slawomir Sadziak -* Solal Pirelli -* Soo Jae Hwang -* Stan Thomas -* Stanislav Iliev -* Stanislav Sysoev -* Stas Vilchik -* Stephan Ginthör -* Steve Lucco -* @styfle -* Sudheesh Singanamalla -* Sébastien Arod -* @T18970237136 -* @t_ -* Taras Mankovski -* Tarik Ozket -* Tetsuharu Ohzeki -* Thomas den Hollander -* Thomas Loubiou -* Tien Hoanhtien -* Tim Lancina -* Tim Perry -* Tim Viiding-Spader -* Tingan Ho -* Todd Thomson -* togru -* Tomas Grubliauskas -* Torben Fitschen -* @TravCav -* TruongSinh Tran-Nguyen -* Tycho Grouwstra -* Vadi Taslim -* Vakhurin Sergey -* Vidar Tonaas Fauske -* Viktor Zozulyak -* Vilic Vane -* Vimal Raghubir -* Vladimir Kurchatkin -* Vladimir Matveev -* Vyacheslav Pukhanov -* Wenlu Wang -* Wesley Wigham -* William Orr -* Wilson Hobbs -* York Yao -* @yortus -* Yuichi Nukiyama -* Yuval Greenfield -* Zeeshan Ahmed -* Zev Spitz -* Zhengbo Li +TypeScript is authored by: +* Aaron Holmes +* Abubaker Bashir +* Adam Freidin +* Adi Dahiya +* Aditya Daflapurkar +* Adnan Chowdhury +* Adrian Leonhard +* Adrien Gibrat +* Ahmad Farid +* Akshar Patel +* Alan Agius +* Alex Chugaev +* Alex Eagle +* Alex Khomchenko +* Alex Ryan +* Alexander Kuvaev +* Alexander Rusakov +* Alexander Tarasyuk +* Ali Sabzevari +* Aliaksandr Radzivanovich +* Aluan Haddad +* Anatoly Ressin +* Anders Hejlsberg +* Andreas Martin +* Andrej Baran +* Andrew Casey +* Andrew Faulkner +* Andrew Ochsner +* Andrew Stegmaier +* Andrew Z Allen +* András Parditka +* Andy Hanson +* Anil Anar +* Anton Khlynovskiy +* Anton Tolmachev +* Anubha Mathur +* Armando Aguirre +* Arnaud Tournier +* Arnav Singh +* Artem Tyurin +* Arthur Ozga +* Asad Saeeduddin +* Avery Morin +* Basarat Ali Syed +* @begincalendar +* Ben Duffield +* Ben Mosher +* Benjamin Bock +* Benjamin Lichtman +* Benny Neugebauer +* Bill Ticehurst +* Blaine Bublitz +* Blake Embrey +* @bluelovers +* @bootstraponline +* Bowden Kelly +* Bowden Kenny +* Brandon Slade +* Brett Mayen +* Bryan Forbes +* Caitlin Potter +* Cameron Taggart +* @cedvdb +* Charles Pierce +* Charly POLY +* Chris Bubernak +* Christophe Vidal +* Chuck Jazdzewski +* Colby Russell +* Colin Snover +* Cotton Hou +* Cyrus Najmabadi +* Dafrok Zhang +* Dahan Gong +* Dan Corder +* Dan Freeman +* Dan Quirk +* Daniel Gooss +* Daniel Hollocher +* Daniel Król +* Daniel Lehenbauer +* Daniel Rosenwasser +* David Kmenta +* David Li +* David Sheldrick +* David Sherret +* David Souther +* David Staheli +* Denis Nedelyaev +* Derek P Sifford +* Dhruv Rajvanshi +* Dick van den Brink +* Diogo Franco (Kovensky) +* Dirk Bäumer +* Dirk Holtwick +* Dom Chen +* Donald Pipowitch +* Doug Ilijev +* @e-cloud +* Ecole Keine +* Elisée Maurer +* Elizabeth Dinella +* Emilio García-Pumarino +* Eric Grube +* Eric Tsang +* Erik Edrosa +* Erik McClenney +* Esakki Raj +* Ethan Resnick +* Ethan Rubio +* Eugene Timokhov +* Evan Martin +* Evan Sebastian +* Eyas Sharaiha +* Fabian Cook +* @falsandtru +* Filipe Silva +* @flowmemo +* Francois Wouts +* Frank Wallis +* Franklin Tse +* František Žiacik +* Gabe Moothart +* Gabriel Isenberg +* Gilad Peleg +* Godfrey Chan +* Graeme Wicksted +* Guilherme Oenning +* Guillaume Salles +* Guy Bedford +* Halasi Tamás +* Harald Niesche +* Hendrik Liebau +* Henry Mercer +* Herrington Darkholme +* Holger Jeromin +* Homa Wong +* Iain Monro +* @IdeaHunter +* Igor Novozhilov +* Ika +* Ingvar Stepanyan +* Isiah Meadows +* Ivan Enderlin +* Ivo Gabe de Wolff +* Iwata Hidetaka +* Jack Williams +* Jakub Korzeniowski +* Jakub Młokosiewicz +* James Henry +* James Whitney +* Jan Melcher +* Jason Freeman +* Jason Jarrett +* Jason Killian +* Jason Ramsay +* JBerger +* Jed Mao +* Jeffrey Morlan +* Jesse Schalken +* Jing Ma +* Jiri Tobisek +* Joe Calzaretta +* Joe Chung +* Joel Day +* Joey Wilson +* Johannes Rieken +* John Doe +* John Vilk +* Jonathan Bond-Caron +* Jonathan Park +* Jonathan Toland +* Jonathan Turner +* Jonathon Smith +* Jordi Oliveras Rovira +* Joscha Feth +* Josh Abernathy +* Josh Goldberg +* Josh Kalderimis +* Josh Soref +* Juan Luis Boya García +* Julian Williams +* Justin Bay +* Justin Johansson +* K. Preißer +* Kagami Sascha Rosylight +* Kanchalai Tanglertsampan +* Kate Miháliková +* Keith Mashinter +* Ken Howard +* Kenji Imamula +* Kerem Kat +* Kevin Donnelly +* Kevin Gibbons +* Kevin Lang +* Khải +* Kitson Kelly +* Klaus Meinhardt +* Kris Zyp +* Kyle Kelley +* Kārlis Gaņģis +* Lorant Pinter +* Lucien Greathouse +* Lukas Elmer +* Maarten Sijm +* Magnus Hiie +* Magnus Kulke +* Manish Giri +* Marin Marinov +* Marius Schulz +* Markus Johnsson +* Martin Hiller +* Martin Probst +* Martin Vseticka +* Martyn Janes +* Masahiro Wakame +* Mateusz Burzyński +* Matt Bierner +* Matt McCutchen +* Matt Mitchell +* Mattias Buelens +* Mattias Buelens +* Max Deepfield +* Maxwell Paul Brickner +* @meyer +* Micah Zoltu +* @micbou +* Michael +* Michael Bromley +* Mike Busyrev +* Mike Morearty +* Mine Starks +* Mohamed Hegazy +* Mohsen Azimi +* Myles Megyesi +* Nathan Shively-Sanders +* Nathan Yee +* Nicolas Henry +* Nicu Micleușanu +* @nieltg +* Nima Zahedi +* Noah Chen +* Noel Varanda +* Noj Vek +* Oleg Mihailik +* Oleksandr Chekhovskyi +* Omer Sheikh +* Orta Therox +* Oskar Segersva¨rd +* Oussama Ben Brahim +* Patrick Zhong +* Paul Jolly +* Paul Koerbitz +* Paul van Brenk +* @pcbro +* Pedro Maltez +* Perry Jiang +* Peter Burns +* Philip Bulley +* Philippe Voinov +* Pi Lanningham +* Piero Cangianiello +* @piloopin +* Prayag Verma +* Priyantha Lankapura +* @progre +* Punya Biswal +* Rado Kirov +* Raj Dosanjh +* Reiner Dolp +* Remo H. Jansen +* @rhysd +* Ricardo N Feliciano +* Richard Karmazín +* Richard Knoll +* Richard Sentino +* Robert Coie +* Rohit Verma +* Ron Buckton +* Rostislav Galimsky +* Rowan Wyborn +* Ryan Cavanaugh +* Ryohei Ikegami +* Sam Bostock +* Sam El-Husseini +* Sarangan Rajamanickam +* Sean Barag +* Sergey Rubanov +* Sergey Shandar +* Sergii Bezliudnyi +* Sharon Rolel +* Sheetal Nandi +* Shengping Zhong +* Shyyko Serhiy +* Simon Hürlimann +* Slawomir Sadziak +* Solal Pirelli +* Soo Jae Hwang +* Stan Thomas +* Stanislav Iliev +* Stanislav Sysoev +* Stas Vilchik +* Stephan Ginthör +* Steve Lucco +* @styfle +* Sudheesh Singanamalla +* Sébastien Arod +* @T18970237136 +* @t_ +* Taras Mankovski +* Tarik Ozket +* Tetsuharu Ohzeki +* Thomas den Hollander +* Thomas Loubiou +* Tien Hoanhtien +* Tim Lancina +* Tim Perry +* Tim Viiding-Spader +* Tingan Ho +* Todd Thomson +* togru +* Tomas Grubliauskas +* Torben Fitschen +* @TravCav +* TruongSinh Tran-Nguyen +* Tycho Grouwstra +* Vadi Taslim +* Vakhurin Sergey +* Vidar Tonaas Fauske +* Viktor Zozulyak +* Vilic Vane +* Vimal Raghubir +* Vladimir Kurchatkin +* Vladimir Matveev +* Vyacheslav Pukhanov +* Wenlu Wang +* Wesley Wigham +* William Orr +* Wilson Hobbs +* York Yao +* @yortus +* Yuichi Nukiyama +* Yuval Greenfield +* Zeeshan Ahmed +* Zev Spitz +* Zhengbo Li * @Zzzen \ No newline at end of file diff --git a/node_modules/typescript/LICENSE.txt b/node_modules/typescript/LICENSE.txt index edc24fd6e..8746124b2 100644 --- a/node_modules/typescript/LICENSE.txt +++ b/node_modules/typescript/LICENSE.txt @@ -1,55 +1,55 @@ -Apache License - -Version 2.0, January 2004 - -http://www.apache.org/licenses/ - -TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - -1. Definitions. - -"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. - -"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. - -"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. - -"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. - -"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. - -"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. - -"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). - -"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. - -"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." - -"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. - -2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. - -3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. - -4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: - -You must give any other recipients of the Work or Derivative Works a copy of this License; and - -You must cause any modified files to carry prominent notices stating that You changed the files; and - -You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and - -If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. - -5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. - -6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. - -7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. - -8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. - -9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. - -END OF TERMS AND CONDITIONS +Apache License + +Version 2.0, January 2004 + +http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + +"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. + +"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + +"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + +"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. + +"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. + +"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. + +"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). + +"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. + +"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." + +"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: + +You must give any other recipients of the Work or Derivative Works a copy of this License; and + +You must cause any modified files to carry prominent notices stating that You changed the files; and + +You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and + +If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS diff --git a/node_modules/typescript/README.md b/node_modules/typescript/README.md index 4b6928f86..459cebe95 100644 --- a/node_modules/typescript/README.md +++ b/node_modules/typescript/README.md @@ -1,107 +1,107 @@ - -# TypeScript - -[![Join the chat at https://gitter.im/microsoft/TypeScript](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/microsoft/TypeScript?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) -[![Build Status](https://travis-ci.org/microsoft/TypeScript.svg?branch=master)](https://travis-ci.org/microsoft/TypeScript) -[![VSTS Build Status](https://dev.azure.com/typescript/TypeScript/_apis/build/status/Typescript/node10)](https://dev.azure.com/typescript/TypeScript/_build/latest?definitionId=4&view=logs) -[![npm version](https://badge.fury.io/js/typescript.svg)](https://www.npmjs.com/package/typescript) -[![Downloads](https://img.shields.io/npm/dm/typescript.svg)](https://www.npmjs.com/package/typescript) - - - -[TypeScript](https://www.typescriptlang.org/) is a language for application-scale JavaScript. TypeScript adds optional types to JavaScript that support tools for large-scale JavaScript applications for any browser, for any host, on any OS. TypeScript compiles to readable, standards-based JavaScript. Try it out at the [playground](https://www.typescriptlang.org/play/), and stay up to date via [our blog](https://blogs.msdn.microsoft.com/typescript) and [Twitter account](https://twitter.com/typescript). - -## Installing - -For the latest stable version: - -```bash -npm install -g typescript -``` - -For our nightly builds: - -```bash -npm install -g typescript@next -``` - -## Contribute - -There are many ways to [contribute](https://github.com/microsoft/TypeScript/blob/master/CONTRIBUTING.md) to TypeScript. -* [Submit bugs](https://github.com/microsoft/TypeScript/issues) and help us verify fixes as they are checked in. -* Review the [source code changes](https://github.com/microsoft/TypeScript/pulls). -* Engage with other TypeScript users and developers on [StackOverflow](https://stackoverflow.com/questions/tagged/typescript). -* Join the [#typescript](https://twitter.com/search?q=%23TypeScript) discussion on Twitter. -* [Contribute bug fixes](https://github.com/microsoft/TypeScript/blob/master/CONTRIBUTING.md). -* Read the language specification ([docx](https://github.com/microsoft/TypeScript/blob/master/doc/TypeScript%20Language%20Specification.docx?raw=true), - [pdf](https://github.com/microsoft/TypeScript/blob/master/doc/TypeScript%20Language%20Specification.pdf?raw=true), [md](https://github.com/microsoft/TypeScript/blob/master/doc/spec.md)). - -This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see -the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) -with any additional questions or comments. - -## Documentation - -* [TypeScript in 5 minutes](https://www.typescriptlang.org/docs/handbook/typescript-in-5-minutes.html) -* [Programming handbook](https://www.typescriptlang.org/docs/handbook/basic-types.html) -* [Language specification](https://github.com/microsoft/TypeScript/blob/master/doc/spec.md) -* [Homepage](https://www.typescriptlang.org/) - -## Building - -In order to build the TypeScript compiler, ensure that you have [Git](https://git-scm.com/downloads) and [Node.js](https://nodejs.org/) installed. - -Clone a copy of the repo: - -```bash -git clone https://github.com/microsoft/TypeScript.git -``` - -Change to the TypeScript directory: - -```bash -cd TypeScript -``` - -Install [Gulp](https://gulpjs.com/) tools and dev dependencies: - -```bash -npm install -g gulp -npm install -``` - -Use one of the following to build and test: - -``` -gulp local # Build the compiler into built/local. -gulp clean # Delete the built compiler. -gulp LKG # Replace the last known good with the built one. - # Bootstrapping step to be executed when the built compiler reaches a stable state. -gulp tests # Build the test infrastructure using the built compiler. -gulp runtests # Run tests using the built compiler and test infrastructure. - # Some low-value tests are skipped when not on a CI machine - you can use the - # --skipPercent=0 command to override this behavior and run all tests locally. - # You can override the specific suite runner used or specify a test for this command. - # Use --tests= for a specific test and/or --runner= for a specific suite. - # Valid runners include conformance, compiler, fourslash, project, user, and docker - # The user and docker runners are extended test suite runners - the user runner - # works on disk in the tests/cases/user directory, while the docker runner works in containers. - # You'll need to have the docker executable in your system path for the docker runner to work. -gulp runtests-parallel # Like runtests, but split across multiple threads. Uses a number of threads equal to the system - # core count by default. Use --workers= to adjust this. -gulp baseline-accept # This replaces the baseline test results with the results obtained from gulp runtests. -gulp lint # Runs eslint on the TypeScript source. -gulp help # List the above commands. -``` - - -## Usage - -```bash -node built/local/tsc.js hello.ts -``` - - -## Roadmap - -For details on our planned features and future direction please refer to our [roadmap](https://github.com/microsoft/TypeScript/wiki/Roadmap). + +# TypeScript + +[![Join the chat at https://gitter.im/microsoft/TypeScript](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/microsoft/TypeScript?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) +[![Build Status](https://travis-ci.org/microsoft/TypeScript.svg?branch=master)](https://travis-ci.org/microsoft/TypeScript) +[![VSTS Build Status](https://dev.azure.com/typescript/TypeScript/_apis/build/status/Typescript/node10)](https://dev.azure.com/typescript/TypeScript/_build/latest?definitionId=4&view=logs) +[![npm version](https://badge.fury.io/js/typescript.svg)](https://www.npmjs.com/package/typescript) +[![Downloads](https://img.shields.io/npm/dm/typescript.svg)](https://www.npmjs.com/package/typescript) + + + +[TypeScript](https://www.typescriptlang.org/) is a language for application-scale JavaScript. TypeScript adds optional types to JavaScript that support tools for large-scale JavaScript applications for any browser, for any host, on any OS. TypeScript compiles to readable, standards-based JavaScript. Try it out at the [playground](https://www.typescriptlang.org/play/), and stay up to date via [our blog](https://blogs.msdn.microsoft.com/typescript) and [Twitter account](https://twitter.com/typescript). + +## Installing + +For the latest stable version: + +```bash +npm install -g typescript +``` + +For our nightly builds: + +```bash +npm install -g typescript@next +``` + +## Contribute + +There are many ways to [contribute](https://github.com/microsoft/TypeScript/blob/master/CONTRIBUTING.md) to TypeScript. +* [Submit bugs](https://github.com/microsoft/TypeScript/issues) and help us verify fixes as they are checked in. +* Review the [source code changes](https://github.com/microsoft/TypeScript/pulls). +* Engage with other TypeScript users and developers on [StackOverflow](https://stackoverflow.com/questions/tagged/typescript). +* Join the [#typescript](https://twitter.com/search?q=%23TypeScript) discussion on Twitter. +* [Contribute bug fixes](https://github.com/microsoft/TypeScript/blob/master/CONTRIBUTING.md). +* Read the language specification ([docx](https://github.com/microsoft/TypeScript/blob/master/doc/TypeScript%20Language%20Specification.docx?raw=true), + [pdf](https://github.com/microsoft/TypeScript/blob/master/doc/TypeScript%20Language%20Specification.pdf?raw=true), [md](https://github.com/microsoft/TypeScript/blob/master/doc/spec.md)). + +This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see +the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) +with any additional questions or comments. + +## Documentation + +* [TypeScript in 5 minutes](https://www.typescriptlang.org/docs/handbook/typescript-in-5-minutes.html) +* [Programming handbook](https://www.typescriptlang.org/docs/handbook/basic-types.html) +* [Language specification](https://github.com/microsoft/TypeScript/blob/master/doc/spec.md) +* [Homepage](https://www.typescriptlang.org/) + +## Building + +In order to build the TypeScript compiler, ensure that you have [Git](https://git-scm.com/downloads) and [Node.js](https://nodejs.org/) installed. + +Clone a copy of the repo: + +```bash +git clone https://github.com/microsoft/TypeScript.git +``` + +Change to the TypeScript directory: + +```bash +cd TypeScript +``` + +Install [Gulp](https://gulpjs.com/) tools and dev dependencies: + +```bash +npm install -g gulp +npm install +``` + +Use one of the following to build and test: + +``` +gulp local # Build the compiler into built/local. +gulp clean # Delete the built compiler. +gulp LKG # Replace the last known good with the built one. + # Bootstrapping step to be executed when the built compiler reaches a stable state. +gulp tests # Build the test infrastructure using the built compiler. +gulp runtests # Run tests using the built compiler and test infrastructure. + # Some low-value tests are skipped when not on a CI machine - you can use the + # --skipPercent=0 command to override this behavior and run all tests locally. + # You can override the specific suite runner used or specify a test for this command. + # Use --tests= for a specific test and/or --runner= for a specific suite. + # Valid runners include conformance, compiler, fourslash, project, user, and docker + # The user and docker runners are extended test suite runners - the user runner + # works on disk in the tests/cases/user directory, while the docker runner works in containers. + # You'll need to have the docker executable in your system path for the docker runner to work. +gulp runtests-parallel # Like runtests, but split across multiple threads. Uses a number of threads equal to the system + # core count by default. Use --workers= to adjust this. +gulp baseline-accept # This replaces the baseline test results with the results obtained from gulp runtests. +gulp lint # Runs eslint on the TypeScript source. +gulp help # List the above commands. +``` + + +## Usage + +```bash +node built/local/tsc.js hello.ts +``` + + +## Roadmap + +For details on our planned features and future direction please refer to our [roadmap](https://github.com/microsoft/TypeScript/wiki/Roadmap). diff --git a/node_modules/typescript/ThirdPartyNoticeText.txt b/node_modules/typescript/ThirdPartyNoticeText.txt index b4f9cb68d..26aa57f27 100644 --- a/node_modules/typescript/ThirdPartyNoticeText.txt +++ b/node_modules/typescript/ThirdPartyNoticeText.txt @@ -1,193 +1,193 @@ -/*!----------------- TypeScript ThirdPartyNotices ------------------------------------------------------- - -The TypeScript software incorporates third party material from the projects listed below. The original copyright notice and the license under which Microsoft received such third party material are set forth below. Microsoft reserves all other rights not expressly granted, whether by implication, estoppel or otherwise. - ---------------------------------------------- -Third Party Code Components --------------------------------------------- - -------------------- DefinitelyTyped -------------------- -This file is based on or incorporates material from the projects listed below (collectively "Third Party Code"). Microsoft is not the original author of the Third Party Code. The original copyright notice and the license, under which Microsoft received such Third Party Code, are set forth below. Such licenses and notices are provided for informational purposes only. Microsoft, not the third party, licenses the Third Party Code to you under the terms set forth in the EULA for the Microsoft Product. Microsoft reserves all other rights not expressly granted under this agreement, whether by implication, estoppel or otherwise. -DefinitelyTyped -This project is licensed under the MIT license. Copyrights are respective of each contributor listed at the beginning of each definition file. Provided for Informational Purposes Only - -MIT License -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. --------------------------------------------------------------------------------------- - -------------------- Unicode -------------------- -UNICODE, INC. LICENSE AGREEMENT - DATA FILES AND SOFTWARE - -Unicode Data Files include all data files under the directories -http://www.unicode.org/Public/, http://www.unicode.org/reports/, -http://www.unicode.org/cldr/data/, http://source.icu-project.org/repos/icu/, and -http://www.unicode.org/utility/trac/browser/. - -Unicode Data Files do not include PDF online code charts under the -directory http://www.unicode.org/Public/. - -Software includes any source code published in the Unicode Standard -or under the directories -http://www.unicode.org/Public/, http://www.unicode.org/reports/, -http://www.unicode.org/cldr/data/, http://source.icu-project.org/repos/icu/, and -http://www.unicode.org/utility/trac/browser/. - -NOTICE TO USER: Carefully read the following legal agreement. -BY DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING UNICODE INC.'S -DATA FILES ("DATA FILES"), AND/OR SOFTWARE ("SOFTWARE"), -YOU UNEQUIVOCALLY ACCEPT, AND AGREE TO BE BOUND BY, ALL OF THE -TERMS AND CONDITIONS OF THIS AGREEMENT. -IF YOU DO NOT AGREE, DO NOT DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE -THE DATA FILES OR SOFTWARE. - -COPYRIGHT AND PERMISSION NOTICE - -Copyright (c) 1991-2017 Unicode, Inc. All rights reserved. -Distributed under the Terms of Use in http://www.unicode.org/copyright.html. - -Permission is hereby granted, free of charge, to any person obtaining -a copy of the Unicode data files and any associated documentation -(the "Data Files") or Unicode software and any associated documentation -(the "Software") to deal in the Data Files or Software -without restriction, including without limitation the rights to use, -copy, modify, merge, publish, distribute, and/or sell copies of -the Data Files or Software, and to permit persons to whom the Data Files -or Software are furnished to do so, provided that either -(a) this copyright and permission notice appear with all copies -of the Data Files or Software, or -(b) this copyright and permission notice appear in associated -Documentation. - -THE DATA FILES AND SOFTWARE ARE 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 OF THIRD PARTY RIGHTS. -IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS -NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL -DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, -DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER -TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THE DATA FILES OR SOFTWARE. - -Except as contained in this notice, the name of a copyright holder -shall not be used in advertising or otherwise to promote the sale, -use or other dealings in these Data Files or Software without prior -written authorization of the copyright holder. -------------------------------------------------------------------------------------- - --------------------Document Object Model----------------------------- -DOM - -W3C License -This work is being provided by the copyright holders under the following license. -By obtaining and/or copying this work, you (the licensee) agree that you have read, understood, and will comply with the following terms and conditions. -Permission to copy, modify, and distribute this work, with or without modification,�for any purpose and without fee or royalty is hereby granted, provided that you include the following -on ALL copies of the work or portions thereof, including modifications: -* The full text of this NOTICE in a location viewable to users of the redistributed or derivative work. -* Any pre-existing intellectual property disclaimers, notices, or terms and conditions. If none exist, the W3C Software and Document Short Notice should be included. -* Notice of any changes or modifications, through a copyright statement on the new code or document such as "This software or document includes material copied from or derived -from [title and URI of the W3C document]. Copyright � [YEAR] W3C� (MIT, ERCIM, Keio, Beihang)." -Disclaimers -THIS WORK IS PROVIDED "AS IS," AND COPYRIGHT HOLDERS MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY OR -FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE OR DOCUMENT WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS. -COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE SOFTWARE OR DOCUMENT. -The name and trademarks of copyright holders may NOT be used in advertising or publicity pertaining to the work without specific, written prior permission. -Title to copyright in this work will at all times remain with copyright holders. - ---------- - -DOM -Copyright � 2018 WHATWG (Apple, Google, Mozilla, Microsoft). This work is licensed under a Creative Commons Attribution 4.0 International License: Attribution 4.0 International -======================================================================= -Creative Commons Corporation ("Creative Commons") is not a law firm and does not provide legal services or legal advice. Distribution of Creative Commons public licenses does not create a lawyer-client or other relationship. Creative Commons makes its licenses and related information available on an "as-is" basis. Creative Commons gives no warranties regarding its licenses, any material licensed under their terms and conditions, or any related information. Creative Commons disclaims all liability for damages resulting from their use to the fullest extent possible. Using Creative Commons Public Licenses Creative Commons public licenses provide a standard set of terms and conditions that creators and other rights holders may use to share original works of authorship and other material subject to copyright and certain other rights specified in the public license below. The following considerations are for informational purposes only, are not exhaustive, and do not form part of our licenses. Considerations for licensors: Our public licenses are intended for use by those authorized to give the public permission to use material in ways otherwise restricted by copyright and certain other rights. Our licenses are irrevocable. Licensors should read and understand the terms and conditions of the license they choose before applying it. Licensors should also secure all rights necessary before applying our licenses so that the public can reuse the material as expected. Licensors should clearly mark any material not subject to the license. This includes other CC- licensed material, or material used under an exception or limitation to copyright. More considerations for licensors: - -wiki.creativecommons.org/Considerations_for_licensors Considerations for the public: By using one of our public licenses, a licensor grants the public permission to use the licensed material under specified terms and conditions. If the licensor's permission is not necessary for any reason--for example, because of any applicable exception or limitation to copyright--then that use is not regulated by the license. Our licenses grant only permissions under copyright and certain other rights that a licensor has authority to grant. Use of the licensed material may still be restricted for other reasons, including because others have copyright or other rights in the material. A licensor may make special requests, such as asking that all changes be marked or described. Although not required by our licenses, you are encouraged to respect those requests where reasonable. More_considerations for the public: wiki.creativecommons.org/Considerations_for_licensees ======================================================================= -Creative Commons Attribution 4.0 International Public License By exercising the Licensed Rights (defined below), You accept and agree to be bound by the terms and conditions of this Creative Commons Attribution 4.0 International Public License ("Public License"). To the extent this Public License may be interpreted as a contract, You are granted the Licensed Rights in consideration of Your acceptance of these terms and conditions, and the Licensor grants You such rights in consideration of benefits the Licensor receives from making the Licensed Material available under these terms and conditions. Section 1 -- Definitions. a. Adapted Material means material subject to Copyright and Similar Rights that is derived from or based upon the Licensed Material and in which the Licensed Material is translated, altered, arranged, transformed, or otherwise modified in a manner requiring permission under the Copyright and Similar Rights held by the Licensor. For purposes of this Public License, where the Licensed Material is a musical work, performance, or sound recording, Adapted Material is always produced where the Licensed Material is synched in timed relation with a moving image. b. Adapter's License means the license You apply to Your Copyright and Similar Rights in Your contributions to Adapted Material in accordance with the terms and conditions of this Public License. c. Copyright and Similar Rights means copyright and/or similar rights closely related to copyright including, without limitation, performance, broadcast, sound recording, and Sui Generis Database Rights, without regard to how the rights are labeled or categorized. For purposes of this Public License, the rights specified in Section 2(b)(1)-(2) are not Copyright and Similar Rights. d. Effective Technological Measures means those measures that, in the absence of proper authority, may not be circumvented under laws fulfilling obligations under Article 11 of the WIPO Copyright Treaty adopted on December 20, 1996, and/or similar international agreements. e. Exceptions and Limitations means fair use, fair dealing, and/or any other exception or limitation to Copyright and Similar Rights that applies to Your use of the Licensed Material. f. Licensed Material means the artistic or literary work, database, or other material to which the Licensor applied this Public License. g. Licensed Rights means the rights granted to You subject to the terms and conditions of this Public License, which are limited to all Copyright and Similar Rights that apply to Your use of the Licensed Material and that the Licensor has authority to license. h. Licensor means the individual(s) or entity(ies) granting rights under this Public License. i. Share means to provide material to the public by any means or process that requires permission under the Licensed Rights, such as reproduction, public display, public performance, distribution, dissemination, communication, or importation, and to make material available to the public including in ways that members of the public may access the material from a place and at a time individually chosen by them. j. Sui Generis Database Rights means rights other than copyright resulting from Directive 96/9/EC of the European Parliament and of the Council of 11 March 1996 on the legal protection of databases, as amended and/or succeeded, as well as other essentially equivalent rights anywhere in the world. k. You means the individual or entity exercising the Licensed Rights under this Public License. Your has a corresponding meaning. Section 2 -- Scope. a. License grant. 1. Subject to the terms and conditions of this Public License, the Licensor hereby grants You a worldwide, royalty-free, non-sublicensable, non-exclusive, irrevocable license to exercise the Licensed Rights in the Licensed Material to: a. reproduce and Share the Licensed Material, in whole or in part; and b. produce, reproduce, and Share Adapted Material. 2. Exceptions and Limitations. For the avoidance of doubt, where Exceptions and Limitations apply to Your use, this Public License does not apply, and You do not need to comply with its terms and conditions. 3. Term. The term of this Public License is specified in Section 6(a). 4. Media and formats; technical modifications allowed. The Licensor authorizes You to exercise the Licensed Rights in all media and formats whether now known or hereafter created, and to make technical modifications necessary to do so. The Licensor waives and/or agrees not to assert any right or authority to forbid You from making technical modifications necessary to exercise the Licensed Rights, including technical modifications necessary to circumvent Effective Technological Measures. For purposes of this Public License, simply making modifications authorized by this Section 2(a) (4) never produces Adapted Material. 5. Downstream recipients. a. Offer from the Licensor -- Licensed Material. Every recipient of the Licensed Material automatically receives an offer from the Licensor to exercise the Licensed Rights under the terms and conditions of this Public License. b. No downstream restrictions. You may not offer or impose any additional or different terms or conditions on, or apply any Effective Technological Measures to, the Licensed Material if doing so restricts exercise of the Licensed Rights by any recipient of the Licensed Material. 6. No endorsement. Nothing in this Public License constitutes or may be construed as permission to assert or imply that You are, or that Your use of the Licensed Material is, connected with, or sponsored, endorsed, or granted official status by, the Licensor or others designated to receive attribution as provided in Section 3(a)(1)(A)(i). b. Other rights. 1. Moral rights, such as the right of integrity, are not licensed under this Public License, nor are publicity, privacy, and/or other similar personality rights; however, to the extent possible, the Licensor waives and/or agrees not to assert any such rights held by the Licensor to the limited extent necessary to allow You to exercise the Licensed Rights, but not otherwise. 2. Patent and trademark rights are not licensed under this Public License. 3. To the extent possible, the Licensor waives any right to collect royalties from You for the exercise of the Licensed Rights, whether directly or through a collecting society under any voluntary or waivable statutory or compulsory licensing scheme. In all other cases the Licensor expressly reserves any right to collect such royalties. Section 3 -- License Conditions. Your exercise of the Licensed Rights is expressly made subject to the following conditions. a. Attribution. 1. If You Share the Licensed Material (including in modified form), You must: a. retain the following if it is supplied by the Licensor with the Licensed Material: i. identification of the creator(s) of the Licensed Material and any others designated to receive attribution, in any reasonable manner requested by the Licensor (including by pseudonym if designated); ii. a copyright notice; iii. a notice that refers to this Public License; iv. a notice that refers to the disclaimer of warranties; v. a URI or hyperlink to the Licensed Material to the extent reasonably practicable; b. indicate if You modified the Licensed Material and retain an indication of any previous modifications; and c. indicate the Licensed Material is licensed under this Public License, and include the text of, or the URI or hyperlink to, this Public License. 2. You may satisfy the conditions in Section 3(a)(1) in any reasonable manner based on the medium, means, and context in which You Share the Licensed Material. For example, it may be reasonable to satisfy the conditions by providing a URI or hyperlink to a resource that includes the required information. 3. If requested by the Licensor, You must remove any of the information required by Section 3(a)(1)(A) to the extent reasonably practicable. 4. If You Share Adapted Material You produce, the Adapter's License You apply must not prevent recipients of the Adapted Material from complying with this Public License. Section 4 -- Sui Generis Database Rights. Where the Licensed Rights include Sui Generis Database Rights that apply to Your use of the Licensed Material: a. for the avoidance of doubt, Section 2(a)(1) grants You the right to extract, reuse, reproduce, and Share all or a substantial portion of the contents of the database; b. if You include all or a substantial portion of the database contents in a database in which You have Sui Generis Database Rights, then the database in which You have Sui Generis Database Rights (but not its individual contents) is Adapted Material; and c. You must comply with the conditions in Section 3(a) if You Share all or a substantial portion of the contents of the database. For the avoidance of doubt, this Section 4 supplements and does not replace Your obligations under this Public License where the Licensed Rights include other Copyright and Similar Rights. Section 5 -- Disclaimer of Warranties and Limitation of Liability. a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS, IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU. b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION, NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT, INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES, COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR IN PART, THIS LIMITATION MAY NOT APPLY TO YOU. c. The disclaimer of warranties and limitation of liability provided above shall be interpreted in a manner that, to the extent possible, most closely approximates an absolute disclaimer and waiver of all liability. Section 6 -- Term and Termination. a. This Public License applies for the term of the Copyright and Similar Rights licensed here. However, if You fail to comply with this Public License, then Your rights under this Public License terminate automatically. b. Where Your right to use the Licensed Material has terminated under Section 6(a), it reinstates: 1. automatically as of the date the violation is cured, provided it is cured within 30 days of Your discovery of the violation; or 2. upon express reinstatement by the Licensor. For the avoidance of doubt, this Section 6(b) does not affect any right the Licensor may have to seek remedies for Your violations of this Public License. c. For the avoidance of doubt, the Licensor may also offer the Licensed Material under separate terms or conditions or stop distributing the Licensed Material at any time; however, doing so will not terminate this Public License. d. Sections 1, 5, 6, 7, and 8 survive termination of this Public License. Section 7 -- Other Terms and Conditions. a. The Licensor shall not be bound by any additional or different terms or conditions communicated by You unless expressly agreed. b. Any arrangements, understandings, or agreements regarding the Licensed Material not stated herein are separate from and independent of the terms and conditions of this Public License. Section 8 -- Interpretation. a. For the avoidance of doubt, this Public License does not, and shall not be interpreted to, reduce, limit, restrict, or impose conditions on any use of the Licensed Material that could lawfully be made without permission under this Public License. b. To the extent possible, if any provision of this Public License is deemed unenforceable, it shall be automatically reformed to the minimum extent necessary to make it enforceable. If the provision cannot be reformed, it shall be severed from this Public License without affecting the enforceability of the remaining terms and conditions. c. No term or condition of this Public License will be waived and no failure to comply consented to unless expressly agreed to by the Licensor. d. Nothing in this Public License constitutes or may be interpreted as a limitation upon, or waiver of, any privileges and immunities that apply to the Licensor or You, including from the legal processes of any jurisdiction or authority. ======================================================================= Creative Commons is not a party to its public licenses. Notwithstanding, Creative Commons may elect to apply one of its public licenses to material it publishes and in those instances will be considered the "Licensor." Except for the limited purpose of indicating that material is shared under a Creative Commons public license or as otherwise permitted by the Creative Commons policies published at creativecommons.org/policies, Creative Commons does not authorize the use of the trademark "Creative Commons" or any other trademark or logo of Creative Commons without its prior written consent including, without limitation, in connection with any unauthorized modifications to any of its public licenses or any other arrangements, understandings, or agreements concerning use of licensed material. For the avoidance of doubt, this paragraph does not form part of the public licenses. Creative Commons may be contacted at creativecommons.org. - --------------------------------------------------------------------------------- - -----------------------Web Background Synchronization------------------------------ - -Web Background Synchronization Specification -Portions of spec � by W3C - -W3C Community Final Specification Agreement -To secure commitments from participants for the full text of a Community or Business Group Report, the group may call for voluntary commitments to the following terms; a "summary" is -available. See also the related "W3C Community Contributor License Agreement". -1. The Purpose of this Agreement. -This Agreement sets forth the terms under which I make certain copyright and patent rights available to you for your implementation of the Specification. -Any other capitalized terms not specifically defined herein have the same meaning as those terms have in the "W3C Patent Policy", and if not defined there, in the "W3C Process Document". -2. Copyrights. -2.1. Copyright Grant. I grant to you a perpetual (for the duration of the applicable copyright), worldwide, non-exclusive, no-charge, royalty-free, copyright license, without any obligation for accounting to me, to reproduce, prepare derivative works of, publicly display, publicly perform, sublicense, distribute, and implement the Specification to the full extent of my copyright interest in the Specification. -2.2. Attribution. As a condition of the copyright grant, you must include an attribution to the Specification in any derivative work you make based on the Specification. That attribution must include, at minimum, the Specification name and version number. -3. Patents. -3.1. Patent Licensing Commitment. I agree to license my Essential Claims under the W3C Community RF Licensing Requirements. This requirement includes Essential Claims that I own and any that I have the right to license without obligation of payment or other consideration to an unrelated third party. W3C Community RF Licensing Requirements obligations made concerning the Specification and described in this policy are binding on me for the life of the patents in question and encumber the patents containing Essential Claims, regardless of changes in participation status or W3C Membership. I also agree to license my Essential Claims under the W3C Community RF Licensing Requirements in derivative works of the Specification so long as all normative portions of the Specification are maintained and that this licensing commitment does not extend to any portion of the derivative work that was not included in the Specification. -3.2. Optional, Additional Patent Grant. In addition to the provisions of Section 3.1, I may also, at my option, make certain intellectual property rights infringed by implementations of the Specification, including Essential Claims, available by providing those terms via the W3C Web site. -4. No Other Rights. Except as specifically set forth in this Agreement, no other express or implied patent, trademark, copyright, or other property rights are granted under this Agreement, including by implication, waiver, or estoppel. -5. Antitrust Compliance. I acknowledge that I may compete with other participants, that I am under no obligation to implement the Specification, that each participant is free to develop competing technologies and standards, and that each party is free to license its patent rights to third parties, including for the purpose of enabling competing technologies and standards. -6. Non-Circumvention. I agree that I will not intentionally take or willfully assist any third party to take any action for the purpose of circumventing my obligations under this Agreement. -7. Transition to W3C Recommendation Track. The Specification developed by the Project may transition to the W3C Recommendation Track. The W3C Team is responsible for notifying me that a Corresponding Working Group has been chartered. I have no obligation to join the Corresponding Working Group. If the Specification developed by the Project transitions to the W3C Recommendation Track, the following terms apply: -7.1. If I join the Corresponding Working Group. If I join the Corresponding Working Group, I will be subject to all W3C rules, obligations, licensing commitments, and policies that govern that Corresponding Working Group. -7.2. If I Do Not Join the Corresponding Working Group. -7.2.1. Licensing Obligations to Resulting Specification. If I do not join the Corresponding Working Group, I agree to offer patent licenses according to the W3C Royalty-Free licensing requirements described in Section 5 of the W3C Patent Policy for the portions of the Specification included in the resulting Recommendation. This licensing commitment does not extend to any portion of an implementation of the Recommendation that was not included in the Specification. This licensing commitment may not be revoked but may be modified through the exclusion process defined in Section 4 of the W3C Patent Policy. I am not required to join the Corresponding Working Group to exclude patents from the W3C Royalty-Free licensing commitment, but must otherwise follow the normal exclusion procedures defined by the W3C Patent Policy. The W3C Team will notify me of any Call for Exclusion in the Corresponding Working Group as set forth in Section 4.5 of the W3C Patent Policy. -7.2.2. No Disclosure Obligation. If I do not join the Corresponding Working Group, I have no patent disclosure obligations outside of those set forth in Section 6 of the W3C Patent Policy. -8. Conflict of Interest. I will disclose significant relationships when those relationships might reasonably be perceived as creating a conflict of interest with my role. I will notify W3C of any change in my affiliation using W3C-provided mechanisms. -9. Representations, Warranties and Disclaimers. I represent and warrant that I am legally entitled to grant the rights and promises set forth in this Agreement. IN ALL OTHER RESPECTS THE SPECIFICATION IS PROVIDED �AS IS.� The entire risk as to implementing or otherwise using the Specification is assumed by the implementer and user. Except as stated herein, I expressly disclaim any warranties (express, implied, or otherwise), including implied warranties of merchantability, non-infringement, fitness for a particular purpose, or title, related to the Specification. IN NO EVENT WILL ANY PARTY BE LIABLE TO ANY OTHER PARTY FOR LOST PROFITS OR ANY FORM OF INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER FROM ANY CAUSES OF ACTION OF ANY KIND WITH RESPECT TO THIS AGREEMENT, WHETHER BASED ON BREACH OF CONTRACT, TORT (INCLUDING NEGLIGENCE), OR OTHERWISE, AND WHETHER OR NOT THE OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. All of my obligations under Section 3 regarding the transfer, successors in interest, or assignment of Granted Claims will be satisfied if I notify the transferee or assignee of any patent that I know contains Granted Claims of the obligations under Section 3. Nothing in this Agreement requires me to undertake a patent search. -10. Definitions. -10.1. Agreement. �Agreement� means this W3C Community Final Specification Agreement. -10.2. Corresponding Working Group. �Corresponding Working Group� is a W3C Working Group that is chartered to develop a Recommendation, as defined in the W3C Process Document, that takes the Specification as an input. -10.3. Essential Claims. �Essential Claims� shall mean all claims in any patent or patent application in any jurisdiction in the world that would necessarily be infringed by implementation of the Specification. A claim is necessarily infringed hereunder only when it is not possible to avoid infringing it because there is no non-infringing alternative for implementing the normative portions of the Specification. Existence of a non-infringing alternative shall be judged based on the state of the art at the time of the publication of the Specification. The following are expressly excluded from and shall not be deemed to constitute Essential Claims: -10.3.1. any claims other than as set forth above even if contained in the same patent as Essential Claims; and -10.3.2. claims which would be infringed only by: -portions of an implementation that are not specified in the normative portions of the Specification, or -enabling technologies that may be necessary to make or use any product or portion thereof that complies with the Specification and are not themselves expressly set forth in the Specification (e.g., semiconductor manufacturing technology, compiler technology, object-oriented technology, basic operating system technology, and the like); or -the implementation of technology developed elsewhere and merely incorporated by reference in the body of the Specification. -10.3.3. design patents and design registrations. -For purposes of this definition, the normative portions of the Specification shall be deemed to include only architectural and interoperability requirements. Optional features in the RFC 2119 sense are considered normative unless they are specifically identified as informative. Implementation examples or any other material that merely illustrate the requirements of the Specification are informative, rather than normative. -10.4. I, Me, or My. �I,� �me,� or �my� refers to the signatory. -10.5 Project. �Project� means the W3C Community Group or Business Group for which I executed this Agreement. -10.6. Specification. �Specification� means the Specification identified by the Project as the target of this agreement in a call for Final Specification Commitments. W3C shall provide the authoritative mechanisms for the identification of this Specification. -10.7. W3C Community RF Licensing Requirements. �W3C Community RF Licensing Requirements� license shall mean a non-assignable, non-sublicensable license to make, have made, use, sell, have sold, offer to sell, import, and distribute and dispose of implementations of the Specification that: -10.7.1. shall be available to all, worldwide, whether or not they are W3C Members; -10.7.2. shall extend to all Essential Claims owned or controlled by me; -10.7.3. may be limited to implementations of the Specification, and to what is required by the Specification; -10.7.4. may be conditioned on a grant of a reciprocal RF license (as defined in this policy) to all Essential Claims owned or controlled by the licensee. A reciprocal license may be required to be available to all, and a reciprocal license may itself be conditioned on a further reciprocal license from all. -10.7.5. may not be conditioned on payment of royalties, fees or other consideration; -10.7.6. may be suspended with respect to any licensee when licensor issued by licensee for infringement of claims essential to implement the Specification or any W3C Recommendation; -10.7.7. may not impose any further conditions or restrictions on the use of any technology, intellectual property rights, or other restrictions on behavior of the licensee, but may include reasonable, customary terms relating to operation or maintenance of the license relationship such as the following: choice of law and dispute resolution; -10.7.8. shall not be considered accepted by an implementer who manifests an intent not to accept the terms of the W3C Community RF Licensing Requirements license as offered by the licensor. -10.7.9. The RF license conforming to the requirements in this policy shall be made available by the licensor as long as the Specification is in effect. The term of such license shall be for the life of the patents in question. -I am encouraged to provide a contact from which licensing information can be obtained and other relevant licensing information. Any such information will be made publicly available. -10.8. You or Your. �You,� �you,� or �your� means any person or entity who exercises copyright or patent rights granted under this Agreement, and any person that person or entity controls. - -------------------------------------------------------------------------------------- - -------------------- WebGL ----------------------------- -Copyright (c) 2018 The Khronos Group Inc. - -Permission is hereby granted, free of charge, to any person obtaining a -copy of this software and/or associated documentation files (the -"Materials"), to deal in the Materials without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Materials, and to -permit persons to whom the Materials are 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 Materials. - -THE MATERIALS ARE 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 -MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. ------------------------------------------------------- - -------------- End of ThirdPartyNotices ------------------------------------------- */ - +/*!----------------- TypeScript ThirdPartyNotices ------------------------------------------------------- + +The TypeScript software incorporates third party material from the projects listed below. The original copyright notice and the license under which Microsoft received such third party material are set forth below. Microsoft reserves all other rights not expressly granted, whether by implication, estoppel or otherwise. + +--------------------------------------------- +Third Party Code Components +-------------------------------------------- + +------------------- DefinitelyTyped -------------------- +This file is based on or incorporates material from the projects listed below (collectively "Third Party Code"). Microsoft is not the original author of the Third Party Code. The original copyright notice and the license, under which Microsoft received such Third Party Code, are set forth below. Such licenses and notices are provided for informational purposes only. Microsoft, not the third party, licenses the Third Party Code to you under the terms set forth in the EULA for the Microsoft Product. Microsoft reserves all other rights not expressly granted under this agreement, whether by implication, estoppel or otherwise. +DefinitelyTyped +This project is licensed under the MIT license. Copyrights are respective of each contributor listed at the beginning of each definition file. Provided for Informational Purposes Only + +MIT License +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. +-------------------------------------------------------------------------------------- + +------------------- Unicode -------------------- +UNICODE, INC. LICENSE AGREEMENT - DATA FILES AND SOFTWARE + +Unicode Data Files include all data files under the directories +http://www.unicode.org/Public/, http://www.unicode.org/reports/, +http://www.unicode.org/cldr/data/, http://source.icu-project.org/repos/icu/, and +http://www.unicode.org/utility/trac/browser/. + +Unicode Data Files do not include PDF online code charts under the +directory http://www.unicode.org/Public/. + +Software includes any source code published in the Unicode Standard +or under the directories +http://www.unicode.org/Public/, http://www.unicode.org/reports/, +http://www.unicode.org/cldr/data/, http://source.icu-project.org/repos/icu/, and +http://www.unicode.org/utility/trac/browser/. + +NOTICE TO USER: Carefully read the following legal agreement. +BY DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING UNICODE INC.'S +DATA FILES ("DATA FILES"), AND/OR SOFTWARE ("SOFTWARE"), +YOU UNEQUIVOCALLY ACCEPT, AND AGREE TO BE BOUND BY, ALL OF THE +TERMS AND CONDITIONS OF THIS AGREEMENT. +IF YOU DO NOT AGREE, DO NOT DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE +THE DATA FILES OR SOFTWARE. + +COPYRIGHT AND PERMISSION NOTICE + +Copyright (c) 1991-2017 Unicode, Inc. All rights reserved. +Distributed under the Terms of Use in http://www.unicode.org/copyright.html. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Unicode data files and any associated documentation +(the "Data Files") or Unicode software and any associated documentation +(the "Software") to deal in the Data Files or Software +without restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, and/or sell copies of +the Data Files or Software, and to permit persons to whom the Data Files +or Software are furnished to do so, provided that either +(a) this copyright and permission notice appear with all copies +of the Data Files or Software, or +(b) this copyright and permission notice appear in associated +Documentation. + +THE DATA FILES AND SOFTWARE ARE 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 OF THIRD PARTY RIGHTS. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS +NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL +DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, +DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER +TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THE DATA FILES OR SOFTWARE. + +Except as contained in this notice, the name of a copyright holder +shall not be used in advertising or otherwise to promote the sale, +use or other dealings in these Data Files or Software without prior +written authorization of the copyright holder. +------------------------------------------------------------------------------------- + +-------------------Document Object Model----------------------------- +DOM + +W3C License +This work is being provided by the copyright holders under the following license. +By obtaining and/or copying this work, you (the licensee) agree that you have read, understood, and will comply with the following terms and conditions. +Permission to copy, modify, and distribute this work, with or without modification,�for any purpose and without fee or royalty is hereby granted, provided that you include the following +on ALL copies of the work or portions thereof, including modifications: +* The full text of this NOTICE in a location viewable to users of the redistributed or derivative work. +* Any pre-existing intellectual property disclaimers, notices, or terms and conditions. If none exist, the W3C Software and Document Short Notice should be included. +* Notice of any changes or modifications, through a copyright statement on the new code or document such as "This software or document includes material copied from or derived +from [title and URI of the W3C document]. Copyright � [YEAR] W3C� (MIT, ERCIM, Keio, Beihang)." +Disclaimers +THIS WORK IS PROVIDED "AS IS," AND COPYRIGHT HOLDERS MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY OR +FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE OR DOCUMENT WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS. +COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE SOFTWARE OR DOCUMENT. +The name and trademarks of copyright holders may NOT be used in advertising or publicity pertaining to the work without specific, written prior permission. +Title to copyright in this work will at all times remain with copyright holders. + +--------- + +DOM +Copyright � 2018 WHATWG (Apple, Google, Mozilla, Microsoft). This work is licensed under a Creative Commons Attribution 4.0 International License: Attribution 4.0 International +======================================================================= +Creative Commons Corporation ("Creative Commons") is not a law firm and does not provide legal services or legal advice. Distribution of Creative Commons public licenses does not create a lawyer-client or other relationship. Creative Commons makes its licenses and related information available on an "as-is" basis. Creative Commons gives no warranties regarding its licenses, any material licensed under their terms and conditions, or any related information. Creative Commons disclaims all liability for damages resulting from their use to the fullest extent possible. Using Creative Commons Public Licenses Creative Commons public licenses provide a standard set of terms and conditions that creators and other rights holders may use to share original works of authorship and other material subject to copyright and certain other rights specified in the public license below. The following considerations are for informational purposes only, are not exhaustive, and do not form part of our licenses. Considerations for licensors: Our public licenses are intended for use by those authorized to give the public permission to use material in ways otherwise restricted by copyright and certain other rights. Our licenses are irrevocable. Licensors should read and understand the terms and conditions of the license they choose before applying it. Licensors should also secure all rights necessary before applying our licenses so that the public can reuse the material as expected. Licensors should clearly mark any material not subject to the license. This includes other CC- licensed material, or material used under an exception or limitation to copyright. More considerations for licensors: + +wiki.creativecommons.org/Considerations_for_licensors Considerations for the public: By using one of our public licenses, a licensor grants the public permission to use the licensed material under specified terms and conditions. If the licensor's permission is not necessary for any reason--for example, because of any applicable exception or limitation to copyright--then that use is not regulated by the license. Our licenses grant only permissions under copyright and certain other rights that a licensor has authority to grant. Use of the licensed material may still be restricted for other reasons, including because others have copyright or other rights in the material. A licensor may make special requests, such as asking that all changes be marked or described. Although not required by our licenses, you are encouraged to respect those requests where reasonable. More_considerations for the public: wiki.creativecommons.org/Considerations_for_licensees ======================================================================= +Creative Commons Attribution 4.0 International Public License By exercising the Licensed Rights (defined below), You accept and agree to be bound by the terms and conditions of this Creative Commons Attribution 4.0 International Public License ("Public License"). To the extent this Public License may be interpreted as a contract, You are granted the Licensed Rights in consideration of Your acceptance of these terms and conditions, and the Licensor grants You such rights in consideration of benefits the Licensor receives from making the Licensed Material available under these terms and conditions. Section 1 -- Definitions. a. Adapted Material means material subject to Copyright and Similar Rights that is derived from or based upon the Licensed Material and in which the Licensed Material is translated, altered, arranged, transformed, or otherwise modified in a manner requiring permission under the Copyright and Similar Rights held by the Licensor. For purposes of this Public License, where the Licensed Material is a musical work, performance, or sound recording, Adapted Material is always produced where the Licensed Material is synched in timed relation with a moving image. b. Adapter's License means the license You apply to Your Copyright and Similar Rights in Your contributions to Adapted Material in accordance with the terms and conditions of this Public License. c. Copyright and Similar Rights means copyright and/or similar rights closely related to copyright including, without limitation, performance, broadcast, sound recording, and Sui Generis Database Rights, without regard to how the rights are labeled or categorized. For purposes of this Public License, the rights specified in Section 2(b)(1)-(2) are not Copyright and Similar Rights. d. Effective Technological Measures means those measures that, in the absence of proper authority, may not be circumvented under laws fulfilling obligations under Article 11 of the WIPO Copyright Treaty adopted on December 20, 1996, and/or similar international agreements. e. Exceptions and Limitations means fair use, fair dealing, and/or any other exception or limitation to Copyright and Similar Rights that applies to Your use of the Licensed Material. f. Licensed Material means the artistic or literary work, database, or other material to which the Licensor applied this Public License. g. Licensed Rights means the rights granted to You subject to the terms and conditions of this Public License, which are limited to all Copyright and Similar Rights that apply to Your use of the Licensed Material and that the Licensor has authority to license. h. Licensor means the individual(s) or entity(ies) granting rights under this Public License. i. Share means to provide material to the public by any means or process that requires permission under the Licensed Rights, such as reproduction, public display, public performance, distribution, dissemination, communication, or importation, and to make material available to the public including in ways that members of the public may access the material from a place and at a time individually chosen by them. j. Sui Generis Database Rights means rights other than copyright resulting from Directive 96/9/EC of the European Parliament and of the Council of 11 March 1996 on the legal protection of databases, as amended and/or succeeded, as well as other essentially equivalent rights anywhere in the world. k. You means the individual or entity exercising the Licensed Rights under this Public License. Your has a corresponding meaning. Section 2 -- Scope. a. License grant. 1. Subject to the terms and conditions of this Public License, the Licensor hereby grants You a worldwide, royalty-free, non-sublicensable, non-exclusive, irrevocable license to exercise the Licensed Rights in the Licensed Material to: a. reproduce and Share the Licensed Material, in whole or in part; and b. produce, reproduce, and Share Adapted Material. 2. Exceptions and Limitations. For the avoidance of doubt, where Exceptions and Limitations apply to Your use, this Public License does not apply, and You do not need to comply with its terms and conditions. 3. Term. The term of this Public License is specified in Section 6(a). 4. Media and formats; technical modifications allowed. The Licensor authorizes You to exercise the Licensed Rights in all media and formats whether now known or hereafter created, and to make technical modifications necessary to do so. The Licensor waives and/or agrees not to assert any right or authority to forbid You from making technical modifications necessary to exercise the Licensed Rights, including technical modifications necessary to circumvent Effective Technological Measures. For purposes of this Public License, simply making modifications authorized by this Section 2(a) (4) never produces Adapted Material. 5. Downstream recipients. a. Offer from the Licensor -- Licensed Material. Every recipient of the Licensed Material automatically receives an offer from the Licensor to exercise the Licensed Rights under the terms and conditions of this Public License. b. No downstream restrictions. You may not offer or impose any additional or different terms or conditions on, or apply any Effective Technological Measures to, the Licensed Material if doing so restricts exercise of the Licensed Rights by any recipient of the Licensed Material. 6. No endorsement. Nothing in this Public License constitutes or may be construed as permission to assert or imply that You are, or that Your use of the Licensed Material is, connected with, or sponsored, endorsed, or granted official status by, the Licensor or others designated to receive attribution as provided in Section 3(a)(1)(A)(i). b. Other rights. 1. Moral rights, such as the right of integrity, are not licensed under this Public License, nor are publicity, privacy, and/or other similar personality rights; however, to the extent possible, the Licensor waives and/or agrees not to assert any such rights held by the Licensor to the limited extent necessary to allow You to exercise the Licensed Rights, but not otherwise. 2. Patent and trademark rights are not licensed under this Public License. 3. To the extent possible, the Licensor waives any right to collect royalties from You for the exercise of the Licensed Rights, whether directly or through a collecting society under any voluntary or waivable statutory or compulsory licensing scheme. In all other cases the Licensor expressly reserves any right to collect such royalties. Section 3 -- License Conditions. Your exercise of the Licensed Rights is expressly made subject to the following conditions. a. Attribution. 1. If You Share the Licensed Material (including in modified form), You must: a. retain the following if it is supplied by the Licensor with the Licensed Material: i. identification of the creator(s) of the Licensed Material and any others designated to receive attribution, in any reasonable manner requested by the Licensor (including by pseudonym if designated); ii. a copyright notice; iii. a notice that refers to this Public License; iv. a notice that refers to the disclaimer of warranties; v. a URI or hyperlink to the Licensed Material to the extent reasonably practicable; b. indicate if You modified the Licensed Material and retain an indication of any previous modifications; and c. indicate the Licensed Material is licensed under this Public License, and include the text of, or the URI or hyperlink to, this Public License. 2. You may satisfy the conditions in Section 3(a)(1) in any reasonable manner based on the medium, means, and context in which You Share the Licensed Material. For example, it may be reasonable to satisfy the conditions by providing a URI or hyperlink to a resource that includes the required information. 3. If requested by the Licensor, You must remove any of the information required by Section 3(a)(1)(A) to the extent reasonably practicable. 4. If You Share Adapted Material You produce, the Adapter's License You apply must not prevent recipients of the Adapted Material from complying with this Public License. Section 4 -- Sui Generis Database Rights. Where the Licensed Rights include Sui Generis Database Rights that apply to Your use of the Licensed Material: a. for the avoidance of doubt, Section 2(a)(1) grants You the right to extract, reuse, reproduce, and Share all or a substantial portion of the contents of the database; b. if You include all or a substantial portion of the database contents in a database in which You have Sui Generis Database Rights, then the database in which You have Sui Generis Database Rights (but not its individual contents) is Adapted Material; and c. You must comply with the conditions in Section 3(a) if You Share all or a substantial portion of the contents of the database. For the avoidance of doubt, this Section 4 supplements and does not replace Your obligations under this Public License where the Licensed Rights include other Copyright and Similar Rights. Section 5 -- Disclaimer of Warranties and Limitation of Liability. a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS, IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU. b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION, NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT, INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES, COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR IN PART, THIS LIMITATION MAY NOT APPLY TO YOU. c. The disclaimer of warranties and limitation of liability provided above shall be interpreted in a manner that, to the extent possible, most closely approximates an absolute disclaimer and waiver of all liability. Section 6 -- Term and Termination. a. This Public License applies for the term of the Copyright and Similar Rights licensed here. However, if You fail to comply with this Public License, then Your rights under this Public License terminate automatically. b. Where Your right to use the Licensed Material has terminated under Section 6(a), it reinstates: 1. automatically as of the date the violation is cured, provided it is cured within 30 days of Your discovery of the violation; or 2. upon express reinstatement by the Licensor. For the avoidance of doubt, this Section 6(b) does not affect any right the Licensor may have to seek remedies for Your violations of this Public License. c. For the avoidance of doubt, the Licensor may also offer the Licensed Material under separate terms or conditions or stop distributing the Licensed Material at any time; however, doing so will not terminate this Public License. d. Sections 1, 5, 6, 7, and 8 survive termination of this Public License. Section 7 -- Other Terms and Conditions. a. The Licensor shall not be bound by any additional or different terms or conditions communicated by You unless expressly agreed. b. Any arrangements, understandings, or agreements regarding the Licensed Material not stated herein are separate from and independent of the terms and conditions of this Public License. Section 8 -- Interpretation. a. For the avoidance of doubt, this Public License does not, and shall not be interpreted to, reduce, limit, restrict, or impose conditions on any use of the Licensed Material that could lawfully be made without permission under this Public License. b. To the extent possible, if any provision of this Public License is deemed unenforceable, it shall be automatically reformed to the minimum extent necessary to make it enforceable. If the provision cannot be reformed, it shall be severed from this Public License without affecting the enforceability of the remaining terms and conditions. c. No term or condition of this Public License will be waived and no failure to comply consented to unless expressly agreed to by the Licensor. d. Nothing in this Public License constitutes or may be interpreted as a limitation upon, or waiver of, any privileges and immunities that apply to the Licensor or You, including from the legal processes of any jurisdiction or authority. ======================================================================= Creative Commons is not a party to its public licenses. Notwithstanding, Creative Commons may elect to apply one of its public licenses to material it publishes and in those instances will be considered the "Licensor." Except for the limited purpose of indicating that material is shared under a Creative Commons public license or as otherwise permitted by the Creative Commons policies published at creativecommons.org/policies, Creative Commons does not authorize the use of the trademark "Creative Commons" or any other trademark or logo of Creative Commons without its prior written consent including, without limitation, in connection with any unauthorized modifications to any of its public licenses or any other arrangements, understandings, or agreements concerning use of licensed material. For the avoidance of doubt, this paragraph does not form part of the public licenses. Creative Commons may be contacted at creativecommons.org. + +-------------------------------------------------------------------------------- + +----------------------Web Background Synchronization------------------------------ + +Web Background Synchronization Specification +Portions of spec � by W3C + +W3C Community Final Specification Agreement +To secure commitments from participants for the full text of a Community or Business Group Report, the group may call for voluntary commitments to the following terms; a "summary" is +available. See also the related "W3C Community Contributor License Agreement". +1. The Purpose of this Agreement. +This Agreement sets forth the terms under which I make certain copyright and patent rights available to you for your implementation of the Specification. +Any other capitalized terms not specifically defined herein have the same meaning as those terms have in the "W3C Patent Policy", and if not defined there, in the "W3C Process Document". +2. Copyrights. +2.1. Copyright Grant. I grant to you a perpetual (for the duration of the applicable copyright), worldwide, non-exclusive, no-charge, royalty-free, copyright license, without any obligation for accounting to me, to reproduce, prepare derivative works of, publicly display, publicly perform, sublicense, distribute, and implement the Specification to the full extent of my copyright interest in the Specification. +2.2. Attribution. As a condition of the copyright grant, you must include an attribution to the Specification in any derivative work you make based on the Specification. That attribution must include, at minimum, the Specification name and version number. +3. Patents. +3.1. Patent Licensing Commitment. I agree to license my Essential Claims under the W3C Community RF Licensing Requirements. This requirement includes Essential Claims that I own and any that I have the right to license without obligation of payment or other consideration to an unrelated third party. W3C Community RF Licensing Requirements obligations made concerning the Specification and described in this policy are binding on me for the life of the patents in question and encumber the patents containing Essential Claims, regardless of changes in participation status or W3C Membership. I also agree to license my Essential Claims under the W3C Community RF Licensing Requirements in derivative works of the Specification so long as all normative portions of the Specification are maintained and that this licensing commitment does not extend to any portion of the derivative work that was not included in the Specification. +3.2. Optional, Additional Patent Grant. In addition to the provisions of Section 3.1, I may also, at my option, make certain intellectual property rights infringed by implementations of the Specification, including Essential Claims, available by providing those terms via the W3C Web site. +4. No Other Rights. Except as specifically set forth in this Agreement, no other express or implied patent, trademark, copyright, or other property rights are granted under this Agreement, including by implication, waiver, or estoppel. +5. Antitrust Compliance. I acknowledge that I may compete with other participants, that I am under no obligation to implement the Specification, that each participant is free to develop competing technologies and standards, and that each party is free to license its patent rights to third parties, including for the purpose of enabling competing technologies and standards. +6. Non-Circumvention. I agree that I will not intentionally take or willfully assist any third party to take any action for the purpose of circumventing my obligations under this Agreement. +7. Transition to W3C Recommendation Track. The Specification developed by the Project may transition to the W3C Recommendation Track. The W3C Team is responsible for notifying me that a Corresponding Working Group has been chartered. I have no obligation to join the Corresponding Working Group. If the Specification developed by the Project transitions to the W3C Recommendation Track, the following terms apply: +7.1. If I join the Corresponding Working Group. If I join the Corresponding Working Group, I will be subject to all W3C rules, obligations, licensing commitments, and policies that govern that Corresponding Working Group. +7.2. If I Do Not Join the Corresponding Working Group. +7.2.1. Licensing Obligations to Resulting Specification. If I do not join the Corresponding Working Group, I agree to offer patent licenses according to the W3C Royalty-Free licensing requirements described in Section 5 of the W3C Patent Policy for the portions of the Specification included in the resulting Recommendation. This licensing commitment does not extend to any portion of an implementation of the Recommendation that was not included in the Specification. This licensing commitment may not be revoked but may be modified through the exclusion process defined in Section 4 of the W3C Patent Policy. I am not required to join the Corresponding Working Group to exclude patents from the W3C Royalty-Free licensing commitment, but must otherwise follow the normal exclusion procedures defined by the W3C Patent Policy. The W3C Team will notify me of any Call for Exclusion in the Corresponding Working Group as set forth in Section 4.5 of the W3C Patent Policy. +7.2.2. No Disclosure Obligation. If I do not join the Corresponding Working Group, I have no patent disclosure obligations outside of those set forth in Section 6 of the W3C Patent Policy. +8. Conflict of Interest. I will disclose significant relationships when those relationships might reasonably be perceived as creating a conflict of interest with my role. I will notify W3C of any change in my affiliation using W3C-provided mechanisms. +9. Representations, Warranties and Disclaimers. I represent and warrant that I am legally entitled to grant the rights and promises set forth in this Agreement. IN ALL OTHER RESPECTS THE SPECIFICATION IS PROVIDED �AS IS.� The entire risk as to implementing or otherwise using the Specification is assumed by the implementer and user. Except as stated herein, I expressly disclaim any warranties (express, implied, or otherwise), including implied warranties of merchantability, non-infringement, fitness for a particular purpose, or title, related to the Specification. IN NO EVENT WILL ANY PARTY BE LIABLE TO ANY OTHER PARTY FOR LOST PROFITS OR ANY FORM OF INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER FROM ANY CAUSES OF ACTION OF ANY KIND WITH RESPECT TO THIS AGREEMENT, WHETHER BASED ON BREACH OF CONTRACT, TORT (INCLUDING NEGLIGENCE), OR OTHERWISE, AND WHETHER OR NOT THE OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. All of my obligations under Section 3 regarding the transfer, successors in interest, or assignment of Granted Claims will be satisfied if I notify the transferee or assignee of any patent that I know contains Granted Claims of the obligations under Section 3. Nothing in this Agreement requires me to undertake a patent search. +10. Definitions. +10.1. Agreement. �Agreement� means this W3C Community Final Specification Agreement. +10.2. Corresponding Working Group. �Corresponding Working Group� is a W3C Working Group that is chartered to develop a Recommendation, as defined in the W3C Process Document, that takes the Specification as an input. +10.3. Essential Claims. �Essential Claims� shall mean all claims in any patent or patent application in any jurisdiction in the world that would necessarily be infringed by implementation of the Specification. A claim is necessarily infringed hereunder only when it is not possible to avoid infringing it because there is no non-infringing alternative for implementing the normative portions of the Specification. Existence of a non-infringing alternative shall be judged based on the state of the art at the time of the publication of the Specification. The following are expressly excluded from and shall not be deemed to constitute Essential Claims: +10.3.1. any claims other than as set forth above even if contained in the same patent as Essential Claims; and +10.3.2. claims which would be infringed only by: +portions of an implementation that are not specified in the normative portions of the Specification, or +enabling technologies that may be necessary to make or use any product or portion thereof that complies with the Specification and are not themselves expressly set forth in the Specification (e.g., semiconductor manufacturing technology, compiler technology, object-oriented technology, basic operating system technology, and the like); or +the implementation of technology developed elsewhere and merely incorporated by reference in the body of the Specification. +10.3.3. design patents and design registrations. +For purposes of this definition, the normative portions of the Specification shall be deemed to include only architectural and interoperability requirements. Optional features in the RFC 2119 sense are considered normative unless they are specifically identified as informative. Implementation examples or any other material that merely illustrate the requirements of the Specification are informative, rather than normative. +10.4. I, Me, or My. �I,� �me,� or �my� refers to the signatory. +10.5 Project. �Project� means the W3C Community Group or Business Group for which I executed this Agreement. +10.6. Specification. �Specification� means the Specification identified by the Project as the target of this agreement in a call for Final Specification Commitments. W3C shall provide the authoritative mechanisms for the identification of this Specification. +10.7. W3C Community RF Licensing Requirements. �W3C Community RF Licensing Requirements� license shall mean a non-assignable, non-sublicensable license to make, have made, use, sell, have sold, offer to sell, import, and distribute and dispose of implementations of the Specification that: +10.7.1. shall be available to all, worldwide, whether or not they are W3C Members; +10.7.2. shall extend to all Essential Claims owned or controlled by me; +10.7.3. may be limited to implementations of the Specification, and to what is required by the Specification; +10.7.4. may be conditioned on a grant of a reciprocal RF license (as defined in this policy) to all Essential Claims owned or controlled by the licensee. A reciprocal license may be required to be available to all, and a reciprocal license may itself be conditioned on a further reciprocal license from all. +10.7.5. may not be conditioned on payment of royalties, fees or other consideration; +10.7.6. may be suspended with respect to any licensee when licensor issued by licensee for infringement of claims essential to implement the Specification or any W3C Recommendation; +10.7.7. may not impose any further conditions or restrictions on the use of any technology, intellectual property rights, or other restrictions on behavior of the licensee, but may include reasonable, customary terms relating to operation or maintenance of the license relationship such as the following: choice of law and dispute resolution; +10.7.8. shall not be considered accepted by an implementer who manifests an intent not to accept the terms of the W3C Community RF Licensing Requirements license as offered by the licensor. +10.7.9. The RF license conforming to the requirements in this policy shall be made available by the licensor as long as the Specification is in effect. The term of such license shall be for the life of the patents in question. +I am encouraged to provide a contact from which licensing information can be obtained and other relevant licensing information. Any such information will be made publicly available. +10.8. You or Your. �You,� �you,� or �your� means any person or entity who exercises copyright or patent rights granted under this Agreement, and any person that person or entity controls. + +------------------------------------------------------------------------------------- + +------------------- WebGL ----------------------------- +Copyright (c) 2018 The Khronos Group Inc. + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and/or associated documentation files (the +"Materials"), to deal in the Materials without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Materials, and to +permit persons to whom the Materials are 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 Materials. + +THE MATERIALS ARE 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 +MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. +------------------------------------------------------ + +------------- End of ThirdPartyNotices ------------------------------------------- */ + diff --git a/node_modules/typescript/bin/tsc b/node_modules/typescript/bin/tsc old mode 100644 new mode 100755 diff --git a/node_modules/typescript/bin/tsserver b/node_modules/typescript/bin/tsserver old mode 100644 new mode 100755 diff --git a/node_modules/typescript/lib/lib.d.ts b/node_modules/typescript/lib/lib.d.ts index 38a1cc017..6b79c0ad0 100644 --- a/node_modules/typescript/lib/lib.d.ts +++ b/node_modules/typescript/lib/lib.d.ts @@ -15,10 +15,10 @@ and limitations under the License. -/// +/// -/// -/// -/// -/// +/// +/// +/// +/// diff --git a/node_modules/typescript/lib/lib.dom.d.ts b/node_modules/typescript/lib/lib.dom.d.ts index 4217884bc..124a08590 100644 --- a/node_modules/typescript/lib/lib.dom.d.ts +++ b/node_modules/typescript/lib/lib.dom.d.ts @@ -15,7 +15,7 @@ and limitations under the License. -/// +/// ///////////////////////////// diff --git a/node_modules/typescript/lib/lib.dom.iterable.d.ts b/node_modules/typescript/lib/lib.dom.iterable.d.ts index e5db9c136..bbda4ba2d 100644 --- a/node_modules/typescript/lib/lib.dom.iterable.d.ts +++ b/node_modules/typescript/lib/lib.dom.iterable.d.ts @@ -15,7 +15,7 @@ and limitations under the License. -/// +/// ///////////////////////////// diff --git a/node_modules/typescript/lib/lib.es2015.collection.d.ts b/node_modules/typescript/lib/lib.es2015.collection.d.ts index dc93004c0..d1f1f6213 100644 --- a/node_modules/typescript/lib/lib.es2015.collection.d.ts +++ b/node_modules/typescript/lib/lib.es2015.collection.d.ts @@ -15,75 +15,75 @@ and limitations under the License. -/// +/// -interface Map { - clear(): void; - delete(key: K): boolean; - forEach(callbackfn: (value: V, key: K, map: Map) => void, thisArg?: any): void; - get(key: K): V | undefined; - has(key: K): boolean; - set(key: K, value: V): this; - readonly size: number; -} - -interface MapConstructor { - new(): Map; - new(entries?: readonly (readonly [K, V])[] | null): Map; - readonly prototype: Map; -} -declare var Map: MapConstructor; - -interface ReadonlyMap { - forEach(callbackfn: (value: V, key: K, map: ReadonlyMap) => void, thisArg?: any): void; - get(key: K): V | undefined; - has(key: K): boolean; - readonly size: number; -} - -interface WeakMap { - delete(key: K): boolean; - get(key: K): V | undefined; - has(key: K): boolean; - set(key: K, value: V): this; -} - -interface WeakMapConstructor { - new (entries?: readonly [K, V][] | null): WeakMap; - readonly prototype: WeakMap; -} -declare var WeakMap: WeakMapConstructor; - -interface Set { - add(value: T): this; - clear(): void; - delete(value: T): boolean; - forEach(callbackfn: (value: T, value2: T, set: Set) => void, thisArg?: any): void; - has(value: T): boolean; - readonly size: number; -} - -interface SetConstructor { - new (values?: readonly T[] | null): Set; - readonly prototype: Set; -} -declare var Set: SetConstructor; - -interface ReadonlySet { - forEach(callbackfn: (value: T, value2: T, set: ReadonlySet) => void, thisArg?: any): void; - has(value: T): boolean; - readonly size: number; -} - -interface WeakSet { - add(value: T): this; - delete(value: T): boolean; - has(value: T): boolean; -} - -interface WeakSetConstructor { - new (values?: readonly T[] | null): WeakSet; - readonly prototype: WeakSet; -} -declare var WeakSet: WeakSetConstructor; +interface Map { + clear(): void; + delete(key: K): boolean; + forEach(callbackfn: (value: V, key: K, map: Map) => void, thisArg?: any): void; + get(key: K): V | undefined; + has(key: K): boolean; + set(key: K, value: V): this; + readonly size: number; +} + +interface MapConstructor { + new(): Map; + new(entries?: readonly (readonly [K, V])[] | null): Map; + readonly prototype: Map; +} +declare var Map: MapConstructor; + +interface ReadonlyMap { + forEach(callbackfn: (value: V, key: K, map: ReadonlyMap) => void, thisArg?: any): void; + get(key: K): V | undefined; + has(key: K): boolean; + readonly size: number; +} + +interface WeakMap { + delete(key: K): boolean; + get(key: K): V | undefined; + has(key: K): boolean; + set(key: K, value: V): this; +} + +interface WeakMapConstructor { + new (entries?: readonly [K, V][] | null): WeakMap; + readonly prototype: WeakMap; +} +declare var WeakMap: WeakMapConstructor; + +interface Set { + add(value: T): this; + clear(): void; + delete(value: T): boolean; + forEach(callbackfn: (value: T, value2: T, set: Set) => void, thisArg?: any): void; + has(value: T): boolean; + readonly size: number; +} + +interface SetConstructor { + new (values?: readonly T[] | null): Set; + readonly prototype: Set; +} +declare var Set: SetConstructor; + +interface ReadonlySet { + forEach(callbackfn: (value: T, value2: T, set: ReadonlySet) => void, thisArg?: any): void; + has(value: T): boolean; + readonly size: number; +} + +interface WeakSet { + add(value: T): this; + delete(value: T): boolean; + has(value: T): boolean; +} + +interface WeakSetConstructor { + new (values?: readonly T[] | null): WeakSet; + readonly prototype: WeakSet; +} +declare var WeakSet: WeakSetConstructor; diff --git a/node_modules/typescript/lib/lib.es2015.core.d.ts b/node_modules/typescript/lib/lib.es2015.core.d.ts index e0c83ad46..913db853f 100644 --- a/node_modules/typescript/lib/lib.es2015.core.d.ts +++ b/node_modules/typescript/lib/lib.es2015.core.d.ts @@ -15,503 +15,503 @@ and limitations under the License. -/// - - -interface Array { - /** - * Returns the value of the first element in the array where predicate is true, and undefined - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, find - * immediately returns that element value. Otherwise, find returns undefined. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - find(predicate: (this: void, value: T, index: number, obj: T[]) => value is S, thisArg?: any): S | undefined; - find(predicate: (value: T, index: number, obj: T[]) => unknown, thisArg?: any): T | undefined; - - /** - * Returns the index of the first element in the array where predicate is true, and -1 - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, - * findIndex immediately returns that element index. Otherwise, findIndex returns -1. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - findIndex(predicate: (value: T, index: number, obj: T[]) => unknown, thisArg?: any): number; - - /** - * Returns the this object after filling the section identified by start and end with value - * @param value value to fill array section with - * @param start index to start filling the array at. If start is negative, it is treated as - * length+start where length is the length of the array. - * @param end index to stop filling the array at. If end is negative, it is treated as - * length+end. - */ - fill(value: T, start?: number, end?: number): this; - - /** - * Returns the this object after copying a section of the array identified by start and end - * to the same array starting at position target - * @param target If target is negative, it is treated as length+target where length is the - * length of the array. - * @param start If start is negative, it is treated as length+start. If end is negative, it - * is treated as length+end. - * @param end If not specified, length of the this object is used as its default value. - */ - copyWithin(target: number, start: number, end?: number): this; -} - -interface ArrayConstructor { - /** - * Creates an array from an array-like object. - * @param arrayLike An array-like object to convert to an array. - */ - from(arrayLike: ArrayLike): T[]; - - /** - * Creates an array from an iterable object. - * @param arrayLike An array-like object to convert to an array. - * @param mapfn A mapping function to call on every element of the array. - * @param thisArg Value of 'this' used to invoke the mapfn. - */ - from(arrayLike: ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; - - /** - * Returns a new array from a set of elements. - * @param items A set of elements to include in the new array object. - */ - of(...items: T[]): T[]; -} - -interface DateConstructor { - new (value: number | string | Date): Date; -} - -interface Function { - /** - * Returns the name of the function. Function names are read-only and can not be changed. - */ - readonly name: string; -} - -interface Math { - /** - * Returns the number of leading zero bits in the 32-bit binary representation of a number. - * @param x A numeric expression. - */ - clz32(x: number): number; - - /** - * Returns the result of 32-bit multiplication of two numbers. - * @param x First number - * @param y Second number - */ - imul(x: number, y: number): number; - - /** - * Returns the sign of the x, indicating whether x is positive, negative or zero. - * @param x The numeric expression to test - */ - sign(x: number): number; - - /** - * Returns the base 10 logarithm of a number. - * @param x A numeric expression. - */ - log10(x: number): number; - - /** - * Returns the base 2 logarithm of a number. - * @param x A numeric expression. - */ - log2(x: number): number; - - /** - * Returns the natural logarithm of 1 + x. - * @param x A numeric expression. - */ - log1p(x: number): number; - - /** - * Returns the result of (e^x - 1), which is an implementation-dependent approximation to - * subtracting 1 from the exponential function of x (e raised to the power of x, where e - * is the base of the natural logarithms). - * @param x A numeric expression. - */ - expm1(x: number): number; - - /** - * Returns the hyperbolic cosine of a number. - * @param x A numeric expression that contains an angle measured in radians. - */ - cosh(x: number): number; - - /** - * Returns the hyperbolic sine of a number. - * @param x A numeric expression that contains an angle measured in radians. - */ - sinh(x: number): number; - - /** - * Returns the hyperbolic tangent of a number. - * @param x A numeric expression that contains an angle measured in radians. - */ - tanh(x: number): number; - - /** - * Returns the inverse hyperbolic cosine of a number. - * @param x A numeric expression that contains an angle measured in radians. - */ - acosh(x: number): number; - - /** - * Returns the inverse hyperbolic sine of a number. - * @param x A numeric expression that contains an angle measured in radians. - */ - asinh(x: number): number; - - /** - * Returns the inverse hyperbolic tangent of a number. - * @param x A numeric expression that contains an angle measured in radians. - */ - atanh(x: number): number; - - /** - * Returns the square root of the sum of squares of its arguments. - * @param values Values to compute the square root for. - * If no arguments are passed, the result is +0. - * If there is only one argument, the result is the absolute value. - * If any argument is +Infinity or -Infinity, the result is +Infinity. - * If any argument is NaN, the result is NaN. - * If all arguments are either +0 or −0, the result is +0. - */ - hypot(...values: number[]): number; - - /** - * Returns the integral part of the a numeric expression, x, removing any fractional digits. - * If x is already an integer, the result is x. - * @param x A numeric expression. - */ - trunc(x: number): number; - - /** - * Returns the nearest single precision float representation of a number. - * @param x A numeric expression. - */ - fround(x: number): number; - - /** - * Returns an implementation-dependent approximation to the cube root of number. - * @param x A numeric expression. - */ - cbrt(x: number): number; -} - -interface NumberConstructor { - /** - * The value of Number.EPSILON is the difference between 1 and the smallest value greater than 1 - * that is representable as a Number value, which is approximately: - * 2.2204460492503130808472633361816 x 10‍−‍16. - */ - readonly EPSILON: number; - - /** - * Returns true if passed value is finite. - * Unlike the global isFinite, Number.isFinite doesn't forcibly convert the parameter to a - * number. Only finite values of the type number, result in true. - * @param number A numeric value. - */ - isFinite(number: number): boolean; - - /** - * Returns true if the value passed is an integer, false otherwise. - * @param number A numeric value. - */ - isInteger(number: number): boolean; - - /** - * Returns a Boolean value that indicates whether a value is the reserved value NaN (not a - * number). Unlike the global isNaN(), Number.isNaN() doesn't forcefully convert the parameter - * to a number. Only values of the type number, that are also NaN, result in true. - * @param number A numeric value. - */ - isNaN(number: number): boolean; - - /** - * Returns true if the value passed is a safe integer. - * @param number A numeric value. - */ - isSafeInteger(number: number): boolean; - - /** - * The value of the largest integer n such that n and n + 1 are both exactly representable as - * a Number value. - * The value of Number.MAX_SAFE_INTEGER is 9007199254740991 2^53 − 1. - */ - readonly MAX_SAFE_INTEGER: number; - - /** - * The value of the smallest integer n such that n and n − 1 are both exactly representable as - * a Number value. - * The value of Number.MIN_SAFE_INTEGER is −9007199254740991 (−(2^53 − 1)). - */ - readonly MIN_SAFE_INTEGER: number; - - /** - * Converts a string to a floating-point number. - * @param string A string that contains a floating-point number. - */ - parseFloat(string: string): number; - - /** - * Converts A string to an integer. - * @param s A string to convert into a number. - * @param radix A value between 2 and 36 that specifies the base of the number in numString. - * If this argument is not supplied, strings with a prefix of '0x' are considered hexadecimal. - * All other strings are considered decimal. - */ - parseInt(string: string, radix?: number): number; -} - -interface ObjectConstructor { - /** - * Copy the values of all of the enumerable own properties from one or more source objects to a - * target object. Returns the target object. - * @param target The target object to copy to. - * @param source The source object from which to copy properties. - */ - assign(target: T, source: U): T & U; - - /** - * Copy the values of all of the enumerable own properties from one or more source objects to a - * target object. Returns the target object. - * @param target The target object to copy to. - * @param source1 The first source object from which to copy properties. - * @param source2 The second source object from which to copy properties. - */ - assign(target: T, source1: U, source2: V): T & U & V; - - /** - * Copy the values of all of the enumerable own properties from one or more source objects to a - * target object. Returns the target object. - * @param target The target object to copy to. - * @param source1 The first source object from which to copy properties. - * @param source2 The second source object from which to copy properties. - * @param source3 The third source object from which to copy properties. - */ - assign(target: T, source1: U, source2: V, source3: W): T & U & V & W; - - /** - * Copy the values of all of the enumerable own properties from one or more source objects to a - * target object. Returns the target object. - * @param target The target object to copy to. - * @param sources One or more source objects from which to copy properties - */ - assign(target: object, ...sources: any[]): any; - - /** - * Returns an array of all symbol properties found directly on object o. - * @param o Object to retrieve the symbols from. - */ - getOwnPropertySymbols(o: any): symbol[]; - - /** - * Returns the names of the enumerable string properties and methods of an object. - * @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object. - */ - keys(o: {}): string[]; - - /** - * Returns true if the values are the same value, false otherwise. - * @param value1 The first value. - * @param value2 The second value. - */ - is(value1: any, value2: any): boolean; - - /** - * Sets the prototype of a specified object o to object proto or null. Returns the object o. - * @param o The object to change its prototype. - * @param proto The value of the new prototype or null. - */ - setPrototypeOf(o: any, proto: object | null): any; -} - -interface ReadonlyArray { - /** - * Returns the value of the first element in the array where predicate is true, and undefined - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, find - * immediately returns that element value. Otherwise, find returns undefined. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - find(predicate: (this: void, value: T, index: number, obj: readonly T[]) => value is S, thisArg?: any): S | undefined; - find(predicate: (value: T, index: number, obj: readonly T[]) => unknown, thisArg?: any): T | undefined; - - /** - * Returns the index of the first element in the array where predicate is true, and -1 - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, - * findIndex immediately returns that element index. Otherwise, findIndex returns -1. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - findIndex(predicate: (value: T, index: number, obj: readonly T[]) => unknown, thisArg?: any): number; -} - -interface RegExp { - /** - * Returns a string indicating the flags of the regular expression in question. This field is read-only. - * The characters in this string are sequenced and concatenated in the following order: - * - * - "g" for global - * - "i" for ignoreCase - * - "m" for multiline - * - "u" for unicode - * - "y" for sticky - * - * If no flags are set, the value is the empty string. - */ - readonly flags: string; - - /** - * Returns a Boolean value indicating the state of the sticky flag (y) used with a regular - * expression. Default is false. Read-only. - */ - readonly sticky: boolean; - - /** - * Returns a Boolean value indicating the state of the Unicode flag (u) used with a regular - * expression. Default is false. Read-only. - */ - readonly unicode: boolean; -} - -interface RegExpConstructor { - new (pattern: RegExp | string, flags?: string): RegExp; - (pattern: RegExp | string, flags?: string): RegExp; -} - -interface String { - /** - * Returns a nonnegative integer Number less than 1114112 (0x110000) that is the code point - * value of the UTF-16 encoded code point starting at the string element at position pos in - * the String resulting from converting this object to a String. - * If there is no element at that position, the result is undefined. - * If a valid UTF-16 surrogate pair does not begin at pos, the result is the code unit at pos. - */ - codePointAt(pos: number): number | undefined; - - /** - * Returns true if searchString appears as a substring of the result of converting this - * object to a String, at one or more positions that are - * greater than or equal to position; otherwise, returns false. - * @param searchString search string - * @param position If position is undefined, 0 is assumed, so as to search all of the String. - */ - includes(searchString: string, position?: number): boolean; - - /** - * Returns true if the sequence of elements of searchString converted to a String is the - * same as the corresponding elements of this object (converted to a String) starting at - * endPosition – length(this). Otherwise returns false. - */ - endsWith(searchString: string, endPosition?: number): boolean; - - /** - * Returns the String value result of normalizing the string into the normalization form - * named by form as specified in Unicode Standard Annex #15, Unicode Normalization Forms. - * @param form Applicable values: "NFC", "NFD", "NFKC", or "NFKD", If not specified default - * is "NFC" - */ - normalize(form: "NFC" | "NFD" | "NFKC" | "NFKD"): string; - - /** - * Returns the String value result of normalizing the string into the normalization form - * named by form as specified in Unicode Standard Annex #15, Unicode Normalization Forms. - * @param form Applicable values: "NFC", "NFD", "NFKC", or "NFKD", If not specified default - * is "NFC" - */ - normalize(form?: string): string; - - /** - * Returns a String value that is made from count copies appended together. If count is 0, - * the empty string is returned. - * @param count number of copies to append - */ - repeat(count: number): string; - - /** - * Returns true if the sequence of elements of searchString converted to a String is the - * same as the corresponding elements of this object (converted to a String) starting at - * position. Otherwise returns false. - */ - startsWith(searchString: string, position?: number): boolean; - - /** - * Returns an HTML anchor element and sets the name attribute to the text value - * @param name - */ - anchor(name: string): string; - - /** Returns a HTML element */ - big(): string; - - /** Returns a HTML element */ - blink(): string; - - /** Returns a HTML element */ - bold(): string; - - /** Returns a HTML element */ - fixed(): string; - - /** Returns a HTML element and sets the color attribute value */ - fontcolor(color: string): string; - - /** Returns a HTML element and sets the size attribute value */ - fontsize(size: number): string; - - /** Returns a HTML element and sets the size attribute value */ - fontsize(size: string): string; - - /** Returns an HTML element */ - italics(): string; - - /** Returns an HTML element and sets the href attribute value */ - link(url: string): string; - - /** Returns a HTML element */ - small(): string; - - /** Returns a HTML element */ - strike(): string; - - /** Returns a HTML element */ - sub(): string; - - /** Returns a HTML element */ - sup(): string; -} - -interface StringConstructor { - /** - * Return the String value whose elements are, in order, the elements in the List elements. - * If length is 0, the empty string is returned. - */ - fromCodePoint(...codePoints: number[]): string; - - /** - * String.raw is intended for use as a tag function of a Tagged Template String. When called - * as such the first argument will be a well formed template call site object and the rest - * parameter will contain the substitution values. - * @param template A well-formed template string call site representation. - * @param substitutions A set of substitution values. - */ - raw(template: TemplateStringsArray, ...substitutions: any[]): string; -} +/// + + +interface Array { + /** + * Returns the value of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + find(predicate: (this: void, value: T, index: number, obj: T[]) => value is S, thisArg?: any): S | undefined; + find(predicate: (value: T, index: number, obj: T[]) => unknown, thisArg?: any): T | undefined; + + /** + * Returns the index of the first element in the array where predicate is true, and -1 + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, + * findIndex immediately returns that element index. Otherwise, findIndex returns -1. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + findIndex(predicate: (value: T, index: number, obj: T[]) => unknown, thisArg?: any): number; + + /** + * Returns the this object after filling the section identified by start and end with value + * @param value value to fill array section with + * @param start index to start filling the array at. If start is negative, it is treated as + * length+start where length is the length of the array. + * @param end index to stop filling the array at. If end is negative, it is treated as + * length+end. + */ + fill(value: T, start?: number, end?: number): this; + + /** + * Returns the this object after copying a section of the array identified by start and end + * to the same array starting at position target + * @param target If target is negative, it is treated as length+target where length is the + * length of the array. + * @param start If start is negative, it is treated as length+start. If end is negative, it + * is treated as length+end. + * @param end If not specified, length of the this object is used as its default value. + */ + copyWithin(target: number, start: number, end?: number): this; +} + +interface ArrayConstructor { + /** + * Creates an array from an array-like object. + * @param arrayLike An array-like object to convert to an array. + */ + from(arrayLike: ArrayLike): T[]; + + /** + * Creates an array from an iterable object. + * @param arrayLike An array-like object to convert to an array. + * @param mapfn A mapping function to call on every element of the array. + * @param thisArg Value of 'this' used to invoke the mapfn. + */ + from(arrayLike: ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; + + /** + * Returns a new array from a set of elements. + * @param items A set of elements to include in the new array object. + */ + of(...items: T[]): T[]; +} + +interface DateConstructor { + new (value: number | string | Date): Date; +} + +interface Function { + /** + * Returns the name of the function. Function names are read-only and can not be changed. + */ + readonly name: string; +} + +interface Math { + /** + * Returns the number of leading zero bits in the 32-bit binary representation of a number. + * @param x A numeric expression. + */ + clz32(x: number): number; + + /** + * Returns the result of 32-bit multiplication of two numbers. + * @param x First number + * @param y Second number + */ + imul(x: number, y: number): number; + + /** + * Returns the sign of the x, indicating whether x is positive, negative or zero. + * @param x The numeric expression to test + */ + sign(x: number): number; + + /** + * Returns the base 10 logarithm of a number. + * @param x A numeric expression. + */ + log10(x: number): number; + + /** + * Returns the base 2 logarithm of a number. + * @param x A numeric expression. + */ + log2(x: number): number; + + /** + * Returns the natural logarithm of 1 + x. + * @param x A numeric expression. + */ + log1p(x: number): number; + + /** + * Returns the result of (e^x - 1), which is an implementation-dependent approximation to + * subtracting 1 from the exponential function of x (e raised to the power of x, where e + * is the base of the natural logarithms). + * @param x A numeric expression. + */ + expm1(x: number): number; + + /** + * Returns the hyperbolic cosine of a number. + * @param x A numeric expression that contains an angle measured in radians. + */ + cosh(x: number): number; + + /** + * Returns the hyperbolic sine of a number. + * @param x A numeric expression that contains an angle measured in radians. + */ + sinh(x: number): number; + + /** + * Returns the hyperbolic tangent of a number. + * @param x A numeric expression that contains an angle measured in radians. + */ + tanh(x: number): number; + + /** + * Returns the inverse hyperbolic cosine of a number. + * @param x A numeric expression that contains an angle measured in radians. + */ + acosh(x: number): number; + + /** + * Returns the inverse hyperbolic sine of a number. + * @param x A numeric expression that contains an angle measured in radians. + */ + asinh(x: number): number; + + /** + * Returns the inverse hyperbolic tangent of a number. + * @param x A numeric expression that contains an angle measured in radians. + */ + atanh(x: number): number; + + /** + * Returns the square root of the sum of squares of its arguments. + * @param values Values to compute the square root for. + * If no arguments are passed, the result is +0. + * If there is only one argument, the result is the absolute value. + * If any argument is +Infinity or -Infinity, the result is +Infinity. + * If any argument is NaN, the result is NaN. + * If all arguments are either +0 or −0, the result is +0. + */ + hypot(...values: number[]): number; + + /** + * Returns the integral part of the a numeric expression, x, removing any fractional digits. + * If x is already an integer, the result is x. + * @param x A numeric expression. + */ + trunc(x: number): number; + + /** + * Returns the nearest single precision float representation of a number. + * @param x A numeric expression. + */ + fround(x: number): number; + + /** + * Returns an implementation-dependent approximation to the cube root of number. + * @param x A numeric expression. + */ + cbrt(x: number): number; +} + +interface NumberConstructor { + /** + * The value of Number.EPSILON is the difference between 1 and the smallest value greater than 1 + * that is representable as a Number value, which is approximately: + * 2.2204460492503130808472633361816 x 10‍−‍16. + */ + readonly EPSILON: number; + + /** + * Returns true if passed value is finite. + * Unlike the global isFinite, Number.isFinite doesn't forcibly convert the parameter to a + * number. Only finite values of the type number, result in true. + * @param number A numeric value. + */ + isFinite(number: number): boolean; + + /** + * Returns true if the value passed is an integer, false otherwise. + * @param number A numeric value. + */ + isInteger(number: number): boolean; + + /** + * Returns a Boolean value that indicates whether a value is the reserved value NaN (not a + * number). Unlike the global isNaN(), Number.isNaN() doesn't forcefully convert the parameter + * to a number. Only values of the type number, that are also NaN, result in true. + * @param number A numeric value. + */ + isNaN(number: number): boolean; + + /** + * Returns true if the value passed is a safe integer. + * @param number A numeric value. + */ + isSafeInteger(number: number): boolean; + + /** + * The value of the largest integer n such that n and n + 1 are both exactly representable as + * a Number value. + * The value of Number.MAX_SAFE_INTEGER is 9007199254740991 2^53 − 1. + */ + readonly MAX_SAFE_INTEGER: number; + + /** + * The value of the smallest integer n such that n and n − 1 are both exactly representable as + * a Number value. + * The value of Number.MIN_SAFE_INTEGER is −9007199254740991 (−(2^53 − 1)). + */ + readonly MIN_SAFE_INTEGER: number; + + /** + * Converts a string to a floating-point number. + * @param string A string that contains a floating-point number. + */ + parseFloat(string: string): number; + + /** + * Converts A string to an integer. + * @param s A string to convert into a number. + * @param radix A value between 2 and 36 that specifies the base of the number in numString. + * If this argument is not supplied, strings with a prefix of '0x' are considered hexadecimal. + * All other strings are considered decimal. + */ + parseInt(string: string, radix?: number): number; +} + +interface ObjectConstructor { + /** + * Copy the values of all of the enumerable own properties from one or more source objects to a + * target object. Returns the target object. + * @param target The target object to copy to. + * @param source The source object from which to copy properties. + */ + assign(target: T, source: U): T & U; + + /** + * Copy the values of all of the enumerable own properties from one or more source objects to a + * target object. Returns the target object. + * @param target The target object to copy to. + * @param source1 The first source object from which to copy properties. + * @param source2 The second source object from which to copy properties. + */ + assign(target: T, source1: U, source2: V): T & U & V; + + /** + * Copy the values of all of the enumerable own properties from one or more source objects to a + * target object. Returns the target object. + * @param target The target object to copy to. + * @param source1 The first source object from which to copy properties. + * @param source2 The second source object from which to copy properties. + * @param source3 The third source object from which to copy properties. + */ + assign(target: T, source1: U, source2: V, source3: W): T & U & V & W; + + /** + * Copy the values of all of the enumerable own properties from one or more source objects to a + * target object. Returns the target object. + * @param target The target object to copy to. + * @param sources One or more source objects from which to copy properties + */ + assign(target: object, ...sources: any[]): any; + + /** + * Returns an array of all symbol properties found directly on object o. + * @param o Object to retrieve the symbols from. + */ + getOwnPropertySymbols(o: any): symbol[]; + + /** + * Returns the names of the enumerable string properties and methods of an object. + * @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object. + */ + keys(o: {}): string[]; + + /** + * Returns true if the values are the same value, false otherwise. + * @param value1 The first value. + * @param value2 The second value. + */ + is(value1: any, value2: any): boolean; + + /** + * Sets the prototype of a specified object o to object proto or null. Returns the object o. + * @param o The object to change its prototype. + * @param proto The value of the new prototype or null. + */ + setPrototypeOf(o: any, proto: object | null): any; +} + +interface ReadonlyArray { + /** + * Returns the value of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + find(predicate: (this: void, value: T, index: number, obj: readonly T[]) => value is S, thisArg?: any): S | undefined; + find(predicate: (value: T, index: number, obj: readonly T[]) => unknown, thisArg?: any): T | undefined; + + /** + * Returns the index of the first element in the array where predicate is true, and -1 + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, + * findIndex immediately returns that element index. Otherwise, findIndex returns -1. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + findIndex(predicate: (value: T, index: number, obj: readonly T[]) => unknown, thisArg?: any): number; +} + +interface RegExp { + /** + * Returns a string indicating the flags of the regular expression in question. This field is read-only. + * The characters in this string are sequenced and concatenated in the following order: + * + * - "g" for global + * - "i" for ignoreCase + * - "m" for multiline + * - "u" for unicode + * - "y" for sticky + * + * If no flags are set, the value is the empty string. + */ + readonly flags: string; + + /** + * Returns a Boolean value indicating the state of the sticky flag (y) used with a regular + * expression. Default is false. Read-only. + */ + readonly sticky: boolean; + + /** + * Returns a Boolean value indicating the state of the Unicode flag (u) used with a regular + * expression. Default is false. Read-only. + */ + readonly unicode: boolean; +} + +interface RegExpConstructor { + new (pattern: RegExp | string, flags?: string): RegExp; + (pattern: RegExp | string, flags?: string): RegExp; +} + +interface String { + /** + * Returns a nonnegative integer Number less than 1114112 (0x110000) that is the code point + * value of the UTF-16 encoded code point starting at the string element at position pos in + * the String resulting from converting this object to a String. + * If there is no element at that position, the result is undefined. + * If a valid UTF-16 surrogate pair does not begin at pos, the result is the code unit at pos. + */ + codePointAt(pos: number): number | undefined; + + /** + * Returns true if searchString appears as a substring of the result of converting this + * object to a String, at one or more positions that are + * greater than or equal to position; otherwise, returns false. + * @param searchString search string + * @param position If position is undefined, 0 is assumed, so as to search all of the String. + */ + includes(searchString: string, position?: number): boolean; + + /** + * Returns true if the sequence of elements of searchString converted to a String is the + * same as the corresponding elements of this object (converted to a String) starting at + * endPosition – length(this). Otherwise returns false. + */ + endsWith(searchString: string, endPosition?: number): boolean; + + /** + * Returns the String value result of normalizing the string into the normalization form + * named by form as specified in Unicode Standard Annex #15, Unicode Normalization Forms. + * @param form Applicable values: "NFC", "NFD", "NFKC", or "NFKD", If not specified default + * is "NFC" + */ + normalize(form: "NFC" | "NFD" | "NFKC" | "NFKD"): string; + + /** + * Returns the String value result of normalizing the string into the normalization form + * named by form as specified in Unicode Standard Annex #15, Unicode Normalization Forms. + * @param form Applicable values: "NFC", "NFD", "NFKC", or "NFKD", If not specified default + * is "NFC" + */ + normalize(form?: string): string; + + /** + * Returns a String value that is made from count copies appended together. If count is 0, + * the empty string is returned. + * @param count number of copies to append + */ + repeat(count: number): string; + + /** + * Returns true if the sequence of elements of searchString converted to a String is the + * same as the corresponding elements of this object (converted to a String) starting at + * position. Otherwise returns false. + */ + startsWith(searchString: string, position?: number): boolean; + + /** + * Returns an HTML anchor element and sets the name attribute to the text value + * @param name + */ + anchor(name: string): string; + + /** Returns a HTML element */ + big(): string; + + /** Returns a HTML element */ + blink(): string; + + /** Returns a HTML element */ + bold(): string; + + /** Returns a HTML element */ + fixed(): string; + + /** Returns a HTML element and sets the color attribute value */ + fontcolor(color: string): string; + + /** Returns a HTML element and sets the size attribute value */ + fontsize(size: number): string; + + /** Returns a HTML element and sets the size attribute value */ + fontsize(size: string): string; + + /** Returns an HTML element */ + italics(): string; + + /** Returns an HTML element and sets the href attribute value */ + link(url: string): string; + + /** Returns a HTML element */ + small(): string; + + /** Returns a HTML element */ + strike(): string; + + /** Returns a HTML element */ + sub(): string; + + /** Returns a HTML element */ + sup(): string; +} + +interface StringConstructor { + /** + * Return the String value whose elements are, in order, the elements in the List elements. + * If length is 0, the empty string is returned. + */ + fromCodePoint(...codePoints: number[]): string; + + /** + * String.raw is intended for use as a tag function of a Tagged Template String. When called + * as such the first argument will be a well formed template call site object and the rest + * parameter will contain the substitution values. + * @param template A well-formed template string call site representation. + * @param substitutions A set of substitution values. + */ + raw(template: TemplateStringsArray, ...substitutions: any[]): string; +} diff --git a/node_modules/typescript/lib/lib.es2015.d.ts b/node_modules/typescript/lib/lib.es2015.d.ts index 80aaba05b..8cdaf0c92 100644 --- a/node_modules/typescript/lib/lib.es2015.d.ts +++ b/node_modules/typescript/lib/lib.es2015.d.ts @@ -15,16 +15,16 @@ and limitations under the License. -/// +/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// diff --git a/node_modules/typescript/lib/lib.es2015.generator.d.ts b/node_modules/typescript/lib/lib.es2015.generator.d.ts index 25b733b07..b79727fac 100644 --- a/node_modules/typescript/lib/lib.es2015.generator.d.ts +++ b/node_modules/typescript/lib/lib.es2015.generator.d.ts @@ -15,65 +15,65 @@ and limitations under the License. -/// +/// -/// - -interface Generator extends Iterator { - // NOTE: 'next' is defined using a tuple to ensure we report the correct assignability errors in all places. - next(...args: [] | [TNext]): IteratorResult; - return(value: TReturn): IteratorResult; - throw(e: any): IteratorResult; - [Symbol.iterator](): Generator; -} - -interface GeneratorFunction { - /** - * Creates a new Generator object. - * @param args A list of arguments the function accepts. - */ - new (...args: any[]): Generator; - /** - * Creates a new Generator object. - * @param args A list of arguments the function accepts. - */ - (...args: any[]): Generator; - /** - * The length of the arguments. - */ - readonly length: number; - /** - * Returns the name of the function. - */ - readonly name: string; - /** - * A reference to the prototype. - */ - readonly prototype: Generator; -} - -interface GeneratorFunctionConstructor { - /** - * Creates a new Generator function. - * @param args A list of arguments the function accepts. - */ - new (...args: string[]): GeneratorFunction; - /** - * Creates a new Generator function. - * @param args A list of arguments the function accepts. - */ - (...args: string[]): GeneratorFunction; - /** - * The length of the arguments. - */ - readonly length: number; - /** - * Returns the name of the function. - */ - readonly name: string; - /** - * A reference to the prototype. - */ - readonly prototype: GeneratorFunction; -} +/// + +interface Generator extends Iterator { + // NOTE: 'next' is defined using a tuple to ensure we report the correct assignability errors in all places. + next(...args: [] | [TNext]): IteratorResult; + return(value: TReturn): IteratorResult; + throw(e: any): IteratorResult; + [Symbol.iterator](): Generator; +} + +interface GeneratorFunction { + /** + * Creates a new Generator object. + * @param args A list of arguments the function accepts. + */ + new (...args: any[]): Generator; + /** + * Creates a new Generator object. + * @param args A list of arguments the function accepts. + */ + (...args: any[]): Generator; + /** + * The length of the arguments. + */ + readonly length: number; + /** + * Returns the name of the function. + */ + readonly name: string; + /** + * A reference to the prototype. + */ + readonly prototype: Generator; +} + +interface GeneratorFunctionConstructor { + /** + * Creates a new Generator function. + * @param args A list of arguments the function accepts. + */ + new (...args: string[]): GeneratorFunction; + /** + * Creates a new Generator function. + * @param args A list of arguments the function accepts. + */ + (...args: string[]): GeneratorFunction; + /** + * The length of the arguments. + */ + readonly length: number; + /** + * Returns the name of the function. + */ + readonly name: string; + /** + * A reference to the prototype. + */ + readonly prototype: GeneratorFunction; +} diff --git a/node_modules/typescript/lib/lib.es2015.iterable.d.ts b/node_modules/typescript/lib/lib.es2015.iterable.d.ts index 051d3f26e..b3616fe20 100644 --- a/node_modules/typescript/lib/lib.es2015.iterable.d.ts +++ b/node_modules/typescript/lib/lib.es2015.iterable.d.ts @@ -15,487 +15,487 @@ and limitations under the License. -/// - - -/// - -interface SymbolConstructor { - /** - * A method that returns the default iterator for an object. Called by the semantics of the - * for-of statement. - */ - readonly iterator: symbol; -} - -interface IteratorYieldResult { - done?: false; - value: TYield; -} - -interface IteratorReturnResult { - done: true; - value: TReturn; -} - -type IteratorResult = IteratorYieldResult | IteratorReturnResult; - -interface Iterator { - // NOTE: 'next' is defined using a tuple to ensure we report the correct assignability errors in all places. - next(...args: [] | [TNext]): IteratorResult; - return?(value?: TReturn): IteratorResult; - throw?(e?: any): IteratorResult; -} - -interface Iterable { - [Symbol.iterator](): Iterator; -} - -interface IterableIterator extends Iterator { - [Symbol.iterator](): IterableIterator; -} - -interface Array { - /** Iterator */ - [Symbol.iterator](): IterableIterator; - - /** - * Returns an iterable of key, value pairs for every entry in the array - */ - entries(): IterableIterator<[number, T]>; - - /** - * Returns an iterable of keys in the array - */ - keys(): IterableIterator; - - /** - * Returns an iterable of values in the array - */ - values(): IterableIterator; -} - -interface ArrayConstructor { - /** - * Creates an array from an iterable object. - * @param iterable An iterable object to convert to an array. - */ - from(iterable: Iterable | ArrayLike): T[]; - - /** - * Creates an array from an iterable object. - * @param iterable An iterable object to convert to an array. - * @param mapfn A mapping function to call on every element of the array. - * @param thisArg Value of 'this' used to invoke the mapfn. - */ - from(iterable: Iterable | ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; -} - -interface ReadonlyArray { - /** Iterator of values in the array. */ - [Symbol.iterator](): IterableIterator; - - /** - * Returns an iterable of key, value pairs for every entry in the array - */ - entries(): IterableIterator<[number, T]>; - - /** - * Returns an iterable of keys in the array - */ - keys(): IterableIterator; - - /** - * Returns an iterable of values in the array - */ - values(): IterableIterator; -} - -interface IArguments { - /** Iterator */ - [Symbol.iterator](): IterableIterator; -} - -interface Map { - /** Returns an iterable of entries in the map. */ - [Symbol.iterator](): IterableIterator<[K, V]>; - - /** - * Returns an iterable of key, value pairs for every entry in the map. - */ - entries(): IterableIterator<[K, V]>; - - /** - * Returns an iterable of keys in the map - */ - keys(): IterableIterator; - - /** - * Returns an iterable of values in the map - */ - values(): IterableIterator; -} - -interface ReadonlyMap { - /** Returns an iterable of entries in the map. */ - [Symbol.iterator](): IterableIterator<[K, V]>; - - /** - * Returns an iterable of key, value pairs for every entry in the map. - */ - entries(): IterableIterator<[K, V]>; - - /** - * Returns an iterable of keys in the map - */ - keys(): IterableIterator; - - /** - * Returns an iterable of values in the map - */ - values(): IterableIterator; -} - -interface MapConstructor { - new (iterable: Iterable): Map; -} - -interface WeakMap { } - -interface WeakMapConstructor { - new (iterable: Iterable<[K, V]>): WeakMap; -} - -interface Set { - /** Iterates over values in the set. */ - [Symbol.iterator](): IterableIterator; - /** - * Returns an iterable of [v,v] pairs for every value `v` in the set. - */ - entries(): IterableIterator<[T, T]>; - /** - * Despite its name, returns an iterable of the values in the set, - */ - keys(): IterableIterator; - - /** - * Returns an iterable of values in the set. - */ - values(): IterableIterator; -} - -interface ReadonlySet { - /** Iterates over values in the set. */ - [Symbol.iterator](): IterableIterator; - - /** - * Returns an iterable of [v,v] pairs for every value `v` in the set. - */ - entries(): IterableIterator<[T, T]>; - - /** - * Despite its name, returns an iterable of the values in the set, - */ - keys(): IterableIterator; - - /** - * Returns an iterable of values in the set. - */ - values(): IterableIterator; -} - -interface SetConstructor { - new (iterable?: Iterable | null): Set; -} - -interface WeakSet { } - -interface WeakSetConstructor { - new (iterable: Iterable): WeakSet; -} - -interface Promise { } - -interface PromiseConstructor { - /** - * Creates a Promise that is resolved with an array of results when all of the provided Promises - * resolve, or rejected when any Promise is rejected. - * @param values An array of Promises. - * @returns A new Promise. - */ - all(values: Iterable>): Promise; - - /** - * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved - * or rejected. - * @param values An array of Promises. - * @returns A new Promise. - */ - race(values: Iterable>): Promise; -} - -declare namespace Reflect { - function enumerate(target: object): IterableIterator; -} - -interface String { - /** Iterator */ - [Symbol.iterator](): IterableIterator; -} - -interface Int8Array { - [Symbol.iterator](): IterableIterator; - /** - * Returns an array of key, value pairs for every entry in the array - */ - entries(): IterableIterator<[number, number]>; - /** - * Returns an list of keys in the array - */ - keys(): IterableIterator; - /** - * Returns an list of values in the array - */ - values(): IterableIterator; -} - -interface Int8ArrayConstructor { - new (elements: Iterable): Int8Array; - - /** - * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. - * @param mapfn A mapping function to call on every element of the array. - * @param thisArg Value of 'this' used to invoke the mapfn. - */ - from(arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Int8Array; -} - -interface Uint8Array { - [Symbol.iterator](): IterableIterator; - /** - * Returns an array of key, value pairs for every entry in the array - */ - entries(): IterableIterator<[number, number]>; - /** - * Returns an list of keys in the array - */ - keys(): IterableIterator; - /** - * Returns an list of values in the array - */ - values(): IterableIterator; -} - -interface Uint8ArrayConstructor { - new (elements: Iterable): Uint8Array; - - /** - * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. - * @param mapfn A mapping function to call on every element of the array. - * @param thisArg Value of 'this' used to invoke the mapfn. - */ - from(arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint8Array; -} - -interface Uint8ClampedArray { - [Symbol.iterator](): IterableIterator; - /** - * Returns an array of key, value pairs for every entry in the array - */ - entries(): IterableIterator<[number, number]>; - - /** - * Returns an list of keys in the array - */ - keys(): IterableIterator; - - /** - * Returns an list of values in the array - */ - values(): IterableIterator; -} - -interface Uint8ClampedArrayConstructor { - new (elements: Iterable): Uint8ClampedArray; - - - /** - * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. - * @param mapfn A mapping function to call on every element of the array. - * @param thisArg Value of 'this' used to invoke the mapfn. - */ - from(arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint8ClampedArray; -} - -interface Int16Array { - [Symbol.iterator](): IterableIterator; - /** - * Returns an array of key, value pairs for every entry in the array - */ - entries(): IterableIterator<[number, number]>; - - /** - * Returns an list of keys in the array - */ - keys(): IterableIterator; - - /** - * Returns an list of values in the array - */ - values(): IterableIterator; -} - -interface Int16ArrayConstructor { - new (elements: Iterable): Int16Array; - - /** - * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. - * @param mapfn A mapping function to call on every element of the array. - * @param thisArg Value of 'this' used to invoke the mapfn. - */ - from(arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Int16Array; -} - -interface Uint16Array { - [Symbol.iterator](): IterableIterator; - /** - * Returns an array of key, value pairs for every entry in the array - */ - entries(): IterableIterator<[number, number]>; - /** - * Returns an list of keys in the array - */ - keys(): IterableIterator; - /** - * Returns an list of values in the array - */ - values(): IterableIterator; -} - -interface Uint16ArrayConstructor { - new (elements: Iterable): Uint16Array; - - /** - * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. - * @param mapfn A mapping function to call on every element of the array. - * @param thisArg Value of 'this' used to invoke the mapfn. - */ - from(arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint16Array; -} - -interface Int32Array { - [Symbol.iterator](): IterableIterator; - /** - * Returns an array of key, value pairs for every entry in the array - */ - entries(): IterableIterator<[number, number]>; - /** - * Returns an list of keys in the array - */ - keys(): IterableIterator; - /** - * Returns an list of values in the array - */ - values(): IterableIterator; -} - -interface Int32ArrayConstructor { - new (elements: Iterable): Int32Array; - - /** - * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. - * @param mapfn A mapping function to call on every element of the array. - * @param thisArg Value of 'this' used to invoke the mapfn. - */ - from(arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Int32Array; -} - -interface Uint32Array { - [Symbol.iterator](): IterableIterator; - /** - * Returns an array of key, value pairs for every entry in the array - */ - entries(): IterableIterator<[number, number]>; - /** - * Returns an list of keys in the array - */ - keys(): IterableIterator; - /** - * Returns an list of values in the array - */ - values(): IterableIterator; -} - -interface Uint32ArrayConstructor { - new (elements: Iterable): Uint32Array; - - /** - * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. - * @param mapfn A mapping function to call on every element of the array. - * @param thisArg Value of 'this' used to invoke the mapfn. - */ - from(arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint32Array; -} - -interface Float32Array { - [Symbol.iterator](): IterableIterator; - /** - * Returns an array of key, value pairs for every entry in the array - */ - entries(): IterableIterator<[number, number]>; - /** - * Returns an list of keys in the array - */ - keys(): IterableIterator; - /** - * Returns an list of values in the array - */ - values(): IterableIterator; -} - -interface Float32ArrayConstructor { - new (elements: Iterable): Float32Array; - - /** - * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. - * @param mapfn A mapping function to call on every element of the array. - * @param thisArg Value of 'this' used to invoke the mapfn. - */ - from(arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Float32Array; -} - -interface Float64Array { - [Symbol.iterator](): IterableIterator; - /** - * Returns an array of key, value pairs for every entry in the array - */ - entries(): IterableIterator<[number, number]>; - /** - * Returns an list of keys in the array - */ - keys(): IterableIterator; - /** - * Returns an list of values in the array - */ - values(): IterableIterator; -} - -interface Float64ArrayConstructor { - new (elements: Iterable): Float64Array; - - /** - * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. - * @param mapfn A mapping function to call on every element of the array. - * @param thisArg Value of 'this' used to invoke the mapfn. - */ - from(arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Float64Array; -} +/// + + +/// + +interface SymbolConstructor { + /** + * A method that returns the default iterator for an object. Called by the semantics of the + * for-of statement. + */ + readonly iterator: symbol; +} + +interface IteratorYieldResult { + done?: false; + value: TYield; +} + +interface IteratorReturnResult { + done: true; + value: TReturn; +} + +type IteratorResult = IteratorYieldResult | IteratorReturnResult; + +interface Iterator { + // NOTE: 'next' is defined using a tuple to ensure we report the correct assignability errors in all places. + next(...args: [] | [TNext]): IteratorResult; + return?(value?: TReturn): IteratorResult; + throw?(e?: any): IteratorResult; +} + +interface Iterable { + [Symbol.iterator](): Iterator; +} + +interface IterableIterator extends Iterator { + [Symbol.iterator](): IterableIterator; +} + +interface Array { + /** Iterator */ + [Symbol.iterator](): IterableIterator; + + /** + * Returns an iterable of key, value pairs for every entry in the array + */ + entries(): IterableIterator<[number, T]>; + + /** + * Returns an iterable of keys in the array + */ + keys(): IterableIterator; + + /** + * Returns an iterable of values in the array + */ + values(): IterableIterator; +} + +interface ArrayConstructor { + /** + * Creates an array from an iterable object. + * @param iterable An iterable object to convert to an array. + */ + from(iterable: Iterable | ArrayLike): T[]; + + /** + * Creates an array from an iterable object. + * @param iterable An iterable object to convert to an array. + * @param mapfn A mapping function to call on every element of the array. + * @param thisArg Value of 'this' used to invoke the mapfn. + */ + from(iterable: Iterable | ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; +} + +interface ReadonlyArray { + /** Iterator of values in the array. */ + [Symbol.iterator](): IterableIterator; + + /** + * Returns an iterable of key, value pairs for every entry in the array + */ + entries(): IterableIterator<[number, T]>; + + /** + * Returns an iterable of keys in the array + */ + keys(): IterableIterator; + + /** + * Returns an iterable of values in the array + */ + values(): IterableIterator; +} + +interface IArguments { + /** Iterator */ + [Symbol.iterator](): IterableIterator; +} + +interface Map { + /** Returns an iterable of entries in the map. */ + [Symbol.iterator](): IterableIterator<[K, V]>; + + /** + * Returns an iterable of key, value pairs for every entry in the map. + */ + entries(): IterableIterator<[K, V]>; + + /** + * Returns an iterable of keys in the map + */ + keys(): IterableIterator; + + /** + * Returns an iterable of values in the map + */ + values(): IterableIterator; +} + +interface ReadonlyMap { + /** Returns an iterable of entries in the map. */ + [Symbol.iterator](): IterableIterator<[K, V]>; + + /** + * Returns an iterable of key, value pairs for every entry in the map. + */ + entries(): IterableIterator<[K, V]>; + + /** + * Returns an iterable of keys in the map + */ + keys(): IterableIterator; + + /** + * Returns an iterable of values in the map + */ + values(): IterableIterator; +} + +interface MapConstructor { + new (iterable: Iterable): Map; +} + +interface WeakMap { } + +interface WeakMapConstructor { + new (iterable: Iterable<[K, V]>): WeakMap; +} + +interface Set { + /** Iterates over values in the set. */ + [Symbol.iterator](): IterableIterator; + /** + * Returns an iterable of [v,v] pairs for every value `v` in the set. + */ + entries(): IterableIterator<[T, T]>; + /** + * Despite its name, returns an iterable of the values in the set, + */ + keys(): IterableIterator; + + /** + * Returns an iterable of values in the set. + */ + values(): IterableIterator; +} + +interface ReadonlySet { + /** Iterates over values in the set. */ + [Symbol.iterator](): IterableIterator; + + /** + * Returns an iterable of [v,v] pairs for every value `v` in the set. + */ + entries(): IterableIterator<[T, T]>; + + /** + * Despite its name, returns an iterable of the values in the set, + */ + keys(): IterableIterator; + + /** + * Returns an iterable of values in the set. + */ + values(): IterableIterator; +} + +interface SetConstructor { + new (iterable?: Iterable | null): Set; +} + +interface WeakSet { } + +interface WeakSetConstructor { + new (iterable: Iterable): WeakSet; +} + +interface Promise { } + +interface PromiseConstructor { + /** + * Creates a Promise that is resolved with an array of results when all of the provided Promises + * resolve, or rejected when any Promise is rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + all(values: Iterable>): Promise; + + /** + * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved + * or rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + race(values: Iterable>): Promise; +} + +declare namespace Reflect { + function enumerate(target: object): IterableIterator; +} + +interface String { + /** Iterator */ + [Symbol.iterator](): IterableIterator; +} + +interface Int8Array { + [Symbol.iterator](): IterableIterator; + /** + * Returns an array of key, value pairs for every entry in the array + */ + entries(): IterableIterator<[number, number]>; + /** + * Returns an list of keys in the array + */ + keys(): IterableIterator; + /** + * Returns an list of values in the array + */ + values(): IterableIterator; +} + +interface Int8ArrayConstructor { + new (elements: Iterable): Int8Array; + + /** + * Creates an array from an array-like or iterable object. + * @param arrayLike An array-like or iterable object to convert to an array. + * @param mapfn A mapping function to call on every element of the array. + * @param thisArg Value of 'this' used to invoke the mapfn. + */ + from(arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Int8Array; +} + +interface Uint8Array { + [Symbol.iterator](): IterableIterator; + /** + * Returns an array of key, value pairs for every entry in the array + */ + entries(): IterableIterator<[number, number]>; + /** + * Returns an list of keys in the array + */ + keys(): IterableIterator; + /** + * Returns an list of values in the array + */ + values(): IterableIterator; +} + +interface Uint8ArrayConstructor { + new (elements: Iterable): Uint8Array; + + /** + * Creates an array from an array-like or iterable object. + * @param arrayLike An array-like or iterable object to convert to an array. + * @param mapfn A mapping function to call on every element of the array. + * @param thisArg Value of 'this' used to invoke the mapfn. + */ + from(arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint8Array; +} + +interface Uint8ClampedArray { + [Symbol.iterator](): IterableIterator; + /** + * Returns an array of key, value pairs for every entry in the array + */ + entries(): IterableIterator<[number, number]>; + + /** + * Returns an list of keys in the array + */ + keys(): IterableIterator; + + /** + * Returns an list of values in the array + */ + values(): IterableIterator; +} + +interface Uint8ClampedArrayConstructor { + new (elements: Iterable): Uint8ClampedArray; + + + /** + * Creates an array from an array-like or iterable object. + * @param arrayLike An array-like or iterable object to convert to an array. + * @param mapfn A mapping function to call on every element of the array. + * @param thisArg Value of 'this' used to invoke the mapfn. + */ + from(arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint8ClampedArray; +} + +interface Int16Array { + [Symbol.iterator](): IterableIterator; + /** + * Returns an array of key, value pairs for every entry in the array + */ + entries(): IterableIterator<[number, number]>; + + /** + * Returns an list of keys in the array + */ + keys(): IterableIterator; + + /** + * Returns an list of values in the array + */ + values(): IterableIterator; +} + +interface Int16ArrayConstructor { + new (elements: Iterable): Int16Array; + + /** + * Creates an array from an array-like or iterable object. + * @param arrayLike An array-like or iterable object to convert to an array. + * @param mapfn A mapping function to call on every element of the array. + * @param thisArg Value of 'this' used to invoke the mapfn. + */ + from(arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Int16Array; +} + +interface Uint16Array { + [Symbol.iterator](): IterableIterator; + /** + * Returns an array of key, value pairs for every entry in the array + */ + entries(): IterableIterator<[number, number]>; + /** + * Returns an list of keys in the array + */ + keys(): IterableIterator; + /** + * Returns an list of values in the array + */ + values(): IterableIterator; +} + +interface Uint16ArrayConstructor { + new (elements: Iterable): Uint16Array; + + /** + * Creates an array from an array-like or iterable object. + * @param arrayLike An array-like or iterable object to convert to an array. + * @param mapfn A mapping function to call on every element of the array. + * @param thisArg Value of 'this' used to invoke the mapfn. + */ + from(arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint16Array; +} + +interface Int32Array { + [Symbol.iterator](): IterableIterator; + /** + * Returns an array of key, value pairs for every entry in the array + */ + entries(): IterableIterator<[number, number]>; + /** + * Returns an list of keys in the array + */ + keys(): IterableIterator; + /** + * Returns an list of values in the array + */ + values(): IterableIterator; +} + +interface Int32ArrayConstructor { + new (elements: Iterable): Int32Array; + + /** + * Creates an array from an array-like or iterable object. + * @param arrayLike An array-like or iterable object to convert to an array. + * @param mapfn A mapping function to call on every element of the array. + * @param thisArg Value of 'this' used to invoke the mapfn. + */ + from(arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Int32Array; +} + +interface Uint32Array { + [Symbol.iterator](): IterableIterator; + /** + * Returns an array of key, value pairs for every entry in the array + */ + entries(): IterableIterator<[number, number]>; + /** + * Returns an list of keys in the array + */ + keys(): IterableIterator; + /** + * Returns an list of values in the array + */ + values(): IterableIterator; +} + +interface Uint32ArrayConstructor { + new (elements: Iterable): Uint32Array; + + /** + * Creates an array from an array-like or iterable object. + * @param arrayLike An array-like or iterable object to convert to an array. + * @param mapfn A mapping function to call on every element of the array. + * @param thisArg Value of 'this' used to invoke the mapfn. + */ + from(arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint32Array; +} + +interface Float32Array { + [Symbol.iterator](): IterableIterator; + /** + * Returns an array of key, value pairs for every entry in the array + */ + entries(): IterableIterator<[number, number]>; + /** + * Returns an list of keys in the array + */ + keys(): IterableIterator; + /** + * Returns an list of values in the array + */ + values(): IterableIterator; +} + +interface Float32ArrayConstructor { + new (elements: Iterable): Float32Array; + + /** + * Creates an array from an array-like or iterable object. + * @param arrayLike An array-like or iterable object to convert to an array. + * @param mapfn A mapping function to call on every element of the array. + * @param thisArg Value of 'this' used to invoke the mapfn. + */ + from(arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Float32Array; +} + +interface Float64Array { + [Symbol.iterator](): IterableIterator; + /** + * Returns an array of key, value pairs for every entry in the array + */ + entries(): IterableIterator<[number, number]>; + /** + * Returns an list of keys in the array + */ + keys(): IterableIterator; + /** + * Returns an list of values in the array + */ + values(): IterableIterator; +} + +interface Float64ArrayConstructor { + new (elements: Iterable): Float64Array; + + /** + * Creates an array from an array-like or iterable object. + * @param arrayLike An array-like or iterable object to convert to an array. + * @param mapfn A mapping function to call on every element of the array. + * @param thisArg Value of 'this' used to invoke the mapfn. + */ + from(arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Float64Array; +} diff --git a/node_modules/typescript/lib/lib.es2015.promise.d.ts b/node_modules/typescript/lib/lib.es2015.promise.d.ts index 1c73467ea..b20efaed8 100644 --- a/node_modules/typescript/lib/lib.es2015.promise.d.ts +++ b/node_modules/typescript/lib/lib.es2015.promise.d.ts @@ -15,138 +15,138 @@ and limitations under the License. -/// - - -interface PromiseConstructor { - /** - * A reference to the prototype. - */ - readonly prototype: Promise; - - /** - * Creates a new Promise. - * @param executor A callback used to initialize the promise. This callback is passed two arguments: - * a resolve callback used to resolve the promise with a value or the result of another promise, - * and a reject callback used to reject the promise with a provided reason or error. - */ - new (executor: (resolve: (value?: T | PromiseLike) => void, reject: (reason?: any) => void) => void): Promise; - - /** - * Creates a Promise that is resolved with an array of results when all of the provided Promises - * resolve, or rejected when any Promise is rejected. - * @param values An array of Promises. - * @returns A new Promise. - */ - all(values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike, T9 | PromiseLike, T10 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]>; - - /** - * Creates a Promise that is resolved with an array of results when all of the provided Promises - * resolve, or rejected when any Promise is rejected. - * @param values An array of Promises. - * @returns A new Promise. - */ - all(values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike, T9 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8, T9]>; - - /** - * Creates a Promise that is resolved with an array of results when all of the provided Promises - * resolve, or rejected when any Promise is rejected. - * @param values An array of Promises. - * @returns A new Promise. - */ - all(values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8]>; - - /** - * Creates a Promise that is resolved with an array of results when all of the provided Promises - * resolve, or rejected when any Promise is rejected. - * @param values An array of Promises. - * @returns A new Promise. - */ - all(values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7]>; - - /** - * Creates a Promise that is resolved with an array of results when all of the provided Promises - * resolve, or rejected when any Promise is rejected. - * @param values An array of Promises. - * @returns A new Promise. - */ - all(values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6]>; - - /** - * Creates a Promise that is resolved with an array of results when all of the provided Promises - * resolve, or rejected when any Promise is rejected. - * @param values An array of Promises. - * @returns A new Promise. - */ - all(values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike]): Promise<[T1, T2, T3, T4, T5]>; - - /** - * Creates a Promise that is resolved with an array of results when all of the provided Promises - * resolve, or rejected when any Promise is rejected. - * @param values An array of Promises. - * @returns A new Promise. - */ - all(values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike ]): Promise<[T1, T2, T3, T4]>; - - /** - * Creates a Promise that is resolved with an array of results when all of the provided Promises - * resolve, or rejected when any Promise is rejected. - * @param values An array of Promises. - * @returns A new Promise. - */ - all(values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike]): Promise<[T1, T2, T3]>; - - /** - * Creates a Promise that is resolved with an array of results when all of the provided Promises - * resolve, or rejected when any Promise is rejected. - * @param values An array of Promises. - * @returns A new Promise. - */ - all(values: readonly [T1 | PromiseLike, T2 | PromiseLike]): Promise<[T1, T2]>; - - /** - * Creates a Promise that is resolved with an array of results when all of the provided Promises - * resolve, or rejected when any Promise is rejected. - * @param values An array of Promises. - * @returns A new Promise. - */ - all(values: readonly (T | PromiseLike)[]): Promise; - - /** - * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved - * or rejected. - * @param values An array of Promises. - * @returns A new Promise. - */ - race(values: readonly T[]): Promise ? U : T>; - - /** - * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved - * or rejected. - * @param values An iterable of Promises. - * @returns A new Promise. - */ - race(values: Iterable): Promise ? U : T>; - - /** - * Creates a new rejected promise for the provided reason. - * @param reason The reason the promise was rejected. - * @returns A new rejected Promise. - */ - reject(reason?: any): Promise; - - /** - * Creates a new resolved promise for the provided value. - * @param value A promise. - * @returns A promise whose internal state matches the provided promise. - */ - resolve(value: T | PromiseLike): Promise; - - /** - * Creates a new resolved promise . - * @returns A resolved promise. - */ - resolve(): Promise; -} - -declare var Promise: PromiseConstructor; +/// + + +interface PromiseConstructor { + /** + * A reference to the prototype. + */ + readonly prototype: Promise; + + /** + * Creates a new Promise. + * @param executor A callback used to initialize the promise. This callback is passed two arguments: + * a resolve callback used to resolve the promise with a value or the result of another promise, + * and a reject callback used to reject the promise with a provided reason or error. + */ + new (executor: (resolve: (value?: T | PromiseLike) => void, reject: (reason?: any) => void) => void): Promise; + + /** + * Creates a Promise that is resolved with an array of results when all of the provided Promises + * resolve, or rejected when any Promise is rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + all(values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike, T9 | PromiseLike, T10 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]>; + + /** + * Creates a Promise that is resolved with an array of results when all of the provided Promises + * resolve, or rejected when any Promise is rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + all(values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike, T9 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8, T9]>; + + /** + * Creates a Promise that is resolved with an array of results when all of the provided Promises + * resolve, or rejected when any Promise is rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + all(values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8]>; + + /** + * Creates a Promise that is resolved with an array of results when all of the provided Promises + * resolve, or rejected when any Promise is rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + all(values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7]>; + + /** + * Creates a Promise that is resolved with an array of results when all of the provided Promises + * resolve, or rejected when any Promise is rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + all(values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6]>; + + /** + * Creates a Promise that is resolved with an array of results when all of the provided Promises + * resolve, or rejected when any Promise is rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + all(values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike]): Promise<[T1, T2, T3, T4, T5]>; + + /** + * Creates a Promise that is resolved with an array of results when all of the provided Promises + * resolve, or rejected when any Promise is rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + all(values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike ]): Promise<[T1, T2, T3, T4]>; + + /** + * Creates a Promise that is resolved with an array of results when all of the provided Promises + * resolve, or rejected when any Promise is rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + all(values: readonly [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike]): Promise<[T1, T2, T3]>; + + /** + * Creates a Promise that is resolved with an array of results when all of the provided Promises + * resolve, or rejected when any Promise is rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + all(values: readonly [T1 | PromiseLike, T2 | PromiseLike]): Promise<[T1, T2]>; + + /** + * Creates a Promise that is resolved with an array of results when all of the provided Promises + * resolve, or rejected when any Promise is rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + all(values: readonly (T | PromiseLike)[]): Promise; + + /** + * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved + * or rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + race(values: readonly T[]): Promise ? U : T>; + + /** + * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved + * or rejected. + * @param values An iterable of Promises. + * @returns A new Promise. + */ + race(values: Iterable): Promise ? U : T>; + + /** + * Creates a new rejected promise for the provided reason. + * @param reason The reason the promise was rejected. + * @returns A new rejected Promise. + */ + reject(reason?: any): Promise; + + /** + * Creates a new resolved promise for the provided value. + * @param value A promise. + * @returns A promise whose internal state matches the provided promise. + */ + resolve(value: T | PromiseLike): Promise; + + /** + * Creates a new resolved promise . + * @returns A resolved promise. + */ + resolve(): Promise; +} + +declare var Promise: PromiseConstructor; diff --git a/node_modules/typescript/lib/lib.es2015.proxy.d.ts b/node_modules/typescript/lib/lib.es2015.proxy.d.ts index 440897038..6b45e14d2 100644 --- a/node_modules/typescript/lib/lib.es2015.proxy.d.ts +++ b/node_modules/typescript/lib/lib.es2015.proxy.d.ts @@ -15,28 +15,28 @@ and limitations under the License. -/// +/// -interface ProxyHandler { - getPrototypeOf? (target: T): object | null; - setPrototypeOf? (target: T, v: any): boolean; - isExtensible? (target: T): boolean; - preventExtensions? (target: T): boolean; - getOwnPropertyDescriptor? (target: T, p: PropertyKey): PropertyDescriptor | undefined; - has? (target: T, p: PropertyKey): boolean; - get? (target: T, p: PropertyKey, receiver: any): any; - set? (target: T, p: PropertyKey, value: any, receiver: any): boolean; - deleteProperty? (target: T, p: PropertyKey): boolean; - defineProperty? (target: T, p: PropertyKey, attributes: PropertyDescriptor): boolean; - enumerate? (target: T): PropertyKey[]; - ownKeys? (target: T): PropertyKey[]; - apply? (target: T, thisArg: any, argArray?: any): any; - construct? (target: T, argArray: any, newTarget?: any): object; -} - -interface ProxyConstructor { - revocable(target: T, handler: ProxyHandler): { proxy: T; revoke: () => void; }; - new (target: T, handler: ProxyHandler): T; -} -declare var Proxy: ProxyConstructor; +interface ProxyHandler { + getPrototypeOf? (target: T): object | null; + setPrototypeOf? (target: T, v: any): boolean; + isExtensible? (target: T): boolean; + preventExtensions? (target: T): boolean; + getOwnPropertyDescriptor? (target: T, p: PropertyKey): PropertyDescriptor | undefined; + has? (target: T, p: PropertyKey): boolean; + get? (target: T, p: PropertyKey, receiver: any): any; + set? (target: T, p: PropertyKey, value: any, receiver: any): boolean; + deleteProperty? (target: T, p: PropertyKey): boolean; + defineProperty? (target: T, p: PropertyKey, attributes: PropertyDescriptor): boolean; + enumerate? (target: T): PropertyKey[]; + ownKeys? (target: T): PropertyKey[]; + apply? (target: T, thisArg: any, argArray?: any): any; + construct? (target: T, argArray: any, newTarget?: any): object; +} + +interface ProxyConstructor { + revocable(target: T, handler: ProxyHandler): { proxy: T; revoke: () => void; }; + new (target: T, handler: ProxyHandler): T; +} +declare var Proxy: ProxyConstructor; diff --git a/node_modules/typescript/lib/lib.es2015.reflect.d.ts b/node_modules/typescript/lib/lib.es2015.reflect.d.ts index 1139f1c2c..7078c9636 100644 --- a/node_modules/typescript/lib/lib.es2015.reflect.d.ts +++ b/node_modules/typescript/lib/lib.es2015.reflect.d.ts @@ -15,21 +15,21 @@ and limitations under the License. -/// +/// -declare namespace Reflect { - function apply(target: Function, thisArgument: any, argumentsList: ArrayLike): any; - function construct(target: Function, argumentsList: ArrayLike, newTarget?: any): any; - function defineProperty(target: object, propertyKey: PropertyKey, attributes: PropertyDescriptor): boolean; - function deleteProperty(target: object, propertyKey: PropertyKey): boolean; - function get(target: object, propertyKey: PropertyKey, receiver?: any): any; - function getOwnPropertyDescriptor(target: object, propertyKey: PropertyKey): PropertyDescriptor | undefined; - function getPrototypeOf(target: object): object; - function has(target: object, propertyKey: PropertyKey): boolean; - function isExtensible(target: object): boolean; - function ownKeys(target: object): PropertyKey[]; - function preventExtensions(target: object): boolean; - function set(target: object, propertyKey: PropertyKey, value: any, receiver?: any): boolean; - function setPrototypeOf(target: object, proto: any): boolean; -} +declare namespace Reflect { + function apply(target: Function, thisArgument: any, argumentsList: ArrayLike): any; + function construct(target: Function, argumentsList: ArrayLike, newTarget?: any): any; + function defineProperty(target: object, propertyKey: PropertyKey, attributes: PropertyDescriptor): boolean; + function deleteProperty(target: object, propertyKey: PropertyKey): boolean; + function get(target: object, propertyKey: PropertyKey, receiver?: any): any; + function getOwnPropertyDescriptor(target: object, propertyKey: PropertyKey): PropertyDescriptor | undefined; + function getPrototypeOf(target: object): object; + function has(target: object, propertyKey: PropertyKey): boolean; + function isExtensible(target: object): boolean; + function ownKeys(target: object): PropertyKey[]; + function preventExtensions(target: object): boolean; + function set(target: object, propertyKey: PropertyKey, value: any, receiver?: any): boolean; + function setPrototypeOf(target: object, proto: any): boolean; +} diff --git a/node_modules/typescript/lib/lib.es2015.symbol.d.ts b/node_modules/typescript/lib/lib.es2015.symbol.d.ts index bf09484d5..07b2c4054 100644 --- a/node_modules/typescript/lib/lib.es2015.symbol.d.ts +++ b/node_modules/typescript/lib/lib.es2015.symbol.d.ts @@ -15,34 +15,34 @@ and limitations under the License. -/// - - -interface SymbolConstructor { - /** - * A reference to the prototype. - */ - readonly prototype: Symbol; - - /** - * Returns a new unique Symbol value. - * @param description Description of the new Symbol object. - */ - (description?: string | number): symbol; - - /** - * Returns a Symbol object from the global symbol registry matching the given key if found. - * Otherwise, returns a new symbol with this key. - * @param key key to search for. - */ - for(key: string): symbol; - - /** - * Returns a key from the global symbol registry matching the given Symbol if found. - * Otherwise, returns a undefined. - * @param sym Symbol to find the key for. - */ - keyFor(sym: symbol): string | undefined; -} - +/// + + +interface SymbolConstructor { + /** + * A reference to the prototype. + */ + readonly prototype: Symbol; + + /** + * Returns a new unique Symbol value. + * @param description Description of the new Symbol object. + */ + (description?: string | number): symbol; + + /** + * Returns a Symbol object from the global symbol registry matching the given key if found. + * Otherwise, returns a new symbol with this key. + * @param key key to search for. + */ + for(key: string): symbol; + + /** + * Returns a key from the global symbol registry matching the given Symbol if found. + * Otherwise, returns a undefined. + * @param sym Symbol to find the key for. + */ + keyFor(sym: symbol): string | undefined; +} + declare var Symbol: SymbolConstructor; \ No newline at end of file diff --git a/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts b/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts index 400f70a7f..454e29601 100644 --- a/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts +++ b/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts @@ -15,304 +15,304 @@ and limitations under the License. -/// - - -/// - -interface SymbolConstructor { - /** - * A method that determines if a constructor object recognizes an object as one of the - * constructor’s instances. Called by the semantics of the instanceof operator. - */ - readonly hasInstance: symbol; - - /** - * A Boolean value that if true indicates that an object should flatten to its array elements - * by Array.prototype.concat. - */ - readonly isConcatSpreadable: symbol; - - /** - * A regular expression method that matches the regular expression against a string. Called - * by the String.prototype.match method. - */ - readonly match: symbol; - - /** - * A regular expression method that replaces matched substrings of a string. Called by the - * String.prototype.replace method. - */ - readonly replace: symbol; - - /** - * A regular expression method that returns the index within a string that matches the - * regular expression. Called by the String.prototype.search method. - */ - readonly search: symbol; - - /** - * A function valued property that is the constructor function that is used to create - * derived objects. - */ - readonly species: symbol; - - /** - * A regular expression method that splits a string at the indices that match the regular - * expression. Called by the String.prototype.split method. - */ - readonly split: symbol; - - /** - * A method that converts an object to a corresponding primitive value. - * Called by the ToPrimitive abstract operation. - */ - readonly toPrimitive: symbol; - - /** - * A String value that is used in the creation of the default string description of an object. - * Called by the built-in method Object.prototype.toString. - */ - readonly toStringTag: symbol; - - /** - * An Object whose own property names are property names that are excluded from the 'with' - * environment bindings of the associated objects. - */ - readonly unscopables: symbol; -} - -interface Symbol { - readonly [Symbol.toStringTag]: string; -} - -interface Array { - /** - * Returns an object whose properties have the value 'true' - * when they will be absent when used in a 'with' statement. - */ - [Symbol.unscopables](): { - copyWithin: boolean; - entries: boolean; - fill: boolean; - find: boolean; - findIndex: boolean; - keys: boolean; - values: boolean; - }; -} - -interface Date { - /** - * Converts a Date object to a string. - */ - [Symbol.toPrimitive](hint: "default"): string; - /** - * Converts a Date object to a string. - */ - [Symbol.toPrimitive](hint: "string"): string; - /** - * Converts a Date object to a number. - */ - [Symbol.toPrimitive](hint: "number"): number; - /** - * Converts a Date object to a string or number. - * - * @param hint The strings "number", "string", or "default" to specify what primitive to return. - * - * @throws {TypeError} If 'hint' was given something other than "number", "string", or "default". - * @returns A number if 'hint' was "number", a string if 'hint' was "string" or "default". - */ - [Symbol.toPrimitive](hint: string): string | number; -} - -interface Map { - readonly [Symbol.toStringTag]: string; -} - -interface WeakMap { - readonly [Symbol.toStringTag]: string; -} - -interface Set { - readonly [Symbol.toStringTag]: string; -} - -interface WeakSet { - readonly [Symbol.toStringTag]: string; -} - -interface JSON { - readonly [Symbol.toStringTag]: string; -} - -interface Function { - /** - * Determines whether the given value inherits from this function if this function was used - * as a constructor function. - * - * A constructor function can control which objects are recognized as its instances by - * 'instanceof' by overriding this method. - */ - [Symbol.hasInstance](value: any): boolean; -} - -interface GeneratorFunction { - readonly [Symbol.toStringTag]: string; -} - -interface Math { - readonly [Symbol.toStringTag]: string; -} - -interface Promise { - readonly [Symbol.toStringTag]: string; -} - -interface PromiseConstructor { - readonly [Symbol.species]: PromiseConstructor; -} - -interface RegExp { - /** - * Matches a string with this regular expression, and returns an array containing the results of - * that search. - * @param string A string to search within. - */ - [Symbol.match](string: string): RegExpMatchArray | null; - - /** - * Replaces text in a string, using this regular expression. - * @param string A String object or string literal whose contents matching against - * this regular expression will be replaced - * @param replaceValue A String object or string literal containing the text to replace for every - * successful match of this regular expression. - */ - [Symbol.replace](string: string, replaceValue: string): string; - - /** - * Replaces text in a string, using this regular expression. - * @param string A String object or string literal whose contents matching against - * this regular expression will be replaced - * @param replacer A function that returns the replacement text. - */ - [Symbol.replace](string: string, replacer: (substring: string, ...args: any[]) => string): string; - - /** - * Finds the position beginning first substring match in a regular expression search - * using this regular expression. - * - * @param string The string to search within. - */ - [Symbol.search](string: string): number; - - /** - * Returns an array of substrings that were delimited by strings in the original input that - * match against this regular expression. - * - * If the regular expression contains capturing parentheses, then each time this - * regular expression matches, the results (including any undefined results) of the - * capturing parentheses are spliced. - * - * @param string string value to split - * @param limit if not undefined, the output array is truncated so that it contains no more - * than 'limit' elements. - */ - [Symbol.split](string: string, limit?: number): string[]; -} - -interface RegExpConstructor { - readonly [Symbol.species]: RegExpConstructor; -} - -interface String { - /** - * Matches a string an object that supports being matched against, and returns an array containing the results of that search. - * @param matcher An object that supports being matched against. - */ - match(matcher: { [Symbol.match](string: string): RegExpMatchArray | null; }): RegExpMatchArray | null; - - /** - * Replaces text in a string, using an object that supports replacement within a string. - * @param searchValue A object can search for and replace matches within a string. - * @param replaceValue A string containing the text to replace for every successful match of searchValue in this string. - */ - replace(searchValue: { [Symbol.replace](string: string, replaceValue: string): string; }, replaceValue: string): string; - - /** - * Replaces text in a string, using an object that supports replacement within a string. - * @param searchValue A object can search for and replace matches within a string. - * @param replacer A function that returns the replacement text. - */ - replace(searchValue: { [Symbol.replace](string: string, replacer: (substring: string, ...args: any[]) => string): string; }, replacer: (substring: string, ...args: any[]) => string): string; - - /** - * Finds the first substring match in a regular expression search. - * @param searcher An object which supports searching within a string. - */ - search(searcher: { [Symbol.search](string: string): number; }): number; - - /** - * Split a string into substrings using the specified separator and return them as an array. - * @param splitter An object that can split a string. - * @param limit A value used to limit the number of elements returned in the array. - */ - split(splitter: { [Symbol.split](string: string, limit?: number): string[]; }, limit?: number): string[]; -} - -interface ArrayBuffer { - readonly [Symbol.toStringTag]: string; -} - -interface DataView { - readonly [Symbol.toStringTag]: string; -} - -interface Int8Array { - readonly [Symbol.toStringTag]: "Int8Array"; -} - -interface Uint8Array { - readonly [Symbol.toStringTag]: "UInt8Array"; -} - -interface Uint8ClampedArray { - readonly [Symbol.toStringTag]: "Uint8ClampedArray"; -} - -interface Int16Array { - readonly [Symbol.toStringTag]: "Int16Array"; -} - -interface Uint16Array { - readonly [Symbol.toStringTag]: "Uint16Array"; -} - -interface Int32Array { - readonly [Symbol.toStringTag]: "Int32Array"; -} - -interface Uint32Array { - readonly [Symbol.toStringTag]: "Uint32Array"; -} - -interface Float32Array { - readonly [Symbol.toStringTag]: "Float32Array"; -} - -interface Float64Array { - readonly [Symbol.toStringTag]: "Float64Array"; -} - -interface ArrayConstructor { - readonly [Symbol.species]: ArrayConstructor; -} -interface MapConstructor { - readonly [Symbol.species]: MapConstructor; -} -interface SetConstructor { - readonly [Symbol.species]: SetConstructor; -} -interface ArrayBufferConstructor { - readonly [Symbol.species]: ArrayBufferConstructor; +/// + + +/// + +interface SymbolConstructor { + /** + * A method that determines if a constructor object recognizes an object as one of the + * constructor’s instances. Called by the semantics of the instanceof operator. + */ + readonly hasInstance: symbol; + + /** + * A Boolean value that if true indicates that an object should flatten to its array elements + * by Array.prototype.concat. + */ + readonly isConcatSpreadable: symbol; + + /** + * A regular expression method that matches the regular expression against a string. Called + * by the String.prototype.match method. + */ + readonly match: symbol; + + /** + * A regular expression method that replaces matched substrings of a string. Called by the + * String.prototype.replace method. + */ + readonly replace: symbol; + + /** + * A regular expression method that returns the index within a string that matches the + * regular expression. Called by the String.prototype.search method. + */ + readonly search: symbol; + + /** + * A function valued property that is the constructor function that is used to create + * derived objects. + */ + readonly species: symbol; + + /** + * A regular expression method that splits a string at the indices that match the regular + * expression. Called by the String.prototype.split method. + */ + readonly split: symbol; + + /** + * A method that converts an object to a corresponding primitive value. + * Called by the ToPrimitive abstract operation. + */ + readonly toPrimitive: symbol; + + /** + * A String value that is used in the creation of the default string description of an object. + * Called by the built-in method Object.prototype.toString. + */ + readonly toStringTag: symbol; + + /** + * An Object whose own property names are property names that are excluded from the 'with' + * environment bindings of the associated objects. + */ + readonly unscopables: symbol; +} + +interface Symbol { + readonly [Symbol.toStringTag]: string; +} + +interface Array { + /** + * Returns an object whose properties have the value 'true' + * when they will be absent when used in a 'with' statement. + */ + [Symbol.unscopables](): { + copyWithin: boolean; + entries: boolean; + fill: boolean; + find: boolean; + findIndex: boolean; + keys: boolean; + values: boolean; + }; +} + +interface Date { + /** + * Converts a Date object to a string. + */ + [Symbol.toPrimitive](hint: "default"): string; + /** + * Converts a Date object to a string. + */ + [Symbol.toPrimitive](hint: "string"): string; + /** + * Converts a Date object to a number. + */ + [Symbol.toPrimitive](hint: "number"): number; + /** + * Converts a Date object to a string or number. + * + * @param hint The strings "number", "string", or "default" to specify what primitive to return. + * + * @throws {TypeError} If 'hint' was given something other than "number", "string", or "default". + * @returns A number if 'hint' was "number", a string if 'hint' was "string" or "default". + */ + [Symbol.toPrimitive](hint: string): string | number; +} + +interface Map { + readonly [Symbol.toStringTag]: string; +} + +interface WeakMap { + readonly [Symbol.toStringTag]: string; +} + +interface Set { + readonly [Symbol.toStringTag]: string; +} + +interface WeakSet { + readonly [Symbol.toStringTag]: string; +} + +interface JSON { + readonly [Symbol.toStringTag]: string; +} + +interface Function { + /** + * Determines whether the given value inherits from this function if this function was used + * as a constructor function. + * + * A constructor function can control which objects are recognized as its instances by + * 'instanceof' by overriding this method. + */ + [Symbol.hasInstance](value: any): boolean; +} + +interface GeneratorFunction { + readonly [Symbol.toStringTag]: string; +} + +interface Math { + readonly [Symbol.toStringTag]: string; +} + +interface Promise { + readonly [Symbol.toStringTag]: string; +} + +interface PromiseConstructor { + readonly [Symbol.species]: PromiseConstructor; +} + +interface RegExp { + /** + * Matches a string with this regular expression, and returns an array containing the results of + * that search. + * @param string A string to search within. + */ + [Symbol.match](string: string): RegExpMatchArray | null; + + /** + * Replaces text in a string, using this regular expression. + * @param string A String object or string literal whose contents matching against + * this regular expression will be replaced + * @param replaceValue A String object or string literal containing the text to replace for every + * successful match of this regular expression. + */ + [Symbol.replace](string: string, replaceValue: string): string; + + /** + * Replaces text in a string, using this regular expression. + * @param string A String object or string literal whose contents matching against + * this regular expression will be replaced + * @param replacer A function that returns the replacement text. + */ + [Symbol.replace](string: string, replacer: (substring: string, ...args: any[]) => string): string; + + /** + * Finds the position beginning first substring match in a regular expression search + * using this regular expression. + * + * @param string The string to search within. + */ + [Symbol.search](string: string): number; + + /** + * Returns an array of substrings that were delimited by strings in the original input that + * match against this regular expression. + * + * If the regular expression contains capturing parentheses, then each time this + * regular expression matches, the results (including any undefined results) of the + * capturing parentheses are spliced. + * + * @param string string value to split + * @param limit if not undefined, the output array is truncated so that it contains no more + * than 'limit' elements. + */ + [Symbol.split](string: string, limit?: number): string[]; +} + +interface RegExpConstructor { + readonly [Symbol.species]: RegExpConstructor; +} + +interface String { + /** + * Matches a string an object that supports being matched against, and returns an array containing the results of that search. + * @param matcher An object that supports being matched against. + */ + match(matcher: { [Symbol.match](string: string): RegExpMatchArray | null; }): RegExpMatchArray | null; + + /** + * Replaces text in a string, using an object that supports replacement within a string. + * @param searchValue A object can search for and replace matches within a string. + * @param replaceValue A string containing the text to replace for every successful match of searchValue in this string. + */ + replace(searchValue: { [Symbol.replace](string: string, replaceValue: string): string; }, replaceValue: string): string; + + /** + * Replaces text in a string, using an object that supports replacement within a string. + * @param searchValue A object can search for and replace matches within a string. + * @param replacer A function that returns the replacement text. + */ + replace(searchValue: { [Symbol.replace](string: string, replacer: (substring: string, ...args: any[]) => string): string; }, replacer: (substring: string, ...args: any[]) => string): string; + + /** + * Finds the first substring match in a regular expression search. + * @param searcher An object which supports searching within a string. + */ + search(searcher: { [Symbol.search](string: string): number; }): number; + + /** + * Split a string into substrings using the specified separator and return them as an array. + * @param splitter An object that can split a string. + * @param limit A value used to limit the number of elements returned in the array. + */ + split(splitter: { [Symbol.split](string: string, limit?: number): string[]; }, limit?: number): string[]; +} + +interface ArrayBuffer { + readonly [Symbol.toStringTag]: string; +} + +interface DataView { + readonly [Symbol.toStringTag]: string; +} + +interface Int8Array { + readonly [Symbol.toStringTag]: "Int8Array"; +} + +interface Uint8Array { + readonly [Symbol.toStringTag]: "UInt8Array"; +} + +interface Uint8ClampedArray { + readonly [Symbol.toStringTag]: "Uint8ClampedArray"; +} + +interface Int16Array { + readonly [Symbol.toStringTag]: "Int16Array"; +} + +interface Uint16Array { + readonly [Symbol.toStringTag]: "Uint16Array"; +} + +interface Int32Array { + readonly [Symbol.toStringTag]: "Int32Array"; +} + +interface Uint32Array { + readonly [Symbol.toStringTag]: "Uint32Array"; +} + +interface Float32Array { + readonly [Symbol.toStringTag]: "Float32Array"; +} + +interface Float64Array { + readonly [Symbol.toStringTag]: "Float64Array"; +} + +interface ArrayConstructor { + readonly [Symbol.species]: ArrayConstructor; +} +interface MapConstructor { + readonly [Symbol.species]: MapConstructor; +} +interface SetConstructor { + readonly [Symbol.species]: SetConstructor; +} +interface ArrayBufferConstructor { + readonly [Symbol.species]: ArrayBufferConstructor; } \ No newline at end of file diff --git a/node_modules/typescript/lib/lib.es2016.array.include.d.ts b/node_modules/typescript/lib/lib.es2016.array.include.d.ts index 734fa450d..3f417a6a6 100644 --- a/node_modules/typescript/lib/lib.es2016.array.include.d.ts +++ b/node_modules/typescript/lib/lib.es2016.array.include.d.ts @@ -15,104 +15,104 @@ and limitations under the License. -/// +/// -interface Array { - /** - * Determines whether an array includes a certain element, returning true or false as appropriate. - * @param searchElement The element to search for. - * @param fromIndex The position in this array at which to begin searching for searchElement. - */ - includes(searchElement: T, fromIndex?: number): boolean; -} - -interface ReadonlyArray { - /** - * Determines whether an array includes a certain element, returning true or false as appropriate. - * @param searchElement The element to search for. - * @param fromIndex The position in this array at which to begin searching for searchElement. - */ - includes(searchElement: T, fromIndex?: number): boolean; -} - -interface Int8Array { - /** - * Determines whether an array includes a certain element, returning true or false as appropriate. - * @param searchElement The element to search for. - * @param fromIndex The position in this array at which to begin searching for searchElement. - */ - includes(searchElement: number, fromIndex?: number): boolean; -} - -interface Uint8Array { - /** - * Determines whether an array includes a certain element, returning true or false as appropriate. - * @param searchElement The element to search for. - * @param fromIndex The position in this array at which to begin searching for searchElement. - */ - includes(searchElement: number, fromIndex?: number): boolean; -} - -interface Uint8ClampedArray { - /** - * Determines whether an array includes a certain element, returning true or false as appropriate. - * @param searchElement The element to search for. - * @param fromIndex The position in this array at which to begin searching for searchElement. - */ - includes(searchElement: number, fromIndex?: number): boolean; -} - -interface Int16Array { - /** - * Determines whether an array includes a certain element, returning true or false as appropriate. - * @param searchElement The element to search for. - * @param fromIndex The position in this array at which to begin searching for searchElement. - */ - includes(searchElement: number, fromIndex?: number): boolean; -} - -interface Uint16Array { - /** - * Determines whether an array includes a certain element, returning true or false as appropriate. - * @param searchElement The element to search for. - * @param fromIndex The position in this array at which to begin searching for searchElement. - */ - includes(searchElement: number, fromIndex?: number): boolean; -} - -interface Int32Array { - /** - * Determines whether an array includes a certain element, returning true or false as appropriate. - * @param searchElement The element to search for. - * @param fromIndex The position in this array at which to begin searching for searchElement. - */ - includes(searchElement: number, fromIndex?: number): boolean; -} - -interface Uint32Array { - /** - * Determines whether an array includes a certain element, returning true or false as appropriate. - * @param searchElement The element to search for. - * @param fromIndex The position in this array at which to begin searching for searchElement. - */ - includes(searchElement: number, fromIndex?: number): boolean; -} - -interface Float32Array { - /** - * Determines whether an array includes a certain element, returning true or false as appropriate. - * @param searchElement The element to search for. - * @param fromIndex The position in this array at which to begin searching for searchElement. - */ - includes(searchElement: number, fromIndex?: number): boolean; -} - -interface Float64Array { - /** - * Determines whether an array includes a certain element, returning true or false as appropriate. - * @param searchElement The element to search for. - * @param fromIndex The position in this array at which to begin searching for searchElement. - */ - includes(searchElement: number, fromIndex?: number): boolean; +interface Array { + /** + * Determines whether an array includes a certain element, returning true or false as appropriate. + * @param searchElement The element to search for. + * @param fromIndex The position in this array at which to begin searching for searchElement. + */ + includes(searchElement: T, fromIndex?: number): boolean; +} + +interface ReadonlyArray { + /** + * Determines whether an array includes a certain element, returning true or false as appropriate. + * @param searchElement The element to search for. + * @param fromIndex The position in this array at which to begin searching for searchElement. + */ + includes(searchElement: T, fromIndex?: number): boolean; +} + +interface Int8Array { + /** + * Determines whether an array includes a certain element, returning true or false as appropriate. + * @param searchElement The element to search for. + * @param fromIndex The position in this array at which to begin searching for searchElement. + */ + includes(searchElement: number, fromIndex?: number): boolean; +} + +interface Uint8Array { + /** + * Determines whether an array includes a certain element, returning true or false as appropriate. + * @param searchElement The element to search for. + * @param fromIndex The position in this array at which to begin searching for searchElement. + */ + includes(searchElement: number, fromIndex?: number): boolean; +} + +interface Uint8ClampedArray { + /** + * Determines whether an array includes a certain element, returning true or false as appropriate. + * @param searchElement The element to search for. + * @param fromIndex The position in this array at which to begin searching for searchElement. + */ + includes(searchElement: number, fromIndex?: number): boolean; +} + +interface Int16Array { + /** + * Determines whether an array includes a certain element, returning true or false as appropriate. + * @param searchElement The element to search for. + * @param fromIndex The position in this array at which to begin searching for searchElement. + */ + includes(searchElement: number, fromIndex?: number): boolean; +} + +interface Uint16Array { + /** + * Determines whether an array includes a certain element, returning true or false as appropriate. + * @param searchElement The element to search for. + * @param fromIndex The position in this array at which to begin searching for searchElement. + */ + includes(searchElement: number, fromIndex?: number): boolean; +} + +interface Int32Array { + /** + * Determines whether an array includes a certain element, returning true or false as appropriate. + * @param searchElement The element to search for. + * @param fromIndex The position in this array at which to begin searching for searchElement. + */ + includes(searchElement: number, fromIndex?: number): boolean; +} + +interface Uint32Array { + /** + * Determines whether an array includes a certain element, returning true or false as appropriate. + * @param searchElement The element to search for. + * @param fromIndex The position in this array at which to begin searching for searchElement. + */ + includes(searchElement: number, fromIndex?: number): boolean; +} + +interface Float32Array { + /** + * Determines whether an array includes a certain element, returning true or false as appropriate. + * @param searchElement The element to search for. + * @param fromIndex The position in this array at which to begin searching for searchElement. + */ + includes(searchElement: number, fromIndex?: number): boolean; +} + +interface Float64Array { + /** + * Determines whether an array includes a certain element, returning true or false as appropriate. + * @param searchElement The element to search for. + * @param fromIndex The position in this array at which to begin searching for searchElement. + */ + includes(searchElement: number, fromIndex?: number): boolean; } \ No newline at end of file diff --git a/node_modules/typescript/lib/lib.es2016.d.ts b/node_modules/typescript/lib/lib.es2016.d.ts index b2d59b8d4..81da5004b 100644 --- a/node_modules/typescript/lib/lib.es2016.d.ts +++ b/node_modules/typescript/lib/lib.es2016.d.ts @@ -15,8 +15,8 @@ and limitations under the License. -/// +/// -/// +/// /// \ No newline at end of file diff --git a/node_modules/typescript/lib/lib.es2016.full.d.ts b/node_modules/typescript/lib/lib.es2016.full.d.ts index 6ecfe0a67..5e317b2cf 100644 --- a/node_modules/typescript/lib/lib.es2016.full.d.ts +++ b/node_modules/typescript/lib/lib.es2016.full.d.ts @@ -15,11 +15,11 @@ and limitations under the License. -/// +/// -/// -/// -/// -/// +/// +/// +/// +/// /// \ No newline at end of file diff --git a/node_modules/typescript/lib/lib.es2017.d.ts b/node_modules/typescript/lib/lib.es2017.d.ts index 850e81d0f..38aae6a3d 100644 --- a/node_modules/typescript/lib/lib.es2017.d.ts +++ b/node_modules/typescript/lib/lib.es2017.d.ts @@ -15,12 +15,12 @@ and limitations under the License. -/// +/// -/// -/// -/// -/// -/// -/// +/// +/// +/// +/// +/// +/// diff --git a/node_modules/typescript/lib/lib.es2017.full.d.ts b/node_modules/typescript/lib/lib.es2017.full.d.ts index 46d2ee836..f9de1f4de 100644 --- a/node_modules/typescript/lib/lib.es2017.full.d.ts +++ b/node_modules/typescript/lib/lib.es2017.full.d.ts @@ -15,11 +15,11 @@ and limitations under the License. -/// +/// -/// -/// -/// -/// +/// +/// +/// +/// /// \ No newline at end of file diff --git a/node_modules/typescript/lib/lib.es2017.intl.d.ts b/node_modules/typescript/lib/lib.es2017.intl.d.ts index 25b1fa5fa..f4fc56ba7 100644 --- a/node_modules/typescript/lib/lib.es2017.intl.d.ts +++ b/node_modules/typescript/lib/lib.es2017.intl.d.ts @@ -15,18 +15,18 @@ and limitations under the License. -/// +/// -declare namespace Intl { - type DateTimeFormatPartTypes = "day" | "dayPeriod" | "era" | "hour" | "literal" | "minute" | "month" | "second" | "timeZoneName" | "weekday" | "year"; - - interface DateTimeFormatPart { - type: DateTimeFormatPartTypes; - value: string; - } - - interface DateTimeFormat { - formatToParts(date?: Date | number): DateTimeFormatPart[]; - } -} +declare namespace Intl { + type DateTimeFormatPartTypes = "day" | "dayPeriod" | "era" | "hour" | "literal" | "minute" | "month" | "second" | "timeZoneName" | "weekday" | "year"; + + interface DateTimeFormatPart { + type: DateTimeFormatPartTypes; + value: string; + } + + interface DateTimeFormat { + formatToParts(date?: Date | number): DateTimeFormatPart[]; + } +} diff --git a/node_modules/typescript/lib/lib.es2017.object.d.ts b/node_modules/typescript/lib/lib.es2017.object.d.ts index aaea4246c..7e34fe1d9 100644 --- a/node_modules/typescript/lib/lib.es2017.object.d.ts +++ b/node_modules/typescript/lib/lib.es2017.object.d.ts @@ -15,37 +15,37 @@ and limitations under the License. -/// - - -interface ObjectConstructor { - /** - * Returns an array of values of the enumerable properties of an object - * @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object. - */ - values(o: { [s: string]: T } | ArrayLike): T[]; - - /** - * Returns an array of values of the enumerable properties of an object - * @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object. - */ - values(o: {}): any[]; - - /** - * Returns an array of key/values of the enumerable properties of an object - * @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object. - */ - entries(o: { [s: string]: T } | ArrayLike): [string, T][]; - - /** - * Returns an array of key/values of the enumerable properties of an object - * @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object. - */ - entries(o: {}): [string, any][]; - - /** - * Returns an object containing all own property descriptors of an object - * @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object. - */ - getOwnPropertyDescriptors(o: T): {[P in keyof T]: TypedPropertyDescriptor} & { [x: string]: PropertyDescriptor }; -} +/// + + +interface ObjectConstructor { + /** + * Returns an array of values of the enumerable properties of an object + * @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object. + */ + values(o: { [s: string]: T } | ArrayLike): T[]; + + /** + * Returns an array of values of the enumerable properties of an object + * @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object. + */ + values(o: {}): any[]; + + /** + * Returns an array of key/values of the enumerable properties of an object + * @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object. + */ + entries(o: { [s: string]: T } | ArrayLike): [string, T][]; + + /** + * Returns an array of key/values of the enumerable properties of an object + * @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object. + */ + entries(o: {}): [string, any][]; + + /** + * Returns an object containing all own property descriptors of an object + * @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object. + */ + getOwnPropertyDescriptors(o: T): {[P in keyof T]: TypedPropertyDescriptor} & { [x: string]: PropertyDescriptor }; +} diff --git a/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts b/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts index e3fb0c73b..d9a914da3 100644 --- a/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts +++ b/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts @@ -15,124 +15,124 @@ and limitations under the License. -/// - - -/// -/// - -interface SharedArrayBuffer { - /** - * Read-only. The length of the ArrayBuffer (in bytes). - */ - readonly byteLength: number; - - /* - * The SharedArrayBuffer constructor's length property whose value is 1. - */ - length: number; - /** - * Returns a section of an SharedArrayBuffer. - */ - slice(begin: number, end?: number): SharedArrayBuffer; - readonly [Symbol.species]: SharedArrayBuffer; - readonly [Symbol.toStringTag]: "SharedArrayBuffer"; -} - -interface SharedArrayBufferConstructor { - readonly prototype: SharedArrayBuffer; - new (byteLength: number): SharedArrayBuffer; -} -declare var SharedArrayBuffer: SharedArrayBufferConstructor; - -interface ArrayBufferTypes { - SharedArrayBuffer: SharedArrayBuffer; -} - -interface Atomics { - /** - * Adds a value to the value at the given position in the array, returning the original value. - * Until this atomic operation completes, any other read or write operation against the array - * will block. - */ - add(typedArray: Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array, index: number, value: number): number; - - /** - * Stores the bitwise AND of a value with the value at the given position in the array, - * returning the original value. Until this atomic operation completes, any other read or - * write operation against the array will block. - */ - and(typedArray: Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array, index: number, value: number): number; - - /** - * Replaces the value at the given position in the array if the original value equals the given - * expected value, returning the original value. Until this atomic operation completes, any - * other read or write operation against the array will block. - */ - compareExchange(typedArray: Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array, index: number, expectedValue: number, replacementValue: number): number; - - /** - * Replaces the value at the given position in the array, returning the original value. Until - * this atomic operation completes, any other read or write operation against the array will - * block. - */ - exchange(typedArray: Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array, index: number, value: number): number; - - /** - * Returns a value indicating whether high-performance algorithms can use atomic operations - * (`true`) or must use locks (`false`) for the given number of bytes-per-element of a typed - * array. - */ - isLockFree(size: number): boolean; - - /** - * Returns the value at the given position in the array. Until this atomic operation completes, - * any other read or write operation against the array will block. - */ - load(typedArray: Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array, index: number): number; - - /** - * Stores the bitwise OR of a value with the value at the given position in the array, - * returning the original value. Until this atomic operation completes, any other read or write - * operation against the array will block. - */ - or(typedArray: Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array, index: number, value: number): number; - - /** - * Stores a value at the given position in the array, returning the new value. Until this - * atomic operation completes, any other read or write operation against the array will block. - */ - store(typedArray: Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array, index: number, value: number): number; - - /** - * Subtracts a value from the value at the given position in the array, returning the original - * value. Until this atomic operation completes, any other read or write operation against the - * array will block. - */ - sub(typedArray: Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array, index: number, value: number): number; - - /** - * If the value at the given position in the array is equal to the provided value, the current - * agent is put to sleep causing execution to suspend until the timeout expires (returning - * `"timed-out"`) or until the agent is awoken (returning `"ok"`); otherwise, returns - * `"not-equal"`. - */ - wait(typedArray: Int32Array, index: number, value: number, timeout?: number): "ok" | "not-equal" | "timed-out"; - - /** - * Wakes up sleeping agents that are waiting on the given index of the array, returning the - * number of agents that were awoken. - */ - notify(typedArray: Int32Array, index: number, count: number): number; - - /** - * Stores the bitwise XOR of a value with the value at the given position in the array, - * returning the original value. Until this atomic operation completes, any other read or write - * operation against the array will block. - */ - xor(typedArray: Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array, index: number, value: number): number; - - readonly [Symbol.toStringTag]: "Atomics"; -} - -declare var Atomics: Atomics; +/// + + +/// +/// + +interface SharedArrayBuffer { + /** + * Read-only. The length of the ArrayBuffer (in bytes). + */ + readonly byteLength: number; + + /* + * The SharedArrayBuffer constructor's length property whose value is 1. + */ + length: number; + /** + * Returns a section of an SharedArrayBuffer. + */ + slice(begin: number, end?: number): SharedArrayBuffer; + readonly [Symbol.species]: SharedArrayBuffer; + readonly [Symbol.toStringTag]: "SharedArrayBuffer"; +} + +interface SharedArrayBufferConstructor { + readonly prototype: SharedArrayBuffer; + new (byteLength: number): SharedArrayBuffer; +} +declare var SharedArrayBuffer: SharedArrayBufferConstructor; + +interface ArrayBufferTypes { + SharedArrayBuffer: SharedArrayBuffer; +} + +interface Atomics { + /** + * Adds a value to the value at the given position in the array, returning the original value. + * Until this atomic operation completes, any other read or write operation against the array + * will block. + */ + add(typedArray: Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array, index: number, value: number): number; + + /** + * Stores the bitwise AND of a value with the value at the given position in the array, + * returning the original value. Until this atomic operation completes, any other read or + * write operation against the array will block. + */ + and(typedArray: Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array, index: number, value: number): number; + + /** + * Replaces the value at the given position in the array if the original value equals the given + * expected value, returning the original value. Until this atomic operation completes, any + * other read or write operation against the array will block. + */ + compareExchange(typedArray: Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array, index: number, expectedValue: number, replacementValue: number): number; + + /** + * Replaces the value at the given position in the array, returning the original value. Until + * this atomic operation completes, any other read or write operation against the array will + * block. + */ + exchange(typedArray: Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array, index: number, value: number): number; + + /** + * Returns a value indicating whether high-performance algorithms can use atomic operations + * (`true`) or must use locks (`false`) for the given number of bytes-per-element of a typed + * array. + */ + isLockFree(size: number): boolean; + + /** + * Returns the value at the given position in the array. Until this atomic operation completes, + * any other read or write operation against the array will block. + */ + load(typedArray: Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array, index: number): number; + + /** + * Stores the bitwise OR of a value with the value at the given position in the array, + * returning the original value. Until this atomic operation completes, any other read or write + * operation against the array will block. + */ + or(typedArray: Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array, index: number, value: number): number; + + /** + * Stores a value at the given position in the array, returning the new value. Until this + * atomic operation completes, any other read or write operation against the array will block. + */ + store(typedArray: Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array, index: number, value: number): number; + + /** + * Subtracts a value from the value at the given position in the array, returning the original + * value. Until this atomic operation completes, any other read or write operation against the + * array will block. + */ + sub(typedArray: Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array, index: number, value: number): number; + + /** + * If the value at the given position in the array is equal to the provided value, the current + * agent is put to sleep causing execution to suspend until the timeout expires (returning + * `"timed-out"`) or until the agent is awoken (returning `"ok"`); otherwise, returns + * `"not-equal"`. + */ + wait(typedArray: Int32Array, index: number, value: number, timeout?: number): "ok" | "not-equal" | "timed-out"; + + /** + * Wakes up sleeping agents that are waiting on the given index of the array, returning the + * number of agents that were awoken. + */ + notify(typedArray: Int32Array, index: number, count: number): number; + + /** + * Stores the bitwise XOR of a value with the value at the given position in the array, + * returning the original value. Until this atomic operation completes, any other read or write + * operation against the array will block. + */ + xor(typedArray: Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array, index: number, value: number): number; + + readonly [Symbol.toStringTag]: "Atomics"; +} + +declare var Atomics: Atomics; diff --git a/node_modules/typescript/lib/lib.es2017.string.d.ts b/node_modules/typescript/lib/lib.es2017.string.d.ts index dad64f0d8..5d46546a9 100644 --- a/node_modules/typescript/lib/lib.es2017.string.d.ts +++ b/node_modules/typescript/lib/lib.es2017.string.d.ts @@ -15,33 +15,33 @@ and limitations under the License. -/// +/// -interface String { - /** - * Pads the current string with a given string (possibly repeated) so that the resulting string reaches a given length. - * The padding is applied from the start (left) of the current string. - * - * @param maxLength The length of the resulting string once the current string has been padded. - * If this parameter is smaller than the current string's length, the current string will be returned as it is. - * - * @param fillString The string to pad the current string with. - * If this string is too long, it will be truncated and the left-most part will be applied. - * The default value for this parameter is " " (U+0020). - */ - padStart(maxLength: number, fillString?: string): string; - - /** - * Pads the current string with a given string (possibly repeated) so that the resulting string reaches a given length. - * The padding is applied from the end (right) of the current string. - * - * @param maxLength The length of the resulting string once the current string has been padded. - * If this parameter is smaller than the current string's length, the current string will be returned as it is. - * - * @param fillString The string to pad the current string with. - * If this string is too long, it will be truncated and the left-most part will be applied. - * The default value for this parameter is " " (U+0020). - */ - padEnd(maxLength: number, fillString?: string): string; -} +interface String { + /** + * Pads the current string with a given string (possibly repeated) so that the resulting string reaches a given length. + * The padding is applied from the start (left) of the current string. + * + * @param maxLength The length of the resulting string once the current string has been padded. + * If this parameter is smaller than the current string's length, the current string will be returned as it is. + * + * @param fillString The string to pad the current string with. + * If this string is too long, it will be truncated and the left-most part will be applied. + * The default value for this parameter is " " (U+0020). + */ + padStart(maxLength: number, fillString?: string): string; + + /** + * Pads the current string with a given string (possibly repeated) so that the resulting string reaches a given length. + * The padding is applied from the end (right) of the current string. + * + * @param maxLength The length of the resulting string once the current string has been padded. + * If this parameter is smaller than the current string's length, the current string will be returned as it is. + * + * @param fillString The string to pad the current string with. + * If this string is too long, it will be truncated and the left-most part will be applied. + * The default value for this parameter is " " (U+0020). + */ + padEnd(maxLength: number, fillString?: string): string; +} diff --git a/node_modules/typescript/lib/lib.es2017.typedarrays.d.ts b/node_modules/typescript/lib/lib.es2017.typedarrays.d.ts index 4f6f6e72d..0a13c77aa 100644 --- a/node_modules/typescript/lib/lib.es2017.typedarrays.d.ts +++ b/node_modules/typescript/lib/lib.es2017.typedarrays.d.ts @@ -15,41 +15,41 @@ and limitations under the License. -/// - - -interface Int8ArrayConstructor { - new (): Int8Array; -} - -interface Uint8ArrayConstructor { - new (): Uint8Array; -} - -interface Uint8ClampedArrayConstructor { - new (): Uint8ClampedArray; -} - -interface Int16ArrayConstructor { - new (): Int16Array; -} - -interface Uint16ArrayConstructor { - new (): Uint16Array; -} - -interface Int32ArrayConstructor { - new (): Int32Array; -} - -interface Uint32ArrayConstructor { - new (): Uint32Array; -} - -interface Float32ArrayConstructor { - new (): Float32Array; -} - -interface Float64ArrayConstructor { - new (): Float64Array; -} +/// + + +interface Int8ArrayConstructor { + new (): Int8Array; +} + +interface Uint8ArrayConstructor { + new (): Uint8Array; +} + +interface Uint8ClampedArrayConstructor { + new (): Uint8ClampedArray; +} + +interface Int16ArrayConstructor { + new (): Int16Array; +} + +interface Uint16ArrayConstructor { + new (): Uint16Array; +} + +interface Int32ArrayConstructor { + new (): Int32Array; +} + +interface Uint32ArrayConstructor { + new (): Uint32Array; +} + +interface Float32ArrayConstructor { + new (): Float32Array; +} + +interface Float64ArrayConstructor { + new (): Float64Array; +} diff --git a/node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts b/node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts index 61eb9c39a..041f24a29 100644 --- a/node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts +++ b/node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts @@ -15,65 +15,65 @@ and limitations under the License. -/// +/// -/// - -interface AsyncGenerator extends AsyncIterator { - // NOTE: 'next' is defined using a tuple to ensure we report the correct assignability errors in all places. - next(...args: [] | [TNext]): Promise>; - return(value: TReturn | PromiseLike): Promise>; - throw(e: any): Promise>; - [Symbol.asyncIterator](): AsyncGenerator; -} - -interface AsyncGeneratorFunction { - /** - * Creates a new AsyncGenerator object. - * @param args A list of arguments the function accepts. - */ - new (...args: any[]): AsyncGenerator; - /** - * Creates a new AsyncGenerator object. - * @param args A list of arguments the function accepts. - */ - (...args: any[]): AsyncGenerator; - /** - * The length of the arguments. - */ - readonly length: number; - /** - * Returns the name of the function. - */ - readonly name: string; - /** - * A reference to the prototype. - */ - readonly prototype: AsyncGenerator; -} - -interface AsyncGeneratorFunctionConstructor { - /** - * Creates a new AsyncGenerator function. - * @param args A list of arguments the function accepts. - */ - new (...args: string[]): AsyncGeneratorFunction; - /** - * Creates a new AsyncGenerator function. - * @param args A list of arguments the function accepts. - */ - (...args: string[]): AsyncGeneratorFunction; - /** - * The length of the arguments. - */ - readonly length: number; - /** - * Returns the name of the function. - */ - readonly name: string; - /** - * A reference to the prototype. - */ - readonly prototype: AsyncGeneratorFunction; -} +/// + +interface AsyncGenerator extends AsyncIterator { + // NOTE: 'next' is defined using a tuple to ensure we report the correct assignability errors in all places. + next(...args: [] | [TNext]): Promise>; + return(value: TReturn | PromiseLike): Promise>; + throw(e: any): Promise>; + [Symbol.asyncIterator](): AsyncGenerator; +} + +interface AsyncGeneratorFunction { + /** + * Creates a new AsyncGenerator object. + * @param args A list of arguments the function accepts. + */ + new (...args: any[]): AsyncGenerator; + /** + * Creates a new AsyncGenerator object. + * @param args A list of arguments the function accepts. + */ + (...args: any[]): AsyncGenerator; + /** + * The length of the arguments. + */ + readonly length: number; + /** + * Returns the name of the function. + */ + readonly name: string; + /** + * A reference to the prototype. + */ + readonly prototype: AsyncGenerator; +} + +interface AsyncGeneratorFunctionConstructor { + /** + * Creates a new AsyncGenerator function. + * @param args A list of arguments the function accepts. + */ + new (...args: string[]): AsyncGeneratorFunction; + /** + * Creates a new AsyncGenerator function. + * @param args A list of arguments the function accepts. + */ + (...args: string[]): AsyncGeneratorFunction; + /** + * The length of the arguments. + */ + readonly length: number; + /** + * Returns the name of the function. + */ + readonly name: string; + /** + * A reference to the prototype. + */ + readonly prototype: AsyncGeneratorFunction; +} diff --git a/node_modules/typescript/lib/lib.es2018.asynciterable.d.ts b/node_modules/typescript/lib/lib.es2018.asynciterable.d.ts index 8eebde363..8016a8a6b 100644 --- a/node_modules/typescript/lib/lib.es2018.asynciterable.d.ts +++ b/node_modules/typescript/lib/lib.es2018.asynciterable.d.ts @@ -15,31 +15,31 @@ and limitations under the License. -/// - - -/// -/// - -interface SymbolConstructor { - /** - * A method that returns the default async iterator for an object. Called by the semantics of - * the for-await-of statement. - */ - readonly asyncIterator: symbol; -} - -interface AsyncIterator { - // NOTE: 'next' is defined using a tuple to ensure we report the correct assignability errors in all places. - next(...args: [] | [TNext]): Promise>; - return?(value?: TReturn | PromiseLike): Promise>; - throw?(e?: any): Promise>; -} - -interface AsyncIterable { - [Symbol.asyncIterator](): AsyncIterator; -} - -interface AsyncIterableIterator extends AsyncIterator { - [Symbol.asyncIterator](): AsyncIterableIterator; +/// + + +/// +/// + +interface SymbolConstructor { + /** + * A method that returns the default async iterator for an object. Called by the semantics of + * the for-await-of statement. + */ + readonly asyncIterator: symbol; +} + +interface AsyncIterator { + // NOTE: 'next' is defined using a tuple to ensure we report the correct assignability errors in all places. + next(...args: [] | [TNext]): Promise>; + return?(value?: TReturn | PromiseLike): Promise>; + throw?(e?: any): Promise>; +} + +interface AsyncIterable { + [Symbol.asyncIterator](): AsyncIterator; +} + +interface AsyncIterableIterator extends AsyncIterator { + [Symbol.asyncIterator](): AsyncIterableIterator; } \ No newline at end of file diff --git a/node_modules/typescript/lib/lib.es2018.d.ts b/node_modules/typescript/lib/lib.es2018.d.ts index 24ce0dc05..5d2dc219b 100644 --- a/node_modules/typescript/lib/lib.es2018.d.ts +++ b/node_modules/typescript/lib/lib.es2018.d.ts @@ -15,12 +15,12 @@ and limitations under the License. -/// +/// -/// -/// -/// -/// -/// -/// +/// +/// +/// +/// +/// +/// diff --git a/node_modules/typescript/lib/lib.es2018.full.d.ts b/node_modules/typescript/lib/lib.es2018.full.d.ts index 277d5411f..e78c22e74 100644 --- a/node_modules/typescript/lib/lib.es2018.full.d.ts +++ b/node_modules/typescript/lib/lib.es2018.full.d.ts @@ -15,11 +15,11 @@ and limitations under the License. -/// +/// -/// -/// -/// -/// +/// +/// +/// +/// /// \ No newline at end of file diff --git a/node_modules/typescript/lib/lib.es2018.intl.d.ts b/node_modules/typescript/lib/lib.es2018.intl.d.ts index 6ab0dca02..462b3a956 100644 --- a/node_modules/typescript/lib/lib.es2018.intl.d.ts +++ b/node_modules/typescript/lib/lib.es2018.intl.d.ts @@ -15,37 +15,37 @@ and limitations under the License. -/// - - -declare namespace Intl { - interface PluralRulesOptions { - localeMatcher?: "lookup" | "best fit"; - type?: "cardinal" | "ordinal"; - } - - interface ResolvedPluralRulesOptions { - locale: string; - pluralCategories: string[]; - type: "cardinal" | "ordinal"; - minimumIntegerDigits: number; - minimumFractionDigits: number; - maximumFractionDigits: number; - minimumSignificantDigits: number; - maximumSignificantDigits: number; - } - - interface PluralRules { - resolvedOptions(): ResolvedPluralRulesOptions; - select(n: number): string; - } - - const PluralRules: { - new (locales?: string | string[], options?: PluralRulesOptions): PluralRules; - (locales?: string | string[], options?: PluralRulesOptions): PluralRules; - supportedLocalesOf( - locales: string | string[], - options?: PluralRulesOptions, - ): string[]; - }; -} +/// + + +declare namespace Intl { + interface PluralRulesOptions { + localeMatcher?: "lookup" | "best fit"; + type?: "cardinal" | "ordinal"; + } + + interface ResolvedPluralRulesOptions { + locale: string; + pluralCategories: string[]; + type: "cardinal" | "ordinal"; + minimumIntegerDigits: number; + minimumFractionDigits: number; + maximumFractionDigits: number; + minimumSignificantDigits: number; + maximumSignificantDigits: number; + } + + interface PluralRules { + resolvedOptions(): ResolvedPluralRulesOptions; + select(n: number): string; + } + + const PluralRules: { + new (locales?: string | string[], options?: PluralRulesOptions): PluralRules; + (locales?: string | string[], options?: PluralRulesOptions): PluralRules; + supportedLocalesOf( + locales: string | string[], + options?: PluralRulesOptions, + ): string[]; + }; +} diff --git a/node_modules/typescript/lib/lib.es2018.promise.d.ts b/node_modules/typescript/lib/lib.es2018.promise.d.ts index d73b4d456..6abedab87 100644 --- a/node_modules/typescript/lib/lib.es2018.promise.d.ts +++ b/node_modules/typescript/lib/lib.es2018.promise.d.ts @@ -15,18 +15,18 @@ and limitations under the License. -/// +/// -/** - * Represents the completion of an asynchronous operation - */ -interface Promise { - /** - * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The - * resolved value cannot be modified from the callback. - * @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected). - * @returns A Promise for the completion of the callback. - */ - finally(onfinally?: (() => void) | undefined | null): Promise -} +/** + * Represents the completion of an asynchronous operation + */ +interface Promise { + /** + * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The + * resolved value cannot be modified from the callback. + * @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected). + * @returns A Promise for the completion of the callback. + */ + finally(onfinally?: (() => void) | undefined | null): Promise +} diff --git a/node_modules/typescript/lib/lib.es2018.regexp.d.ts b/node_modules/typescript/lib/lib.es2018.regexp.d.ts index 4ba698ff9..3f3cffd31 100644 --- a/node_modules/typescript/lib/lib.es2018.regexp.d.ts +++ b/node_modules/typescript/lib/lib.es2018.regexp.d.ts @@ -15,25 +15,25 @@ and limitations under the License. -/// +/// -interface RegExpMatchArray { - groups?: { - [key: string]: string - } -} - -interface RegExpExecArray { - groups?: { - [key: string]: string - } -} - -interface RegExp { - /** - * Returns a Boolean value indicating the state of the dotAll flag (s) used with a regular expression. - * Default is false. Read-only. - */ - readonly dotAll: boolean; +interface RegExpMatchArray { + groups?: { + [key: string]: string + } +} + +interface RegExpExecArray { + groups?: { + [key: string]: string + } +} + +interface RegExp { + /** + * Returns a Boolean value indicating the state of the dotAll flag (s) used with a regular expression. + * Default is false. Read-only. + */ + readonly dotAll: boolean; } \ No newline at end of file diff --git a/node_modules/typescript/lib/lib.es2019.array.d.ts b/node_modules/typescript/lib/lib.es2019.array.d.ts index b67c7c14c..ca375ffdb 100644 --- a/node_modules/typescript/lib/lib.es2019.array.d.ts +++ b/node_modules/typescript/lib/lib.es2019.array.d.ts @@ -15,209 +15,209 @@ and limitations under the License. -/// - - -interface ReadonlyArray { - - /** - * Calls a defined callback function on each element of an array. Then, flattens the result into - * a new array. - * This is identical to a map followed by flat with depth 1. - * - * @param callback A function that accepts up to three arguments. The flatMap method calls the - * callback function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callback function. If - * thisArg is omitted, undefined is used as the this value. - */ - flatMap ( - callback: (this: This, value: T, index: number, array: T[]) => U | ReadonlyArray, - thisArg?: This - ): U[] - - - /** - * Returns a new array with all sub-array elements concatenated into it recursively up to the - * specified depth. - * - * @param depth The maximum recursion depth - */ - flat(this: - ReadonlyArray | - - ReadonlyArray> | - ReadonlyArray[]> | - ReadonlyArray[][]> | - ReadonlyArray[][][]> | - - ReadonlyArray>> | - ReadonlyArray[][]>> | - ReadonlyArray>[][]> | - ReadonlyArray[]>[]> | - ReadonlyArray>[]> | - ReadonlyArray[]>> | - - ReadonlyArray>>> | - ReadonlyArray[]>>> | - ReadonlyArray>[]>> | - ReadonlyArray>>[]> | - - ReadonlyArray>>>>, - depth: 4): U[]; - - /** - * Returns a new array with all sub-array elements concatenated into it recursively up to the - * specified depth. - * - * @param depth The maximum recursion depth - */ - flat(this: - ReadonlyArray | - - ReadonlyArray[][]> | - ReadonlyArray[]> | - ReadonlyArray> | - - ReadonlyArray>> | - ReadonlyArray[]>> | - ReadonlyArray>[]> | - - ReadonlyArray>>>, - depth: 3): U[]; - - /** - * Returns a new array with all sub-array elements concatenated into it recursively up to the - * specified depth. - * - * @param depth The maximum recursion depth - */ - flat(this: - ReadonlyArray | - - ReadonlyArray> | - ReadonlyArray[]> | - - ReadonlyArray>>, - depth: 2): U[]; - - /** - * Returns a new array with all sub-array elements concatenated into it recursively up to the - * specified depth. - * - * @param depth The maximum recursion depth - */ - flat(this: - ReadonlyArray | - ReadonlyArray>, - depth?: 1 - ): U[]; - - /** - * Returns a new array with all sub-array elements concatenated into it recursively up to the - * specified depth. - * - * @param depth The maximum recursion depth - */ - flat(this: - ReadonlyArray, - depth: 0 - ): U[]; - - /** - * Returns a new array with all sub-array elements concatenated into it recursively up to the - * specified depth. If no depth is provided, flat method defaults to the depth of 1. - * - * @param depth The maximum recursion depth - */ - flat(depth?: number): any[]; -} - -interface Array { - - /** - * Calls a defined callback function on each element of an array. Then, flattens the result into - * a new array. - * This is identical to a map followed by flat with depth 1. - * - * @param callback A function that accepts up to three arguments. The flatMap method calls the - * callback function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callback function. If - * thisArg is omitted, undefined is used as the this value. - */ - flatMap ( - callback: (this: This, value: T, index: number, array: T[]) => U | ReadonlyArray, - thisArg?: This - ): U[] - - /** - * Returns a new array with all sub-array elements concatenated into it recursively up to the - * specified depth. - * - * @param depth The maximum recursion depth - */ - flat(this: U[][][][][][][][], depth: 7): U[]; - - /** - * Returns a new array with all sub-array elements concatenated into it recursively up to the - * specified depth. - * - * @param depth The maximum recursion depth - */ - flat(this: U[][][][][][][], depth: 6): U[]; - - /** - * Returns a new array with all sub-array elements concatenated into it recursively up to the - * specified depth. - * - * @param depth The maximum recursion depth - */ - flat(this: U[][][][][][], depth: 5): U[]; - - /** - * Returns a new array with all sub-array elements concatenated into it recursively up to the - * specified depth. - * - * @param depth The maximum recursion depth - */ - flat(this: U[][][][][], depth: 4): U[]; - - /** - * Returns a new array with all sub-array elements concatenated into it recursively up to the - * specified depth. - * - * @param depth The maximum recursion depth - */ - flat(this: U[][][][], depth: 3): U[]; - - /** - * Returns a new array with all sub-array elements concatenated into it recursively up to the - * specified depth. - * - * @param depth The maximum recursion depth - */ - flat(this: U[][][], depth: 2): U[]; - - /** - * Returns a new array with all sub-array elements concatenated into it recursively up to the - * specified depth. - * - * @param depth The maximum recursion depth - */ - flat(this: U[][], depth?: 1): U[]; - - /** - * Returns a new array with all sub-array elements concatenated into it recursively up to the - * specified depth. - * - * @param depth The maximum recursion depth - */ - flat(this: U[], depth: 0): U[]; - - /** - * Returns a new array with all sub-array elements concatenated into it recursively up to the - * specified depth. If no depth is provided, flat method defaults to the depth of 1. - * - * @param depth The maximum recursion depth - */ - flat(depth?: number): any[]; -} +/// + + +interface ReadonlyArray { + + /** + * Calls a defined callback function on each element of an array. Then, flattens the result into + * a new array. + * This is identical to a map followed by flat with depth 1. + * + * @param callback A function that accepts up to three arguments. The flatMap method calls the + * callback function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callback function. If + * thisArg is omitted, undefined is used as the this value. + */ + flatMap ( + callback: (this: This, value: T, index: number, array: T[]) => U | ReadonlyArray, + thisArg?: This + ): U[] + + + /** + * Returns a new array with all sub-array elements concatenated into it recursively up to the + * specified depth. + * + * @param depth The maximum recursion depth + */ + flat(this: + ReadonlyArray | + + ReadonlyArray> | + ReadonlyArray[]> | + ReadonlyArray[][]> | + ReadonlyArray[][][]> | + + ReadonlyArray>> | + ReadonlyArray[][]>> | + ReadonlyArray>[][]> | + ReadonlyArray[]>[]> | + ReadonlyArray>[]> | + ReadonlyArray[]>> | + + ReadonlyArray>>> | + ReadonlyArray[]>>> | + ReadonlyArray>[]>> | + ReadonlyArray>>[]> | + + ReadonlyArray>>>>, + depth: 4): U[]; + + /** + * Returns a new array with all sub-array elements concatenated into it recursively up to the + * specified depth. + * + * @param depth The maximum recursion depth + */ + flat(this: + ReadonlyArray | + + ReadonlyArray[][]> | + ReadonlyArray[]> | + ReadonlyArray> | + + ReadonlyArray>> | + ReadonlyArray[]>> | + ReadonlyArray>[]> | + + ReadonlyArray>>>, + depth: 3): U[]; + + /** + * Returns a new array with all sub-array elements concatenated into it recursively up to the + * specified depth. + * + * @param depth The maximum recursion depth + */ + flat(this: + ReadonlyArray | + + ReadonlyArray> | + ReadonlyArray[]> | + + ReadonlyArray>>, + depth: 2): U[]; + + /** + * Returns a new array with all sub-array elements concatenated into it recursively up to the + * specified depth. + * + * @param depth The maximum recursion depth + */ + flat(this: + ReadonlyArray | + ReadonlyArray>, + depth?: 1 + ): U[]; + + /** + * Returns a new array with all sub-array elements concatenated into it recursively up to the + * specified depth. + * + * @param depth The maximum recursion depth + */ + flat(this: + ReadonlyArray, + depth: 0 + ): U[]; + + /** + * Returns a new array with all sub-array elements concatenated into it recursively up to the + * specified depth. If no depth is provided, flat method defaults to the depth of 1. + * + * @param depth The maximum recursion depth + */ + flat(depth?: number): any[]; +} + +interface Array { + + /** + * Calls a defined callback function on each element of an array. Then, flattens the result into + * a new array. + * This is identical to a map followed by flat with depth 1. + * + * @param callback A function that accepts up to three arguments. The flatMap method calls the + * callback function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callback function. If + * thisArg is omitted, undefined is used as the this value. + */ + flatMap ( + callback: (this: This, value: T, index: number, array: T[]) => U | ReadonlyArray, + thisArg?: This + ): U[] + + /** + * Returns a new array with all sub-array elements concatenated into it recursively up to the + * specified depth. + * + * @param depth The maximum recursion depth + */ + flat(this: U[][][][][][][][], depth: 7): U[]; + + /** + * Returns a new array with all sub-array elements concatenated into it recursively up to the + * specified depth. + * + * @param depth The maximum recursion depth + */ + flat(this: U[][][][][][][], depth: 6): U[]; + + /** + * Returns a new array with all sub-array elements concatenated into it recursively up to the + * specified depth. + * + * @param depth The maximum recursion depth + */ + flat(this: U[][][][][][], depth: 5): U[]; + + /** + * Returns a new array with all sub-array elements concatenated into it recursively up to the + * specified depth. + * + * @param depth The maximum recursion depth + */ + flat(this: U[][][][][], depth: 4): U[]; + + /** + * Returns a new array with all sub-array elements concatenated into it recursively up to the + * specified depth. + * + * @param depth The maximum recursion depth + */ + flat(this: U[][][][], depth: 3): U[]; + + /** + * Returns a new array with all sub-array elements concatenated into it recursively up to the + * specified depth. + * + * @param depth The maximum recursion depth + */ + flat(this: U[][][], depth: 2): U[]; + + /** + * Returns a new array with all sub-array elements concatenated into it recursively up to the + * specified depth. + * + * @param depth The maximum recursion depth + */ + flat(this: U[][], depth?: 1): U[]; + + /** + * Returns a new array with all sub-array elements concatenated into it recursively up to the + * specified depth. + * + * @param depth The maximum recursion depth + */ + flat(this: U[], depth: 0): U[]; + + /** + * Returns a new array with all sub-array elements concatenated into it recursively up to the + * specified depth. If no depth is provided, flat method defaults to the depth of 1. + * + * @param depth The maximum recursion depth + */ + flat(depth?: number): any[]; +} diff --git a/node_modules/typescript/lib/lib.es2019.d.ts b/node_modules/typescript/lib/lib.es2019.d.ts index 14a547afb..ed25656d3 100644 --- a/node_modules/typescript/lib/lib.es2019.d.ts +++ b/node_modules/typescript/lib/lib.es2019.d.ts @@ -15,11 +15,11 @@ and limitations under the License. -/// +/// -/// -/// -/// -/// -/// +/// +/// +/// +/// +/// diff --git a/node_modules/typescript/lib/lib.es2019.full.d.ts b/node_modules/typescript/lib/lib.es2019.full.d.ts index ee095676f..ecbd2e6c8 100644 --- a/node_modules/typescript/lib/lib.es2019.full.d.ts +++ b/node_modules/typescript/lib/lib.es2019.full.d.ts @@ -15,11 +15,11 @@ and limitations under the License. -/// +/// -/// -/// -/// -/// -/// +/// +/// +/// +/// +/// diff --git a/node_modules/typescript/lib/lib.es2019.object.d.ts b/node_modules/typescript/lib/lib.es2019.object.d.ts index 9b26b6709..063947146 100644 --- a/node_modules/typescript/lib/lib.es2019.object.d.ts +++ b/node_modules/typescript/lib/lib.es2019.object.d.ts @@ -15,21 +15,21 @@ and limitations under the License. -/// +/// -/// - -interface ObjectConstructor { - /** - * Returns an object created by key-value entries for properties and methods - * @param entries An iterable object that contains key-value entries for properties and methods. - */ - fromEntries(entries: Iterable): { [k in PropertyKey]: T }; - - /** - * Returns an object created by key-value entries for properties and methods - * @param entries An iterable object that contains key-value entries for properties and methods. - */ - fromEntries(entries: Iterable): any; -} +/// + +interface ObjectConstructor { + /** + * Returns an object created by key-value entries for properties and methods + * @param entries An iterable object that contains key-value entries for properties and methods. + */ + fromEntries(entries: Iterable): { [k in PropertyKey]: T }; + + /** + * Returns an object created by key-value entries for properties and methods + * @param entries An iterable object that contains key-value entries for properties and methods. + */ + fromEntries(entries: Iterable): any; +} diff --git a/node_modules/typescript/lib/lib.es2019.string.d.ts b/node_modules/typescript/lib/lib.es2019.string.d.ts index a5a9dc692..6208074c2 100644 --- a/node_modules/typescript/lib/lib.es2019.string.d.ts +++ b/node_modules/typescript/lib/lib.es2019.string.d.ts @@ -15,19 +15,19 @@ and limitations under the License. -/// - - -interface String { - /** Removes the trailing white space and line terminator characters from a string. */ - trimEnd(): string; - - /** Removes the leading white space and line terminator characters from a string. */ - trimStart(): string; - - /** Removes the leading white space and line terminator characters from a string. */ - trimLeft(): string; - - /** Removes the trailing white space and line terminator characters from a string. */ - trimRight(): string; -} +/// + + +interface String { + /** Removes the trailing white space and line terminator characters from a string. */ + trimEnd(): string; + + /** Removes the leading white space and line terminator characters from a string. */ + trimStart(): string; + + /** Removes the leading white space and line terminator characters from a string. */ + trimLeft(): string; + + /** Removes the trailing white space and line terminator characters from a string. */ + trimRight(): string; +} diff --git a/node_modules/typescript/lib/lib.es2019.symbol.d.ts b/node_modules/typescript/lib/lib.es2019.symbol.d.ts index 98293eaf5..05bd9ba12 100644 --- a/node_modules/typescript/lib/lib.es2019.symbol.d.ts +++ b/node_modules/typescript/lib/lib.es2019.symbol.d.ts @@ -15,12 +15,12 @@ and limitations under the License. -/// +/// -interface Symbol { - /** - * expose the [[Description]] internal slot of a symbol directly - */ - readonly description: string; -} +interface Symbol { + /** + * expose the [[Description]] internal slot of a symbol directly + */ + readonly description: string; +} diff --git a/node_modules/typescript/lib/lib.es2020.d.ts b/node_modules/typescript/lib/lib.es2020.d.ts index f0b49c8a7..8d69f42a7 100644 --- a/node_modules/typescript/lib/lib.es2020.d.ts +++ b/node_modules/typescript/lib/lib.es2020.d.ts @@ -15,9 +15,9 @@ and limitations under the License. -/// +/// -/// -/// -/// +/// +/// +/// diff --git a/node_modules/typescript/lib/lib.es2020.full.d.ts b/node_modules/typescript/lib/lib.es2020.full.d.ts index 7ffe939cd..58b1b8a65 100644 --- a/node_modules/typescript/lib/lib.es2020.full.d.ts +++ b/node_modules/typescript/lib/lib.es2020.full.d.ts @@ -15,11 +15,11 @@ and limitations under the License. -/// +/// -/// -/// -/// -/// -/// +/// +/// +/// +/// +/// diff --git a/node_modules/typescript/lib/lib.es2020.string.d.ts b/node_modules/typescript/lib/lib.es2020.string.d.ts index 146786641..b6a2576b5 100644 --- a/node_modules/typescript/lib/lib.es2020.string.d.ts +++ b/node_modules/typescript/lib/lib.es2020.string.d.ts @@ -15,16 +15,16 @@ and limitations under the License. -/// +/// -/// - -interface String { - /** - * Matches a string with a regular expression, and returns an iterable of matches - * containing the results of that search. - * @param regexp A variable name or string literal containing the regular expression pattern and flags. - */ - matchAll(regexp: RegExp): IterableIterator; -} +/// + +interface String { + /** + * Matches a string with a regular expression, and returns an iterable of matches + * containing the results of that search. + * @param regexp A variable name or string literal containing the regular expression pattern and flags. + */ + matchAll(regexp: RegExp): IterableIterator; +} diff --git a/node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts b/node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts index 599d62d24..2cd1e7279 100644 --- a/node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts +++ b/node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts @@ -15,25 +15,25 @@ and limitations under the License. -/// +/// -/// -/// - -interface SymbolConstructor { - /** - * A regular expression method that matches the regular expression against a string. Called - * by the String.prototype.matchAll method. - */ - readonly matchAll: symbol; -} - -interface RegExp { - /** - * Matches a string with this regular expression, and returns an iterable of matches - * containing the results of that search. - * @param string A string to search within. - */ - [Symbol.matchAll](str: string): IterableIterator; -} +/// +/// + +interface SymbolConstructor { + /** + * A regular expression method that matches the regular expression against a string. Called + * by the String.prototype.matchAll method. + */ + readonly matchAll: symbol; +} + +interface RegExp { + /** + * Matches a string with this regular expression, and returns an iterable of matches + * containing the results of that search. + * @param string A string to search within. + */ + [Symbol.matchAll](str: string): IterableIterator; +} diff --git a/node_modules/typescript/lib/lib.es5.d.ts b/node_modules/typescript/lib/lib.es5.d.ts index a9b9f5b0a..541fcf0bf 100644 --- a/node_modules/typescript/lib/lib.es5.d.ts +++ b/node_modules/typescript/lib/lib.es5.d.ts @@ -15,4342 +15,4342 @@ and limitations under the License. -/// - - -///////////////////////////// -/// ECMAScript APIs -///////////////////////////// - -declare var NaN: number; -declare var Infinity: number; - -/** - * Evaluates JavaScript code and executes it. - * @param x A String value that contains valid JavaScript code. - */ -declare function eval(x: string): any; - -/** - * Converts a string to an integer. - * @param s A string to convert into a number. - * @param radix A value between 2 and 36 that specifies the base of the number in numString. - * If this argument is not supplied, strings with a prefix of '0x' are considered hexadecimal. - * All other strings are considered decimal. - */ -declare function parseInt(s: string, radix?: number): number; - -/** - * Converts a string to a floating-point number. - * @param string A string that contains a floating-point number. - */ -declare function parseFloat(string: string): number; - -/** - * Returns a Boolean value that indicates whether a value is the reserved value NaN (not a number). - * @param number A numeric value. - */ -declare function isNaN(number: number): boolean; - -/** - * Determines whether a supplied number is finite. - * @param number Any numeric value. - */ -declare function isFinite(number: number): boolean; - -/** - * Gets the unencoded version of an encoded Uniform Resource Identifier (URI). - * @param encodedURI A value representing an encoded URI. - */ -declare function decodeURI(encodedURI: string): string; - -/** - * Gets the unencoded version of an encoded component of a Uniform Resource Identifier (URI). - * @param encodedURIComponent A value representing an encoded URI component. - */ -declare function decodeURIComponent(encodedURIComponent: string): string; - -/** - * Encodes a text string as a valid Uniform Resource Identifier (URI) - * @param uri A value representing an encoded URI. - */ -declare function encodeURI(uri: string): string; - -/** - * Encodes a text string as a valid component of a Uniform Resource Identifier (URI). - * @param uriComponent A value representing an encoded URI component. - */ -declare function encodeURIComponent(uriComponent: string | number | boolean): string; - -/** - * Computes a new string in which certain characters have been replaced by a hexadecimal escape sequence. - * @param string A string value - */ -declare function escape(string: string): string; - -/** - * Computes a new string in which hexadecimal escape sequences are replaced with the character that it represents. - * @param string A string value - */ -declare function unescape(string: string): string; - -interface Symbol { - /** Returns a string representation of an object. */ - toString(): string; - - /** Returns the primitive value of the specified object. */ - valueOf(): symbol; -} - -declare type PropertyKey = string | number | symbol; - -interface PropertyDescriptor { - configurable?: boolean; - enumerable?: boolean; - value?: any; - writable?: boolean; - get?(): any; - set?(v: any): void; -} - -interface PropertyDescriptorMap { - [s: string]: PropertyDescriptor; -} - -interface Object { - /** The initial value of Object.prototype.constructor is the standard built-in Object constructor. */ - constructor: Function; - - /** Returns a string representation of an object. */ - toString(): string; - - /** Returns a date converted to a string using the current locale. */ - toLocaleString(): string; - - /** Returns the primitive value of the specified object. */ - valueOf(): Object; - - /** - * Determines whether an object has a property with the specified name. - * @param v A property name. - */ - hasOwnProperty(v: PropertyKey): boolean; - - /** - * Determines whether an object exists in another object's prototype chain. - * @param v Another object whose prototype chain is to be checked. - */ - isPrototypeOf(v: Object): boolean; - - /** - * Determines whether a specified property is enumerable. - * @param v A property name. - */ - propertyIsEnumerable(v: PropertyKey): boolean; -} - -interface ObjectConstructor { - new(value?: any): Object; - (): any; - (value: any): any; - - /** A reference to the prototype for a class of objects. */ - readonly prototype: Object; - - /** - * Returns the prototype of an object. - * @param o The object that references the prototype. - */ - getPrototypeOf(o: any): any; - - /** - * Gets the own property descriptor of the specified object. - * An own property descriptor is one that is defined directly on the object and is not inherited from the object's prototype. - * @param o Object that contains the property. - * @param p Name of the property. - */ - getOwnPropertyDescriptor(o: any, p: PropertyKey): PropertyDescriptor | undefined; - - /** - * Returns the names of the own properties of an object. The own properties of an object are those that are defined directly - * on that object, and are not inherited from the object's prototype. The properties of an object include both fields (objects) and functions. - * @param o Object that contains the own properties. - */ - getOwnPropertyNames(o: any): string[]; - - /** - * Creates an object that has the specified prototype or that has null prototype. - * @param o Object to use as a prototype. May be null. - */ - create(o: object | null): any; - - /** - * Creates an object that has the specified prototype, and that optionally contains specified properties. - * @param o Object to use as a prototype. May be null - * @param properties JavaScript object that contains one or more property descriptors. - */ - create(o: object | null, properties: PropertyDescriptorMap & ThisType): any; - - /** - * Adds a property to an object, or modifies attributes of an existing property. - * @param o Object on which to add or modify the property. This can be a native JavaScript object (that is, a user-defined object or a built in object) or a DOM object. - * @param p The property name. - * @param attributes Descriptor for the property. It can be for a data property or an accessor property. - */ - defineProperty(o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType): any; - - /** - * Adds one or more properties to an object, and/or modifies attributes of existing properties. - * @param o Object on which to add or modify the properties. This can be a native JavaScript object or a DOM object. - * @param properties JavaScript object that contains one or more descriptor objects. Each descriptor object describes a data property or an accessor property. - */ - defineProperties(o: any, properties: PropertyDescriptorMap & ThisType): any; - - /** - * Prevents the modification of attributes of existing properties, and prevents the addition of new properties. - * @param o Object on which to lock the attributes. - */ - seal(o: T): T; - - /** - * Prevents the modification of existing property attributes and values, and prevents the addition of new properties. - * @param o Object on which to lock the attributes. - */ - freeze(a: T[]): readonly T[]; - - /** - * Prevents the modification of existing property attributes and values, and prevents the addition of new properties. - * @param o Object on which to lock the attributes. - */ - freeze(f: T): T; - - /** - * Prevents the modification of existing property attributes and values, and prevents the addition of new properties. - * @param o Object on which to lock the attributes. - */ - freeze(o: T): Readonly; - - /** - * Prevents the addition of new properties to an object. - * @param o Object to make non-extensible. - */ - preventExtensions(o: T): T; - - /** - * Returns true if existing property attributes cannot be modified in an object and new properties cannot be added to the object. - * @param o Object to test. - */ - isSealed(o: any): boolean; - - /** - * Returns true if existing property attributes and values cannot be modified in an object, and new properties cannot be added to the object. - * @param o Object to test. - */ - isFrozen(o: any): boolean; - - /** - * Returns a value that indicates whether new properties can be added to an object. - * @param o Object to test. - */ - isExtensible(o: any): boolean; - - /** - * Returns the names of the enumerable string properties and methods of an object. - * @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object. - */ - keys(o: object): string[]; -} - -/** - * Provides functionality common to all JavaScript objects. - */ -declare var Object: ObjectConstructor; - -/** - * Creates a new function. - */ -interface Function { - /** - * Calls the function, substituting the specified object for the this value of the function, and the specified array for the arguments of the function. - * @param thisArg The object to be used as the this object. - * @param argArray A set of arguments to be passed to the function. - */ - apply(this: Function, thisArg: any, argArray?: any): any; - - /** - * Calls a method of an object, substituting another object for the current object. - * @param thisArg The object to be used as the current object. - * @param argArray A list of arguments to be passed to the method. - */ - call(this: Function, thisArg: any, ...argArray: any[]): any; - - /** - * For a given function, creates a bound function that has the same body as the original function. - * The this object of the bound function is associated with the specified object, and has the specified initial parameters. - * @param thisArg An object to which the this keyword can refer inside the new function. - * @param argArray A list of arguments to be passed to the new function. - */ - bind(this: Function, thisArg: any, ...argArray: any[]): any; - - /** Returns a string representation of a function. */ - toString(): string; - - prototype: any; - readonly length: number; - - // Non-standard extensions - arguments: any; - caller: Function; -} - -interface FunctionConstructor { - /** - * Creates a new function. - * @param args A list of arguments the function accepts. - */ - new(...args: string[]): Function; - (...args: string[]): Function; - readonly prototype: Function; -} - -declare var Function: FunctionConstructor; - -/** - * Extracts the type of the 'this' parameter of a function type, or 'unknown' if the function type has no 'this' parameter. - */ -type ThisParameterType = T extends (this: unknown, ...args: any[]) => any ? unknown : T extends (this: infer U, ...args: any[]) => any ? U : unknown; - -/** - * Removes the 'this' parameter from a function type. - */ -type OmitThisParameter = unknown extends ThisParameterType ? T : T extends (...args: infer A) => infer R ? (...args: A) => R : T; - -interface CallableFunction extends Function { - /** - * Calls the function with the specified object as the this value and the elements of specified array as the arguments. - * @param thisArg The object to be used as the this object. - * @param args An array of argument values to be passed to the function. - */ - apply(this: (this: T) => R, thisArg: T): R; - apply(this: (this: T, ...args: A) => R, thisArg: T, args: A): R; - - /** - * Calls the function with the specified object as the this value and the specified rest arguments as the arguments. - * @param thisArg The object to be used as the this object. - * @param args Argument values to be passed to the function. - */ - call(this: (this: T, ...args: A) => R, thisArg: T, ...args: A): R; - - /** - * For a given function, creates a bound function that has the same body as the original function. - * The this object of the bound function is associated with the specified object, and has the specified initial parameters. - * @param thisArg The object to be used as the this object. - * @param args Arguments to bind to the parameters of the function. - */ - bind(this: T, thisArg: ThisParameterType): OmitThisParameter; - bind(this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; - bind(this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; - bind(this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; - bind(this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; - bind(this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; -} - -interface NewableFunction extends Function { - /** - * Calls the function with the specified object as the this value and the elements of specified array as the arguments. - * @param thisArg The object to be used as the this object. - * @param args An array of argument values to be passed to the function. - */ - apply(this: new () => T, thisArg: T): void; - apply(this: new (...args: A) => T, thisArg: T, args: A): void; - - /** - * Calls the function with the specified object as the this value and the specified rest arguments as the arguments. - * @param thisArg The object to be used as the this object. - * @param args Argument values to be passed to the function. - */ - call(this: new (...args: A) => T, thisArg: T, ...args: A): void; - - /** - * For a given function, creates a bound function that has the same body as the original function. - * The this object of the bound function is associated with the specified object, and has the specified initial parameters. - * @param thisArg The object to be used as the this object. - * @param args Arguments to bind to the parameters of the function. - */ - bind(this: T, thisArg: any): T; - bind(this: new (arg0: A0, ...args: A) => R, thisArg: any, arg0: A0): new (...args: A) => R; - bind(this: new (arg0: A0, arg1: A1, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1): new (...args: A) => R; - bind(this: new (arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2): new (...args: A) => R; - bind(this: new (arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2, arg3: A3): new (...args: A) => R; - bind(this: new (...args: AX[]) => R, thisArg: any, ...args: AX[]): new (...args: AX[]) => R; -} - -interface IArguments { - [index: number]: any; - length: number; - callee: Function; -} - -interface String { - /** Returns a string representation of a string. */ - toString(): string; - - /** - * Returns the character at the specified index. - * @param pos The zero-based index of the desired character. - */ - charAt(pos: number): string; - - /** - * Returns the Unicode value of the character at the specified location. - * @param index The zero-based index of the desired character. If there is no character at the specified index, NaN is returned. - */ - charCodeAt(index: number): number; - - /** - * Returns a string that contains the concatenation of two or more strings. - * @param strings The strings to append to the end of the string. - */ - concat(...strings: string[]): string; - - /** - * Returns the position of the first occurrence of a substring. - * @param searchString The substring to search for in the string - * @param position The index at which to begin searching the String object. If omitted, search starts at the beginning of the string. - */ - indexOf(searchString: string, position?: number): number; - - /** - * Returns the last occurrence of a substring in the string. - * @param searchString The substring to search for. - * @param position The index at which to begin searching. If omitted, the search begins at the end of the string. - */ - lastIndexOf(searchString: string, position?: number): number; - - /** - * Determines whether two strings are equivalent in the current locale. - * @param that String to compare to target string - */ - localeCompare(that: string): number; - - /** - * Matches a string with a regular expression, and returns an array containing the results of that search. - * @param regexp A variable name or string literal containing the regular expression pattern and flags. - */ - match(regexp: string | RegExp): RegExpMatchArray | null; - - /** - * Replaces text in a string, using a regular expression or search string. - * @param searchValue A string to search for. - * @param replaceValue A string containing the text to replace for every successful match of searchValue in this string. - */ - replace(searchValue: string | RegExp, replaceValue: string): string; - - /** - * Replaces text in a string, using a regular expression or search string. - * @param searchValue A string to search for. - * @param replacer A function that returns the replacement text. - */ - replace(searchValue: string | RegExp, replacer: (substring: string, ...args: any[]) => string): string; - - /** - * Finds the first substring match in a regular expression search. - * @param regexp The regular expression pattern and applicable flags. - */ - search(regexp: string | RegExp): number; - - /** - * Returns a section of a string. - * @param start The index to the beginning of the specified portion of stringObj. - * @param end The index to the end of the specified portion of stringObj. The substring includes the characters up to, but not including, the character indicated by end. - * If this value is not specified, the substring continues to the end of stringObj. - */ - slice(start?: number, end?: number): string; - - /** - * Split a string into substrings using the specified separator and return them as an array. - * @param separator A string that identifies character or characters to use in separating the string. If omitted, a single-element array containing the entire string is returned. - * @param limit A value used to limit the number of elements returned in the array. - */ - split(separator: string | RegExp, limit?: number): string[]; - - /** - * Returns the substring at the specified location within a String object. - * @param start The zero-based index number indicating the beginning of the substring. - * @param end Zero-based index number indicating the end of the substring. The substring includes the characters up to, but not including, the character indicated by end. - * If end is omitted, the characters from start through the end of the original string are returned. - */ - substring(start: number, end?: number): string; - - /** Converts all the alphabetic characters in a string to lowercase. */ - toLowerCase(): string; - - /** Converts all alphabetic characters to lowercase, taking into account the host environment's current locale. */ - toLocaleLowerCase(locales?: string | string[]): string; - - /** Converts all the alphabetic characters in a string to uppercase. */ - toUpperCase(): string; - - /** Returns a string where all alphabetic characters have been converted to uppercase, taking into account the host environment's current locale. */ - toLocaleUpperCase(locales?: string | string[]): string; - - /** Removes the leading and trailing white space and line terminator characters from a string. */ - trim(): string; - - /** Returns the length of a String object. */ - readonly length: number; - - // IE extensions - /** - * Gets a substring beginning at the specified location and having the specified length. - * @param from The starting position of the desired substring. The index of the first character in the string is zero. - * @param length The number of characters to include in the returned substring. - */ - substr(from: number, length?: number): string; - - /** Returns the primitive value of the specified object. */ - valueOf(): string; - - readonly [index: number]: string; -} - -interface StringConstructor { - new(value?: any): String; - (value?: any): string; - readonly prototype: String; - fromCharCode(...codes: number[]): string; -} - -/** - * Allows manipulation and formatting of text strings and determination and location of substrings within strings. - */ -declare var String: StringConstructor; - -interface Boolean { - /** Returns the primitive value of the specified object. */ - valueOf(): boolean; -} - -interface BooleanConstructor { - new(value?: any): Boolean; - (value?: T): boolean; - readonly prototype: Boolean; -} - -declare var Boolean: BooleanConstructor; - -interface Number { - /** - * Returns a string representation of an object. - * @param radix Specifies a radix for converting numeric values to strings. This value is only used for numbers. - */ - toString(radix?: number): string; - - /** - * Returns a string representing a number in fixed-point notation. - * @param fractionDigits Number of digits after the decimal point. Must be in the range 0 - 20, inclusive. - */ - toFixed(fractionDigits?: number): string; - - /** - * Returns a string containing a number represented in exponential notation. - * @param fractionDigits Number of digits after the decimal point. Must be in the range 0 - 20, inclusive. - */ - toExponential(fractionDigits?: number): string; - - /** - * Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits. - * @param precision Number of significant digits. Must be in the range 1 - 21, inclusive. - */ - toPrecision(precision?: number): string; - - /** Returns the primitive value of the specified object. */ - valueOf(): number; -} - -interface NumberConstructor { - new(value?: any): Number; - (value?: any): number; - readonly prototype: Number; - - /** The largest number that can be represented in JavaScript. Equal to approximately 1.79E+308. */ - readonly MAX_VALUE: number; - - /** The closest number to zero that can be represented in JavaScript. Equal to approximately 5.00E-324. */ - readonly MIN_VALUE: number; - - /** - * A value that is not a number. - * In equality comparisons, NaN does not equal any value, including itself. To test whether a value is equivalent to NaN, use the isNaN function. - */ - readonly NaN: number; - - /** - * A value that is less than the largest negative number that can be represented in JavaScript. - * JavaScript displays NEGATIVE_INFINITY values as -infinity. - */ - readonly NEGATIVE_INFINITY: number; - - /** - * A value greater than the largest number that can be represented in JavaScript. - * JavaScript displays POSITIVE_INFINITY values as infinity. - */ - readonly POSITIVE_INFINITY: number; -} - -/** An object that represents a number of any kind. All JavaScript numbers are 64-bit floating-point numbers. */ -declare var Number: NumberConstructor; - -interface TemplateStringsArray extends ReadonlyArray { - readonly raw: readonly string[]; -} - -/** - * The type of `import.meta`. - * - * If you need to declare that a given property exists on `import.meta`, - * this type may be augmented via interface merging. - */ -interface ImportMeta { -} - -interface Math { - /** The mathematical constant e. This is Euler's number, the base of natural logarithms. */ - readonly E: number; - /** The natural logarithm of 10. */ - readonly LN10: number; - /** The natural logarithm of 2. */ - readonly LN2: number; - /** The base-2 logarithm of e. */ - readonly LOG2E: number; - /** The base-10 logarithm of e. */ - readonly LOG10E: number; - /** Pi. This is the ratio of the circumference of a circle to its diameter. */ - readonly PI: number; - /** The square root of 0.5, or, equivalently, one divided by the square root of 2. */ - readonly SQRT1_2: number; - /** The square root of 2. */ - readonly SQRT2: number; - /** - * Returns the absolute value of a number (the value without regard to whether it is positive or negative). - * For example, the absolute value of -5 is the same as the absolute value of 5. - * @param x A numeric expression for which the absolute value is needed. - */ - abs(x: number): number; - /** - * Returns the arc cosine (or inverse cosine) of a number. - * @param x A numeric expression. - */ - acos(x: number): number; - /** - * Returns the arcsine of a number. - * @param x A numeric expression. - */ - asin(x: number): number; - /** - * Returns the arctangent of a number. - * @param x A numeric expression for which the arctangent is needed. - */ - atan(x: number): number; - /** - * Returns the angle (in radians) from the X axis to a point. - * @param y A numeric expression representing the cartesian y-coordinate. - * @param x A numeric expression representing the cartesian x-coordinate. - */ - atan2(y: number, x: number): number; - /** - * Returns the smallest integer greater than or equal to its numeric argument. - * @param x A numeric expression. - */ - ceil(x: number): number; - /** - * Returns the cosine of a number. - * @param x A numeric expression that contains an angle measured in radians. - */ - cos(x: number): number; - /** - * Returns e (the base of natural logarithms) raised to a power. - * @param x A numeric expression representing the power of e. - */ - exp(x: number): number; - /** - * Returns the greatest integer less than or equal to its numeric argument. - * @param x A numeric expression. - */ - floor(x: number): number; - /** - * Returns the natural logarithm (base e) of a number. - * @param x A numeric expression. - */ - log(x: number): number; - /** - * Returns the larger of a set of supplied numeric expressions. - * @param values Numeric expressions to be evaluated. - */ - max(...values: number[]): number; - /** - * Returns the smaller of a set of supplied numeric expressions. - * @param values Numeric expressions to be evaluated. - */ - min(...values: number[]): number; - /** - * Returns the value of a base expression taken to a specified power. - * @param x The base value of the expression. - * @param y The exponent value of the expression. - */ - pow(x: number, y: number): number; - /** Returns a pseudorandom number between 0 and 1. */ - random(): number; - /** - * Returns a supplied numeric expression rounded to the nearest integer. - * @param x The value to be rounded to the nearest integer. - */ - round(x: number): number; - /** - * Returns the sine of a number. - * @param x A numeric expression that contains an angle measured in radians. - */ - sin(x: number): number; - /** - * Returns the square root of a number. - * @param x A numeric expression. - */ - sqrt(x: number): number; - /** - * Returns the tangent of a number. - * @param x A numeric expression that contains an angle measured in radians. - */ - tan(x: number): number; -} -/** An intrinsic object that provides basic mathematics functionality and constants. */ -declare var Math: Math; - -/** Enables basic storage and retrieval of dates and times. */ -interface Date { - /** Returns a string representation of a date. The format of the string depends on the locale. */ - toString(): string; - /** Returns a date as a string value. */ - toDateString(): string; - /** Returns a time as a string value. */ - toTimeString(): string; - /** Returns a value as a string value appropriate to the host environment's current locale. */ - toLocaleString(): string; - /** Returns a date as a string value appropriate to the host environment's current locale. */ - toLocaleDateString(): string; - /** Returns a time as a string value appropriate to the host environment's current locale. */ - toLocaleTimeString(): string; - /** Returns the stored time value in milliseconds since midnight, January 1, 1970 UTC. */ - valueOf(): number; - /** Gets the time value in milliseconds. */ - getTime(): number; - /** Gets the year, using local time. */ - getFullYear(): number; - /** Gets the year using Universal Coordinated Time (UTC). */ - getUTCFullYear(): number; - /** Gets the month, using local time. */ - getMonth(): number; - /** Gets the month of a Date object using Universal Coordinated Time (UTC). */ - getUTCMonth(): number; - /** Gets the day-of-the-month, using local time. */ - getDate(): number; - /** Gets the day-of-the-month, using Universal Coordinated Time (UTC). */ - getUTCDate(): number; - /** Gets the day of the week, using local time. */ - getDay(): number; - /** Gets the day of the week using Universal Coordinated Time (UTC). */ - getUTCDay(): number; - /** Gets the hours in a date, using local time. */ - getHours(): number; - /** Gets the hours value in a Date object using Universal Coordinated Time (UTC). */ - getUTCHours(): number; - /** Gets the minutes of a Date object, using local time. */ - getMinutes(): number; - /** Gets the minutes of a Date object using Universal Coordinated Time (UTC). */ - getUTCMinutes(): number; - /** Gets the seconds of a Date object, using local time. */ - getSeconds(): number; - /** Gets the seconds of a Date object using Universal Coordinated Time (UTC). */ - getUTCSeconds(): number; - /** Gets the milliseconds of a Date, using local time. */ - getMilliseconds(): number; - /** Gets the milliseconds of a Date object using Universal Coordinated Time (UTC). */ - getUTCMilliseconds(): number; - /** Gets the difference in minutes between the time on the local computer and Universal Coordinated Time (UTC). */ - getTimezoneOffset(): number; - /** - * Sets the date and time value in the Date object. - * @param time A numeric value representing the number of elapsed milliseconds since midnight, January 1, 1970 GMT. - */ - setTime(time: number): number; - /** - * Sets the milliseconds value in the Date object using local time. - * @param ms A numeric value equal to the millisecond value. - */ - setMilliseconds(ms: number): number; - /** - * Sets the milliseconds value in the Date object using Universal Coordinated Time (UTC). - * @param ms A numeric value equal to the millisecond value. - */ - setUTCMilliseconds(ms: number): number; - - /** - * Sets the seconds value in the Date object using local time. - * @param sec A numeric value equal to the seconds value. - * @param ms A numeric value equal to the milliseconds value. - */ - setSeconds(sec: number, ms?: number): number; - /** - * Sets the seconds value in the Date object using Universal Coordinated Time (UTC). - * @param sec A numeric value equal to the seconds value. - * @param ms A numeric value equal to the milliseconds value. - */ - setUTCSeconds(sec: number, ms?: number): number; - /** - * Sets the minutes value in the Date object using local time. - * @param min A numeric value equal to the minutes value. - * @param sec A numeric value equal to the seconds value. - * @param ms A numeric value equal to the milliseconds value. - */ - setMinutes(min: number, sec?: number, ms?: number): number; - /** - * Sets the minutes value in the Date object using Universal Coordinated Time (UTC). - * @param min A numeric value equal to the minutes value. - * @param sec A numeric value equal to the seconds value. - * @param ms A numeric value equal to the milliseconds value. - */ - setUTCMinutes(min: number, sec?: number, ms?: number): number; - /** - * Sets the hour value in the Date object using local time. - * @param hours A numeric value equal to the hours value. - * @param min A numeric value equal to the minutes value. - * @param sec A numeric value equal to the seconds value. - * @param ms A numeric value equal to the milliseconds value. - */ - setHours(hours: number, min?: number, sec?: number, ms?: number): number; - /** - * Sets the hours value in the Date object using Universal Coordinated Time (UTC). - * @param hours A numeric value equal to the hours value. - * @param min A numeric value equal to the minutes value. - * @param sec A numeric value equal to the seconds value. - * @param ms A numeric value equal to the milliseconds value. - */ - setUTCHours(hours: number, min?: number, sec?: number, ms?: number): number; - /** - * Sets the numeric day-of-the-month value of the Date object using local time. - * @param date A numeric value equal to the day of the month. - */ - setDate(date: number): number; - /** - * Sets the numeric day of the month in the Date object using Universal Coordinated Time (UTC). - * @param date A numeric value equal to the day of the month. - */ - setUTCDate(date: number): number; - /** - * Sets the month value in the Date object using local time. - * @param month A numeric value equal to the month. The value for January is 0, and other month values follow consecutively. - * @param date A numeric value representing the day of the month. If this value is not supplied, the value from a call to the getDate method is used. - */ - setMonth(month: number, date?: number): number; - /** - * Sets the month value in the Date object using Universal Coordinated Time (UTC). - * @param month A numeric value equal to the month. The value for January is 0, and other month values follow consecutively. - * @param date A numeric value representing the day of the month. If it is not supplied, the value from a call to the getUTCDate method is used. - */ - setUTCMonth(month: number, date?: number): number; - /** - * Sets the year of the Date object using local time. - * @param year A numeric value for the year. - * @param month A zero-based numeric value for the month (0 for January, 11 for December). Must be specified if numDate is specified. - * @param date A numeric value equal for the day of the month. - */ - setFullYear(year: number, month?: number, date?: number): number; - /** - * Sets the year value in the Date object using Universal Coordinated Time (UTC). - * @param year A numeric value equal to the year. - * @param month A numeric value equal to the month. The value for January is 0, and other month values follow consecutively. Must be supplied if numDate is supplied. - * @param date A numeric value equal to the day of the month. - */ - setUTCFullYear(year: number, month?: number, date?: number): number; - /** Returns a date converted to a string using Universal Coordinated Time (UTC). */ - toUTCString(): string; - /** Returns a date as a string value in ISO format. */ - toISOString(): string; - /** Used by the JSON.stringify method to enable the transformation of an object's data for JavaScript Object Notation (JSON) serialization. */ - toJSON(key?: any): string; -} - -interface DateConstructor { - new(): Date; - new(value: number | string): Date; - new(year: number, month: number, date?: number, hours?: number, minutes?: number, seconds?: number, ms?: number): Date; - (): string; - readonly prototype: Date; - /** - * Parses a string containing a date, and returns the number of milliseconds between that date and midnight, January 1, 1970. - * @param s A date string - */ - parse(s: string): number; - /** - * Returns the number of milliseconds between midnight, January 1, 1970 Universal Coordinated Time (UTC) (or GMT) and the specified date. - * @param year The full year designation is required for cross-century date accuracy. If year is between 0 and 99 is used, then year is assumed to be 1900 + year. - * @param month The month as a number between 0 and 11 (January to December). - * @param date The date as a number between 1 and 31. - * @param hours Must be supplied if minutes is supplied. A number from 0 to 23 (midnight to 11pm) that specifies the hour. - * @param minutes Must be supplied if seconds is supplied. A number from 0 to 59 that specifies the minutes. - * @param seconds Must be supplied if milliseconds is supplied. A number from 0 to 59 that specifies the seconds. - * @param ms A number from 0 to 999 that specifies the milliseconds. - */ - UTC(year: number, month: number, date?: number, hours?: number, minutes?: number, seconds?: number, ms?: number): number; - now(): number; -} - -declare var Date: DateConstructor; - -interface RegExpMatchArray extends Array { - index?: number; - input?: string; -} - -interface RegExpExecArray extends Array { - index: number; - input: string; -} - -interface RegExp { - /** - * Executes a search on a string using a regular expression pattern, and returns an array containing the results of that search. - * @param string The String object or string literal on which to perform the search. - */ - exec(string: string): RegExpExecArray | null; - - /** - * Returns a Boolean value that indicates whether or not a pattern exists in a searched string. - * @param string String on which to perform the search. - */ - test(string: string): boolean; - - /** Returns a copy of the text of the regular expression pattern. Read-only. The regExp argument is a Regular expression object. It can be a variable name or a literal. */ - readonly source: string; - - /** Returns a Boolean value indicating the state of the global flag (g) used with a regular expression. Default is false. Read-only. */ - readonly global: boolean; - - /** Returns a Boolean value indicating the state of the ignoreCase flag (i) used with a regular expression. Default is false. Read-only. */ - readonly ignoreCase: boolean; - - /** Returns a Boolean value indicating the state of the multiline flag (m) used with a regular expression. Default is false. Read-only. */ - readonly multiline: boolean; - - lastIndex: number; - - // Non-standard extensions - compile(): this; -} - -interface RegExpConstructor { - new(pattern: RegExp | string): RegExp; - new(pattern: string, flags?: string): RegExp; - (pattern: RegExp | string): RegExp; - (pattern: string, flags?: string): RegExp; - readonly prototype: RegExp; - - // Non-standard extensions - $1: string; - $2: string; - $3: string; - $4: string; - $5: string; - $6: string; - $7: string; - $8: string; - $9: string; - lastMatch: string; -} - -declare var RegExp: RegExpConstructor; - -interface Error { - name: string; - message: string; - stack?: string; -} - -interface ErrorConstructor { - new(message?: string): Error; - (message?: string): Error; - readonly prototype: Error; -} - -declare var Error: ErrorConstructor; - -interface EvalError extends Error { -} - -interface EvalErrorConstructor { - new(message?: string): EvalError; - (message?: string): EvalError; - readonly prototype: EvalError; -} - -declare var EvalError: EvalErrorConstructor; - -interface RangeError extends Error { -} - -interface RangeErrorConstructor { - new(message?: string): RangeError; - (message?: string): RangeError; - readonly prototype: RangeError; -} - -declare var RangeError: RangeErrorConstructor; - -interface ReferenceError extends Error { -} - -interface ReferenceErrorConstructor { - new(message?: string): ReferenceError; - (message?: string): ReferenceError; - readonly prototype: ReferenceError; -} - -declare var ReferenceError: ReferenceErrorConstructor; - -interface SyntaxError extends Error { -} - -interface SyntaxErrorConstructor { - new(message?: string): SyntaxError; - (message?: string): SyntaxError; - readonly prototype: SyntaxError; -} - -declare var SyntaxError: SyntaxErrorConstructor; - -interface TypeError extends Error { -} - -interface TypeErrorConstructor { - new(message?: string): TypeError; - (message?: string): TypeError; - readonly prototype: TypeError; -} - -declare var TypeError: TypeErrorConstructor; - -interface URIError extends Error { -} - -interface URIErrorConstructor { - new(message?: string): URIError; - (message?: string): URIError; - readonly prototype: URIError; -} - -declare var URIError: URIErrorConstructor; - -interface JSON { - /** - * Converts a JavaScript Object Notation (JSON) string into an object. - * @param text A valid JSON string. - * @param reviver A function that transforms the results. This function is called for each member of the object. - * If a member contains nested objects, the nested objects are transformed before the parent object is. - */ - parse(text: string, reviver?: (this: any, key: string, value: any) => any): any; - /** - * Converts a JavaScript value to a JavaScript Object Notation (JSON) string. - * @param value A JavaScript value, usually an object or array, to be converted. - * @param replacer A function that transforms the results. - * @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read. - */ - stringify(value: any, replacer?: (this: any, key: string, value: any) => any, space?: string | number): string; - /** - * Converts a JavaScript value to a JavaScript Object Notation (JSON) string. - * @param value A JavaScript value, usually an object or array, to be converted. - * @param replacer An array of strings and numbers that acts as a approved list for selecting the object properties that will be stringified. - * @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read. - */ - stringify(value: any, replacer?: (number | string)[] | null, space?: string | number): string; -} - -/** - * An intrinsic object that provides functions to convert JavaScript values to and from the JavaScript Object Notation (JSON) format. - */ -declare var JSON: JSON; - - -///////////////////////////// -/// ECMAScript Array API (specially handled by compiler) -///////////////////////////// - -interface ReadonlyArray { - /** - * Gets the length of the array. This is a number one higher than the highest element defined in an array. - */ - readonly length: number; - /** - * Returns a string representation of an array. - */ - toString(): string; - /** - * Returns a string representation of an array. The elements are converted to string using their toLocalString methods. - */ - toLocaleString(): string; - /** - * Combines two or more arrays. - * @param items Additional items to add to the end of array1. - */ - concat(...items: ConcatArray[]): T[]; - /** - * Combines two or more arrays. - * @param items Additional items to add to the end of array1. - */ - concat(...items: (T | ConcatArray)[]): T[]; - /** - * Adds all the elements of an array separated by the specified separator string. - * @param separator A string used to separate one element of an array from the next in the resulting String. If omitted, the array elements are separated with a comma. - */ - join(separator?: string): string; - /** - * Returns a section of an array. - * @param start The beginning of the specified portion of the array. - * @param end The end of the specified portion of the array. This is exclusive of the element at the index 'end'. - */ - slice(start?: number, end?: number): T[]; - /** - * Returns the index of the first occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the search starts at index 0. - */ - indexOf(searchElement: T, fromIndex?: number): number; - /** - * Returns the index of the last occurrence of a specified value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the search starts at the last index in the array. - */ - lastIndexOf(searchElement: T, fromIndex?: number): number; - /** - * Determines whether all the members of an array satisfy the specified test. - * @param callbackfn A function that accepts up to three arguments. The every method calls - * the callbackfn function for each element in the array until the callbackfn returns a value - * which is coercible to the Boolean value false, or until the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - every(callbackfn: (value: T, index: number, array: readonly T[]) => unknown, thisArg?: any): boolean; - /** - * Determines whether the specified callback function returns true for any element of an array. - * @param callbackfn A function that accepts up to three arguments. The some method calls - * the callbackfn function for each element in the array until the callbackfn returns a value - * which is coercible to the Boolean value true, or until the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - some(callbackfn: (value: T, index: number, array: readonly T[]) => unknown, thisArg?: any): boolean; - /** - * Performs the specified action for each element in an array. - * @param callbackfn A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. - */ - forEach(callbackfn: (value: T, index: number, array: readonly T[]) => void, thisArg?: any): void; - /** - * Calls a defined callback function on each element of an array, and returns an array that contains the results. - * @param callbackfn A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. - */ - map(callbackfn: (value: T, index: number, array: readonly T[]) => U, thisArg?: any): U[]; - /** - * Returns the elements of an array that meet the condition specified in a callback function. - * @param callbackfn A function that accepts up to three arguments. The filter method calls the callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. - */ - filter(callbackfn: (value: T, index: number, array: readonly T[]) => value is S, thisArg?: any): S[]; - /** - * Returns the elements of an array that meet the condition specified in a callback function. - * @param callbackfn A function that accepts up to three arguments. The filter method calls the callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. - */ - filter(callbackfn: (value: T, index: number, array: readonly T[]) => unknown, thisArg?: any): T[]; - /** - * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. - */ - reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: readonly T[]) => T): T; - reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: readonly T[]) => T, initialValue: T): T; - /** - * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. - */ - reduce(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: readonly T[]) => U, initialValue: U): U; - /** - * Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. - */ - reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: readonly T[]) => T): T; - reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: readonly T[]) => T, initialValue: T): T; - /** - * Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. - */ - reduceRight(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: readonly T[]) => U, initialValue: U): U; - - readonly [n: number]: T; -} - -interface ConcatArray { - readonly length: number; - readonly [n: number]: T; - join(separator?: string): string; - slice(start?: number, end?: number): T[]; -} - -interface Array { - /** - * Gets or sets the length of the array. This is a number one higher than the highest element defined in an array. - */ - length: number; - /** - * Returns a string representation of an array. - */ - toString(): string; - /** - * Returns a string representation of an array. The elements are converted to string using their toLocalString methods. - */ - toLocaleString(): string; - /** - * Removes the last element from an array and returns it. - */ - pop(): T | undefined; - /** - * Appends new elements to an array, and returns the new length of the array. - * @param items New elements of the Array. - */ - push(...items: T[]): number; - /** - * Combines two or more arrays. - * @param items Additional items to add to the end of array1. - */ - concat(...items: ConcatArray[]): T[]; - /** - * Combines two or more arrays. - * @param items Additional items to add to the end of array1. - */ - concat(...items: (T | ConcatArray)[]): T[]; - /** - * Adds all the elements of an array separated by the specified separator string. - * @param separator A string used to separate one element of an array from the next in the resulting String. If omitted, the array elements are separated with a comma. - */ - join(separator?: string): string; - /** - * Reverses the elements in an Array. - */ - reverse(): T[]; - /** - * Removes the first element from an array and returns it. - */ - shift(): T | undefined; - /** - * Returns a section of an array. - * @param start The beginning of the specified portion of the array. - * @param end The end of the specified portion of the array. This is exclusive of the element at the index 'end'. - */ - slice(start?: number, end?: number): T[]; - /** - * Sorts an array. - * @param compareFn Function used to determine the order of the elements. It is expected to return - * a negative value if first argument is less than second argument, zero if they're equal and a positive - * value otherwise. If omitted, the elements are sorted in ascending, ASCII character order. - * ```ts - * [11,2,22,1].sort((a, b) => a - b) - * ``` - */ - sort(compareFn?: (a: T, b: T) => number): this; - /** - * Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements. - * @param start The zero-based location in the array from which to start removing elements. - * @param deleteCount The number of elements to remove. - */ - splice(start: number, deleteCount?: number): T[]; - /** - * Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements. - * @param start The zero-based location in the array from which to start removing elements. - * @param deleteCount The number of elements to remove. - * @param items Elements to insert into the array in place of the deleted elements. - */ - splice(start: number, deleteCount: number, ...items: T[]): T[]; - /** - * Inserts new elements at the start of an array. - * @param items Elements to insert at the start of the Array. - */ - unshift(...items: T[]): number; - /** - * Returns the index of the first occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the search starts at index 0. - */ - indexOf(searchElement: T, fromIndex?: number): number; - /** - * Returns the index of the last occurrence of a specified value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the search starts at the last index in the array. - */ - lastIndexOf(searchElement: T, fromIndex?: number): number; - /** - * Determines whether all the members of an array satisfy the specified test. - * @param callbackfn A function that accepts up to three arguments. The every method calls - * the callbackfn function for each element in the array until the callbackfn returns a value - * which is coercible to the Boolean value false, or until the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - every(callbackfn: (value: T, index: number, array: T[]) => unknown, thisArg?: any): boolean; - /** - * Determines whether the specified callback function returns true for any element of an array. - * @param callbackfn A function that accepts up to three arguments. The some method calls - * the callbackfn function for each element in the array until the callbackfn returns a value - * which is coercible to the Boolean value true, or until the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - some(callbackfn: (value: T, index: number, array: T[]) => unknown, thisArg?: any): boolean; - /** - * Performs the specified action for each element in an array. - * @param callbackfn A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. - */ - forEach(callbackfn: (value: T, index: number, array: T[]) => void, thisArg?: any): void; - /** - * Calls a defined callback function on each element of an array, and returns an array that contains the results. - * @param callbackfn A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. - */ - map(callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): U[]; - /** - * Returns the elements of an array that meet the condition specified in a callback function. - * @param callbackfn A function that accepts up to three arguments. The filter method calls the callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. - */ - filter(callbackfn: (value: T, index: number, array: T[]) => value is S, thisArg?: any): S[]; - /** - * Returns the elements of an array that meet the condition specified in a callback function. - * @param callbackfn A function that accepts up to three arguments. The filter method calls the callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. - */ - filter(callbackfn: (value: T, index: number, array: T[]) => unknown, thisArg?: any): T[]; - /** - * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. - */ - reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T): T; - reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue: T): T; - /** - * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. - */ - reduce(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U; - /** - * Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. - */ - reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T): T; - reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue: T): T; - /** - * Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. - */ - reduceRight(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U; - - [n: number]: T; -} - -interface ArrayConstructor { - new(arrayLength?: number): any[]; - new (arrayLength: number): T[]; - new (...items: T[]): T[]; - (arrayLength?: number): any[]; - (arrayLength: number): T[]; - (...items: T[]): T[]; - isArray(arg: any): arg is any[]; - readonly prototype: any[]; -} - -declare var Array: ArrayConstructor; - -interface TypedPropertyDescriptor { - enumerable?: boolean; - configurable?: boolean; - writable?: boolean; - value?: T; - get?: () => T; - set?: (value: T) => void; -} - -declare type ClassDecorator = (target: TFunction) => TFunction | void; -declare type PropertyDecorator = (target: Object, propertyKey: string | symbol) => void; -declare type MethodDecorator = (target: Object, propertyKey: string | symbol, descriptor: TypedPropertyDescriptor) => TypedPropertyDescriptor | void; -declare type ParameterDecorator = (target: Object, propertyKey: string | symbol, parameterIndex: number) => void; - -declare type PromiseConstructorLike = new (executor: (resolve: (value?: T | PromiseLike) => void, reject: (reason?: any) => void) => void) => PromiseLike; - -interface PromiseLike { - /** - * Attaches callbacks for the resolution and/or rejection of the Promise. - * @param onfulfilled The callback to execute when the Promise is resolved. - * @param onrejected The callback to execute when the Promise is rejected. - * @returns A Promise for the completion of which ever callback is executed. - */ - then(onfulfilled?: ((value: T) => TResult1 | PromiseLike) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike) | undefined | null): PromiseLike; -} - -/** - * Represents the completion of an asynchronous operation - */ -interface Promise { - /** - * Attaches callbacks for the resolution and/or rejection of the Promise. - * @param onfulfilled The callback to execute when the Promise is resolved. - * @param onrejected The callback to execute when the Promise is rejected. - * @returns A Promise for the completion of which ever callback is executed. - */ - then(onfulfilled?: ((value: T) => TResult1 | PromiseLike) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike) | undefined | null): Promise; - - /** - * Attaches a callback for only the rejection of the Promise. - * @param onrejected The callback to execute when the Promise is rejected. - * @returns A Promise for the completion of the callback. - */ - catch(onrejected?: ((reason: any) => TResult | PromiseLike) | undefined | null): Promise; -} - -interface ArrayLike { - readonly length: number; - readonly [n: number]: T; -} - -/** - * Make all properties in T optional - */ -type Partial = { - [P in keyof T]?: T[P]; -}; - -/** - * Make all properties in T required - */ -type Required = { - [P in keyof T]-?: T[P]; -}; - -/** - * Make all properties in T readonly - */ -type Readonly = { - readonly [P in keyof T]: T[P]; -}; - -/** - * From T, pick a set of properties whose keys are in the union K - */ -type Pick = { - [P in K]: T[P]; -}; - -/** - * Construct a type with a set of properties K of type T - */ -type Record = { - [P in K]: T; -}; - -/** - * Exclude from T those types that are assignable to U - */ -type Exclude = T extends U ? never : T; - -/** - * Extract from T those types that are assignable to U - */ -type Extract = T extends U ? T : never; - -/** - * Construct a type with the properties of T except for those in type K. - */ -type Omit = Pick>; - -/** - * Exclude null and undefined from T - */ -type NonNullable = T extends null | undefined ? never : T; - -/** - * Obtain the parameters of a function type in a tuple - */ -type Parameters any> = T extends (...args: infer P) => any ? P : never; - -/** - * Obtain the parameters of a constructor function type in a tuple - */ -type ConstructorParameters any> = T extends new (...args: infer P) => any ? P : never; - -/** - * Obtain the return type of a function type - */ -type ReturnType any> = T extends (...args: any) => infer R ? R : any; - -/** - * Obtain the return type of a constructor function type - */ -type InstanceType any> = T extends new (...args: any) => infer R ? R : any; - -/** - * Marker for contextual 'this' type - */ -interface ThisType { } - -/** - * Represents a raw buffer of binary data, which is used to store data for the - * different typed arrays. ArrayBuffers cannot be read from or written to directly, - * but can be passed to a typed array or DataView Object to interpret the raw - * buffer as needed. - */ -interface ArrayBuffer { - /** - * Read-only. The length of the ArrayBuffer (in bytes). - */ - readonly byteLength: number; - - /** - * Returns a section of an ArrayBuffer. - */ - slice(begin: number, end?: number): ArrayBuffer; -} - -/** - * Allowed ArrayBuffer types for the buffer of an ArrayBufferView and related Typed Arrays. - */ -interface ArrayBufferTypes { - ArrayBuffer: ArrayBuffer; -} -type ArrayBufferLike = ArrayBufferTypes[keyof ArrayBufferTypes]; - -interface ArrayBufferConstructor { - readonly prototype: ArrayBuffer; - new(byteLength: number): ArrayBuffer; - isView(arg: any): arg is ArrayBufferView; -} -declare var ArrayBuffer: ArrayBufferConstructor; - -interface ArrayBufferView { - /** - * The ArrayBuffer instance referenced by the array. - */ - buffer: ArrayBufferLike; - - /** - * The length in bytes of the array. - */ - byteLength: number; - - /** - * The offset in bytes of the array. - */ - byteOffset: number; -} - -interface DataView { - readonly buffer: ArrayBuffer; - readonly byteLength: number; - readonly byteOffset: number; - /** - * Gets the Float32 value at the specified byte offset from the start of the view. There is - * no alignment constraint; multi-byte values may be fetched from any offset. - * @param byteOffset The place in the buffer at which the value should be retrieved. - */ - getFloat32(byteOffset: number, littleEndian?: boolean): number; - - /** - * Gets the Float64 value at the specified byte offset from the start of the view. There is - * no alignment constraint; multi-byte values may be fetched from any offset. - * @param byteOffset The place in the buffer at which the value should be retrieved. - */ - getFloat64(byteOffset: number, littleEndian?: boolean): number; - - /** - * Gets the Int8 value at the specified byte offset from the start of the view. There is - * no alignment constraint; multi-byte values may be fetched from any offset. - * @param byteOffset The place in the buffer at which the value should be retrieved. - */ - getInt8(byteOffset: number): number; - - /** - * Gets the Int16 value at the specified byte offset from the start of the view. There is - * no alignment constraint; multi-byte values may be fetched from any offset. - * @param byteOffset The place in the buffer at which the value should be retrieved. - */ - getInt16(byteOffset: number, littleEndian?: boolean): number; - /** - * Gets the Int32 value at the specified byte offset from the start of the view. There is - * no alignment constraint; multi-byte values may be fetched from any offset. - * @param byteOffset The place in the buffer at which the value should be retrieved. - */ - getInt32(byteOffset: number, littleEndian?: boolean): number; - - /** - * Gets the Uint8 value at the specified byte offset from the start of the view. There is - * no alignment constraint; multi-byte values may be fetched from any offset. - * @param byteOffset The place in the buffer at which the value should be retrieved. - */ - getUint8(byteOffset: number): number; - - /** - * Gets the Uint16 value at the specified byte offset from the start of the view. There is - * no alignment constraint; multi-byte values may be fetched from any offset. - * @param byteOffset The place in the buffer at which the value should be retrieved. - */ - getUint16(byteOffset: number, littleEndian?: boolean): number; - - /** - * Gets the Uint32 value at the specified byte offset from the start of the view. There is - * no alignment constraint; multi-byte values may be fetched from any offset. - * @param byteOffset The place in the buffer at which the value should be retrieved. - */ - getUint32(byteOffset: number, littleEndian?: boolean): number; - - /** - * Stores an Float32 value at the specified byte offset from the start of the view. - * @param byteOffset The place in the buffer at which the value should be set. - * @param value The value to set. - * @param littleEndian If false or undefined, a big-endian value should be written, - * otherwise a little-endian value should be written. - */ - setFloat32(byteOffset: number, value: number, littleEndian?: boolean): void; - - /** - * Stores an Float64 value at the specified byte offset from the start of the view. - * @param byteOffset The place in the buffer at which the value should be set. - * @param value The value to set. - * @param littleEndian If false or undefined, a big-endian value should be written, - * otherwise a little-endian value should be written. - */ - setFloat64(byteOffset: number, value: number, littleEndian?: boolean): void; - - /** - * Stores an Int8 value at the specified byte offset from the start of the view. - * @param byteOffset The place in the buffer at which the value should be set. - * @param value The value to set. - */ - setInt8(byteOffset: number, value: number): void; - - /** - * Stores an Int16 value at the specified byte offset from the start of the view. - * @param byteOffset The place in the buffer at which the value should be set. - * @param value The value to set. - * @param littleEndian If false or undefined, a big-endian value should be written, - * otherwise a little-endian value should be written. - */ - setInt16(byteOffset: number, value: number, littleEndian?: boolean): void; - - /** - * Stores an Int32 value at the specified byte offset from the start of the view. - * @param byteOffset The place in the buffer at which the value should be set. - * @param value The value to set. - * @param littleEndian If false or undefined, a big-endian value should be written, - * otherwise a little-endian value should be written. - */ - setInt32(byteOffset: number, value: number, littleEndian?: boolean): void; - - /** - * Stores an Uint8 value at the specified byte offset from the start of the view. - * @param byteOffset The place in the buffer at which the value should be set. - * @param value The value to set. - */ - setUint8(byteOffset: number, value: number): void; - - /** - * Stores an Uint16 value at the specified byte offset from the start of the view. - * @param byteOffset The place in the buffer at which the value should be set. - * @param value The value to set. - * @param littleEndian If false or undefined, a big-endian value should be written, - * otherwise a little-endian value should be written. - */ - setUint16(byteOffset: number, value: number, littleEndian?: boolean): void; - - /** - * Stores an Uint32 value at the specified byte offset from the start of the view. - * @param byteOffset The place in the buffer at which the value should be set. - * @param value The value to set. - * @param littleEndian If false or undefined, a big-endian value should be written, - * otherwise a little-endian value should be written. - */ - setUint32(byteOffset: number, value: number, littleEndian?: boolean): void; -} - -interface DataViewConstructor { - new(buffer: ArrayBufferLike, byteOffset?: number, byteLength?: number): DataView; -} -declare var DataView: DataViewConstructor; - -/** - * A typed array of 8-bit integer values. The contents are initialized to 0. If the requested - * number of bytes could not be allocated an exception is raised. - */ -interface Int8Array { - /** - * The size in bytes of each element in the array. - */ - readonly BYTES_PER_ELEMENT: number; - - /** - * The ArrayBuffer instance referenced by the array. - */ - readonly buffer: ArrayBufferLike; - - /** - * The length in bytes of the array. - */ - readonly byteLength: number; - - /** - * The offset in bytes of the array. - */ - readonly byteOffset: number; - - /** - * Returns the this object after copying a section of the array identified by start and end - * to the same array starting at position target - * @param target If target is negative, it is treated as length+target where length is the - * length of the array. - * @param start If start is negative, it is treated as length+start. If end is negative, it - * is treated as length+end. - * @param end If not specified, length of the this object is used as its default value. - */ - copyWithin(target: number, start: number, end?: number): this; - - /** - * Determines whether all the members of an array satisfy the specified test. - * @param callbackfn A function that accepts up to three arguments. The every method calls - * the callbackfn function for each element in the array until the callbackfn returns a value - * which is coercible to the Boolean value false, or until the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - every(callbackfn: (value: number, index: number, array: Int8Array) => unknown, thisArg?: any): boolean; - - /** - * Returns the this object after filling the section identified by start and end with value - * @param value value to fill array section with - * @param start index to start filling the array at. If start is negative, it is treated as - * length+start where length is the length of the array. - * @param end index to stop filling the array at. If end is negative, it is treated as - * length+end. - */ - fill(value: number, start?: number, end?: number): this; - - /** - * Returns the elements of an array that meet the condition specified in a callback function. - * @param callbackfn A function that accepts up to three arguments. The filter method calls - * the callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - filter(callbackfn: (value: number, index: number, array: Int8Array) => any, thisArg?: any): Int8Array; - - /** - * Returns the value of the first element in the array where predicate is true, and undefined - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, find - * immediately returns that element value. Otherwise, find returns undefined. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - find(predicate: (value: number, index: number, obj: Int8Array) => boolean, thisArg?: any): number | undefined; - - /** - * Returns the index of the first element in the array where predicate is true, and -1 - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, - * findIndex immediately returns that element index. Otherwise, findIndex returns -1. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - findIndex(predicate: (value: number, index: number, obj: Int8Array) => boolean, thisArg?: any): number; - - /** - * Performs the specified action for each element in an array. - * @param callbackfn A function that accepts up to three arguments. forEach calls the - * callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - forEach(callbackfn: (value: number, index: number, array: Int8Array) => void, thisArg?: any): void; - - /** - * Returns the index of the first occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the - * search starts at index 0. - */ - indexOf(searchElement: number, fromIndex?: number): number; - - /** - * Adds all the elements of an array separated by the specified separator string. - * @param separator A string used to separate one element of an array from the next in the - * resulting String. If omitted, the array elements are separated with a comma. - */ - join(separator?: string): string; - - /** - * Returns the index of the last occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the - * search starts at index 0. - */ - lastIndexOf(searchElement: number, fromIndex?: number): number; - - /** - * The length of the array. - */ - readonly length: number; - - /** - * Calls a defined callback function on each element of an array, and returns an array that - * contains the results. - * @param callbackfn A function that accepts up to three arguments. The map method calls the - * callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - map(callbackfn: (value: number, index: number, array: Int8Array) => number, thisArg?: any): Int8Array; - - /** - * Calls the specified callback function for all the elements in an array. The return value of - * the callback function is the accumulated result, and is provided as an argument in the next - * call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the - * callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int8Array) => number): number; - reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int8Array) => number, initialValue: number): number; - - /** - * Calls the specified callback function for all the elements in an array. The return value of - * the callback function is the accumulated result, and is provided as an argument in the next - * call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the - * callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int8Array) => U, initialValue: U): U; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. - * The return value of the callback function is the accumulated result, and is provided as an - * argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls - * the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an - * argument instead of an array value. - */ - reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int8Array) => number): number; - reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int8Array) => number, initialValue: number): number; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. - * The return value of the callback function is the accumulated result, and is provided as an - * argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls - * the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int8Array) => U, initialValue: U): U; - - /** - * Reverses the elements in an Array. - */ - reverse(): Int8Array; - - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. - */ - set(array: ArrayLike, offset?: number): void; - - /** - * Returns a section of an array. - * @param start The beginning of the specified portion of the array. - * @param end The end of the specified portion of the array. This is exclusive of the element at the index 'end'. - */ - slice(start?: number, end?: number): Int8Array; - - /** - * Determines whether the specified callback function returns true for any element of an array. - * @param callbackfn A function that accepts up to three arguments. The some method calls - * the callbackfn function for each element in the array until the callbackfn returns a value - * which is coercible to the Boolean value true, or until the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - some(callbackfn: (value: number, index: number, array: Int8Array) => unknown, thisArg?: any): boolean; - - /** - * Sorts an array. - * @param compareFn Function used to determine the order of the elements. It is expected to return - * a negative value if first argument is less than second argument, zero if they're equal and a positive - * value otherwise. If omitted, the elements are sorted in ascending, ASCII character order. - * ```ts - * [11,2,22,1].sort((a, b) => a - b) - * ``` - */ - sort(compareFn?: (a: number, b: number) => number): this; - - /** - * Gets a new Int8Array view of the ArrayBuffer store for this array, referencing the elements - * at begin, inclusive, up to end, exclusive. - * @param begin The index of the beginning of the array. - * @param end The index of the end of the array. - */ - subarray(begin?: number, end?: number): Int8Array; - - /** - * Converts a number to a string by using the current locale. - */ - toLocaleString(): string; - - /** - * Returns a string representation of an array. - */ - toString(): string; - - [index: number]: number; -} -interface Int8ArrayConstructor { - readonly prototype: Int8Array; - new(length: number): Int8Array; - new(arrayOrArrayBuffer: ArrayLike | ArrayBufferLike): Int8Array; - new(buffer: ArrayBufferLike, byteOffset: number, length?: number): Int8Array; - - /** - * The size in bytes of each element in the array. - */ - readonly BYTES_PER_ELEMENT: number; - - /** - * Returns a new array from a set of elements. - * @param items A set of elements to include in the new array object. - */ - of(...items: number[]): Int8Array; - - /** - * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. - */ - from(arrayLike: ArrayLike): Int8Array; - - /** - * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. - * @param mapfn A mapping function to call on every element of the array. - * @param thisArg Value of 'this' used to invoke the mapfn. - */ - from(arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Int8Array; - - -} -declare var Int8Array: Int8ArrayConstructor; - -/** - * A typed array of 8-bit unsigned integer values. The contents are initialized to 0. If the - * requested number of bytes could not be allocated an exception is raised. - */ -interface Uint8Array { - /** - * The size in bytes of each element in the array. - */ - readonly BYTES_PER_ELEMENT: number; - - /** - * The ArrayBuffer instance referenced by the array. - */ - readonly buffer: ArrayBufferLike; - - /** - * The length in bytes of the array. - */ - readonly byteLength: number; - - /** - * The offset in bytes of the array. - */ - readonly byteOffset: number; - - /** - * Returns the this object after copying a section of the array identified by start and end - * to the same array starting at position target - * @param target If target is negative, it is treated as length+target where length is the - * length of the array. - * @param start If start is negative, it is treated as length+start. If end is negative, it - * is treated as length+end. - * @param end If not specified, length of the this object is used as its default value. - */ - copyWithin(target: number, start: number, end?: number): this; - - /** - * Determines whether all the members of an array satisfy the specified test. - * @param callbackfn A function that accepts up to three arguments. The every method calls - * the callbackfn function for each element in the array until the callbackfn returns a value - * which is coercible to the Boolean value false, or until the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - every(callbackfn: (value: number, index: number, array: Uint8Array) => unknown, thisArg?: any): boolean; - - /** - * Returns the this object after filling the section identified by start and end with value - * @param value value to fill array section with - * @param start index to start filling the array at. If start is negative, it is treated as - * length+start where length is the length of the array. - * @param end index to stop filling the array at. If end is negative, it is treated as - * length+end. - */ - fill(value: number, start?: number, end?: number): this; - - /** - * Returns the elements of an array that meet the condition specified in a callback function. - * @param callbackfn A function that accepts up to three arguments. The filter method calls - * the callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - filter(callbackfn: (value: number, index: number, array: Uint8Array) => any, thisArg?: any): Uint8Array; - - /** - * Returns the value of the first element in the array where predicate is true, and undefined - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, find - * immediately returns that element value. Otherwise, find returns undefined. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - find(predicate: (value: number, index: number, obj: Uint8Array) => boolean, thisArg?: any): number | undefined; - - /** - * Returns the index of the first element in the array where predicate is true, and -1 - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, - * findIndex immediately returns that element index. Otherwise, findIndex returns -1. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - findIndex(predicate: (value: number, index: number, obj: Uint8Array) => boolean, thisArg?: any): number; - - /** - * Performs the specified action for each element in an array. - * @param callbackfn A function that accepts up to three arguments. forEach calls the - * callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - forEach(callbackfn: (value: number, index: number, array: Uint8Array) => void, thisArg?: any): void; - - /** - * Returns the index of the first occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the - * search starts at index 0. - */ - indexOf(searchElement: number, fromIndex?: number): number; - - /** - * Adds all the elements of an array separated by the specified separator string. - * @param separator A string used to separate one element of an array from the next in the - * resulting String. If omitted, the array elements are separated with a comma. - */ - join(separator?: string): string; - - /** - * Returns the index of the last occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the - * search starts at index 0. - */ - lastIndexOf(searchElement: number, fromIndex?: number): number; - - /** - * The length of the array. - */ - readonly length: number; - - /** - * Calls a defined callback function on each element of an array, and returns an array that - * contains the results. - * @param callbackfn A function that accepts up to three arguments. The map method calls the - * callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - map(callbackfn: (value: number, index: number, array: Uint8Array) => number, thisArg?: any): Uint8Array; - - /** - * Calls the specified callback function for all the elements in an array. The return value of - * the callback function is the accumulated result, and is provided as an argument in the next - * call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the - * callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8Array) => number): number; - reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8Array) => number, initialValue: number): number; - - /** - * Calls the specified callback function for all the elements in an array. The return value of - * the callback function is the accumulated result, and is provided as an argument in the next - * call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the - * callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint8Array) => U, initialValue: U): U; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. - * The return value of the callback function is the accumulated result, and is provided as an - * argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls - * the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an - * argument instead of an array value. - */ - reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8Array) => number): number; - reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8Array) => number, initialValue: number): number; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. - * The return value of the callback function is the accumulated result, and is provided as an - * argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls - * the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint8Array) => U, initialValue: U): U; - - /** - * Reverses the elements in an Array. - */ - reverse(): Uint8Array; - - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. - */ - set(array: ArrayLike, offset?: number): void; - - /** - * Returns a section of an array. - * @param start The beginning of the specified portion of the array. - * @param end The end of the specified portion of the array. This is exclusive of the element at the index 'end'. - */ - slice(start?: number, end?: number): Uint8Array; - - /** - * Determines whether the specified callback function returns true for any element of an array. - * @param callbackfn A function that accepts up to three arguments. The some method calls - * the callbackfn function for each element in the array until the callbackfn returns a value - * which is coercible to the Boolean value true, or until the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - some(callbackfn: (value: number, index: number, array: Uint8Array) => unknown, thisArg?: any): boolean; - - /** - * Sorts an array. - * @param compareFn Function used to determine the order of the elements. It is expected to return - * a negative value if first argument is less than second argument, zero if they're equal and a positive - * value otherwise. If omitted, the elements are sorted in ascending, ASCII character order. - * ```ts - * [11,2,22,1].sort((a, b) => a - b) - * ``` - */ - sort(compareFn?: (a: number, b: number) => number): this; - - /** - * Gets a new Uint8Array view of the ArrayBuffer store for this array, referencing the elements - * at begin, inclusive, up to end, exclusive. - * @param begin The index of the beginning of the array. - * @param end The index of the end of the array. - */ - subarray(begin?: number, end?: number): Uint8Array; - - /** - * Converts a number to a string by using the current locale. - */ - toLocaleString(): string; - - /** - * Returns a string representation of an array. - */ - toString(): string; - - [index: number]: number; -} - -interface Uint8ArrayConstructor { - readonly prototype: Uint8Array; - new(length: number): Uint8Array; - new(arrayOrArrayBuffer: ArrayLike | ArrayBufferLike): Uint8Array; - new(buffer: ArrayBufferLike, byteOffset: number, length?: number): Uint8Array; - - /** - * The size in bytes of each element in the array. - */ - readonly BYTES_PER_ELEMENT: number; - - /** - * Returns a new array from a set of elements. - * @param items A set of elements to include in the new array object. - */ - of(...items: number[]): Uint8Array; - - /** - * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. - */ - from(arrayLike: ArrayLike): Uint8Array; - - /** - * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. - * @param mapfn A mapping function to call on every element of the array. - * @param thisArg Value of 'this' used to invoke the mapfn. - */ - from(arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Uint8Array; - -} -declare var Uint8Array: Uint8ArrayConstructor; - -/** - * A typed array of 8-bit unsigned integer (clamped) values. The contents are initialized to 0. - * If the requested number of bytes could not be allocated an exception is raised. - */ -interface Uint8ClampedArray { - /** - * The size in bytes of each element in the array. - */ - readonly BYTES_PER_ELEMENT: number; - - /** - * The ArrayBuffer instance referenced by the array. - */ - readonly buffer: ArrayBufferLike; - - /** - * The length in bytes of the array. - */ - readonly byteLength: number; - - /** - * The offset in bytes of the array. - */ - readonly byteOffset: number; - - /** - * Returns the this object after copying a section of the array identified by start and end - * to the same array starting at position target - * @param target If target is negative, it is treated as length+target where length is the - * length of the array. - * @param start If start is negative, it is treated as length+start. If end is negative, it - * is treated as length+end. - * @param end If not specified, length of the this object is used as its default value. - */ - copyWithin(target: number, start: number, end?: number): this; - - /** - * Determines whether all the members of an array satisfy the specified test. - * @param callbackfn A function that accepts up to three arguments. The every method calls - * the callbackfn function for each element in the array until the callbackfn returns a value - * which is coercible to the Boolean value false, or until the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - every(callbackfn: (value: number, index: number, array: Uint8ClampedArray) => unknown, thisArg?: any): boolean; - - /** - * Returns the this object after filling the section identified by start and end with value - * @param value value to fill array section with - * @param start index to start filling the array at. If start is negative, it is treated as - * length+start where length is the length of the array. - * @param end index to stop filling the array at. If end is negative, it is treated as - * length+end. - */ - fill(value: number, start?: number, end?: number): this; - - /** - * Returns the elements of an array that meet the condition specified in a callback function. - * @param callbackfn A function that accepts up to three arguments. The filter method calls - * the callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - filter(callbackfn: (value: number, index: number, array: Uint8ClampedArray) => any, thisArg?: any): Uint8ClampedArray; - - /** - * Returns the value of the first element in the array where predicate is true, and undefined - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, find - * immediately returns that element value. Otherwise, find returns undefined. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - find(predicate: (value: number, index: number, obj: Uint8ClampedArray) => boolean, thisArg?: any): number | undefined; - - /** - * Returns the index of the first element in the array where predicate is true, and -1 - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, - * findIndex immediately returns that element index. Otherwise, findIndex returns -1. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - findIndex(predicate: (value: number, index: number, obj: Uint8ClampedArray) => boolean, thisArg?: any): number; - - /** - * Performs the specified action for each element in an array. - * @param callbackfn A function that accepts up to three arguments. forEach calls the - * callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - forEach(callbackfn: (value: number, index: number, array: Uint8ClampedArray) => void, thisArg?: any): void; - - /** - * Returns the index of the first occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the - * search starts at index 0. - */ - indexOf(searchElement: number, fromIndex?: number): number; - - /** - * Adds all the elements of an array separated by the specified separator string. - * @param separator A string used to separate one element of an array from the next in the - * resulting String. If omitted, the array elements are separated with a comma. - */ - join(separator?: string): string; - - /** - * Returns the index of the last occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the - * search starts at index 0. - */ - lastIndexOf(searchElement: number, fromIndex?: number): number; - - /** - * The length of the array. - */ - readonly length: number; - - /** - * Calls a defined callback function on each element of an array, and returns an array that - * contains the results. - * @param callbackfn A function that accepts up to three arguments. The map method calls the - * callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - map(callbackfn: (value: number, index: number, array: Uint8ClampedArray) => number, thisArg?: any): Uint8ClampedArray; - - /** - * Calls the specified callback function for all the elements in an array. The return value of - * the callback function is the accumulated result, and is provided as an argument in the next - * call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the - * callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => number): number; - reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => number, initialValue: number): number; - - /** - * Calls the specified callback function for all the elements in an array. The return value of - * the callback function is the accumulated result, and is provided as an argument in the next - * call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the - * callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => U, initialValue: U): U; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. - * The return value of the callback function is the accumulated result, and is provided as an - * argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls - * the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an - * argument instead of an array value. - */ - reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => number): number; - reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => number, initialValue: number): number; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. - * The return value of the callback function is the accumulated result, and is provided as an - * argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls - * the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => U, initialValue: U): U; - - /** - * Reverses the elements in an Array. - */ - reverse(): Uint8ClampedArray; - - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. - */ - set(array: ArrayLike, offset?: number): void; - - /** - * Returns a section of an array. - * @param start The beginning of the specified portion of the array. - * @param end The end of the specified portion of the array. This is exclusive of the element at the index 'end'. - */ - slice(start?: number, end?: number): Uint8ClampedArray; - - /** - * Determines whether the specified callback function returns true for any element of an array. - * @param callbackfn A function that accepts up to three arguments. The some method calls - * the callbackfn function for each element in the array until the callbackfn returns a value - * which is coercible to the Boolean value true, or until the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - some(callbackfn: (value: number, index: number, array: Uint8ClampedArray) => unknown, thisArg?: any): boolean; - - /** - * Sorts an array. - * @param compareFn Function used to determine the order of the elements. It is expected to return - * a negative value if first argument is less than second argument, zero if they're equal and a positive - * value otherwise. If omitted, the elements are sorted in ascending, ASCII character order. - * ```ts - * [11,2,22,1].sort((a, b) => a - b) - * ``` - */ - sort(compareFn?: (a: number, b: number) => number): this; - - /** - * Gets a new Uint8ClampedArray view of the ArrayBuffer store for this array, referencing the elements - * at begin, inclusive, up to end, exclusive. - * @param begin The index of the beginning of the array. - * @param end The index of the end of the array. - */ - subarray(begin?: number, end?: number): Uint8ClampedArray; - - /** - * Converts a number to a string by using the current locale. - */ - toLocaleString(): string; - - /** - * Returns a string representation of an array. - */ - toString(): string; - - [index: number]: number; -} - -interface Uint8ClampedArrayConstructor { - readonly prototype: Uint8ClampedArray; - new(length: number): Uint8ClampedArray; - new(arrayOrArrayBuffer: ArrayLike | ArrayBufferLike): Uint8ClampedArray; - new(buffer: ArrayBufferLike, byteOffset: number, length?: number): Uint8ClampedArray; - - /** - * The size in bytes of each element in the array. - */ - readonly BYTES_PER_ELEMENT: number; - - /** - * Returns a new array from a set of elements. - * @param items A set of elements to include in the new array object. - */ - of(...items: number[]): Uint8ClampedArray; - - /** - * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. - */ - from(arrayLike: ArrayLike): Uint8ClampedArray; - - /** - * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. - * @param mapfn A mapping function to call on every element of the array. - * @param thisArg Value of 'this' used to invoke the mapfn. - */ - from(arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Uint8ClampedArray; -} -declare var Uint8ClampedArray: Uint8ClampedArrayConstructor; - -/** - * A typed array of 16-bit signed integer values. The contents are initialized to 0. If the - * requested number of bytes could not be allocated an exception is raised. - */ -interface Int16Array { - /** - * The size in bytes of each element in the array. - */ - readonly BYTES_PER_ELEMENT: number; - - /** - * The ArrayBuffer instance referenced by the array. - */ - readonly buffer: ArrayBufferLike; - - /** - * The length in bytes of the array. - */ - readonly byteLength: number; - - /** - * The offset in bytes of the array. - */ - readonly byteOffset: number; - - /** - * Returns the this object after copying a section of the array identified by start and end - * to the same array starting at position target - * @param target If target is negative, it is treated as length+target where length is the - * length of the array. - * @param start If start is negative, it is treated as length+start. If end is negative, it - * is treated as length+end. - * @param end If not specified, length of the this object is used as its default value. - */ - copyWithin(target: number, start: number, end?: number): this; - - /** - * Determines whether all the members of an array satisfy the specified test. - * @param callbackfn A function that accepts up to three arguments. The every method calls - * the callbackfn function for each element in the array until the callbackfn returns a value - * which is coercible to the Boolean value false, or until the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - every(callbackfn: (value: number, index: number, array: Int16Array) => unknown, thisArg?: any): boolean; - - /** - * Returns the this object after filling the section identified by start and end with value - * @param value value to fill array section with - * @param start index to start filling the array at. If start is negative, it is treated as - * length+start where length is the length of the array. - * @param end index to stop filling the array at. If end is negative, it is treated as - * length+end. - */ - fill(value: number, start?: number, end?: number): this; - - /** - * Returns the elements of an array that meet the condition specified in a callback function. - * @param callbackfn A function that accepts up to three arguments. The filter method calls - * the callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - filter(callbackfn: (value: number, index: number, array: Int16Array) => any, thisArg?: any): Int16Array; - - /** - * Returns the value of the first element in the array where predicate is true, and undefined - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, find - * immediately returns that element value. Otherwise, find returns undefined. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - find(predicate: (value: number, index: number, obj: Int16Array) => boolean, thisArg?: any): number | undefined; - - /** - * Returns the index of the first element in the array where predicate is true, and -1 - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, - * findIndex immediately returns that element index. Otherwise, findIndex returns -1. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - findIndex(predicate: (value: number, index: number, obj: Int16Array) => boolean, thisArg?: any): number; - - /** - * Performs the specified action for each element in an array. - * @param callbackfn A function that accepts up to three arguments. forEach calls the - * callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - forEach(callbackfn: (value: number, index: number, array: Int16Array) => void, thisArg?: any): void; - /** - * Returns the index of the first occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the - * search starts at index 0. - */ - indexOf(searchElement: number, fromIndex?: number): number; - - /** - * Adds all the elements of an array separated by the specified separator string. - * @param separator A string used to separate one element of an array from the next in the - * resulting String. If omitted, the array elements are separated with a comma. - */ - join(separator?: string): string; - - /** - * Returns the index of the last occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the - * search starts at index 0. - */ - lastIndexOf(searchElement: number, fromIndex?: number): number; - - /** - * The length of the array. - */ - readonly length: number; - - /** - * Calls a defined callback function on each element of an array, and returns an array that - * contains the results. - * @param callbackfn A function that accepts up to three arguments. The map method calls the - * callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - map(callbackfn: (value: number, index: number, array: Int16Array) => number, thisArg?: any): Int16Array; - - /** - * Calls the specified callback function for all the elements in an array. The return value of - * the callback function is the accumulated result, and is provided as an argument in the next - * call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the - * callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int16Array) => number): number; - reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int16Array) => number, initialValue: number): number; - - /** - * Calls the specified callback function for all the elements in an array. The return value of - * the callback function is the accumulated result, and is provided as an argument in the next - * call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the - * callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int16Array) => U, initialValue: U): U; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. - * The return value of the callback function is the accumulated result, and is provided as an - * argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls - * the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an - * argument instead of an array value. - */ - reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int16Array) => number): number; - reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int16Array) => number, initialValue: number): number; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. - * The return value of the callback function is the accumulated result, and is provided as an - * argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls - * the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int16Array) => U, initialValue: U): U; - - /** - * Reverses the elements in an Array. - */ - reverse(): Int16Array; - - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. - */ - set(array: ArrayLike, offset?: number): void; - - /** - * Returns a section of an array. - * @param start The beginning of the specified portion of the array. - * @param end The end of the specified portion of the array. This is exclusive of the element at the index 'end'. - */ - slice(start?: number, end?: number): Int16Array; - - /** - * Determines whether the specified callback function returns true for any element of an array. - * @param callbackfn A function that accepts up to three arguments. The some method calls - * the callbackfn function for each element in the array until the callbackfn returns a value - * which is coercible to the Boolean value true, or until the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - some(callbackfn: (value: number, index: number, array: Int16Array) => unknown, thisArg?: any): boolean; - - /** - * Sorts an array. - * @param compareFn Function used to determine the order of the elements. It is expected to return - * a negative value if first argument is less than second argument, zero if they're equal and a positive - * value otherwise. If omitted, the elements are sorted in ascending, ASCII character order. - * ```ts - * [11,2,22,1].sort((a, b) => a - b) - * ``` - */ - sort(compareFn?: (a: number, b: number) => number): this; - - /** - * Gets a new Int16Array view of the ArrayBuffer store for this array, referencing the elements - * at begin, inclusive, up to end, exclusive. - * @param begin The index of the beginning of the array. - * @param end The index of the end of the array. - */ - subarray(begin?: number, end?: number): Int16Array; - - /** - * Converts a number to a string by using the current locale. - */ - toLocaleString(): string; - - /** - * Returns a string representation of an array. - */ - toString(): string; - - [index: number]: number; -} - -interface Int16ArrayConstructor { - readonly prototype: Int16Array; - new(length: number): Int16Array; - new(arrayOrArrayBuffer: ArrayLike | ArrayBufferLike): Int16Array; - new(buffer: ArrayBufferLike, byteOffset: number, length?: number): Int16Array; - - /** - * The size in bytes of each element in the array. - */ - readonly BYTES_PER_ELEMENT: number; - - /** - * Returns a new array from a set of elements. - * @param items A set of elements to include in the new array object. - */ - of(...items: number[]): Int16Array; - - /** - * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. - */ - from(arrayLike: ArrayLike): Int16Array; - - /** - * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. - * @param mapfn A mapping function to call on every element of the array. - * @param thisArg Value of 'this' used to invoke the mapfn. - */ - from(arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Int16Array; - - -} -declare var Int16Array: Int16ArrayConstructor; - -/** - * A typed array of 16-bit unsigned integer values. The contents are initialized to 0. If the - * requested number of bytes could not be allocated an exception is raised. - */ -interface Uint16Array { - /** - * The size in bytes of each element in the array. - */ - readonly BYTES_PER_ELEMENT: number; - - /** - * The ArrayBuffer instance referenced by the array. - */ - readonly buffer: ArrayBufferLike; - - /** - * The length in bytes of the array. - */ - readonly byteLength: number; - - /** - * The offset in bytes of the array. - */ - readonly byteOffset: number; - - /** - * Returns the this object after copying a section of the array identified by start and end - * to the same array starting at position target - * @param target If target is negative, it is treated as length+target where length is the - * length of the array. - * @param start If start is negative, it is treated as length+start. If end is negative, it - * is treated as length+end. - * @param end If not specified, length of the this object is used as its default value. - */ - copyWithin(target: number, start: number, end?: number): this; - - /** - * Determines whether all the members of an array satisfy the specified test. - * @param callbackfn A function that accepts up to three arguments. The every method calls - * the callbackfn function for each element in the array until the callbackfn returns a value - * which is coercible to the Boolean value false, or until the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - every(callbackfn: (value: number, index: number, array: Uint16Array) => unknown, thisArg?: any): boolean; - - /** - * Returns the this object after filling the section identified by start and end with value - * @param value value to fill array section with - * @param start index to start filling the array at. If start is negative, it is treated as - * length+start where length is the length of the array. - * @param end index to stop filling the array at. If end is negative, it is treated as - * length+end. - */ - fill(value: number, start?: number, end?: number): this; - - /** - * Returns the elements of an array that meet the condition specified in a callback function. - * @param callbackfn A function that accepts up to three arguments. The filter method calls - * the callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - filter(callbackfn: (value: number, index: number, array: Uint16Array) => any, thisArg?: any): Uint16Array; - - /** - * Returns the value of the first element in the array where predicate is true, and undefined - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, find - * immediately returns that element value. Otherwise, find returns undefined. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - find(predicate: (value: number, index: number, obj: Uint16Array) => boolean, thisArg?: any): number | undefined; - - /** - * Returns the index of the first element in the array where predicate is true, and -1 - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, - * findIndex immediately returns that element index. Otherwise, findIndex returns -1. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - findIndex(predicate: (value: number, index: number, obj: Uint16Array) => boolean, thisArg?: any): number; - - /** - * Performs the specified action for each element in an array. - * @param callbackfn A function that accepts up to three arguments. forEach calls the - * callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - forEach(callbackfn: (value: number, index: number, array: Uint16Array) => void, thisArg?: any): void; - - /** - * Returns the index of the first occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the - * search starts at index 0. - */ - indexOf(searchElement: number, fromIndex?: number): number; - - /** - * Adds all the elements of an array separated by the specified separator string. - * @param separator A string used to separate one element of an array from the next in the - * resulting String. If omitted, the array elements are separated with a comma. - */ - join(separator?: string): string; - - /** - * Returns the index of the last occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the - * search starts at index 0. - */ - lastIndexOf(searchElement: number, fromIndex?: number): number; - - /** - * The length of the array. - */ - readonly length: number; - - /** - * Calls a defined callback function on each element of an array, and returns an array that - * contains the results. - * @param callbackfn A function that accepts up to three arguments. The map method calls the - * callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - map(callbackfn: (value: number, index: number, array: Uint16Array) => number, thisArg?: any): Uint16Array; - - /** - * Calls the specified callback function for all the elements in an array. The return value of - * the callback function is the accumulated result, and is provided as an argument in the next - * call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the - * callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint16Array) => number): number; - reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint16Array) => number, initialValue: number): number; - - /** - * Calls the specified callback function for all the elements in an array. The return value of - * the callback function is the accumulated result, and is provided as an argument in the next - * call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the - * callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint16Array) => U, initialValue: U): U; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. - * The return value of the callback function is the accumulated result, and is provided as an - * argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls - * the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an - * argument instead of an array value. - */ - reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint16Array) => number): number; - reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint16Array) => number, initialValue: number): number; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. - * The return value of the callback function is the accumulated result, and is provided as an - * argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls - * the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint16Array) => U, initialValue: U): U; - - /** - * Reverses the elements in an Array. - */ - reverse(): Uint16Array; - - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. - */ - set(array: ArrayLike, offset?: number): void; - - /** - * Returns a section of an array. - * @param start The beginning of the specified portion of the array. - * @param end The end of the specified portion of the array. This is exclusive of the element at the index 'end'. - */ - slice(start?: number, end?: number): Uint16Array; - - /** - * Determines whether the specified callback function returns true for any element of an array. - * @param callbackfn A function that accepts up to three arguments. The some method calls - * the callbackfn function for each element in the array until the callbackfn returns a value - * which is coercible to the Boolean value true, or until the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - some(callbackfn: (value: number, index: number, array: Uint16Array) => unknown, thisArg?: any): boolean; - - /** - * Sorts an array. - * @param compareFn Function used to determine the order of the elements. It is expected to return - * a negative value if first argument is less than second argument, zero if they're equal and a positive - * value otherwise. If omitted, the elements are sorted in ascending, ASCII character order. - * ```ts - * [11,2,22,1].sort((a, b) => a - b) - * ``` - */ - sort(compareFn?: (a: number, b: number) => number): this; - - /** - * Gets a new Uint16Array view of the ArrayBuffer store for this array, referencing the elements - * at begin, inclusive, up to end, exclusive. - * @param begin The index of the beginning of the array. - * @param end The index of the end of the array. - */ - subarray(begin?: number, end?: number): Uint16Array; - - /** - * Converts a number to a string by using the current locale. - */ - toLocaleString(): string; - - /** - * Returns a string representation of an array. - */ - toString(): string; - - [index: number]: number; -} - -interface Uint16ArrayConstructor { - readonly prototype: Uint16Array; - new(length: number): Uint16Array; - new(arrayOrArrayBuffer: ArrayLike | ArrayBufferLike): Uint16Array; - new(buffer: ArrayBufferLike, byteOffset: number, length?: number): Uint16Array; - - /** - * The size in bytes of each element in the array. - */ - readonly BYTES_PER_ELEMENT: number; - - /** - * Returns a new array from a set of elements. - * @param items A set of elements to include in the new array object. - */ - of(...items: number[]): Uint16Array; - - /** - * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. - */ - from(arrayLike: ArrayLike): Uint16Array; - - /** - * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. - * @param mapfn A mapping function to call on every element of the array. - * @param thisArg Value of 'this' used to invoke the mapfn. - */ - from(arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Uint16Array; - - -} -declare var Uint16Array: Uint16ArrayConstructor; -/** - * A typed array of 32-bit signed integer values. The contents are initialized to 0. If the - * requested number of bytes could not be allocated an exception is raised. - */ -interface Int32Array { - /** - * The size in bytes of each element in the array. - */ - readonly BYTES_PER_ELEMENT: number; - - /** - * The ArrayBuffer instance referenced by the array. - */ - readonly buffer: ArrayBufferLike; - - /** - * The length in bytes of the array. - */ - readonly byteLength: number; - - /** - * The offset in bytes of the array. - */ - readonly byteOffset: number; - - /** - * Returns the this object after copying a section of the array identified by start and end - * to the same array starting at position target - * @param target If target is negative, it is treated as length+target where length is the - * length of the array. - * @param start If start is negative, it is treated as length+start. If end is negative, it - * is treated as length+end. - * @param end If not specified, length of the this object is used as its default value. - */ - copyWithin(target: number, start: number, end?: number): this; - - /** - * Determines whether all the members of an array satisfy the specified test. - * @param callbackfn A function that accepts up to three arguments. The every method calls - * the callbackfn function for each element in the array until the callbackfn returns a value - * which is coercible to the Boolean value false, or until the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - every(callbackfn: (value: number, index: number, array: Int32Array) => unknown, thisArg?: any): boolean; - - /** - * Returns the this object after filling the section identified by start and end with value - * @param value value to fill array section with - * @param start index to start filling the array at. If start is negative, it is treated as - * length+start where length is the length of the array. - * @param end index to stop filling the array at. If end is negative, it is treated as - * length+end. - */ - fill(value: number, start?: number, end?: number): this; - - /** - * Returns the elements of an array that meet the condition specified in a callback function. - * @param callbackfn A function that accepts up to three arguments. The filter method calls - * the callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - filter(callbackfn: (value: number, index: number, array: Int32Array) => any, thisArg?: any): Int32Array; - - /** - * Returns the value of the first element in the array where predicate is true, and undefined - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, find - * immediately returns that element value. Otherwise, find returns undefined. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - find(predicate: (value: number, index: number, obj: Int32Array) => boolean, thisArg?: any): number | undefined; - - /** - * Returns the index of the first element in the array where predicate is true, and -1 - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, - * findIndex immediately returns that element index. Otherwise, findIndex returns -1. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - findIndex(predicate: (value: number, index: number, obj: Int32Array) => boolean, thisArg?: any): number; - - /** - * Performs the specified action for each element in an array. - * @param callbackfn A function that accepts up to three arguments. forEach calls the - * callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - forEach(callbackfn: (value: number, index: number, array: Int32Array) => void, thisArg?: any): void; - - /** - * Returns the index of the first occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the - * search starts at index 0. - */ - indexOf(searchElement: number, fromIndex?: number): number; - - /** - * Adds all the elements of an array separated by the specified separator string. - * @param separator A string used to separate one element of an array from the next in the - * resulting String. If omitted, the array elements are separated with a comma. - */ - join(separator?: string): string; - - /** - * Returns the index of the last occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the - * search starts at index 0. - */ - lastIndexOf(searchElement: number, fromIndex?: number): number; - - /** - * The length of the array. - */ - readonly length: number; - - /** - * Calls a defined callback function on each element of an array, and returns an array that - * contains the results. - * @param callbackfn A function that accepts up to three arguments. The map method calls the - * callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - map(callbackfn: (value: number, index: number, array: Int32Array) => number, thisArg?: any): Int32Array; - - /** - * Calls the specified callback function for all the elements in an array. The return value of - * the callback function is the accumulated result, and is provided as an argument in the next - * call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the - * callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int32Array) => number): number; - reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int32Array) => number, initialValue: number): number; - - /** - * Calls the specified callback function for all the elements in an array. The return value of - * the callback function is the accumulated result, and is provided as an argument in the next - * call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the - * callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int32Array) => U, initialValue: U): U; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. - * The return value of the callback function is the accumulated result, and is provided as an - * argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls - * the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an - * argument instead of an array value. - */ - reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int32Array) => number): number; - reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int32Array) => number, initialValue: number): number; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. - * The return value of the callback function is the accumulated result, and is provided as an - * argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls - * the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int32Array) => U, initialValue: U): U; - - /** - * Reverses the elements in an Array. - */ - reverse(): Int32Array; - - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. - */ - set(array: ArrayLike, offset?: number): void; - - /** - * Returns a section of an array. - * @param start The beginning of the specified portion of the array. - * @param end The end of the specified portion of the array. This is exclusive of the element at the index 'end'. - */ - slice(start?: number, end?: number): Int32Array; - - /** - * Determines whether the specified callback function returns true for any element of an array. - * @param callbackfn A function that accepts up to three arguments. The some method calls - * the callbackfn function for each element in the array until the callbackfn returns a value - * which is coercible to the Boolean value true, or until the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - some(callbackfn: (value: number, index: number, array: Int32Array) => unknown, thisArg?: any): boolean; - - /** - * Sorts an array. - * @param compareFn Function used to determine the order of the elements. It is expected to return - * a negative value if first argument is less than second argument, zero if they're equal and a positive - * value otherwise. If omitted, the elements are sorted in ascending, ASCII character order. - * ```ts - * [11,2,22,1].sort((a, b) => a - b) - * ``` - */ - sort(compareFn?: (a: number, b: number) => number): this; - - /** - * Gets a new Int32Array view of the ArrayBuffer store for this array, referencing the elements - * at begin, inclusive, up to end, exclusive. - * @param begin The index of the beginning of the array. - * @param end The index of the end of the array. - */ - subarray(begin?: number, end?: number): Int32Array; - - /** - * Converts a number to a string by using the current locale. - */ - toLocaleString(): string; - - /** - * Returns a string representation of an array. - */ - toString(): string; - - [index: number]: number; -} - -interface Int32ArrayConstructor { - readonly prototype: Int32Array; - new(length: number): Int32Array; - new(arrayOrArrayBuffer: ArrayLike | ArrayBufferLike): Int32Array; - new(buffer: ArrayBufferLike, byteOffset: number, length?: number): Int32Array; - - /** - * The size in bytes of each element in the array. - */ - readonly BYTES_PER_ELEMENT: number; - - /** - * Returns a new array from a set of elements. - * @param items A set of elements to include in the new array object. - */ - of(...items: number[]): Int32Array; - - /** - * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. - */ - from(arrayLike: ArrayLike): Int32Array; - - /** - * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. - * @param mapfn A mapping function to call on every element of the array. - * @param thisArg Value of 'this' used to invoke the mapfn. - */ - from(arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Int32Array; - -} -declare var Int32Array: Int32ArrayConstructor; - -/** - * A typed array of 32-bit unsigned integer values. The contents are initialized to 0. If the - * requested number of bytes could not be allocated an exception is raised. - */ -interface Uint32Array { - /** - * The size in bytes of each element in the array. - */ - readonly BYTES_PER_ELEMENT: number; - - /** - * The ArrayBuffer instance referenced by the array. - */ - readonly buffer: ArrayBufferLike; - - /** - * The length in bytes of the array. - */ - readonly byteLength: number; - - /** - * The offset in bytes of the array. - */ - readonly byteOffset: number; - - /** - * Returns the this object after copying a section of the array identified by start and end - * to the same array starting at position target - * @param target If target is negative, it is treated as length+target where length is the - * length of the array. - * @param start If start is negative, it is treated as length+start. If end is negative, it - * is treated as length+end. - * @param end If not specified, length of the this object is used as its default value. - */ - copyWithin(target: number, start: number, end?: number): this; - - /** - * Determines whether all the members of an array satisfy the specified test. - * @param callbackfn A function that accepts up to three arguments. The every method calls - * the callbackfn function for each element in the array until the callbackfn returns a value - * which is coercible to the Boolean value false, or until the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - every(callbackfn: (value: number, index: number, array: Uint32Array) => unknown, thisArg?: any): boolean; - - /** - * Returns the this object after filling the section identified by start and end with value - * @param value value to fill array section with - * @param start index to start filling the array at. If start is negative, it is treated as - * length+start where length is the length of the array. - * @param end index to stop filling the array at. If end is negative, it is treated as - * length+end. - */ - fill(value: number, start?: number, end?: number): this; - - /** - * Returns the elements of an array that meet the condition specified in a callback function. - * @param callbackfn A function that accepts up to three arguments. The filter method calls - * the callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - filter(callbackfn: (value: number, index: number, array: Uint32Array) => any, thisArg?: any): Uint32Array; - - /** - * Returns the value of the first element in the array where predicate is true, and undefined - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, find - * immediately returns that element value. Otherwise, find returns undefined. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - find(predicate: (value: number, index: number, obj: Uint32Array) => boolean, thisArg?: any): number | undefined; - - /** - * Returns the index of the first element in the array where predicate is true, and -1 - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, - * findIndex immediately returns that element index. Otherwise, findIndex returns -1. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - findIndex(predicate: (value: number, index: number, obj: Uint32Array) => boolean, thisArg?: any): number; - - /** - * Performs the specified action for each element in an array. - * @param callbackfn A function that accepts up to three arguments. forEach calls the - * callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - forEach(callbackfn: (value: number, index: number, array: Uint32Array) => void, thisArg?: any): void; - /** - * Returns the index of the first occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the - * search starts at index 0. - */ - indexOf(searchElement: number, fromIndex?: number): number; - - /** - * Adds all the elements of an array separated by the specified separator string. - * @param separator A string used to separate one element of an array from the next in the - * resulting String. If omitted, the array elements are separated with a comma. - */ - join(separator?: string): string; - - /** - * Returns the index of the last occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the - * search starts at index 0. - */ - lastIndexOf(searchElement: number, fromIndex?: number): number; - - /** - * The length of the array. - */ - readonly length: number; - - /** - * Calls a defined callback function on each element of an array, and returns an array that - * contains the results. - * @param callbackfn A function that accepts up to three arguments. The map method calls the - * callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - map(callbackfn: (value: number, index: number, array: Uint32Array) => number, thisArg?: any): Uint32Array; - - /** - * Calls the specified callback function for all the elements in an array. The return value of - * the callback function is the accumulated result, and is provided as an argument in the next - * call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the - * callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint32Array) => number): number; - reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint32Array) => number, initialValue: number): number; - - /** - * Calls the specified callback function for all the elements in an array. The return value of - * the callback function is the accumulated result, and is provided as an argument in the next - * call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the - * callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint32Array) => U, initialValue: U): U; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. - * The return value of the callback function is the accumulated result, and is provided as an - * argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls - * the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an - * argument instead of an array value. - */ - reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint32Array) => number): number; - reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint32Array) => number, initialValue: number): number; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. - * The return value of the callback function is the accumulated result, and is provided as an - * argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls - * the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint32Array) => U, initialValue: U): U; - - /** - * Reverses the elements in an Array. - */ - reverse(): Uint32Array; - - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. - */ - set(array: ArrayLike, offset?: number): void; - - /** - * Returns a section of an array. - * @param start The beginning of the specified portion of the array. - * @param end The end of the specified portion of the array. This is exclusive of the element at the index 'end'. - */ - slice(start?: number, end?: number): Uint32Array; - - /** - * Determines whether the specified callback function returns true for any element of an array. - * @param callbackfn A function that accepts up to three arguments. The some method calls - * the callbackfn function for each element in the array until the callbackfn returns a value - * which is coercible to the Boolean value true, or until the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - some(callbackfn: (value: number, index: number, array: Uint32Array) => unknown, thisArg?: any): boolean; - - /** - * Sorts an array. - * @param compareFn Function used to determine the order of the elements. It is expected to return - * a negative value if first argument is less than second argument, zero if they're equal and a positive - * value otherwise. If omitted, the elements are sorted in ascending, ASCII character order. - * ```ts - * [11,2,22,1].sort((a, b) => a - b) - * ``` - */ - sort(compareFn?: (a: number, b: number) => number): this; - - /** - * Gets a new Uint32Array view of the ArrayBuffer store for this array, referencing the elements - * at begin, inclusive, up to end, exclusive. - * @param begin The index of the beginning of the array. - * @param end The index of the end of the array. - */ - subarray(begin?: number, end?: number): Uint32Array; - - /** - * Converts a number to a string by using the current locale. - */ - toLocaleString(): string; - - /** - * Returns a string representation of an array. - */ - toString(): string; - - [index: number]: number; -} - -interface Uint32ArrayConstructor { - readonly prototype: Uint32Array; - new(length: number): Uint32Array; - new(arrayOrArrayBuffer: ArrayLike | ArrayBufferLike): Uint32Array; - new(buffer: ArrayBufferLike, byteOffset: number, length?: number): Uint32Array; - - /** - * The size in bytes of each element in the array. - */ - readonly BYTES_PER_ELEMENT: number; - - /** - * Returns a new array from a set of elements. - * @param items A set of elements to include in the new array object. - */ - of(...items: number[]): Uint32Array; - - /** - * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. - */ - from(arrayLike: ArrayLike): Uint32Array; - - /** - * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. - * @param mapfn A mapping function to call on every element of the array. - * @param thisArg Value of 'this' used to invoke the mapfn. - */ - from(arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Uint32Array; - -} -declare var Uint32Array: Uint32ArrayConstructor; - -/** - * A typed array of 32-bit float values. The contents are initialized to 0. If the requested number - * of bytes could not be allocated an exception is raised. - */ -interface Float32Array { - /** - * The size in bytes of each element in the array. - */ - readonly BYTES_PER_ELEMENT: number; - - /** - * The ArrayBuffer instance referenced by the array. - */ - readonly buffer: ArrayBufferLike; - - /** - * The length in bytes of the array. - */ - readonly byteLength: number; - - /** - * The offset in bytes of the array. - */ - readonly byteOffset: number; - - /** - * Returns the this object after copying a section of the array identified by start and end - * to the same array starting at position target - * @param target If target is negative, it is treated as length+target where length is the - * length of the array. - * @param start If start is negative, it is treated as length+start. If end is negative, it - * is treated as length+end. - * @param end If not specified, length of the this object is used as its default value. - */ - copyWithin(target: number, start: number, end?: number): this; - - /** - * Determines whether all the members of an array satisfy the specified test. - * @param callbackfn A function that accepts up to three arguments. The every method calls - * the callbackfn function for each element in the array until the callbackfn returns a value - * which is coercible to the Boolean value false, or until the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - every(callbackfn: (value: number, index: number, array: Float32Array) => unknown, thisArg?: any): boolean; - - /** - * Returns the this object after filling the section identified by start and end with value - * @param value value to fill array section with - * @param start index to start filling the array at. If start is negative, it is treated as - * length+start where length is the length of the array. - * @param end index to stop filling the array at. If end is negative, it is treated as - * length+end. - */ - fill(value: number, start?: number, end?: number): this; - - /** - * Returns the elements of an array that meet the condition specified in a callback function. - * @param callbackfn A function that accepts up to three arguments. The filter method calls - * the callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - filter(callbackfn: (value: number, index: number, array: Float32Array) => any, thisArg?: any): Float32Array; - - /** - * Returns the value of the first element in the array where predicate is true, and undefined - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, find - * immediately returns that element value. Otherwise, find returns undefined. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - find(predicate: (value: number, index: number, obj: Float32Array) => boolean, thisArg?: any): number | undefined; - - /** - * Returns the index of the first element in the array where predicate is true, and -1 - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, - * findIndex immediately returns that element index. Otherwise, findIndex returns -1. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - findIndex(predicate: (value: number, index: number, obj: Float32Array) => boolean, thisArg?: any): number; - - /** - * Performs the specified action for each element in an array. - * @param callbackfn A function that accepts up to three arguments. forEach calls the - * callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - forEach(callbackfn: (value: number, index: number, array: Float32Array) => void, thisArg?: any): void; - - /** - * Returns the index of the first occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the - * search starts at index 0. - */ - indexOf(searchElement: number, fromIndex?: number): number; - - /** - * Adds all the elements of an array separated by the specified separator string. - * @param separator A string used to separate one element of an array from the next in the - * resulting String. If omitted, the array elements are separated with a comma. - */ - join(separator?: string): string; - - /** - * Returns the index of the last occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the - * search starts at index 0. - */ - lastIndexOf(searchElement: number, fromIndex?: number): number; - - /** - * The length of the array. - */ - readonly length: number; - - /** - * Calls a defined callback function on each element of an array, and returns an array that - * contains the results. - * @param callbackfn A function that accepts up to three arguments. The map method calls the - * callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - map(callbackfn: (value: number, index: number, array: Float32Array) => number, thisArg?: any): Float32Array; - - /** - * Calls the specified callback function for all the elements in an array. The return value of - * the callback function is the accumulated result, and is provided as an argument in the next - * call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the - * callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float32Array) => number): number; - reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float32Array) => number, initialValue: number): number; - - /** - * Calls the specified callback function for all the elements in an array. The return value of - * the callback function is the accumulated result, and is provided as an argument in the next - * call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the - * callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float32Array) => U, initialValue: U): U; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. - * The return value of the callback function is the accumulated result, and is provided as an - * argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls - * the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an - * argument instead of an array value. - */ - reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float32Array) => number): number; - reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float32Array) => number, initialValue: number): number; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. - * The return value of the callback function is the accumulated result, and is provided as an - * argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls - * the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float32Array) => U, initialValue: U): U; - - /** - * Reverses the elements in an Array. - */ - reverse(): Float32Array; - - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. - */ - set(array: ArrayLike, offset?: number): void; - - /** - * Returns a section of an array. - * @param start The beginning of the specified portion of the array. - * @param end The end of the specified portion of the array. This is exclusive of the element at the index 'end'. - */ - slice(start?: number, end?: number): Float32Array; - - /** - * Determines whether the specified callback function returns true for any element of an array. - * @param callbackfn A function that accepts up to three arguments. The some method calls - * the callbackfn function for each element in the array until the callbackfn returns a value - * which is coercible to the Boolean value true, or until the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - some(callbackfn: (value: number, index: number, array: Float32Array) => unknown, thisArg?: any): boolean; - - /** - * Sorts an array. - * @param compareFn Function used to determine the order of the elements. It is expected to return - * a negative value if first argument is less than second argument, zero if they're equal and a positive - * value otherwise. If omitted, the elements are sorted in ascending, ASCII character order. - * ```ts - * [11,2,22,1].sort((a, b) => a - b) - * ``` - */ - sort(compareFn?: (a: number, b: number) => number): this; - - /** - * Gets a new Float32Array view of the ArrayBuffer store for this array, referencing the elements - * at begin, inclusive, up to end, exclusive. - * @param begin The index of the beginning of the array. - * @param end The index of the end of the array. - */ - subarray(begin?: number, end?: number): Float32Array; - - /** - * Converts a number to a string by using the current locale. - */ - toLocaleString(): string; - - /** - * Returns a string representation of an array. - */ - toString(): string; - - [index: number]: number; -} - -interface Float32ArrayConstructor { - readonly prototype: Float32Array; - new(length: number): Float32Array; - new(arrayOrArrayBuffer: ArrayLike | ArrayBufferLike): Float32Array; - new(buffer: ArrayBufferLike, byteOffset: number, length?: number): Float32Array; - - /** - * The size in bytes of each element in the array. - */ - readonly BYTES_PER_ELEMENT: number; - - /** - * Returns a new array from a set of elements. - * @param items A set of elements to include in the new array object. - */ - of(...items: number[]): Float32Array; - - /** - * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. - */ - from(arrayLike: ArrayLike): Float32Array; - - /** - * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. - * @param mapfn A mapping function to call on every element of the array. - * @param thisArg Value of 'this' used to invoke the mapfn. - */ - from(arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Float32Array; - - -} -declare var Float32Array: Float32ArrayConstructor; - -/** - * A typed array of 64-bit float values. The contents are initialized to 0. If the requested - * number of bytes could not be allocated an exception is raised. - */ -interface Float64Array { - /** - * The size in bytes of each element in the array. - */ - readonly BYTES_PER_ELEMENT: number; - - /** - * The ArrayBuffer instance referenced by the array. - */ - readonly buffer: ArrayBufferLike; - - /** - * The length in bytes of the array. - */ - readonly byteLength: number; - - /** - * The offset in bytes of the array. - */ - readonly byteOffset: number; - - /** - * Returns the this object after copying a section of the array identified by start and end - * to the same array starting at position target - * @param target If target is negative, it is treated as length+target where length is the - * length of the array. - * @param start If start is negative, it is treated as length+start. If end is negative, it - * is treated as length+end. - * @param end If not specified, length of the this object is used as its default value. - */ - copyWithin(target: number, start: number, end?: number): this; - - /** - * Determines whether all the members of an array satisfy the specified test. - * @param callbackfn A function that accepts up to three arguments. The every method calls - * the callbackfn function for each element in the array until the callbackfn returns a value - * which is coercible to the Boolean value false, or until the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - every(callbackfn: (value: number, index: number, array: Float64Array) => unknown, thisArg?: any): boolean; - - /** - * Returns the this object after filling the section identified by start and end with value - * @param value value to fill array section with - * @param start index to start filling the array at. If start is negative, it is treated as - * length+start where length is the length of the array. - * @param end index to stop filling the array at. If end is negative, it is treated as - * length+end. - */ - fill(value: number, start?: number, end?: number): this; - - /** - * Returns the elements of an array that meet the condition specified in a callback function. - * @param callbackfn A function that accepts up to three arguments. The filter method calls - * the callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - filter(callbackfn: (value: number, index: number, array: Float64Array) => any, thisArg?: any): Float64Array; - - /** - * Returns the value of the first element in the array where predicate is true, and undefined - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, find - * immediately returns that element value. Otherwise, find returns undefined. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - find(predicate: (value: number, index: number, obj: Float64Array) => boolean, thisArg?: any): number | undefined; - - /** - * Returns the index of the first element in the array where predicate is true, and -1 - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, - * findIndex immediately returns that element index. Otherwise, findIndex returns -1. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - findIndex(predicate: (value: number, index: number, obj: Float64Array) => boolean, thisArg?: any): number; - - /** - * Performs the specified action for each element in an array. - * @param callbackfn A function that accepts up to three arguments. forEach calls the - * callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - forEach(callbackfn: (value: number, index: number, array: Float64Array) => void, thisArg?: any): void; - - /** - * Returns the index of the first occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the - * search starts at index 0. - */ - indexOf(searchElement: number, fromIndex?: number): number; - - /** - * Adds all the elements of an array separated by the specified separator string. - * @param separator A string used to separate one element of an array from the next in the - * resulting String. If omitted, the array elements are separated with a comma. - */ - join(separator?: string): string; - - /** - * Returns the index of the last occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the - * search starts at index 0. - */ - lastIndexOf(searchElement: number, fromIndex?: number): number; - - /** - * The length of the array. - */ - readonly length: number; - - /** - * Calls a defined callback function on each element of an array, and returns an array that - * contains the results. - * @param callbackfn A function that accepts up to three arguments. The map method calls the - * callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - map(callbackfn: (value: number, index: number, array: Float64Array) => number, thisArg?: any): Float64Array; - - /** - * Calls the specified callback function for all the elements in an array. The return value of - * the callback function is the accumulated result, and is provided as an argument in the next - * call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the - * callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float64Array) => number): number; - reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float64Array) => number, initialValue: number): number; - - /** - * Calls the specified callback function for all the elements in an array. The return value of - * the callback function is the accumulated result, and is provided as an argument in the next - * call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the - * callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float64Array) => U, initialValue: U): U; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. - * The return value of the callback function is the accumulated result, and is provided as an - * argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls - * the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an - * argument instead of an array value. - */ - reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float64Array) => number): number; - reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float64Array) => number, initialValue: number): number; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. - * The return value of the callback function is the accumulated result, and is provided as an - * argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls - * the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float64Array) => U, initialValue: U): U; - - /** - * Reverses the elements in an Array. - */ - reverse(): Float64Array; - - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. - */ - set(array: ArrayLike, offset?: number): void; - - /** - * Returns a section of an array. - * @param start The beginning of the specified portion of the array. - * @param end The end of the specified portion of the array. This is exclusive of the element at the index 'end'. - */ - slice(start?: number, end?: number): Float64Array; - - /** - * Determines whether the specified callback function returns true for any element of an array. - * @param callbackfn A function that accepts up to three arguments. The some method calls - * the callbackfn function for each element in the array until the callbackfn returns a value - * which is coercible to the Boolean value true, or until the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - some(callbackfn: (value: number, index: number, array: Float64Array) => unknown, thisArg?: any): boolean; - - /** - * Sorts an array. - * @param compareFn Function used to determine the order of the elements. It is expected to return - * a negative value if first argument is less than second argument, zero if they're equal and a positive - * value otherwise. If omitted, the elements are sorted in ascending, ASCII character order. - * ```ts - * [11,2,22,1].sort((a, b) => a - b) - * ``` - */ - sort(compareFn?: (a: number, b: number) => number): this; - - /** - * at begin, inclusive, up to end, exclusive. - * @param begin The index of the beginning of the array. - * @param end The index of the end of the array. - */ - subarray(begin?: number, end?: number): Float64Array; - - toString(): string; - - [index: number]: number; -} - -interface Float64ArrayConstructor { - readonly prototype: Float64Array; - new(length: number): Float64Array; - new(arrayOrArrayBuffer: ArrayLike | ArrayBufferLike): Float64Array; - new(buffer: ArrayBufferLike, byteOffset: number, length?: number): Float64Array; - - /** - * The size in bytes of each element in the array. - */ - readonly BYTES_PER_ELEMENT: number; - - /** - * Returns a new array from a set of elements. - * @param items A set of elements to include in the new array object. - */ - of(...items: number[]): Float64Array; - - /** - * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. - */ - from(arrayLike: ArrayLike): Float64Array; - - /** - * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. - * @param mapfn A mapping function to call on every element of the array. - * @param thisArg Value of 'this' used to invoke the mapfn. - */ - from(arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Float64Array; - -} -declare var Float64Array: Float64ArrayConstructor; - -///////////////////////////// -/// ECMAScript Internationalization API -///////////////////////////// - -declare namespace Intl { - interface CollatorOptions { - usage?: string; - localeMatcher?: string; - numeric?: boolean; - caseFirst?: string; - sensitivity?: string; - ignorePunctuation?: boolean; - } - - interface ResolvedCollatorOptions { - locale: string; - usage: string; - sensitivity: string; - ignorePunctuation: boolean; - collation: string; - caseFirst: string; - numeric: boolean; - } - - interface Collator { - compare(x: string, y: string): number; - resolvedOptions(): ResolvedCollatorOptions; - } - var Collator: { - new(locales?: string | string[], options?: CollatorOptions): Collator; - (locales?: string | string[], options?: CollatorOptions): Collator; - supportedLocalesOf(locales: string | string[], options?: CollatorOptions): string[]; - }; - - interface NumberFormatOptions { - localeMatcher?: string; - style?: string; - currency?: string; - currencyDisplay?: string; - useGrouping?: boolean; - minimumIntegerDigits?: number; - minimumFractionDigits?: number; - maximumFractionDigits?: number; - minimumSignificantDigits?: number; - maximumSignificantDigits?: number; - } - - interface ResolvedNumberFormatOptions { - locale: string; - numberingSystem: string; - style: string; - currency?: string; - currencyDisplay?: string; - minimumIntegerDigits: number; - minimumFractionDigits: number; - maximumFractionDigits: number; - minimumSignificantDigits?: number; - maximumSignificantDigits?: number; - useGrouping: boolean; - } - - interface NumberFormat { - format(value: number): string; - resolvedOptions(): ResolvedNumberFormatOptions; - } - var NumberFormat: { - new(locales?: string | string[], options?: NumberFormatOptions): NumberFormat; - (locales?: string | string[], options?: NumberFormatOptions): NumberFormat; - supportedLocalesOf(locales: string | string[], options?: NumberFormatOptions): string[]; - }; - - interface DateTimeFormatOptions { - localeMatcher?: string; - weekday?: string; - era?: string; - year?: string; - month?: string; - day?: string; - hour?: string; - minute?: string; - second?: string; - timeZoneName?: string; - formatMatcher?: string; - hour12?: boolean; - timeZone?: string; - } - - interface ResolvedDateTimeFormatOptions { - locale: string; - calendar: string; - numberingSystem: string; - timeZone: string; - hour12?: boolean; - weekday?: string; - era?: string; - year?: string; - month?: string; - day?: string; - hour?: string; - minute?: string; - second?: string; - timeZoneName?: string; - } - - interface DateTimeFormat { - format(date?: Date | number): string; - resolvedOptions(): ResolvedDateTimeFormatOptions; - } - var DateTimeFormat: { - new(locales?: string | string[], options?: DateTimeFormatOptions): DateTimeFormat; - (locales?: string | string[], options?: DateTimeFormatOptions): DateTimeFormat; - supportedLocalesOf(locales: string | string[], options?: DateTimeFormatOptions): string[]; - }; -} - -interface String { - /** - * Determines whether two strings are equivalent in the current or specified locale. - * @param that String to compare to target string - * @param locales A locale string or array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used. This parameter must conform to BCP 47 standards; see the Intl.Collator object for details. - * @param options An object that contains one or more properties that specify comparison options. see the Intl.Collator object for details. - */ - localeCompare(that: string, locales?: string | string[], options?: Intl.CollatorOptions): number; -} - -interface Number { - /** - * Converts a number to a string by using the current or specified locale. - * @param locales A locale string or array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used. - * @param options An object that contains one or more properties that specify comparison options. - */ - toLocaleString(locales?: string | string[], options?: Intl.NumberFormatOptions): string; -} - -interface Date { - /** - * Converts a date and time to a string by using the current or specified locale. - * @param locales A locale string or array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used. - * @param options An object that contains one or more properties that specify comparison options. - */ - toLocaleString(locales?: string | string[], options?: Intl.DateTimeFormatOptions): string; - /** - * Converts a date to a string by using the current or specified locale. - * @param locales A locale string or array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used. - * @param options An object that contains one or more properties that specify comparison options. - */ - toLocaleDateString(locales?: string | string[], options?: Intl.DateTimeFormatOptions): string; - - /** - * Converts a time to a string by using the current or specified locale. - * @param locales A locale string or array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used. - * @param options An object that contains one or more properties that specify comparison options. - */ - toLocaleTimeString(locales?: string | string[], options?: Intl.DateTimeFormatOptions): string; -} +/// + + +///////////////////////////// +/// ECMAScript APIs +///////////////////////////// + +declare var NaN: number; +declare var Infinity: number; + +/** + * Evaluates JavaScript code and executes it. + * @param x A String value that contains valid JavaScript code. + */ +declare function eval(x: string): any; + +/** + * Converts a string to an integer. + * @param s A string to convert into a number. + * @param radix A value between 2 and 36 that specifies the base of the number in numString. + * If this argument is not supplied, strings with a prefix of '0x' are considered hexadecimal. + * All other strings are considered decimal. + */ +declare function parseInt(s: string, radix?: number): number; + +/** + * Converts a string to a floating-point number. + * @param string A string that contains a floating-point number. + */ +declare function parseFloat(string: string): number; + +/** + * Returns a Boolean value that indicates whether a value is the reserved value NaN (not a number). + * @param number A numeric value. + */ +declare function isNaN(number: number): boolean; + +/** + * Determines whether a supplied number is finite. + * @param number Any numeric value. + */ +declare function isFinite(number: number): boolean; + +/** + * Gets the unencoded version of an encoded Uniform Resource Identifier (URI). + * @param encodedURI A value representing an encoded URI. + */ +declare function decodeURI(encodedURI: string): string; + +/** + * Gets the unencoded version of an encoded component of a Uniform Resource Identifier (URI). + * @param encodedURIComponent A value representing an encoded URI component. + */ +declare function decodeURIComponent(encodedURIComponent: string): string; + +/** + * Encodes a text string as a valid Uniform Resource Identifier (URI) + * @param uri A value representing an encoded URI. + */ +declare function encodeURI(uri: string): string; + +/** + * Encodes a text string as a valid component of a Uniform Resource Identifier (URI). + * @param uriComponent A value representing an encoded URI component. + */ +declare function encodeURIComponent(uriComponent: string | number | boolean): string; + +/** + * Computes a new string in which certain characters have been replaced by a hexadecimal escape sequence. + * @param string A string value + */ +declare function escape(string: string): string; + +/** + * Computes a new string in which hexadecimal escape sequences are replaced with the character that it represents. + * @param string A string value + */ +declare function unescape(string: string): string; + +interface Symbol { + /** Returns a string representation of an object. */ + toString(): string; + + /** Returns the primitive value of the specified object. */ + valueOf(): symbol; +} + +declare type PropertyKey = string | number | symbol; + +interface PropertyDescriptor { + configurable?: boolean; + enumerable?: boolean; + value?: any; + writable?: boolean; + get?(): any; + set?(v: any): void; +} + +interface PropertyDescriptorMap { + [s: string]: PropertyDescriptor; +} + +interface Object { + /** The initial value of Object.prototype.constructor is the standard built-in Object constructor. */ + constructor: Function; + + /** Returns a string representation of an object. */ + toString(): string; + + /** Returns a date converted to a string using the current locale. */ + toLocaleString(): string; + + /** Returns the primitive value of the specified object. */ + valueOf(): Object; + + /** + * Determines whether an object has a property with the specified name. + * @param v A property name. + */ + hasOwnProperty(v: PropertyKey): boolean; + + /** + * Determines whether an object exists in another object's prototype chain. + * @param v Another object whose prototype chain is to be checked. + */ + isPrototypeOf(v: Object): boolean; + + /** + * Determines whether a specified property is enumerable. + * @param v A property name. + */ + propertyIsEnumerable(v: PropertyKey): boolean; +} + +interface ObjectConstructor { + new(value?: any): Object; + (): any; + (value: any): any; + + /** A reference to the prototype for a class of objects. */ + readonly prototype: Object; + + /** + * Returns the prototype of an object. + * @param o The object that references the prototype. + */ + getPrototypeOf(o: any): any; + + /** + * Gets the own property descriptor of the specified object. + * An own property descriptor is one that is defined directly on the object and is not inherited from the object's prototype. + * @param o Object that contains the property. + * @param p Name of the property. + */ + getOwnPropertyDescriptor(o: any, p: PropertyKey): PropertyDescriptor | undefined; + + /** + * Returns the names of the own properties of an object. The own properties of an object are those that are defined directly + * on that object, and are not inherited from the object's prototype. The properties of an object include both fields (objects) and functions. + * @param o Object that contains the own properties. + */ + getOwnPropertyNames(o: any): string[]; + + /** + * Creates an object that has the specified prototype or that has null prototype. + * @param o Object to use as a prototype. May be null. + */ + create(o: object | null): any; + + /** + * Creates an object that has the specified prototype, and that optionally contains specified properties. + * @param o Object to use as a prototype. May be null + * @param properties JavaScript object that contains one or more property descriptors. + */ + create(o: object | null, properties: PropertyDescriptorMap & ThisType): any; + + /** + * Adds a property to an object, or modifies attributes of an existing property. + * @param o Object on which to add or modify the property. This can be a native JavaScript object (that is, a user-defined object or a built in object) or a DOM object. + * @param p The property name. + * @param attributes Descriptor for the property. It can be for a data property or an accessor property. + */ + defineProperty(o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType): any; + + /** + * Adds one or more properties to an object, and/or modifies attributes of existing properties. + * @param o Object on which to add or modify the properties. This can be a native JavaScript object or a DOM object. + * @param properties JavaScript object that contains one or more descriptor objects. Each descriptor object describes a data property or an accessor property. + */ + defineProperties(o: any, properties: PropertyDescriptorMap & ThisType): any; + + /** + * Prevents the modification of attributes of existing properties, and prevents the addition of new properties. + * @param o Object on which to lock the attributes. + */ + seal(o: T): T; + + /** + * Prevents the modification of existing property attributes and values, and prevents the addition of new properties. + * @param o Object on which to lock the attributes. + */ + freeze(a: T[]): readonly T[]; + + /** + * Prevents the modification of existing property attributes and values, and prevents the addition of new properties. + * @param o Object on which to lock the attributes. + */ + freeze(f: T): T; + + /** + * Prevents the modification of existing property attributes and values, and prevents the addition of new properties. + * @param o Object on which to lock the attributes. + */ + freeze(o: T): Readonly; + + /** + * Prevents the addition of new properties to an object. + * @param o Object to make non-extensible. + */ + preventExtensions(o: T): T; + + /** + * Returns true if existing property attributes cannot be modified in an object and new properties cannot be added to the object. + * @param o Object to test. + */ + isSealed(o: any): boolean; + + /** + * Returns true if existing property attributes and values cannot be modified in an object, and new properties cannot be added to the object. + * @param o Object to test. + */ + isFrozen(o: any): boolean; + + /** + * Returns a value that indicates whether new properties can be added to an object. + * @param o Object to test. + */ + isExtensible(o: any): boolean; + + /** + * Returns the names of the enumerable string properties and methods of an object. + * @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object. + */ + keys(o: object): string[]; +} + +/** + * Provides functionality common to all JavaScript objects. + */ +declare var Object: ObjectConstructor; + +/** + * Creates a new function. + */ +interface Function { + /** + * Calls the function, substituting the specified object for the this value of the function, and the specified array for the arguments of the function. + * @param thisArg The object to be used as the this object. + * @param argArray A set of arguments to be passed to the function. + */ + apply(this: Function, thisArg: any, argArray?: any): any; + + /** + * Calls a method of an object, substituting another object for the current object. + * @param thisArg The object to be used as the current object. + * @param argArray A list of arguments to be passed to the method. + */ + call(this: Function, thisArg: any, ...argArray: any[]): any; + + /** + * For a given function, creates a bound function that has the same body as the original function. + * The this object of the bound function is associated with the specified object, and has the specified initial parameters. + * @param thisArg An object to which the this keyword can refer inside the new function. + * @param argArray A list of arguments to be passed to the new function. + */ + bind(this: Function, thisArg: any, ...argArray: any[]): any; + + /** Returns a string representation of a function. */ + toString(): string; + + prototype: any; + readonly length: number; + + // Non-standard extensions + arguments: any; + caller: Function; +} + +interface FunctionConstructor { + /** + * Creates a new function. + * @param args A list of arguments the function accepts. + */ + new(...args: string[]): Function; + (...args: string[]): Function; + readonly prototype: Function; +} + +declare var Function: FunctionConstructor; + +/** + * Extracts the type of the 'this' parameter of a function type, or 'unknown' if the function type has no 'this' parameter. + */ +type ThisParameterType = T extends (this: unknown, ...args: any[]) => any ? unknown : T extends (this: infer U, ...args: any[]) => any ? U : unknown; + +/** + * Removes the 'this' parameter from a function type. + */ +type OmitThisParameter = unknown extends ThisParameterType ? T : T extends (...args: infer A) => infer R ? (...args: A) => R : T; + +interface CallableFunction extends Function { + /** + * Calls the function with the specified object as the this value and the elements of specified array as the arguments. + * @param thisArg The object to be used as the this object. + * @param args An array of argument values to be passed to the function. + */ + apply(this: (this: T) => R, thisArg: T): R; + apply(this: (this: T, ...args: A) => R, thisArg: T, args: A): R; + + /** + * Calls the function with the specified object as the this value and the specified rest arguments as the arguments. + * @param thisArg The object to be used as the this object. + * @param args Argument values to be passed to the function. + */ + call(this: (this: T, ...args: A) => R, thisArg: T, ...args: A): R; + + /** + * For a given function, creates a bound function that has the same body as the original function. + * The this object of the bound function is associated with the specified object, and has the specified initial parameters. + * @param thisArg The object to be used as the this object. + * @param args Arguments to bind to the parameters of the function. + */ + bind(this: T, thisArg: ThisParameterType): OmitThisParameter; + bind(this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; + bind(this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; + bind(this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; + bind(this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; + bind(this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; +} + +interface NewableFunction extends Function { + /** + * Calls the function with the specified object as the this value and the elements of specified array as the arguments. + * @param thisArg The object to be used as the this object. + * @param args An array of argument values to be passed to the function. + */ + apply(this: new () => T, thisArg: T): void; + apply(this: new (...args: A) => T, thisArg: T, args: A): void; + + /** + * Calls the function with the specified object as the this value and the specified rest arguments as the arguments. + * @param thisArg The object to be used as the this object. + * @param args Argument values to be passed to the function. + */ + call(this: new (...args: A) => T, thisArg: T, ...args: A): void; + + /** + * For a given function, creates a bound function that has the same body as the original function. + * The this object of the bound function is associated with the specified object, and has the specified initial parameters. + * @param thisArg The object to be used as the this object. + * @param args Arguments to bind to the parameters of the function. + */ + bind(this: T, thisArg: any): T; + bind(this: new (arg0: A0, ...args: A) => R, thisArg: any, arg0: A0): new (...args: A) => R; + bind(this: new (arg0: A0, arg1: A1, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1): new (...args: A) => R; + bind(this: new (arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2): new (...args: A) => R; + bind(this: new (arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2, arg3: A3): new (...args: A) => R; + bind(this: new (...args: AX[]) => R, thisArg: any, ...args: AX[]): new (...args: AX[]) => R; +} + +interface IArguments { + [index: number]: any; + length: number; + callee: Function; +} + +interface String { + /** Returns a string representation of a string. */ + toString(): string; + + /** + * Returns the character at the specified index. + * @param pos The zero-based index of the desired character. + */ + charAt(pos: number): string; + + /** + * Returns the Unicode value of the character at the specified location. + * @param index The zero-based index of the desired character. If there is no character at the specified index, NaN is returned. + */ + charCodeAt(index: number): number; + + /** + * Returns a string that contains the concatenation of two or more strings. + * @param strings The strings to append to the end of the string. + */ + concat(...strings: string[]): string; + + /** + * Returns the position of the first occurrence of a substring. + * @param searchString The substring to search for in the string + * @param position The index at which to begin searching the String object. If omitted, search starts at the beginning of the string. + */ + indexOf(searchString: string, position?: number): number; + + /** + * Returns the last occurrence of a substring in the string. + * @param searchString The substring to search for. + * @param position The index at which to begin searching. If omitted, the search begins at the end of the string. + */ + lastIndexOf(searchString: string, position?: number): number; + + /** + * Determines whether two strings are equivalent in the current locale. + * @param that String to compare to target string + */ + localeCompare(that: string): number; + + /** + * Matches a string with a regular expression, and returns an array containing the results of that search. + * @param regexp A variable name or string literal containing the regular expression pattern and flags. + */ + match(regexp: string | RegExp): RegExpMatchArray | null; + + /** + * Replaces text in a string, using a regular expression or search string. + * @param searchValue A string to search for. + * @param replaceValue A string containing the text to replace for every successful match of searchValue in this string. + */ + replace(searchValue: string | RegExp, replaceValue: string): string; + + /** + * Replaces text in a string, using a regular expression or search string. + * @param searchValue A string to search for. + * @param replacer A function that returns the replacement text. + */ + replace(searchValue: string | RegExp, replacer: (substring: string, ...args: any[]) => string): string; + + /** + * Finds the first substring match in a regular expression search. + * @param regexp The regular expression pattern and applicable flags. + */ + search(regexp: string | RegExp): number; + + /** + * Returns a section of a string. + * @param start The index to the beginning of the specified portion of stringObj. + * @param end The index to the end of the specified portion of stringObj. The substring includes the characters up to, but not including, the character indicated by end. + * If this value is not specified, the substring continues to the end of stringObj. + */ + slice(start?: number, end?: number): string; + + /** + * Split a string into substrings using the specified separator and return them as an array. + * @param separator A string that identifies character or characters to use in separating the string. If omitted, a single-element array containing the entire string is returned. + * @param limit A value used to limit the number of elements returned in the array. + */ + split(separator: string | RegExp, limit?: number): string[]; + + /** + * Returns the substring at the specified location within a String object. + * @param start The zero-based index number indicating the beginning of the substring. + * @param end Zero-based index number indicating the end of the substring. The substring includes the characters up to, but not including, the character indicated by end. + * If end is omitted, the characters from start through the end of the original string are returned. + */ + substring(start: number, end?: number): string; + + /** Converts all the alphabetic characters in a string to lowercase. */ + toLowerCase(): string; + + /** Converts all alphabetic characters to lowercase, taking into account the host environment's current locale. */ + toLocaleLowerCase(locales?: string | string[]): string; + + /** Converts all the alphabetic characters in a string to uppercase. */ + toUpperCase(): string; + + /** Returns a string where all alphabetic characters have been converted to uppercase, taking into account the host environment's current locale. */ + toLocaleUpperCase(locales?: string | string[]): string; + + /** Removes the leading and trailing white space and line terminator characters from a string. */ + trim(): string; + + /** Returns the length of a String object. */ + readonly length: number; + + // IE extensions + /** + * Gets a substring beginning at the specified location and having the specified length. + * @param from The starting position of the desired substring. The index of the first character in the string is zero. + * @param length The number of characters to include in the returned substring. + */ + substr(from: number, length?: number): string; + + /** Returns the primitive value of the specified object. */ + valueOf(): string; + + readonly [index: number]: string; +} + +interface StringConstructor { + new(value?: any): String; + (value?: any): string; + readonly prototype: String; + fromCharCode(...codes: number[]): string; +} + +/** + * Allows manipulation and formatting of text strings and determination and location of substrings within strings. + */ +declare var String: StringConstructor; + +interface Boolean { + /** Returns the primitive value of the specified object. */ + valueOf(): boolean; +} + +interface BooleanConstructor { + new(value?: any): Boolean; + (value?: T): boolean; + readonly prototype: Boolean; +} + +declare var Boolean: BooleanConstructor; + +interface Number { + /** + * Returns a string representation of an object. + * @param radix Specifies a radix for converting numeric values to strings. This value is only used for numbers. + */ + toString(radix?: number): string; + + /** + * Returns a string representing a number in fixed-point notation. + * @param fractionDigits Number of digits after the decimal point. Must be in the range 0 - 20, inclusive. + */ + toFixed(fractionDigits?: number): string; + + /** + * Returns a string containing a number represented in exponential notation. + * @param fractionDigits Number of digits after the decimal point. Must be in the range 0 - 20, inclusive. + */ + toExponential(fractionDigits?: number): string; + + /** + * Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits. + * @param precision Number of significant digits. Must be in the range 1 - 21, inclusive. + */ + toPrecision(precision?: number): string; + + /** Returns the primitive value of the specified object. */ + valueOf(): number; +} + +interface NumberConstructor { + new(value?: any): Number; + (value?: any): number; + readonly prototype: Number; + + /** The largest number that can be represented in JavaScript. Equal to approximately 1.79E+308. */ + readonly MAX_VALUE: number; + + /** The closest number to zero that can be represented in JavaScript. Equal to approximately 5.00E-324. */ + readonly MIN_VALUE: number; + + /** + * A value that is not a number. + * In equality comparisons, NaN does not equal any value, including itself. To test whether a value is equivalent to NaN, use the isNaN function. + */ + readonly NaN: number; + + /** + * A value that is less than the largest negative number that can be represented in JavaScript. + * JavaScript displays NEGATIVE_INFINITY values as -infinity. + */ + readonly NEGATIVE_INFINITY: number; + + /** + * A value greater than the largest number that can be represented in JavaScript. + * JavaScript displays POSITIVE_INFINITY values as infinity. + */ + readonly POSITIVE_INFINITY: number; +} + +/** An object that represents a number of any kind. All JavaScript numbers are 64-bit floating-point numbers. */ +declare var Number: NumberConstructor; + +interface TemplateStringsArray extends ReadonlyArray { + readonly raw: readonly string[]; +} + +/** + * The type of `import.meta`. + * + * If you need to declare that a given property exists on `import.meta`, + * this type may be augmented via interface merging. + */ +interface ImportMeta { +} + +interface Math { + /** The mathematical constant e. This is Euler's number, the base of natural logarithms. */ + readonly E: number; + /** The natural logarithm of 10. */ + readonly LN10: number; + /** The natural logarithm of 2. */ + readonly LN2: number; + /** The base-2 logarithm of e. */ + readonly LOG2E: number; + /** The base-10 logarithm of e. */ + readonly LOG10E: number; + /** Pi. This is the ratio of the circumference of a circle to its diameter. */ + readonly PI: number; + /** The square root of 0.5, or, equivalently, one divided by the square root of 2. */ + readonly SQRT1_2: number; + /** The square root of 2. */ + readonly SQRT2: number; + /** + * Returns the absolute value of a number (the value without regard to whether it is positive or negative). + * For example, the absolute value of -5 is the same as the absolute value of 5. + * @param x A numeric expression for which the absolute value is needed. + */ + abs(x: number): number; + /** + * Returns the arc cosine (or inverse cosine) of a number. + * @param x A numeric expression. + */ + acos(x: number): number; + /** + * Returns the arcsine of a number. + * @param x A numeric expression. + */ + asin(x: number): number; + /** + * Returns the arctangent of a number. + * @param x A numeric expression for which the arctangent is needed. + */ + atan(x: number): number; + /** + * Returns the angle (in radians) from the X axis to a point. + * @param y A numeric expression representing the cartesian y-coordinate. + * @param x A numeric expression representing the cartesian x-coordinate. + */ + atan2(y: number, x: number): number; + /** + * Returns the smallest integer greater than or equal to its numeric argument. + * @param x A numeric expression. + */ + ceil(x: number): number; + /** + * Returns the cosine of a number. + * @param x A numeric expression that contains an angle measured in radians. + */ + cos(x: number): number; + /** + * Returns e (the base of natural logarithms) raised to a power. + * @param x A numeric expression representing the power of e. + */ + exp(x: number): number; + /** + * Returns the greatest integer less than or equal to its numeric argument. + * @param x A numeric expression. + */ + floor(x: number): number; + /** + * Returns the natural logarithm (base e) of a number. + * @param x A numeric expression. + */ + log(x: number): number; + /** + * Returns the larger of a set of supplied numeric expressions. + * @param values Numeric expressions to be evaluated. + */ + max(...values: number[]): number; + /** + * Returns the smaller of a set of supplied numeric expressions. + * @param values Numeric expressions to be evaluated. + */ + min(...values: number[]): number; + /** + * Returns the value of a base expression taken to a specified power. + * @param x The base value of the expression. + * @param y The exponent value of the expression. + */ + pow(x: number, y: number): number; + /** Returns a pseudorandom number between 0 and 1. */ + random(): number; + /** + * Returns a supplied numeric expression rounded to the nearest integer. + * @param x The value to be rounded to the nearest integer. + */ + round(x: number): number; + /** + * Returns the sine of a number. + * @param x A numeric expression that contains an angle measured in radians. + */ + sin(x: number): number; + /** + * Returns the square root of a number. + * @param x A numeric expression. + */ + sqrt(x: number): number; + /** + * Returns the tangent of a number. + * @param x A numeric expression that contains an angle measured in radians. + */ + tan(x: number): number; +} +/** An intrinsic object that provides basic mathematics functionality and constants. */ +declare var Math: Math; + +/** Enables basic storage and retrieval of dates and times. */ +interface Date { + /** Returns a string representation of a date. The format of the string depends on the locale. */ + toString(): string; + /** Returns a date as a string value. */ + toDateString(): string; + /** Returns a time as a string value. */ + toTimeString(): string; + /** Returns a value as a string value appropriate to the host environment's current locale. */ + toLocaleString(): string; + /** Returns a date as a string value appropriate to the host environment's current locale. */ + toLocaleDateString(): string; + /** Returns a time as a string value appropriate to the host environment's current locale. */ + toLocaleTimeString(): string; + /** Returns the stored time value in milliseconds since midnight, January 1, 1970 UTC. */ + valueOf(): number; + /** Gets the time value in milliseconds. */ + getTime(): number; + /** Gets the year, using local time. */ + getFullYear(): number; + /** Gets the year using Universal Coordinated Time (UTC). */ + getUTCFullYear(): number; + /** Gets the month, using local time. */ + getMonth(): number; + /** Gets the month of a Date object using Universal Coordinated Time (UTC). */ + getUTCMonth(): number; + /** Gets the day-of-the-month, using local time. */ + getDate(): number; + /** Gets the day-of-the-month, using Universal Coordinated Time (UTC). */ + getUTCDate(): number; + /** Gets the day of the week, using local time. */ + getDay(): number; + /** Gets the day of the week using Universal Coordinated Time (UTC). */ + getUTCDay(): number; + /** Gets the hours in a date, using local time. */ + getHours(): number; + /** Gets the hours value in a Date object using Universal Coordinated Time (UTC). */ + getUTCHours(): number; + /** Gets the minutes of a Date object, using local time. */ + getMinutes(): number; + /** Gets the minutes of a Date object using Universal Coordinated Time (UTC). */ + getUTCMinutes(): number; + /** Gets the seconds of a Date object, using local time. */ + getSeconds(): number; + /** Gets the seconds of a Date object using Universal Coordinated Time (UTC). */ + getUTCSeconds(): number; + /** Gets the milliseconds of a Date, using local time. */ + getMilliseconds(): number; + /** Gets the milliseconds of a Date object using Universal Coordinated Time (UTC). */ + getUTCMilliseconds(): number; + /** Gets the difference in minutes between the time on the local computer and Universal Coordinated Time (UTC). */ + getTimezoneOffset(): number; + /** + * Sets the date and time value in the Date object. + * @param time A numeric value representing the number of elapsed milliseconds since midnight, January 1, 1970 GMT. + */ + setTime(time: number): number; + /** + * Sets the milliseconds value in the Date object using local time. + * @param ms A numeric value equal to the millisecond value. + */ + setMilliseconds(ms: number): number; + /** + * Sets the milliseconds value in the Date object using Universal Coordinated Time (UTC). + * @param ms A numeric value equal to the millisecond value. + */ + setUTCMilliseconds(ms: number): number; + + /** + * Sets the seconds value in the Date object using local time. + * @param sec A numeric value equal to the seconds value. + * @param ms A numeric value equal to the milliseconds value. + */ + setSeconds(sec: number, ms?: number): number; + /** + * Sets the seconds value in the Date object using Universal Coordinated Time (UTC). + * @param sec A numeric value equal to the seconds value. + * @param ms A numeric value equal to the milliseconds value. + */ + setUTCSeconds(sec: number, ms?: number): number; + /** + * Sets the minutes value in the Date object using local time. + * @param min A numeric value equal to the minutes value. + * @param sec A numeric value equal to the seconds value. + * @param ms A numeric value equal to the milliseconds value. + */ + setMinutes(min: number, sec?: number, ms?: number): number; + /** + * Sets the minutes value in the Date object using Universal Coordinated Time (UTC). + * @param min A numeric value equal to the minutes value. + * @param sec A numeric value equal to the seconds value. + * @param ms A numeric value equal to the milliseconds value. + */ + setUTCMinutes(min: number, sec?: number, ms?: number): number; + /** + * Sets the hour value in the Date object using local time. + * @param hours A numeric value equal to the hours value. + * @param min A numeric value equal to the minutes value. + * @param sec A numeric value equal to the seconds value. + * @param ms A numeric value equal to the milliseconds value. + */ + setHours(hours: number, min?: number, sec?: number, ms?: number): number; + /** + * Sets the hours value in the Date object using Universal Coordinated Time (UTC). + * @param hours A numeric value equal to the hours value. + * @param min A numeric value equal to the minutes value. + * @param sec A numeric value equal to the seconds value. + * @param ms A numeric value equal to the milliseconds value. + */ + setUTCHours(hours: number, min?: number, sec?: number, ms?: number): number; + /** + * Sets the numeric day-of-the-month value of the Date object using local time. + * @param date A numeric value equal to the day of the month. + */ + setDate(date: number): number; + /** + * Sets the numeric day of the month in the Date object using Universal Coordinated Time (UTC). + * @param date A numeric value equal to the day of the month. + */ + setUTCDate(date: number): number; + /** + * Sets the month value in the Date object using local time. + * @param month A numeric value equal to the month. The value for January is 0, and other month values follow consecutively. + * @param date A numeric value representing the day of the month. If this value is not supplied, the value from a call to the getDate method is used. + */ + setMonth(month: number, date?: number): number; + /** + * Sets the month value in the Date object using Universal Coordinated Time (UTC). + * @param month A numeric value equal to the month. The value for January is 0, and other month values follow consecutively. + * @param date A numeric value representing the day of the month. If it is not supplied, the value from a call to the getUTCDate method is used. + */ + setUTCMonth(month: number, date?: number): number; + /** + * Sets the year of the Date object using local time. + * @param year A numeric value for the year. + * @param month A zero-based numeric value for the month (0 for January, 11 for December). Must be specified if numDate is specified. + * @param date A numeric value equal for the day of the month. + */ + setFullYear(year: number, month?: number, date?: number): number; + /** + * Sets the year value in the Date object using Universal Coordinated Time (UTC). + * @param year A numeric value equal to the year. + * @param month A numeric value equal to the month. The value for January is 0, and other month values follow consecutively. Must be supplied if numDate is supplied. + * @param date A numeric value equal to the day of the month. + */ + setUTCFullYear(year: number, month?: number, date?: number): number; + /** Returns a date converted to a string using Universal Coordinated Time (UTC). */ + toUTCString(): string; + /** Returns a date as a string value in ISO format. */ + toISOString(): string; + /** Used by the JSON.stringify method to enable the transformation of an object's data for JavaScript Object Notation (JSON) serialization. */ + toJSON(key?: any): string; +} + +interface DateConstructor { + new(): Date; + new(value: number | string): Date; + new(year: number, month: number, date?: number, hours?: number, minutes?: number, seconds?: number, ms?: number): Date; + (): string; + readonly prototype: Date; + /** + * Parses a string containing a date, and returns the number of milliseconds between that date and midnight, January 1, 1970. + * @param s A date string + */ + parse(s: string): number; + /** + * Returns the number of milliseconds between midnight, January 1, 1970 Universal Coordinated Time (UTC) (or GMT) and the specified date. + * @param year The full year designation is required for cross-century date accuracy. If year is between 0 and 99 is used, then year is assumed to be 1900 + year. + * @param month The month as a number between 0 and 11 (January to December). + * @param date The date as a number between 1 and 31. + * @param hours Must be supplied if minutes is supplied. A number from 0 to 23 (midnight to 11pm) that specifies the hour. + * @param minutes Must be supplied if seconds is supplied. A number from 0 to 59 that specifies the minutes. + * @param seconds Must be supplied if milliseconds is supplied. A number from 0 to 59 that specifies the seconds. + * @param ms A number from 0 to 999 that specifies the milliseconds. + */ + UTC(year: number, month: number, date?: number, hours?: number, minutes?: number, seconds?: number, ms?: number): number; + now(): number; +} + +declare var Date: DateConstructor; + +interface RegExpMatchArray extends Array { + index?: number; + input?: string; +} + +interface RegExpExecArray extends Array { + index: number; + input: string; +} + +interface RegExp { + /** + * Executes a search on a string using a regular expression pattern, and returns an array containing the results of that search. + * @param string The String object or string literal on which to perform the search. + */ + exec(string: string): RegExpExecArray | null; + + /** + * Returns a Boolean value that indicates whether or not a pattern exists in a searched string. + * @param string String on which to perform the search. + */ + test(string: string): boolean; + + /** Returns a copy of the text of the regular expression pattern. Read-only. The regExp argument is a Regular expression object. It can be a variable name or a literal. */ + readonly source: string; + + /** Returns a Boolean value indicating the state of the global flag (g) used with a regular expression. Default is false. Read-only. */ + readonly global: boolean; + + /** Returns a Boolean value indicating the state of the ignoreCase flag (i) used with a regular expression. Default is false. Read-only. */ + readonly ignoreCase: boolean; + + /** Returns a Boolean value indicating the state of the multiline flag (m) used with a regular expression. Default is false. Read-only. */ + readonly multiline: boolean; + + lastIndex: number; + + // Non-standard extensions + compile(): this; +} + +interface RegExpConstructor { + new(pattern: RegExp | string): RegExp; + new(pattern: string, flags?: string): RegExp; + (pattern: RegExp | string): RegExp; + (pattern: string, flags?: string): RegExp; + readonly prototype: RegExp; + + // Non-standard extensions + $1: string; + $2: string; + $3: string; + $4: string; + $5: string; + $6: string; + $7: string; + $8: string; + $9: string; + lastMatch: string; +} + +declare var RegExp: RegExpConstructor; + +interface Error { + name: string; + message: string; + stack?: string; +} + +interface ErrorConstructor { + new(message?: string): Error; + (message?: string): Error; + readonly prototype: Error; +} + +declare var Error: ErrorConstructor; + +interface EvalError extends Error { +} + +interface EvalErrorConstructor { + new(message?: string): EvalError; + (message?: string): EvalError; + readonly prototype: EvalError; +} + +declare var EvalError: EvalErrorConstructor; + +interface RangeError extends Error { +} + +interface RangeErrorConstructor { + new(message?: string): RangeError; + (message?: string): RangeError; + readonly prototype: RangeError; +} + +declare var RangeError: RangeErrorConstructor; + +interface ReferenceError extends Error { +} + +interface ReferenceErrorConstructor { + new(message?: string): ReferenceError; + (message?: string): ReferenceError; + readonly prototype: ReferenceError; +} + +declare var ReferenceError: ReferenceErrorConstructor; + +interface SyntaxError extends Error { +} + +interface SyntaxErrorConstructor { + new(message?: string): SyntaxError; + (message?: string): SyntaxError; + readonly prototype: SyntaxError; +} + +declare var SyntaxError: SyntaxErrorConstructor; + +interface TypeError extends Error { +} + +interface TypeErrorConstructor { + new(message?: string): TypeError; + (message?: string): TypeError; + readonly prototype: TypeError; +} + +declare var TypeError: TypeErrorConstructor; + +interface URIError extends Error { +} + +interface URIErrorConstructor { + new(message?: string): URIError; + (message?: string): URIError; + readonly prototype: URIError; +} + +declare var URIError: URIErrorConstructor; + +interface JSON { + /** + * Converts a JavaScript Object Notation (JSON) string into an object. + * @param text A valid JSON string. + * @param reviver A function that transforms the results. This function is called for each member of the object. + * If a member contains nested objects, the nested objects are transformed before the parent object is. + */ + parse(text: string, reviver?: (this: any, key: string, value: any) => any): any; + /** + * Converts a JavaScript value to a JavaScript Object Notation (JSON) string. + * @param value A JavaScript value, usually an object or array, to be converted. + * @param replacer A function that transforms the results. + * @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read. + */ + stringify(value: any, replacer?: (this: any, key: string, value: any) => any, space?: string | number): string; + /** + * Converts a JavaScript value to a JavaScript Object Notation (JSON) string. + * @param value A JavaScript value, usually an object or array, to be converted. + * @param replacer An array of strings and numbers that acts as a approved list for selecting the object properties that will be stringified. + * @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read. + */ + stringify(value: any, replacer?: (number | string)[] | null, space?: string | number): string; +} + +/** + * An intrinsic object that provides functions to convert JavaScript values to and from the JavaScript Object Notation (JSON) format. + */ +declare var JSON: JSON; + + +///////////////////////////// +/// ECMAScript Array API (specially handled by compiler) +///////////////////////////// + +interface ReadonlyArray { + /** + * Gets the length of the array. This is a number one higher than the highest element defined in an array. + */ + readonly length: number; + /** + * Returns a string representation of an array. + */ + toString(): string; + /** + * Returns a string representation of an array. The elements are converted to string using their toLocalString methods. + */ + toLocaleString(): string; + /** + * Combines two or more arrays. + * @param items Additional items to add to the end of array1. + */ + concat(...items: ConcatArray[]): T[]; + /** + * Combines two or more arrays. + * @param items Additional items to add to the end of array1. + */ + concat(...items: (T | ConcatArray)[]): T[]; + /** + * Adds all the elements of an array separated by the specified separator string. + * @param separator A string used to separate one element of an array from the next in the resulting String. If omitted, the array elements are separated with a comma. + */ + join(separator?: string): string; + /** + * Returns a section of an array. + * @param start The beginning of the specified portion of the array. + * @param end The end of the specified portion of the array. This is exclusive of the element at the index 'end'. + */ + slice(start?: number, end?: number): T[]; + /** + * Returns the index of the first occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the search starts at index 0. + */ + indexOf(searchElement: T, fromIndex?: number): number; + /** + * Returns the index of the last occurrence of a specified value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the search starts at the last index in the array. + */ + lastIndexOf(searchElement: T, fromIndex?: number): number; + /** + * Determines whether all the members of an array satisfy the specified test. + * @param callbackfn A function that accepts up to three arguments. The every method calls + * the callbackfn function for each element in the array until the callbackfn returns a value + * which is coercible to the Boolean value false, or until the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + every(callbackfn: (value: T, index: number, array: readonly T[]) => unknown, thisArg?: any): boolean; + /** + * Determines whether the specified callback function returns true for any element of an array. + * @param callbackfn A function that accepts up to three arguments. The some method calls + * the callbackfn function for each element in the array until the callbackfn returns a value + * which is coercible to the Boolean value true, or until the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + some(callbackfn: (value: T, index: number, array: readonly T[]) => unknown, thisArg?: any): boolean; + /** + * Performs the specified action for each element in an array. + * @param callbackfn A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. + */ + forEach(callbackfn: (value: T, index: number, array: readonly T[]) => void, thisArg?: any): void; + /** + * Calls a defined callback function on each element of an array, and returns an array that contains the results. + * @param callbackfn A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. + */ + map(callbackfn: (value: T, index: number, array: readonly T[]) => U, thisArg?: any): U[]; + /** + * Returns the elements of an array that meet the condition specified in a callback function. + * @param callbackfn A function that accepts up to three arguments. The filter method calls the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. + */ + filter(callbackfn: (value: T, index: number, array: readonly T[]) => value is S, thisArg?: any): S[]; + /** + * Returns the elements of an array that meet the condition specified in a callback function. + * @param callbackfn A function that accepts up to three arguments. The filter method calls the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. + */ + filter(callbackfn: (value: T, index: number, array: readonly T[]) => unknown, thisArg?: any): T[]; + /** + * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. + */ + reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: readonly T[]) => T): T; + reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: readonly T[]) => T, initialValue: T): T; + /** + * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. + */ + reduce(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: readonly T[]) => U, initialValue: U): U; + /** + * Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. + */ + reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: readonly T[]) => T): T; + reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: readonly T[]) => T, initialValue: T): T; + /** + * Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. + */ + reduceRight(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: readonly T[]) => U, initialValue: U): U; + + readonly [n: number]: T; +} + +interface ConcatArray { + readonly length: number; + readonly [n: number]: T; + join(separator?: string): string; + slice(start?: number, end?: number): T[]; +} + +interface Array { + /** + * Gets or sets the length of the array. This is a number one higher than the highest element defined in an array. + */ + length: number; + /** + * Returns a string representation of an array. + */ + toString(): string; + /** + * Returns a string representation of an array. The elements are converted to string using their toLocalString methods. + */ + toLocaleString(): string; + /** + * Removes the last element from an array and returns it. + */ + pop(): T | undefined; + /** + * Appends new elements to an array, and returns the new length of the array. + * @param items New elements of the Array. + */ + push(...items: T[]): number; + /** + * Combines two or more arrays. + * @param items Additional items to add to the end of array1. + */ + concat(...items: ConcatArray[]): T[]; + /** + * Combines two or more arrays. + * @param items Additional items to add to the end of array1. + */ + concat(...items: (T | ConcatArray)[]): T[]; + /** + * Adds all the elements of an array separated by the specified separator string. + * @param separator A string used to separate one element of an array from the next in the resulting String. If omitted, the array elements are separated with a comma. + */ + join(separator?: string): string; + /** + * Reverses the elements in an Array. + */ + reverse(): T[]; + /** + * Removes the first element from an array and returns it. + */ + shift(): T | undefined; + /** + * Returns a section of an array. + * @param start The beginning of the specified portion of the array. + * @param end The end of the specified portion of the array. This is exclusive of the element at the index 'end'. + */ + slice(start?: number, end?: number): T[]; + /** + * Sorts an array. + * @param compareFn Function used to determine the order of the elements. It is expected to return + * a negative value if first argument is less than second argument, zero if they're equal and a positive + * value otherwise. If omitted, the elements are sorted in ascending, ASCII character order. + * ```ts + * [11,2,22,1].sort((a, b) => a - b) + * ``` + */ + sort(compareFn?: (a: T, b: T) => number): this; + /** + * Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements. + * @param start The zero-based location in the array from which to start removing elements. + * @param deleteCount The number of elements to remove. + */ + splice(start: number, deleteCount?: number): T[]; + /** + * Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements. + * @param start The zero-based location in the array from which to start removing elements. + * @param deleteCount The number of elements to remove. + * @param items Elements to insert into the array in place of the deleted elements. + */ + splice(start: number, deleteCount: number, ...items: T[]): T[]; + /** + * Inserts new elements at the start of an array. + * @param items Elements to insert at the start of the Array. + */ + unshift(...items: T[]): number; + /** + * Returns the index of the first occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the search starts at index 0. + */ + indexOf(searchElement: T, fromIndex?: number): number; + /** + * Returns the index of the last occurrence of a specified value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the search starts at the last index in the array. + */ + lastIndexOf(searchElement: T, fromIndex?: number): number; + /** + * Determines whether all the members of an array satisfy the specified test. + * @param callbackfn A function that accepts up to three arguments. The every method calls + * the callbackfn function for each element in the array until the callbackfn returns a value + * which is coercible to the Boolean value false, or until the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + every(callbackfn: (value: T, index: number, array: T[]) => unknown, thisArg?: any): boolean; + /** + * Determines whether the specified callback function returns true for any element of an array. + * @param callbackfn A function that accepts up to three arguments. The some method calls + * the callbackfn function for each element in the array until the callbackfn returns a value + * which is coercible to the Boolean value true, or until the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + some(callbackfn: (value: T, index: number, array: T[]) => unknown, thisArg?: any): boolean; + /** + * Performs the specified action for each element in an array. + * @param callbackfn A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. + */ + forEach(callbackfn: (value: T, index: number, array: T[]) => void, thisArg?: any): void; + /** + * Calls a defined callback function on each element of an array, and returns an array that contains the results. + * @param callbackfn A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. + */ + map(callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): U[]; + /** + * Returns the elements of an array that meet the condition specified in a callback function. + * @param callbackfn A function that accepts up to three arguments. The filter method calls the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. + */ + filter(callbackfn: (value: T, index: number, array: T[]) => value is S, thisArg?: any): S[]; + /** + * Returns the elements of an array that meet the condition specified in a callback function. + * @param callbackfn A function that accepts up to three arguments. The filter method calls the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. + */ + filter(callbackfn: (value: T, index: number, array: T[]) => unknown, thisArg?: any): T[]; + /** + * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. + */ + reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T): T; + reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue: T): T; + /** + * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. + */ + reduce(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U; + /** + * Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. + */ + reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T): T; + reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue: T): T; + /** + * Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. + */ + reduceRight(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U; + + [n: number]: T; +} + +interface ArrayConstructor { + new(arrayLength?: number): any[]; + new (arrayLength: number): T[]; + new (...items: T[]): T[]; + (arrayLength?: number): any[]; + (arrayLength: number): T[]; + (...items: T[]): T[]; + isArray(arg: any): arg is any[]; + readonly prototype: any[]; +} + +declare var Array: ArrayConstructor; + +interface TypedPropertyDescriptor { + enumerable?: boolean; + configurable?: boolean; + writable?: boolean; + value?: T; + get?: () => T; + set?: (value: T) => void; +} + +declare type ClassDecorator = (target: TFunction) => TFunction | void; +declare type PropertyDecorator = (target: Object, propertyKey: string | symbol) => void; +declare type MethodDecorator = (target: Object, propertyKey: string | symbol, descriptor: TypedPropertyDescriptor) => TypedPropertyDescriptor | void; +declare type ParameterDecorator = (target: Object, propertyKey: string | symbol, parameterIndex: number) => void; + +declare type PromiseConstructorLike = new (executor: (resolve: (value?: T | PromiseLike) => void, reject: (reason?: any) => void) => void) => PromiseLike; + +interface PromiseLike { + /** + * Attaches callbacks for the resolution and/or rejection of the Promise. + * @param onfulfilled The callback to execute when the Promise is resolved. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of which ever callback is executed. + */ + then(onfulfilled?: ((value: T) => TResult1 | PromiseLike) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike) | undefined | null): PromiseLike; +} + +/** + * Represents the completion of an asynchronous operation + */ +interface Promise { + /** + * Attaches callbacks for the resolution and/or rejection of the Promise. + * @param onfulfilled The callback to execute when the Promise is resolved. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of which ever callback is executed. + */ + then(onfulfilled?: ((value: T) => TResult1 | PromiseLike) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike) | undefined | null): Promise; + + /** + * Attaches a callback for only the rejection of the Promise. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of the callback. + */ + catch(onrejected?: ((reason: any) => TResult | PromiseLike) | undefined | null): Promise; +} + +interface ArrayLike { + readonly length: number; + readonly [n: number]: T; +} + +/** + * Make all properties in T optional + */ +type Partial = { + [P in keyof T]?: T[P]; +}; + +/** + * Make all properties in T required + */ +type Required = { + [P in keyof T]-?: T[P]; +}; + +/** + * Make all properties in T readonly + */ +type Readonly = { + readonly [P in keyof T]: T[P]; +}; + +/** + * From T, pick a set of properties whose keys are in the union K + */ +type Pick = { + [P in K]: T[P]; +}; + +/** + * Construct a type with a set of properties K of type T + */ +type Record = { + [P in K]: T; +}; + +/** + * Exclude from T those types that are assignable to U + */ +type Exclude = T extends U ? never : T; + +/** + * Extract from T those types that are assignable to U + */ +type Extract = T extends U ? T : never; + +/** + * Construct a type with the properties of T except for those in type K. + */ +type Omit = Pick>; + +/** + * Exclude null and undefined from T + */ +type NonNullable = T extends null | undefined ? never : T; + +/** + * Obtain the parameters of a function type in a tuple + */ +type Parameters any> = T extends (...args: infer P) => any ? P : never; + +/** + * Obtain the parameters of a constructor function type in a tuple + */ +type ConstructorParameters any> = T extends new (...args: infer P) => any ? P : never; + +/** + * Obtain the return type of a function type + */ +type ReturnType any> = T extends (...args: any) => infer R ? R : any; + +/** + * Obtain the return type of a constructor function type + */ +type InstanceType any> = T extends new (...args: any) => infer R ? R : any; + +/** + * Marker for contextual 'this' type + */ +interface ThisType { } + +/** + * Represents a raw buffer of binary data, which is used to store data for the + * different typed arrays. ArrayBuffers cannot be read from or written to directly, + * but can be passed to a typed array or DataView Object to interpret the raw + * buffer as needed. + */ +interface ArrayBuffer { + /** + * Read-only. The length of the ArrayBuffer (in bytes). + */ + readonly byteLength: number; + + /** + * Returns a section of an ArrayBuffer. + */ + slice(begin: number, end?: number): ArrayBuffer; +} + +/** + * Allowed ArrayBuffer types for the buffer of an ArrayBufferView and related Typed Arrays. + */ +interface ArrayBufferTypes { + ArrayBuffer: ArrayBuffer; +} +type ArrayBufferLike = ArrayBufferTypes[keyof ArrayBufferTypes]; + +interface ArrayBufferConstructor { + readonly prototype: ArrayBuffer; + new(byteLength: number): ArrayBuffer; + isView(arg: any): arg is ArrayBufferView; +} +declare var ArrayBuffer: ArrayBufferConstructor; + +interface ArrayBufferView { + /** + * The ArrayBuffer instance referenced by the array. + */ + buffer: ArrayBufferLike; + + /** + * The length in bytes of the array. + */ + byteLength: number; + + /** + * The offset in bytes of the array. + */ + byteOffset: number; +} + +interface DataView { + readonly buffer: ArrayBuffer; + readonly byteLength: number; + readonly byteOffset: number; + /** + * Gets the Float32 value at the specified byte offset from the start of the view. There is + * no alignment constraint; multi-byte values may be fetched from any offset. + * @param byteOffset The place in the buffer at which the value should be retrieved. + */ + getFloat32(byteOffset: number, littleEndian?: boolean): number; + + /** + * Gets the Float64 value at the specified byte offset from the start of the view. There is + * no alignment constraint; multi-byte values may be fetched from any offset. + * @param byteOffset The place in the buffer at which the value should be retrieved. + */ + getFloat64(byteOffset: number, littleEndian?: boolean): number; + + /** + * Gets the Int8 value at the specified byte offset from the start of the view. There is + * no alignment constraint; multi-byte values may be fetched from any offset. + * @param byteOffset The place in the buffer at which the value should be retrieved. + */ + getInt8(byteOffset: number): number; + + /** + * Gets the Int16 value at the specified byte offset from the start of the view. There is + * no alignment constraint; multi-byte values may be fetched from any offset. + * @param byteOffset The place in the buffer at which the value should be retrieved. + */ + getInt16(byteOffset: number, littleEndian?: boolean): number; + /** + * Gets the Int32 value at the specified byte offset from the start of the view. There is + * no alignment constraint; multi-byte values may be fetched from any offset. + * @param byteOffset The place in the buffer at which the value should be retrieved. + */ + getInt32(byteOffset: number, littleEndian?: boolean): number; + + /** + * Gets the Uint8 value at the specified byte offset from the start of the view. There is + * no alignment constraint; multi-byte values may be fetched from any offset. + * @param byteOffset The place in the buffer at which the value should be retrieved. + */ + getUint8(byteOffset: number): number; + + /** + * Gets the Uint16 value at the specified byte offset from the start of the view. There is + * no alignment constraint; multi-byte values may be fetched from any offset. + * @param byteOffset The place in the buffer at which the value should be retrieved. + */ + getUint16(byteOffset: number, littleEndian?: boolean): number; + + /** + * Gets the Uint32 value at the specified byte offset from the start of the view. There is + * no alignment constraint; multi-byte values may be fetched from any offset. + * @param byteOffset The place in the buffer at which the value should be retrieved. + */ + getUint32(byteOffset: number, littleEndian?: boolean): number; + + /** + * Stores an Float32 value at the specified byte offset from the start of the view. + * @param byteOffset The place in the buffer at which the value should be set. + * @param value The value to set. + * @param littleEndian If false or undefined, a big-endian value should be written, + * otherwise a little-endian value should be written. + */ + setFloat32(byteOffset: number, value: number, littleEndian?: boolean): void; + + /** + * Stores an Float64 value at the specified byte offset from the start of the view. + * @param byteOffset The place in the buffer at which the value should be set. + * @param value The value to set. + * @param littleEndian If false or undefined, a big-endian value should be written, + * otherwise a little-endian value should be written. + */ + setFloat64(byteOffset: number, value: number, littleEndian?: boolean): void; + + /** + * Stores an Int8 value at the specified byte offset from the start of the view. + * @param byteOffset The place in the buffer at which the value should be set. + * @param value The value to set. + */ + setInt8(byteOffset: number, value: number): void; + + /** + * Stores an Int16 value at the specified byte offset from the start of the view. + * @param byteOffset The place in the buffer at which the value should be set. + * @param value The value to set. + * @param littleEndian If false or undefined, a big-endian value should be written, + * otherwise a little-endian value should be written. + */ + setInt16(byteOffset: number, value: number, littleEndian?: boolean): void; + + /** + * Stores an Int32 value at the specified byte offset from the start of the view. + * @param byteOffset The place in the buffer at which the value should be set. + * @param value The value to set. + * @param littleEndian If false or undefined, a big-endian value should be written, + * otherwise a little-endian value should be written. + */ + setInt32(byteOffset: number, value: number, littleEndian?: boolean): void; + + /** + * Stores an Uint8 value at the specified byte offset from the start of the view. + * @param byteOffset The place in the buffer at which the value should be set. + * @param value The value to set. + */ + setUint8(byteOffset: number, value: number): void; + + /** + * Stores an Uint16 value at the specified byte offset from the start of the view. + * @param byteOffset The place in the buffer at which the value should be set. + * @param value The value to set. + * @param littleEndian If false or undefined, a big-endian value should be written, + * otherwise a little-endian value should be written. + */ + setUint16(byteOffset: number, value: number, littleEndian?: boolean): void; + + /** + * Stores an Uint32 value at the specified byte offset from the start of the view. + * @param byteOffset The place in the buffer at which the value should be set. + * @param value The value to set. + * @param littleEndian If false or undefined, a big-endian value should be written, + * otherwise a little-endian value should be written. + */ + setUint32(byteOffset: number, value: number, littleEndian?: boolean): void; +} + +interface DataViewConstructor { + new(buffer: ArrayBufferLike, byteOffset?: number, byteLength?: number): DataView; +} +declare var DataView: DataViewConstructor; + +/** + * A typed array of 8-bit integer values. The contents are initialized to 0. If the requested + * number of bytes could not be allocated an exception is raised. + */ +interface Int8Array { + /** + * The size in bytes of each element in the array. + */ + readonly BYTES_PER_ELEMENT: number; + + /** + * The ArrayBuffer instance referenced by the array. + */ + readonly buffer: ArrayBufferLike; + + /** + * The length in bytes of the array. + */ + readonly byteLength: number; + + /** + * The offset in bytes of the array. + */ + readonly byteOffset: number; + + /** + * Returns the this object after copying a section of the array identified by start and end + * to the same array starting at position target + * @param target If target is negative, it is treated as length+target where length is the + * length of the array. + * @param start If start is negative, it is treated as length+start. If end is negative, it + * is treated as length+end. + * @param end If not specified, length of the this object is used as its default value. + */ + copyWithin(target: number, start: number, end?: number): this; + + /** + * Determines whether all the members of an array satisfy the specified test. + * @param callbackfn A function that accepts up to three arguments. The every method calls + * the callbackfn function for each element in the array until the callbackfn returns a value + * which is coercible to the Boolean value false, or until the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + every(callbackfn: (value: number, index: number, array: Int8Array) => unknown, thisArg?: any): boolean; + + /** + * Returns the this object after filling the section identified by start and end with value + * @param value value to fill array section with + * @param start index to start filling the array at. If start is negative, it is treated as + * length+start where length is the length of the array. + * @param end index to stop filling the array at. If end is negative, it is treated as + * length+end. + */ + fill(value: number, start?: number, end?: number): this; + + /** + * Returns the elements of an array that meet the condition specified in a callback function. + * @param callbackfn A function that accepts up to three arguments. The filter method calls + * the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + filter(callbackfn: (value: number, index: number, array: Int8Array) => any, thisArg?: any): Int8Array; + + /** + * Returns the value of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + find(predicate: (value: number, index: number, obj: Int8Array) => boolean, thisArg?: any): number | undefined; + + /** + * Returns the index of the first element in the array where predicate is true, and -1 + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, + * findIndex immediately returns that element index. Otherwise, findIndex returns -1. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + findIndex(predicate: (value: number, index: number, obj: Int8Array) => boolean, thisArg?: any): number; + + /** + * Performs the specified action for each element in an array. + * @param callbackfn A function that accepts up to three arguments. forEach calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + forEach(callbackfn: (value: number, index: number, array: Int8Array) => void, thisArg?: any): void; + + /** + * Returns the index of the first occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + indexOf(searchElement: number, fromIndex?: number): number; + + /** + * Adds all the elements of an array separated by the specified separator string. + * @param separator A string used to separate one element of an array from the next in the + * resulting String. If omitted, the array elements are separated with a comma. + */ + join(separator?: string): string; + + /** + * Returns the index of the last occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + lastIndexOf(searchElement: number, fromIndex?: number): number; + + /** + * The length of the array. + */ + readonly length: number; + + /** + * Calls a defined callback function on each element of an array, and returns an array that + * contains the results. + * @param callbackfn A function that accepts up to three arguments. The map method calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + map(callbackfn: (value: number, index: number, array: Int8Array) => number, thisArg?: any): Int8Array; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int8Array) => number): number; + reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int8Array) => number, initialValue: number): number; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int8Array) => U, initialValue: U): U; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an + * argument instead of an array value. + */ + reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int8Array) => number): number; + reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int8Array) => number, initialValue: number): number; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int8Array) => U, initialValue: U): U; + + /** + * Reverses the elements in an Array. + */ + reverse(): Int8Array; + + /** + * Sets a value or an array of values. + * @param array A typed or untyped array of values to set. + * @param offset The index in the current array at which the values are to be written. + */ + set(array: ArrayLike, offset?: number): void; + + /** + * Returns a section of an array. + * @param start The beginning of the specified portion of the array. + * @param end The end of the specified portion of the array. This is exclusive of the element at the index 'end'. + */ + slice(start?: number, end?: number): Int8Array; + + /** + * Determines whether the specified callback function returns true for any element of an array. + * @param callbackfn A function that accepts up to three arguments. The some method calls + * the callbackfn function for each element in the array until the callbackfn returns a value + * which is coercible to the Boolean value true, or until the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + some(callbackfn: (value: number, index: number, array: Int8Array) => unknown, thisArg?: any): boolean; + + /** + * Sorts an array. + * @param compareFn Function used to determine the order of the elements. It is expected to return + * a negative value if first argument is less than second argument, zero if they're equal and a positive + * value otherwise. If omitted, the elements are sorted in ascending, ASCII character order. + * ```ts + * [11,2,22,1].sort((a, b) => a - b) + * ``` + */ + sort(compareFn?: (a: number, b: number) => number): this; + + /** + * Gets a new Int8Array view of the ArrayBuffer store for this array, referencing the elements + * at begin, inclusive, up to end, exclusive. + * @param begin The index of the beginning of the array. + * @param end The index of the end of the array. + */ + subarray(begin?: number, end?: number): Int8Array; + + /** + * Converts a number to a string by using the current locale. + */ + toLocaleString(): string; + + /** + * Returns a string representation of an array. + */ + toString(): string; + + [index: number]: number; +} +interface Int8ArrayConstructor { + readonly prototype: Int8Array; + new(length: number): Int8Array; + new(arrayOrArrayBuffer: ArrayLike | ArrayBufferLike): Int8Array; + new(buffer: ArrayBufferLike, byteOffset: number, length?: number): Int8Array; + + /** + * The size in bytes of each element in the array. + */ + readonly BYTES_PER_ELEMENT: number; + + /** + * Returns a new array from a set of elements. + * @param items A set of elements to include in the new array object. + */ + of(...items: number[]): Int8Array; + + /** + * Creates an array from an array-like or iterable object. + * @param arrayLike An array-like or iterable object to convert to an array. + */ + from(arrayLike: ArrayLike): Int8Array; + + /** + * Creates an array from an array-like or iterable object. + * @param arrayLike An array-like or iterable object to convert to an array. + * @param mapfn A mapping function to call on every element of the array. + * @param thisArg Value of 'this' used to invoke the mapfn. + */ + from(arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Int8Array; + + +} +declare var Int8Array: Int8ArrayConstructor; + +/** + * A typed array of 8-bit unsigned integer values. The contents are initialized to 0. If the + * requested number of bytes could not be allocated an exception is raised. + */ +interface Uint8Array { + /** + * The size in bytes of each element in the array. + */ + readonly BYTES_PER_ELEMENT: number; + + /** + * The ArrayBuffer instance referenced by the array. + */ + readonly buffer: ArrayBufferLike; + + /** + * The length in bytes of the array. + */ + readonly byteLength: number; + + /** + * The offset in bytes of the array. + */ + readonly byteOffset: number; + + /** + * Returns the this object after copying a section of the array identified by start and end + * to the same array starting at position target + * @param target If target is negative, it is treated as length+target where length is the + * length of the array. + * @param start If start is negative, it is treated as length+start. If end is negative, it + * is treated as length+end. + * @param end If not specified, length of the this object is used as its default value. + */ + copyWithin(target: number, start: number, end?: number): this; + + /** + * Determines whether all the members of an array satisfy the specified test. + * @param callbackfn A function that accepts up to three arguments. The every method calls + * the callbackfn function for each element in the array until the callbackfn returns a value + * which is coercible to the Boolean value false, or until the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + every(callbackfn: (value: number, index: number, array: Uint8Array) => unknown, thisArg?: any): boolean; + + /** + * Returns the this object after filling the section identified by start and end with value + * @param value value to fill array section with + * @param start index to start filling the array at. If start is negative, it is treated as + * length+start where length is the length of the array. + * @param end index to stop filling the array at. If end is negative, it is treated as + * length+end. + */ + fill(value: number, start?: number, end?: number): this; + + /** + * Returns the elements of an array that meet the condition specified in a callback function. + * @param callbackfn A function that accepts up to three arguments. The filter method calls + * the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + filter(callbackfn: (value: number, index: number, array: Uint8Array) => any, thisArg?: any): Uint8Array; + + /** + * Returns the value of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + find(predicate: (value: number, index: number, obj: Uint8Array) => boolean, thisArg?: any): number | undefined; + + /** + * Returns the index of the first element in the array where predicate is true, and -1 + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, + * findIndex immediately returns that element index. Otherwise, findIndex returns -1. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + findIndex(predicate: (value: number, index: number, obj: Uint8Array) => boolean, thisArg?: any): number; + + /** + * Performs the specified action for each element in an array. + * @param callbackfn A function that accepts up to three arguments. forEach calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + forEach(callbackfn: (value: number, index: number, array: Uint8Array) => void, thisArg?: any): void; + + /** + * Returns the index of the first occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + indexOf(searchElement: number, fromIndex?: number): number; + + /** + * Adds all the elements of an array separated by the specified separator string. + * @param separator A string used to separate one element of an array from the next in the + * resulting String. If omitted, the array elements are separated with a comma. + */ + join(separator?: string): string; + + /** + * Returns the index of the last occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + lastIndexOf(searchElement: number, fromIndex?: number): number; + + /** + * The length of the array. + */ + readonly length: number; + + /** + * Calls a defined callback function on each element of an array, and returns an array that + * contains the results. + * @param callbackfn A function that accepts up to three arguments. The map method calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + map(callbackfn: (value: number, index: number, array: Uint8Array) => number, thisArg?: any): Uint8Array; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8Array) => number): number; + reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8Array) => number, initialValue: number): number; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint8Array) => U, initialValue: U): U; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an + * argument instead of an array value. + */ + reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8Array) => number): number; + reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8Array) => number, initialValue: number): number; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint8Array) => U, initialValue: U): U; + + /** + * Reverses the elements in an Array. + */ + reverse(): Uint8Array; + + /** + * Sets a value or an array of values. + * @param array A typed or untyped array of values to set. + * @param offset The index in the current array at which the values are to be written. + */ + set(array: ArrayLike, offset?: number): void; + + /** + * Returns a section of an array. + * @param start The beginning of the specified portion of the array. + * @param end The end of the specified portion of the array. This is exclusive of the element at the index 'end'. + */ + slice(start?: number, end?: number): Uint8Array; + + /** + * Determines whether the specified callback function returns true for any element of an array. + * @param callbackfn A function that accepts up to three arguments. The some method calls + * the callbackfn function for each element in the array until the callbackfn returns a value + * which is coercible to the Boolean value true, or until the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + some(callbackfn: (value: number, index: number, array: Uint8Array) => unknown, thisArg?: any): boolean; + + /** + * Sorts an array. + * @param compareFn Function used to determine the order of the elements. It is expected to return + * a negative value if first argument is less than second argument, zero if they're equal and a positive + * value otherwise. If omitted, the elements are sorted in ascending, ASCII character order. + * ```ts + * [11,2,22,1].sort((a, b) => a - b) + * ``` + */ + sort(compareFn?: (a: number, b: number) => number): this; + + /** + * Gets a new Uint8Array view of the ArrayBuffer store for this array, referencing the elements + * at begin, inclusive, up to end, exclusive. + * @param begin The index of the beginning of the array. + * @param end The index of the end of the array. + */ + subarray(begin?: number, end?: number): Uint8Array; + + /** + * Converts a number to a string by using the current locale. + */ + toLocaleString(): string; + + /** + * Returns a string representation of an array. + */ + toString(): string; + + [index: number]: number; +} + +interface Uint8ArrayConstructor { + readonly prototype: Uint8Array; + new(length: number): Uint8Array; + new(arrayOrArrayBuffer: ArrayLike | ArrayBufferLike): Uint8Array; + new(buffer: ArrayBufferLike, byteOffset: number, length?: number): Uint8Array; + + /** + * The size in bytes of each element in the array. + */ + readonly BYTES_PER_ELEMENT: number; + + /** + * Returns a new array from a set of elements. + * @param items A set of elements to include in the new array object. + */ + of(...items: number[]): Uint8Array; + + /** + * Creates an array from an array-like or iterable object. + * @param arrayLike An array-like or iterable object to convert to an array. + */ + from(arrayLike: ArrayLike): Uint8Array; + + /** + * Creates an array from an array-like or iterable object. + * @param arrayLike An array-like or iterable object to convert to an array. + * @param mapfn A mapping function to call on every element of the array. + * @param thisArg Value of 'this' used to invoke the mapfn. + */ + from(arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Uint8Array; + +} +declare var Uint8Array: Uint8ArrayConstructor; + +/** + * A typed array of 8-bit unsigned integer (clamped) values. The contents are initialized to 0. + * If the requested number of bytes could not be allocated an exception is raised. + */ +interface Uint8ClampedArray { + /** + * The size in bytes of each element in the array. + */ + readonly BYTES_PER_ELEMENT: number; + + /** + * The ArrayBuffer instance referenced by the array. + */ + readonly buffer: ArrayBufferLike; + + /** + * The length in bytes of the array. + */ + readonly byteLength: number; + + /** + * The offset in bytes of the array. + */ + readonly byteOffset: number; + + /** + * Returns the this object after copying a section of the array identified by start and end + * to the same array starting at position target + * @param target If target is negative, it is treated as length+target where length is the + * length of the array. + * @param start If start is negative, it is treated as length+start. If end is negative, it + * is treated as length+end. + * @param end If not specified, length of the this object is used as its default value. + */ + copyWithin(target: number, start: number, end?: number): this; + + /** + * Determines whether all the members of an array satisfy the specified test. + * @param callbackfn A function that accepts up to three arguments. The every method calls + * the callbackfn function for each element in the array until the callbackfn returns a value + * which is coercible to the Boolean value false, or until the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + every(callbackfn: (value: number, index: number, array: Uint8ClampedArray) => unknown, thisArg?: any): boolean; + + /** + * Returns the this object after filling the section identified by start and end with value + * @param value value to fill array section with + * @param start index to start filling the array at. If start is negative, it is treated as + * length+start where length is the length of the array. + * @param end index to stop filling the array at. If end is negative, it is treated as + * length+end. + */ + fill(value: number, start?: number, end?: number): this; + + /** + * Returns the elements of an array that meet the condition specified in a callback function. + * @param callbackfn A function that accepts up to three arguments. The filter method calls + * the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + filter(callbackfn: (value: number, index: number, array: Uint8ClampedArray) => any, thisArg?: any): Uint8ClampedArray; + + /** + * Returns the value of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + find(predicate: (value: number, index: number, obj: Uint8ClampedArray) => boolean, thisArg?: any): number | undefined; + + /** + * Returns the index of the first element in the array where predicate is true, and -1 + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, + * findIndex immediately returns that element index. Otherwise, findIndex returns -1. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + findIndex(predicate: (value: number, index: number, obj: Uint8ClampedArray) => boolean, thisArg?: any): number; + + /** + * Performs the specified action for each element in an array. + * @param callbackfn A function that accepts up to three arguments. forEach calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + forEach(callbackfn: (value: number, index: number, array: Uint8ClampedArray) => void, thisArg?: any): void; + + /** + * Returns the index of the first occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + indexOf(searchElement: number, fromIndex?: number): number; + + /** + * Adds all the elements of an array separated by the specified separator string. + * @param separator A string used to separate one element of an array from the next in the + * resulting String. If omitted, the array elements are separated with a comma. + */ + join(separator?: string): string; + + /** + * Returns the index of the last occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + lastIndexOf(searchElement: number, fromIndex?: number): number; + + /** + * The length of the array. + */ + readonly length: number; + + /** + * Calls a defined callback function on each element of an array, and returns an array that + * contains the results. + * @param callbackfn A function that accepts up to three arguments. The map method calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + map(callbackfn: (value: number, index: number, array: Uint8ClampedArray) => number, thisArg?: any): Uint8ClampedArray; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => number): number; + reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => number, initialValue: number): number; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => U, initialValue: U): U; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an + * argument instead of an array value. + */ + reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => number): number; + reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => number, initialValue: number): number; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => U, initialValue: U): U; + + /** + * Reverses the elements in an Array. + */ + reverse(): Uint8ClampedArray; + + /** + * Sets a value or an array of values. + * @param array A typed or untyped array of values to set. + * @param offset The index in the current array at which the values are to be written. + */ + set(array: ArrayLike, offset?: number): void; + + /** + * Returns a section of an array. + * @param start The beginning of the specified portion of the array. + * @param end The end of the specified portion of the array. This is exclusive of the element at the index 'end'. + */ + slice(start?: number, end?: number): Uint8ClampedArray; + + /** + * Determines whether the specified callback function returns true for any element of an array. + * @param callbackfn A function that accepts up to three arguments. The some method calls + * the callbackfn function for each element in the array until the callbackfn returns a value + * which is coercible to the Boolean value true, or until the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + some(callbackfn: (value: number, index: number, array: Uint8ClampedArray) => unknown, thisArg?: any): boolean; + + /** + * Sorts an array. + * @param compareFn Function used to determine the order of the elements. It is expected to return + * a negative value if first argument is less than second argument, zero if they're equal and a positive + * value otherwise. If omitted, the elements are sorted in ascending, ASCII character order. + * ```ts + * [11,2,22,1].sort((a, b) => a - b) + * ``` + */ + sort(compareFn?: (a: number, b: number) => number): this; + + /** + * Gets a new Uint8ClampedArray view of the ArrayBuffer store for this array, referencing the elements + * at begin, inclusive, up to end, exclusive. + * @param begin The index of the beginning of the array. + * @param end The index of the end of the array. + */ + subarray(begin?: number, end?: number): Uint8ClampedArray; + + /** + * Converts a number to a string by using the current locale. + */ + toLocaleString(): string; + + /** + * Returns a string representation of an array. + */ + toString(): string; + + [index: number]: number; +} + +interface Uint8ClampedArrayConstructor { + readonly prototype: Uint8ClampedArray; + new(length: number): Uint8ClampedArray; + new(arrayOrArrayBuffer: ArrayLike | ArrayBufferLike): Uint8ClampedArray; + new(buffer: ArrayBufferLike, byteOffset: number, length?: number): Uint8ClampedArray; + + /** + * The size in bytes of each element in the array. + */ + readonly BYTES_PER_ELEMENT: number; + + /** + * Returns a new array from a set of elements. + * @param items A set of elements to include in the new array object. + */ + of(...items: number[]): Uint8ClampedArray; + + /** + * Creates an array from an array-like or iterable object. + * @param arrayLike An array-like or iterable object to convert to an array. + */ + from(arrayLike: ArrayLike): Uint8ClampedArray; + + /** + * Creates an array from an array-like or iterable object. + * @param arrayLike An array-like or iterable object to convert to an array. + * @param mapfn A mapping function to call on every element of the array. + * @param thisArg Value of 'this' used to invoke the mapfn. + */ + from(arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Uint8ClampedArray; +} +declare var Uint8ClampedArray: Uint8ClampedArrayConstructor; + +/** + * A typed array of 16-bit signed integer values. The contents are initialized to 0. If the + * requested number of bytes could not be allocated an exception is raised. + */ +interface Int16Array { + /** + * The size in bytes of each element in the array. + */ + readonly BYTES_PER_ELEMENT: number; + + /** + * The ArrayBuffer instance referenced by the array. + */ + readonly buffer: ArrayBufferLike; + + /** + * The length in bytes of the array. + */ + readonly byteLength: number; + + /** + * The offset in bytes of the array. + */ + readonly byteOffset: number; + + /** + * Returns the this object after copying a section of the array identified by start and end + * to the same array starting at position target + * @param target If target is negative, it is treated as length+target where length is the + * length of the array. + * @param start If start is negative, it is treated as length+start. If end is negative, it + * is treated as length+end. + * @param end If not specified, length of the this object is used as its default value. + */ + copyWithin(target: number, start: number, end?: number): this; + + /** + * Determines whether all the members of an array satisfy the specified test. + * @param callbackfn A function that accepts up to three arguments. The every method calls + * the callbackfn function for each element in the array until the callbackfn returns a value + * which is coercible to the Boolean value false, or until the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + every(callbackfn: (value: number, index: number, array: Int16Array) => unknown, thisArg?: any): boolean; + + /** + * Returns the this object after filling the section identified by start and end with value + * @param value value to fill array section with + * @param start index to start filling the array at. If start is negative, it is treated as + * length+start where length is the length of the array. + * @param end index to stop filling the array at. If end is negative, it is treated as + * length+end. + */ + fill(value: number, start?: number, end?: number): this; + + /** + * Returns the elements of an array that meet the condition specified in a callback function. + * @param callbackfn A function that accepts up to three arguments. The filter method calls + * the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + filter(callbackfn: (value: number, index: number, array: Int16Array) => any, thisArg?: any): Int16Array; + + /** + * Returns the value of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + find(predicate: (value: number, index: number, obj: Int16Array) => boolean, thisArg?: any): number | undefined; + + /** + * Returns the index of the first element in the array where predicate is true, and -1 + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, + * findIndex immediately returns that element index. Otherwise, findIndex returns -1. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + findIndex(predicate: (value: number, index: number, obj: Int16Array) => boolean, thisArg?: any): number; + + /** + * Performs the specified action for each element in an array. + * @param callbackfn A function that accepts up to three arguments. forEach calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + forEach(callbackfn: (value: number, index: number, array: Int16Array) => void, thisArg?: any): void; + /** + * Returns the index of the first occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + indexOf(searchElement: number, fromIndex?: number): number; + + /** + * Adds all the elements of an array separated by the specified separator string. + * @param separator A string used to separate one element of an array from the next in the + * resulting String. If omitted, the array elements are separated with a comma. + */ + join(separator?: string): string; + + /** + * Returns the index of the last occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + lastIndexOf(searchElement: number, fromIndex?: number): number; + + /** + * The length of the array. + */ + readonly length: number; + + /** + * Calls a defined callback function on each element of an array, and returns an array that + * contains the results. + * @param callbackfn A function that accepts up to three arguments. The map method calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + map(callbackfn: (value: number, index: number, array: Int16Array) => number, thisArg?: any): Int16Array; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int16Array) => number): number; + reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int16Array) => number, initialValue: number): number; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int16Array) => U, initialValue: U): U; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an + * argument instead of an array value. + */ + reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int16Array) => number): number; + reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int16Array) => number, initialValue: number): number; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int16Array) => U, initialValue: U): U; + + /** + * Reverses the elements in an Array. + */ + reverse(): Int16Array; + + /** + * Sets a value or an array of values. + * @param array A typed or untyped array of values to set. + * @param offset The index in the current array at which the values are to be written. + */ + set(array: ArrayLike, offset?: number): void; + + /** + * Returns a section of an array. + * @param start The beginning of the specified portion of the array. + * @param end The end of the specified portion of the array. This is exclusive of the element at the index 'end'. + */ + slice(start?: number, end?: number): Int16Array; + + /** + * Determines whether the specified callback function returns true for any element of an array. + * @param callbackfn A function that accepts up to three arguments. The some method calls + * the callbackfn function for each element in the array until the callbackfn returns a value + * which is coercible to the Boolean value true, or until the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + some(callbackfn: (value: number, index: number, array: Int16Array) => unknown, thisArg?: any): boolean; + + /** + * Sorts an array. + * @param compareFn Function used to determine the order of the elements. It is expected to return + * a negative value if first argument is less than second argument, zero if they're equal and a positive + * value otherwise. If omitted, the elements are sorted in ascending, ASCII character order. + * ```ts + * [11,2,22,1].sort((a, b) => a - b) + * ``` + */ + sort(compareFn?: (a: number, b: number) => number): this; + + /** + * Gets a new Int16Array view of the ArrayBuffer store for this array, referencing the elements + * at begin, inclusive, up to end, exclusive. + * @param begin The index of the beginning of the array. + * @param end The index of the end of the array. + */ + subarray(begin?: number, end?: number): Int16Array; + + /** + * Converts a number to a string by using the current locale. + */ + toLocaleString(): string; + + /** + * Returns a string representation of an array. + */ + toString(): string; + + [index: number]: number; +} + +interface Int16ArrayConstructor { + readonly prototype: Int16Array; + new(length: number): Int16Array; + new(arrayOrArrayBuffer: ArrayLike | ArrayBufferLike): Int16Array; + new(buffer: ArrayBufferLike, byteOffset: number, length?: number): Int16Array; + + /** + * The size in bytes of each element in the array. + */ + readonly BYTES_PER_ELEMENT: number; + + /** + * Returns a new array from a set of elements. + * @param items A set of elements to include in the new array object. + */ + of(...items: number[]): Int16Array; + + /** + * Creates an array from an array-like or iterable object. + * @param arrayLike An array-like or iterable object to convert to an array. + */ + from(arrayLike: ArrayLike): Int16Array; + + /** + * Creates an array from an array-like or iterable object. + * @param arrayLike An array-like or iterable object to convert to an array. + * @param mapfn A mapping function to call on every element of the array. + * @param thisArg Value of 'this' used to invoke the mapfn. + */ + from(arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Int16Array; + + +} +declare var Int16Array: Int16ArrayConstructor; + +/** + * A typed array of 16-bit unsigned integer values. The contents are initialized to 0. If the + * requested number of bytes could not be allocated an exception is raised. + */ +interface Uint16Array { + /** + * The size in bytes of each element in the array. + */ + readonly BYTES_PER_ELEMENT: number; + + /** + * The ArrayBuffer instance referenced by the array. + */ + readonly buffer: ArrayBufferLike; + + /** + * The length in bytes of the array. + */ + readonly byteLength: number; + + /** + * The offset in bytes of the array. + */ + readonly byteOffset: number; + + /** + * Returns the this object after copying a section of the array identified by start and end + * to the same array starting at position target + * @param target If target is negative, it is treated as length+target where length is the + * length of the array. + * @param start If start is negative, it is treated as length+start. If end is negative, it + * is treated as length+end. + * @param end If not specified, length of the this object is used as its default value. + */ + copyWithin(target: number, start: number, end?: number): this; + + /** + * Determines whether all the members of an array satisfy the specified test. + * @param callbackfn A function that accepts up to three arguments. The every method calls + * the callbackfn function for each element in the array until the callbackfn returns a value + * which is coercible to the Boolean value false, or until the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + every(callbackfn: (value: number, index: number, array: Uint16Array) => unknown, thisArg?: any): boolean; + + /** + * Returns the this object after filling the section identified by start and end with value + * @param value value to fill array section with + * @param start index to start filling the array at. If start is negative, it is treated as + * length+start where length is the length of the array. + * @param end index to stop filling the array at. If end is negative, it is treated as + * length+end. + */ + fill(value: number, start?: number, end?: number): this; + + /** + * Returns the elements of an array that meet the condition specified in a callback function. + * @param callbackfn A function that accepts up to three arguments. The filter method calls + * the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + filter(callbackfn: (value: number, index: number, array: Uint16Array) => any, thisArg?: any): Uint16Array; + + /** + * Returns the value of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + find(predicate: (value: number, index: number, obj: Uint16Array) => boolean, thisArg?: any): number | undefined; + + /** + * Returns the index of the first element in the array where predicate is true, and -1 + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, + * findIndex immediately returns that element index. Otherwise, findIndex returns -1. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + findIndex(predicate: (value: number, index: number, obj: Uint16Array) => boolean, thisArg?: any): number; + + /** + * Performs the specified action for each element in an array. + * @param callbackfn A function that accepts up to three arguments. forEach calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + forEach(callbackfn: (value: number, index: number, array: Uint16Array) => void, thisArg?: any): void; + + /** + * Returns the index of the first occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + indexOf(searchElement: number, fromIndex?: number): number; + + /** + * Adds all the elements of an array separated by the specified separator string. + * @param separator A string used to separate one element of an array from the next in the + * resulting String. If omitted, the array elements are separated with a comma. + */ + join(separator?: string): string; + + /** + * Returns the index of the last occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + lastIndexOf(searchElement: number, fromIndex?: number): number; + + /** + * The length of the array. + */ + readonly length: number; + + /** + * Calls a defined callback function on each element of an array, and returns an array that + * contains the results. + * @param callbackfn A function that accepts up to three arguments. The map method calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + map(callbackfn: (value: number, index: number, array: Uint16Array) => number, thisArg?: any): Uint16Array; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint16Array) => number): number; + reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint16Array) => number, initialValue: number): number; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint16Array) => U, initialValue: U): U; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an + * argument instead of an array value. + */ + reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint16Array) => number): number; + reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint16Array) => number, initialValue: number): number; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint16Array) => U, initialValue: U): U; + + /** + * Reverses the elements in an Array. + */ + reverse(): Uint16Array; + + /** + * Sets a value or an array of values. + * @param array A typed or untyped array of values to set. + * @param offset The index in the current array at which the values are to be written. + */ + set(array: ArrayLike, offset?: number): void; + + /** + * Returns a section of an array. + * @param start The beginning of the specified portion of the array. + * @param end The end of the specified portion of the array. This is exclusive of the element at the index 'end'. + */ + slice(start?: number, end?: number): Uint16Array; + + /** + * Determines whether the specified callback function returns true for any element of an array. + * @param callbackfn A function that accepts up to three arguments. The some method calls + * the callbackfn function for each element in the array until the callbackfn returns a value + * which is coercible to the Boolean value true, or until the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + some(callbackfn: (value: number, index: number, array: Uint16Array) => unknown, thisArg?: any): boolean; + + /** + * Sorts an array. + * @param compareFn Function used to determine the order of the elements. It is expected to return + * a negative value if first argument is less than second argument, zero if they're equal and a positive + * value otherwise. If omitted, the elements are sorted in ascending, ASCII character order. + * ```ts + * [11,2,22,1].sort((a, b) => a - b) + * ``` + */ + sort(compareFn?: (a: number, b: number) => number): this; + + /** + * Gets a new Uint16Array view of the ArrayBuffer store for this array, referencing the elements + * at begin, inclusive, up to end, exclusive. + * @param begin The index of the beginning of the array. + * @param end The index of the end of the array. + */ + subarray(begin?: number, end?: number): Uint16Array; + + /** + * Converts a number to a string by using the current locale. + */ + toLocaleString(): string; + + /** + * Returns a string representation of an array. + */ + toString(): string; + + [index: number]: number; +} + +interface Uint16ArrayConstructor { + readonly prototype: Uint16Array; + new(length: number): Uint16Array; + new(arrayOrArrayBuffer: ArrayLike | ArrayBufferLike): Uint16Array; + new(buffer: ArrayBufferLike, byteOffset: number, length?: number): Uint16Array; + + /** + * The size in bytes of each element in the array. + */ + readonly BYTES_PER_ELEMENT: number; + + /** + * Returns a new array from a set of elements. + * @param items A set of elements to include in the new array object. + */ + of(...items: number[]): Uint16Array; + + /** + * Creates an array from an array-like or iterable object. + * @param arrayLike An array-like or iterable object to convert to an array. + */ + from(arrayLike: ArrayLike): Uint16Array; + + /** + * Creates an array from an array-like or iterable object. + * @param arrayLike An array-like or iterable object to convert to an array. + * @param mapfn A mapping function to call on every element of the array. + * @param thisArg Value of 'this' used to invoke the mapfn. + */ + from(arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Uint16Array; + + +} +declare var Uint16Array: Uint16ArrayConstructor; +/** + * A typed array of 32-bit signed integer values. The contents are initialized to 0. If the + * requested number of bytes could not be allocated an exception is raised. + */ +interface Int32Array { + /** + * The size in bytes of each element in the array. + */ + readonly BYTES_PER_ELEMENT: number; + + /** + * The ArrayBuffer instance referenced by the array. + */ + readonly buffer: ArrayBufferLike; + + /** + * The length in bytes of the array. + */ + readonly byteLength: number; + + /** + * The offset in bytes of the array. + */ + readonly byteOffset: number; + + /** + * Returns the this object after copying a section of the array identified by start and end + * to the same array starting at position target + * @param target If target is negative, it is treated as length+target where length is the + * length of the array. + * @param start If start is negative, it is treated as length+start. If end is negative, it + * is treated as length+end. + * @param end If not specified, length of the this object is used as its default value. + */ + copyWithin(target: number, start: number, end?: number): this; + + /** + * Determines whether all the members of an array satisfy the specified test. + * @param callbackfn A function that accepts up to three arguments. The every method calls + * the callbackfn function for each element in the array until the callbackfn returns a value + * which is coercible to the Boolean value false, or until the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + every(callbackfn: (value: number, index: number, array: Int32Array) => unknown, thisArg?: any): boolean; + + /** + * Returns the this object after filling the section identified by start and end with value + * @param value value to fill array section with + * @param start index to start filling the array at. If start is negative, it is treated as + * length+start where length is the length of the array. + * @param end index to stop filling the array at. If end is negative, it is treated as + * length+end. + */ + fill(value: number, start?: number, end?: number): this; + + /** + * Returns the elements of an array that meet the condition specified in a callback function. + * @param callbackfn A function that accepts up to three arguments. The filter method calls + * the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + filter(callbackfn: (value: number, index: number, array: Int32Array) => any, thisArg?: any): Int32Array; + + /** + * Returns the value of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + find(predicate: (value: number, index: number, obj: Int32Array) => boolean, thisArg?: any): number | undefined; + + /** + * Returns the index of the first element in the array where predicate is true, and -1 + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, + * findIndex immediately returns that element index. Otherwise, findIndex returns -1. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + findIndex(predicate: (value: number, index: number, obj: Int32Array) => boolean, thisArg?: any): number; + + /** + * Performs the specified action for each element in an array. + * @param callbackfn A function that accepts up to three arguments. forEach calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + forEach(callbackfn: (value: number, index: number, array: Int32Array) => void, thisArg?: any): void; + + /** + * Returns the index of the first occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + indexOf(searchElement: number, fromIndex?: number): number; + + /** + * Adds all the elements of an array separated by the specified separator string. + * @param separator A string used to separate one element of an array from the next in the + * resulting String. If omitted, the array elements are separated with a comma. + */ + join(separator?: string): string; + + /** + * Returns the index of the last occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + lastIndexOf(searchElement: number, fromIndex?: number): number; + + /** + * The length of the array. + */ + readonly length: number; + + /** + * Calls a defined callback function on each element of an array, and returns an array that + * contains the results. + * @param callbackfn A function that accepts up to three arguments. The map method calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + map(callbackfn: (value: number, index: number, array: Int32Array) => number, thisArg?: any): Int32Array; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int32Array) => number): number; + reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int32Array) => number, initialValue: number): number; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int32Array) => U, initialValue: U): U; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an + * argument instead of an array value. + */ + reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int32Array) => number): number; + reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int32Array) => number, initialValue: number): number; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int32Array) => U, initialValue: U): U; + + /** + * Reverses the elements in an Array. + */ + reverse(): Int32Array; + + /** + * Sets a value or an array of values. + * @param array A typed or untyped array of values to set. + * @param offset The index in the current array at which the values are to be written. + */ + set(array: ArrayLike, offset?: number): void; + + /** + * Returns a section of an array. + * @param start The beginning of the specified portion of the array. + * @param end The end of the specified portion of the array. This is exclusive of the element at the index 'end'. + */ + slice(start?: number, end?: number): Int32Array; + + /** + * Determines whether the specified callback function returns true for any element of an array. + * @param callbackfn A function that accepts up to three arguments. The some method calls + * the callbackfn function for each element in the array until the callbackfn returns a value + * which is coercible to the Boolean value true, or until the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + some(callbackfn: (value: number, index: number, array: Int32Array) => unknown, thisArg?: any): boolean; + + /** + * Sorts an array. + * @param compareFn Function used to determine the order of the elements. It is expected to return + * a negative value if first argument is less than second argument, zero if they're equal and a positive + * value otherwise. If omitted, the elements are sorted in ascending, ASCII character order. + * ```ts + * [11,2,22,1].sort((a, b) => a - b) + * ``` + */ + sort(compareFn?: (a: number, b: number) => number): this; + + /** + * Gets a new Int32Array view of the ArrayBuffer store for this array, referencing the elements + * at begin, inclusive, up to end, exclusive. + * @param begin The index of the beginning of the array. + * @param end The index of the end of the array. + */ + subarray(begin?: number, end?: number): Int32Array; + + /** + * Converts a number to a string by using the current locale. + */ + toLocaleString(): string; + + /** + * Returns a string representation of an array. + */ + toString(): string; + + [index: number]: number; +} + +interface Int32ArrayConstructor { + readonly prototype: Int32Array; + new(length: number): Int32Array; + new(arrayOrArrayBuffer: ArrayLike | ArrayBufferLike): Int32Array; + new(buffer: ArrayBufferLike, byteOffset: number, length?: number): Int32Array; + + /** + * The size in bytes of each element in the array. + */ + readonly BYTES_PER_ELEMENT: number; + + /** + * Returns a new array from a set of elements. + * @param items A set of elements to include in the new array object. + */ + of(...items: number[]): Int32Array; + + /** + * Creates an array from an array-like or iterable object. + * @param arrayLike An array-like or iterable object to convert to an array. + */ + from(arrayLike: ArrayLike): Int32Array; + + /** + * Creates an array from an array-like or iterable object. + * @param arrayLike An array-like or iterable object to convert to an array. + * @param mapfn A mapping function to call on every element of the array. + * @param thisArg Value of 'this' used to invoke the mapfn. + */ + from(arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Int32Array; + +} +declare var Int32Array: Int32ArrayConstructor; + +/** + * A typed array of 32-bit unsigned integer values. The contents are initialized to 0. If the + * requested number of bytes could not be allocated an exception is raised. + */ +interface Uint32Array { + /** + * The size in bytes of each element in the array. + */ + readonly BYTES_PER_ELEMENT: number; + + /** + * The ArrayBuffer instance referenced by the array. + */ + readonly buffer: ArrayBufferLike; + + /** + * The length in bytes of the array. + */ + readonly byteLength: number; + + /** + * The offset in bytes of the array. + */ + readonly byteOffset: number; + + /** + * Returns the this object after copying a section of the array identified by start and end + * to the same array starting at position target + * @param target If target is negative, it is treated as length+target where length is the + * length of the array. + * @param start If start is negative, it is treated as length+start. If end is negative, it + * is treated as length+end. + * @param end If not specified, length of the this object is used as its default value. + */ + copyWithin(target: number, start: number, end?: number): this; + + /** + * Determines whether all the members of an array satisfy the specified test. + * @param callbackfn A function that accepts up to three arguments. The every method calls + * the callbackfn function for each element in the array until the callbackfn returns a value + * which is coercible to the Boolean value false, or until the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + every(callbackfn: (value: number, index: number, array: Uint32Array) => unknown, thisArg?: any): boolean; + + /** + * Returns the this object after filling the section identified by start and end with value + * @param value value to fill array section with + * @param start index to start filling the array at. If start is negative, it is treated as + * length+start where length is the length of the array. + * @param end index to stop filling the array at. If end is negative, it is treated as + * length+end. + */ + fill(value: number, start?: number, end?: number): this; + + /** + * Returns the elements of an array that meet the condition specified in a callback function. + * @param callbackfn A function that accepts up to three arguments. The filter method calls + * the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + filter(callbackfn: (value: number, index: number, array: Uint32Array) => any, thisArg?: any): Uint32Array; + + /** + * Returns the value of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + find(predicate: (value: number, index: number, obj: Uint32Array) => boolean, thisArg?: any): number | undefined; + + /** + * Returns the index of the first element in the array where predicate is true, and -1 + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, + * findIndex immediately returns that element index. Otherwise, findIndex returns -1. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + findIndex(predicate: (value: number, index: number, obj: Uint32Array) => boolean, thisArg?: any): number; + + /** + * Performs the specified action for each element in an array. + * @param callbackfn A function that accepts up to three arguments. forEach calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + forEach(callbackfn: (value: number, index: number, array: Uint32Array) => void, thisArg?: any): void; + /** + * Returns the index of the first occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + indexOf(searchElement: number, fromIndex?: number): number; + + /** + * Adds all the elements of an array separated by the specified separator string. + * @param separator A string used to separate one element of an array from the next in the + * resulting String. If omitted, the array elements are separated with a comma. + */ + join(separator?: string): string; + + /** + * Returns the index of the last occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + lastIndexOf(searchElement: number, fromIndex?: number): number; + + /** + * The length of the array. + */ + readonly length: number; + + /** + * Calls a defined callback function on each element of an array, and returns an array that + * contains the results. + * @param callbackfn A function that accepts up to three arguments. The map method calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + map(callbackfn: (value: number, index: number, array: Uint32Array) => number, thisArg?: any): Uint32Array; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint32Array) => number): number; + reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint32Array) => number, initialValue: number): number; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint32Array) => U, initialValue: U): U; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an + * argument instead of an array value. + */ + reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint32Array) => number): number; + reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint32Array) => number, initialValue: number): number; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint32Array) => U, initialValue: U): U; + + /** + * Reverses the elements in an Array. + */ + reverse(): Uint32Array; + + /** + * Sets a value or an array of values. + * @param array A typed or untyped array of values to set. + * @param offset The index in the current array at which the values are to be written. + */ + set(array: ArrayLike, offset?: number): void; + + /** + * Returns a section of an array. + * @param start The beginning of the specified portion of the array. + * @param end The end of the specified portion of the array. This is exclusive of the element at the index 'end'. + */ + slice(start?: number, end?: number): Uint32Array; + + /** + * Determines whether the specified callback function returns true for any element of an array. + * @param callbackfn A function that accepts up to three arguments. The some method calls + * the callbackfn function for each element in the array until the callbackfn returns a value + * which is coercible to the Boolean value true, or until the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + some(callbackfn: (value: number, index: number, array: Uint32Array) => unknown, thisArg?: any): boolean; + + /** + * Sorts an array. + * @param compareFn Function used to determine the order of the elements. It is expected to return + * a negative value if first argument is less than second argument, zero if they're equal and a positive + * value otherwise. If omitted, the elements are sorted in ascending, ASCII character order. + * ```ts + * [11,2,22,1].sort((a, b) => a - b) + * ``` + */ + sort(compareFn?: (a: number, b: number) => number): this; + + /** + * Gets a new Uint32Array view of the ArrayBuffer store for this array, referencing the elements + * at begin, inclusive, up to end, exclusive. + * @param begin The index of the beginning of the array. + * @param end The index of the end of the array. + */ + subarray(begin?: number, end?: number): Uint32Array; + + /** + * Converts a number to a string by using the current locale. + */ + toLocaleString(): string; + + /** + * Returns a string representation of an array. + */ + toString(): string; + + [index: number]: number; +} + +interface Uint32ArrayConstructor { + readonly prototype: Uint32Array; + new(length: number): Uint32Array; + new(arrayOrArrayBuffer: ArrayLike | ArrayBufferLike): Uint32Array; + new(buffer: ArrayBufferLike, byteOffset: number, length?: number): Uint32Array; + + /** + * The size in bytes of each element in the array. + */ + readonly BYTES_PER_ELEMENT: number; + + /** + * Returns a new array from a set of elements. + * @param items A set of elements to include in the new array object. + */ + of(...items: number[]): Uint32Array; + + /** + * Creates an array from an array-like or iterable object. + * @param arrayLike An array-like or iterable object to convert to an array. + */ + from(arrayLike: ArrayLike): Uint32Array; + + /** + * Creates an array from an array-like or iterable object. + * @param arrayLike An array-like or iterable object to convert to an array. + * @param mapfn A mapping function to call on every element of the array. + * @param thisArg Value of 'this' used to invoke the mapfn. + */ + from(arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Uint32Array; + +} +declare var Uint32Array: Uint32ArrayConstructor; + +/** + * A typed array of 32-bit float values. The contents are initialized to 0. If the requested number + * of bytes could not be allocated an exception is raised. + */ +interface Float32Array { + /** + * The size in bytes of each element in the array. + */ + readonly BYTES_PER_ELEMENT: number; + + /** + * The ArrayBuffer instance referenced by the array. + */ + readonly buffer: ArrayBufferLike; + + /** + * The length in bytes of the array. + */ + readonly byteLength: number; + + /** + * The offset in bytes of the array. + */ + readonly byteOffset: number; + + /** + * Returns the this object after copying a section of the array identified by start and end + * to the same array starting at position target + * @param target If target is negative, it is treated as length+target where length is the + * length of the array. + * @param start If start is negative, it is treated as length+start. If end is negative, it + * is treated as length+end. + * @param end If not specified, length of the this object is used as its default value. + */ + copyWithin(target: number, start: number, end?: number): this; + + /** + * Determines whether all the members of an array satisfy the specified test. + * @param callbackfn A function that accepts up to three arguments. The every method calls + * the callbackfn function for each element in the array until the callbackfn returns a value + * which is coercible to the Boolean value false, or until the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + every(callbackfn: (value: number, index: number, array: Float32Array) => unknown, thisArg?: any): boolean; + + /** + * Returns the this object after filling the section identified by start and end with value + * @param value value to fill array section with + * @param start index to start filling the array at. If start is negative, it is treated as + * length+start where length is the length of the array. + * @param end index to stop filling the array at. If end is negative, it is treated as + * length+end. + */ + fill(value: number, start?: number, end?: number): this; + + /** + * Returns the elements of an array that meet the condition specified in a callback function. + * @param callbackfn A function that accepts up to three arguments. The filter method calls + * the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + filter(callbackfn: (value: number, index: number, array: Float32Array) => any, thisArg?: any): Float32Array; + + /** + * Returns the value of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + find(predicate: (value: number, index: number, obj: Float32Array) => boolean, thisArg?: any): number | undefined; + + /** + * Returns the index of the first element in the array where predicate is true, and -1 + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, + * findIndex immediately returns that element index. Otherwise, findIndex returns -1. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + findIndex(predicate: (value: number, index: number, obj: Float32Array) => boolean, thisArg?: any): number; + + /** + * Performs the specified action for each element in an array. + * @param callbackfn A function that accepts up to three arguments. forEach calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + forEach(callbackfn: (value: number, index: number, array: Float32Array) => void, thisArg?: any): void; + + /** + * Returns the index of the first occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + indexOf(searchElement: number, fromIndex?: number): number; + + /** + * Adds all the elements of an array separated by the specified separator string. + * @param separator A string used to separate one element of an array from the next in the + * resulting String. If omitted, the array elements are separated with a comma. + */ + join(separator?: string): string; + + /** + * Returns the index of the last occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + lastIndexOf(searchElement: number, fromIndex?: number): number; + + /** + * The length of the array. + */ + readonly length: number; + + /** + * Calls a defined callback function on each element of an array, and returns an array that + * contains the results. + * @param callbackfn A function that accepts up to three arguments. The map method calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + map(callbackfn: (value: number, index: number, array: Float32Array) => number, thisArg?: any): Float32Array; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float32Array) => number): number; + reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float32Array) => number, initialValue: number): number; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float32Array) => U, initialValue: U): U; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an + * argument instead of an array value. + */ + reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float32Array) => number): number; + reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float32Array) => number, initialValue: number): number; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float32Array) => U, initialValue: U): U; + + /** + * Reverses the elements in an Array. + */ + reverse(): Float32Array; + + /** + * Sets a value or an array of values. + * @param array A typed or untyped array of values to set. + * @param offset The index in the current array at which the values are to be written. + */ + set(array: ArrayLike, offset?: number): void; + + /** + * Returns a section of an array. + * @param start The beginning of the specified portion of the array. + * @param end The end of the specified portion of the array. This is exclusive of the element at the index 'end'. + */ + slice(start?: number, end?: number): Float32Array; + + /** + * Determines whether the specified callback function returns true for any element of an array. + * @param callbackfn A function that accepts up to three arguments. The some method calls + * the callbackfn function for each element in the array until the callbackfn returns a value + * which is coercible to the Boolean value true, or until the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + some(callbackfn: (value: number, index: number, array: Float32Array) => unknown, thisArg?: any): boolean; + + /** + * Sorts an array. + * @param compareFn Function used to determine the order of the elements. It is expected to return + * a negative value if first argument is less than second argument, zero if they're equal and a positive + * value otherwise. If omitted, the elements are sorted in ascending, ASCII character order. + * ```ts + * [11,2,22,1].sort((a, b) => a - b) + * ``` + */ + sort(compareFn?: (a: number, b: number) => number): this; + + /** + * Gets a new Float32Array view of the ArrayBuffer store for this array, referencing the elements + * at begin, inclusive, up to end, exclusive. + * @param begin The index of the beginning of the array. + * @param end The index of the end of the array. + */ + subarray(begin?: number, end?: number): Float32Array; + + /** + * Converts a number to a string by using the current locale. + */ + toLocaleString(): string; + + /** + * Returns a string representation of an array. + */ + toString(): string; + + [index: number]: number; +} + +interface Float32ArrayConstructor { + readonly prototype: Float32Array; + new(length: number): Float32Array; + new(arrayOrArrayBuffer: ArrayLike | ArrayBufferLike): Float32Array; + new(buffer: ArrayBufferLike, byteOffset: number, length?: number): Float32Array; + + /** + * The size in bytes of each element in the array. + */ + readonly BYTES_PER_ELEMENT: number; + + /** + * Returns a new array from a set of elements. + * @param items A set of elements to include in the new array object. + */ + of(...items: number[]): Float32Array; + + /** + * Creates an array from an array-like or iterable object. + * @param arrayLike An array-like or iterable object to convert to an array. + */ + from(arrayLike: ArrayLike): Float32Array; + + /** + * Creates an array from an array-like or iterable object. + * @param arrayLike An array-like or iterable object to convert to an array. + * @param mapfn A mapping function to call on every element of the array. + * @param thisArg Value of 'this' used to invoke the mapfn. + */ + from(arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Float32Array; + + +} +declare var Float32Array: Float32ArrayConstructor; + +/** + * A typed array of 64-bit float values. The contents are initialized to 0. If the requested + * number of bytes could not be allocated an exception is raised. + */ +interface Float64Array { + /** + * The size in bytes of each element in the array. + */ + readonly BYTES_PER_ELEMENT: number; + + /** + * The ArrayBuffer instance referenced by the array. + */ + readonly buffer: ArrayBufferLike; + + /** + * The length in bytes of the array. + */ + readonly byteLength: number; + + /** + * The offset in bytes of the array. + */ + readonly byteOffset: number; + + /** + * Returns the this object after copying a section of the array identified by start and end + * to the same array starting at position target + * @param target If target is negative, it is treated as length+target where length is the + * length of the array. + * @param start If start is negative, it is treated as length+start. If end is negative, it + * is treated as length+end. + * @param end If not specified, length of the this object is used as its default value. + */ + copyWithin(target: number, start: number, end?: number): this; + + /** + * Determines whether all the members of an array satisfy the specified test. + * @param callbackfn A function that accepts up to three arguments. The every method calls + * the callbackfn function for each element in the array until the callbackfn returns a value + * which is coercible to the Boolean value false, or until the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + every(callbackfn: (value: number, index: number, array: Float64Array) => unknown, thisArg?: any): boolean; + + /** + * Returns the this object after filling the section identified by start and end with value + * @param value value to fill array section with + * @param start index to start filling the array at. If start is negative, it is treated as + * length+start where length is the length of the array. + * @param end index to stop filling the array at. If end is negative, it is treated as + * length+end. + */ + fill(value: number, start?: number, end?: number): this; + + /** + * Returns the elements of an array that meet the condition specified in a callback function. + * @param callbackfn A function that accepts up to three arguments. The filter method calls + * the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + filter(callbackfn: (value: number, index: number, array: Float64Array) => any, thisArg?: any): Float64Array; + + /** + * Returns the value of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + find(predicate: (value: number, index: number, obj: Float64Array) => boolean, thisArg?: any): number | undefined; + + /** + * Returns the index of the first element in the array where predicate is true, and -1 + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, + * findIndex immediately returns that element index. Otherwise, findIndex returns -1. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + findIndex(predicate: (value: number, index: number, obj: Float64Array) => boolean, thisArg?: any): number; + + /** + * Performs the specified action for each element in an array. + * @param callbackfn A function that accepts up to three arguments. forEach calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + forEach(callbackfn: (value: number, index: number, array: Float64Array) => void, thisArg?: any): void; + + /** + * Returns the index of the first occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + indexOf(searchElement: number, fromIndex?: number): number; + + /** + * Adds all the elements of an array separated by the specified separator string. + * @param separator A string used to separate one element of an array from the next in the + * resulting String. If omitted, the array elements are separated with a comma. + */ + join(separator?: string): string; + + /** + * Returns the index of the last occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + lastIndexOf(searchElement: number, fromIndex?: number): number; + + /** + * The length of the array. + */ + readonly length: number; + + /** + * Calls a defined callback function on each element of an array, and returns an array that + * contains the results. + * @param callbackfn A function that accepts up to three arguments. The map method calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + map(callbackfn: (value: number, index: number, array: Float64Array) => number, thisArg?: any): Float64Array; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float64Array) => number): number; + reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float64Array) => number, initialValue: number): number; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float64Array) => U, initialValue: U): U; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an + * argument instead of an array value. + */ + reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float64Array) => number): number; + reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float64Array) => number, initialValue: number): number; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float64Array) => U, initialValue: U): U; + + /** + * Reverses the elements in an Array. + */ + reverse(): Float64Array; + + /** + * Sets a value or an array of values. + * @param array A typed or untyped array of values to set. + * @param offset The index in the current array at which the values are to be written. + */ + set(array: ArrayLike, offset?: number): void; + + /** + * Returns a section of an array. + * @param start The beginning of the specified portion of the array. + * @param end The end of the specified portion of the array. This is exclusive of the element at the index 'end'. + */ + slice(start?: number, end?: number): Float64Array; + + /** + * Determines whether the specified callback function returns true for any element of an array. + * @param callbackfn A function that accepts up to three arguments. The some method calls + * the callbackfn function for each element in the array until the callbackfn returns a value + * which is coercible to the Boolean value true, or until the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + some(callbackfn: (value: number, index: number, array: Float64Array) => unknown, thisArg?: any): boolean; + + /** + * Sorts an array. + * @param compareFn Function used to determine the order of the elements. It is expected to return + * a negative value if first argument is less than second argument, zero if they're equal and a positive + * value otherwise. If omitted, the elements are sorted in ascending, ASCII character order. + * ```ts + * [11,2,22,1].sort((a, b) => a - b) + * ``` + */ + sort(compareFn?: (a: number, b: number) => number): this; + + /** + * at begin, inclusive, up to end, exclusive. + * @param begin The index of the beginning of the array. + * @param end The index of the end of the array. + */ + subarray(begin?: number, end?: number): Float64Array; + + toString(): string; + + [index: number]: number; +} + +interface Float64ArrayConstructor { + readonly prototype: Float64Array; + new(length: number): Float64Array; + new(arrayOrArrayBuffer: ArrayLike | ArrayBufferLike): Float64Array; + new(buffer: ArrayBufferLike, byteOffset: number, length?: number): Float64Array; + + /** + * The size in bytes of each element in the array. + */ + readonly BYTES_PER_ELEMENT: number; + + /** + * Returns a new array from a set of elements. + * @param items A set of elements to include in the new array object. + */ + of(...items: number[]): Float64Array; + + /** + * Creates an array from an array-like or iterable object. + * @param arrayLike An array-like or iterable object to convert to an array. + */ + from(arrayLike: ArrayLike): Float64Array; + + /** + * Creates an array from an array-like or iterable object. + * @param arrayLike An array-like or iterable object to convert to an array. + * @param mapfn A mapping function to call on every element of the array. + * @param thisArg Value of 'this' used to invoke the mapfn. + */ + from(arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Float64Array; + +} +declare var Float64Array: Float64ArrayConstructor; + +///////////////////////////// +/// ECMAScript Internationalization API +///////////////////////////// + +declare namespace Intl { + interface CollatorOptions { + usage?: string; + localeMatcher?: string; + numeric?: boolean; + caseFirst?: string; + sensitivity?: string; + ignorePunctuation?: boolean; + } + + interface ResolvedCollatorOptions { + locale: string; + usage: string; + sensitivity: string; + ignorePunctuation: boolean; + collation: string; + caseFirst: string; + numeric: boolean; + } + + interface Collator { + compare(x: string, y: string): number; + resolvedOptions(): ResolvedCollatorOptions; + } + var Collator: { + new(locales?: string | string[], options?: CollatorOptions): Collator; + (locales?: string | string[], options?: CollatorOptions): Collator; + supportedLocalesOf(locales: string | string[], options?: CollatorOptions): string[]; + }; + + interface NumberFormatOptions { + localeMatcher?: string; + style?: string; + currency?: string; + currencyDisplay?: string; + useGrouping?: boolean; + minimumIntegerDigits?: number; + minimumFractionDigits?: number; + maximumFractionDigits?: number; + minimumSignificantDigits?: number; + maximumSignificantDigits?: number; + } + + interface ResolvedNumberFormatOptions { + locale: string; + numberingSystem: string; + style: string; + currency?: string; + currencyDisplay?: string; + minimumIntegerDigits: number; + minimumFractionDigits: number; + maximumFractionDigits: number; + minimumSignificantDigits?: number; + maximumSignificantDigits?: number; + useGrouping: boolean; + } + + interface NumberFormat { + format(value: number): string; + resolvedOptions(): ResolvedNumberFormatOptions; + } + var NumberFormat: { + new(locales?: string | string[], options?: NumberFormatOptions): NumberFormat; + (locales?: string | string[], options?: NumberFormatOptions): NumberFormat; + supportedLocalesOf(locales: string | string[], options?: NumberFormatOptions): string[]; + }; + + interface DateTimeFormatOptions { + localeMatcher?: string; + weekday?: string; + era?: string; + year?: string; + month?: string; + day?: string; + hour?: string; + minute?: string; + second?: string; + timeZoneName?: string; + formatMatcher?: string; + hour12?: boolean; + timeZone?: string; + } + + interface ResolvedDateTimeFormatOptions { + locale: string; + calendar: string; + numberingSystem: string; + timeZone: string; + hour12?: boolean; + weekday?: string; + era?: string; + year?: string; + month?: string; + day?: string; + hour?: string; + minute?: string; + second?: string; + timeZoneName?: string; + } + + interface DateTimeFormat { + format(date?: Date | number): string; + resolvedOptions(): ResolvedDateTimeFormatOptions; + } + var DateTimeFormat: { + new(locales?: string | string[], options?: DateTimeFormatOptions): DateTimeFormat; + (locales?: string | string[], options?: DateTimeFormatOptions): DateTimeFormat; + supportedLocalesOf(locales: string | string[], options?: DateTimeFormatOptions): string[]; + }; +} + +interface String { + /** + * Determines whether two strings are equivalent in the current or specified locale. + * @param that String to compare to target string + * @param locales A locale string or array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used. This parameter must conform to BCP 47 standards; see the Intl.Collator object for details. + * @param options An object that contains one or more properties that specify comparison options. see the Intl.Collator object for details. + */ + localeCompare(that: string, locales?: string | string[], options?: Intl.CollatorOptions): number; +} + +interface Number { + /** + * Converts a number to a string by using the current or specified locale. + * @param locales A locale string or array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used. + * @param options An object that contains one or more properties that specify comparison options. + */ + toLocaleString(locales?: string | string[], options?: Intl.NumberFormatOptions): string; +} + +interface Date { + /** + * Converts a date and time to a string by using the current or specified locale. + * @param locales A locale string or array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used. + * @param options An object that contains one or more properties that specify comparison options. + */ + toLocaleString(locales?: string | string[], options?: Intl.DateTimeFormatOptions): string; + /** + * Converts a date to a string by using the current or specified locale. + * @param locales A locale string or array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used. + * @param options An object that contains one or more properties that specify comparison options. + */ + toLocaleDateString(locales?: string | string[], options?: Intl.DateTimeFormatOptions): string; + + /** + * Converts a time to a string by using the current or specified locale. + * @param locales A locale string or array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used. + * @param options An object that contains one or more properties that specify comparison options. + */ + toLocaleTimeString(locales?: string | string[], options?: Intl.DateTimeFormatOptions): string; +} diff --git a/node_modules/typescript/lib/lib.es6.d.ts b/node_modules/typescript/lib/lib.es6.d.ts index 6149c4a29..f2ebe020e 100644 --- a/node_modules/typescript/lib/lib.es6.d.ts +++ b/node_modules/typescript/lib/lib.es6.d.ts @@ -15,11 +15,11 @@ and limitations under the License. -/// +/// -/// -/// -/// -/// -/// +/// +/// +/// +/// +/// diff --git a/node_modules/typescript/lib/lib.esnext.bigint.d.ts b/node_modules/typescript/lib/lib.esnext.bigint.d.ts index ba9bae6e8..748841ae7 100644 --- a/node_modules/typescript/lib/lib.esnext.bigint.d.ts +++ b/node_modules/typescript/lib/lib.esnext.bigint.d.ts @@ -15,615 +15,615 @@ and limitations under the License. -/// - - -interface BigInt { - /** - * Returns a string representation of an object. - * @param radix Specifies a radix for converting numeric values to strings. - */ - toString(radix?: number): string; - - /** Returns a string representation appropriate to the host environment's current locale. */ - toLocaleString(): string; - - /** Returns the primitive value of the specified object. */ - valueOf(): bigint; - - readonly [Symbol.toStringTag]: "BigInt"; -} - -interface BigIntConstructor { - (value?: any): bigint; - readonly prototype: BigInt; - - /** - * Interprets the low bits of a BigInt as a 2's-complement signed integer. - * All higher bits are discarded. - * @param bits The number of low bits to use - * @param int The BigInt whose bits to extract - */ - asIntN(bits: number, int: bigint): bigint; - /** - * Interprets the low bits of a BigInt as an unsigned integer. - * All higher bits are discarded. - * @param bits The number of low bits to use - * @param int The BigInt whose bits to extract - */ - asUintN(bits: number, int: bigint): bigint; -} - -declare var BigInt: BigIntConstructor; - -/** - * A typed array of 64-bit signed integer values. The contents are initialized to 0. If the - * requested number of bytes could not be allocated, an exception is raised. - */ -interface BigInt64Array { - /** The size in bytes of each element in the array. */ - readonly BYTES_PER_ELEMENT: number; - - /** The ArrayBuffer instance referenced by the array. */ - readonly buffer: ArrayBufferLike; - - /** The length in bytes of the array. */ - readonly byteLength: number; - - /** The offset in bytes of the array. */ - readonly byteOffset: number; - - /** - * Returns the this object after copying a section of the array identified by start and end - * to the same array starting at position target - * @param target If target is negative, it is treated as length+target where length is the - * length of the array. - * @param start If start is negative, it is treated as length+start. If end is negative, it - * is treated as length+end. - * @param end If not specified, length of the this object is used as its default value. - */ - copyWithin(target: number, start: number, end?: number): this; - - /** Yields index, value pairs for every entry in the array. */ - entries(): IterableIterator<[number, bigint]>; - - /** - * Determines whether all the members of an array satisfy the specified test. - * @param callbackfn A function that accepts up to three arguments. The every method calls - * the callbackfn function for each element in the array until the callbackfn returns false, - * or until the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - every(callbackfn: (value: bigint, index: number, array: BigInt64Array) => boolean, thisArg?: any): boolean; - - /** - * Returns the this object after filling the section identified by start and end with value - * @param value value to fill array section with - * @param start index to start filling the array at. If start is negative, it is treated as - * length+start where length is the length of the array. - * @param end index to stop filling the array at. If end is negative, it is treated as - * length+end. - */ - fill(value: bigint, start?: number, end?: number): this; - - /** - * Returns the elements of an array that meet the condition specified in a callback function. - * @param callbackfn A function that accepts up to three arguments. The filter method calls - * the callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - filter(callbackfn: (value: bigint, index: number, array: BigInt64Array) => any, thisArg?: any): BigInt64Array; - - /** - * Returns the value of the first element in the array where predicate is true, and undefined - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, find - * immediately returns that element value. Otherwise, find returns undefined. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - find(predicate: (value: bigint, index: number, array: BigInt64Array) => boolean, thisArg?: any): bigint | undefined; - - /** - * Returns the index of the first element in the array where predicate is true, and -1 - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, - * findIndex immediately returns that element index. Otherwise, findIndex returns -1. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - findIndex(predicate: (value: bigint, index: number, array: BigInt64Array) => boolean, thisArg?: any): number; - - /** - * Performs the specified action for each element in an array. - * @param callbackfn A function that accepts up to three arguments. forEach calls the - * callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - forEach(callbackfn: (value: bigint, index: number, array: BigInt64Array) => void, thisArg?: any): void; - - /** - * Determines whether an array includes a certain element, returning true or false as appropriate. - * @param searchElement The element to search for. - * @param fromIndex The position in this array at which to begin searching for searchElement. - */ - includes(searchElement: bigint, fromIndex?: number): boolean; - - /** - * Returns the index of the first occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the - * search starts at index 0. - */ - indexOf(searchElement: bigint, fromIndex?: number): number; - - /** - * Adds all the elements of an array separated by the specified separator string. - * @param separator A string used to separate one element of an array from the next in the - * resulting String. If omitted, the array elements are separated with a comma. - */ - join(separator?: string): string; - - /** Yields each index in the array. */ - keys(): IterableIterator; - - /** - * Returns the index of the last occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the - * search starts at index 0. - */ - lastIndexOf(searchElement: bigint, fromIndex?: number): number; - - /** The length of the array. */ - readonly length: number; - - /** - * Calls a defined callback function on each element of an array, and returns an array that - * contains the results. - * @param callbackfn A function that accepts up to three arguments. The map method calls the - * callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - map(callbackfn: (value: bigint, index: number, array: BigInt64Array) => bigint, thisArg?: any): BigInt64Array; - - /** - * Calls the specified callback function for all the elements in an array. The return value of - * the callback function is the accumulated result, and is provided as an argument in the next - * call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the - * callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduce(callbackfn: (previousValue: bigint, currentValue: bigint, currentIndex: number, array: BigInt64Array) => bigint): bigint; - - /** - * Calls the specified callback function for all the elements in an array. The return value of - * the callback function is the accumulated result, and is provided as an argument in the next - * call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the - * callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduce(callbackfn: (previousValue: U, currentValue: bigint, currentIndex: number, array: BigInt64Array) => U, initialValue: U): U; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. - * The return value of the callback function is the accumulated result, and is provided as an - * argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls - * the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an - * argument instead of an array value. - */ - reduceRight(callbackfn: (previousValue: bigint, currentValue: bigint, currentIndex: number, array: BigInt64Array) => bigint): bigint; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. - * The return value of the callback function is the accumulated result, and is provided as an - * argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls - * the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduceRight(callbackfn: (previousValue: U, currentValue: bigint, currentIndex: number, array: BigInt64Array) => U, initialValue: U): U; - - /** Reverses the elements in the array. */ - reverse(): this; - - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. - */ - set(array: ArrayLike, offset?: number): void; - - /** - * Returns a section of an array. - * @param start The beginning of the specified portion of the array. - * @param end The end of the specified portion of the array. - */ - slice(start?: number, end?: number): BigInt64Array; - - /** - * Determines whether the specified callback function returns true for any element of an array. - * @param callbackfn A function that accepts up to three arguments. The some method calls the - * callbackfn function for each element in the array until the callbackfn returns true, or until - * the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - some(callbackfn: (value: bigint, index: number, array: BigInt64Array) => boolean, thisArg?: any): boolean; - - /** - * Sorts the array. - * @param compareFn The function used to determine the order of the elements. If omitted, the elements are sorted in ascending order. - */ - sort(compareFn?: (a: bigint, b: bigint) => number | bigint): this; - - /** - * Gets a new BigInt64Array view of the ArrayBuffer store for this array, referencing the elements - * at begin, inclusive, up to end, exclusive. - * @param begin The index of the beginning of the array. - * @param end The index of the end of the array. - */ - subarray(begin?: number, end?: number): BigInt64Array; - - /** Converts the array to a string by using the current locale. */ - toLocaleString(): string; - - /** Returns a string representation of the array. */ - toString(): string; - - /** Yields each value in the array. */ - values(): IterableIterator; - - [Symbol.iterator](): IterableIterator; - - readonly [Symbol.toStringTag]: "BigInt64Array"; - - [index: number]: bigint; -} - -interface BigInt64ArrayConstructor { - readonly prototype: BigInt64Array; - new(length?: number): BigInt64Array; - new(array: Iterable): BigInt64Array; - new(buffer: ArrayBufferLike, byteOffset?: number, length?: number): BigInt64Array; - - /** The size in bytes of each element in the array. */ - readonly BYTES_PER_ELEMENT: number; - - /** - * Returns a new array from a set of elements. - * @param items A set of elements to include in the new array object. - */ - of(...items: bigint[]): BigInt64Array; - - /** - * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. - * @param mapfn A mapping function to call on every element of the array. - * @param thisArg Value of 'this' used to invoke the mapfn. - */ - from(arrayLike: ArrayLike): BigInt64Array; - from(arrayLike: ArrayLike, mapfn: (v: U, k: number) => bigint, thisArg?: any): BigInt64Array; -} - -declare var BigInt64Array: BigInt64ArrayConstructor; - -/** - * A typed array of 64-bit unsigned integer values. The contents are initialized to 0. If the - * requested number of bytes could not be allocated, an exception is raised. - */ -interface BigUint64Array { - /** The size in bytes of each element in the array. */ - readonly BYTES_PER_ELEMENT: number; - - /** The ArrayBuffer instance referenced by the array. */ - readonly buffer: ArrayBufferLike; - - /** The length in bytes of the array. */ - readonly byteLength: number; - - /** The offset in bytes of the array. */ - readonly byteOffset: number; - - /** - * Returns the this object after copying a section of the array identified by start and end - * to the same array starting at position target - * @param target If target is negative, it is treated as length+target where length is the - * length of the array. - * @param start If start is negative, it is treated as length+start. If end is negative, it - * is treated as length+end. - * @param end If not specified, length of the this object is used as its default value. - */ - copyWithin(target: number, start: number, end?: number): this; - - /** Yields index, value pairs for every entry in the array. */ - entries(): IterableIterator<[number, bigint]>; - - /** - * Determines whether all the members of an array satisfy the specified test. - * @param callbackfn A function that accepts up to three arguments. The every method calls - * the callbackfn function for each element in the array until the callbackfn returns false, - * or until the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - every(callbackfn: (value: bigint, index: number, array: BigUint64Array) => boolean, thisArg?: any): boolean; - - /** - * Returns the this object after filling the section identified by start and end with value - * @param value value to fill array section with - * @param start index to start filling the array at. If start is negative, it is treated as - * length+start where length is the length of the array. - * @param end index to stop filling the array at. If end is negative, it is treated as - * length+end. - */ - fill(value: bigint, start?: number, end?: number): this; - - /** - * Returns the elements of an array that meet the condition specified in a callback function. - * @param callbackfn A function that accepts up to three arguments. The filter method calls - * the callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - filter(callbackfn: (value: bigint, index: number, array: BigUint64Array) => any, thisArg?: any): BigUint64Array; - - /** - * Returns the value of the first element in the array where predicate is true, and undefined - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, find - * immediately returns that element value. Otherwise, find returns undefined. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - find(predicate: (value: bigint, index: number, array: BigUint64Array) => boolean, thisArg?: any): bigint | undefined; - - /** - * Returns the index of the first element in the array where predicate is true, and -1 - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, - * findIndex immediately returns that element index. Otherwise, findIndex returns -1. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - findIndex(predicate: (value: bigint, index: number, array: BigUint64Array) => boolean, thisArg?: any): number; - - /** - * Performs the specified action for each element in an array. - * @param callbackfn A function that accepts up to three arguments. forEach calls the - * callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - forEach(callbackfn: (value: bigint, index: number, array: BigUint64Array) => void, thisArg?: any): void; - - /** - * Determines whether an array includes a certain element, returning true or false as appropriate. - * @param searchElement The element to search for. - * @param fromIndex The position in this array at which to begin searching for searchElement. - */ - includes(searchElement: bigint, fromIndex?: number): boolean; - - /** - * Returns the index of the first occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the - * search starts at index 0. - */ - indexOf(searchElement: bigint, fromIndex?: number): number; - - /** - * Adds all the elements of an array separated by the specified separator string. - * @param separator A string used to separate one element of an array from the next in the - * resulting String. If omitted, the array elements are separated with a comma. - */ - join(separator?: string): string; - - /** Yields each index in the array. */ - keys(): IterableIterator; - - /** - * Returns the index of the last occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the - * search starts at index 0. - */ - lastIndexOf(searchElement: bigint, fromIndex?: number): number; - - /** The length of the array. */ - readonly length: number; - - /** - * Calls a defined callback function on each element of an array, and returns an array that - * contains the results. - * @param callbackfn A function that accepts up to three arguments. The map method calls the - * callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - map(callbackfn: (value: bigint, index: number, array: BigUint64Array) => bigint, thisArg?: any): BigUint64Array; - - /** - * Calls the specified callback function for all the elements in an array. The return value of - * the callback function is the accumulated result, and is provided as an argument in the next - * call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the - * callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduce(callbackfn: (previousValue: bigint, currentValue: bigint, currentIndex: number, array: BigUint64Array) => bigint): bigint; - - /** - * Calls the specified callback function for all the elements in an array. The return value of - * the callback function is the accumulated result, and is provided as an argument in the next - * call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the - * callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduce(callbackfn: (previousValue: U, currentValue: bigint, currentIndex: number, array: BigUint64Array) => U, initialValue: U): U; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. - * The return value of the callback function is the accumulated result, and is provided as an - * argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls - * the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an - * argument instead of an array value. - */ - reduceRight(callbackfn: (previousValue: bigint, currentValue: bigint, currentIndex: number, array: BigUint64Array) => bigint): bigint; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. - * The return value of the callback function is the accumulated result, and is provided as an - * argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls - * the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduceRight(callbackfn: (previousValue: U, currentValue: bigint, currentIndex: number, array: BigUint64Array) => U, initialValue: U): U; - - /** Reverses the elements in the array. */ - reverse(): this; - - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. - */ - set(array: ArrayLike, offset?: number): void; - - /** - * Returns a section of an array. - * @param start The beginning of the specified portion of the array. - * @param end The end of the specified portion of the array. - */ - slice(start?: number, end?: number): BigUint64Array; - - /** - * Determines whether the specified callback function returns true for any element of an array. - * @param callbackfn A function that accepts up to three arguments. The some method calls the - * callbackfn function for each element in the array until the callbackfn returns true, or until - * the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - some(callbackfn: (value: bigint, index: number, array: BigUint64Array) => boolean, thisArg?: any): boolean; - - /** - * Sorts the array. - * @param compareFn The function used to determine the order of the elements. If omitted, the elements are sorted in ascending order. - */ - sort(compareFn?: (a: bigint, b: bigint) => number | bigint): this; - - /** - * Gets a new BigUint64Array view of the ArrayBuffer store for this array, referencing the elements - * at begin, inclusive, up to end, exclusive. - * @param begin The index of the beginning of the array. - * @param end The index of the end of the array. - */ - subarray(begin?: number, end?: number): BigUint64Array; - - /** Converts the array to a string by using the current locale. */ - toLocaleString(): string; - - /** Returns a string representation of the array. */ - toString(): string; - - /** Yields each value in the array. */ - values(): IterableIterator; - - [Symbol.iterator](): IterableIterator; - - readonly [Symbol.toStringTag]: "BigUint64Array"; - - [index: number]: bigint; -} - -interface BigUint64ArrayConstructor { - readonly prototype: BigUint64Array; - new(length?: number): BigUint64Array; - new(array: Iterable): BigUint64Array; - new(buffer: ArrayBufferLike, byteOffset?: number, length?: number): BigUint64Array; - - /** The size in bytes of each element in the array. */ - readonly BYTES_PER_ELEMENT: number; - - /** - * Returns a new array from a set of elements. - * @param items A set of elements to include in the new array object. - */ - of(...items: bigint[]): BigUint64Array; - - /** - * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. - * @param mapfn A mapping function to call on every element of the array. - * @param thisArg Value of 'this' used to invoke the mapfn. - */ - from(arrayLike: ArrayLike): BigUint64Array; - from(arrayLike: ArrayLike, mapfn: (v: U, k: number) => bigint, thisArg?: any): BigUint64Array; -} - -declare var BigUint64Array: BigUint64ArrayConstructor; - -interface DataView { - /** - * Gets the BigInt64 value at the specified byte offset from the start of the view. There is - * no alignment constraint; multi-byte values may be fetched from any offset. - * @param byteOffset The place in the buffer at which the value should be retrieved. - */ - getBigInt64(byteOffset: number, littleEndian?: boolean): bigint; - - /** - * Gets the BigUint64 value at the specified byte offset from the start of the view. There is - * no alignment constraint; multi-byte values may be fetched from any offset. - * @param byteOffset The place in the buffer at which the value should be retrieved. - */ - getBigUint64(byteOffset: number, littleEndian?: boolean): bigint; - - /** - * Stores a BigInt64 value at the specified byte offset from the start of the view. - * @param byteOffset The place in the buffer at which the value should be set. - * @param value The value to set. - * @param littleEndian If false or undefined, a big-endian value should be written, - * otherwise a little-endian value should be written. - */ - setBigInt64(byteOffset: number, value: bigint, littleEndian?: boolean): void; - - /** - * Stores a BigUint64 value at the specified byte offset from the start of the view. - * @param byteOffset The place in the buffer at which the value should be set. - * @param value The value to set. - * @param littleEndian If false or undefined, a big-endian value should be written, - * otherwise a little-endian value should be written. - */ - setBigUint64(byteOffset: number, value: bigint, littleEndian?: boolean): void; -} +/// + + +interface BigInt { + /** + * Returns a string representation of an object. + * @param radix Specifies a radix for converting numeric values to strings. + */ + toString(radix?: number): string; + + /** Returns a string representation appropriate to the host environment's current locale. */ + toLocaleString(): string; + + /** Returns the primitive value of the specified object. */ + valueOf(): bigint; + + readonly [Symbol.toStringTag]: "BigInt"; +} + +interface BigIntConstructor { + (value?: any): bigint; + readonly prototype: BigInt; + + /** + * Interprets the low bits of a BigInt as a 2's-complement signed integer. + * All higher bits are discarded. + * @param bits The number of low bits to use + * @param int The BigInt whose bits to extract + */ + asIntN(bits: number, int: bigint): bigint; + /** + * Interprets the low bits of a BigInt as an unsigned integer. + * All higher bits are discarded. + * @param bits The number of low bits to use + * @param int The BigInt whose bits to extract + */ + asUintN(bits: number, int: bigint): bigint; +} + +declare var BigInt: BigIntConstructor; + +/** + * A typed array of 64-bit signed integer values. The contents are initialized to 0. If the + * requested number of bytes could not be allocated, an exception is raised. + */ +interface BigInt64Array { + /** The size in bytes of each element in the array. */ + readonly BYTES_PER_ELEMENT: number; + + /** The ArrayBuffer instance referenced by the array. */ + readonly buffer: ArrayBufferLike; + + /** The length in bytes of the array. */ + readonly byteLength: number; + + /** The offset in bytes of the array. */ + readonly byteOffset: number; + + /** + * Returns the this object after copying a section of the array identified by start and end + * to the same array starting at position target + * @param target If target is negative, it is treated as length+target where length is the + * length of the array. + * @param start If start is negative, it is treated as length+start. If end is negative, it + * is treated as length+end. + * @param end If not specified, length of the this object is used as its default value. + */ + copyWithin(target: number, start: number, end?: number): this; + + /** Yields index, value pairs for every entry in the array. */ + entries(): IterableIterator<[number, bigint]>; + + /** + * Determines whether all the members of an array satisfy the specified test. + * @param callbackfn A function that accepts up to three arguments. The every method calls + * the callbackfn function for each element in the array until the callbackfn returns false, + * or until the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + every(callbackfn: (value: bigint, index: number, array: BigInt64Array) => boolean, thisArg?: any): boolean; + + /** + * Returns the this object after filling the section identified by start and end with value + * @param value value to fill array section with + * @param start index to start filling the array at. If start is negative, it is treated as + * length+start where length is the length of the array. + * @param end index to stop filling the array at. If end is negative, it is treated as + * length+end. + */ + fill(value: bigint, start?: number, end?: number): this; + + /** + * Returns the elements of an array that meet the condition specified in a callback function. + * @param callbackfn A function that accepts up to three arguments. The filter method calls + * the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + filter(callbackfn: (value: bigint, index: number, array: BigInt64Array) => any, thisArg?: any): BigInt64Array; + + /** + * Returns the value of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + find(predicate: (value: bigint, index: number, array: BigInt64Array) => boolean, thisArg?: any): bigint | undefined; + + /** + * Returns the index of the first element in the array where predicate is true, and -1 + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, + * findIndex immediately returns that element index. Otherwise, findIndex returns -1. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + findIndex(predicate: (value: bigint, index: number, array: BigInt64Array) => boolean, thisArg?: any): number; + + /** + * Performs the specified action for each element in an array. + * @param callbackfn A function that accepts up to three arguments. forEach calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + forEach(callbackfn: (value: bigint, index: number, array: BigInt64Array) => void, thisArg?: any): void; + + /** + * Determines whether an array includes a certain element, returning true or false as appropriate. + * @param searchElement The element to search for. + * @param fromIndex The position in this array at which to begin searching for searchElement. + */ + includes(searchElement: bigint, fromIndex?: number): boolean; + + /** + * Returns the index of the first occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + indexOf(searchElement: bigint, fromIndex?: number): number; + + /** + * Adds all the elements of an array separated by the specified separator string. + * @param separator A string used to separate one element of an array from the next in the + * resulting String. If omitted, the array elements are separated with a comma. + */ + join(separator?: string): string; + + /** Yields each index in the array. */ + keys(): IterableIterator; + + /** + * Returns the index of the last occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + lastIndexOf(searchElement: bigint, fromIndex?: number): number; + + /** The length of the array. */ + readonly length: number; + + /** + * Calls a defined callback function on each element of an array, and returns an array that + * contains the results. + * @param callbackfn A function that accepts up to three arguments. The map method calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + map(callbackfn: (value: bigint, index: number, array: BigInt64Array) => bigint, thisArg?: any): BigInt64Array; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: bigint, currentValue: bigint, currentIndex: number, array: BigInt64Array) => bigint): bigint; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: U, currentValue: bigint, currentIndex: number, array: BigInt64Array) => U, initialValue: U): U; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an + * argument instead of an array value. + */ + reduceRight(callbackfn: (previousValue: bigint, currentValue: bigint, currentIndex: number, array: BigInt64Array) => bigint): bigint; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduceRight(callbackfn: (previousValue: U, currentValue: bigint, currentIndex: number, array: BigInt64Array) => U, initialValue: U): U; + + /** Reverses the elements in the array. */ + reverse(): this; + + /** + * Sets a value or an array of values. + * @param array A typed or untyped array of values to set. + * @param offset The index in the current array at which the values are to be written. + */ + set(array: ArrayLike, offset?: number): void; + + /** + * Returns a section of an array. + * @param start The beginning of the specified portion of the array. + * @param end The end of the specified portion of the array. + */ + slice(start?: number, end?: number): BigInt64Array; + + /** + * Determines whether the specified callback function returns true for any element of an array. + * @param callbackfn A function that accepts up to three arguments. The some method calls the + * callbackfn function for each element in the array until the callbackfn returns true, or until + * the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + some(callbackfn: (value: bigint, index: number, array: BigInt64Array) => boolean, thisArg?: any): boolean; + + /** + * Sorts the array. + * @param compareFn The function used to determine the order of the elements. If omitted, the elements are sorted in ascending order. + */ + sort(compareFn?: (a: bigint, b: bigint) => number | bigint): this; + + /** + * Gets a new BigInt64Array view of the ArrayBuffer store for this array, referencing the elements + * at begin, inclusive, up to end, exclusive. + * @param begin The index of the beginning of the array. + * @param end The index of the end of the array. + */ + subarray(begin?: number, end?: number): BigInt64Array; + + /** Converts the array to a string by using the current locale. */ + toLocaleString(): string; + + /** Returns a string representation of the array. */ + toString(): string; + + /** Yields each value in the array. */ + values(): IterableIterator; + + [Symbol.iterator](): IterableIterator; + + readonly [Symbol.toStringTag]: "BigInt64Array"; + + [index: number]: bigint; +} + +interface BigInt64ArrayConstructor { + readonly prototype: BigInt64Array; + new(length?: number): BigInt64Array; + new(array: Iterable): BigInt64Array; + new(buffer: ArrayBufferLike, byteOffset?: number, length?: number): BigInt64Array; + + /** The size in bytes of each element in the array. */ + readonly BYTES_PER_ELEMENT: number; + + /** + * Returns a new array from a set of elements. + * @param items A set of elements to include in the new array object. + */ + of(...items: bigint[]): BigInt64Array; + + /** + * Creates an array from an array-like or iterable object. + * @param arrayLike An array-like or iterable object to convert to an array. + * @param mapfn A mapping function to call on every element of the array. + * @param thisArg Value of 'this' used to invoke the mapfn. + */ + from(arrayLike: ArrayLike): BigInt64Array; + from(arrayLike: ArrayLike, mapfn: (v: U, k: number) => bigint, thisArg?: any): BigInt64Array; +} + +declare var BigInt64Array: BigInt64ArrayConstructor; + +/** + * A typed array of 64-bit unsigned integer values. The contents are initialized to 0. If the + * requested number of bytes could not be allocated, an exception is raised. + */ +interface BigUint64Array { + /** The size in bytes of each element in the array. */ + readonly BYTES_PER_ELEMENT: number; + + /** The ArrayBuffer instance referenced by the array. */ + readonly buffer: ArrayBufferLike; + + /** The length in bytes of the array. */ + readonly byteLength: number; + + /** The offset in bytes of the array. */ + readonly byteOffset: number; + + /** + * Returns the this object after copying a section of the array identified by start and end + * to the same array starting at position target + * @param target If target is negative, it is treated as length+target where length is the + * length of the array. + * @param start If start is negative, it is treated as length+start. If end is negative, it + * is treated as length+end. + * @param end If not specified, length of the this object is used as its default value. + */ + copyWithin(target: number, start: number, end?: number): this; + + /** Yields index, value pairs for every entry in the array. */ + entries(): IterableIterator<[number, bigint]>; + + /** + * Determines whether all the members of an array satisfy the specified test. + * @param callbackfn A function that accepts up to three arguments. The every method calls + * the callbackfn function for each element in the array until the callbackfn returns false, + * or until the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + every(callbackfn: (value: bigint, index: number, array: BigUint64Array) => boolean, thisArg?: any): boolean; + + /** + * Returns the this object after filling the section identified by start and end with value + * @param value value to fill array section with + * @param start index to start filling the array at. If start is negative, it is treated as + * length+start where length is the length of the array. + * @param end index to stop filling the array at. If end is negative, it is treated as + * length+end. + */ + fill(value: bigint, start?: number, end?: number): this; + + /** + * Returns the elements of an array that meet the condition specified in a callback function. + * @param callbackfn A function that accepts up to three arguments. The filter method calls + * the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + filter(callbackfn: (value: bigint, index: number, array: BigUint64Array) => any, thisArg?: any): BigUint64Array; + + /** + * Returns the value of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + find(predicate: (value: bigint, index: number, array: BigUint64Array) => boolean, thisArg?: any): bigint | undefined; + + /** + * Returns the index of the first element in the array where predicate is true, and -1 + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, + * findIndex immediately returns that element index. Otherwise, findIndex returns -1. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + findIndex(predicate: (value: bigint, index: number, array: BigUint64Array) => boolean, thisArg?: any): number; + + /** + * Performs the specified action for each element in an array. + * @param callbackfn A function that accepts up to three arguments. forEach calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + forEach(callbackfn: (value: bigint, index: number, array: BigUint64Array) => void, thisArg?: any): void; + + /** + * Determines whether an array includes a certain element, returning true or false as appropriate. + * @param searchElement The element to search for. + * @param fromIndex The position in this array at which to begin searching for searchElement. + */ + includes(searchElement: bigint, fromIndex?: number): boolean; + + /** + * Returns the index of the first occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + indexOf(searchElement: bigint, fromIndex?: number): number; + + /** + * Adds all the elements of an array separated by the specified separator string. + * @param separator A string used to separate one element of an array from the next in the + * resulting String. If omitted, the array elements are separated with a comma. + */ + join(separator?: string): string; + + /** Yields each index in the array. */ + keys(): IterableIterator; + + /** + * Returns the index of the last occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + lastIndexOf(searchElement: bigint, fromIndex?: number): number; + + /** The length of the array. */ + readonly length: number; + + /** + * Calls a defined callback function on each element of an array, and returns an array that + * contains the results. + * @param callbackfn A function that accepts up to three arguments. The map method calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + map(callbackfn: (value: bigint, index: number, array: BigUint64Array) => bigint, thisArg?: any): BigUint64Array; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: bigint, currentValue: bigint, currentIndex: number, array: BigUint64Array) => bigint): bigint; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: U, currentValue: bigint, currentIndex: number, array: BigUint64Array) => U, initialValue: U): U; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an + * argument instead of an array value. + */ + reduceRight(callbackfn: (previousValue: bigint, currentValue: bigint, currentIndex: number, array: BigUint64Array) => bigint): bigint; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduceRight(callbackfn: (previousValue: U, currentValue: bigint, currentIndex: number, array: BigUint64Array) => U, initialValue: U): U; + + /** Reverses the elements in the array. */ + reverse(): this; + + /** + * Sets a value or an array of values. + * @param array A typed or untyped array of values to set. + * @param offset The index in the current array at which the values are to be written. + */ + set(array: ArrayLike, offset?: number): void; + + /** + * Returns a section of an array. + * @param start The beginning of the specified portion of the array. + * @param end The end of the specified portion of the array. + */ + slice(start?: number, end?: number): BigUint64Array; + + /** + * Determines whether the specified callback function returns true for any element of an array. + * @param callbackfn A function that accepts up to three arguments. The some method calls the + * callbackfn function for each element in the array until the callbackfn returns true, or until + * the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + some(callbackfn: (value: bigint, index: number, array: BigUint64Array) => boolean, thisArg?: any): boolean; + + /** + * Sorts the array. + * @param compareFn The function used to determine the order of the elements. If omitted, the elements are sorted in ascending order. + */ + sort(compareFn?: (a: bigint, b: bigint) => number | bigint): this; + + /** + * Gets a new BigUint64Array view of the ArrayBuffer store for this array, referencing the elements + * at begin, inclusive, up to end, exclusive. + * @param begin The index of the beginning of the array. + * @param end The index of the end of the array. + */ + subarray(begin?: number, end?: number): BigUint64Array; + + /** Converts the array to a string by using the current locale. */ + toLocaleString(): string; + + /** Returns a string representation of the array. */ + toString(): string; + + /** Yields each value in the array. */ + values(): IterableIterator; + + [Symbol.iterator](): IterableIterator; + + readonly [Symbol.toStringTag]: "BigUint64Array"; + + [index: number]: bigint; +} + +interface BigUint64ArrayConstructor { + readonly prototype: BigUint64Array; + new(length?: number): BigUint64Array; + new(array: Iterable): BigUint64Array; + new(buffer: ArrayBufferLike, byteOffset?: number, length?: number): BigUint64Array; + + /** The size in bytes of each element in the array. */ + readonly BYTES_PER_ELEMENT: number; + + /** + * Returns a new array from a set of elements. + * @param items A set of elements to include in the new array object. + */ + of(...items: bigint[]): BigUint64Array; + + /** + * Creates an array from an array-like or iterable object. + * @param arrayLike An array-like or iterable object to convert to an array. + * @param mapfn A mapping function to call on every element of the array. + * @param thisArg Value of 'this' used to invoke the mapfn. + */ + from(arrayLike: ArrayLike): BigUint64Array; + from(arrayLike: ArrayLike, mapfn: (v: U, k: number) => bigint, thisArg?: any): BigUint64Array; +} + +declare var BigUint64Array: BigUint64ArrayConstructor; + +interface DataView { + /** + * Gets the BigInt64 value at the specified byte offset from the start of the view. There is + * no alignment constraint; multi-byte values may be fetched from any offset. + * @param byteOffset The place in the buffer at which the value should be retrieved. + */ + getBigInt64(byteOffset: number, littleEndian?: boolean): bigint; + + /** + * Gets the BigUint64 value at the specified byte offset from the start of the view. There is + * no alignment constraint; multi-byte values may be fetched from any offset. + * @param byteOffset The place in the buffer at which the value should be retrieved. + */ + getBigUint64(byteOffset: number, littleEndian?: boolean): bigint; + + /** + * Stores a BigInt64 value at the specified byte offset from the start of the view. + * @param byteOffset The place in the buffer at which the value should be set. + * @param value The value to set. + * @param littleEndian If false or undefined, a big-endian value should be written, + * otherwise a little-endian value should be written. + */ + setBigInt64(byteOffset: number, value: bigint, littleEndian?: boolean): void; + + /** + * Stores a BigUint64 value at the specified byte offset from the start of the view. + * @param byteOffset The place in the buffer at which the value should be set. + * @param value The value to set. + * @param littleEndian If false or undefined, a big-endian value should be written, + * otherwise a little-endian value should be written. + */ + setBigUint64(byteOffset: number, value: bigint, littleEndian?: boolean): void; +} diff --git a/node_modules/typescript/lib/lib.esnext.d.ts b/node_modules/typescript/lib/lib.esnext.d.ts index d71ce67c5..a4a0d06ac 100644 --- a/node_modules/typescript/lib/lib.esnext.d.ts +++ b/node_modules/typescript/lib/lib.esnext.d.ts @@ -15,9 +15,9 @@ and limitations under the License. -/// +/// -/// -/// -/// +/// +/// +/// diff --git a/node_modules/typescript/lib/lib.esnext.full.d.ts b/node_modules/typescript/lib/lib.esnext.full.d.ts index e3c4fa5e0..db0b25cdd 100644 --- a/node_modules/typescript/lib/lib.esnext.full.d.ts +++ b/node_modules/typescript/lib/lib.esnext.full.d.ts @@ -15,11 +15,11 @@ and limitations under the License. -/// +/// -/// -/// -/// -/// +/// +/// +/// +/// /// \ No newline at end of file diff --git a/node_modules/typescript/lib/lib.esnext.intl.d.ts b/node_modules/typescript/lib/lib.esnext.intl.d.ts index 404ffc35b..33988f314 100644 --- a/node_modules/typescript/lib/lib.esnext.intl.d.ts +++ b/node_modules/typescript/lib/lib.esnext.intl.d.ts @@ -15,18 +15,18 @@ and limitations under the License. -/// +/// -declare namespace Intl { - type NumberFormatPartTypes = "currency" | "decimal" | "fraction" | "group" | "infinity" | "integer" | "literal" | "minusSign" | "nan" | "plusSign" | "percentSign"; - - interface NumberFormatPart { - type: NumberFormatPartTypes; - value: string; - } - - interface NumberFormat { - formatToParts(number?: number): NumberFormatPart[]; - } -} +declare namespace Intl { + type NumberFormatPartTypes = "currency" | "decimal" | "fraction" | "group" | "infinity" | "integer" | "literal" | "minusSign" | "nan" | "plusSign" | "percentSign"; + + interface NumberFormatPart { + type: NumberFormatPartTypes; + value: string; + } + + interface NumberFormat { + formatToParts(number?: number): NumberFormatPart[]; + } +} diff --git a/node_modules/typescript/lib/lib.scripthost.d.ts b/node_modules/typescript/lib/lib.scripthost.d.ts index 5aab121c8..5795c68a3 100644 --- a/node_modules/typescript/lib/lib.scripthost.d.ts +++ b/node_modules/typescript/lib/lib.scripthost.d.ts @@ -15,313 +15,313 @@ and limitations under the License. -/// - - - - -///////////////////////////// -/// Windows Script Host APIS -///////////////////////////// - - -interface ActiveXObject { - new (s: string): any; -} -declare var ActiveXObject: ActiveXObject; - -interface ITextWriter { - Write(s: string): void; - WriteLine(s: string): void; - Close(): void; -} - -interface TextStreamBase { - /** - * The column number of the current character position in an input stream. - */ - Column: number; - - /** - * The current line number in an input stream. - */ - Line: number; - - /** - * Closes a text stream. - * It is not necessary to close standard streams; they close automatically when the process ends. If - * you close a standard stream, be aware that any other pointers to that standard stream become invalid. - */ - Close(): void; -} - -interface TextStreamWriter extends TextStreamBase { - /** - * Sends a string to an output stream. - */ - Write(s: string): void; - - /** - * Sends a specified number of blank lines (newline characters) to an output stream. - */ - WriteBlankLines(intLines: number): void; - - /** - * Sends a string followed by a newline character to an output stream. - */ - WriteLine(s: string): void; -} - -interface TextStreamReader extends TextStreamBase { - /** - * Returns a specified number of characters from an input stream, starting at the current pointer position. - * Does not return until the ENTER key is pressed. - * Can only be used on a stream in reading mode; causes an error in writing or appending mode. - */ - Read(characters: number): string; - - /** - * Returns all characters from an input stream. - * Can only be used on a stream in reading mode; causes an error in writing or appending mode. - */ - ReadAll(): string; - - /** - * Returns an entire line from an input stream. - * Although this method extracts the newline character, it does not add it to the returned string. - * Can only be used on a stream in reading mode; causes an error in writing or appending mode. - */ - ReadLine(): string; - - /** - * Skips a specified number of characters when reading from an input text stream. - * Can only be used on a stream in reading mode; causes an error in writing or appending mode. - * @param characters Positive number of characters to skip forward. (Backward skipping is not supported.) - */ - Skip(characters: number): void; - - /** - * Skips the next line when reading from an input text stream. - * Can only be used on a stream in reading mode, not writing or appending mode. - */ - SkipLine(): void; - - /** - * Indicates whether the stream pointer position is at the end of a line. - */ - AtEndOfLine: boolean; - - /** - * Indicates whether the stream pointer position is at the end of a stream. - */ - AtEndOfStream: boolean; -} - -declare var WScript: { - /** - * Outputs text to either a message box (under WScript.exe) or the command console window followed by - * a newline (under CScript.exe). - */ - Echo(s: any): void; - - /** - * Exposes the write-only error output stream for the current script. - * Can be accessed only while using CScript.exe. - */ - StdErr: TextStreamWriter; - - /** - * Exposes the write-only output stream for the current script. - * Can be accessed only while using CScript.exe. - */ - StdOut: TextStreamWriter; - Arguments: { length: number; Item(n: number): string; }; - - /** - * The full path of the currently running script. - */ - ScriptFullName: string; - - /** - * Forces the script to stop immediately, with an optional exit code. - */ - Quit(exitCode?: number): number; - - /** - * The Windows Script Host build version number. - */ - BuildVersion: number; - - /** - * Fully qualified path of the host executable. - */ - FullName: string; - - /** - * Gets/sets the script mode - interactive(true) or batch(false). - */ - Interactive: boolean; - - /** - * The name of the host executable (WScript.exe or CScript.exe). - */ - Name: string; - - /** - * Path of the directory containing the host executable. - */ - Path: string; - - /** - * The filename of the currently running script. - */ - ScriptName: string; - - /** - * Exposes the read-only input stream for the current script. - * Can be accessed only while using CScript.exe. - */ - StdIn: TextStreamReader; - - /** - * Windows Script Host version - */ - Version: string; - - /** - * Connects a COM object's event sources to functions named with a given prefix, in the form prefix_event. - */ - ConnectObject(objEventSource: any, strPrefix: string): void; - - /** - * Creates a COM object. - * @param strProgiID - * @param strPrefix Function names in the form prefix_event will be bound to this object's COM events. - */ - CreateObject(strProgID: string, strPrefix?: string): any; - - /** - * Disconnects a COM object from its event sources. - */ - DisconnectObject(obj: any): void; - - /** - * Retrieves an existing object with the specified ProgID from memory, or creates a new one from a file. - * @param strPathname Fully qualified path to the file containing the object persisted to disk. - * For objects in memory, pass a zero-length string. - * @param strProgID - * @param strPrefix Function names in the form prefix_event will be bound to this object's COM events. - */ - GetObject(strPathname: string, strProgID?: string, strPrefix?: string): any; - - /** - * Suspends script execution for a specified length of time, then continues execution. - * @param intTime Interval (in milliseconds) to suspend script execution. - */ - Sleep(intTime: number): void; -}; - -/** - * WSH is an alias for WScript under Windows Script Host - */ -declare var WSH: typeof WScript; - -/** - * Represents an Automation SAFEARRAY - */ -declare class SafeArray { - private constructor(); - private SafeArray_typekey: SafeArray; -} - -/** - * Allows enumerating over a COM collection, which may not have indexed item access. - */ -interface Enumerator { - /** - * Returns true if the current item is the last one in the collection, or the collection is empty, - * or the current item is undefined. - */ - atEnd(): boolean; - - /** - * Returns the current item in the collection - */ - item(): T; - - /** - * Resets the current item in the collection to the first item. If there are no items in the collection, - * the current item is set to undefined. - */ - moveFirst(): void; - - /** - * Moves the current item to the next item in the collection. If the enumerator is at the end of - * the collection or the collection is empty, the current item is set to undefined. - */ - moveNext(): void; -} - -interface EnumeratorConstructor { - new (safearray: SafeArray): Enumerator; - new (collection: { Item(index: any): T }): Enumerator; - new (collection: any): Enumerator; -} - -declare var Enumerator: EnumeratorConstructor; - -/** - * Enables reading from a COM safe array, which might have an alternate lower bound, or multiple dimensions. - */ -interface VBArray { - /** - * Returns the number of dimensions (1-based). - */ - dimensions(): number; - - /** - * Takes an index for each dimension in the array, and returns the item at the corresponding location. - */ - getItem(dimension1Index: number, ...dimensionNIndexes: number[]): T; - - /** - * Returns the smallest available index for a given dimension. - * @param dimension 1-based dimension (defaults to 1) - */ - lbound(dimension?: number): number; - - /** - * Returns the largest available index for a given dimension. - * @param dimension 1-based dimension (defaults to 1) - */ - ubound(dimension?: number): number; - - /** - * Returns a Javascript array with all the elements in the VBArray. If there are multiple dimensions, - * each successive dimension is appended to the end of the array. - * Example: [[1,2,3],[4,5,6]] becomes [1,2,3,4,5,6] - */ - toArray(): T[]; -} - -interface VBArrayConstructor { - new (safeArray: SafeArray): VBArray; -} - -declare var VBArray: VBArrayConstructor; - -/** - * Automation date (VT_DATE) - */ -declare class VarDate { - private constructor(); - private VarDate_typekey: VarDate; -} - -interface DateConstructor { - new (vd: VarDate): Date; -} - -interface Date { - getVarDate: () => VarDate; -} +/// + + + + +///////////////////////////// +/// Windows Script Host APIS +///////////////////////////// + + +interface ActiveXObject { + new (s: string): any; +} +declare var ActiveXObject: ActiveXObject; + +interface ITextWriter { + Write(s: string): void; + WriteLine(s: string): void; + Close(): void; +} + +interface TextStreamBase { + /** + * The column number of the current character position in an input stream. + */ + Column: number; + + /** + * The current line number in an input stream. + */ + Line: number; + + /** + * Closes a text stream. + * It is not necessary to close standard streams; they close automatically when the process ends. If + * you close a standard stream, be aware that any other pointers to that standard stream become invalid. + */ + Close(): void; +} + +interface TextStreamWriter extends TextStreamBase { + /** + * Sends a string to an output stream. + */ + Write(s: string): void; + + /** + * Sends a specified number of blank lines (newline characters) to an output stream. + */ + WriteBlankLines(intLines: number): void; + + /** + * Sends a string followed by a newline character to an output stream. + */ + WriteLine(s: string): void; +} + +interface TextStreamReader extends TextStreamBase { + /** + * Returns a specified number of characters from an input stream, starting at the current pointer position. + * Does not return until the ENTER key is pressed. + * Can only be used on a stream in reading mode; causes an error in writing or appending mode. + */ + Read(characters: number): string; + + /** + * Returns all characters from an input stream. + * Can only be used on a stream in reading mode; causes an error in writing or appending mode. + */ + ReadAll(): string; + + /** + * Returns an entire line from an input stream. + * Although this method extracts the newline character, it does not add it to the returned string. + * Can only be used on a stream in reading mode; causes an error in writing or appending mode. + */ + ReadLine(): string; + + /** + * Skips a specified number of characters when reading from an input text stream. + * Can only be used on a stream in reading mode; causes an error in writing or appending mode. + * @param characters Positive number of characters to skip forward. (Backward skipping is not supported.) + */ + Skip(characters: number): void; + + /** + * Skips the next line when reading from an input text stream. + * Can only be used on a stream in reading mode, not writing or appending mode. + */ + SkipLine(): void; + + /** + * Indicates whether the stream pointer position is at the end of a line. + */ + AtEndOfLine: boolean; + + /** + * Indicates whether the stream pointer position is at the end of a stream. + */ + AtEndOfStream: boolean; +} + +declare var WScript: { + /** + * Outputs text to either a message box (under WScript.exe) or the command console window followed by + * a newline (under CScript.exe). + */ + Echo(s: any): void; + + /** + * Exposes the write-only error output stream for the current script. + * Can be accessed only while using CScript.exe. + */ + StdErr: TextStreamWriter; + + /** + * Exposes the write-only output stream for the current script. + * Can be accessed only while using CScript.exe. + */ + StdOut: TextStreamWriter; + Arguments: { length: number; Item(n: number): string; }; + + /** + * The full path of the currently running script. + */ + ScriptFullName: string; + + /** + * Forces the script to stop immediately, with an optional exit code. + */ + Quit(exitCode?: number): number; + + /** + * The Windows Script Host build version number. + */ + BuildVersion: number; + + /** + * Fully qualified path of the host executable. + */ + FullName: string; + + /** + * Gets/sets the script mode - interactive(true) or batch(false). + */ + Interactive: boolean; + + /** + * The name of the host executable (WScript.exe or CScript.exe). + */ + Name: string; + + /** + * Path of the directory containing the host executable. + */ + Path: string; + + /** + * The filename of the currently running script. + */ + ScriptName: string; + + /** + * Exposes the read-only input stream for the current script. + * Can be accessed only while using CScript.exe. + */ + StdIn: TextStreamReader; + + /** + * Windows Script Host version + */ + Version: string; + + /** + * Connects a COM object's event sources to functions named with a given prefix, in the form prefix_event. + */ + ConnectObject(objEventSource: any, strPrefix: string): void; + + /** + * Creates a COM object. + * @param strProgiID + * @param strPrefix Function names in the form prefix_event will be bound to this object's COM events. + */ + CreateObject(strProgID: string, strPrefix?: string): any; + + /** + * Disconnects a COM object from its event sources. + */ + DisconnectObject(obj: any): void; + + /** + * Retrieves an existing object with the specified ProgID from memory, or creates a new one from a file. + * @param strPathname Fully qualified path to the file containing the object persisted to disk. + * For objects in memory, pass a zero-length string. + * @param strProgID + * @param strPrefix Function names in the form prefix_event will be bound to this object's COM events. + */ + GetObject(strPathname: string, strProgID?: string, strPrefix?: string): any; + + /** + * Suspends script execution for a specified length of time, then continues execution. + * @param intTime Interval (in milliseconds) to suspend script execution. + */ + Sleep(intTime: number): void; +}; + +/** + * WSH is an alias for WScript under Windows Script Host + */ +declare var WSH: typeof WScript; + +/** + * Represents an Automation SAFEARRAY + */ +declare class SafeArray { + private constructor(); + private SafeArray_typekey: SafeArray; +} + +/** + * Allows enumerating over a COM collection, which may not have indexed item access. + */ +interface Enumerator { + /** + * Returns true if the current item is the last one in the collection, or the collection is empty, + * or the current item is undefined. + */ + atEnd(): boolean; + + /** + * Returns the current item in the collection + */ + item(): T; + + /** + * Resets the current item in the collection to the first item. If there are no items in the collection, + * the current item is set to undefined. + */ + moveFirst(): void; + + /** + * Moves the current item to the next item in the collection. If the enumerator is at the end of + * the collection or the collection is empty, the current item is set to undefined. + */ + moveNext(): void; +} + +interface EnumeratorConstructor { + new (safearray: SafeArray): Enumerator; + new (collection: { Item(index: any): T }): Enumerator; + new (collection: any): Enumerator; +} + +declare var Enumerator: EnumeratorConstructor; + +/** + * Enables reading from a COM safe array, which might have an alternate lower bound, or multiple dimensions. + */ +interface VBArray { + /** + * Returns the number of dimensions (1-based). + */ + dimensions(): number; + + /** + * Takes an index for each dimension in the array, and returns the item at the corresponding location. + */ + getItem(dimension1Index: number, ...dimensionNIndexes: number[]): T; + + /** + * Returns the smallest available index for a given dimension. + * @param dimension 1-based dimension (defaults to 1) + */ + lbound(dimension?: number): number; + + /** + * Returns the largest available index for a given dimension. + * @param dimension 1-based dimension (defaults to 1) + */ + ubound(dimension?: number): number; + + /** + * Returns a Javascript array with all the elements in the VBArray. If there are multiple dimensions, + * each successive dimension is appended to the end of the array. + * Example: [[1,2,3],[4,5,6]] becomes [1,2,3,4,5,6] + */ + toArray(): T[]; +} + +interface VBArrayConstructor { + new (safeArray: SafeArray): VBArray; +} + +declare var VBArray: VBArrayConstructor; + +/** + * Automation date (VT_DATE) + */ +declare class VarDate { + private constructor(); + private VarDate_typekey: VarDate; +} + +interface DateConstructor { + new (vd: VarDate): Date; +} + +interface Date { + getVarDate: () => VarDate; +} diff --git a/node_modules/typescript/lib/lib.webworker.d.ts b/node_modules/typescript/lib/lib.webworker.d.ts index efc1de2e9..3e6773d77 100644 --- a/node_modules/typescript/lib/lib.webworker.d.ts +++ b/node_modules/typescript/lib/lib.webworker.d.ts @@ -15,7 +15,7 @@ and limitations under the License. -/// +/// ///////////////////////////// diff --git a/node_modules/typescript/lib/lib.webworker.importscripts.d.ts b/node_modules/typescript/lib/lib.webworker.importscripts.d.ts index c373ba82a..debd76944 100644 --- a/node_modules/typescript/lib/lib.webworker.importscripts.d.ts +++ b/node_modules/typescript/lib/lib.webworker.importscripts.d.ts @@ -15,12 +15,12 @@ and limitations under the License. -/// +/// - -///////////////////////////// -/// WorkerGlobalScope APIs -///////////////////////////// -// These are only available in a Web Worker -declare function importScripts(...urls: string[]): void; + +///////////////////////////// +/// WorkerGlobalScope APIs +///////////////////////////// +// These are only available in a Web Worker +declare function importScripts(...urls: string[]): void; diff --git a/node_modules/uri-js/LICENSE b/node_modules/uri-js/LICENSE old mode 100644 new mode 100755 diff --git a/node_modules/uri-js/README.md b/node_modules/uri-js/README.md old mode 100644 new mode 100755 diff --git a/node_modules/uri-js/dist/es5/uri.all.d.ts b/node_modules/uri-js/dist/es5/uri.all.d.ts old mode 100644 new mode 100755 diff --git a/node_modules/uri-js/dist/es5/uri.all.js b/node_modules/uri-js/dist/es5/uri.all.js old mode 100644 new mode 100755 diff --git a/node_modules/uri-js/dist/es5/uri.all.js.map b/node_modules/uri-js/dist/es5/uri.all.js.map old mode 100644 new mode 100755 diff --git a/node_modules/uri-js/dist/es5/uri.all.min.d.ts b/node_modules/uri-js/dist/es5/uri.all.min.d.ts old mode 100644 new mode 100755 diff --git a/node_modules/uri-js/dist/es5/uri.all.min.js b/node_modules/uri-js/dist/es5/uri.all.min.js old mode 100644 new mode 100755 diff --git a/node_modules/uri-js/dist/es5/uri.all.min.js.map b/node_modules/uri-js/dist/es5/uri.all.min.js.map old mode 100644 new mode 100755 diff --git a/node_modules/uri-js/dist/esnext/index.d.ts b/node_modules/uri-js/dist/esnext/index.d.ts old mode 100644 new mode 100755 diff --git a/node_modules/uri-js/dist/esnext/index.js b/node_modules/uri-js/dist/esnext/index.js old mode 100644 new mode 100755 diff --git a/node_modules/uri-js/dist/esnext/index.js.map b/node_modules/uri-js/dist/esnext/index.js.map old mode 100644 new mode 100755 diff --git a/node_modules/uri-js/dist/esnext/regexps-iri.d.ts b/node_modules/uri-js/dist/esnext/regexps-iri.d.ts old mode 100644 new mode 100755 diff --git a/node_modules/uri-js/dist/esnext/regexps-iri.js b/node_modules/uri-js/dist/esnext/regexps-iri.js old mode 100644 new mode 100755 diff --git a/node_modules/uri-js/dist/esnext/regexps-iri.js.map b/node_modules/uri-js/dist/esnext/regexps-iri.js.map old mode 100644 new mode 100755 diff --git a/node_modules/uri-js/dist/esnext/regexps-uri.d.ts b/node_modules/uri-js/dist/esnext/regexps-uri.d.ts old mode 100644 new mode 100755 diff --git a/node_modules/uri-js/dist/esnext/regexps-uri.js b/node_modules/uri-js/dist/esnext/regexps-uri.js old mode 100644 new mode 100755 diff --git a/node_modules/uri-js/dist/esnext/regexps-uri.js.map b/node_modules/uri-js/dist/esnext/regexps-uri.js.map old mode 100644 new mode 100755 diff --git a/node_modules/uri-js/dist/esnext/schemes/http.d.ts b/node_modules/uri-js/dist/esnext/schemes/http.d.ts old mode 100644 new mode 100755 diff --git a/node_modules/uri-js/dist/esnext/schemes/http.js b/node_modules/uri-js/dist/esnext/schemes/http.js old mode 100644 new mode 100755 diff --git a/node_modules/uri-js/dist/esnext/schemes/http.js.map b/node_modules/uri-js/dist/esnext/schemes/http.js.map old mode 100644 new mode 100755 diff --git a/node_modules/uri-js/dist/esnext/schemes/https.d.ts b/node_modules/uri-js/dist/esnext/schemes/https.d.ts old mode 100644 new mode 100755 diff --git a/node_modules/uri-js/dist/esnext/schemes/https.js b/node_modules/uri-js/dist/esnext/schemes/https.js old mode 100644 new mode 100755 diff --git a/node_modules/uri-js/dist/esnext/schemes/https.js.map b/node_modules/uri-js/dist/esnext/schemes/https.js.map old mode 100644 new mode 100755 diff --git a/node_modules/uri-js/dist/esnext/schemes/mailto.d.ts b/node_modules/uri-js/dist/esnext/schemes/mailto.d.ts old mode 100644 new mode 100755 diff --git a/node_modules/uri-js/dist/esnext/schemes/mailto.js b/node_modules/uri-js/dist/esnext/schemes/mailto.js old mode 100644 new mode 100755 diff --git a/node_modules/uri-js/dist/esnext/schemes/mailto.js.map b/node_modules/uri-js/dist/esnext/schemes/mailto.js.map old mode 100644 new mode 100755 diff --git a/node_modules/uri-js/dist/esnext/schemes/urn-uuid.d.ts b/node_modules/uri-js/dist/esnext/schemes/urn-uuid.d.ts old mode 100644 new mode 100755 diff --git a/node_modules/uri-js/dist/esnext/schemes/urn-uuid.js b/node_modules/uri-js/dist/esnext/schemes/urn-uuid.js old mode 100644 new mode 100755 diff --git a/node_modules/uri-js/dist/esnext/schemes/urn-uuid.js.map b/node_modules/uri-js/dist/esnext/schemes/urn-uuid.js.map old mode 100644 new mode 100755 diff --git a/node_modules/uri-js/dist/esnext/schemes/urn.d.ts b/node_modules/uri-js/dist/esnext/schemes/urn.d.ts old mode 100644 new mode 100755 diff --git a/node_modules/uri-js/dist/esnext/schemes/urn.js b/node_modules/uri-js/dist/esnext/schemes/urn.js old mode 100644 new mode 100755 diff --git a/node_modules/uri-js/dist/esnext/schemes/urn.js.map b/node_modules/uri-js/dist/esnext/schemes/urn.js.map old mode 100644 new mode 100755 diff --git a/node_modules/uri-js/dist/esnext/schemes/ws.d.ts b/node_modules/uri-js/dist/esnext/schemes/ws.d.ts old mode 100644 new mode 100755 diff --git a/node_modules/uri-js/dist/esnext/schemes/ws.js b/node_modules/uri-js/dist/esnext/schemes/ws.js old mode 100644 new mode 100755 diff --git a/node_modules/uri-js/dist/esnext/schemes/ws.js.map b/node_modules/uri-js/dist/esnext/schemes/ws.js.map old mode 100644 new mode 100755 diff --git a/node_modules/uri-js/dist/esnext/schemes/wss.d.ts b/node_modules/uri-js/dist/esnext/schemes/wss.d.ts old mode 100644 new mode 100755 diff --git a/node_modules/uri-js/dist/esnext/schemes/wss.js b/node_modules/uri-js/dist/esnext/schemes/wss.js old mode 100644 new mode 100755 diff --git a/node_modules/uri-js/dist/esnext/schemes/wss.js.map b/node_modules/uri-js/dist/esnext/schemes/wss.js.map old mode 100644 new mode 100755 diff --git a/node_modules/uri-js/dist/esnext/uri.d.ts b/node_modules/uri-js/dist/esnext/uri.d.ts old mode 100644 new mode 100755 diff --git a/node_modules/uri-js/dist/esnext/uri.js b/node_modules/uri-js/dist/esnext/uri.js old mode 100644 new mode 100755 diff --git a/node_modules/uri-js/dist/esnext/uri.js.map b/node_modules/uri-js/dist/esnext/uri.js.map old mode 100644 new mode 100755 diff --git a/node_modules/uri-js/dist/esnext/util.d.ts b/node_modules/uri-js/dist/esnext/util.d.ts old mode 100644 new mode 100755 diff --git a/node_modules/uri-js/dist/esnext/util.js b/node_modules/uri-js/dist/esnext/util.js old mode 100644 new mode 100755 diff --git a/node_modules/uri-js/dist/esnext/util.js.map b/node_modules/uri-js/dist/esnext/util.js.map old mode 100644 new mode 100755 diff --git a/node_modules/uri-js/package.json b/node_modules/uri-js/package.json old mode 100644 new mode 100755 diff --git a/node_modules/uri-js/yarn.lock b/node_modules/uri-js/yarn.lock old mode 100644 new mode 100755 diff --git a/node_modules/urix/.jshintrc b/node_modules/urix/.jshintrc index e722e4697..9d1a61836 100644 --- a/node_modules/urix/.jshintrc +++ b/node_modules/urix/.jshintrc @@ -1,42 +1,42 @@ -{ - "bitwise": true, - "camelcase": true, - "curly": false, - "eqeqeq": true, - "es3": false, - "forin": true, - "immed": false, - "indent": false, - "latedef": "nofunc", - "newcap": false, - "noarg": true, - "noempty": true, - "nonew": false, - "plusplus": false, - "quotmark": true, - "undef": true, - "unused": "vars", - "strict": false, - "trailing": true, - "maxparams": 5, - "maxdepth": false, - "maxstatements": false, - "maxcomplexity": false, - "maxlen": 100, - - "asi": true, - "expr": true, - "globalstrict": true, - "smarttabs": true, - "sub": true, - - "node": true, - "globals": { - "describe": false, - "it": false, - "before": false, - "beforeEach": false, - "after": false, - "afterEach": false - } -} +{ + "bitwise": true, + "camelcase": true, + "curly": false, + "eqeqeq": true, + "es3": false, + "forin": true, + "immed": false, + "indent": false, + "latedef": "nofunc", + "newcap": false, + "noarg": true, + "noempty": true, + "nonew": false, + "plusplus": false, + "quotmark": true, + "undef": true, + "unused": "vars", + "strict": false, + "trailing": true, + "maxparams": 5, + "maxdepth": false, + "maxstatements": false, + "maxcomplexity": false, + "maxlen": 100, + + "asi": true, + "expr": true, + "globalstrict": true, + "smarttabs": true, + "sub": true, + + "node": true, + "globals": { + "describe": false, + "it": false, + "before": false, + "beforeEach": false, + "after": false, + "afterEach": false + } +} diff --git a/node_modules/urix/index.js b/node_modules/urix/index.js index 3fb790314..dc6ef2700 100644 --- a/node_modules/urix/index.js +++ b/node_modules/urix/index.js @@ -1,17 +1,17 @@ -// Copyright 2014 Simon Lydell -// X11 (“MIT”) Licensed. (See LICENSE.) - -var path = require("path") - -"use strict" - -function urix(aPath) { - if (path.sep === "\\") { - return aPath - .replace(/\\/g, "/") - .replace(/^[a-z]:\/?/i, "/") - } - return aPath -} - -module.exports = urix +// Copyright 2014 Simon Lydell +// X11 (“MIT”) Licensed. (See LICENSE.) + +var path = require("path") + +"use strict" + +function urix(aPath) { + if (path.sep === "\\") { + return aPath + .replace(/\\/g, "/") + .replace(/^[a-z]:\/?/i, "/") + } + return aPath +} + +module.exports = urix diff --git a/node_modules/urix/package.json b/node_modules/urix/package.json index ce795d176..992e32959 100644 --- a/node_modules/urix/package.json +++ b/node_modules/urix/package.json @@ -1,25 +1,25 @@ -{ - "name": "urix", - "version": "0.1.0", - "author": "Simon Lydell", - "license": "MIT", - "description": "Makes Windows-style paths more unix and URI friendly.", - "main": "index.js", - "repository": "lydell/urix", - "keywords": [ - "path", - "url", - "uri", - "unix", - "windows", - "backslash", - "slash" - ], - "scripts": { - "test": "jshint index.js test/ && mocha" - }, - "devDependencies": { - "mocha": "^1.17.1", - "jshint": "^2.4.4" - } -} +{ + "name": "urix", + "version": "0.1.0", + "author": "Simon Lydell", + "license": "MIT", + "description": "Makes Windows-style paths more unix and URI friendly.", + "main": "index.js", + "repository": "lydell/urix", + "keywords": [ + "path", + "url", + "uri", + "unix", + "windows", + "backslash", + "slash" + ], + "scripts": { + "test": "jshint index.js test/ && mocha" + }, + "devDependencies": { + "mocha": "^1.17.1", + "jshint": "^2.4.4" + } +} diff --git a/node_modules/urix/readme.md b/node_modules/urix/readme.md index ac386f5d6..b258b9863 100644 --- a/node_modules/urix/readme.md +++ b/node_modules/urix/readme.md @@ -1,46 +1,46 @@ -[![Build Status](https://travis-ci.org/lydell/urix.png?branch=master)](https://travis-ci.org/lydell/urix) - -Overview -======== - -Makes Windows-style paths more unix and URI friendly. Useful if you work with -paths that eventually will be used in URLs. - -```js -var urix = require("urix") - -// On Windows: -urix("c:\\users\\you\\foo") -// /users/you/foo - -// On unix-like systems: -urix("c:\\users\\you\\foo") -// c:\users\you\foo -``` - - -Installation -============ - -`npm install urix` - -```js -var urix = require("urix") -``` - - -Usage -===== - -### `urix(path)` ### - -On Windows, replaces all backslashes with slashes and uses a slash instead of a -drive letter and a colon for absolute paths. - -On unix-like systems it is a no-op. - - -License -======= - -[The X11 (“MIT”) License](LICENSE). +[![Build Status](https://travis-ci.org/lydell/urix.png?branch=master)](https://travis-ci.org/lydell/urix) + +Overview +======== + +Makes Windows-style paths more unix and URI friendly. Useful if you work with +paths that eventually will be used in URLs. + +```js +var urix = require("urix") + +// On Windows: +urix("c:\\users\\you\\foo") +// /users/you/foo + +// On unix-like systems: +urix("c:\\users\\you\\foo") +// c:\users\you\foo +``` + + +Installation +============ + +`npm install urix` + +```js +var urix = require("urix") +``` + + +Usage +===== + +### `urix(path)` ### + +On Windows, replaces all backslashes with slashes and uses a slash instead of a +drive letter and a colon for absolute paths. + +On unix-like systems it is a no-op. + + +License +======= + +[The X11 (“MIT”) License](LICENSE). diff --git a/node_modules/urix/test/index.js b/node_modules/urix/test/index.js index b84b8f3ee..5333f2463 100644 --- a/node_modules/urix/test/index.js +++ b/node_modules/urix/test/index.js @@ -1,43 +1,43 @@ -// Copyright 2014 Simon Lydell -// X11 (“MIT”) Licensed. (See LICENSE.) - -var path = require("path") -var assert = require("assert") -var urix = require("../") - -"use stict" - -function test(testPath, expected) { - path.sep = "\\" - assert.equal(urix(testPath), expected) - path.sep = "/" - assert.equal(urix(testPath), testPath) -} - -describe("urix", function() { - - it("is a function", function() { - assert.equal(typeof urix, "function") - }) - - - it("converts backslashes to slashes", function() { - test("a\\b\\c", "a/b/c") - test("\\a\\b\\c", "/a/b/c") - test("a/b\\c", "a/b/c") - test("\\\\a\\\\\\b///c", "//a///b///c") - }) - - - it("changes the drive letter to a slash", function() { - test("c:\\a", "/a") - test("C:\\a", "/a") - test("z:\\a", "/a") - test("c:a", "/a") - test("c:/a", "/a") - test("c:\\\\a", "//a") - test("c://a", "//a") - test("c:\\//a", "///a") - }) - -}) +// Copyright 2014 Simon Lydell +// X11 (“MIT”) Licensed. (See LICENSE.) + +var path = require("path") +var assert = require("assert") +var urix = require("../") + +"use stict" + +function test(testPath, expected) { + path.sep = "\\" + assert.equal(urix(testPath), expected) + path.sep = "/" + assert.equal(urix(testPath), testPath) +} + +describe("urix", function() { + + it("is a function", function() { + assert.equal(typeof urix, "function") + }) + + + it("converts backslashes to slashes", function() { + test("a\\b\\c", "a/b/c") + test("\\a\\b\\c", "/a/b/c") + test("a/b\\c", "a/b/c") + test("\\\\a\\\\\\b///c", "//a///b///c") + }) + + + it("changes the drive letter to a slash", function() { + test("c:\\a", "/a") + test("C:\\a", "/a") + test("z:\\a", "/a") + test("c:a", "/a") + test("c:/a", "/a") + test("c:\\\\a", "//a") + test("c://a", "//a") + test("c:\\//a", "///a") + }) + +}) diff --git a/node_modules/util-deprecate/package.json b/node_modules/util-deprecate/package.json index 5d062105a..2e79f89a9 100644 --- a/node_modules/util-deprecate/package.json +++ b/node_modules/util-deprecate/package.json @@ -24,8 +24,4 @@ "url": "https://github.com/TooTallNate/util-deprecate/issues" }, "homepage": "https://github.com/TooTallNate/util-deprecate" - -,"_resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz" -,"_integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" -,"_from": "util-deprecate@1.0.2" -} \ No newline at end of file +} diff --git a/node_modules/uuid/bin/uuid b/node_modules/uuid/bin/uuid old mode 100644 new mode 100755 diff --git a/node_modules/which/bin/node-which b/node_modules/which/bin/node-which old mode 100644 new mode 100755 diff --git a/node_modules/word-wrap/package.json b/node_modules/word-wrap/package.json index 9edd5e27e..6f8f633c4 100644 --- a/node_modules/word-wrap/package.json +++ b/node_modules/word-wrap/package.json @@ -74,8 +74,4 @@ "verb-generate-readme" ] } - -,"_resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz" -,"_integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==" -,"_from": "word-wrap@1.2.3" -} \ No newline at end of file +} diff --git a/node_modules/wrap-ansi/index.js b/node_modules/wrap-ansi/index.js old mode 100644 new mode 100755 diff --git a/node_modules/wrappy/package.json b/node_modules/wrappy/package.json index afa77fdc3..130752046 100644 --- a/node_modules/wrappy/package.json +++ b/node_modules/wrappy/package.json @@ -26,8 +26,4 @@ "url": "https://github.com/npm/wrappy/issues" }, "homepage": "https://github.com/npm/wrappy" - -,"_resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz" -,"_integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" -,"_from": "wrappy@1.0.2" -} \ No newline at end of file +} diff --git a/node_modules/xml2js/package.json b/node_modules/xml2js/package.json index 2128f5abe..0769b6115 100644 --- a/node_modules/xml2js/package.json +++ b/node_modules/xml2js/package.json @@ -89,8 +89,4 @@ "node": ">=4.0.0" }, "license": "MIT" - -,"_resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.4.23.tgz" -,"_integrity": "sha512-ySPiMjM0+pLDftHgXY4By0uswI3SPKLDw/i3UXbnO8M/p28zqexCUoPmQFrYD+/1BzhGJSs2i1ERWKJAtiLrug==" -,"_from": "xml2js@0.4.23" -} \ No newline at end of file +} diff --git a/node_modules/xmlbuilder/LICENSE b/node_modules/xmlbuilder/LICENSE index e7cbac9a8..9fb97002a 100644 --- a/node_modules/xmlbuilder/LICENSE +++ b/node_modules/xmlbuilder/LICENSE @@ -1,21 +1,21 @@ -The MIT License (MIT) - -Copyright (c) 2013 Ozgur Ozcitak - -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. +The MIT License (MIT) + +Copyright (c) 2013 Ozgur Ozcitak + +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/node_modules/xmlbuilder/README.md b/node_modules/xmlbuilder/README.md index efcb4b11d..1a96edb58 100644 --- a/node_modules/xmlbuilder/README.md +++ b/node_modules/xmlbuilder/README.md @@ -1,86 +1,86 @@ -# xmlbuilder-js - -An XML builder for [node.js](https://nodejs.org/) similar to -[java-xmlbuilder](https://github.com/jmurty/java-xmlbuilder). - -[![License](http://img.shields.io/npm/l/xmlbuilder.svg?style=flat-square)](http://opensource.org/licenses/MIT) -[![NPM Version](http://img.shields.io/npm/v/xmlbuilder.svg?style=flat-square)](https://npmjs.com/package/xmlbuilder) -[![NPM Downloads](https://img.shields.io/npm/dm/xmlbuilder.svg?style=flat-square)](https://npmjs.com/package/xmlbuilder) - -[![Travis Build Status](http://img.shields.io/travis/oozcitak/xmlbuilder-js.svg?style=flat-square)](http://travis-ci.org/oozcitak/xmlbuilder-js) -[![AppVeyor Build status](https://ci.appveyor.com/api/projects/status/bf7odb20hj77isry?svg=true)](https://ci.appveyor.com/project/oozcitak/xmlbuilder-js) -[![Dev Dependency Status](http://img.shields.io/david/dev/oozcitak/xmlbuilder-js.svg?style=flat-square)](https://david-dm.org/oozcitak/xmlbuilder-js) -[![Code Coverage](https://img.shields.io/coveralls/oozcitak/xmlbuilder-js.svg?style=flat-square)](https://coveralls.io/github/oozcitak/xmlbuilder-js) - -### Installation: - -``` sh -npm install xmlbuilder -``` - -### Usage: - -``` js -var builder = require('xmlbuilder'); -var xml = builder.create('root') - .ele('xmlbuilder') - .ele('repo', {'type': 'git'}, 'git://github.com/oozcitak/xmlbuilder-js.git') - .end({ pretty: true}); - -console.log(xml); -``` - -will result in: - -``` xml - - - - git://github.com/oozcitak/xmlbuilder-js.git - - -``` - -It is also possible to convert objects into nodes: - -``` js -builder.create({ - root: { - xmlbuilder: { - repo: { - '@type': 'git', // attributes start with @ - '#text': 'git://github.com/oozcitak/xmlbuilder-js.git' // text node - } - } - } -}); -``` - -If you need to do some processing: - -``` js -var root = builder.create('squares'); -root.com('f(x) = x^2'); -for(var i = 1; i <= 5; i++) -{ - var item = root.ele('data'); - item.att('x', i); - item.att('y', i * i); -} -``` - -This will result in: - -``` xml - - - - - - - - - -``` - -See the [wiki](https://github.com/oozcitak/xmlbuilder-js/wiki) for details and [examples](https://github.com/oozcitak/xmlbuilder-js/wiki/Examples) for more complex examples. +# xmlbuilder-js + +An XML builder for [node.js](https://nodejs.org/) similar to +[java-xmlbuilder](https://github.com/jmurty/java-xmlbuilder). + +[![License](http://img.shields.io/npm/l/xmlbuilder.svg?style=flat-square)](http://opensource.org/licenses/MIT) +[![NPM Version](http://img.shields.io/npm/v/xmlbuilder.svg?style=flat-square)](https://npmjs.com/package/xmlbuilder) +[![NPM Downloads](https://img.shields.io/npm/dm/xmlbuilder.svg?style=flat-square)](https://npmjs.com/package/xmlbuilder) + +[![Travis Build Status](http://img.shields.io/travis/oozcitak/xmlbuilder-js.svg?style=flat-square)](http://travis-ci.org/oozcitak/xmlbuilder-js) +[![AppVeyor Build status](https://ci.appveyor.com/api/projects/status/bf7odb20hj77isry?svg=true)](https://ci.appveyor.com/project/oozcitak/xmlbuilder-js) +[![Dev Dependency Status](http://img.shields.io/david/dev/oozcitak/xmlbuilder-js.svg?style=flat-square)](https://david-dm.org/oozcitak/xmlbuilder-js) +[![Code Coverage](https://img.shields.io/coveralls/oozcitak/xmlbuilder-js.svg?style=flat-square)](https://coveralls.io/github/oozcitak/xmlbuilder-js) + +### Installation: + +``` sh +npm install xmlbuilder +``` + +### Usage: + +``` js +var builder = require('xmlbuilder'); +var xml = builder.create('root') + .ele('xmlbuilder') + .ele('repo', {'type': 'git'}, 'git://github.com/oozcitak/xmlbuilder-js.git') + .end({ pretty: true}); + +console.log(xml); +``` + +will result in: + +``` xml + + + + git://github.com/oozcitak/xmlbuilder-js.git + + +``` + +It is also possible to convert objects into nodes: + +``` js +builder.create({ + root: { + xmlbuilder: { + repo: { + '@type': 'git', // attributes start with @ + '#text': 'git://github.com/oozcitak/xmlbuilder-js.git' // text node + } + } + } +}); +``` + +If you need to do some processing: + +``` js +var root = builder.create('squares'); +root.com('f(x) = x^2'); +for(var i = 1; i <= 5; i++) +{ + var item = root.ele('data'); + item.att('x', i); + item.att('y', i * i); +} +``` + +This will result in: + +``` xml + + + + + + + + + +``` + +See the [wiki](https://github.com/oozcitak/xmlbuilder-js/wiki) for details and [examples](https://github.com/oozcitak/xmlbuilder-js/wiki/Examples) for more complex examples. diff --git a/node_modules/xmlbuilder/appveyor.yml b/node_modules/xmlbuilder/appveyor.yml index 39a262827..9604b7853 100644 --- a/node_modules/xmlbuilder/appveyor.yml +++ b/node_modules/xmlbuilder/appveyor.yml @@ -1,20 +1,20 @@ -environment: - matrix: - - nodejs_version: "4" - - nodejs_version: "5" - - nodejs_version: "6" - - nodejs_version: "8" - - nodejs_version: "10" - - nodejs_version: "" # latest - -install: - - ps: "Install-Product node $env:nodejs_version" - - "npm install" - -test_script: - - "node --version" - - "npm --version" - - "npm test" - -build: off - +environment: + matrix: + - nodejs_version: "4" + - nodejs_version: "5" + - nodejs_version: "6" + - nodejs_version: "8" + - nodejs_version: "10" + - nodejs_version: "" # latest + +install: + - ps: "Install-Product node $env:nodejs_version" + - "npm install" + +test_script: + - "node --version" + - "npm --version" + - "npm test" + +build: off + diff --git a/node_modules/xmlbuilder/package.json b/node_modules/xmlbuilder/package.json index f15d265c7..512cd9771 100644 --- a/node_modules/xmlbuilder/package.json +++ b/node_modules/xmlbuilder/package.json @@ -36,8 +36,4 @@ "postpublish": "rm -rf lib", "test": "mocha \"test/**/*.coffee\" && istanbul report text lcov" } - -,"_resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-11.0.1.tgz" -,"_integrity": "sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA==" -,"_from": "xmlbuilder@11.0.1" -} \ No newline at end of file +} diff --git a/node_modules/xmldom/__package__.js b/node_modules/xmldom/__package__.js index b4cad2891..93af3495a 100644 --- a/node_modules/xmldom/__package__.js +++ b/node_modules/xmldom/__package__.js @@ -1,4 +1,4 @@ -this.addScript('dom.js',['DOMImplementation','XMLSerializer']); -this.addScript('dom-parser.js',['DOMHandler','DOMParser'], - ['DOMImplementation','XMLReader']); +this.addScript('dom.js',['DOMImplementation','XMLSerializer']); +this.addScript('dom-parser.js',['DOMHandler','DOMParser'], + ['DOMImplementation','XMLReader']); this.addScript('sax.js','XMLReader'); \ No newline at end of file diff --git a/node_modules/xmldom/dom-parser.js b/node_modules/xmldom/dom-parser.js index 41d522679..08e949580 100644 --- a/node_modules/xmldom/dom-parser.js +++ b/node_modules/xmldom/dom-parser.js @@ -1,251 +1,251 @@ -function DOMParser(options){ - this.options = options ||{locator:{}}; - -} -DOMParser.prototype.parseFromString = function(source,mimeType){ - var options = this.options; - var sax = new XMLReader(); - var domBuilder = options.domBuilder || new DOMHandler();//contentHandler and LexicalHandler - var errorHandler = options.errorHandler; - var locator = options.locator; - var defaultNSMap = options.xmlns||{}; - var entityMap = {'lt':'<','gt':'>','amp':'&','quot':'"','apos':"'"} - if(locator){ - domBuilder.setDocumentLocator(locator) - } - - sax.errorHandler = buildErrorHandler(errorHandler,domBuilder,locator); - sax.domBuilder = options.domBuilder || domBuilder; - if(/\/x?html?$/.test(mimeType)){ - entityMap.nbsp = '\xa0'; - entityMap.copy = '\xa9'; - defaultNSMap['']= 'http://www.w3.org/1999/xhtml'; - } - defaultNSMap.xml = defaultNSMap.xml || 'http://www.w3.org/XML/1998/namespace'; - if(source){ - sax.parse(source,defaultNSMap,entityMap); - }else{ - sax.errorHandler.error("invalid doc source"); - } - return domBuilder.doc; -} -function buildErrorHandler(errorImpl,domBuilder,locator){ - if(!errorImpl){ - if(domBuilder instanceof DOMHandler){ - return domBuilder; - } - errorImpl = domBuilder ; - } - var errorHandler = {} - var isCallback = errorImpl instanceof Function; - locator = locator||{} - function build(key){ - var fn = errorImpl[key]; - if(!fn && isCallback){ - fn = errorImpl.length == 2?function(msg){errorImpl(key,msg)}:errorImpl; - } - errorHandler[key] = fn && function(msg){ - fn('[xmldom '+key+']\t'+msg+_locator(locator)); - }||function(){}; - } - build('warning'); - build('error'); - build('fatalError'); - return errorHandler; -} - -//console.log('#\n\n\n\n\n\n\n####') -/** - * +ContentHandler+ErrorHandler - * +LexicalHandler+EntityResolver2 - * -DeclHandler-DTDHandler - * - * DefaultHandler:EntityResolver, DTDHandler, ContentHandler, ErrorHandler - * DefaultHandler2:DefaultHandler,LexicalHandler, DeclHandler, EntityResolver2 - * @link http://www.saxproject.org/apidoc/org/xml/sax/helpers/DefaultHandler.html - */ -function DOMHandler() { - this.cdata = false; -} -function position(locator,node){ - node.lineNumber = locator.lineNumber; - node.columnNumber = locator.columnNumber; -} -/** - * @see org.xml.sax.ContentHandler#startDocument - * @link http://www.saxproject.org/apidoc/org/xml/sax/ContentHandler.html - */ -DOMHandler.prototype = { - startDocument : function() { - this.doc = new DOMImplementation().createDocument(null, null, null); - if (this.locator) { - this.doc.documentURI = this.locator.systemId; - } - }, - startElement:function(namespaceURI, localName, qName, attrs) { - var doc = this.doc; - var el = doc.createElementNS(namespaceURI, qName||localName); - var len = attrs.length; - appendElement(this, el); - this.currentElement = el; - - this.locator && position(this.locator,el) - for (var i = 0 ; i < len; i++) { - var namespaceURI = attrs.getURI(i); - var value = attrs.getValue(i); - var qName = attrs.getQName(i); - var attr = doc.createAttributeNS(namespaceURI, qName); - this.locator &&position(attrs.getLocator(i),attr); - attr.value = attr.nodeValue = value; - el.setAttributeNode(attr) - } - }, - endElement:function(namespaceURI, localName, qName) { - var current = this.currentElement - var tagName = current.tagName; - this.currentElement = current.parentNode; - }, - startPrefixMapping:function(prefix, uri) { - }, - endPrefixMapping:function(prefix) { - }, - processingInstruction:function(target, data) { - var ins = this.doc.createProcessingInstruction(target, data); - this.locator && position(this.locator,ins) - appendElement(this, ins); - }, - ignorableWhitespace:function(ch, start, length) { - }, - characters:function(chars, start, length) { - chars = _toString.apply(this,arguments) - //console.log(chars) - if(chars){ - if (this.cdata) { - var charNode = this.doc.createCDATASection(chars); - } else { - var charNode = this.doc.createTextNode(chars); - } - if(this.currentElement){ - this.currentElement.appendChild(charNode); - }else if(/^\s*$/.test(chars)){ - this.doc.appendChild(charNode); - //process xml - } - this.locator && position(this.locator,charNode) - } - }, - skippedEntity:function(name) { - }, - endDocument:function() { - this.doc.normalize(); - }, - setDocumentLocator:function (locator) { - if(this.locator = locator){// && !('lineNumber' in locator)){ - locator.lineNumber = 0; - } - }, - //LexicalHandler - comment:function(chars, start, length) { - chars = _toString.apply(this,arguments) - var comm = this.doc.createComment(chars); - this.locator && position(this.locator,comm) - appendElement(this, comm); - }, - - startCDATA:function() { - //used in characters() methods - this.cdata = true; - }, - endCDATA:function() { - this.cdata = false; - }, - - startDTD:function(name, publicId, systemId) { - var impl = this.doc.implementation; - if (impl && impl.createDocumentType) { - var dt = impl.createDocumentType(name, publicId, systemId); - this.locator && position(this.locator,dt) - appendElement(this, dt); - } - }, - /** - * @see org.xml.sax.ErrorHandler - * @link http://www.saxproject.org/apidoc/org/xml/sax/ErrorHandler.html - */ - warning:function(error) { - console.warn('[xmldom warning]\t'+error,_locator(this.locator)); - }, - error:function(error) { - console.error('[xmldom error]\t'+error,_locator(this.locator)); - }, - fatalError:function(error) { - console.error('[xmldom fatalError]\t'+error,_locator(this.locator)); - throw error; - } -} -function _locator(l){ - if(l){ - return '\n@'+(l.systemId ||'')+'#[line:'+l.lineNumber+',col:'+l.columnNumber+']' - } -} -function _toString(chars,start,length){ - if(typeof chars == 'string'){ - return chars.substr(start,length) - }else{//java sax connect width xmldom on rhino(what about: "? && !(chars instanceof String)") - if(chars.length >= start+length || start){ - return new java.lang.String(chars,start,length)+''; - } - return chars; - } -} - -/* - * @link http://www.saxproject.org/apidoc/org/xml/sax/ext/LexicalHandler.html - * used method of org.xml.sax.ext.LexicalHandler: - * #comment(chars, start, length) - * #startCDATA() - * #endCDATA() - * #startDTD(name, publicId, systemId) - * - * - * IGNORED method of org.xml.sax.ext.LexicalHandler: - * #endDTD() - * #startEntity(name) - * #endEntity(name) - * - * - * @link http://www.saxproject.org/apidoc/org/xml/sax/ext/DeclHandler.html - * IGNORED method of org.xml.sax.ext.DeclHandler - * #attributeDecl(eName, aName, type, mode, value) - * #elementDecl(name, model) - * #externalEntityDecl(name, publicId, systemId) - * #internalEntityDecl(name, value) - * @link http://www.saxproject.org/apidoc/org/xml/sax/ext/EntityResolver2.html - * IGNORED method of org.xml.sax.EntityResolver2 - * #resolveEntity(String name,String publicId,String baseURI,String systemId) - * #resolveEntity(publicId, systemId) - * #getExternalSubset(name, baseURI) - * @link http://www.saxproject.org/apidoc/org/xml/sax/DTDHandler.html - * IGNORED method of org.xml.sax.DTDHandler - * #notationDecl(name, publicId, systemId) {}; - * #unparsedEntityDecl(name, publicId, systemId, notationName) {}; - */ -"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,function(key){ - DOMHandler.prototype[key] = function(){return null} -}) - -/* Private static helpers treated below as private instance methods, so don't need to add these to the public API; we might use a Relator to also get rid of non-standard public properties */ -function appendElement (hander,node) { - if (!hander.currentElement) { - hander.doc.appendChild(node); - } else { - hander.currentElement.appendChild(node); - } -}//appendChild and setAttributeNS are preformance key - -//if(typeof require == 'function'){ - var XMLReader = require('./sax').XMLReader; - var DOMImplementation = exports.DOMImplementation = require('./dom').DOMImplementation; - exports.XMLSerializer = require('./dom').XMLSerializer ; - exports.DOMParser = DOMParser; -//} +function DOMParser(options){ + this.options = options ||{locator:{}}; + +} +DOMParser.prototype.parseFromString = function(source,mimeType){ + var options = this.options; + var sax = new XMLReader(); + var domBuilder = options.domBuilder || new DOMHandler();//contentHandler and LexicalHandler + var errorHandler = options.errorHandler; + var locator = options.locator; + var defaultNSMap = options.xmlns||{}; + var entityMap = {'lt':'<','gt':'>','amp':'&','quot':'"','apos':"'"} + if(locator){ + domBuilder.setDocumentLocator(locator) + } + + sax.errorHandler = buildErrorHandler(errorHandler,domBuilder,locator); + sax.domBuilder = options.domBuilder || domBuilder; + if(/\/x?html?$/.test(mimeType)){ + entityMap.nbsp = '\xa0'; + entityMap.copy = '\xa9'; + defaultNSMap['']= 'http://www.w3.org/1999/xhtml'; + } + defaultNSMap.xml = defaultNSMap.xml || 'http://www.w3.org/XML/1998/namespace'; + if(source){ + sax.parse(source,defaultNSMap,entityMap); + }else{ + sax.errorHandler.error("invalid doc source"); + } + return domBuilder.doc; +} +function buildErrorHandler(errorImpl,domBuilder,locator){ + if(!errorImpl){ + if(domBuilder instanceof DOMHandler){ + return domBuilder; + } + errorImpl = domBuilder ; + } + var errorHandler = {} + var isCallback = errorImpl instanceof Function; + locator = locator||{} + function build(key){ + var fn = errorImpl[key]; + if(!fn && isCallback){ + fn = errorImpl.length == 2?function(msg){errorImpl(key,msg)}:errorImpl; + } + errorHandler[key] = fn && function(msg){ + fn('[xmldom '+key+']\t'+msg+_locator(locator)); + }||function(){}; + } + build('warning'); + build('error'); + build('fatalError'); + return errorHandler; +} + +//console.log('#\n\n\n\n\n\n\n####') +/** + * +ContentHandler+ErrorHandler + * +LexicalHandler+EntityResolver2 + * -DeclHandler-DTDHandler + * + * DefaultHandler:EntityResolver, DTDHandler, ContentHandler, ErrorHandler + * DefaultHandler2:DefaultHandler,LexicalHandler, DeclHandler, EntityResolver2 + * @link http://www.saxproject.org/apidoc/org/xml/sax/helpers/DefaultHandler.html + */ +function DOMHandler() { + this.cdata = false; +} +function position(locator,node){ + node.lineNumber = locator.lineNumber; + node.columnNumber = locator.columnNumber; +} +/** + * @see org.xml.sax.ContentHandler#startDocument + * @link http://www.saxproject.org/apidoc/org/xml/sax/ContentHandler.html + */ +DOMHandler.prototype = { + startDocument : function() { + this.doc = new DOMImplementation().createDocument(null, null, null); + if (this.locator) { + this.doc.documentURI = this.locator.systemId; + } + }, + startElement:function(namespaceURI, localName, qName, attrs) { + var doc = this.doc; + var el = doc.createElementNS(namespaceURI, qName||localName); + var len = attrs.length; + appendElement(this, el); + this.currentElement = el; + + this.locator && position(this.locator,el) + for (var i = 0 ; i < len; i++) { + var namespaceURI = attrs.getURI(i); + var value = attrs.getValue(i); + var qName = attrs.getQName(i); + var attr = doc.createAttributeNS(namespaceURI, qName); + this.locator &&position(attrs.getLocator(i),attr); + attr.value = attr.nodeValue = value; + el.setAttributeNode(attr) + } + }, + endElement:function(namespaceURI, localName, qName) { + var current = this.currentElement + var tagName = current.tagName; + this.currentElement = current.parentNode; + }, + startPrefixMapping:function(prefix, uri) { + }, + endPrefixMapping:function(prefix) { + }, + processingInstruction:function(target, data) { + var ins = this.doc.createProcessingInstruction(target, data); + this.locator && position(this.locator,ins) + appendElement(this, ins); + }, + ignorableWhitespace:function(ch, start, length) { + }, + characters:function(chars, start, length) { + chars = _toString.apply(this,arguments) + //console.log(chars) + if(chars){ + if (this.cdata) { + var charNode = this.doc.createCDATASection(chars); + } else { + var charNode = this.doc.createTextNode(chars); + } + if(this.currentElement){ + this.currentElement.appendChild(charNode); + }else if(/^\s*$/.test(chars)){ + this.doc.appendChild(charNode); + //process xml + } + this.locator && position(this.locator,charNode) + } + }, + skippedEntity:function(name) { + }, + endDocument:function() { + this.doc.normalize(); + }, + setDocumentLocator:function (locator) { + if(this.locator = locator){// && !('lineNumber' in locator)){ + locator.lineNumber = 0; + } + }, + //LexicalHandler + comment:function(chars, start, length) { + chars = _toString.apply(this,arguments) + var comm = this.doc.createComment(chars); + this.locator && position(this.locator,comm) + appendElement(this, comm); + }, + + startCDATA:function() { + //used in characters() methods + this.cdata = true; + }, + endCDATA:function() { + this.cdata = false; + }, + + startDTD:function(name, publicId, systemId) { + var impl = this.doc.implementation; + if (impl && impl.createDocumentType) { + var dt = impl.createDocumentType(name, publicId, systemId); + this.locator && position(this.locator,dt) + appendElement(this, dt); + } + }, + /** + * @see org.xml.sax.ErrorHandler + * @link http://www.saxproject.org/apidoc/org/xml/sax/ErrorHandler.html + */ + warning:function(error) { + console.warn('[xmldom warning]\t'+error,_locator(this.locator)); + }, + error:function(error) { + console.error('[xmldom error]\t'+error,_locator(this.locator)); + }, + fatalError:function(error) { + console.error('[xmldom fatalError]\t'+error,_locator(this.locator)); + throw error; + } +} +function _locator(l){ + if(l){ + return '\n@'+(l.systemId ||'')+'#[line:'+l.lineNumber+',col:'+l.columnNumber+']' + } +} +function _toString(chars,start,length){ + if(typeof chars == 'string'){ + return chars.substr(start,length) + }else{//java sax connect width xmldom on rhino(what about: "? && !(chars instanceof String)") + if(chars.length >= start+length || start){ + return new java.lang.String(chars,start,length)+''; + } + return chars; + } +} + +/* + * @link http://www.saxproject.org/apidoc/org/xml/sax/ext/LexicalHandler.html + * used method of org.xml.sax.ext.LexicalHandler: + * #comment(chars, start, length) + * #startCDATA() + * #endCDATA() + * #startDTD(name, publicId, systemId) + * + * + * IGNORED method of org.xml.sax.ext.LexicalHandler: + * #endDTD() + * #startEntity(name) + * #endEntity(name) + * + * + * @link http://www.saxproject.org/apidoc/org/xml/sax/ext/DeclHandler.html + * IGNORED method of org.xml.sax.ext.DeclHandler + * #attributeDecl(eName, aName, type, mode, value) + * #elementDecl(name, model) + * #externalEntityDecl(name, publicId, systemId) + * #internalEntityDecl(name, value) + * @link http://www.saxproject.org/apidoc/org/xml/sax/ext/EntityResolver2.html + * IGNORED method of org.xml.sax.EntityResolver2 + * #resolveEntity(String name,String publicId,String baseURI,String systemId) + * #resolveEntity(publicId, systemId) + * #getExternalSubset(name, baseURI) + * @link http://www.saxproject.org/apidoc/org/xml/sax/DTDHandler.html + * IGNORED method of org.xml.sax.DTDHandler + * #notationDecl(name, publicId, systemId) {}; + * #unparsedEntityDecl(name, publicId, systemId, notationName) {}; + */ +"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,function(key){ + DOMHandler.prototype[key] = function(){return null} +}) + +/* Private static helpers treated below as private instance methods, so don't need to add these to the public API; we might use a Relator to also get rid of non-standard public properties */ +function appendElement (hander,node) { + if (!hander.currentElement) { + hander.doc.appendChild(node); + } else { + hander.currentElement.appendChild(node); + } +}//appendChild and setAttributeNS are preformance key + +//if(typeof require == 'function'){ + var XMLReader = require('./sax').XMLReader; + var DOMImplementation = exports.DOMImplementation = require('./dom').DOMImplementation; + exports.XMLSerializer = require('./dom').XMLSerializer ; + exports.DOMParser = DOMParser; +//} diff --git a/node_modules/xmldom/package.json b/node_modules/xmldom/package.json index fa95809af..75a9841a3 100644 --- a/node_modules/xmldom/package.json +++ b/node_modules/xmldom/package.json @@ -1,26 +1,22 @@ -{ - "name": "xmldom", - "version": "0.1.31", - "description": "A W3C Standard XML DOM(Level2 CORE) implementation and parser(DOMParser/XMLSerializer).", - "keywords": ["w3c","dom","xml","parser","javascript","DOMParser","XMLSerializer"], - "author": "jindw (http://www.xidea.org)", - "homepage": "https://github.com/xmldom/xmldom", - "repository": {"type": "git","url": "git://github.com/xmldom/xmldom.git"}, - "main": "./dom-parser.js", - "scripts" : { "test": "proof platform win32 && proof test */*/*.t.js || t/test" }, - "engines": {"node": ">=0.1"}, - "dependencies": {}, - "devDependencies": { "proof": "0.0.28" }, - "maintainers": [{"name": "jindw","email": "jindw@xidea.org","url": "http://www.xidea.org"}], - "contributors": [ - {"name" : "Yaron Naveh","email" : "yaronn01@gmail.com","web" : "http://webservices20.blogspot.com/"}, - {"name" : "Harutyun Amirjanyan","email" : "amirjanyan@gmail.com","web" : "https://github.com/nightwing"}, - {"name" : "Alan Gutierrez","email" : "alan@prettyrobots.com","web" : "http://www.prettyrobots.com/"} - ], - "bugs": {"email": "jindw@xidea.org","url": "http://github.com/jindw/xmldom/issues"}, - "license": "(LGPL-2.0 or MIT)" - -,"_resolved": "https://registry.npmjs.org/xmldom/-/xmldom-0.1.31.tgz" -,"_integrity": "sha512-yS2uJflVQs6n+CyjHoaBmVSqIDevTAWrzMmjG1Gc7h1qQ7uVozNhEPJAwZXWyGQ/Gafo3fCwrcaokezLPupVyQ==" -,"_from": "xmldom@0.1.31" -} \ No newline at end of file +{ + "name": "xmldom", + "version": "0.1.31", + "description": "A W3C Standard XML DOM(Level2 CORE) implementation and parser(DOMParser/XMLSerializer).", + "keywords": ["w3c","dom","xml","parser","javascript","DOMParser","XMLSerializer"], + "author": "jindw (http://www.xidea.org)", + "homepage": "https://github.com/xmldom/xmldom", + "repository": {"type": "git","url": "git://github.com/xmldom/xmldom.git"}, + "main": "./dom-parser.js", + "scripts" : { "test": "proof platform win32 && proof test */*/*.t.js || t/test" }, + "engines": {"node": ">=0.1"}, + "dependencies": {}, + "devDependencies": { "proof": "0.0.28" }, + "maintainers": [{"name": "jindw","email": "jindw@xidea.org","url": "http://www.xidea.org"}], + "contributors": [ + {"name" : "Yaron Naveh","email" : "yaronn01@gmail.com","web" : "http://webservices20.blogspot.com/"}, + {"name" : "Harutyun Amirjanyan","email" : "amirjanyan@gmail.com","web" : "https://github.com/nightwing"}, + {"name" : "Alan Gutierrez","email" : "alan@prettyrobots.com","web" : "http://www.prettyrobots.com/"} + ], + "bugs": {"email": "jindw@xidea.org","url": "http://github.com/jindw/xmldom/issues"}, + "license": "(LGPL-2.0 or MIT)" +} diff --git a/node_modules/xmldom/sax.js b/node_modules/xmldom/sax.js index b33635f64..dc17cc251 100644 --- a/node_modules/xmldom/sax.js +++ b/node_modules/xmldom/sax.js @@ -1,633 +1,633 @@ -//[4] NameStartChar ::= ":" | [A-Z] | "_" | [a-z] | [#xC0-#xD6] | [#xD8-#xF6] | [#xF8-#x2FF] | [#x370-#x37D] | [#x37F-#x1FFF] | [#x200C-#x200D] | [#x2070-#x218F] | [#x2C00-#x2FEF] | [#x3001-#xD7FF] | [#xF900-#xFDCF] | [#xFDF0-#xFFFD] | [#x10000-#xEFFFF] -//[4a] NameChar ::= NameStartChar | "-" | "." | [0-9] | #xB7 | [#x0300-#x036F] | [#x203F-#x2040] -//[5] Name ::= NameStartChar (NameChar)* -var nameStartChar = /[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]///\u10000-\uEFFFF -var nameChar = new RegExp("[\\-\\.0-9"+nameStartChar.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"); -var tagNamePattern = new RegExp('^'+nameStartChar.source+nameChar.source+'*(?:\:'+nameStartChar.source+nameChar.source+'*)?$'); -//var tagNamePattern = /^[a-zA-Z_][\w\-\.]*(?:\:[a-zA-Z_][\w\-\.]*)?$/ -//var handlers = 'resolveEntity,getExternalSubset,characters,endDocument,endElement,endPrefixMapping,ignorableWhitespace,processingInstruction,setDocumentLocator,skippedEntity,startDocument,startElement,startPrefixMapping,notationDecl,unparsedEntityDecl,error,fatalError,warning,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,comment,endCDATA,endDTD,endEntity,startCDATA,startDTD,startEntity'.split(',') - -//S_TAG, S_ATTR, S_EQ, S_ATTR_NOQUOT_VALUE -//S_ATTR_SPACE, S_ATTR_END, S_TAG_SPACE, S_TAG_CLOSE -var S_TAG = 0;//tag name offerring -var S_ATTR = 1;//attr name offerring -var S_ATTR_SPACE=2;//attr name end and space offer -var S_EQ = 3;//=space? -var S_ATTR_NOQUOT_VALUE = 4;//attr value(no quot value only) -var S_ATTR_END = 5;//attr value end and no space(quot end) -var S_TAG_SPACE = 6;//(attr value end || tag end ) && (space offer) -var S_TAG_CLOSE = 7;//closed el - -function XMLReader(){ - -} - -XMLReader.prototype = { - parse:function(source,defaultNSMap,entityMap){ - var domBuilder = this.domBuilder; - domBuilder.startDocument(); - _copy(defaultNSMap ,defaultNSMap = {}) - parse(source,defaultNSMap,entityMap, - domBuilder,this.errorHandler); - domBuilder.endDocument(); - } -} -function parse(source,defaultNSMapCopy,entityMap,domBuilder,errorHandler){ - function fixedFromCharCode(code) { - // String.prototype.fromCharCode does not supports - // > 2 bytes unicode chars directly - if (code > 0xffff) { - code -= 0x10000; - var surrogate1 = 0xd800 + (code >> 10) - , surrogate2 = 0xdc00 + (code & 0x3ff); - - return String.fromCharCode(surrogate1, surrogate2); - } else { - return String.fromCharCode(code); - } - } - function entityReplacer(a){ - var k = a.slice(1,-1); - if(k in entityMap){ - return entityMap[k]; - }else if(k.charAt(0) === '#'){ - return fixedFromCharCode(parseInt(k.substr(1).replace('x','0x'))) - }else{ - errorHandler.error('entity not found:'+a); - return a; - } - } - function appendText(end){//has some bugs - if(end>start){ - var xt = source.substring(start,end).replace(/&#?\w+;/g,entityReplacer); - locator&&position(start); - domBuilder.characters(xt,0,end-start); - start = end - } - } - function position(p,m){ - while(p>=lineEnd && (m = linePattern.exec(source))){ - lineStart = m.index; - lineEnd = lineStart + m[0].length; - locator.lineNumber++; - //console.log('line++:',locator,startPos,endPos) - } - locator.columnNumber = p-lineStart+1; - } - var lineStart = 0; - var lineEnd = 0; - var linePattern = /.*(?:\r\n?|\n)|.*$/g - var locator = domBuilder.locator; - - var parseStack = [{currentNSMap:defaultNSMapCopy}] - var closeMap = {}; - var start = 0; - while(true){ - try{ - var tagStart = source.indexOf('<',start); - if(tagStart<0){ - if(!source.substr(start).match(/^\s*$/)){ - var doc = domBuilder.doc; - var text = doc.createTextNode(source.substr(start)); - doc.appendChild(text); - domBuilder.currentElement = text; - } - return; - } - if(tagStart>start){ - appendText(tagStart); - } - switch(source.charAt(tagStart+1)){ - case '/': - var end = source.indexOf('>',tagStart+3); - var tagName = source.substring(tagStart+2,end); - var config = parseStack.pop(); - if(end<0){ - - tagName = source.substring(tagStart+2).replace(/[\s<].*/,''); - //console.error('#@@@@@@'+tagName) - errorHandler.error("end tag name: "+tagName+' is not complete:'+config.tagName); - end = tagStart+1+tagName.length; - }else if(tagName.match(/\s - locator&&position(tagStart); - end = parseInstruction(source,tagStart,domBuilder); - break; - case '!':// start){ - start = end; - }else{ - //TODO: 这里有可能sax回退,有位置错误风险 - appendText(Math.max(tagStart,start)+1); - } - } -} -function copyLocator(f,t){ - t.lineNumber = f.lineNumber; - t.columnNumber = f.columnNumber; - return t; -} - -/** - * @see #appendElement(source,elStartEnd,el,selfClosed,entityReplacer,domBuilder,parseStack); - * @return end of the elementStartPart(end of elementEndPart for selfClosed el) - */ -function parseElementStartPart(source,start,el,currentNSMap,entityReplacer,errorHandler){ - var attrName; - var value; - var p = ++start; - var s = S_TAG;//status - while(true){ - var c = source.charAt(p); - switch(c){ - case '=': - if(s === S_ATTR){//attrName - attrName = source.slice(start,p); - s = S_EQ; - }else if(s === S_ATTR_SPACE){ - s = S_EQ; - }else{ - //fatalError: equal must after attrName or space after attrName - throw new Error('attribute equal must after attrName'); - } - break; - case '\'': - case '"': - if(s === S_EQ || s === S_ATTR //|| s == S_ATTR_SPACE - ){//equal - if(s === S_ATTR){ - errorHandler.warning('attribute value must after "="') - attrName = source.slice(start,p) - } - start = p+1; - p = source.indexOf(c,start) - if(p>0){ - value = source.slice(start,p).replace(/&#?\w+;/g,entityReplacer); - el.add(attrName,value,start-1); - s = S_ATTR_END; - }else{ - //fatalError: no end quot match - throw new Error('attribute value no end \''+c+'\' match'); - } - }else if(s == S_ATTR_NOQUOT_VALUE){ - value = source.slice(start,p).replace(/&#?\w+;/g,entityReplacer); - //console.log(attrName,value,start,p) - el.add(attrName,value,start); - //console.dir(el) - errorHandler.warning('attribute "'+attrName+'" missed start quot('+c+')!!'); - start = p+1; - s = S_ATTR_END - }else{ - //fatalError: no equal before - throw new Error('attribute value must after "="'); - } - break; - case '/': - switch(s){ - case S_TAG: - el.setTagName(source.slice(start,p)); - case S_ATTR_END: - case S_TAG_SPACE: - case S_TAG_CLOSE: - s =S_TAG_CLOSE; - el.closed = true; - case S_ATTR_NOQUOT_VALUE: - case S_ATTR: - case S_ATTR_SPACE: - break; - //case S_EQ: - default: - throw new Error("attribute invalid close char('/')") - } - break; - case ''://end document - //throw new Error('unexpected end of input') - errorHandler.error('unexpected end of input'); - if(s == S_TAG){ - el.setTagName(source.slice(start,p)); - } - return p; - case '>': - switch(s){ - case S_TAG: - el.setTagName(source.slice(start,p)); - case S_ATTR_END: - case S_TAG_SPACE: - case S_TAG_CLOSE: - break;//normal - case S_ATTR_NOQUOT_VALUE://Compatible state - case S_ATTR: - value = source.slice(start,p); - if(value.slice(-1) === '/'){ - el.closed = true; - value = value.slice(0,-1) - } - case S_ATTR_SPACE: - if(s === S_ATTR_SPACE){ - value = attrName; - } - if(s == S_ATTR_NOQUOT_VALUE){ - errorHandler.warning('attribute "'+value+'" missed quot(")!!'); - el.add(attrName,value.replace(/&#?\w+;/g,entityReplacer),start) - }else{ - if(currentNSMap[''] !== 'http://www.w3.org/1999/xhtml' || !value.match(/^(?:disabled|checked|selected)$/i)){ - errorHandler.warning('attribute "'+value+'" missed value!! "'+value+'" instead!!') - } - el.add(value,value,start) - } - break; - case S_EQ: - throw new Error('attribute value missed!!'); - } -// console.log(tagName,tagNamePattern,tagNamePattern.test(tagName)) - return p; - /*xml space '\x20' | #x9 | #xD | #xA; */ - case '\u0080': - c = ' '; - default: - if(c<= ' '){//space - switch(s){ - case S_TAG: - el.setTagName(source.slice(start,p));//tagName - s = S_TAG_SPACE; - break; - case S_ATTR: - attrName = source.slice(start,p) - s = S_ATTR_SPACE; - break; - case S_ATTR_NOQUOT_VALUE: - var value = source.slice(start,p).replace(/&#?\w+;/g,entityReplacer); - errorHandler.warning('attribute "'+value+'" missed quot(")!!'); - el.add(attrName,value,start) - case S_ATTR_END: - s = S_TAG_SPACE; - break; - //case S_TAG_SPACE: - //case S_EQ: - //case S_ATTR_SPACE: - // void();break; - //case S_TAG_CLOSE: - //ignore warning - } - }else{//not space -//S_TAG, S_ATTR, S_EQ, S_ATTR_NOQUOT_VALUE -//S_ATTR_SPACE, S_ATTR_END, S_TAG_SPACE, S_TAG_CLOSE - switch(s){ - //case S_TAG:void();break; - //case S_ATTR:void();break; - //case S_ATTR_NOQUOT_VALUE:void();break; - case S_ATTR_SPACE: - var tagName = el.tagName; - if(currentNSMap[''] !== 'http://www.w3.org/1999/xhtml' || !attrName.match(/^(?:disabled|checked|selected)$/i)){ - errorHandler.warning('attribute "'+attrName+'" missed value!! "'+attrName+'" instead2!!') - } - el.add(attrName,attrName,start); - start = p; - s = S_ATTR; - break; - case S_ATTR_END: - errorHandler.warning('attribute space is required"'+attrName+'"!!') - case S_TAG_SPACE: - s = S_ATTR; - start = p; - break; - case S_EQ: - s = S_ATTR_NOQUOT_VALUE; - start = p; - break; - case S_TAG_CLOSE: - throw new Error("elements closed character '/' and '>' must be connected to"); - } - } - }//end outer switch - //console.log('p++',p) - p++; - } -} -/** - * @return true if has new namespace define - */ -function appendElement(el,domBuilder,currentNSMap){ - var tagName = el.tagName; - var localNSMap = null; - //var currentNSMap = parseStack[parseStack.length-1].currentNSMap; - var i = el.length; - while(i--){ - var a = el[i]; - var qName = a.qName; - var value = a.value; - var nsp = qName.indexOf(':'); - if(nsp>0){ - var prefix = a.prefix = qName.slice(0,nsp); - var localName = qName.slice(nsp+1); - var nsPrefix = prefix === 'xmlns' && localName - }else{ - localName = qName; - prefix = null - nsPrefix = qName === 'xmlns' && '' - } - //can not set prefix,because prefix !== '' - a.localName = localName ; - //prefix == null for no ns prefix attribute - if(nsPrefix !== false){//hack!! - if(localNSMap == null){ - localNSMap = {} - //console.log(currentNSMap,0) - _copy(currentNSMap,currentNSMap={}) - //console.log(currentNSMap,1) - } - currentNSMap[nsPrefix] = localNSMap[nsPrefix] = value; - a.uri = 'http://www.w3.org/2000/xmlns/' - domBuilder.startPrefixMapping(nsPrefix, value) - } - } - var i = el.length; - while(i--){ - a = el[i]; - var prefix = a.prefix; - if(prefix){//no prefix attribute has no namespace - if(prefix === 'xml'){ - a.uri = 'http://www.w3.org/XML/1998/namespace'; - }if(prefix !== 'xmlns'){ - a.uri = currentNSMap[prefix || ''] - - //{console.log('###'+a.qName,domBuilder.locator.systemId+'',currentNSMap,a.uri)} - } - } - } - var nsp = tagName.indexOf(':'); - if(nsp>0){ - prefix = el.prefix = tagName.slice(0,nsp); - localName = el.localName = tagName.slice(nsp+1); - }else{ - prefix = null;//important!! - localName = el.localName = tagName; - } - //no prefix element has default namespace - var ns = el.uri = currentNSMap[prefix || '']; - domBuilder.startElement(ns,localName,tagName,el); - //endPrefixMapping and startPrefixMapping have not any help for dom builder - //localNSMap = null - if(el.closed){ - domBuilder.endElement(ns,localName,tagName); - if(localNSMap){ - for(prefix in localNSMap){ - domBuilder.endPrefixMapping(prefix) - } - } - }else{ - el.currentNSMap = currentNSMap; - el.localNSMap = localNSMap; - //parseStack.push(el); - return true; - } -} -function parseHtmlSpecialContent(source,elStartEnd,tagName,entityReplacer,domBuilder){ - if(/^(?:script|textarea)$/i.test(tagName)){ - var elEndStart = source.indexOf('',elStartEnd); - var text = source.substring(elStartEnd+1,elEndStart); - if(/[&<]/.test(text)){ - if(/^script$/i.test(tagName)){ - //if(!/\]\]>/.test(text)){ - //lexHandler.startCDATA(); - domBuilder.characters(text,0,text.length); - //lexHandler.endCDATA(); - return elEndStart; - //} - }//}else{//text area - text = text.replace(/&#?\w+;/g,entityReplacer); - domBuilder.characters(text,0,text.length); - return elEndStart; - //} - - } - } - return elStartEnd+1; -} -function fixSelfClosed(source,elStartEnd,tagName,closeMap){ - //if(tagName in closeMap){ - var pos = closeMap[tagName]; - if(pos == null){ - //console.log(tagName) - pos = source.lastIndexOf('') - if(pos',start+4); - //append comment source.substring(4,end)//',start+4); + //append comment source.substring(4,end)//Harry Potter'; - var doc = new dom().parseFromString(xml); - var nodes = xpath.select('//title', doc); - assert.equal('title', nodes[0].localName); - assert.equal('Harry Potter', nodes[0].firstChild.data); - assert.equal('Harry Potter', nodes[0].toString()); - - var nodes2 = xpath.select('//node()', doc); - assert.equal(7, nodes2.length); - - var pis = xpath.select("/processing-instruction('series')", doc); - assert.equal(2, pis.length); - assert.equal('books="7"', pis[1].data); - - test.done(); - }, - - 'select single node': function(test) { - var xml = 'Harry Potter'; - var doc = new dom().parseFromString(xml); - - assert.equal('title', xpath.select('//title[1]', doc)[0].localName); - - test.done(); - }, - - 'select text node': function (test) { - var xml = 'HarryPotter'; - var doc = new dom().parseFromString(xml); - - assert.deepEqual('book', xpath.select('local-name(/book)', doc)); - assert.deepEqual('Harry,Potter', xpath.select('//title/text()', doc).toString()); - - test.done(); - }, - - 'select number value': function(test) { - var xml = 'HarryPotter'; - var doc = new dom().parseFromString(xml); - - assert.deepEqual(2, xpath.select('count(//title)', doc)); - - test.done(); - }, - - 'select xpath with namespaces': function (test) { - var xml = 'Harry Potter'; - var doc = new dom().parseFromString(xml); - - var nodes = xpath.select('//*[local-name(.)="title" and namespace-uri(.)="myns"]', doc); - assert.equal('title', nodes[0].localName); - assert.equal('myns', nodes[0].namespaceURI) ; - - var nodes2 = xpath.select('/*/title', doc); - - assert.equal(0, nodes2.length); - - test.done(); - }, - - 'select xpath with namespaces, using a resolver': function (test) { - var xml = 'NarniaHarry PotterJKR'; - var doc = new dom().parseFromString(xml); - - var resolver = { - mappings: { - 'testns': 'http://example.com/test' - }, - lookupNamespaceURI: function(prefix) { - return this.mappings[prefix]; - } - } - - var nodes = xpath.selectWithResolver('//testns:title/text()', doc, resolver); - assert.equal('Harry Potter', xpath.selectWithResolver('//testns:title/text()', doc, resolver)[0].nodeValue); - assert.equal('JKR', xpath.selectWithResolver('//testns:field[@testns:type="author"]/text()', doc, resolver)[0].nodeValue); - - var nodes2 = xpath.selectWithResolver('/*/testns:*', doc, resolver); - - assert.equal(2, nodes2.length); - - test.done(); - }, - - 'select xpath with default namespace, using a resolver': function (test) { - var xml = 'Harry PotterJKR'; - var doc = new dom().parseFromString(xml); - - var resolver = { - mappings: { - 'testns': 'http://example.com/test' - }, - lookupNamespaceURI: function(prefix) { - return this.mappings[prefix]; - } - } - - var nodes = xpath.selectWithResolver('//testns:title/text()', doc, resolver); - assert.equal('Harry Potter', xpath.selectWithResolver('//testns:title/text()', doc, resolver)[0].nodeValue); - assert.equal('JKR', xpath.selectWithResolver('//testns:field[@type="author"]/text()', doc, resolver)[0].nodeValue); - - test.done(); - }, - - 'select xpath with namespaces, prefixes different in xml and xpath, using a resolver': function (test) { - var xml = 'Harry PotterJKR'; - var doc = new dom().parseFromString(xml); - - var resolver = { - mappings: { - 'ns': 'http://example.com/test' - }, - lookupNamespaceURI: function(prefix) { - return this.mappings[prefix]; - } - } - - var nodes = xpath.selectWithResolver('//ns:title/text()', doc, resolver); - assert.equal('Harry Potter', xpath.selectWithResolver('//ns:title/text()', doc, resolver)[0].nodeValue); - assert.equal('JKR', xpath.selectWithResolver('//ns:field[@ns:type="author"]/text()', doc, resolver)[0].nodeValue); - - test.done(); - }, - - 'select xpath with namespaces, using namespace mappings': function (test) { - var xml = 'Harry PotterJKR'; - var doc = new dom().parseFromString(xml); - var select = xpath.useNamespaces({'testns': 'http://example.com/test'}); - - assert.equal('Harry Potter', select('//testns:title/text()', doc)[0].nodeValue); - assert.equal('JKR', select('//testns:field[@testns:type="author"]/text()', doc)[0].nodeValue); - - test.done(); - }, - - - 'select attribute': function (test) { - var xml = ''; - var doc = new dom().parseFromString(xml); - - var author = xpath.select1('/author/@name', doc).value; - assert.equal('J. K. Rowling', author); - - test.done(); - } - - ,'select with multiple predicates': function (test) { - var xml = ''; - var doc = new dom().parseFromString(xml); - - var characters = xpath.select('/*/character[@sex = "M"][@age > 40]/@name', doc); - - assert.equal(1, characters.length); - assert.equal('Snape', characters[0].textContent); - - test.done(); - } - - // https://github.com/goto100/xpath/issues/37 - ,'select multiple attributes': function (test) { - var xml = ''; - var doc = new dom().parseFromString(xml); - - var authors = xpath.select('/authors/author/@name', doc); - assert.equal(2, authors.length); - assert.equal('J. K. Rowling', authors[0].value); - - // https://github.com/goto100/xpath/issues/41 - doc = new dom().parseFromString(''); - var nodes = xpath.select("/chapters/chapter/@v", doc); - var values = nodes.map(function(n) { return n.value; }); - - assert.equal(3, values.length); - assert.equal("1", values[0]); - assert.equal("2", values[1]); - assert.equal("3", values[2]); - - test.done(); - } - - ,'XPathException acts like Error': function (test) { - try { - xpath.evaluate('1', null, null, null); - assert.fail(null, null, 'evaluate() should throw exception'); - } catch (e) { - assert.ok('code' in e, 'must have a code'); - assert.ok('stack' in e, 'must have a stack'); - } - - test.done(); - }, - - 'string() with no arguments': function (test) { - var doc = new dom().parseFromString('Harry Potter'); - - var rootElement = xpath.select1('/book', doc); - assert.ok(rootElement, 'rootElement is null'); - - assert.equal('Harry Potter', xpath.select1('string()', doc)); - - test.done(); - }, - - 'string value of document fragment': function (test) { - var doc = new dom().parseFromString(''); - var docFragment = doc.createDocumentFragment(); - - var el = doc.createElement("book"); - docFragment.appendChild(el); - - var testValue = "Harry Potter"; - - el.appendChild(doc.createTextNode(testValue)); - - assert.equal(testValue, xpath.select1("string()", docFragment)); - - test.done(); - }, - - 'compare string of a number with a number': function (test) { - assert.ok(xpath.select1('"000" = 0'), '000'); - assert.ok(xpath.select1('"45.0" = 45'), '45'); - - test.done(); - }, - - 'string(boolean) is a string': function (test) { - assert.equal('string', typeof xpath.select1('string(true())')); - assert.equal('string', typeof xpath.select1('string(false())')); - assert.equal('string', typeof xpath.select1('string(1 = 2)')); - assert.ok(xpath.select1('"true" = string(true())'), '"true" = string(true())'); - - test.done(); - }, - - 'string should downcast to boolean': function (test) { - assert.equal(false, xpath.select1('"false" = false()'), '"false" = false()'); - assert.equal(true, xpath.select1('"a" = true()'), '"a" = true()'); - assert.equal(true, xpath.select1('"" = false()'), '"" = false()'); - - test.done(); - }, - - 'string(number) is a string': function (test) { - assert.equal('string', typeof xpath.select1('string(45)')); - assert.ok(xpath.select1('"45" = string(45)'), '"45" = string(45)'); - - test.done(); - }, - - 'correct string to number conversion': function (test) { - assert.equal(45.2, xpath.select1('number("45.200")')); - assert.equal(55.0, xpath.select1('number("000055")')); - assert.equal(65.0, xpath.select1('number(" 65 ")')); - - assert.equal(true, xpath.select1('"" != 0'), '"" != 0'); - assert.equal(false, xpath.select1('"" = 0'), '"" = 0'); - assert.equal(false, xpath.select1('0 = ""'), '0 = ""'); - assert.equal(false, xpath.select1('0 = " "'), '0 = " "'); - - assert.ok(Number.isNaN(xpath.select('number("")')), 'number("")'); - assert.ok(Number.isNaN(xpath.select('number("45.8g")')), 'number("45.8g")'); - assert.ok(Number.isNaN(xpath.select('number("2e9")')), 'number("2e9")'); - assert.ok(Number.isNaN(xpath.select('number("+33")')), 'number("+33")'); - - test.done(); - } - - ,'correct number to string conversion': function (test) { - assert.equal('0.0000000000000000000000005250000000000001', xpath.parse('0.525 div 1000000 div 1000000 div 1000000 div 1000000').evaluateString()); - assert.equal('525000000000000000000000', xpath.parse('0.525 * 1000000 * 1000000 * 1000000 * 1000000').evaluateString()); - - test.done(); - } - - ,'local-name() and name() of processing instruction': function (test) { - var xml = 'Harry Potter'; - var doc = new dom().parseFromString(xml); - var expectedName = 'book-record'; - var localName = xpath.select('local-name(/processing-instruction())', doc); - var name = xpath.select('name(/processing-instruction())', doc); - - assert.deepEqual(expectedName, localName, 'local-name() - "' + expectedName + '" !== "' + localName + '"'); - assert.deepEqual(expectedName, name, 'name() - "' + expectedName + '" !== "' + name + '"'); - - test.done(); - }, - - 'evaluate substring-after': function (test) { - var xml = 'Hermione'; - var doc = new dom().parseFromString(xml); - - var part = xpath.select('substring-after(/classmate, "Her")', doc); - assert.deepEqual('mione', part); - - test.done(); - } - - ,'parsed expression with no options': function (test) { - var parsed = xpath.parse('5 + 7'); - - assert.equal(typeof parsed, "object", "parse() should return an object"); - assert.equal(typeof parsed.evaluate, "function", "parsed.evaluate should be a function"); - assert.equal(typeof parsed.evaluateNumber, "function", "parsed.evaluateNumber should be a function"); - - assert.equal(parsed.evaluateNumber(), 12); - - // evaluating twice should yield the same result - assert.equal(parsed.evaluateNumber(), 12); - - test.done(); - } - - ,'select1() on parsed expression': function (test) { - var xml = 'Harry Potter'; - var doc = new dom().parseFromString(xml); - var parsed = xpath.parse('/*/title'); - - assert.equal(typeof parsed, 'object', 'parse() should return an object'); - - assert.equal(typeof parsed.select1, 'function', 'parsed.select1 should be a function'); - - var single = parsed.select1({ node: doc }); - - assert.equal('title', single.localName); - assert.equal('Harry Potter', single.firstChild.data); - assert.equal('Harry Potter', single.toString()); - - test.done(); - } - - ,'select() on parsed expression': function (test) { - var xml = 'Harry Potter'; - var doc = new dom().parseFromString(xml); - var parsed = xpath.parse('/*/title'); - - assert.equal(typeof parsed, 'object', 'parse() should return an object'); - - assert.equal(typeof parsed.select, 'function', 'parsed.select should be a function'); - - var nodes = parsed.select({ node: doc }); - - assert.ok(nodes, 'parsed.select() should return a value'); - assert.equal(1, nodes.length); - assert.equal('title', nodes[0].localName); - assert.equal('Harry Potter', nodes[0].firstChild.data); - assert.equal('Harry Potter', nodes[0].toString()); - - test.done(); - } - - ,'evaluateString(), and evaluateNumber() on parsed expression with node': function (test) { - var xml = 'Harry Potter7'; - var doc = new dom().parseFromString(xml); - var parsed = xpath.parse('/*/numVolumes'); - - assert.equal(typeof parsed, 'object', 'parse() should return an object'); - - assert.equal(typeof parsed.evaluateString, 'function', 'parsed.evaluateString should be a function'); - assert.equal('7', parsed.evaluateString({ node: doc })); - - assert.equal(typeof parsed.evaluateBoolean, 'function', 'parsed.evaluateBoolean should be a function'); - assert.equal(true, parsed.evaluateBoolean({ node: doc })); - - assert.equal(typeof parsed.evaluateNumber, 'function', 'parsed.evaluateNumber should be a function'); - assert.equal(7, parsed.evaluateNumber({ node: doc })); - - test.done(); - } - - ,'evaluateBoolean() on parsed empty node set and boolean expressions': function (test) { - var xml = 'Harry Potter'; - var doc = new dom().parseFromString(xml); - var context = { node: doc }; - - function evaluate(path) { - return xpath.parse(path).evaluateBoolean({ node: doc }); - } - - assert.equal(false, evaluate('/*/myrtle'), 'boolean value of empty node set should be false'); - - assert.equal(true, evaluate('not(/*/myrtle)'), 'not() of empty nodeset should be true'); - - assert.equal(true, evaluate('/*/title'), 'boolean value of non-empty nodeset should be true'); - - assert.equal(true, evaluate('/*/title = "Harry Potter"'), 'title equals Harry Potter'); - - assert.equal(false, evaluate('/*/title != "Harry Potter"'), 'title != Harry Potter should be false'); - - assert.equal(false, evaluate('/*/title = "Percy Jackson"'), 'title should not equal Percy Jackson'); - - test.done(); - } - - ,'namespaces with parsed expression': function (test) { - var xml = '' + - 'QuirrellFluffy' + - 'MyrtleTom Riddle' + - ''; - var doc = new dom().parseFromString(xml); - - var expr = xpath.parse('/characters/c:character'); - var countExpr = xpath.parse('count(/characters/c:character)'); - var csns = 'http://chamber-secrets.com'; - - function resolve(prefix) { - if (prefix === 'c') { - return csns; - } - } - - function testContext(context, description) { - try { - var value = expr.evaluateString(context); - var count = countExpr.evaluateNumber(context); - - assert.equal('Myrtle', value, description + ' - string value - ' + value); - assert.equal(2, count, description + ' map - count - ' + count); - } catch(e) { - e.message = description + ': ' + (e.message || ''); - throw e; - } - } - - testContext({ - node: doc, - namespaces: { - c: csns - } - }, 'Namespace map'); - - testContext({ - node: doc, - namespaces: resolve - }, 'Namespace function'); - - testContext({ - node: doc, - namespaces: { - getNamespace: resolve - } - }, 'Namespace object'); - - test.done(); - } - - ,'custom functions': function (test) { - var xml = 'Harry Potter'; - var doc = new dom().parseFromString(xml); - - var parsed = xpath.parse('concat(double(/*/title), " is cool")'); - - function doubleString(context, value) { - assert.equal(2, arguments.length); - var str = value.stringValue(); - return str + str; - } - - function functions(name, namespace) { - if(name === 'double') { - return doubleString; - } - return null; - } - - function testContext(context, description) { - try{ - var actual = parsed.evaluateString(context); - var expected = 'Harry PotterHarry Potter is cool'; - assert.equal(expected, actual, description + ' - ' + expected + ' != ' + actual); - } catch (e) { - e.message = description + ": " + (e.message || ''); - throw e; - } - } - - testContext({ - node: doc, - functions: functions - }, 'Functions function'); - - testContext({ - node: doc, - functions: { - getFunction: functions - } - }, 'Functions object'); - - testContext({ - node: doc, - functions: { - double: doubleString - } - }, 'Functions map'); - - test.done(); - } - - ,'custom function namespaces': function (test) { - var xml = 'Harry PotterRonHermioneNeville'; - var doc = new dom().parseFromString(xml); - - var parsed = xpath.parse('concat(hp:double(/*/title), " is 2 cool ", hp:square(2), " school")'); - var hpns = 'http://harry-potter.com'; - - var namespaces = { - hp: hpns - }; - - var context = { - node: doc, - namespaces: { - hp: hpns - }, - functions: function (name, namespace) { - if (namespace === hpns) { - switch (name) { - case "double": - return function (context, value) { - assert.equal(2, arguments.length); - var str = value.stringValue(); - return str + str; - }; - case "square": - return function (context, value) { - var num = value.numberValue(); - return num * num; - }; - - case "xor": - return function (context, l, r) { - assert.equal(3, arguments.length); - var lbool = l.booleanValue(); - var rbool = r.booleanValue(); - return (lbool || rbool) && !(lbool && rbool); - }; - - case "second": - return function (context, nodes) { - var nodesArr = nodes.toArray(); - var second = nodesArr[1]; - return second ? [second] : []; - }; - } - } - return null; - } - }; - - assert.equal('Harry PotterHarry Potter is 2 cool 4 school', parsed.evaluateString(context)); - - assert.equal(false, xpath.parse('hp:xor(false(), false())').evaluateBoolean(context)); - assert.equal(true, xpath.parse('hp:xor(false(), true())').evaluateBoolean(context)); - assert.equal(true, xpath.parse('hp:xor(true(), false())').evaluateBoolean(context)); - assert.equal(false, xpath.parse('hp:xor(true(), true())').evaluateBoolean(context)); - - assert.equal('Hermione', xpath.parse('hp:second(/*/friend)').evaluateString(context)); - assert.equal(1, xpath.parse('count(hp:second(/*/friend))').evaluateNumber(context)); - assert.equal(0, xpath.parse('count(hp:second(/*/friendz))').evaluateNumber(context)); - - test.done(); - } - - ,'xpath variables': function (test) { - var xml = 'Harry Potter7'; - var doc = new dom().parseFromString(xml); - - var variables = { - title: 'Harry Potter', - notTitle: 'Percy Jackson', - houses: 4 - }; - - function variableFunction(name) { - return variables[name]; - } - - function testContext(context, description) { - try{ - assert.equal(true, xpath.parse('$title = /*/title').evaluateBoolean(context)); - assert.equal(false, xpath.parse('$notTitle = /*/title').evaluateBoolean(context)); - assert.equal(11, xpath.parse('$houses + /*/volumes').evaluateNumber(context)); - } catch (e) { - e.message = description + ": " + (e.message || ''); - throw e; - } - } - - testContext({ - node: doc, - variables: variableFunction - }, 'Variables function'); - - testContext({ - node: doc, - variables: { - getVariable: variableFunction - } - }, 'Variables object'); - - testContext({ - node: doc, - variables: variables - }, 'Variables map'); - - test.done(); - } - - ,'xpath variable namespaces': function (test) { - var xml = 'Harry Potter7'; - var doc = new dom().parseFromString(xml); - var hpns = 'http://harry-potter.com'; - - var context = { - node: doc, - namespaces: { - hp: hpns - }, - variables: function(name, namespace) { - if (namespace === hpns) { - switch (name) { - case 'title': return 'Harry Potter'; - case 'houses': return 4; - case 'false': return false; - case 'falseStr': return 'false'; - } - } else if (namespace === '') { - switch (name) { - case 'title': return 'World'; - } - } - - return null; - } - }; - - assert.equal(true, xpath.parse('$hp:title = /*/title').evaluateBoolean(context)); - assert.equal(false, xpath.parse('$title = /*/title').evaluateBoolean(context)); - assert.equal('World', xpath.parse('$title').evaluateString(context)); - assert.equal(false, xpath.parse('$hp:false').evaluateBoolean(context)); - assert.notEqual(false, xpath.parse('$hp:falseStr').evaluateBoolean(context)); - assert.throws(function () { - xpath.parse('$hp:hello').evaluateString(context); - }, function (err) { - return err.message === 'Undeclared variable: $hp:hello'; - }); - - test.done(); - } - - ,"detect unterminated string literals": function (test) { - function testUnterminated(path) { - assert.throws(function () { - xpath.evaluate('"hello'); - }, function (err) { - return err.message.indexOf('Unterminated') !== -1; - }); - } - - testUnterminated('"Hello'); - testUnterminated("'Hello"); - testUnterminated('self::text() = "\""'); - testUnterminated('"\""'); - - test.done(); - } - - ,"string value for CDATA sections": function (test) { - var xml = "Ron ", - doc = new dom().parseFromString(xml), - person1 = xpath.parse("/people/person").evaluateString({ node: doc }), - person2 = xpath.parse("/people/person/text()").evaluateString({ node: doc }), - person3 = xpath.select("string(/people/person/text())", doc); - person4 = xpath.parse("/people/person[2]").evaluateString({ node: doc }); - - assert.equal(person1, 'Harry Potter'); - assert.equal(person2, 'Harry Potter'); - assert.equal(person3, 'Harry Potter'); - assert.equal(person4, 'Ron Weasley'); - - test.done(); - } - - ,"string value of various node types": function (test) { - var xml = "<![CDATA[Harry Potter & the Philosopher's Stone]]>Harry Potter", - doc = new dom().parseFromString(xml), - allText = xpath.parse('.').evaluateString({ node: doc }), - ns = xpath.parse('*/namespace::*[name() = "hp"]').evaluateString({ node: doc }), - title = xpath.parse('*/title').evaluateString({ node: doc }), - child = xpath.parse('*/*').evaluateString({ node: doc }), - titleLang = xpath.parse('*/*/@lang').evaluateString({ node: doc }), - pi = xpath.parse('*/processing-instruction()').evaluateString({ node: doc }), - comment = xpath.parse('*/comment()').evaluateString({ node: doc }); - - assert.equal(allText, "Harry Potter & the Philosopher's StoneHarry Potter"); - assert.equal(ns, 'http://harry'); - assert.equal(title, "Harry Potter & the Philosopher's Stone"); - assert.equal(child, "Harry Potter & the Philosopher's Stone"); - assert.equal(titleLang, 'en'); - assert.equal(pi.trim(), "name='J.K. Rowling'"); - assert.equal(comment, ' This describes the Harry Potter Book '); - - test.done(); - } - - ,"exposes custom types": function (test) { - assert.ok(xpath.XPath, "xpath.XPath"); - assert.ok(xpath.XPathParser, "xpath.XPathParser"); - assert.ok(xpath.XPathResult, "xpath.XPathResult"); - - assert.ok(xpath.Step, "xpath.Step"); - assert.ok(xpath.NodeTest, "xpath.NodeTest"); - assert.ok(xpath.BarOperation, "xpath.BarOperation"); - - assert.ok(xpath.NamespaceResolver, "xpath.NamespaceResolver"); - assert.ok(xpath.FunctionResolver, "xpath.FunctionResolver"); - assert.ok(xpath.VariableResolver, "xpath.VariableResolver"); - - assert.ok(xpath.Utilities, "xpath.Utilities"); - - assert.ok(xpath.XPathContext, "xpath.XPathContext"); - assert.ok(xpath.XNodeSet, "xpath.XNodeSet"); - assert.ok(xpath.XBoolean, "xpath.XBoolean"); - assert.ok(xpath.XString, "xpath.XString"); - assert.ok(xpath.XNumber, "xpath.XNumber"); - - test.done(); - } - - ,"work with nodes created using DOM1 createElement()": function (test) { - var doc = new dom().parseFromString(''); - - doc.documentElement.appendChild(doc.createElement('characters')); - - assert.ok(xpath.select1('/book/characters', doc)); - - assert.equal(xpath.select1('local-name(/book/characters)', doc), 'characters'); - - test.done(); - } - - ,"preceding:: axis works on document fragments": function (test) { - var doc = new dom().parseFromString(''), - df = doc.createDocumentFragment(), - root = doc.createElement('book'); - - df.appendChild(root); - - for (var i = 0; i < 10; i += 1) { - root.appendChild(doc.createElement('chapter')); - } - - var chapter = xpath.select1("book/chapter[5]", df); - - assert.ok(chapter, 'chapter'); - - assert.equal(xpath.select("count(preceding::chapter)", chapter), 4); - - test.done(); - } - - ,"node set sorted and unsorted arrays": function (test) { - var doc = new dom().parseFromString('HarryRonHermione'), - path = xpath.parse("/*/*[3] | /*/*[2] | /*/*[1]") - nset = path.evaluateNodeSet({ node: doc }), - sorted = nset.toArray(), - unsorted = nset.toUnsortedArray(); - - assert.equal(sorted.length, 3); - assert.equal(unsorted.length, 3); - - assert.equal(sorted[0].textContent, 'Harry'); - assert.equal(sorted[1].textContent, 'Ron'); - assert.equal(sorted[2].textContent, 'Hermione'); - - assert.notEqual(sorted[0], unsorted[0], "first nodeset element equal"); - - test.done(); - } - - ,'meaningful error for invalid function': function(test) { - var path = xpath.parse('invalidFunc()'); - - assert.throws(function () { - path.evaluateString(); - }, function (err) { - return err.message.indexOf('invalidFunc') !== -1; - }); - - var path2 = xpath.parse('funcs:invalidFunc()'); - - assert.throws(function () { - path2.evaluateString({ - namespaces: { - funcs: 'myfunctions' - } - }); - }, function (err) { - return err.message.indexOf('invalidFunc') !== -1; - }); - - test.done(); - } - - // https://github.com/goto100/xpath/issues/32 - ,'supports contains() function on attributes': function (test) { - var doc = new dom().parseFromString(""), - andTheBooks = xpath.select("/books/book[contains(@title, ' ')]", doc), - secretBooks = xpath.select("/books/book[contains(@title, 'Secrets')]", doc); - - assert.equal(andTheBooks.length, 2); - assert.equal(secretBooks.length, 1); - - test.done(); - } - - ,'compare multiple nodes to multiple nodes (equals)': function (test) { - var xml = '' + - 'HarryHermione' + - 'DracoCrabbe' + - 'LunaCho' + - '' + - 'HermioneLuna'; - - var doc = new dom().parseFromString(xml); - var houses = xpath.parse('/school/houses/house[student = /school/honorStudents/student]').select({ node: doc }); - - assert.equal(houses.length, 2); - - var houseNames = houses.map(function (node) { return node.getAttribute('name'); }).sort(); - - assert.equal(houseNames[0], 'Gryffindor'); - assert.equal(houseNames[1], 'Ravenclaw'); - - test.done(); - } - - ,'compare multiple nodes to multiple nodes (gte)': function (test) { - var xml = '' + - 'HarryHermione' + - 'GoyleCrabbe' + - 'LunaCho' + - '' + - 'DADACharms' + - ''; - - var doc = new dom().parseFromString(xml); - var houses = xpath.parse('/school/houses/house[student/@level >= /school/courses/course/@minLevel]').select({ node: doc }); - - assert.equal(houses.length, 2); - - var houseNames = houses.map(function (node) { return node.getAttribute('name'); }).sort(); - - assert.equal(houseNames[0], 'Gryffindor'); - assert.equal(houseNames[1], 'Ravenclaw'); - - test.done(); - } - - ,'inequality comparisons with nodesets': function (test) { - var xml = ""; - var doc = new dom().parseFromString(xml); - - var options = { node: doc, variables: { theNumber: 3, theString: '3', theBoolean: true }}; - - var numberPaths = [ - '/books/book[$theNumber <= @num]', - '/books/book[$theNumber < @num]', - '/books/book[$theNumber >= @num]', - '/books/book[$theNumber > @num]' - ]; - - var stringPaths = [ - '/books/book[$theString <= @num]', - '/books/book[$theString < @num]', - '/books/book[$theString >= @num]', - '/books/book[$theString > @num]' - ]; - - var booleanPaths = [ - '/books/book[$theBoolean <= @num]', - '/books/book[$theBoolean < @num]', - '/books/book[$theBoolean >= @num]', - '/books/book[$theBoolean > @num]' - ]; - - var lhsPaths = [ - '/books/book[@num <= $theNumber]', - '/books/book[@num < $theNumber]' - ]; - - function countNodes(paths){ - return paths - .map(xpath.parse) - .map(function (path) { return path.select(options) }) - .map(function (arr) { return arr.length; }); - } - - assert.deepEqual(countNodes(numberPaths), [5, 4, 3, 2], 'numbers'); - assert.deepEqual(countNodes(stringPaths), [5, 4, 3, 2], 'strings'); - assert.deepEqual(countNodes(booleanPaths), [7, 6, 1, 0], 'numbers'); - assert.deepEqual(countNodes(lhsPaths), [3, 2], 'lhs'); - - test.done(); - } - - ,'error when evaluating boolean as number': function (test) { - var num = xpath.parse('"a" = "b"').evaluateNumber(); - - assert.equal(num, 0); - - var str = xpath.select('substring("expelliarmus", 1, "a" = "a")'); - - assert.equal(str, 'e'); - - test.done(); - } - - ,'string values of parsed expressions': function (test) { - var parser = new xpath.XPathParser(); - - var simpleStep = parser.parse('my:book'); - - assert.equal(simpleStep.toString(), 'child::my:book'); - - var precedingSib = parser.parse('preceding-sibling::my:chapter'); - - assert.equal(precedingSib.toString(), 'preceding-sibling::my:chapter'); - - var withPredicates = parser.parse('book[number > 3][contains(title, "and the")]'); - - assert.equal(withPredicates.toString(), "child::book[(child::number > 3)][contains(child::title, 'and the')]"); - - var parenthesisWithPredicate = parser.parse('(/books/book/chapter)[7]'); - - assert.equal(parenthesisWithPredicate.toString(), '(/child::books/child::book/child::chapter)[7]'); - - var charactersOver20 = parser.parse('heroes[age > 20] | villains[age > 20]'); - - assert.equal(charactersOver20.toString(), 'child::heroes[(child::age > 20)] | child::villains[(child::age > 20)]'); - - test.done(); - } - - ,'context position should work correctly': function (test) { - var doc = new dom().parseFromString("The boy who livedThe vanishing glassThe worst birthdayDobby's warningThe burrow"); - - var chapters = xpath.parse('/books/book/chapter[2]').select({ node: doc }); - - assert.equal(2, chapters.length); - assert.equal('The vanishing glass', chapters[0].textContent); - assert.equal("Dobby's warning", chapters[1].textContent); - - var lastChapters = xpath.parse('/books/book/chapter[last()]').select({ node: doc }); - - assert.equal(2, lastChapters.length); - assert.equal('The vanishing glass', lastChapters[0].textContent); - assert.equal("The burrow", lastChapters[1].textContent); - - var secondChapter = xpath.parse('(/books/book/chapter)[2]').select({ node: doc }); - - assert.equal(1, secondChapter.length); - assert.equal('The vanishing glass', chapters[0].textContent); - - var lastChapter = xpath.parse('(/books/book/chapter)[last()]').select({ node: doc }); - - assert.equal(1, lastChapter.length); - assert.equal("The burrow", lastChapter[0].textContent); - - - test.done(); - } - - ,'should allow null namespaces for null prefixes': function (test) { - var markup = '

Hi Ron!

Hi Draco!

Hi Hermione!

'; - var docHtml = new dom().parseFromString(markup, 'text/html'); - - var noPrefixPath = xpath.parse('/html/body/p[2]'); - - var greetings1 = noPrefixPath.select({ node: docHtml, allowAnyNamespaceForNoPrefix: false }); - - assert.equal(0, greetings1.length); - - var allowAnyNamespaceOptions = { node: docHtml, allowAnyNamespaceForNoPrefix: true }; - - // if allowAnyNamespaceForNoPrefix specified, allow using prefix-less node tests to match nodes with no prefix - var greetings2 = noPrefixPath.select(allowAnyNamespaceOptions); - - assert.equal(1, greetings2.length); - assert.equal('Hi Hermione!', greetings2[0].textContent); - - var allGreetings = xpath.parse('/html/body/p').select(allowAnyNamespaceOptions); - - assert.equal(2, allGreetings.length); - - var nsm = { html: xhtmlNs, other: 'http://www.example.com/other' }; - - var prefixPath = xpath.parse('/html:html/body/html:p'); - var optionsWithNamespaces = { node: docHtml, allowAnyNamespaceForNoPrefix: true, namespaces: nsm }; - - // if the path uses prefixes, they have to match - var greetings3 = prefixPath.select(optionsWithNamespaces); - - assert.equal(2, greetings3.length); - - var badPrefixPath = xpath.parse('/html:html/other:body/html:p'); - - var greetings4 = badPrefixPath.select(optionsWithNamespaces); - - test.done(); - } - - ,'support isHtml option' : function (test){ - var markup = '

Hi Ron!

Hi Draco!

Hi Hermione!

'; - var docHtml = new dom().parseFromString(markup, 'text/html'); - - var ns = { h: xhtmlNs }; - - // allow matching on unprefixed nodes - var greetings1 = xpath.parse('/html/body/p').select({ node: docHtml, isHtml: true }); - - assert.equal(2, greetings1.length); - - // allow case insensitive match - var greetings2 = xpath.parse('/h:html/h:bOdY/h:p').select({ node: docHtml, namespaces: ns, isHtml: true }); - - assert.equal(2, greetings2.length); - - // non-html mode: allow select if case and namespaces match - var greetings3 = xpath.parse('/h:html/h:body/h:p').select({ node: docHtml, namespaces: ns }); - - assert.equal(2, greetings3.length); - - // non-html mode: require namespaces - var greetings4 = xpath.parse('/html/body/p').select({ node: docHtml, namespaces: ns }); - - assert.equal(0, greetings4.length); - - // non-html mode: require case to match - var greetings5 = xpath.parse('/h:html/h:bOdY/h:p').select({ node: docHtml, namespaces: ns }); - - assert.equal(0, greetings5.length); - - test.done(); - } - - ,"builtin functions": function (test) { - var translated = xpath.parse('translate("hello", "lhho", "yHb")').evaluateString(); - - assert.equal('Heyy', translated); - - var characters = new dom().parseFromString('HarryRonHermione'); - - var firstTwo = xpath.parse('/characters/character[position() <= 2]').select({ node: characters }); - - assert.equal(2, firstTwo.length); - assert.equal('Harry', firstTwo[0].textContent); - assert.equal('Ron', firstTwo[1].textContent); - - var last = xpath.parse('/characters/character[last()]').select({ node: characters }); - - assert.equal(1, last.length); - assert.equal('Hermione', last[0].textContent); - - test.done(); - } -} +var xpath = require('./xpath.js') +, dom = require('xmldom').DOMParser +, assert = require('assert'); + +var xhtmlNs = 'http://www.w3.org/1999/xhtml'; + +module.exports = { + 'api': function(test) { + assert.ok(xpath.evaluate, 'evaluate api ok.'); + assert.ok(xpath.select, 'select api ok.'); + assert.ok(xpath.parse, 'parse api ok.'); + test.done(); + }, + + 'evaluate': function(test) { + var xml = 'Harry Potter'; + var doc = new dom().parseFromString(xml); + var nodes = xpath.evaluate('//title', doc, null, xpath.XPathResult.ANY_TYPE, null).nodes; + assert.equal('title', nodes[0].localName); + assert.equal('Harry Potter', nodes[0].firstChild.data); + assert.equal('Harry Potter', nodes[0].toString()); + test.done(); + }, + + 'select': function(test) { + var xml = 'Harry Potter'; + var doc = new dom().parseFromString(xml); + var nodes = xpath.select('//title', doc); + assert.equal('title', nodes[0].localName); + assert.equal('Harry Potter', nodes[0].firstChild.data); + assert.equal('Harry Potter', nodes[0].toString()); + + var nodes2 = xpath.select('//node()', doc); + assert.equal(7, nodes2.length); + + var pis = xpath.select("/processing-instruction('series')", doc); + assert.equal(2, pis.length); + assert.equal('books="7"', pis[1].data); + + test.done(); + }, + + 'select single node': function(test) { + var xml = 'Harry Potter'; + var doc = new dom().parseFromString(xml); + + assert.equal('title', xpath.select('//title[1]', doc)[0].localName); + + test.done(); + }, + + 'select text node': function (test) { + var xml = 'HarryPotter'; + var doc = new dom().parseFromString(xml); + + assert.deepEqual('book', xpath.select('local-name(/book)', doc)); + assert.deepEqual('Harry,Potter', xpath.select('//title/text()', doc).toString()); + + test.done(); + }, + + 'select number value': function(test) { + var xml = 'HarryPotter'; + var doc = new dom().parseFromString(xml); + + assert.deepEqual(2, xpath.select('count(//title)', doc)); + + test.done(); + }, + + 'select xpath with namespaces': function (test) { + var xml = 'Harry Potter'; + var doc = new dom().parseFromString(xml); + + var nodes = xpath.select('//*[local-name(.)="title" and namespace-uri(.)="myns"]', doc); + assert.equal('title', nodes[0].localName); + assert.equal('myns', nodes[0].namespaceURI) ; + + var nodes2 = xpath.select('/*/title', doc); + + assert.equal(0, nodes2.length); + + test.done(); + }, + + 'select xpath with namespaces, using a resolver': function (test) { + var xml = 'NarniaHarry PotterJKR'; + var doc = new dom().parseFromString(xml); + + var resolver = { + mappings: { + 'testns': 'http://example.com/test' + }, + lookupNamespaceURI: function(prefix) { + return this.mappings[prefix]; + } + } + + var nodes = xpath.selectWithResolver('//testns:title/text()', doc, resolver); + assert.equal('Harry Potter', xpath.selectWithResolver('//testns:title/text()', doc, resolver)[0].nodeValue); + assert.equal('JKR', xpath.selectWithResolver('//testns:field[@testns:type="author"]/text()', doc, resolver)[0].nodeValue); + + var nodes2 = xpath.selectWithResolver('/*/testns:*', doc, resolver); + + assert.equal(2, nodes2.length); + + test.done(); + }, + + 'select xpath with default namespace, using a resolver': function (test) { + var xml = 'Harry PotterJKR'; + var doc = new dom().parseFromString(xml); + + var resolver = { + mappings: { + 'testns': 'http://example.com/test' + }, + lookupNamespaceURI: function(prefix) { + return this.mappings[prefix]; + } + } + + var nodes = xpath.selectWithResolver('//testns:title/text()', doc, resolver); + assert.equal('Harry Potter', xpath.selectWithResolver('//testns:title/text()', doc, resolver)[0].nodeValue); + assert.equal('JKR', xpath.selectWithResolver('//testns:field[@type="author"]/text()', doc, resolver)[0].nodeValue); + + test.done(); + }, + + 'select xpath with namespaces, prefixes different in xml and xpath, using a resolver': function (test) { + var xml = 'Harry PotterJKR'; + var doc = new dom().parseFromString(xml); + + var resolver = { + mappings: { + 'ns': 'http://example.com/test' + }, + lookupNamespaceURI: function(prefix) { + return this.mappings[prefix]; + } + } + + var nodes = xpath.selectWithResolver('//ns:title/text()', doc, resolver); + assert.equal('Harry Potter', xpath.selectWithResolver('//ns:title/text()', doc, resolver)[0].nodeValue); + assert.equal('JKR', xpath.selectWithResolver('//ns:field[@ns:type="author"]/text()', doc, resolver)[0].nodeValue); + + test.done(); + }, + + 'select xpath with namespaces, using namespace mappings': function (test) { + var xml = 'Harry PotterJKR'; + var doc = new dom().parseFromString(xml); + var select = xpath.useNamespaces({'testns': 'http://example.com/test'}); + + assert.equal('Harry Potter', select('//testns:title/text()', doc)[0].nodeValue); + assert.equal('JKR', select('//testns:field[@testns:type="author"]/text()', doc)[0].nodeValue); + + test.done(); + }, + + + 'select attribute': function (test) { + var xml = ''; + var doc = new dom().parseFromString(xml); + + var author = xpath.select1('/author/@name', doc).value; + assert.equal('J. K. Rowling', author); + + test.done(); + } + + ,'select with multiple predicates': function (test) { + var xml = ''; + var doc = new dom().parseFromString(xml); + + var characters = xpath.select('/*/character[@sex = "M"][@age > 40]/@name', doc); + + assert.equal(1, characters.length); + assert.equal('Snape', characters[0].textContent); + + test.done(); + } + + // https://github.com/goto100/xpath/issues/37 + ,'select multiple attributes': function (test) { + var xml = ''; + var doc = new dom().parseFromString(xml); + + var authors = xpath.select('/authors/author/@name', doc); + assert.equal(2, authors.length); + assert.equal('J. K. Rowling', authors[0].value); + + // https://github.com/goto100/xpath/issues/41 + doc = new dom().parseFromString(''); + var nodes = xpath.select("/chapters/chapter/@v", doc); + var values = nodes.map(function(n) { return n.value; }); + + assert.equal(3, values.length); + assert.equal("1", values[0]); + assert.equal("2", values[1]); + assert.equal("3", values[2]); + + test.done(); + } + + ,'XPathException acts like Error': function (test) { + try { + xpath.evaluate('1', null, null, null); + assert.fail(null, null, 'evaluate() should throw exception'); + } catch (e) { + assert.ok('code' in e, 'must have a code'); + assert.ok('stack' in e, 'must have a stack'); + } + + test.done(); + }, + + 'string() with no arguments': function (test) { + var doc = new dom().parseFromString('Harry Potter'); + + var rootElement = xpath.select1('/book', doc); + assert.ok(rootElement, 'rootElement is null'); + + assert.equal('Harry Potter', xpath.select1('string()', doc)); + + test.done(); + }, + + 'string value of document fragment': function (test) { + var doc = new dom().parseFromString(''); + var docFragment = doc.createDocumentFragment(); + + var el = doc.createElement("book"); + docFragment.appendChild(el); + + var testValue = "Harry Potter"; + + el.appendChild(doc.createTextNode(testValue)); + + assert.equal(testValue, xpath.select1("string()", docFragment)); + + test.done(); + }, + + 'compare string of a number with a number': function (test) { + assert.ok(xpath.select1('"000" = 0'), '000'); + assert.ok(xpath.select1('"45.0" = 45'), '45'); + + test.done(); + }, + + 'string(boolean) is a string': function (test) { + assert.equal('string', typeof xpath.select1('string(true())')); + assert.equal('string', typeof xpath.select1('string(false())')); + assert.equal('string', typeof xpath.select1('string(1 = 2)')); + assert.ok(xpath.select1('"true" = string(true())'), '"true" = string(true())'); + + test.done(); + }, + + 'string should downcast to boolean': function (test) { + assert.equal(false, xpath.select1('"false" = false()'), '"false" = false()'); + assert.equal(true, xpath.select1('"a" = true()'), '"a" = true()'); + assert.equal(true, xpath.select1('"" = false()'), '"" = false()'); + + test.done(); + }, + + 'string(number) is a string': function (test) { + assert.equal('string', typeof xpath.select1('string(45)')); + assert.ok(xpath.select1('"45" = string(45)'), '"45" = string(45)'); + + test.done(); + }, + + 'correct string to number conversion': function (test) { + assert.equal(45.2, xpath.select1('number("45.200")')); + assert.equal(55.0, xpath.select1('number("000055")')); + assert.equal(65.0, xpath.select1('number(" 65 ")')); + + assert.equal(true, xpath.select1('"" != 0'), '"" != 0'); + assert.equal(false, xpath.select1('"" = 0'), '"" = 0'); + assert.equal(false, xpath.select1('0 = ""'), '0 = ""'); + assert.equal(false, xpath.select1('0 = " "'), '0 = " "'); + + assert.ok(Number.isNaN(xpath.select('number("")')), 'number("")'); + assert.ok(Number.isNaN(xpath.select('number("45.8g")')), 'number("45.8g")'); + assert.ok(Number.isNaN(xpath.select('number("2e9")')), 'number("2e9")'); + assert.ok(Number.isNaN(xpath.select('number("+33")')), 'number("+33")'); + + test.done(); + } + + ,'correct number to string conversion': function (test) { + assert.equal('0.0000000000000000000000005250000000000001', xpath.parse('0.525 div 1000000 div 1000000 div 1000000 div 1000000').evaluateString()); + assert.equal('525000000000000000000000', xpath.parse('0.525 * 1000000 * 1000000 * 1000000 * 1000000').evaluateString()); + + test.done(); + } + + ,'local-name() and name() of processing instruction': function (test) { + var xml = 'Harry Potter'; + var doc = new dom().parseFromString(xml); + var expectedName = 'book-record'; + var localName = xpath.select('local-name(/processing-instruction())', doc); + var name = xpath.select('name(/processing-instruction())', doc); + + assert.deepEqual(expectedName, localName, 'local-name() - "' + expectedName + '" !== "' + localName + '"'); + assert.deepEqual(expectedName, name, 'name() - "' + expectedName + '" !== "' + name + '"'); + + test.done(); + }, + + 'evaluate substring-after': function (test) { + var xml = 'Hermione'; + var doc = new dom().parseFromString(xml); + + var part = xpath.select('substring-after(/classmate, "Her")', doc); + assert.deepEqual('mione', part); + + test.done(); + } + + ,'parsed expression with no options': function (test) { + var parsed = xpath.parse('5 + 7'); + + assert.equal(typeof parsed, "object", "parse() should return an object"); + assert.equal(typeof parsed.evaluate, "function", "parsed.evaluate should be a function"); + assert.equal(typeof parsed.evaluateNumber, "function", "parsed.evaluateNumber should be a function"); + + assert.equal(parsed.evaluateNumber(), 12); + + // evaluating twice should yield the same result + assert.equal(parsed.evaluateNumber(), 12); + + test.done(); + } + + ,'select1() on parsed expression': function (test) { + var xml = 'Harry Potter'; + var doc = new dom().parseFromString(xml); + var parsed = xpath.parse('/*/title'); + + assert.equal(typeof parsed, 'object', 'parse() should return an object'); + + assert.equal(typeof parsed.select1, 'function', 'parsed.select1 should be a function'); + + var single = parsed.select1({ node: doc }); + + assert.equal('title', single.localName); + assert.equal('Harry Potter', single.firstChild.data); + assert.equal('Harry Potter', single.toString()); + + test.done(); + } + + ,'select() on parsed expression': function (test) { + var xml = 'Harry Potter'; + var doc = new dom().parseFromString(xml); + var parsed = xpath.parse('/*/title'); + + assert.equal(typeof parsed, 'object', 'parse() should return an object'); + + assert.equal(typeof parsed.select, 'function', 'parsed.select should be a function'); + + var nodes = parsed.select({ node: doc }); + + assert.ok(nodes, 'parsed.select() should return a value'); + assert.equal(1, nodes.length); + assert.equal('title', nodes[0].localName); + assert.equal('Harry Potter', nodes[0].firstChild.data); + assert.equal('Harry Potter', nodes[0].toString()); + + test.done(); + } + + ,'evaluateString(), and evaluateNumber() on parsed expression with node': function (test) { + var xml = 'Harry Potter7'; + var doc = new dom().parseFromString(xml); + var parsed = xpath.parse('/*/numVolumes'); + + assert.equal(typeof parsed, 'object', 'parse() should return an object'); + + assert.equal(typeof parsed.evaluateString, 'function', 'parsed.evaluateString should be a function'); + assert.equal('7', parsed.evaluateString({ node: doc })); + + assert.equal(typeof parsed.evaluateBoolean, 'function', 'parsed.evaluateBoolean should be a function'); + assert.equal(true, parsed.evaluateBoolean({ node: doc })); + + assert.equal(typeof parsed.evaluateNumber, 'function', 'parsed.evaluateNumber should be a function'); + assert.equal(7, parsed.evaluateNumber({ node: doc })); + + test.done(); + } + + ,'evaluateBoolean() on parsed empty node set and boolean expressions': function (test) { + var xml = 'Harry Potter'; + var doc = new dom().parseFromString(xml); + var context = { node: doc }; + + function evaluate(path) { + return xpath.parse(path).evaluateBoolean({ node: doc }); + } + + assert.equal(false, evaluate('/*/myrtle'), 'boolean value of empty node set should be false'); + + assert.equal(true, evaluate('not(/*/myrtle)'), 'not() of empty nodeset should be true'); + + assert.equal(true, evaluate('/*/title'), 'boolean value of non-empty nodeset should be true'); + + assert.equal(true, evaluate('/*/title = "Harry Potter"'), 'title equals Harry Potter'); + + assert.equal(false, evaluate('/*/title != "Harry Potter"'), 'title != Harry Potter should be false'); + + assert.equal(false, evaluate('/*/title = "Percy Jackson"'), 'title should not equal Percy Jackson'); + + test.done(); + } + + ,'namespaces with parsed expression': function (test) { + var xml = '' + + 'QuirrellFluffy' + + 'MyrtleTom Riddle' + + ''; + var doc = new dom().parseFromString(xml); + + var expr = xpath.parse('/characters/c:character'); + var countExpr = xpath.parse('count(/characters/c:character)'); + var csns = 'http://chamber-secrets.com'; + + function resolve(prefix) { + if (prefix === 'c') { + return csns; + } + } + + function testContext(context, description) { + try { + var value = expr.evaluateString(context); + var count = countExpr.evaluateNumber(context); + + assert.equal('Myrtle', value, description + ' - string value - ' + value); + assert.equal(2, count, description + ' map - count - ' + count); + } catch(e) { + e.message = description + ': ' + (e.message || ''); + throw e; + } + } + + testContext({ + node: doc, + namespaces: { + c: csns + } + }, 'Namespace map'); + + testContext({ + node: doc, + namespaces: resolve + }, 'Namespace function'); + + testContext({ + node: doc, + namespaces: { + getNamespace: resolve + } + }, 'Namespace object'); + + test.done(); + } + + ,'custom functions': function (test) { + var xml = 'Harry Potter'; + var doc = new dom().parseFromString(xml); + + var parsed = xpath.parse('concat(double(/*/title), " is cool")'); + + function doubleString(context, value) { + assert.equal(2, arguments.length); + var str = value.stringValue(); + return str + str; + } + + function functions(name, namespace) { + if(name === 'double') { + return doubleString; + } + return null; + } + + function testContext(context, description) { + try{ + var actual = parsed.evaluateString(context); + var expected = 'Harry PotterHarry Potter is cool'; + assert.equal(expected, actual, description + ' - ' + expected + ' != ' + actual); + } catch (e) { + e.message = description + ": " + (e.message || ''); + throw e; + } + } + + testContext({ + node: doc, + functions: functions + }, 'Functions function'); + + testContext({ + node: doc, + functions: { + getFunction: functions + } + }, 'Functions object'); + + testContext({ + node: doc, + functions: { + double: doubleString + } + }, 'Functions map'); + + test.done(); + } + + ,'custom function namespaces': function (test) { + var xml = 'Harry PotterRonHermioneNeville'; + var doc = new dom().parseFromString(xml); + + var parsed = xpath.parse('concat(hp:double(/*/title), " is 2 cool ", hp:square(2), " school")'); + var hpns = 'http://harry-potter.com'; + + var namespaces = { + hp: hpns + }; + + var context = { + node: doc, + namespaces: { + hp: hpns + }, + functions: function (name, namespace) { + if (namespace === hpns) { + switch (name) { + case "double": + return function (context, value) { + assert.equal(2, arguments.length); + var str = value.stringValue(); + return str + str; + }; + case "square": + return function (context, value) { + var num = value.numberValue(); + return num * num; + }; + + case "xor": + return function (context, l, r) { + assert.equal(3, arguments.length); + var lbool = l.booleanValue(); + var rbool = r.booleanValue(); + return (lbool || rbool) && !(lbool && rbool); + }; + + case "second": + return function (context, nodes) { + var nodesArr = nodes.toArray(); + var second = nodesArr[1]; + return second ? [second] : []; + }; + } + } + return null; + } + }; + + assert.equal('Harry PotterHarry Potter is 2 cool 4 school', parsed.evaluateString(context)); + + assert.equal(false, xpath.parse('hp:xor(false(), false())').evaluateBoolean(context)); + assert.equal(true, xpath.parse('hp:xor(false(), true())').evaluateBoolean(context)); + assert.equal(true, xpath.parse('hp:xor(true(), false())').evaluateBoolean(context)); + assert.equal(false, xpath.parse('hp:xor(true(), true())').evaluateBoolean(context)); + + assert.equal('Hermione', xpath.parse('hp:second(/*/friend)').evaluateString(context)); + assert.equal(1, xpath.parse('count(hp:second(/*/friend))').evaluateNumber(context)); + assert.equal(0, xpath.parse('count(hp:second(/*/friendz))').evaluateNumber(context)); + + test.done(); + } + + ,'xpath variables': function (test) { + var xml = 'Harry Potter7'; + var doc = new dom().parseFromString(xml); + + var variables = { + title: 'Harry Potter', + notTitle: 'Percy Jackson', + houses: 4 + }; + + function variableFunction(name) { + return variables[name]; + } + + function testContext(context, description) { + try{ + assert.equal(true, xpath.parse('$title = /*/title').evaluateBoolean(context)); + assert.equal(false, xpath.parse('$notTitle = /*/title').evaluateBoolean(context)); + assert.equal(11, xpath.parse('$houses + /*/volumes').evaluateNumber(context)); + } catch (e) { + e.message = description + ": " + (e.message || ''); + throw e; + } + } + + testContext({ + node: doc, + variables: variableFunction + }, 'Variables function'); + + testContext({ + node: doc, + variables: { + getVariable: variableFunction + } + }, 'Variables object'); + + testContext({ + node: doc, + variables: variables + }, 'Variables map'); + + test.done(); + } + + ,'xpath variable namespaces': function (test) { + var xml = 'Harry Potter7'; + var doc = new dom().parseFromString(xml); + var hpns = 'http://harry-potter.com'; + + var context = { + node: doc, + namespaces: { + hp: hpns + }, + variables: function(name, namespace) { + if (namespace === hpns) { + switch (name) { + case 'title': return 'Harry Potter'; + case 'houses': return 4; + case 'false': return false; + case 'falseStr': return 'false'; + } + } else if (namespace === '') { + switch (name) { + case 'title': return 'World'; + } + } + + return null; + } + }; + + assert.equal(true, xpath.parse('$hp:title = /*/title').evaluateBoolean(context)); + assert.equal(false, xpath.parse('$title = /*/title').evaluateBoolean(context)); + assert.equal('World', xpath.parse('$title').evaluateString(context)); + assert.equal(false, xpath.parse('$hp:false').evaluateBoolean(context)); + assert.notEqual(false, xpath.parse('$hp:falseStr').evaluateBoolean(context)); + assert.throws(function () { + xpath.parse('$hp:hello').evaluateString(context); + }, function (err) { + return err.message === 'Undeclared variable: $hp:hello'; + }); + + test.done(); + } + + ,"detect unterminated string literals": function (test) { + function testUnterminated(path) { + assert.throws(function () { + xpath.evaluate('"hello'); + }, function (err) { + return err.message.indexOf('Unterminated') !== -1; + }); + } + + testUnterminated('"Hello'); + testUnterminated("'Hello"); + testUnterminated('self::text() = "\""'); + testUnterminated('"\""'); + + test.done(); + } + + ,"string value for CDATA sections": function (test) { + var xml = "Ron ", + doc = new dom().parseFromString(xml), + person1 = xpath.parse("/people/person").evaluateString({ node: doc }), + person2 = xpath.parse("/people/person/text()").evaluateString({ node: doc }), + person3 = xpath.select("string(/people/person/text())", doc); + person4 = xpath.parse("/people/person[2]").evaluateString({ node: doc }); + + assert.equal(person1, 'Harry Potter'); + assert.equal(person2, 'Harry Potter'); + assert.equal(person3, 'Harry Potter'); + assert.equal(person4, 'Ron Weasley'); + + test.done(); + } + + ,"string value of various node types": function (test) { + var xml = "<![CDATA[Harry Potter & the Philosopher's Stone]]>Harry Potter", + doc = new dom().parseFromString(xml), + allText = xpath.parse('.').evaluateString({ node: doc }), + ns = xpath.parse('*/namespace::*[name() = "hp"]').evaluateString({ node: doc }), + title = xpath.parse('*/title').evaluateString({ node: doc }), + child = xpath.parse('*/*').evaluateString({ node: doc }), + titleLang = xpath.parse('*/*/@lang').evaluateString({ node: doc }), + pi = xpath.parse('*/processing-instruction()').evaluateString({ node: doc }), + comment = xpath.parse('*/comment()').evaluateString({ node: doc }); + + assert.equal(allText, "Harry Potter & the Philosopher's StoneHarry Potter"); + assert.equal(ns, 'http://harry'); + assert.equal(title, "Harry Potter & the Philosopher's Stone"); + assert.equal(child, "Harry Potter & the Philosopher's Stone"); + assert.equal(titleLang, 'en'); + assert.equal(pi.trim(), "name='J.K. Rowling'"); + assert.equal(comment, ' This describes the Harry Potter Book '); + + test.done(); + } + + ,"exposes custom types": function (test) { + assert.ok(xpath.XPath, "xpath.XPath"); + assert.ok(xpath.XPathParser, "xpath.XPathParser"); + assert.ok(xpath.XPathResult, "xpath.XPathResult"); + + assert.ok(xpath.Step, "xpath.Step"); + assert.ok(xpath.NodeTest, "xpath.NodeTest"); + assert.ok(xpath.BarOperation, "xpath.BarOperation"); + + assert.ok(xpath.NamespaceResolver, "xpath.NamespaceResolver"); + assert.ok(xpath.FunctionResolver, "xpath.FunctionResolver"); + assert.ok(xpath.VariableResolver, "xpath.VariableResolver"); + + assert.ok(xpath.Utilities, "xpath.Utilities"); + + assert.ok(xpath.XPathContext, "xpath.XPathContext"); + assert.ok(xpath.XNodeSet, "xpath.XNodeSet"); + assert.ok(xpath.XBoolean, "xpath.XBoolean"); + assert.ok(xpath.XString, "xpath.XString"); + assert.ok(xpath.XNumber, "xpath.XNumber"); + + test.done(); + } + + ,"work with nodes created using DOM1 createElement()": function (test) { + var doc = new dom().parseFromString(''); + + doc.documentElement.appendChild(doc.createElement('characters')); + + assert.ok(xpath.select1('/book/characters', doc)); + + assert.equal(xpath.select1('local-name(/book/characters)', doc), 'characters'); + + test.done(); + } + + ,"preceding:: axis works on document fragments": function (test) { + var doc = new dom().parseFromString(''), + df = doc.createDocumentFragment(), + root = doc.createElement('book'); + + df.appendChild(root); + + for (var i = 0; i < 10; i += 1) { + root.appendChild(doc.createElement('chapter')); + } + + var chapter = xpath.select1("book/chapter[5]", df); + + assert.ok(chapter, 'chapter'); + + assert.equal(xpath.select("count(preceding::chapter)", chapter), 4); + + test.done(); + } + + ,"node set sorted and unsorted arrays": function (test) { + var doc = new dom().parseFromString('HarryRonHermione'), + path = xpath.parse("/*/*[3] | /*/*[2] | /*/*[1]") + nset = path.evaluateNodeSet({ node: doc }), + sorted = nset.toArray(), + unsorted = nset.toUnsortedArray(); + + assert.equal(sorted.length, 3); + assert.equal(unsorted.length, 3); + + assert.equal(sorted[0].textContent, 'Harry'); + assert.equal(sorted[1].textContent, 'Ron'); + assert.equal(sorted[2].textContent, 'Hermione'); + + assert.notEqual(sorted[0], unsorted[0], "first nodeset element equal"); + + test.done(); + } + + ,'meaningful error for invalid function': function(test) { + var path = xpath.parse('invalidFunc()'); + + assert.throws(function () { + path.evaluateString(); + }, function (err) { + return err.message.indexOf('invalidFunc') !== -1; + }); + + var path2 = xpath.parse('funcs:invalidFunc()'); + + assert.throws(function () { + path2.evaluateString({ + namespaces: { + funcs: 'myfunctions' + } + }); + }, function (err) { + return err.message.indexOf('invalidFunc') !== -1; + }); + + test.done(); + } + + // https://github.com/goto100/xpath/issues/32 + ,'supports contains() function on attributes': function (test) { + var doc = new dom().parseFromString(""), + andTheBooks = xpath.select("/books/book[contains(@title, ' ')]", doc), + secretBooks = xpath.select("/books/book[contains(@title, 'Secrets')]", doc); + + assert.equal(andTheBooks.length, 2); + assert.equal(secretBooks.length, 1); + + test.done(); + } + + ,'compare multiple nodes to multiple nodes (equals)': function (test) { + var xml = '' + + 'HarryHermione' + + 'DracoCrabbe' + + 'LunaCho' + + '' + + 'HermioneLuna'; + + var doc = new dom().parseFromString(xml); + var houses = xpath.parse('/school/houses/house[student = /school/honorStudents/student]').select({ node: doc }); + + assert.equal(houses.length, 2); + + var houseNames = houses.map(function (node) { return node.getAttribute('name'); }).sort(); + + assert.equal(houseNames[0], 'Gryffindor'); + assert.equal(houseNames[1], 'Ravenclaw'); + + test.done(); + } + + ,'compare multiple nodes to multiple nodes (gte)': function (test) { + var xml = '' + + 'HarryHermione' + + 'GoyleCrabbe' + + 'LunaCho' + + '' + + 'DADACharms' + + ''; + + var doc = new dom().parseFromString(xml); + var houses = xpath.parse('/school/houses/house[student/@level >= /school/courses/course/@minLevel]').select({ node: doc }); + + assert.equal(houses.length, 2); + + var houseNames = houses.map(function (node) { return node.getAttribute('name'); }).sort(); + + assert.equal(houseNames[0], 'Gryffindor'); + assert.equal(houseNames[1], 'Ravenclaw'); + + test.done(); + } + + ,'inequality comparisons with nodesets': function (test) { + var xml = ""; + var doc = new dom().parseFromString(xml); + + var options = { node: doc, variables: { theNumber: 3, theString: '3', theBoolean: true }}; + + var numberPaths = [ + '/books/book[$theNumber <= @num]', + '/books/book[$theNumber < @num]', + '/books/book[$theNumber >= @num]', + '/books/book[$theNumber > @num]' + ]; + + var stringPaths = [ + '/books/book[$theString <= @num]', + '/books/book[$theString < @num]', + '/books/book[$theString >= @num]', + '/books/book[$theString > @num]' + ]; + + var booleanPaths = [ + '/books/book[$theBoolean <= @num]', + '/books/book[$theBoolean < @num]', + '/books/book[$theBoolean >= @num]', + '/books/book[$theBoolean > @num]' + ]; + + var lhsPaths = [ + '/books/book[@num <= $theNumber]', + '/books/book[@num < $theNumber]' + ]; + + function countNodes(paths){ + return paths + .map(xpath.parse) + .map(function (path) { return path.select(options) }) + .map(function (arr) { return arr.length; }); + } + + assert.deepEqual(countNodes(numberPaths), [5, 4, 3, 2], 'numbers'); + assert.deepEqual(countNodes(stringPaths), [5, 4, 3, 2], 'strings'); + assert.deepEqual(countNodes(booleanPaths), [7, 6, 1, 0], 'numbers'); + assert.deepEqual(countNodes(lhsPaths), [3, 2], 'lhs'); + + test.done(); + } + + ,'error when evaluating boolean as number': function (test) { + var num = xpath.parse('"a" = "b"').evaluateNumber(); + + assert.equal(num, 0); + + var str = xpath.select('substring("expelliarmus", 1, "a" = "a")'); + + assert.equal(str, 'e'); + + test.done(); + } + + ,'string values of parsed expressions': function (test) { + var parser = new xpath.XPathParser(); + + var simpleStep = parser.parse('my:book'); + + assert.equal(simpleStep.toString(), 'child::my:book'); + + var precedingSib = parser.parse('preceding-sibling::my:chapter'); + + assert.equal(precedingSib.toString(), 'preceding-sibling::my:chapter'); + + var withPredicates = parser.parse('book[number > 3][contains(title, "and the")]'); + + assert.equal(withPredicates.toString(), "child::book[(child::number > 3)][contains(child::title, 'and the')]"); + + var parenthesisWithPredicate = parser.parse('(/books/book/chapter)[7]'); + + assert.equal(parenthesisWithPredicate.toString(), '(/child::books/child::book/child::chapter)[7]'); + + var charactersOver20 = parser.parse('heroes[age > 20] | villains[age > 20]'); + + assert.equal(charactersOver20.toString(), 'child::heroes[(child::age > 20)] | child::villains[(child::age > 20)]'); + + test.done(); + } + + ,'context position should work correctly': function (test) { + var doc = new dom().parseFromString("The boy who livedThe vanishing glassThe worst birthdayDobby's warningThe burrow"); + + var chapters = xpath.parse('/books/book/chapter[2]').select({ node: doc }); + + assert.equal(2, chapters.length); + assert.equal('The vanishing glass', chapters[0].textContent); + assert.equal("Dobby's warning", chapters[1].textContent); + + var lastChapters = xpath.parse('/books/book/chapter[last()]').select({ node: doc }); + + assert.equal(2, lastChapters.length); + assert.equal('The vanishing glass', lastChapters[0].textContent); + assert.equal("The burrow", lastChapters[1].textContent); + + var secondChapter = xpath.parse('(/books/book/chapter)[2]').select({ node: doc }); + + assert.equal(1, secondChapter.length); + assert.equal('The vanishing glass', chapters[0].textContent); + + var lastChapter = xpath.parse('(/books/book/chapter)[last()]').select({ node: doc }); + + assert.equal(1, lastChapter.length); + assert.equal("The burrow", lastChapter[0].textContent); + + + test.done(); + } + + ,'should allow null namespaces for null prefixes': function (test) { + var markup = '

Hi Ron!

Hi Draco!

Hi Hermione!

'; + var docHtml = new dom().parseFromString(markup, 'text/html'); + + var noPrefixPath = xpath.parse('/html/body/p[2]'); + + var greetings1 = noPrefixPath.select({ node: docHtml, allowAnyNamespaceForNoPrefix: false }); + + assert.equal(0, greetings1.length); + + var allowAnyNamespaceOptions = { node: docHtml, allowAnyNamespaceForNoPrefix: true }; + + // if allowAnyNamespaceForNoPrefix specified, allow using prefix-less node tests to match nodes with no prefix + var greetings2 = noPrefixPath.select(allowAnyNamespaceOptions); + + assert.equal(1, greetings2.length); + assert.equal('Hi Hermione!', greetings2[0].textContent); + + var allGreetings = xpath.parse('/html/body/p').select(allowAnyNamespaceOptions); + + assert.equal(2, allGreetings.length); + + var nsm = { html: xhtmlNs, other: 'http://www.example.com/other' }; + + var prefixPath = xpath.parse('/html:html/body/html:p'); + var optionsWithNamespaces = { node: docHtml, allowAnyNamespaceForNoPrefix: true, namespaces: nsm }; + + // if the path uses prefixes, they have to match + var greetings3 = prefixPath.select(optionsWithNamespaces); + + assert.equal(2, greetings3.length); + + var badPrefixPath = xpath.parse('/html:html/other:body/html:p'); + + var greetings4 = badPrefixPath.select(optionsWithNamespaces); + + test.done(); + } + + ,'support isHtml option' : function (test){ + var markup = '

Hi Ron!

Hi Draco!

Hi Hermione!

'; + var docHtml = new dom().parseFromString(markup, 'text/html'); + + var ns = { h: xhtmlNs }; + + // allow matching on unprefixed nodes + var greetings1 = xpath.parse('/html/body/p').select({ node: docHtml, isHtml: true }); + + assert.equal(2, greetings1.length); + + // allow case insensitive match + var greetings2 = xpath.parse('/h:html/h:bOdY/h:p').select({ node: docHtml, namespaces: ns, isHtml: true }); + + assert.equal(2, greetings2.length); + + // non-html mode: allow select if case and namespaces match + var greetings3 = xpath.parse('/h:html/h:body/h:p').select({ node: docHtml, namespaces: ns }); + + assert.equal(2, greetings3.length); + + // non-html mode: require namespaces + var greetings4 = xpath.parse('/html/body/p').select({ node: docHtml, namespaces: ns }); + + assert.equal(0, greetings4.length); + + // non-html mode: require case to match + var greetings5 = xpath.parse('/h:html/h:bOdY/h:p').select({ node: docHtml, namespaces: ns }); + + assert.equal(0, greetings5.length); + + test.done(); + } + + ,"builtin functions": function (test) { + var translated = xpath.parse('translate("hello", "lhho", "yHb")').evaluateString(); + + assert.equal('Heyy', translated); + + var characters = new dom().parseFromString('HarryRonHermione'); + + var firstTwo = xpath.parse('/characters/character[position() <= 2]').select({ node: characters }); + + assert.equal(2, firstTwo.length); + assert.equal('Harry', firstTwo[0].textContent); + assert.equal('Ron', firstTwo[1].textContent); + + var last = xpath.parse('/characters/character[last()]').select({ node: characters }); + + assert.equal(1, last.length); + assert.equal('Hermione', last[0].textContent); + + test.done(); + } +} diff --git a/node_modules/xpath/xpath.d.ts b/node_modules/xpath/xpath.d.ts index ac95996dd..110076189 100644 --- a/node_modules/xpath/xpath.d.ts +++ b/node_modules/xpath/xpath.d.ts @@ -1,9 +1,9 @@ -type SelectedValue = Node | Attr | string | number | boolean; -interface XPathSelect { - (expression: string, node?: Node): Array; - (expression: string, node: Node, single: true): SelectedValue; -} -export var select: XPathSelect; -export function select1(expression: string, node?: Node): SelectedValue; -export function evaluate(expression: string, contextNode: Node, resolver: XPathNSResolver, type: number, result: XPathResult): XPathResult; -export function useNamespaces(namespaceMap: { [name: string]: string }): XPathSelect; +type SelectedValue = Node | Attr | string | number | boolean; +interface XPathSelect { + (expression: string, node?: Node): Array; + (expression: string, node: Node, single: true): SelectedValue; +} +export var select: XPathSelect; +export function select1(expression: string, node?: Node): SelectedValue; +export function evaluate(expression: string, contextNode: Node, resolver: XPathNSResolver, type: number, result: XPathResult): XPathResult; +export function useNamespaces(namespaceMap: { [name: string]: string }): XPathSelect; diff --git a/node_modules/xpath/xpath.js b/node_modules/xpath/xpath.js index 02732c028..6646a018e 100644 --- a/node_modules/xpath/xpath.js +++ b/node_modules/xpath/xpath.js @@ -1,4764 +1,4764 @@ -/* - * xpath.js - * - * An XPath 1.0 library for JavaScript. - * - * Cameron McCormack - * - * This work is licensed under the MIT License. - * - * Revision 20: April 26, 2011 - * Fixed a typo resulting in FIRST_ORDERED_NODE_TYPE results being wrong, - * thanks to . - * - * Revision 19: November 29, 2005 - * Nodesets now store their nodes in a height balanced tree, increasing - * performance for the common case of selecting nodes in document order, - * thanks to S閎astien Cramatte . - * AVL tree code adapted from Raimund Neumann . - * - * Revision 18: October 27, 2005 - * DOM 3 XPath support. Caveats: - * - namespace prefixes aren't resolved in XPathEvaluator.createExpression, - * but in XPathExpression.evaluate. - * - XPathResult.invalidIteratorState is not implemented. - * - * Revision 17: October 25, 2005 - * Some core XPath function fixes and a patch to avoid crashing certain - * versions of MSXML in PathExpr.prototype.getOwnerElement, thanks to - * S閎astien Cramatte . - * - * Revision 16: September 22, 2005 - * Workarounds for some IE 5.5 deficiencies. - * Fixed problem with prefix node tests on attribute nodes. - * - * Revision 15: May 21, 2005 - * Fixed problem with QName node tests on elements with an xmlns="...". - * - * Revision 14: May 19, 2005 - * Fixed QName node tests on attribute node regression. - * - * Revision 13: May 3, 2005 - * Node tests are case insensitive now if working in an HTML DOM. - * - * Revision 12: April 26, 2005 - * Updated licence. Slight code changes to enable use of Dean - * Edwards' script compression, http://dean.edwards.name/packer/ . - * - * Revision 11: April 23, 2005 - * Fixed bug with 'and' and 'or' operators, fix thanks to - * Sandy McArthur . - * - * Revision 10: April 15, 2005 - * Added support for a virtual root node, supposedly helpful for - * implementing XForms. Fixed problem with QName node tests and - * the parent axis. - * - * Revision 9: March 17, 2005 - * Namespace resolver tweaked so using the document node as the context - * for namespace lookups is equivalent to using the document element. - * - * Revision 8: February 13, 2005 - * Handle implicit declaration of 'xmlns' namespace prefix. - * Fixed bug when comparing nodesets. - * Instance data can now be associated with a FunctionResolver, and - * workaround for MSXML not supporting 'localName' and 'getElementById', - * thanks to Grant Gongaware. - * Fix a few problems when the context node is the root node. - * - * Revision 7: February 11, 2005 - * Default namespace resolver fix from Grant Gongaware - * . - * - * Revision 6: February 10, 2005 - * Fixed bug in 'number' function. - * - * Revision 5: February 9, 2005 - * Fixed bug where text nodes not getting converted to string values. - * - * Revision 4: January 21, 2005 - * Bug in 'name' function, fix thanks to Bill Edney. - * Fixed incorrect processing of namespace nodes. - * Fixed NamespaceResolver to resolve 'xml' namespace. - * Implemented union '|' operator. - * - * Revision 3: January 14, 2005 - * Fixed bug with nodeset comparisons, bug lexing < and >. - * - * Revision 2: October 26, 2004 - * QName node test namespace handling fixed. Few other bug fixes. - * - * Revision 1: August 13, 2004 - * Bug fixes from William J. Edney . - * Added minimal licence. - * - * Initial version: June 14, 2004 - */ - -// non-node wrapper -var xpath = (typeof exports === 'undefined') ? {} : exports; - -(function(exports) { -"use strict"; - -// functional helpers -function curry( func ) { - var slice = Array.prototype.slice, - totalargs = func.length, - partial = function( args, fn ) { - return function( ) { - return fn.apply( this, args.concat( slice.call( arguments ) ) ); - } - }, - fn = function( ) { - var args = slice.call( arguments ); - return ( args.length < totalargs ) ? - partial( args, fn ) : - func.apply( this, slice.apply( arguments, [ 0, totalargs ] ) ); - }; - return fn; -} - -var forEach = curry(function (f, xs) { - for (var i = 0; i < xs.length; i += 1) { - f(xs[i], i, xs); - } -}); - -var reduce = curry(function (f, seed, xs) { - var acc = seed; - - forEach(function (x, i) { acc = f(acc, x, i); }, xs); - - return acc; -}); - -var map = curry(function (f, xs) { - var mapped = new Array(xs.length); - - forEach(function (x, i) { mapped[i] = f(x); }, xs); - - return mapped; -}); - -var filter = curry(function (f, xs) { - var filtered = []; - - forEach(function (x, i) { if(f(x, i)) { filtered.push(x); } }, xs); - - return filtered; -}); - -function compose() { - if (arguments.length === 0) { throw new Error('compose requires at least one argument'); } - - var funcs = Array.prototype.slice.call(arguments).reverse(); - - var f0 = funcs[0]; - var fRem = funcs.slice(1); - - return function () { - return reduce(function (acc, next) { - return next(acc); - }, f0.apply(null, arguments), fRem); - }; -} - -var includes = curry(function (values, value) { - for (var i = 0; i < values.length; i += 1) { - if (values[i] === value){ - return true; - } - } - - return false; -}); - -function always(value) { return function () { return value ;} } - -var prop = curry(function (name, obj) { return obj[name]; }); - -function toString (x) { return x.toString(); } -var join = curry(function (s, xs) { return xs.join(s); }); -var wrap = curry(function (pref, suf, str) { return pref + str + suf; }); - -function assign(target) { // .length of function is 2 - var to = Object(target); - - for (var index = 1; index < arguments.length; index++) { - var nextSource = arguments[index]; - - if (nextSource != null) { // Skip over if undefined or null - for (var nextKey in nextSource) { - // Avoid bugs when hasOwnProperty is shadowed - if (Object.prototype.hasOwnProperty.call(nextSource, nextKey)) { - to[nextKey] = nextSource[nextKey]; - } - } - } - } - - return to; -} - -// XPathParser /////////////////////////////////////////////////////////////// - -XPathParser.prototype = new Object(); -XPathParser.prototype.constructor = XPathParser; -XPathParser.superclass = Object.prototype; - -function XPathParser() { - this.init(); -} - -XPathParser.prototype.init = function() { - this.reduceActions = []; - - this.reduceActions[3] = function(rhs) { - return new OrOperation(rhs[0], rhs[2]); - }; - this.reduceActions[5] = function(rhs) { - return new AndOperation(rhs[0], rhs[2]); - }; - this.reduceActions[7] = function(rhs) { - return new EqualsOperation(rhs[0], rhs[2]); - }; - this.reduceActions[8] = function(rhs) { - return new NotEqualOperation(rhs[0], rhs[2]); - }; - this.reduceActions[10] = function(rhs) { - return new LessThanOperation(rhs[0], rhs[2]); - }; - this.reduceActions[11] = function(rhs) { - return new GreaterThanOperation(rhs[0], rhs[2]); - }; - this.reduceActions[12] = function(rhs) { - return new LessThanOrEqualOperation(rhs[0], rhs[2]); - }; - this.reduceActions[13] = function(rhs) { - return new GreaterThanOrEqualOperation(rhs[0], rhs[2]); - }; - this.reduceActions[15] = function(rhs) { - return new PlusOperation(rhs[0], rhs[2]); - }; - this.reduceActions[16] = function(rhs) { - return new MinusOperation(rhs[0], rhs[2]); - }; - this.reduceActions[18] = function(rhs) { - return new MultiplyOperation(rhs[0], rhs[2]); - }; - this.reduceActions[19] = function(rhs) { - return new DivOperation(rhs[0], rhs[2]); - }; - this.reduceActions[20] = function(rhs) { - return new ModOperation(rhs[0], rhs[2]); - }; - this.reduceActions[22] = function(rhs) { - return new UnaryMinusOperation(rhs[1]); - }; - this.reduceActions[24] = function(rhs) { - return new BarOperation(rhs[0], rhs[2]); - }; - this.reduceActions[25] = function(rhs) { - return new PathExpr(undefined, undefined, rhs[0]); - }; - this.reduceActions[27] = function(rhs) { - rhs[0].locationPath = rhs[2]; - return rhs[0]; - }; - this.reduceActions[28] = function(rhs) { - rhs[0].locationPath = rhs[2]; - rhs[0].locationPath.steps.unshift(new Step(Step.DESCENDANTORSELF, NodeTest.nodeTest, [])); - return rhs[0]; - }; - this.reduceActions[29] = function(rhs) { - return new PathExpr(rhs[0], [], undefined); - }; - this.reduceActions[30] = function(rhs) { - if (Utilities.instance_of(rhs[0], PathExpr)) { - if (rhs[0].filterPredicates == undefined) { - rhs[0].filterPredicates = []; - } - rhs[0].filterPredicates.push(rhs[1]); - return rhs[0]; - } else { - return new PathExpr(rhs[0], [rhs[1]], undefined); - } - }; - this.reduceActions[32] = function(rhs) { - return rhs[1]; - }; - this.reduceActions[33] = function(rhs) { - return new XString(rhs[0]); - }; - this.reduceActions[34] = function(rhs) { - return new XNumber(rhs[0]); - }; - this.reduceActions[36] = function(rhs) { - return new FunctionCall(rhs[0], []); - }; - this.reduceActions[37] = function(rhs) { - return new FunctionCall(rhs[0], rhs[2]); - }; - this.reduceActions[38] = function(rhs) { - return [ rhs[0] ]; - }; - this.reduceActions[39] = function(rhs) { - rhs[2].unshift(rhs[0]); - return rhs[2]; - }; - this.reduceActions[43] = function(rhs) { - return new LocationPath(true, []); - }; - this.reduceActions[44] = function(rhs) { - rhs[1].absolute = true; - return rhs[1]; - }; - this.reduceActions[46] = function(rhs) { - return new LocationPath(false, [ rhs[0] ]); - }; - this.reduceActions[47] = function(rhs) { - rhs[0].steps.push(rhs[2]); - return rhs[0]; - }; - this.reduceActions[49] = function(rhs) { - return new Step(rhs[0], rhs[1], []); - }; - this.reduceActions[50] = function(rhs) { - return new Step(Step.CHILD, rhs[0], []); - }; - this.reduceActions[51] = function(rhs) { - return new Step(rhs[0], rhs[1], rhs[2]); - }; - this.reduceActions[52] = function(rhs) { - return new Step(Step.CHILD, rhs[0], rhs[1]); - }; - this.reduceActions[54] = function(rhs) { - return [ rhs[0] ]; - }; - this.reduceActions[55] = function(rhs) { - rhs[1].unshift(rhs[0]); - return rhs[1]; - }; - this.reduceActions[56] = function(rhs) { - if (rhs[0] == "ancestor") { - return Step.ANCESTOR; - } else if (rhs[0] == "ancestor-or-self") { - return Step.ANCESTORORSELF; - } else if (rhs[0] == "attribute") { - return Step.ATTRIBUTE; - } else if (rhs[0] == "child") { - return Step.CHILD; - } else if (rhs[0] == "descendant") { - return Step.DESCENDANT; - } else if (rhs[0] == "descendant-or-self") { - return Step.DESCENDANTORSELF; - } else if (rhs[0] == "following") { - return Step.FOLLOWING; - } else if (rhs[0] == "following-sibling") { - return Step.FOLLOWINGSIBLING; - } else if (rhs[0] == "namespace") { - return Step.NAMESPACE; - } else if (rhs[0] == "parent") { - return Step.PARENT; - } else if (rhs[0] == "preceding") { - return Step.PRECEDING; - } else if (rhs[0] == "preceding-sibling") { - return Step.PRECEDINGSIBLING; - } else if (rhs[0] == "self") { - return Step.SELF; - } - return -1; - }; - this.reduceActions[57] = function(rhs) { - return Step.ATTRIBUTE; - }; - this.reduceActions[59] = function(rhs) { - if (rhs[0] == "comment") { - return NodeTest.commentTest; - } else if (rhs[0] == "text") { - return NodeTest.textTest; - } else if (rhs[0] == "processing-instruction") { - return NodeTest.anyPiTest; - } else if (rhs[0] == "node") { - return NodeTest.nodeTest; - } - return new NodeTest(-1, undefined); - }; - this.reduceActions[60] = function(rhs) { - return new NodeTest.PITest(rhs[2]); - }; - this.reduceActions[61] = function(rhs) { - return rhs[1]; - }; - this.reduceActions[63] = function(rhs) { - rhs[1].absolute = true; - rhs[1].steps.unshift(new Step(Step.DESCENDANTORSELF, NodeTest.nodeTest, [])); - return rhs[1]; - }; - this.reduceActions[64] = function(rhs) { - rhs[0].steps.push(new Step(Step.DESCENDANTORSELF, NodeTest.nodeTest, [])); - rhs[0].steps.push(rhs[2]); - return rhs[0]; - }; - this.reduceActions[65] = function(rhs) { - return new Step(Step.SELF, NodeTest.nodeTest, []); - }; - this.reduceActions[66] = function(rhs) { - return new Step(Step.PARENT, NodeTest.nodeTest, []); - }; - this.reduceActions[67] = function(rhs) { - return new VariableReference(rhs[1]); - }; - this.reduceActions[68] = function(rhs) { - return NodeTest.nameTestAny; - }; - this.reduceActions[69] = function(rhs) { - return new NodeTest.NameTestPrefixAny(rhs[0].split(':')[0]); - }; - this.reduceActions[70] = function(rhs) { - return new NodeTest.NameTestQName(rhs[0]); - }; -}; - -XPathParser.actionTable = [ - " s s sssssssss s ss s ss", - " s ", - "r rrrrrrrrr rrrrrrr rr r ", - " rrrrr ", - " s s sssssssss s ss s ss", - "rs rrrrrrrr s sssssrrrrrr rrs rs ", - " s s sssssssss s ss s ss", - " s ", - " s ", - "r rrrrrrrrr rrrrrrr rr rr ", - "r rrrrrrrrr rrrrrrr rr rr ", - "r rrrrrrrrr rrrrrrr rr rr ", - "r rrrrrrrrr rrrrrrr rr rr ", - "r rrrrrrrrr rrrrrrr rr rr ", - " s ", - " s ", - " s s sssss s s ", - "r rrrrrrrrr rrrrrrr rr r ", - "a ", - "r s rr r ", - "r sr rr r ", - "r s rr s rr r ", - "r rssrr rss rr r ", - "r rrrrr rrrss rr r ", - "r rrrrrsss rrrrr rr r ", - "r rrrrrrrr rrrrr rr r ", - "r rrrrrrrr rrrrrs rr r ", - "r rrrrrrrr rrrrrr rr r ", - "r rrrrrrrr rrrrrr rr r ", - "r srrrrrrrr rrrrrrs rr sr ", - "r srrrrrrrr rrrrrrs rr r ", - "r rrrrrrrrr rrrrrrr rr rr ", - "r rrrrrrrrr rrrrrrr rr rr ", - "r rrrrrrrrr rrrrrrr rr rr ", - "r rrrrrrrr rrrrrr rr r ", - "r rrrrrrrr rrrrrr rr r ", - "r rrrrrrrrr rrrrrrr rr r ", - "r rrrrrrrrr rrrrrrr rr r ", - " sssss ", - "r rrrrrrrrr rrrrrrr rr sr ", - "r rrrrrrrrr rrrrrrr rr r ", - "r rrrrrrrrr rrrrrrr rr rr ", - "r rrrrrrrrr rrrrrrr rr rr ", - " s ", - "r srrrrrrrr rrrrrrs rr r ", - "r rrrrrrrr rrrrr rr r ", - " s ", - " s ", - " rrrrr ", - " s s sssssssss s sss s ss", - "r srrrrrrrr rrrrrrs rr r ", - " s s sssssssss s ss s ss", - " s s sssssssss s ss s ss", - " s s sssssssss s ss s ss", - " s s sssssssss s ss s ss", - " s s sssssssss s ss s ss", - " s s sssssssss s ss s ss", - " s s sssssssss s ss s ss", - " s s sssssssss s ss s ss", - " s s sssssssss s ss s ss", - " s s sssssssss s ss s ss", - " s s sssssssss s ss s ss", - " s s sssssssss s ss s ss", - " s s sssssssss s ss s ss", - " s s sssssssss ss s ss", - " s s sssssssss s ss s ss", - " s s sssss s s ", - " s s sssss s s ", - "r rrrrrrrrr rrrrrrr rr rr ", - " s s sssss s s ", - " s s sssss s s ", - "r rrrrrrrrr rrrrrrr rr sr ", - "r rrrrrrrrr rrrrrrr rr sr ", - "r rrrrrrrrr rrrrrrr rr r ", - "r rrrrrrrrr rrrrrrr rr rr ", - " s ", - "r rrrrrrrrr rrrrrrr rr rr ", - "r rrrrrrrrr rrrrrrr rr rr ", - " rr ", - " s ", - " rs ", - "r sr rr r ", - "r s rr s rr r ", - "r rssrr rss rr r ", - "r rssrr rss rr r ", - "r rrrrr rrrss rr r ", - "r rrrrr rrrss rr r ", - "r rrrrr rrrss rr r ", - "r rrrrr rrrss rr r ", - "r rrrrrsss rrrrr rr r ", - "r rrrrrsss rrrrr rr r ", - "r rrrrrrrr rrrrr rr r ", - "r rrrrrrrr rrrrr rr r ", - "r rrrrrrrr rrrrr rr r ", - "r rrrrrrrr rrrrrr rr r ", - " r ", - " s ", - "r srrrrrrrr rrrrrrs rr r ", - "r srrrrrrrr rrrrrrs rr r ", - "r rrrrrrrrr rrrrrrr rr r ", - "r rrrrrrrrr rrrrrrr rr r ", - "r rrrrrrrrr rrrrrrr rr r ", - "r rrrrrrrrr rrrrrrr rr r ", - "r rrrrrrrrr rrrrrrr rr rr ", - "r rrrrrrrrr rrrrrrr rr rr ", - " s s sssssssss s ss s ss", - "r rrrrrrrrr rrrrrrr rr rr ", - " r " -]; - -XPathParser.actionTableNumber = [ - " 1 0 /.-,+*)(' & %$ # \"!", - " J ", - "a aaaaaaaaa aaaaaaa aa a ", - " YYYYY ", - " 1 0 /.-,+*)(' & %$ # \"!", - "K1 KKKKKKKK . +*)('KKKKKK KK# K\" ", - " 1 0 /.-,+*)(' & %$ # \"!", - " N ", - " O ", - "e eeeeeeeee eeeeeee ee ee ", - "f fffffffff fffffff ff ff ", - "d ddddddddd ddddddd dd dd ", - "B BBBBBBBBB BBBBBBB BB BB ", - "A AAAAAAAAA AAAAAAA AA AA ", - " P ", - " Q ", - " 1 . +*)(' # \" ", - "b bbbbbbbbb bbbbbbb bb b ", - " ", - "! S !! ! ", - "\" T\" \"\" \" ", - "$ V $$ U $$ $ ", - "& &ZY&& &XW && & ", - ") ))))) )))\\[ )) ) ", - ". ....._^] ..... .. . ", - "1 11111111 11111 11 1 ", - "5 55555555 55555` 55 5 ", - "7 77777777 777777 77 7 ", - "9 99999999 999999 99 9 ", - ": c:::::::: ::::::b :: a: ", - "I fIIIIIIII IIIIIIe II I ", - "= ========= ======= == == ", - "? ????????? ??????? ?? ?? ", - "C CCCCCCCCC CCCCCCC CC CC ", - "J JJJJJJJJ JJJJJJ JJ J ", - "M MMMMMMMM MMMMMM MM M ", - "N NNNNNNNNN NNNNNNN NN N ", - "P PPPPPPPPP PPPPPPP PP P ", - " +*)(' ", - "R RRRRRRRRR RRRRRRR RR aR ", - "U UUUUUUUUU UUUUUUU UU U ", - "Z ZZZZZZZZZ ZZZZZZZ ZZ ZZ ", - "c ccccccccc ccccccc cc cc ", - " j ", - "L fLLLLLLLL LLLLLLe LL L ", - "6 66666666 66666 66 6 ", - " k ", - " l ", - " XXXXX ", - " 1 0 /.-,+*)(' & %$m # \"!", - "_ f________ ______e __ _ ", - " 1 0 /.-,+*)(' & %$ # \"!", - " 1 0 /.-,+*)(' & %$ # \"!", - " 1 0 /.-,+*)(' & %$ # \"!", - " 1 0 /.-,+*)(' & %$ # \"!", - " 1 0 /.-,+*)(' & %$ # \"!", - " 1 0 /.-,+*)(' & %$ # \"!", - " 1 0 /.-,+*)(' & %$ # \"!", - " 1 0 /.-,+*)(' & %$ # \"!", - " 1 0 /.-,+*)(' & %$ # \"!", - " 1 0 /.-,+*)(' & %$ # \"!", - " 1 0 /.-,+*)(' & %$ # \"!", - " 1 0 /.-,+*)(' & %$ # \"!", - " 1 0 /.-,+*)(' & %$ # \"!", - " 1 0 /.-,+*)(' %$ # \"!", - " 1 0 /.-,+*)(' & %$ # \"!", - " 1 . +*)(' # \" ", - " 1 . +*)(' # \" ", - "> >>>>>>>>> >>>>>>> >> >> ", - " 1 . +*)(' # \" ", - " 1 . +*)(' # \" ", - "Q QQQQQQQQQ QQQQQQQ QQ aQ ", - "V VVVVVVVVV VVVVVVV VV aV ", - "T TTTTTTTTT TTTTTTT TT T ", - "@ @@@@@@@@@ @@@@@@@ @@ @@ ", - " \x87 ", - "[ [[[[[[[[[ [[[[[[[ [[ [[ ", - "D DDDDDDDDD DDDDDDD DD DD ", - " HH ", - " \x88 ", - " F\x89 ", - "# T# ## # ", - "% V %% U %% % ", - "' 'ZY'' 'XW '' ' ", - "( (ZY(( (XW (( ( ", - "+ +++++ +++\\[ ++ + ", - "* ***** ***\\[ ** * ", - "- ----- ---\\[ -- - ", - ", ,,,,, ,,,\\[ ,, , ", - "0 00000_^] 00000 00 0 ", - "/ /////_^] ///// // / ", - "2 22222222 22222 22 2 ", - "3 33333333 33333 33 3 ", - "4 44444444 44444 44 4 ", - "8 88888888 888888 88 8 ", - " ^ ", - " \x8a ", - "; f;;;;;;;; ;;;;;;e ;; ; ", - "< f<<<<<<<< <<<<<?@ AB CDEFGH IJ ", - " ", - " ", - " ", - "L456789:;<=>?@ AB CDEFGH IJ ", - " M EFGH IJ ", - " N;<=>?@ AB CDEFGH IJ ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " S EFGH IJ ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " e ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " h J ", - " i j ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - "o456789:;<=>?@ ABpqCDEFGH IJ ", - " ", - " r6789:;<=>?@ AB CDEFGH IJ ", - " s789:;<=>?@ AB CDEFGH IJ ", - " t89:;<=>?@ AB CDEFGH IJ ", - " u89:;<=>?@ AB CDEFGH IJ ", - " v9:;<=>?@ AB CDEFGH IJ ", - " w9:;<=>?@ AB CDEFGH IJ ", - " x9:;<=>?@ AB CDEFGH IJ ", - " y9:;<=>?@ AB CDEFGH IJ ", - " z:;<=>?@ AB CDEFGH IJ ", - " {:;<=>?@ AB CDEFGH IJ ", - " |;<=>?@ AB CDEFGH IJ ", - " };<=>?@ AB CDEFGH IJ ", - " ~;<=>?@ AB CDEFGH IJ ", - " \x7f=>?@ AB CDEFGH IJ ", - "\x80456789:;<=>?@ AB CDEFGH IJ\x81", - " \x82 EFGH IJ ", - " \x83 EFGH IJ ", - " ", - " \x84 GH IJ ", - " \x85 GH IJ ", - " i \x86 ", - " i \x87 ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - "o456789:;<=>?@ AB\x8cqCDEFGH IJ ", - " ", - " " -]; - -XPathParser.productions = [ - [1, 1, 2], - [2, 1, 3], - [3, 1, 4], - [3, 3, 3, -9, 4], - [4, 1, 5], - [4, 3, 4, -8, 5], - [5, 1, 6], - [5, 3, 5, -22, 6], - [5, 3, 5, -5, 6], - [6, 1, 7], - [6, 3, 6, -23, 7], - [6, 3, 6, -24, 7], - [6, 3, 6, -6, 7], - [6, 3, 6, -7, 7], - [7, 1, 8], - [7, 3, 7, -25, 8], - [7, 3, 7, -26, 8], - [8, 1, 9], - [8, 3, 8, -12, 9], - [8, 3, 8, -11, 9], - [8, 3, 8, -10, 9], - [9, 1, 10], - [9, 2, -26, 9], - [10, 1, 11], - [10, 3, 10, -27, 11], - [11, 1, 12], - [11, 1, 13], - [11, 3, 13, -28, 14], - [11, 3, 13, -4, 14], - [13, 1, 15], - [13, 2, 13, 16], - [15, 1, 17], - [15, 3, -29, 2, -30], - [15, 1, -15], - [15, 1, -16], - [15, 1, 18], - [18, 3, -13, -29, -30], - [18, 4, -13, -29, 19, -30], - [19, 1, 20], - [19, 3, 20, -31, 19], - [20, 1, 2], - [12, 1, 14], - [12, 1, 21], - [21, 1, -28], - [21, 2, -28, 14], - [21, 1, 22], - [14, 1, 23], - [14, 3, 14, -28, 23], - [14, 1, 24], - [23, 2, 25, 26], - [23, 1, 26], - [23, 3, 25, 26, 27], - [23, 2, 26, 27], - [23, 1, 28], - [27, 1, 16], - [27, 2, 16, 27], - [25, 2, -14, -3], - [25, 1, -32], - [26, 1, 29], - [26, 3, -20, -29, -30], - [26, 4, -21, -29, -15, -30], - [16, 3, -33, 30, -34], - [30, 1, 2], - [22, 2, -4, 14], - [24, 3, 14, -4, 23], - [28, 1, -35], - [28, 1, -2], - [17, 2, -36, -18], - [29, 1, -17], - [29, 1, -19], - [29, 1, -18] -]; - -XPathParser.DOUBLEDOT = 2; -XPathParser.DOUBLECOLON = 3; -XPathParser.DOUBLESLASH = 4; -XPathParser.NOTEQUAL = 5; -XPathParser.LESSTHANOREQUAL = 6; -XPathParser.GREATERTHANOREQUAL = 7; -XPathParser.AND = 8; -XPathParser.OR = 9; -XPathParser.MOD = 10; -XPathParser.DIV = 11; -XPathParser.MULTIPLYOPERATOR = 12; -XPathParser.FUNCTIONNAME = 13; -XPathParser.AXISNAME = 14; -XPathParser.LITERAL = 15; -XPathParser.NUMBER = 16; -XPathParser.ASTERISKNAMETEST = 17; -XPathParser.QNAME = 18; -XPathParser.NCNAMECOLONASTERISK = 19; -XPathParser.NODETYPE = 20; -XPathParser.PROCESSINGINSTRUCTIONWITHLITERAL = 21; -XPathParser.EQUALS = 22; -XPathParser.LESSTHAN = 23; -XPathParser.GREATERTHAN = 24; -XPathParser.PLUS = 25; -XPathParser.MINUS = 26; -XPathParser.BAR = 27; -XPathParser.SLASH = 28; -XPathParser.LEFTPARENTHESIS = 29; -XPathParser.RIGHTPARENTHESIS = 30; -XPathParser.COMMA = 31; -XPathParser.AT = 32; -XPathParser.LEFTBRACKET = 33; -XPathParser.RIGHTBRACKET = 34; -XPathParser.DOT = 35; -XPathParser.DOLLAR = 36; - -XPathParser.prototype.tokenize = function(s1) { - var types = []; - var values = []; - var s = s1 + '\0'; - - var pos = 0; - var c = s.charAt(pos++); - while (1) { - while (c == ' ' || c == '\t' || c == '\r' || c == '\n') { - c = s.charAt(pos++); - } - if (c == '\0' || pos >= s.length) { - break; - } - - if (c == '(') { - types.push(XPathParser.LEFTPARENTHESIS); - values.push(c); - c = s.charAt(pos++); - continue; - } - if (c == ')') { - types.push(XPathParser.RIGHTPARENTHESIS); - values.push(c); - c = s.charAt(pos++); - continue; - } - if (c == '[') { - types.push(XPathParser.LEFTBRACKET); - values.push(c); - c = s.charAt(pos++); - continue; - } - if (c == ']') { - types.push(XPathParser.RIGHTBRACKET); - values.push(c); - c = s.charAt(pos++); - continue; - } - if (c == '@') { - types.push(XPathParser.AT); - values.push(c); - c = s.charAt(pos++); - continue; - } - if (c == ',') { - types.push(XPathParser.COMMA); - values.push(c); - c = s.charAt(pos++); - continue; - } - if (c == '|') { - types.push(XPathParser.BAR); - values.push(c); - c = s.charAt(pos++); - continue; - } - if (c == '+') { - types.push(XPathParser.PLUS); - values.push(c); - c = s.charAt(pos++); - continue; - } - if (c == '-') { - types.push(XPathParser.MINUS); - values.push(c); - c = s.charAt(pos++); - continue; - } - if (c == '=') { - types.push(XPathParser.EQUALS); - values.push(c); - c = s.charAt(pos++); - continue; - } - if (c == '$') { - types.push(XPathParser.DOLLAR); - values.push(c); - c = s.charAt(pos++); - continue; - } - - if (c == '.') { - c = s.charAt(pos++); - if (c == '.') { - types.push(XPathParser.DOUBLEDOT); - values.push(".."); - c = s.charAt(pos++); - continue; - } - if (c >= '0' && c <= '9') { - var number = "." + c; - c = s.charAt(pos++); - while (c >= '0' && c <= '9') { - number += c; - c = s.charAt(pos++); - } - types.push(XPathParser.NUMBER); - values.push(number); - continue; - } - types.push(XPathParser.DOT); - values.push('.'); - continue; - } - - if (c == '\'' || c == '"') { - var delimiter = c; - var literal = ""; - while (pos < s.length && (c = s.charAt(pos)) !== delimiter) { - literal += c; - pos += 1; - } - if (c !== delimiter) { - throw XPathException.fromMessage("Unterminated string literal: " + delimiter + literal); - } - pos += 1; - types.push(XPathParser.LITERAL); - values.push(literal); - c = s.charAt(pos++); - continue; - } - - if (c >= '0' && c <= '9') { - var number = c; - c = s.charAt(pos++); - while (c >= '0' && c <= '9') { - number += c; - c = s.charAt(pos++); - } - if (c == '.') { - if (s.charAt(pos) >= '0' && s.charAt(pos) <= '9') { - number += c; - number += s.charAt(pos++); - c = s.charAt(pos++); - while (c >= '0' && c <= '9') { - number += c; - c = s.charAt(pos++); - } - } - } - types.push(XPathParser.NUMBER); - values.push(number); - continue; - } - - if (c == '*') { - if (types.length > 0) { - var last = types[types.length - 1]; - if (last != XPathParser.AT - && last != XPathParser.DOUBLECOLON - && last != XPathParser.LEFTPARENTHESIS - && last != XPathParser.LEFTBRACKET - && last != XPathParser.AND - && last != XPathParser.OR - && last != XPathParser.MOD - && last != XPathParser.DIV - && last != XPathParser.MULTIPLYOPERATOR - && last != XPathParser.SLASH - && last != XPathParser.DOUBLESLASH - && last != XPathParser.BAR - && last != XPathParser.PLUS - && last != XPathParser.MINUS - && last != XPathParser.EQUALS - && last != XPathParser.NOTEQUAL - && last != XPathParser.LESSTHAN - && last != XPathParser.LESSTHANOREQUAL - && last != XPathParser.GREATERTHAN - && last != XPathParser.GREATERTHANOREQUAL) { - types.push(XPathParser.MULTIPLYOPERATOR); - values.push(c); - c = s.charAt(pos++); - continue; - } - } - types.push(XPathParser.ASTERISKNAMETEST); - values.push(c); - c = s.charAt(pos++); - continue; - } - - if (c == ':') { - if (s.charAt(pos) == ':') { - types.push(XPathParser.DOUBLECOLON); - values.push("::"); - pos++; - c = s.charAt(pos++); - continue; - } - } - - if (c == '/') { - c = s.charAt(pos++); - if (c == '/') { - types.push(XPathParser.DOUBLESLASH); - values.push("//"); - c = s.charAt(pos++); - continue; - } - types.push(XPathParser.SLASH); - values.push('/'); - continue; - } - - if (c == '!') { - if (s.charAt(pos) == '=') { - types.push(XPathParser.NOTEQUAL); - values.push("!="); - pos++; - c = s.charAt(pos++); - continue; - } - } - - if (c == '<') { - if (s.charAt(pos) == '=') { - types.push(XPathParser.LESSTHANOREQUAL); - values.push("<="); - pos++; - c = s.charAt(pos++); - continue; - } - types.push(XPathParser.LESSTHAN); - values.push('<'); - c = s.charAt(pos++); - continue; - } - - if (c == '>') { - if (s.charAt(pos) == '=') { - types.push(XPathParser.GREATERTHANOREQUAL); - values.push(">="); - pos++; - c = s.charAt(pos++); - continue; - } - types.push(XPathParser.GREATERTHAN); - values.push('>'); - c = s.charAt(pos++); - continue; - } - - if (c == '_' || Utilities.isLetter(c.charCodeAt(0))) { - var name = c; - c = s.charAt(pos++); - while (Utilities.isNCNameChar(c.charCodeAt(0))) { - name += c; - c = s.charAt(pos++); - } - if (types.length > 0) { - var last = types[types.length - 1]; - if (last != XPathParser.AT - && last != XPathParser.DOUBLECOLON - && last != XPathParser.LEFTPARENTHESIS - && last != XPathParser.LEFTBRACKET - && last != XPathParser.AND - && last != XPathParser.OR - && last != XPathParser.MOD - && last != XPathParser.DIV - && last != XPathParser.MULTIPLYOPERATOR - && last != XPathParser.SLASH - && last != XPathParser.DOUBLESLASH - && last != XPathParser.BAR - && last != XPathParser.PLUS - && last != XPathParser.MINUS - && last != XPathParser.EQUALS - && last != XPathParser.NOTEQUAL - && last != XPathParser.LESSTHAN - && last != XPathParser.LESSTHANOREQUAL - && last != XPathParser.GREATERTHAN - && last != XPathParser.GREATERTHANOREQUAL) { - if (name == "and") { - types.push(XPathParser.AND); - values.push(name); - continue; - } - if (name == "or") { - types.push(XPathParser.OR); - values.push(name); - continue; - } - if (name == "mod") { - types.push(XPathParser.MOD); - values.push(name); - continue; - } - if (name == "div") { - types.push(XPathParser.DIV); - values.push(name); - continue; - } - } - } - if (c == ':') { - if (s.charAt(pos) == '*') { - types.push(XPathParser.NCNAMECOLONASTERISK); - values.push(name + ":*"); - pos++; - c = s.charAt(pos++); - continue; - } - if (s.charAt(pos) == '_' || Utilities.isLetter(s.charCodeAt(pos))) { - name += ':'; - c = s.charAt(pos++); - while (Utilities.isNCNameChar(c.charCodeAt(0))) { - name += c; - c = s.charAt(pos++); - } - if (c == '(') { - types.push(XPathParser.FUNCTIONNAME); - values.push(name); - continue; - } - types.push(XPathParser.QNAME); - values.push(name); - continue; - } - if (s.charAt(pos) == ':') { - types.push(XPathParser.AXISNAME); - values.push(name); - continue; - } - } - if (c == '(') { - if (name == "comment" || name == "text" || name == "node") { - types.push(XPathParser.NODETYPE); - values.push(name); - continue; - } - if (name == "processing-instruction") { - if (s.charAt(pos) == ')') { - types.push(XPathParser.NODETYPE); - } else { - types.push(XPathParser.PROCESSINGINSTRUCTIONWITHLITERAL); - } - values.push(name); - continue; - } - types.push(XPathParser.FUNCTIONNAME); - values.push(name); - continue; - } - types.push(XPathParser.QNAME); - values.push(name); - continue; - } - - throw new Error("Unexpected character " + c); - } - types.push(1); - values.push("[EOF]"); - return [types, values]; -}; - -XPathParser.SHIFT = 's'; -XPathParser.REDUCE = 'r'; -XPathParser.ACCEPT = 'a'; - -XPathParser.prototype.parse = function(s) { - var types; - var values; - var res = this.tokenize(s); - if (res == undefined) { - return undefined; - } - types = res[0]; - values = res[1]; - var tokenPos = 0; - var state = []; - var tokenType = []; - var tokenValue = []; - var s; - var a; - var t; - - state.push(0); - tokenType.push(1); - tokenValue.push("_S"); - - a = types[tokenPos]; - t = values[tokenPos++]; - while (1) { - s = state[state.length - 1]; - switch (XPathParser.actionTable[s].charAt(a - 1)) { - case XPathParser.SHIFT: - tokenType.push(-a); - tokenValue.push(t); - state.push(XPathParser.actionTableNumber[s].charCodeAt(a - 1) - 32); - a = types[tokenPos]; - t = values[tokenPos++]; - break; - case XPathParser.REDUCE: - var num = XPathParser.productions[XPathParser.actionTableNumber[s].charCodeAt(a - 1) - 32][1]; - var rhs = []; - for (var i = 0; i < num; i++) { - tokenType.pop(); - rhs.unshift(tokenValue.pop()); - state.pop(); - } - var s_ = state[state.length - 1]; - tokenType.push(XPathParser.productions[XPathParser.actionTableNumber[s].charCodeAt(a - 1) - 32][0]); - if (this.reduceActions[XPathParser.actionTableNumber[s].charCodeAt(a - 1) - 32] == undefined) { - tokenValue.push(rhs[0]); - } else { - tokenValue.push(this.reduceActions[XPathParser.actionTableNumber[s].charCodeAt(a - 1) - 32](rhs)); - } - state.push(XPathParser.gotoTable[s_].charCodeAt(XPathParser.productions[XPathParser.actionTableNumber[s].charCodeAt(a - 1) - 32][0] - 2) - 33); - break; - case XPathParser.ACCEPT: - return new XPath(tokenValue.pop()); - default: - throw new Error("XPath parse error"); - } - } -}; - -// XPath ///////////////////////////////////////////////////////////////////// - -XPath.prototype = new Object(); -XPath.prototype.constructor = XPath; -XPath.superclass = Object.prototype; - -function XPath(e) { - this.expression = e; -} - -XPath.prototype.toString = function() { - return this.expression.toString(); -}; - -function setIfUnset(obj, prop, value) { - if (!(prop in obj)) { - obj[prop] = value; - } -} - -XPath.prototype.evaluate = function(c) { - c.contextNode = c.expressionContextNode; - c.contextSize = 1; - c.contextPosition = 1; - - // [2017-11-25] Removed usage of .implementation.hasFeature() since it does - // not reliably detect HTML DOMs (always returns false in xmldom and true in browsers) - if (c.isHtml) { - setIfUnset(c, 'caseInsensitive', true); - setIfUnset(c, 'allowAnyNamespaceForNoPrefix', true); - } - - setIfUnset(c, 'caseInsensitive', false); - - return this.expression.evaluate(c); -}; - -XPath.XML_NAMESPACE_URI = "http://www.w3.org/XML/1998/namespace"; -XPath.XMLNS_NAMESPACE_URI = "http://www.w3.org/2000/xmlns/"; - -// Expression //////////////////////////////////////////////////////////////// - -Expression.prototype = new Object(); -Expression.prototype.constructor = Expression; -Expression.superclass = Object.prototype; - -function Expression() { -} - -Expression.prototype.init = function() { -}; - -Expression.prototype.toString = function() { - return ""; -}; - -Expression.prototype.evaluate = function(c) { - throw new Error("Could not evaluate expression."); -}; - -// UnaryOperation //////////////////////////////////////////////////////////// - -UnaryOperation.prototype = new Expression(); -UnaryOperation.prototype.constructor = UnaryOperation; -UnaryOperation.superclass = Expression.prototype; - -function UnaryOperation(rhs) { - if (arguments.length > 0) { - this.init(rhs); - } -} - -UnaryOperation.prototype.init = function(rhs) { - this.rhs = rhs; -}; - -// UnaryMinusOperation /////////////////////////////////////////////////////// - -UnaryMinusOperation.prototype = new UnaryOperation(); -UnaryMinusOperation.prototype.constructor = UnaryMinusOperation; -UnaryMinusOperation.superclass = UnaryOperation.prototype; - -function UnaryMinusOperation(rhs) { - if (arguments.length > 0) { - this.init(rhs); - } -} - -UnaryMinusOperation.prototype.init = function(rhs) { - UnaryMinusOperation.superclass.init.call(this, rhs); -}; - -UnaryMinusOperation.prototype.evaluate = function(c) { - return this.rhs.evaluate(c).number().negate(); -}; - -UnaryMinusOperation.prototype.toString = function() { - return "-" + this.rhs.toString(); -}; - -// BinaryOperation /////////////////////////////////////////////////////////// - -BinaryOperation.prototype = new Expression(); -BinaryOperation.prototype.constructor = BinaryOperation; -BinaryOperation.superclass = Expression.prototype; - -function BinaryOperation(lhs, rhs) { - if (arguments.length > 0) { - this.init(lhs, rhs); - } -} - -BinaryOperation.prototype.init = function(lhs, rhs) { - this.lhs = lhs; - this.rhs = rhs; -}; - -// OrOperation /////////////////////////////////////////////////////////////// - -OrOperation.prototype = new BinaryOperation(); -OrOperation.prototype.constructor = OrOperation; -OrOperation.superclass = BinaryOperation.prototype; - -function OrOperation(lhs, rhs) { - if (arguments.length > 0) { - this.init(lhs, rhs); - } -} - -OrOperation.prototype.init = function(lhs, rhs) { - OrOperation.superclass.init.call(this, lhs, rhs); -}; - -OrOperation.prototype.toString = function() { - return "(" + this.lhs.toString() + " or " + this.rhs.toString() + ")"; -}; - -OrOperation.prototype.evaluate = function(c) { - var b = this.lhs.evaluate(c).bool(); - if (b.booleanValue()) { - return b; - } - return this.rhs.evaluate(c).bool(); -}; - -// AndOperation ////////////////////////////////////////////////////////////// - -AndOperation.prototype = new BinaryOperation(); -AndOperation.prototype.constructor = AndOperation; -AndOperation.superclass = BinaryOperation.prototype; - -function AndOperation(lhs, rhs) { - if (arguments.length > 0) { - this.init(lhs, rhs); - } -} - -AndOperation.prototype.init = function(lhs, rhs) { - AndOperation.superclass.init.call(this, lhs, rhs); -}; - -AndOperation.prototype.toString = function() { - return "(" + this.lhs.toString() + " and " + this.rhs.toString() + ")"; -}; - -AndOperation.prototype.evaluate = function(c) { - var b = this.lhs.evaluate(c).bool(); - if (!b.booleanValue()) { - return b; - } - return this.rhs.evaluate(c).bool(); -}; - -// EqualsOperation /////////////////////////////////////////////////////////// - -EqualsOperation.prototype = new BinaryOperation(); -EqualsOperation.prototype.constructor = EqualsOperation; -EqualsOperation.superclass = BinaryOperation.prototype; - -function EqualsOperation(lhs, rhs) { - if (arguments.length > 0) { - this.init(lhs, rhs); - } -} - -EqualsOperation.prototype.init = function(lhs, rhs) { - EqualsOperation.superclass.init.call(this, lhs, rhs); -}; - -EqualsOperation.prototype.toString = function() { - return "(" + this.lhs.toString() + " = " + this.rhs.toString() + ")"; -}; - -EqualsOperation.prototype.evaluate = function(c) { - return this.lhs.evaluate(c).equals(this.rhs.evaluate(c)); -}; - -// NotEqualOperation ///////////////////////////////////////////////////////// - -NotEqualOperation.prototype = new BinaryOperation(); -NotEqualOperation.prototype.constructor = NotEqualOperation; -NotEqualOperation.superclass = BinaryOperation.prototype; - -function NotEqualOperation(lhs, rhs) { - if (arguments.length > 0) { - this.init(lhs, rhs); - } -} - -NotEqualOperation.prototype.init = function(lhs, rhs) { - NotEqualOperation.superclass.init.call(this, lhs, rhs); -}; - -NotEqualOperation.prototype.toString = function() { - return "(" + this.lhs.toString() + " != " + this.rhs.toString() + ")"; -}; - -NotEqualOperation.prototype.evaluate = function(c) { - return this.lhs.evaluate(c).notequal(this.rhs.evaluate(c)); -}; - -// LessThanOperation ///////////////////////////////////////////////////////// - -LessThanOperation.prototype = new BinaryOperation(); -LessThanOperation.prototype.constructor = LessThanOperation; -LessThanOperation.superclass = BinaryOperation.prototype; - -function LessThanOperation(lhs, rhs) { - if (arguments.length > 0) { - this.init(lhs, rhs); - } -} - -LessThanOperation.prototype.init = function(lhs, rhs) { - LessThanOperation.superclass.init.call(this, lhs, rhs); -}; - -LessThanOperation.prototype.evaluate = function(c) { - return this.lhs.evaluate(c).lessthan(this.rhs.evaluate(c)); -}; - -LessThanOperation.prototype.toString = function() { - return "(" + this.lhs.toString() + " < " + this.rhs.toString() + ")"; -}; - -// GreaterThanOperation ////////////////////////////////////////////////////// - -GreaterThanOperation.prototype = new BinaryOperation(); -GreaterThanOperation.prototype.constructor = GreaterThanOperation; -GreaterThanOperation.superclass = BinaryOperation.prototype; - -function GreaterThanOperation(lhs, rhs) { - if (arguments.length > 0) { - this.init(lhs, rhs); - } -} - -GreaterThanOperation.prototype.init = function(lhs, rhs) { - GreaterThanOperation.superclass.init.call(this, lhs, rhs); -}; - -GreaterThanOperation.prototype.evaluate = function(c) { - return this.lhs.evaluate(c).greaterthan(this.rhs.evaluate(c)); -}; - -GreaterThanOperation.prototype.toString = function() { - return "(" + this.lhs.toString() + " > " + this.rhs.toString() + ")"; -}; - -// LessThanOrEqualOperation ////////////////////////////////////////////////// - -LessThanOrEqualOperation.prototype = new BinaryOperation(); -LessThanOrEqualOperation.prototype.constructor = LessThanOrEqualOperation; -LessThanOrEqualOperation.superclass = BinaryOperation.prototype; - -function LessThanOrEqualOperation(lhs, rhs) { - if (arguments.length > 0) { - this.init(lhs, rhs); - } -} - -LessThanOrEqualOperation.prototype.init = function(lhs, rhs) { - LessThanOrEqualOperation.superclass.init.call(this, lhs, rhs); -}; - -LessThanOrEqualOperation.prototype.evaluate = function(c) { - return this.lhs.evaluate(c).lessthanorequal(this.rhs.evaluate(c)); -}; - -LessThanOrEqualOperation.prototype.toString = function() { - return "(" + this.lhs.toString() + " <= " + this.rhs.toString() + ")"; -}; - -// GreaterThanOrEqualOperation /////////////////////////////////////////////// - -GreaterThanOrEqualOperation.prototype = new BinaryOperation(); -GreaterThanOrEqualOperation.prototype.constructor = GreaterThanOrEqualOperation; -GreaterThanOrEqualOperation.superclass = BinaryOperation.prototype; - -function GreaterThanOrEqualOperation(lhs, rhs) { - if (arguments.length > 0) { - this.init(lhs, rhs); - } -} - -GreaterThanOrEqualOperation.prototype.init = function(lhs, rhs) { - GreaterThanOrEqualOperation.superclass.init.call(this, lhs, rhs); -}; - -GreaterThanOrEqualOperation.prototype.evaluate = function(c) { - return this.lhs.evaluate(c).greaterthanorequal(this.rhs.evaluate(c)); -}; - -GreaterThanOrEqualOperation.prototype.toString = function() { - return "(" + this.lhs.toString() + " >= " + this.rhs.toString() + ")"; -}; - -// PlusOperation ///////////////////////////////////////////////////////////// - -PlusOperation.prototype = new BinaryOperation(); -PlusOperation.prototype.constructor = PlusOperation; -PlusOperation.superclass = BinaryOperation.prototype; - -function PlusOperation(lhs, rhs) { - if (arguments.length > 0) { - this.init(lhs, rhs); - } -} - -PlusOperation.prototype.init = function(lhs, rhs) { - PlusOperation.superclass.init.call(this, lhs, rhs); -}; - -PlusOperation.prototype.evaluate = function(c) { - return this.lhs.evaluate(c).number().plus(this.rhs.evaluate(c).number()); -}; - -PlusOperation.prototype.toString = function() { - return "(" + this.lhs.toString() + " + " + this.rhs.toString() + ")"; -}; - -// MinusOperation //////////////////////////////////////////////////////////// - -MinusOperation.prototype = new BinaryOperation(); -MinusOperation.prototype.constructor = MinusOperation; -MinusOperation.superclass = BinaryOperation.prototype; - -function MinusOperation(lhs, rhs) { - if (arguments.length > 0) { - this.init(lhs, rhs); - } -} - -MinusOperation.prototype.init = function(lhs, rhs) { - MinusOperation.superclass.init.call(this, lhs, rhs); -}; - -MinusOperation.prototype.evaluate = function(c) { - return this.lhs.evaluate(c).number().minus(this.rhs.evaluate(c).number()); -}; - -MinusOperation.prototype.toString = function() { - return "(" + this.lhs.toString() + " - " + this.rhs.toString() + ")"; -}; - -// MultiplyOperation ///////////////////////////////////////////////////////// - -MultiplyOperation.prototype = new BinaryOperation(); -MultiplyOperation.prototype.constructor = MultiplyOperation; -MultiplyOperation.superclass = BinaryOperation.prototype; - -function MultiplyOperation(lhs, rhs) { - if (arguments.length > 0) { - this.init(lhs, rhs); - } -} - -MultiplyOperation.prototype.init = function(lhs, rhs) { - MultiplyOperation.superclass.init.call(this, lhs, rhs); -}; - -MultiplyOperation.prototype.evaluate = function(c) { - return this.lhs.evaluate(c).number().multiply(this.rhs.evaluate(c).number()); -}; - -MultiplyOperation.prototype.toString = function() { - return "(" + this.lhs.toString() + " * " + this.rhs.toString() + ")"; -}; - -// DivOperation ////////////////////////////////////////////////////////////// - -DivOperation.prototype = new BinaryOperation(); -DivOperation.prototype.constructor = DivOperation; -DivOperation.superclass = BinaryOperation.prototype; - -function DivOperation(lhs, rhs) { - if (arguments.length > 0) { - this.init(lhs, rhs); - } -} - -DivOperation.prototype.init = function(lhs, rhs) { - DivOperation.superclass.init.call(this, lhs, rhs); -}; - -DivOperation.prototype.evaluate = function(c) { - return this.lhs.evaluate(c).number().div(this.rhs.evaluate(c).number()); -}; - -DivOperation.prototype.toString = function() { - return "(" + this.lhs.toString() + " div " + this.rhs.toString() + ")"; -}; - -// ModOperation ////////////////////////////////////////////////////////////// - -ModOperation.prototype = new BinaryOperation(); -ModOperation.prototype.constructor = ModOperation; -ModOperation.superclass = BinaryOperation.prototype; - -function ModOperation(lhs, rhs) { - if (arguments.length > 0) { - this.init(lhs, rhs); - } -} - -ModOperation.prototype.init = function(lhs, rhs) { - ModOperation.superclass.init.call(this, lhs, rhs); -}; - -ModOperation.prototype.evaluate = function(c) { - return this.lhs.evaluate(c).number().mod(this.rhs.evaluate(c).number()); -}; - -ModOperation.prototype.toString = function() { - return "(" + this.lhs.toString() + " mod " + this.rhs.toString() + ")"; -}; - -// BarOperation ////////////////////////////////////////////////////////////// - -BarOperation.prototype = new BinaryOperation(); -BarOperation.prototype.constructor = BarOperation; -BarOperation.superclass = BinaryOperation.prototype; - -function BarOperation(lhs, rhs) { - if (arguments.length > 0) { - this.init(lhs, rhs); - } -} - -BarOperation.prototype.init = function(lhs, rhs) { - BarOperation.superclass.init.call(this, lhs, rhs); -}; - -BarOperation.prototype.evaluate = function(c) { - return this.lhs.evaluate(c).nodeset().union(this.rhs.evaluate(c).nodeset()); -}; - -BarOperation.prototype.toString = function() { - return map(toString, [this.lhs, this.rhs]).join(' | '); -}; - -// PathExpr ////////////////////////////////////////////////////////////////// - -PathExpr.prototype = new Expression(); -PathExpr.prototype.constructor = PathExpr; -PathExpr.superclass = Expression.prototype; - -function PathExpr(filter, filterPreds, locpath) { - if (arguments.length > 0) { - this.init(filter, filterPreds, locpath); - } -} - -PathExpr.prototype.init = function(filter, filterPreds, locpath) { - PathExpr.superclass.init.call(this); - this.filter = filter; - this.filterPredicates = filterPreds; - this.locationPath = locpath; -}; - -/** - * Returns the topmost node of the tree containing node - */ -function findRoot(node) { - while (node && node.parentNode) { - node = node.parentNode; - } - - return node; -} - -PathExpr.applyPredicates = function (predicates, c, nodes) { - return reduce(function (inNodes, pred) { - var ctx = c.extend({ contextSize: inNodes.length }); - - return filter(function (node, i) { - return PathExpr.predicateMatches(pred, ctx.extend({ contextNode: node, contextPosition: i + 1 })); - }, inNodes); - }, nodes, predicates); -}; - -PathExpr.getRoot = function (xpc, nodes) { - var firstNode = nodes[0]; - - if (firstNode.nodeType === 9 /*Node.DOCUMENT_NODE*/) { - return firstNode; - } - - if (xpc.virtualRoot) { - return xpc.virtualRoot; - } - - var ownerDoc = firstNode.ownerDocument; - - if (ownerDoc) { - return ownerDoc; - } - - // IE 5.5 doesn't have ownerDocument? - var n = firstNode; - while (n.parentNode != null) { - n = n.parentNode; - } - return n; -} - -PathExpr.applyStep = function (step, xpc, node) { - var self = this; - var newNodes = []; - xpc.contextNode = node; - - switch (step.axis) { - case Step.ANCESTOR: - // look at all the ancestor nodes - if (xpc.contextNode === xpc.virtualRoot) { - break; - } - var m; - if (xpc.contextNode.nodeType == 2 /*Node.ATTRIBUTE_NODE*/) { - m = PathExpr.getOwnerElement(xpc.contextNode); - } else { - m = xpc.contextNode.parentNode; - } - while (m != null) { - if (step.nodeTest.matches(m, xpc)) { - newNodes.push(m); - } - if (m === xpc.virtualRoot) { - break; - } - m = m.parentNode; - } - break; - - case Step.ANCESTORORSELF: - // look at all the ancestor nodes and the current node - for (var m = xpc.contextNode; m != null; m = m.nodeType == 2 /*Node.ATTRIBUTE_NODE*/ ? PathExpr.getOwnerElement(m) : m.parentNode) { - if (step.nodeTest.matches(m, xpc)) { - newNodes.push(m); - } - if (m === xpc.virtualRoot) { - break; - } - } - break; - - case Step.ATTRIBUTE: - // look at the attributes - var nnm = xpc.contextNode.attributes; - if (nnm != null) { - for (var k = 0; k < nnm.length; k++) { - var m = nnm.item(k); - if (step.nodeTest.matches(m, xpc)) { - newNodes.push(m); - } - } - } - break; - - case Step.CHILD: - // look at all child elements - for (var m = xpc.contextNode.firstChild; m != null; m = m.nextSibling) { - if (step.nodeTest.matches(m, xpc)) { - newNodes.push(m); - } - } - break; - - case Step.DESCENDANT: - // look at all descendant nodes - var st = [ xpc.contextNode.firstChild ]; - while (st.length > 0) { - for (var m = st.pop(); m != null; ) { - if (step.nodeTest.matches(m, xpc)) { - newNodes.push(m); - } - if (m.firstChild != null) { - st.push(m.nextSibling); - m = m.firstChild; - } else { - m = m.nextSibling; - } - } - } - break; - - case Step.DESCENDANTORSELF: - // look at self - if (step.nodeTest.matches(xpc.contextNode, xpc)) { - newNodes.push(xpc.contextNode); - } - // look at all descendant nodes - var st = [ xpc.contextNode.firstChild ]; - while (st.length > 0) { - for (var m = st.pop(); m != null; ) { - if (step.nodeTest.matches(m, xpc)) { - newNodes.push(m); - } - if (m.firstChild != null) { - st.push(m.nextSibling); - m = m.firstChild; - } else { - m = m.nextSibling; - } - } - } - break; - - case Step.FOLLOWING: - if (xpc.contextNode === xpc.virtualRoot) { - break; - } - var st = []; - if (xpc.contextNode.firstChild != null) { - st.unshift(xpc.contextNode.firstChild); - } else { - st.unshift(xpc.contextNode.nextSibling); - } - for (var m = xpc.contextNode.parentNode; m != null && m.nodeType != 9 /*Node.DOCUMENT_NODE*/ && m !== xpc.virtualRoot; m = m.parentNode) { - st.unshift(m.nextSibling); - } - do { - for (var m = st.pop(); m != null; ) { - if (step.nodeTest.matches(m, xpc)) { - newNodes.push(m); - } - if (m.firstChild != null) { - st.push(m.nextSibling); - m = m.firstChild; - } else { - m = m.nextSibling; - } - } - } while (st.length > 0); - break; - - case Step.FOLLOWINGSIBLING: - if (xpc.contextNode === xpc.virtualRoot) { - break; - } - for (var m = xpc.contextNode.nextSibling; m != null; m = m.nextSibling) { - if (step.nodeTest.matches(m, xpc)) { - newNodes.push(m); - } - } - break; - - case Step.NAMESPACE: - var n = {}; - if (xpc.contextNode.nodeType == 1 /*Node.ELEMENT_NODE*/) { - n["xml"] = XPath.XML_NAMESPACE_URI; - n["xmlns"] = XPath.XMLNS_NAMESPACE_URI; - for (var m = xpc.contextNode; m != null && m.nodeType == 1 /*Node.ELEMENT_NODE*/; m = m.parentNode) { - for (var k = 0; k < m.attributes.length; k++) { - var attr = m.attributes.item(k); - var nm = String(attr.name); - if (nm == "xmlns") { - if (n[""] == undefined) { - n[""] = attr.value; - } - } else if (nm.length > 6 && nm.substring(0, 6) == "xmlns:") { - var pre = nm.substring(6, nm.length); - if (n[pre] == undefined) { - n[pre] = attr.value; - } - } - } - } - for (var pre in n) { - var nsn = new XPathNamespace(pre, n[pre], xpc.contextNode); - if (step.nodeTest.matches(nsn, xpc)) { - newNodes.push(nsn); - } - } - } - break; - - case Step.PARENT: - m = null; - if (xpc.contextNode !== xpc.virtualRoot) { - if (xpc.contextNode.nodeType == 2 /*Node.ATTRIBUTE_NODE*/) { - m = PathExpr.getOwnerElement(xpc.contextNode); - } else { - m = xpc.contextNode.parentNode; - } - } - if (m != null && step.nodeTest.matches(m, xpc)) { - newNodes.push(m); - } - break; - - case Step.PRECEDING: - var st; - if (xpc.virtualRoot != null) { - st = [ xpc.virtualRoot ]; - } else { - // cannot rely on .ownerDocument because the node may be in a document fragment - st = [findRoot(xpc.contextNode)]; - } - outer: while (st.length > 0) { - for (var m = st.pop(); m != null; ) { - if (m == xpc.contextNode) { - break outer; - } - if (step.nodeTest.matches(m, xpc)) { - newNodes.unshift(m); - } - if (m.firstChild != null) { - st.push(m.nextSibling); - m = m.firstChild; - } else { - m = m.nextSibling; - } - } - } - break; - - case Step.PRECEDINGSIBLING: - if (xpc.contextNode === xpc.virtualRoot) { - break; - } - for (var m = xpc.contextNode.previousSibling; m != null; m = m.previousSibling) { - if (step.nodeTest.matches(m, xpc)) { - newNodes.push(m); - } - } - break; - - case Step.SELF: - if (step.nodeTest.matches(xpc.contextNode, xpc)) { - newNodes.push(xpc.contextNode); - } - break; - - default: - } - - return newNodes; -}; - -PathExpr.applySteps = function (steps, xpc, nodes) { - return reduce(function (inNodes, step) { - return [].concat.apply([], map(function (node) { - return PathExpr.applyPredicates(step.predicates, xpc, PathExpr.applyStep(step, xpc, node)); - }, inNodes)); - }, nodes, steps); -} - -PathExpr.prototype.applyFilter = function(c, xpc) { - if (!this.filter) { - return { nodes: [ c.contextNode ] }; - } - - var ns = this.filter.evaluate(c); - - if (!Utilities.instance_of(ns, XNodeSet)) { - if (this.filterPredicates != null && this.filterPredicates.length > 0 || this.locationPath != null) { - throw new Error("Path expression filter must evaluate to a nodeset if predicates or location path are used"); - } - - return { nonNodes: ns }; - } - - return { - nodes: PathExpr.applyPredicates(this.filterPredicates || [], xpc, ns.toUnsortedArray()) - }; -}; - -PathExpr.applyLocationPath = function (locationPath, xpc, nodes) { - if (!locationPath) { - return nodes; - } - - var startNodes = locationPath.absolute ? [ PathExpr.getRoot(xpc, nodes) ] : nodes; - - return PathExpr.applySteps(locationPath.steps, xpc, startNodes); -}; - -PathExpr.prototype.evaluate = function(c) { - var xpc = assign(new XPathContext(), c); - - var filterResult = this.applyFilter(c, xpc); - - if ('nonNodes' in filterResult) { - return filterResult.nonNodes; - } - - var ns = new XNodeSet(); - ns.addArray(PathExpr.applyLocationPath(this.locationPath, xpc, filterResult.nodes)); - return ns; -}; - -PathExpr.predicateMatches = function(pred, c) { - var res = pred.evaluate(c); - - return Utilities.instance_of(res, XNumber) - ? c.contextPosition == res.numberValue() - : res.booleanValue(); -}; - -PathExpr.predicateString = compose(wrap('[', ']'), toString); -PathExpr.predicatesString = compose(join(''), map(PathExpr.predicateString)); - -PathExpr.prototype.toString = function() { - if (this.filter != undefined) { - var filterStr = toString(this.filter); - - if (Utilities.instance_of(this.filter, XString)) { - return wrap("'", "'", filterStr); - } - if (this.filterPredicates != undefined && this.filterPredicates.length) { - return wrap('(', ')', filterStr) + - PathExpr.predicatesString(this.filterPredicates); - } - if (this.locationPath != undefined) { - return filterStr + - (this.locationPath.absolute ? '' : '/') + - toString(this.locationPath); - } - - return filterStr; - } - - return toString(this.locationPath); -}; - -PathExpr.getOwnerElement = function(n) { - // DOM 2 has ownerElement - if (n.ownerElement) { - return n.ownerElement; - } - // DOM 1 Internet Explorer can use selectSingleNode (ironically) - try { - if (n.selectSingleNode) { - return n.selectSingleNode(".."); - } - } catch (e) { - } - // Other DOM 1 implementations must use this egregious search - var doc = n.nodeType == 9 /*Node.DOCUMENT_NODE*/ - ? n - : n.ownerDocument; - var elts = doc.getElementsByTagName("*"); - for (var i = 0; i < elts.length; i++) { - var elt = elts.item(i); - var nnm = elt.attributes; - for (var j = 0; j < nnm.length; j++) { - var an = nnm.item(j); - if (an === n) { - return elt; - } - } - } - return null; -}; - -// LocationPath ////////////////////////////////////////////////////////////// - -LocationPath.prototype = new Object(); -LocationPath.prototype.constructor = LocationPath; -LocationPath.superclass = Object.prototype; - -function LocationPath(abs, steps) { - if (arguments.length > 0) { - this.init(abs, steps); - } -} - -LocationPath.prototype.init = function(abs, steps) { - this.absolute = abs; - this.steps = steps; -}; - -LocationPath.prototype.toString = function() { - return ( - (this.absolute ? '/' : '') + - map(toString, this.steps).join('/') - ); -}; - -// Step ////////////////////////////////////////////////////////////////////// - -Step.prototype = new Object(); -Step.prototype.constructor = Step; -Step.superclass = Object.prototype; - -function Step(axis, nodetest, preds) { - if (arguments.length > 0) { - this.init(axis, nodetest, preds); - } -} - -Step.prototype.init = function(axis, nodetest, preds) { - this.axis = axis; - this.nodeTest = nodetest; - this.predicates = preds; -}; - -Step.prototype.toString = function() { - return Step.STEPNAMES[this.axis] + - "::" + - this.nodeTest.toString() + - PathExpr.predicatesString(this.predicates); -}; - - -Step.ANCESTOR = 0; -Step.ANCESTORORSELF = 1; -Step.ATTRIBUTE = 2; -Step.CHILD = 3; -Step.DESCENDANT = 4; -Step.DESCENDANTORSELF = 5; -Step.FOLLOWING = 6; -Step.FOLLOWINGSIBLING = 7; -Step.NAMESPACE = 8; -Step.PARENT = 9; -Step.PRECEDING = 10; -Step.PRECEDINGSIBLING = 11; -Step.SELF = 12; - -Step.STEPNAMES = reduce(function (acc, x) { return acc[x[0]] = x[1], acc; }, {}, [ - [Step.ANCESTOR, 'ancestor'], - [Step.ANCESTORORSELF, 'ancestor-or-self'], - [Step.ATTRIBUTE, 'attribute'], - [Step.CHILD, 'child'], - [Step.DESCENDANT, 'descendant'], - [Step.DESCENDANTORSELF, 'descendant-or-self'], - [Step.FOLLOWING, 'following'], - [Step.FOLLOWINGSIBLING, 'following-sibling'], - [Step.NAMESPACE, 'namespace'], - [Step.PARENT, 'parent'], - [Step.PRECEDING, 'preceding'], - [Step.PRECEDINGSIBLING, 'preceding-sibling'], - [Step.SELF, 'self'] - ]); - -// NodeTest ////////////////////////////////////////////////////////////////// - -NodeTest.prototype = new Object(); -NodeTest.prototype.constructor = NodeTest; -NodeTest.superclass = Object.prototype; - -function NodeTest(type, value) { - if (arguments.length > 0) { - this.init(type, value); - } -} - -NodeTest.prototype.init = function(type, value) { - this.type = type; - this.value = value; -}; - -NodeTest.prototype.toString = function() { - return ""; -}; - -NodeTest.prototype.matches = function (n, xpc) { - console.warn('unknown node test type'); -}; - -NodeTest.NAMETESTANY = 0; -NodeTest.NAMETESTPREFIXANY = 1; -NodeTest.NAMETESTQNAME = 2; -NodeTest.COMMENT = 3; -NodeTest.TEXT = 4; -NodeTest.PI = 5; -NodeTest.NODE = 6; - -NodeTest.isNodeType = function (types){ - return compose(includes(types), prop('nodeType')); -}; - -NodeTest.makeNodeTestType = function (type, members, ctor) { - var newType = ctor || function () {}; - - newType.prototype = new NodeTest(members.type); - newType.prototype.constructor = type; - - for (var key in members) { - newType.prototype[key] = members[key]; - } - - return newType; -}; -// create invariant node test for certain node types -NodeTest.makeNodeTypeTest = function (type, nodeTypes, stringVal) { - return new (NodeTest.makeNodeTestType(type, { - matches: NodeTest.isNodeType(nodeTypes), - toString: always(stringVal) - }))(); -}; - -NodeTest.hasPrefix = function (node) { - return node.prefix || (node.nodeName || node.tagName).indexOf(':') !== -1; -}; - -NodeTest.isElementOrAttribute = NodeTest.isNodeType([1, 2]); -NodeTest.nameSpaceMatches = function (prefix, xpc, n) { - var nNamespace = (n.namespaceURI || ''); - - if (!prefix) { - return !nNamespace || (xpc.allowAnyNamespaceForNoPrefix && !NodeTest.hasPrefix(n)); - } - - var ns = xpc.namespaceResolver.getNamespace(prefix, xpc.expressionContextNode); - - if (ns == null) { - throw new Error("Cannot resolve QName " + prefix); - } - - return ns === nNamespace; -}; -NodeTest.localNameMatches = function (localName, xpc, n) { - var nLocalName = (n.localName || n.nodeName); - - return xpc.caseInsensitive - ? localName.toLowerCase() === nLocalName.toLowerCase() - : localName === nLocalName; -}; - -NodeTest.NameTestPrefixAny = NodeTest.makeNodeTestType(NodeTest.NAMETESTPREFIXANY, { - matches: function (n, xpc){ - return NodeTest.isElementOrAttribute(n) && - NodeTest.nameSpaceMatches(this.prefix, xpc, n); - }, - toString: function () { - return this.prefix + ":*"; - } -}, function (prefix) { this.prefix = prefix; }); - -NodeTest.NameTestQName = NodeTest.makeNodeTestType(NodeTest.NAMETESTQNAME, { - matches: function (n, xpc) { - return NodeTest.isNodeType([1, 2, XPathNamespace.XPATH_NAMESPACE_NODE])(n) && - NodeTest.nameSpaceMatches(this.prefix, xpc, n) && - NodeTest.localNameMatches(this.localName, xpc, n); - }, - toString: function () { - return this.name; - } -}, function (name) { - var nameParts = name.split(':'); - - this.name = name; - this.prefix = nameParts.length > 1 ? nameParts[0] : null; - this.localName = nameParts[nameParts.length > 1 ? 1 : 0]; -}); - -NodeTest.PITest = NodeTest.makeNodeTestType(NodeTest.PI, { - matches: function (n, xpc) { - return NodeTest.isNodeType([7])(n) && (n.target || n.nodeName) === this.name; - }, - toString: function () { - return wrap('processing-instruction("', '")', this.name); - } -}, function (name) { this.name = name; }) - -// singletons - -// elements, attributes, namespaces -NodeTest.nameTestAny = NodeTest.makeNodeTypeTest(NodeTest.NAMETESTANY, [1, 2, XPathNamespace.XPATH_NAMESPACE_NODE], '*'); -// text, cdata -NodeTest.textTest = NodeTest.makeNodeTypeTest(NodeTest.TEXT, [3, 4], 'text()'); -NodeTest.commentTest = NodeTest.makeNodeTypeTest(NodeTest.COMMENT, [8], 'comment()'); -// elements, attributes, text, cdata, PIs, comments, document nodes -NodeTest.nodeTest = NodeTest.makeNodeTypeTest(NodeTest.NODE, [1, 2, 3, 4, 7, 8, 9], 'node()'); -NodeTest.anyPiTest = NodeTest.makeNodeTypeTest(NodeTest.PI, [7], 'processing-instruction()'); - -// VariableReference ///////////////////////////////////////////////////////// - -VariableReference.prototype = new Expression(); -VariableReference.prototype.constructor = VariableReference; -VariableReference.superclass = Expression.prototype; - -function VariableReference(v) { - if (arguments.length > 0) { - this.init(v); - } -} - -VariableReference.prototype.init = function(v) { - this.variable = v; -}; - -VariableReference.prototype.toString = function() { - return "$" + this.variable; -}; - -VariableReference.prototype.evaluate = function(c) { - var parts = Utilities.resolveQName(this.variable, c.namespaceResolver, c.contextNode, false); - - if (parts[0] == null) { - throw new Error("Cannot resolve QName " + fn); - } - var result = c.variableResolver.getVariable(parts[1], parts[0]); - if (!result) { - throw XPathException.fromMessage("Undeclared variable: " + this.toString()); - } - return result; -}; - -// FunctionCall ////////////////////////////////////////////////////////////// - -FunctionCall.prototype = new Expression(); -FunctionCall.prototype.constructor = FunctionCall; -FunctionCall.superclass = Expression.prototype; - -function FunctionCall(fn, args) { - if (arguments.length > 0) { - this.init(fn, args); - } -} - -FunctionCall.prototype.init = function(fn, args) { - this.functionName = fn; - this.arguments = args; -}; - -FunctionCall.prototype.toString = function() { - var s = this.functionName + "("; - for (var i = 0; i < this.arguments.length; i++) { - if (i > 0) { - s += ", "; - } - s += this.arguments[i].toString(); - } - return s + ")"; -}; - -FunctionCall.prototype.evaluate = function(c) { - var f = FunctionResolver.getFunctionFromContext(this.functionName, c); - - if (!f) { - throw new Error("Unknown function " + this.functionName); - } - - var a = [c].concat(this.arguments); - return f.apply(c.functionResolver.thisArg, a); -}; - -// Operators ///////////////////////////////////////////////////////////////// - -var Operators = new Object(); - -Operators.equals = function(l, r) { - return l.equals(r); -}; - -Operators.notequal = function(l, r) { - return l.notequal(r); -}; - -Operators.lessthan = function(l, r) { - return l.lessthan(r); -}; - -Operators.greaterthan = function(l, r) { - return l.greaterthan(r); -}; - -Operators.lessthanorequal = function(l, r) { - return l.lessthanorequal(r); -}; - -Operators.greaterthanorequal = function(l, r) { - return l.greaterthanorequal(r); -}; - -// XString /////////////////////////////////////////////////////////////////// - -XString.prototype = new Expression(); -XString.prototype.constructor = XString; -XString.superclass = Expression.prototype; - -function XString(s) { - if (arguments.length > 0) { - this.init(s); - } -} - -XString.prototype.init = function(s) { - this.str = String(s); -}; - -XString.prototype.toString = function() { - return this.str; -}; - -XString.prototype.evaluate = function(c) { - return this; -}; - -XString.prototype.string = function() { - return this; -}; - -XString.prototype.number = function() { - return new XNumber(this.str); -}; - -XString.prototype.bool = function() { - return new XBoolean(this.str); -}; - -XString.prototype.nodeset = function() { - throw new Error("Cannot convert string to nodeset"); -}; - -XString.prototype.stringValue = function() { - return this.str; -}; - -XString.prototype.numberValue = function() { - return this.number().numberValue(); -}; - -XString.prototype.booleanValue = function() { - return this.bool().booleanValue(); -}; - -XString.prototype.equals = function(r) { - if (Utilities.instance_of(r, XBoolean)) { - return this.bool().equals(r); - } - if (Utilities.instance_of(r, XNumber)) { - return this.number().equals(r); - } - if (Utilities.instance_of(r, XNodeSet)) { - return r.compareWithString(this, Operators.equals); - } - return new XBoolean(this.str == r.str); -}; - -XString.prototype.notequal = function(r) { - if (Utilities.instance_of(r, XBoolean)) { - return this.bool().notequal(r); - } - if (Utilities.instance_of(r, XNumber)) { - return this.number().notequal(r); - } - if (Utilities.instance_of(r, XNodeSet)) { - return r.compareWithString(this, Operators.notequal); - } - return new XBoolean(this.str != r.str); -}; - -XString.prototype.lessthan = function(r) { - return this.number().lessthan(r); -}; - -XString.prototype.greaterthan = function(r) { - return this.number().greaterthan(r); -}; - -XString.prototype.lessthanorequal = function(r) { - return this.number().lessthanorequal(r); -}; - -XString.prototype.greaterthanorequal = function(r) { - return this.number().greaterthanorequal(r); -}; - -// XNumber /////////////////////////////////////////////////////////////////// - -XNumber.prototype = new Expression(); -XNumber.prototype.constructor = XNumber; -XNumber.superclass = Expression.prototype; - -function XNumber(n) { - if (arguments.length > 0) { - this.init(n); - } -} - -XNumber.prototype.init = function(n) { - this.num = typeof n === "string" ? this.parse(n) : Number(n); -}; - -XNumber.prototype.numberFormat = /^\s*-?[0-9]*\.?[0-9]+\s*$/; - -XNumber.prototype.parse = function(s) { - // XPath representation of numbers is more restrictive than what Number() or parseFloat() allow - return this.numberFormat.test(s) ? parseFloat(s) : Number.NaN; -}; - -function padSmallNumber(numberStr) { - var parts = numberStr.split('e-'); - var base = parts[0].replace('.', ''); - var exponent = Number(parts[1]); - - for (var i = 0; i < exponent - 1; i += 1) { - base = '0' + base; - } - - return '0.' + base; -} - -function padLargeNumber(numberStr) { - var parts = numberStr.split('e'); - var base = parts[0].replace('.', ''); - var exponent = Number(parts[1]); - var zerosToAppend = exponent + 1 - base.length; - - for (var i = 0; i < zerosToAppend; i += 1){ - base += '0'; - } - - return base; -} - -XNumber.prototype.toString = function() { - var strValue = this.num.toString(); - - if (strValue.indexOf('e-') !== -1) { - return padSmallNumber(strValue); - } - - if (strValue.indexOf('e') !== -1) { - return padLargeNumber(strValue); - } - - return strValue; -}; - -XNumber.prototype.evaluate = function(c) { - return this; -}; - -XNumber.prototype.string = function() { - - - return new XString(this.toString()); -}; - -XNumber.prototype.number = function() { - return this; -}; - -XNumber.prototype.bool = function() { - return new XBoolean(this.num); -}; - -XNumber.prototype.nodeset = function() { - throw new Error("Cannot convert number to nodeset"); -}; - -XNumber.prototype.stringValue = function() { - return this.string().stringValue(); -}; - -XNumber.prototype.numberValue = function() { - return this.num; -}; - -XNumber.prototype.booleanValue = function() { - return this.bool().booleanValue(); -}; - -XNumber.prototype.negate = function() { - return new XNumber(-this.num); -}; - -XNumber.prototype.equals = function(r) { - if (Utilities.instance_of(r, XBoolean)) { - return this.bool().equals(r); - } - if (Utilities.instance_of(r, XString)) { - return this.equals(r.number()); - } - if (Utilities.instance_of(r, XNodeSet)) { - return r.compareWithNumber(this, Operators.equals); - } - return new XBoolean(this.num == r.num); -}; - -XNumber.prototype.notequal = function(r) { - if (Utilities.instance_of(r, XBoolean)) { - return this.bool().notequal(r); - } - if (Utilities.instance_of(r, XString)) { - return this.notequal(r.number()); - } - if (Utilities.instance_of(r, XNodeSet)) { - return r.compareWithNumber(this, Operators.notequal); - } - return new XBoolean(this.num != r.num); -}; - -XNumber.prototype.lessthan = function(r) { - if (Utilities.instance_of(r, XNodeSet)) { - return r.compareWithNumber(this, Operators.greaterthan); - } - if (Utilities.instance_of(r, XBoolean) || Utilities.instance_of(r, XString)) { - return this.lessthan(r.number()); - } - return new XBoolean(this.num < r.num); -}; - -XNumber.prototype.greaterthan = function(r) { - if (Utilities.instance_of(r, XNodeSet)) { - return r.compareWithNumber(this, Operators.lessthan); - } - if (Utilities.instance_of(r, XBoolean) || Utilities.instance_of(r, XString)) { - return this.greaterthan(r.number()); - } - return new XBoolean(this.num > r.num); -}; - -XNumber.prototype.lessthanorequal = function(r) { - if (Utilities.instance_of(r, XNodeSet)) { - return r.compareWithNumber(this, Operators.greaterthanorequal); - } - if (Utilities.instance_of(r, XBoolean) || Utilities.instance_of(r, XString)) { - return this.lessthanorequal(r.number()); - } - return new XBoolean(this.num <= r.num); -}; - -XNumber.prototype.greaterthanorequal = function(r) { - if (Utilities.instance_of(r, XNodeSet)) { - return r.compareWithNumber(this, Operators.lessthanorequal); - } - if (Utilities.instance_of(r, XBoolean) || Utilities.instance_of(r, XString)) { - return this.greaterthanorequal(r.number()); - } - return new XBoolean(this.num >= r.num); -}; - -XNumber.prototype.plus = function(r) { - return new XNumber(this.num + r.num); -}; - -XNumber.prototype.minus = function(r) { - return new XNumber(this.num - r.num); -}; - -XNumber.prototype.multiply = function(r) { - return new XNumber(this.num * r.num); -}; - -XNumber.prototype.div = function(r) { - return new XNumber(this.num / r.num); -}; - -XNumber.prototype.mod = function(r) { - return new XNumber(this.num % r.num); -}; - -// XBoolean ////////////////////////////////////////////////////////////////// - -XBoolean.prototype = new Expression(); -XBoolean.prototype.constructor = XBoolean; -XBoolean.superclass = Expression.prototype; - -function XBoolean(b) { - if (arguments.length > 0) { - this.init(b); - } -} - -XBoolean.prototype.init = function(b) { - this.b = Boolean(b); -}; - -XBoolean.prototype.toString = function() { - return this.b.toString(); -}; - -XBoolean.prototype.evaluate = function(c) { - return this; -}; - -XBoolean.prototype.string = function() { - return new XString(this.b); -}; - -XBoolean.prototype.number = function() { - return new XNumber(this.b); -}; - -XBoolean.prototype.bool = function() { - return this; -}; - -XBoolean.prototype.nodeset = function() { - throw new Error("Cannot convert boolean to nodeset"); -}; - -XBoolean.prototype.stringValue = function() { - return this.string().stringValue(); -}; - -XBoolean.prototype.numberValue = function() { - return this.number().numberValue(); -}; - -XBoolean.prototype.booleanValue = function() { - return this.b; -}; - -XBoolean.prototype.not = function() { - return new XBoolean(!this.b); -}; - -XBoolean.prototype.equals = function(r) { - if (Utilities.instance_of(r, XString) || Utilities.instance_of(r, XNumber)) { - return this.equals(r.bool()); - } - if (Utilities.instance_of(r, XNodeSet)) { - return r.compareWithBoolean(this, Operators.equals); - } - return new XBoolean(this.b == r.b); -}; - -XBoolean.prototype.notequal = function(r) { - if (Utilities.instance_of(r, XString) || Utilities.instance_of(r, XNumber)) { - return this.notequal(r.bool()); - } - if (Utilities.instance_of(r, XNodeSet)) { - return r.compareWithBoolean(this, Operators.notequal); - } - return new XBoolean(this.b != r.b); -}; - -XBoolean.prototype.lessthan = function(r) { - return this.number().lessthan(r); -}; - -XBoolean.prototype.greaterthan = function(r) { - return this.number().greaterthan(r); -}; - -XBoolean.prototype.lessthanorequal = function(r) { - return this.number().lessthanorequal(r); -}; - -XBoolean.prototype.greaterthanorequal = function(r) { - return this.number().greaterthanorequal(r); -}; - -XBoolean.true_ = new XBoolean(true); -XBoolean.false_ = new XBoolean(false); - -// AVLTree /////////////////////////////////////////////////////////////////// - -AVLTree.prototype = new Object(); -AVLTree.prototype.constructor = AVLTree; -AVLTree.superclass = Object.prototype; - -function AVLTree(n) { - this.init(n); -} - -AVLTree.prototype.init = function(n) { - this.left = null; - this.right = null; - this.node = n; - this.depth = 1; -}; - -AVLTree.prototype.balance = function() { - var ldepth = this.left == null ? 0 : this.left.depth; - var rdepth = this.right == null ? 0 : this.right.depth; - - if (ldepth > rdepth + 1) { - // LR or LL rotation - var lldepth = this.left.left == null ? 0 : this.left.left.depth; - var lrdepth = this.left.right == null ? 0 : this.left.right.depth; - - if (lldepth < lrdepth) { - // LR rotation consists of a RR rotation of the left child - this.left.rotateRR(); - // plus a LL rotation of this node, which happens anyway - } - this.rotateLL(); - } else if (ldepth + 1 < rdepth) { - // RR or RL rorarion - var rrdepth = this.right.right == null ? 0 : this.right.right.depth; - var rldepth = this.right.left == null ? 0 : this.right.left.depth; - - if (rldepth > rrdepth) { - // RR rotation consists of a LL rotation of the right child - this.right.rotateLL(); - // plus a RR rotation of this node, which happens anyway - } - this.rotateRR(); - } -}; - -AVLTree.prototype.rotateLL = function() { - // the left side is too long => rotate from the left (_not_ leftwards) - var nodeBefore = this.node; - var rightBefore = this.right; - this.node = this.left.node; - this.right = this.left; - this.left = this.left.left; - this.right.left = this.right.right; - this.right.right = rightBefore; - this.right.node = nodeBefore; - this.right.updateInNewLocation(); - this.updateInNewLocation(); -}; - -AVLTree.prototype.rotateRR = function() { - // the right side is too long => rotate from the right (_not_ rightwards) - var nodeBefore = this.node; - var leftBefore = this.left; - this.node = this.right.node; - this.left = this.right; - this.right = this.right.right; - this.left.right = this.left.left; - this.left.left = leftBefore; - this.left.node = nodeBefore; - this.left.updateInNewLocation(); - this.updateInNewLocation(); -}; - -AVLTree.prototype.updateInNewLocation = function() { - this.getDepthFromChildren(); -}; - -AVLTree.prototype.getDepthFromChildren = function() { - this.depth = this.node == null ? 0 : 1; - if (this.left != null) { - this.depth = this.left.depth + 1; - } - if (this.right != null && this.depth <= this.right.depth) { - this.depth = this.right.depth + 1; - } -}; - -function nodeOrder(n1, n2) { - if (n1 === n2) { - return 0; - } - - if (n1.compareDocumentPosition) { - var cpos = n1.compareDocumentPosition(n2); - - if (cpos & 0x01) { - // not in the same document; return an arbitrary result (is there a better way to do this) - return 1; - } - if (cpos & 0x0A) { - // n2 precedes or contains n1 - return 1; - } - if (cpos & 0x14) { - // n2 follows or is contained by n1 - return -1; - } - - return 0; - } - - var d1 = 0, - d2 = 0; - for (var m1 = n1; m1 != null; m1 = m1.parentNode || m1.ownerElement) { - d1++; - } - for (var m2 = n2; m2 != null; m2 = m2.parentNode || m2.ownerElement) { - d2++; - } - - // step up to same depth - if (d1 > d2) { - while (d1 > d2) { - n1 = n1.parentNode || n1.ownerElement; - d1--; - } - if (n1 === n2) { - return 1; - } - } else if (d2 > d1) { - while (d2 > d1) { - n2 = n2.parentNode || n2.ownerElement; - d2--; - } - if (n1 === n2) { - return -1; - } - } - - var n1Par = n1.parentNode || n1.ownerElement, - n2Par = n2.parentNode || n2.ownerElement; - - // find common parent - while (n1Par !== n2Par) { - n1 = n1Par; - n2 = n2Par; - n1Par = n1.parentNode || n1.ownerElement; - n2Par = n2.parentNode || n2.ownerElement; - } - - var n1isAttr = Utilities.isAttribute(n1); - var n2isAttr = Utilities.isAttribute(n2); - - if (n1isAttr && !n2isAttr) { - return -1; - } - if (!n1isAttr && n2isAttr) { - return 1; - } - - if(n1Par) { - var cn = n1isAttr ? n1Par.attributes : n1Par.childNodes, - len = cn.length; - for (var i = 0; i < len; i += 1) { - var n = cn[i]; - if (n === n1) { - return -1; - } - if (n === n2) { - return 1; - } - } - } - - throw new Error('Unexpected: could not determine node order'); -} - -AVLTree.prototype.add = function(n) { - if (n === this.node) { - return false; - } - - var o = nodeOrder(n, this.node); - - var ret = false; - if (o == -1) { - if (this.left == null) { - this.left = new AVLTree(n); - ret = true; - } else { - ret = this.left.add(n); - if (ret) { - this.balance(); - } - } - } else if (o == 1) { - if (this.right == null) { - this.right = new AVLTree(n); - ret = true; - } else { - ret = this.right.add(n); - if (ret) { - this.balance(); - } - } - } - - if (ret) { - this.getDepthFromChildren(); - } - return ret; -}; - -// XNodeSet ////////////////////////////////////////////////////////////////// - -XNodeSet.prototype = new Expression(); -XNodeSet.prototype.constructor = XNodeSet; -XNodeSet.superclass = Expression.prototype; - -function XNodeSet() { - this.init(); -} - -XNodeSet.prototype.init = function() { - this.tree = null; - this.nodes = []; - this.size = 0; -}; - -XNodeSet.prototype.toString = function() { - var p = this.first(); - if (p == null) { - return ""; - } - return this.stringForNode(p); -}; - -XNodeSet.prototype.evaluate = function(c) { - return this; -}; - -XNodeSet.prototype.string = function() { - return new XString(this.toString()); -}; - -XNodeSet.prototype.stringValue = function() { - return this.toString(); -}; - -XNodeSet.prototype.number = function() { - return new XNumber(this.string()); -}; - -XNodeSet.prototype.numberValue = function() { - return Number(this.string()); -}; - -XNodeSet.prototype.bool = function() { - return new XBoolean(this.booleanValue()); -}; - -XNodeSet.prototype.booleanValue = function() { - return !!this.size; -}; - -XNodeSet.prototype.nodeset = function() { - return this; -}; - -XNodeSet.prototype.stringForNode = function(n) { - if (n.nodeType == 9 /*Node.DOCUMENT_NODE*/ || - n.nodeType == 1 /*Node.ELEMENT_NODE */ || - n.nodeType === 11 /*Node.DOCUMENT_FRAGMENT*/) { - return this.stringForContainerNode(n); - } - if (n.nodeType === 2 /* Node.ATTRIBUTE_NODE */) { - return n.value || n.nodeValue; - } - if (n.isNamespaceNode) { - return n.namespace; - } - return n.nodeValue; -}; - -XNodeSet.prototype.stringForContainerNode = function(n) { - var s = ""; - for (var n2 = n.firstChild; n2 != null; n2 = n2.nextSibling) { - var nt = n2.nodeType; - // Element, Text, CDATA, Document, Document Fragment - if (nt === 1 || nt === 3 || nt === 4 || nt === 9 || nt === 11) { - s += this.stringForNode(n2); - } - } - return s; -}; - -XNodeSet.prototype.buildTree = function () { - if (!this.tree && this.nodes.length) { - this.tree = new AVLTree(this.nodes[0]); - for (var i = 1; i < this.nodes.length; i += 1) { - this.tree.add(this.nodes[i]); - } - } - - return this.tree; -}; - -XNodeSet.prototype.first = function() { - var p = this.buildTree(); - if (p == null) { - return null; - } - while (p.left != null) { - p = p.left; - } - return p.node; -}; - -XNodeSet.prototype.add = function(n) { - for (var i = 0; i < this.nodes.length; i += 1) { - if (n === this.nodes[i]) { - return; - } - } - - this.tree = null; - this.nodes.push(n); - this.size += 1; -}; - -XNodeSet.prototype.addArray = function(ns) { - var self = this; - - forEach(function (x) { self.add(x); }, ns); -}; - -/** - * Returns an array of the node set's contents in document order - */ -XNodeSet.prototype.toArray = function() { - var a = []; - this.toArrayRec(this.buildTree(), a); - return a; -}; - -XNodeSet.prototype.toArrayRec = function(t, a) { - if (t != null) { - this.toArrayRec(t.left, a); - a.push(t.node); - this.toArrayRec(t.right, a); - } -}; - -/** - * Returns an array of the node set's contents in arbitrary order - */ -XNodeSet.prototype.toUnsortedArray = function () { - return this.nodes.slice(); -}; - -XNodeSet.prototype.compareWithString = function(r, o) { - var a = this.toUnsortedArray(); - for (var i = 0; i < a.length; i++) { - var n = a[i]; - var l = new XString(this.stringForNode(n)); - var res = o(l, r); - if (res.booleanValue()) { - return res; - } - } - return new XBoolean(false); -}; - -XNodeSet.prototype.compareWithNumber = function(r, o) { - var a = this.toUnsortedArray(); - for (var i = 0; i < a.length; i++) { - var n = a[i]; - var l = new XNumber(this.stringForNode(n)); - var res = o(l, r); - if (res.booleanValue()) { - return res; - } - } - return new XBoolean(false); -}; - -XNodeSet.prototype.compareWithBoolean = function(r, o) { - return o(this.bool(), r); -}; - -XNodeSet.prototype.compareWithNodeSet = function(r, o) { - var arr = this.toUnsortedArray(); - var oInvert = function (lop, rop) { return o(rop, lop); }; - - for (var i = 0; i < arr.length; i++) { - var l = new XString(this.stringForNode(arr[i])); - - var res = r.compareWithString(l, oInvert); - if (res.booleanValue()) { - return res; - } - } - - return new XBoolean(false); -}; - -XNodeSet.compareWith = curry(function (o, r) { - if (Utilities.instance_of(r, XString)) { - return this.compareWithString(r, o); - } - if (Utilities.instance_of(r, XNumber)) { - return this.compareWithNumber(r, o); - } - if (Utilities.instance_of(r, XBoolean)) { - return this.compareWithBoolean(r, o); - } - return this.compareWithNodeSet(r, o); -}); - -XNodeSet.prototype.equals = XNodeSet.compareWith(Operators.equals); -XNodeSet.prototype.notequal = XNodeSet.compareWith(Operators.notequal); -XNodeSet.prototype.lessthan = XNodeSet.compareWith(Operators.lessthan); -XNodeSet.prototype.greaterthan = XNodeSet.compareWith(Operators.greaterthan); -XNodeSet.prototype.lessthanorequal = XNodeSet.compareWith(Operators.lessthanorequal); -XNodeSet.prototype.greaterthanorequal = XNodeSet.compareWith(Operators.greaterthanorequal); - -XNodeSet.prototype.union = function(r) { - var ns = new XNodeSet(); - ns.addArray(this.toUnsortedArray()); - ns.addArray(r.toUnsortedArray()); - return ns; -}; - -// XPathNamespace //////////////////////////////////////////////////////////// - -XPathNamespace.prototype = new Object(); -XPathNamespace.prototype.constructor = XPathNamespace; -XPathNamespace.superclass = Object.prototype; - -function XPathNamespace(pre, ns, p) { - this.isXPathNamespace = true; - this.ownerDocument = p.ownerDocument; - this.nodeName = "#namespace"; - this.prefix = pre; - this.localName = pre; - this.namespaceURI = ns; - this.nodeValue = ns; - this.ownerElement = p; - this.nodeType = XPathNamespace.XPATH_NAMESPACE_NODE; -} - -XPathNamespace.prototype.toString = function() { - return "{ \"" + this.prefix + "\", \"" + this.namespaceURI + "\" }"; -}; - -// XPathContext ////////////////////////////////////////////////////////////// - -XPathContext.prototype = new Object(); -XPathContext.prototype.constructor = XPathContext; -XPathContext.superclass = Object.prototype; - -function XPathContext(vr, nr, fr) { - this.variableResolver = vr != null ? vr : new VariableResolver(); - this.namespaceResolver = nr != null ? nr : new NamespaceResolver(); - this.functionResolver = fr != null ? fr : new FunctionResolver(); -} - -XPathContext.prototype.extend = function (newProps) { - return assign(new XPathContext(), this, newProps); -}; - -// VariableResolver ////////////////////////////////////////////////////////// - -VariableResolver.prototype = new Object(); -VariableResolver.prototype.constructor = VariableResolver; -VariableResolver.superclass = Object.prototype; - -function VariableResolver() { -} - -VariableResolver.prototype.getVariable = function(ln, ns) { - return null; -}; - -// FunctionResolver ////////////////////////////////////////////////////////// - -FunctionResolver.prototype = new Object(); -FunctionResolver.prototype.constructor = FunctionResolver; -FunctionResolver.superclass = Object.prototype; - -function FunctionResolver(thisArg) { - this.thisArg = thisArg != null ? thisArg : Functions; - this.functions = new Object(); - this.addStandardFunctions(); -} - -FunctionResolver.prototype.addStandardFunctions = function() { - this.functions["{}last"] = Functions.last; - this.functions["{}position"] = Functions.position; - this.functions["{}count"] = Functions.count; - this.functions["{}id"] = Functions.id; - this.functions["{}local-name"] = Functions.localName; - this.functions["{}namespace-uri"] = Functions.namespaceURI; - this.functions["{}name"] = Functions.name; - this.functions["{}string"] = Functions.string; - this.functions["{}concat"] = Functions.concat; - this.functions["{}starts-with"] = Functions.startsWith; - this.functions["{}contains"] = Functions.contains; - this.functions["{}substring-before"] = Functions.substringBefore; - this.functions["{}substring-after"] = Functions.substringAfter; - this.functions["{}substring"] = Functions.substring; - this.functions["{}string-length"] = Functions.stringLength; - this.functions["{}normalize-space"] = Functions.normalizeSpace; - this.functions["{}translate"] = Functions.translate; - this.functions["{}boolean"] = Functions.boolean_; - this.functions["{}not"] = Functions.not; - this.functions["{}true"] = Functions.true_; - this.functions["{}false"] = Functions.false_; - this.functions["{}lang"] = Functions.lang; - this.functions["{}number"] = Functions.number; - this.functions["{}sum"] = Functions.sum; - this.functions["{}floor"] = Functions.floor; - this.functions["{}ceiling"] = Functions.ceiling; - this.functions["{}round"] = Functions.round; -}; - -FunctionResolver.prototype.addFunction = function(ns, ln, f) { - this.functions["{" + ns + "}" + ln] = f; -}; - -FunctionResolver.getFunctionFromContext = function(qName, context) { - var parts = Utilities.resolveQName(qName, context.namespaceResolver, context.contextNode, false); - - if (parts[0] === null) { - throw new Error("Cannot resolve QName " + name); - } - - return context.functionResolver.getFunction(parts[1], parts[0]); -}; - -FunctionResolver.prototype.getFunction = function(localName, namespace) { - return this.functions["{" + namespace + "}" + localName]; -}; - -// NamespaceResolver ///////////////////////////////////////////////////////// - -NamespaceResolver.prototype = new Object(); -NamespaceResolver.prototype.constructor = NamespaceResolver; -NamespaceResolver.superclass = Object.prototype; - -function NamespaceResolver() { -} - -NamespaceResolver.prototype.getNamespace = function(prefix, n) { - if (prefix == "xml") { - return XPath.XML_NAMESPACE_URI; - } else if (prefix == "xmlns") { - return XPath.XMLNS_NAMESPACE_URI; - } - if (n.nodeType == 9 /*Node.DOCUMENT_NODE*/) { - n = n.documentElement; - } else if (n.nodeType == 2 /*Node.ATTRIBUTE_NODE*/) { - n = PathExpr.getOwnerElement(n); - } else if (n.nodeType != 1 /*Node.ELEMENT_NODE*/) { - n = n.parentNode; - } - while (n != null && n.nodeType == 1 /*Node.ELEMENT_NODE*/) { - var nnm = n.attributes; - for (var i = 0; i < nnm.length; i++) { - var a = nnm.item(i); - var aname = a.name || a.nodeName; - if ((aname === "xmlns" && prefix === "") - || aname === "xmlns:" + prefix) { - return String(a.value || a.nodeValue); - } - } - n = n.parentNode; - } - return null; -}; - -// Functions ///////////////////////////////////////////////////////////////// - -var Functions = new Object(); - -Functions.last = function(c) { - if (arguments.length != 1) { - throw new Error("Function last expects ()"); - } - - return new XNumber(c.contextSize); -}; - -Functions.position = function(c) { - if (arguments.length != 1) { - throw new Error("Function position expects ()"); - } - - return new XNumber(c.contextPosition); -}; - -Functions.count = function() { - var c = arguments[0]; - var ns; - if (arguments.length != 2 || !Utilities.instance_of(ns = arguments[1].evaluate(c), XNodeSet)) { - throw new Error("Function count expects (node-set)"); - } - return new XNumber(ns.size); -}; - -Functions.id = function() { - var c = arguments[0]; - var id; - if (arguments.length != 2) { - throw new Error("Function id expects (object)"); - } - id = arguments[1].evaluate(c); - if (Utilities.instance_of(id, XNodeSet)) { - id = id.toArray().join(" "); - } else { - id = id.stringValue(); - } - var ids = id.split(/[\x0d\x0a\x09\x20]+/); - var count = 0; - var ns = new XNodeSet(); - var doc = c.contextNode.nodeType == 9 /*Node.DOCUMENT_NODE*/ - ? c.contextNode - : c.contextNode.ownerDocument; - for (var i = 0; i < ids.length; i++) { - var n; - if (doc.getElementById) { - n = doc.getElementById(ids[i]); - } else { - n = Utilities.getElementById(doc, ids[i]); - } - if (n != null) { - ns.add(n); - count++; - } - } - return ns; -}; - -Functions.localName = function(c, eNode) { - var n; - - if (arguments.length == 1) { - n = c.contextNode; - } else if (arguments.length == 2) { - n = eNode.evaluate(c).first(); - } else { - throw new Error("Function local-name expects (node-set?)"); - } - - if (n == null) { - return new XString(""); - } - - return new XString(n.localName || // standard elements and attributes - n.baseName || // IE - n.target || // processing instructions - n.nodeName || // DOM1 elements - ""); // fallback -}; - -Functions.namespaceURI = function() { - var c = arguments[0]; - var n; - if (arguments.length == 1) { - n = c.contextNode; - } else if (arguments.length == 2) { - n = arguments[1].evaluate(c).first(); - } else { - throw new Error("Function namespace-uri expects (node-set?)"); - } - if (n == null) { - return new XString(""); - } - return new XString(n.namespaceURI); -}; - -Functions.name = function() { - var c = arguments[0]; - var n; - if (arguments.length == 1) { - n = c.contextNode; - } else if (arguments.length == 2) { - n = arguments[1].evaluate(c).first(); - } else { - throw new Error("Function name expects (node-set?)"); - } - if (n == null) { - return new XString(""); - } - if (n.nodeType == 1 /*Node.ELEMENT_NODE*/) { - return new XString(n.nodeName); - } else if (n.nodeType == 2 /*Node.ATTRIBUTE_NODE*/) { - return new XString(n.name || n.nodeName); - } else if (n.nodeType === 7 /*Node.PROCESSING_INSTRUCTION_NODE*/) { - return new XString(n.target || n.nodeName); - } else if (n.localName == null) { - return new XString(""); - } else { - return new XString(n.localName); - } -}; - -Functions.string = function() { - var c = arguments[0]; - if (arguments.length == 1) { - return new XString(XNodeSet.prototype.stringForNode(c.contextNode)); - } else if (arguments.length == 2) { - return arguments[1].evaluate(c).string(); - } - throw new Error("Function string expects (object?)"); -}; - -Functions.concat = function(c) { - if (arguments.length < 3) { - throw new Error("Function concat expects (string, string[, string]*)"); - } - var s = ""; - for (var i = 1; i < arguments.length; i++) { - s += arguments[i].evaluate(c).stringValue(); - } - return new XString(s); -}; - -Functions.startsWith = function() { - var c = arguments[0]; - if (arguments.length != 3) { - throw new Error("Function startsWith expects (string, string)"); - } - var s1 = arguments[1].evaluate(c).stringValue(); - var s2 = arguments[2].evaluate(c).stringValue(); - return new XBoolean(s1.substring(0, s2.length) == s2); -}; - -Functions.contains = function() { - var c = arguments[0]; - if (arguments.length != 3) { - throw new Error("Function contains expects (string, string)"); - } - var s1 = arguments[1].evaluate(c).stringValue(); - var s2 = arguments[2].evaluate(c).stringValue(); - return new XBoolean(s1.indexOf(s2) !== -1); -}; - -Functions.substringBefore = function() { - var c = arguments[0]; - if (arguments.length != 3) { - throw new Error("Function substring-before expects (string, string)"); - } - var s1 = arguments[1].evaluate(c).stringValue(); - var s2 = arguments[2].evaluate(c).stringValue(); - return new XString(s1.substring(0, s1.indexOf(s2))); -}; - -Functions.substringAfter = function() { - var c = arguments[0]; - if (arguments.length != 3) { - throw new Error("Function substring-after expects (string, string)"); - } - var s1 = arguments[1].evaluate(c).stringValue(); - var s2 = arguments[2].evaluate(c).stringValue(); - if (s2.length == 0) { - return new XString(s1); - } - var i = s1.indexOf(s2); - if (i == -1) { - return new XString(""); - } - return new XString(s1.substring(i + s2.length)); -}; - -Functions.substring = function() { - var c = arguments[0]; - if (!(arguments.length == 3 || arguments.length == 4)) { - throw new Error("Function substring expects (string, number, number?)"); - } - var s = arguments[1].evaluate(c).stringValue(); - var n1 = Math.round(arguments[2].evaluate(c).numberValue()) - 1; - var n2 = arguments.length == 4 ? n1 + Math.round(arguments[3].evaluate(c).numberValue()) : undefined; - return new XString(s.substring(n1, n2)); -}; - -Functions.stringLength = function() { - var c = arguments[0]; - var s; - if (arguments.length == 1) { - s = XNodeSet.prototype.stringForNode(c.contextNode); - } else if (arguments.length == 2) { - s = arguments[1].evaluate(c).stringValue(); - } else { - throw new Error("Function string-length expects (string?)"); - } - return new XNumber(s.length); -}; - -Functions.normalizeSpace = function() { - var c = arguments[0]; - var s; - if (arguments.length == 1) { - s = XNodeSet.prototype.stringForNode(c.contextNode); - } else if (arguments.length == 2) { - s = arguments[1].evaluate(c).stringValue(); - } else { - throw new Error("Function normalize-space expects (string?)"); - } - var i = 0; - var j = s.length - 1; - while (Utilities.isSpace(s.charCodeAt(j))) { - j--; - } - var t = ""; - while (i <= j && Utilities.isSpace(s.charCodeAt(i))) { - i++; - } - while (i <= j) { - if (Utilities.isSpace(s.charCodeAt(i))) { - t += " "; - while (i <= j && Utilities.isSpace(s.charCodeAt(i))) { - i++; - } - } else { - t += s.charAt(i); - i++; - } - } - return new XString(t); -}; - -Functions.translate = function(c, eValue, eFrom, eTo) { - if (arguments.length != 4) { - throw new Error("Function translate expects (string, string, string)"); - } - - var value = eValue.evaluate(c).stringValue(); - var from = eFrom.evaluate(c).stringValue(); - var to = eTo.evaluate(c).stringValue(); - - var cMap = reduce(function (acc, ch, i) { - if (!(ch in acc)) { - acc[ch] = i > to.length ? '' : to[i]; - } - return acc; - }, {}, from); - - var t = join('', map(function (ch) { - return ch in cMap ? cMap[ch] : ch; - }, value)); - - return new XString(t); -}; - -Functions.boolean_ = function() { - var c = arguments[0]; - if (arguments.length != 2) { - throw new Error("Function boolean expects (object)"); - } - return arguments[1].evaluate(c).bool(); -}; - -Functions.not = function(c, eValue) { - if (arguments.length != 2) { - throw new Error("Function not expects (object)"); - } - return eValue.evaluate(c).bool().not(); -}; - -Functions.true_ = function() { - if (arguments.length != 1) { - throw new Error("Function true expects ()"); - } - return XBoolean.true_; -}; - -Functions.false_ = function() { - if (arguments.length != 1) { - throw new Error("Function false expects ()"); - } - return XBoolean.false_; -}; - -Functions.lang = function() { - var c = arguments[0]; - if (arguments.length != 2) { - throw new Error("Function lang expects (string)"); - } - var lang; - for (var n = c.contextNode; n != null && n.nodeType != 9 /*Node.DOCUMENT_NODE*/; n = n.parentNode) { - var a = n.getAttributeNS(XPath.XML_NAMESPACE_URI, "lang"); - if (a != null) { - lang = String(a); - break; - } - } - if (lang == null) { - return XBoolean.false_; - } - var s = arguments[1].evaluate(c).stringValue(); - return new XBoolean(lang.substring(0, s.length) == s - && (lang.length == s.length || lang.charAt(s.length) == '-')); -}; - -Functions.number = function() { - var c = arguments[0]; - if (!(arguments.length == 1 || arguments.length == 2)) { - throw new Error("Function number expects (object?)"); - } - if (arguments.length == 1) { - return new XNumber(XNodeSet.prototype.stringForNode(c.contextNode)); - } - return arguments[1].evaluate(c).number(); -}; - -Functions.sum = function() { - var c = arguments[0]; - var ns; - if (arguments.length != 2 || !Utilities.instance_of((ns = arguments[1].evaluate(c)), XNodeSet)) { - throw new Error("Function sum expects (node-set)"); - } - ns = ns.toUnsortedArray(); - var n = 0; - for (var i = 0; i < ns.length; i++) { - n += new XNumber(XNodeSet.prototype.stringForNode(ns[i])).numberValue(); - } - return new XNumber(n); -}; - -Functions.floor = function() { - var c = arguments[0]; - if (arguments.length != 2) { - throw new Error("Function floor expects (number)"); - } - return new XNumber(Math.floor(arguments[1].evaluate(c).numberValue())); -}; - -Functions.ceiling = function() { - var c = arguments[0]; - if (arguments.length != 2) { - throw new Error("Function ceiling expects (number)"); - } - return new XNumber(Math.ceil(arguments[1].evaluate(c).numberValue())); -}; - -Functions.round = function() { - var c = arguments[0]; - if (arguments.length != 2) { - throw new Error("Function round expects (number)"); - } - return new XNumber(Math.round(arguments[1].evaluate(c).numberValue())); -}; - -// Utilities ///////////////////////////////////////////////////////////////// - -var Utilities = new Object(); - -Utilities.isAttribute = function (val) { - return val && (val.nodeType === 2 || val.ownerElement); -} - -Utilities.splitQName = function(qn) { - var i = qn.indexOf(":"); - if (i == -1) { - return [ null, qn ]; - } - return [ qn.substring(0, i), qn.substring(i + 1) ]; -}; - -Utilities.resolveQName = function(qn, nr, n, useDefault) { - var parts = Utilities.splitQName(qn); - if (parts[0] != null) { - parts[0] = nr.getNamespace(parts[0], n); - } else { - if (useDefault) { - parts[0] = nr.getNamespace("", n); - if (parts[0] == null) { - parts[0] = ""; - } - } else { - parts[0] = ""; - } - } - return parts; -}; - -Utilities.isSpace = function(c) { - return c == 0x9 || c == 0xd || c == 0xa || c == 0x20; -}; - -Utilities.isLetter = function(c) { - return c >= 0x0041 && c <= 0x005A || - c >= 0x0061 && c <= 0x007A || - c >= 0x00C0 && c <= 0x00D6 || - c >= 0x00D8 && c <= 0x00F6 || - c >= 0x00F8 && c <= 0x00FF || - c >= 0x0100 && c <= 0x0131 || - c >= 0x0134 && c <= 0x013E || - c >= 0x0141 && c <= 0x0148 || - c >= 0x014A && c <= 0x017E || - c >= 0x0180 && c <= 0x01C3 || - c >= 0x01CD && c <= 0x01F0 || - c >= 0x01F4 && c <= 0x01F5 || - c >= 0x01FA && c <= 0x0217 || - c >= 0x0250 && c <= 0x02A8 || - c >= 0x02BB && c <= 0x02C1 || - c == 0x0386 || - c >= 0x0388 && c <= 0x038A || - c == 0x038C || - c >= 0x038E && c <= 0x03A1 || - c >= 0x03A3 && c <= 0x03CE || - c >= 0x03D0 && c <= 0x03D6 || - c == 0x03DA || - c == 0x03DC || - c == 0x03DE || - c == 0x03E0 || - c >= 0x03E2 && c <= 0x03F3 || - c >= 0x0401 && c <= 0x040C || - c >= 0x040E && c <= 0x044F || - c >= 0x0451 && c <= 0x045C || - c >= 0x045E && c <= 0x0481 || - c >= 0x0490 && c <= 0x04C4 || - c >= 0x04C7 && c <= 0x04C8 || - c >= 0x04CB && c <= 0x04CC || - c >= 0x04D0 && c <= 0x04EB || - c >= 0x04EE && c <= 0x04F5 || - c >= 0x04F8 && c <= 0x04F9 || - c >= 0x0531 && c <= 0x0556 || - c == 0x0559 || - c >= 0x0561 && c <= 0x0586 || - c >= 0x05D0 && c <= 0x05EA || - c >= 0x05F0 && c <= 0x05F2 || - c >= 0x0621 && c <= 0x063A || - c >= 0x0641 && c <= 0x064A || - c >= 0x0671 && c <= 0x06B7 || - c >= 0x06BA && c <= 0x06BE || - c >= 0x06C0 && c <= 0x06CE || - c >= 0x06D0 && c <= 0x06D3 || - c == 0x06D5 || - c >= 0x06E5 && c <= 0x06E6 || - c >= 0x0905 && c <= 0x0939 || - c == 0x093D || - c >= 0x0958 && c <= 0x0961 || - c >= 0x0985 && c <= 0x098C || - c >= 0x098F && c <= 0x0990 || - c >= 0x0993 && c <= 0x09A8 || - c >= 0x09AA && c <= 0x09B0 || - c == 0x09B2 || - c >= 0x09B6 && c <= 0x09B9 || - c >= 0x09DC && c <= 0x09DD || - c >= 0x09DF && c <= 0x09E1 || - c >= 0x09F0 && c <= 0x09F1 || - c >= 0x0A05 && c <= 0x0A0A || - c >= 0x0A0F && c <= 0x0A10 || - c >= 0x0A13 && c <= 0x0A28 || - c >= 0x0A2A && c <= 0x0A30 || - c >= 0x0A32 && c <= 0x0A33 || - c >= 0x0A35 && c <= 0x0A36 || - c >= 0x0A38 && c <= 0x0A39 || - c >= 0x0A59 && c <= 0x0A5C || - c == 0x0A5E || - c >= 0x0A72 && c <= 0x0A74 || - c >= 0x0A85 && c <= 0x0A8B || - c == 0x0A8D || - c >= 0x0A8F && c <= 0x0A91 || - c >= 0x0A93 && c <= 0x0AA8 || - c >= 0x0AAA && c <= 0x0AB0 || - c >= 0x0AB2 && c <= 0x0AB3 || - c >= 0x0AB5 && c <= 0x0AB9 || - c == 0x0ABD || - c == 0x0AE0 || - c >= 0x0B05 && c <= 0x0B0C || - c >= 0x0B0F && c <= 0x0B10 || - c >= 0x0B13 && c <= 0x0B28 || - c >= 0x0B2A && c <= 0x0B30 || - c >= 0x0B32 && c <= 0x0B33 || - c >= 0x0B36 && c <= 0x0B39 || - c == 0x0B3D || - c >= 0x0B5C && c <= 0x0B5D || - c >= 0x0B5F && c <= 0x0B61 || - c >= 0x0B85 && c <= 0x0B8A || - c >= 0x0B8E && c <= 0x0B90 || - c >= 0x0B92 && c <= 0x0B95 || - c >= 0x0B99 && c <= 0x0B9A || - c == 0x0B9C || - c >= 0x0B9E && c <= 0x0B9F || - c >= 0x0BA3 && c <= 0x0BA4 || - c >= 0x0BA8 && c <= 0x0BAA || - c >= 0x0BAE && c <= 0x0BB5 || - c >= 0x0BB7 && c <= 0x0BB9 || - c >= 0x0C05 && c <= 0x0C0C || - c >= 0x0C0E && c <= 0x0C10 || - c >= 0x0C12 && c <= 0x0C28 || - c >= 0x0C2A && c <= 0x0C33 || - c >= 0x0C35 && c <= 0x0C39 || - c >= 0x0C60 && c <= 0x0C61 || - c >= 0x0C85 && c <= 0x0C8C || - c >= 0x0C8E && c <= 0x0C90 || - c >= 0x0C92 && c <= 0x0CA8 || - c >= 0x0CAA && c <= 0x0CB3 || - c >= 0x0CB5 && c <= 0x0CB9 || - c == 0x0CDE || - c >= 0x0CE0 && c <= 0x0CE1 || - c >= 0x0D05 && c <= 0x0D0C || - c >= 0x0D0E && c <= 0x0D10 || - c >= 0x0D12 && c <= 0x0D28 || - c >= 0x0D2A && c <= 0x0D39 || - c >= 0x0D60 && c <= 0x0D61 || - c >= 0x0E01 && c <= 0x0E2E || - c == 0x0E30 || - c >= 0x0E32 && c <= 0x0E33 || - c >= 0x0E40 && c <= 0x0E45 || - c >= 0x0E81 && c <= 0x0E82 || - c == 0x0E84 || - c >= 0x0E87 && c <= 0x0E88 || - c == 0x0E8A || - c == 0x0E8D || - c >= 0x0E94 && c <= 0x0E97 || - c >= 0x0E99 && c <= 0x0E9F || - c >= 0x0EA1 && c <= 0x0EA3 || - c == 0x0EA5 || - c == 0x0EA7 || - c >= 0x0EAA && c <= 0x0EAB || - c >= 0x0EAD && c <= 0x0EAE || - c == 0x0EB0 || - c >= 0x0EB2 && c <= 0x0EB3 || - c == 0x0EBD || - c >= 0x0EC0 && c <= 0x0EC4 || - c >= 0x0F40 && c <= 0x0F47 || - c >= 0x0F49 && c <= 0x0F69 || - c >= 0x10A0 && c <= 0x10C5 || - c >= 0x10D0 && c <= 0x10F6 || - c == 0x1100 || - c >= 0x1102 && c <= 0x1103 || - c >= 0x1105 && c <= 0x1107 || - c == 0x1109 || - c >= 0x110B && c <= 0x110C || - c >= 0x110E && c <= 0x1112 || - c == 0x113C || - c == 0x113E || - c == 0x1140 || - c == 0x114C || - c == 0x114E || - c == 0x1150 || - c >= 0x1154 && c <= 0x1155 || - c == 0x1159 || - c >= 0x115F && c <= 0x1161 || - c == 0x1163 || - c == 0x1165 || - c == 0x1167 || - c == 0x1169 || - c >= 0x116D && c <= 0x116E || - c >= 0x1172 && c <= 0x1173 || - c == 0x1175 || - c == 0x119E || - c == 0x11A8 || - c == 0x11AB || - c >= 0x11AE && c <= 0x11AF || - c >= 0x11B7 && c <= 0x11B8 || - c == 0x11BA || - c >= 0x11BC && c <= 0x11C2 || - c == 0x11EB || - c == 0x11F0 || - c == 0x11F9 || - c >= 0x1E00 && c <= 0x1E9B || - c >= 0x1EA0 && c <= 0x1EF9 || - c >= 0x1F00 && c <= 0x1F15 || - c >= 0x1F18 && c <= 0x1F1D || - c >= 0x1F20 && c <= 0x1F45 || - c >= 0x1F48 && c <= 0x1F4D || - c >= 0x1F50 && c <= 0x1F57 || - c == 0x1F59 || - c == 0x1F5B || - c == 0x1F5D || - c >= 0x1F5F && c <= 0x1F7D || - c >= 0x1F80 && c <= 0x1FB4 || - c >= 0x1FB6 && c <= 0x1FBC || - c == 0x1FBE || - c >= 0x1FC2 && c <= 0x1FC4 || - c >= 0x1FC6 && c <= 0x1FCC || - c >= 0x1FD0 && c <= 0x1FD3 || - c >= 0x1FD6 && c <= 0x1FDB || - c >= 0x1FE0 && c <= 0x1FEC || - c >= 0x1FF2 && c <= 0x1FF4 || - c >= 0x1FF6 && c <= 0x1FFC || - c == 0x2126 || - c >= 0x212A && c <= 0x212B || - c == 0x212E || - c >= 0x2180 && c <= 0x2182 || - c >= 0x3041 && c <= 0x3094 || - c >= 0x30A1 && c <= 0x30FA || - c >= 0x3105 && c <= 0x312C || - c >= 0xAC00 && c <= 0xD7A3 || - c >= 0x4E00 && c <= 0x9FA5 || - c == 0x3007 || - c >= 0x3021 && c <= 0x3029; -}; - -Utilities.isNCNameChar = function(c) { - return c >= 0x0030 && c <= 0x0039 - || c >= 0x0660 && c <= 0x0669 - || c >= 0x06F0 && c <= 0x06F9 - || c >= 0x0966 && c <= 0x096F - || c >= 0x09E6 && c <= 0x09EF - || c >= 0x0A66 && c <= 0x0A6F - || c >= 0x0AE6 && c <= 0x0AEF - || c >= 0x0B66 && c <= 0x0B6F - || c >= 0x0BE7 && c <= 0x0BEF - || c >= 0x0C66 && c <= 0x0C6F - || c >= 0x0CE6 && c <= 0x0CEF - || c >= 0x0D66 && c <= 0x0D6F - || c >= 0x0E50 && c <= 0x0E59 - || c >= 0x0ED0 && c <= 0x0ED9 - || c >= 0x0F20 && c <= 0x0F29 - || c == 0x002E - || c == 0x002D - || c == 0x005F - || Utilities.isLetter(c) - || c >= 0x0300 && c <= 0x0345 - || c >= 0x0360 && c <= 0x0361 - || c >= 0x0483 && c <= 0x0486 - || c >= 0x0591 && c <= 0x05A1 - || c >= 0x05A3 && c <= 0x05B9 - || c >= 0x05BB && c <= 0x05BD - || c == 0x05BF - || c >= 0x05C1 && c <= 0x05C2 - || c == 0x05C4 - || c >= 0x064B && c <= 0x0652 - || c == 0x0670 - || c >= 0x06D6 && c <= 0x06DC - || c >= 0x06DD && c <= 0x06DF - || c >= 0x06E0 && c <= 0x06E4 - || c >= 0x06E7 && c <= 0x06E8 - || c >= 0x06EA && c <= 0x06ED - || c >= 0x0901 && c <= 0x0903 - || c == 0x093C - || c >= 0x093E && c <= 0x094C - || c == 0x094D - || c >= 0x0951 && c <= 0x0954 - || c >= 0x0962 && c <= 0x0963 - || c >= 0x0981 && c <= 0x0983 - || c == 0x09BC - || c == 0x09BE - || c == 0x09BF - || c >= 0x09C0 && c <= 0x09C4 - || c >= 0x09C7 && c <= 0x09C8 - || c >= 0x09CB && c <= 0x09CD - || c == 0x09D7 - || c >= 0x09E2 && c <= 0x09E3 - || c == 0x0A02 - || c == 0x0A3C - || c == 0x0A3E - || c == 0x0A3F - || c >= 0x0A40 && c <= 0x0A42 - || c >= 0x0A47 && c <= 0x0A48 - || c >= 0x0A4B && c <= 0x0A4D - || c >= 0x0A70 && c <= 0x0A71 - || c >= 0x0A81 && c <= 0x0A83 - || c == 0x0ABC - || c >= 0x0ABE && c <= 0x0AC5 - || c >= 0x0AC7 && c <= 0x0AC9 - || c >= 0x0ACB && c <= 0x0ACD - || c >= 0x0B01 && c <= 0x0B03 - || c == 0x0B3C - || c >= 0x0B3E && c <= 0x0B43 - || c >= 0x0B47 && c <= 0x0B48 - || c >= 0x0B4B && c <= 0x0B4D - || c >= 0x0B56 && c <= 0x0B57 - || c >= 0x0B82 && c <= 0x0B83 - || c >= 0x0BBE && c <= 0x0BC2 - || c >= 0x0BC6 && c <= 0x0BC8 - || c >= 0x0BCA && c <= 0x0BCD - || c == 0x0BD7 - || c >= 0x0C01 && c <= 0x0C03 - || c >= 0x0C3E && c <= 0x0C44 - || c >= 0x0C46 && c <= 0x0C48 - || c >= 0x0C4A && c <= 0x0C4D - || c >= 0x0C55 && c <= 0x0C56 - || c >= 0x0C82 && c <= 0x0C83 - || c >= 0x0CBE && c <= 0x0CC4 - || c >= 0x0CC6 && c <= 0x0CC8 - || c >= 0x0CCA && c <= 0x0CCD - || c >= 0x0CD5 && c <= 0x0CD6 - || c >= 0x0D02 && c <= 0x0D03 - || c >= 0x0D3E && c <= 0x0D43 - || c >= 0x0D46 && c <= 0x0D48 - || c >= 0x0D4A && c <= 0x0D4D - || c == 0x0D57 - || c == 0x0E31 - || c >= 0x0E34 && c <= 0x0E3A - || c >= 0x0E47 && c <= 0x0E4E - || c == 0x0EB1 - || c >= 0x0EB4 && c <= 0x0EB9 - || c >= 0x0EBB && c <= 0x0EBC - || c >= 0x0EC8 && c <= 0x0ECD - || c >= 0x0F18 && c <= 0x0F19 - || c == 0x0F35 - || c == 0x0F37 - || c == 0x0F39 - || c == 0x0F3E - || c == 0x0F3F - || c >= 0x0F71 && c <= 0x0F84 - || c >= 0x0F86 && c <= 0x0F8B - || c >= 0x0F90 && c <= 0x0F95 - || c == 0x0F97 - || c >= 0x0F99 && c <= 0x0FAD - || c >= 0x0FB1 && c <= 0x0FB7 - || c == 0x0FB9 - || c >= 0x20D0 && c <= 0x20DC - || c == 0x20E1 - || c >= 0x302A && c <= 0x302F - || c == 0x3099 - || c == 0x309A - || c == 0x00B7 - || c == 0x02D0 - || c == 0x02D1 - || c == 0x0387 - || c == 0x0640 - || c == 0x0E46 - || c == 0x0EC6 - || c == 0x3005 - || c >= 0x3031 && c <= 0x3035 - || c >= 0x309D && c <= 0x309E - || c >= 0x30FC && c <= 0x30FE; -}; - -Utilities.coalesceText = function(n) { - for (var m = n.firstChild; m != null; m = m.nextSibling) { - if (m.nodeType == 3 /*Node.TEXT_NODE*/ || m.nodeType == 4 /*Node.CDATA_SECTION_NODE*/) { - var s = m.nodeValue; - var first = m; - m = m.nextSibling; - while (m != null && (m.nodeType == 3 /*Node.TEXT_NODE*/ || m.nodeType == 4 /*Node.CDATA_SECTION_NODE*/)) { - s += m.nodeValue; - var del = m; - m = m.nextSibling; - del.parentNode.removeChild(del); - } - if (first.nodeType == 4 /*Node.CDATA_SECTION_NODE*/) { - var p = first.parentNode; - if (first.nextSibling == null) { - p.removeChild(first); - p.appendChild(p.ownerDocument.createTextNode(s)); - } else { - var next = first.nextSibling; - p.removeChild(first); - p.insertBefore(p.ownerDocument.createTextNode(s), next); - } - } else { - first.nodeValue = s; - } - if (m == null) { - break; - } - } else if (m.nodeType == 1 /*Node.ELEMENT_NODE*/) { - Utilities.coalesceText(m); - } - } -}; - -Utilities.instance_of = function(o, c) { - while (o != null) { - if (o.constructor === c) { - return true; - } - if (o === Object) { - return false; - } - o = o.constructor.superclass; - } - return false; -}; - -Utilities.getElementById = function(n, id) { - // Note that this does not check the DTD to check for actual - // attributes of type ID, so this may be a bit wrong. - if (n.nodeType == 1 /*Node.ELEMENT_NODE*/) { - if (n.getAttribute("id") == id - || n.getAttributeNS(null, "id") == id) { - return n; - } - } - for (var m = n.firstChild; m != null; m = m.nextSibling) { - var res = Utilities.getElementById(m, id); - if (res != null) { - return res; - } - } - return null; -}; - -// XPathException //////////////////////////////////////////////////////////// - -var XPathException = (function () { - function getMessage(code, exception) { - var msg = exception ? ": " + exception.toString() : ""; - switch (code) { - case XPathException.INVALID_EXPRESSION_ERR: - return "Invalid expression" + msg; - case XPathException.TYPE_ERR: - return "Type error" + msg; - } - return null; - } - - function XPathException(code, error, message) { - var err = Error.call(this, getMessage(code, error) || message); - - err.code = code; - err.exception = error; - - return err; - } - - XPathException.prototype = Object.create(Error.prototype); - XPathException.prototype.constructor = XPathException; - XPathException.superclass = Error; - - XPathException.prototype.toString = function() { - return this.message; - }; - - XPathException.fromMessage = function(message, error) { - return new XPathException(null, error, message); - }; - - XPathException.INVALID_EXPRESSION_ERR = 51; - XPathException.TYPE_ERR = 52; - - return XPathException; -})(); - -// XPathExpression /////////////////////////////////////////////////////////// - -XPathExpression.prototype = {}; -XPathExpression.prototype.constructor = XPathExpression; -XPathExpression.superclass = Object.prototype; - -function XPathExpression(e, r, p) { - this.xpath = p.parse(e); - this.context = new XPathContext(); - this.context.namespaceResolver = new XPathNSResolverWrapper(r); -} - -XPathExpression.getOwnerDocument = function (n) { - return n.nodeType === 9 /*Node.DOCUMENT_NODE*/ ? n : n.ownerDocument; -} - -XPathExpression.detectHtmlDom = function (n) { - if (!n) { return false; } - - var doc = XPathExpression.getOwnerDocument(n); - - try { - return doc.implementation.hasFeature("HTML", "2.0"); - } catch (e) { - return true; - } -} - -XPathExpression.prototype.evaluate = function(n, t, res) { - this.context.expressionContextNode = n; - // backward compatibility - no reliable way to detect whether the DOM is HTML, but - // this library has been using this method up until now, so we will continue to use it - // ONLY when using an XPathExpression - this.context.caseInsensitive = XPathExpression.detectHtmlDom(n); - - var result = this.xpath.evaluate(this.context); - return new XPathResult(result, t); -} - -// XPathNSResolverWrapper //////////////////////////////////////////////////// - -XPathNSResolverWrapper.prototype = {}; -XPathNSResolverWrapper.prototype.constructor = XPathNSResolverWrapper; -XPathNSResolverWrapper.superclass = Object.prototype; - -function XPathNSResolverWrapper(r) { - this.xpathNSResolver = r; -} - -XPathNSResolverWrapper.prototype.getNamespace = function(prefix, n) { - if (this.xpathNSResolver == null) { - return null; - } - return this.xpathNSResolver.lookupNamespaceURI(prefix); -}; - -// NodeXPathNSResolver /////////////////////////////////////////////////////// - -NodeXPathNSResolver.prototype = {}; -NodeXPathNSResolver.prototype.constructor = NodeXPathNSResolver; -NodeXPathNSResolver.superclass = Object.prototype; - -function NodeXPathNSResolver(n) { - this.node = n; - this.namespaceResolver = new NamespaceResolver(); -} - -NodeXPathNSResolver.prototype.lookupNamespaceURI = function(prefix) { - return this.namespaceResolver.getNamespace(prefix, this.node); -}; - -// XPathResult /////////////////////////////////////////////////////////////// - -XPathResult.prototype = {}; -XPathResult.prototype.constructor = XPathResult; -XPathResult.superclass = Object.prototype; - -function XPathResult(v, t) { - if (t == XPathResult.ANY_TYPE) { - if (v.constructor === XString) { - t = XPathResult.STRING_TYPE; - } else if (v.constructor === XNumber) { - t = XPathResult.NUMBER_TYPE; - } else if (v.constructor === XBoolean) { - t = XPathResult.BOOLEAN_TYPE; - } else if (v.constructor === XNodeSet) { - t = XPathResult.UNORDERED_NODE_ITERATOR_TYPE; - } - } - this.resultType = t; - switch (t) { - case XPathResult.NUMBER_TYPE: - this.numberValue = v.numberValue(); - return; - case XPathResult.STRING_TYPE: - this.stringValue = v.stringValue(); - return; - case XPathResult.BOOLEAN_TYPE: - this.booleanValue = v.booleanValue(); - return; - case XPathResult.ANY_UNORDERED_NODE_TYPE: - case XPathResult.FIRST_ORDERED_NODE_TYPE: - if (v.constructor === XNodeSet) { - this.singleNodeValue = v.first(); - return; - } - break; - case XPathResult.UNORDERED_NODE_ITERATOR_TYPE: - case XPathResult.ORDERED_NODE_ITERATOR_TYPE: - if (v.constructor === XNodeSet) { - this.invalidIteratorState = false; - this.nodes = v.toArray(); - this.iteratorIndex = 0; - return; - } - break; - case XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE: - case XPathResult.ORDERED_NODE_SNAPSHOT_TYPE: - if (v.constructor === XNodeSet) { - this.nodes = v.toArray(); - this.snapshotLength = this.nodes.length; - return; - } - break; - } - throw new XPathException(XPathException.TYPE_ERR); -}; - -XPathResult.prototype.iterateNext = function() { - if (this.resultType != XPathResult.UNORDERED_NODE_ITERATOR_TYPE - && this.resultType != XPathResult.ORDERED_NODE_ITERATOR_TYPE) { - throw new XPathException(XPathException.TYPE_ERR); - } - return this.nodes[this.iteratorIndex++]; -}; - -XPathResult.prototype.snapshotItem = function(i) { - if (this.resultType != XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE - && this.resultType != XPathResult.ORDERED_NODE_SNAPSHOT_TYPE) { - throw new XPathException(XPathException.TYPE_ERR); - } - return this.nodes[i]; -}; - -XPathResult.ANY_TYPE = 0; -XPathResult.NUMBER_TYPE = 1; -XPathResult.STRING_TYPE = 2; -XPathResult.BOOLEAN_TYPE = 3; -XPathResult.UNORDERED_NODE_ITERATOR_TYPE = 4; -XPathResult.ORDERED_NODE_ITERATOR_TYPE = 5; -XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE = 6; -XPathResult.ORDERED_NODE_SNAPSHOT_TYPE = 7; -XPathResult.ANY_UNORDERED_NODE_TYPE = 8; -XPathResult.FIRST_ORDERED_NODE_TYPE = 9; - -// DOM 3 XPath support /////////////////////////////////////////////////////// - -function installDOM3XPathSupport(doc, p) { - doc.createExpression = function(e, r) { - try { - return new XPathExpression(e, r, p); - } catch (e) { - throw new XPathException(XPathException.INVALID_EXPRESSION_ERR, e); - } - }; - doc.createNSResolver = function(n) { - return new NodeXPathNSResolver(n); - }; - doc.evaluate = function(e, cn, r, t, res) { - if (t < 0 || t > 9) { - throw { code: 0, toString: function() { return "Request type not supported"; } }; - } - return doc.createExpression(e, r, p).evaluate(cn, t, res); - }; -}; - -// --------------------------------------------------------------------------- - -// Install DOM 3 XPath support for the current document. -try { - var shouldInstall = true; - try { - if (document.implementation - && document.implementation.hasFeature - && document.implementation.hasFeature("XPath", null)) { - shouldInstall = false; - } - } catch (e) { - } - if (shouldInstall) { - installDOM3XPathSupport(document, new XPathParser()); - } -} catch (e) { -} - -// --------------------------------------------------------------------------- -// exports for node.js - -installDOM3XPathSupport(exports, new XPathParser()); - -(function() { - var parser = new XPathParser(); - - var defaultNSResolver = new NamespaceResolver(); - var defaultFunctionResolver = new FunctionResolver(); - var defaultVariableResolver = new VariableResolver(); - - function makeNSResolverFromFunction(func) { - return { - getNamespace: function (prefix, node) { - var ns = func(prefix, node); - - return ns || defaultNSResolver.getNamespace(prefix, node); - } - }; - } - - function makeNSResolverFromObject(obj) { - return makeNSResolverFromFunction(obj.getNamespace.bind(obj)); - } - - function makeNSResolverFromMap(map) { - return makeNSResolverFromFunction(function (prefix) { - return map[prefix]; - }); - } - - function makeNSResolver(resolver) { - if (resolver && typeof resolver.getNamespace === "function") { - return makeNSResolverFromObject(resolver); - } - - if (typeof resolver === "function") { - return makeNSResolverFromFunction(resolver); - } - - // assume prefix -> uri mapping - if (typeof resolver === "object") { - return makeNSResolverFromMap(resolver); - } - - return defaultNSResolver; - } - - /** Converts native JavaScript types to their XPath library equivalent */ - function convertValue(value) { - if (value === null || - typeof value === "undefined" || - value instanceof XString || - value instanceof XBoolean || - value instanceof XNumber || - value instanceof XNodeSet) { - return value; - } - - switch (typeof value) { - case "string": return new XString(value); - case "boolean": return new XBoolean(value); - case "number": return new XNumber(value); - } - - // assume node(s) - var ns = new XNodeSet(); - ns.addArray([].concat(value)); - return ns; - } - - function makeEvaluator(func) { - return function (context) { - var args = Array.prototype.slice.call(arguments, 1).map(function (arg) { - return arg.evaluate(context); - }); - var result = func.apply(this, [].concat(context, args)); - return convertValue(result); - }; - } - - function makeFunctionResolverFromFunction(func) { - return { - getFunction: function (name, namespace) { - var found = func(name, namespace); - if (found) { - return makeEvaluator(found); - } - return defaultFunctionResolver.getFunction(name, namespace); - } - }; - } - - function makeFunctionResolverFromObject(obj) { - return makeFunctionResolverFromFunction(obj.getFunction.bind(obj)); - } - - function makeFunctionResolverFromMap(map) { - return makeFunctionResolverFromFunction(function (name) { - return map[name]; - }); - } - - function makeFunctionResolver(resolver) { - if (resolver && typeof resolver.getFunction === "function") { - return makeFunctionResolverFromObject(resolver); - } - - if (typeof resolver === "function") { - return makeFunctionResolverFromFunction(resolver); - } - - // assume map - if (typeof resolver === "object") { - return makeFunctionResolverFromMap(resolver); - } - - return defaultFunctionResolver; - } - - function makeVariableResolverFromFunction(func) { - return { - getVariable: function (name, namespace) { - var value = func(name, namespace); - return convertValue(value); - } - }; - } - - function makeVariableResolver(resolver) { - if (resolver) { - if (typeof resolver.getVariable === "function") { - return makeVariableResolverFromFunction(resolver.getVariable.bind(resolver)); - } - - if (typeof resolver === "function") { - return makeVariableResolverFromFunction(resolver); - } - - // assume map - if (typeof resolver === "object") { - return makeVariableResolverFromFunction(function (name) { - return resolver[name]; - }); - } - } - - return defaultVariableResolver; - } - - function copyIfPresent(prop, dest, source) { - if (prop in source) { dest[prop] = source[prop]; } - } - - function makeContext(options) { - var context = new XPathContext(); - - if (options) { - context.namespaceResolver = makeNSResolver(options.namespaces); - context.functionResolver = makeFunctionResolver(options.functions); - context.variableResolver = makeVariableResolver(options.variables); - context.expressionContextNode = options.node; - copyIfPresent('allowAnyNamespaceForNoPrefix', context, options); - copyIfPresent('isHtml', context, options); - } else { - context.namespaceResolver = defaultNSResolver; - } - - return context; - } - - function evaluate(parsedExpression, options) { - var context = makeContext(options); - - return parsedExpression.evaluate(context); - } - - var evaluatorPrototype = { - evaluate: function (options) { - return evaluate(this.expression, options); - } - - ,evaluateNumber: function (options) { - return this.evaluate(options).numberValue(); - } - - ,evaluateString: function (options) { - return this.evaluate(options).stringValue(); - } - - ,evaluateBoolean: function (options) { - return this.evaluate(options).booleanValue(); - } - - ,evaluateNodeSet: function (options) { - return this.evaluate(options).nodeset(); - } - - ,select: function (options) { - return this.evaluateNodeSet(options).toArray() - } - - ,select1: function (options) { - return this.select(options)[0]; - } - }; - - function parse(xpath) { - var parsed = parser.parse(xpath); - - return Object.create(evaluatorPrototype, { - expression: { - value: parsed - } - }); - } - - exports.parse = parse; -})(); - -exports.XPath = XPath; -exports.XPathParser = XPathParser; -exports.XPathResult = XPathResult; - -exports.Step = Step; -exports.NodeTest = NodeTest; -exports.BarOperation = BarOperation; - -exports.NamespaceResolver = NamespaceResolver; -exports.FunctionResolver = FunctionResolver; -exports.VariableResolver = VariableResolver; - -exports.Utilities = Utilities; - -exports.XPathContext = XPathContext; -exports.XNodeSet = XNodeSet; -exports.XBoolean = XBoolean; -exports.XString = XString; -exports.XNumber = XNumber; - -// helper -exports.select = function(e, doc, single) { - return exports.selectWithResolver(e, doc, null, single); -}; - -exports.useNamespaces = function(mappings) { - var resolver = { - mappings: mappings || {}, - lookupNamespaceURI: function(prefix) { - return this.mappings[prefix]; - } - }; - - return function(e, doc, single) { - return exports.selectWithResolver(e, doc, resolver, single); - }; -}; - -exports.selectWithResolver = function(e, doc, resolver, single) { - var expression = new XPathExpression(e, resolver, new XPathParser()); - var type = XPathResult.ANY_TYPE; - - var result = expression.evaluate(doc, type, null); - - if (result.resultType == XPathResult.STRING_TYPE) { - result = result.stringValue; - } - else if (result.resultType == XPathResult.NUMBER_TYPE) { - result = result.numberValue; - } - else if (result.resultType == XPathResult.BOOLEAN_TYPE) { - result = result.booleanValue; - } - else { - result = result.nodes; - if (single) { - result = result[0]; - } - } - - return result; -}; - -exports.select1 = function(e, doc) { - return exports.select(e, doc, true); -}; - -// end non-node wrapper -})(xpath); +/* + * xpath.js + * + * An XPath 1.0 library for JavaScript. + * + * Cameron McCormack + * + * This work is licensed under the MIT License. + * + * Revision 20: April 26, 2011 + * Fixed a typo resulting in FIRST_ORDERED_NODE_TYPE results being wrong, + * thanks to . + * + * Revision 19: November 29, 2005 + * Nodesets now store their nodes in a height balanced tree, increasing + * performance for the common case of selecting nodes in document order, + * thanks to S閎astien Cramatte . + * AVL tree code adapted from Raimund Neumann . + * + * Revision 18: October 27, 2005 + * DOM 3 XPath support. Caveats: + * - namespace prefixes aren't resolved in XPathEvaluator.createExpression, + * but in XPathExpression.evaluate. + * - XPathResult.invalidIteratorState is not implemented. + * + * Revision 17: October 25, 2005 + * Some core XPath function fixes and a patch to avoid crashing certain + * versions of MSXML in PathExpr.prototype.getOwnerElement, thanks to + * S閎astien Cramatte . + * + * Revision 16: September 22, 2005 + * Workarounds for some IE 5.5 deficiencies. + * Fixed problem with prefix node tests on attribute nodes. + * + * Revision 15: May 21, 2005 + * Fixed problem with QName node tests on elements with an xmlns="...". + * + * Revision 14: May 19, 2005 + * Fixed QName node tests on attribute node regression. + * + * Revision 13: May 3, 2005 + * Node tests are case insensitive now if working in an HTML DOM. + * + * Revision 12: April 26, 2005 + * Updated licence. Slight code changes to enable use of Dean + * Edwards' script compression, http://dean.edwards.name/packer/ . + * + * Revision 11: April 23, 2005 + * Fixed bug with 'and' and 'or' operators, fix thanks to + * Sandy McArthur . + * + * Revision 10: April 15, 2005 + * Added support for a virtual root node, supposedly helpful for + * implementing XForms. Fixed problem with QName node tests and + * the parent axis. + * + * Revision 9: March 17, 2005 + * Namespace resolver tweaked so using the document node as the context + * for namespace lookups is equivalent to using the document element. + * + * Revision 8: February 13, 2005 + * Handle implicit declaration of 'xmlns' namespace prefix. + * Fixed bug when comparing nodesets. + * Instance data can now be associated with a FunctionResolver, and + * workaround for MSXML not supporting 'localName' and 'getElementById', + * thanks to Grant Gongaware. + * Fix a few problems when the context node is the root node. + * + * Revision 7: February 11, 2005 + * Default namespace resolver fix from Grant Gongaware + * . + * + * Revision 6: February 10, 2005 + * Fixed bug in 'number' function. + * + * Revision 5: February 9, 2005 + * Fixed bug where text nodes not getting converted to string values. + * + * Revision 4: January 21, 2005 + * Bug in 'name' function, fix thanks to Bill Edney. + * Fixed incorrect processing of namespace nodes. + * Fixed NamespaceResolver to resolve 'xml' namespace. + * Implemented union '|' operator. + * + * Revision 3: January 14, 2005 + * Fixed bug with nodeset comparisons, bug lexing < and >. + * + * Revision 2: October 26, 2004 + * QName node test namespace handling fixed. Few other bug fixes. + * + * Revision 1: August 13, 2004 + * Bug fixes from William J. Edney . + * Added minimal licence. + * + * Initial version: June 14, 2004 + */ + +// non-node wrapper +var xpath = (typeof exports === 'undefined') ? {} : exports; + +(function(exports) { +"use strict"; + +// functional helpers +function curry( func ) { + var slice = Array.prototype.slice, + totalargs = func.length, + partial = function( args, fn ) { + return function( ) { + return fn.apply( this, args.concat( slice.call( arguments ) ) ); + } + }, + fn = function( ) { + var args = slice.call( arguments ); + return ( args.length < totalargs ) ? + partial( args, fn ) : + func.apply( this, slice.apply( arguments, [ 0, totalargs ] ) ); + }; + return fn; +} + +var forEach = curry(function (f, xs) { + for (var i = 0; i < xs.length; i += 1) { + f(xs[i], i, xs); + } +}); + +var reduce = curry(function (f, seed, xs) { + var acc = seed; + + forEach(function (x, i) { acc = f(acc, x, i); }, xs); + + return acc; +}); + +var map = curry(function (f, xs) { + var mapped = new Array(xs.length); + + forEach(function (x, i) { mapped[i] = f(x); }, xs); + + return mapped; +}); + +var filter = curry(function (f, xs) { + var filtered = []; + + forEach(function (x, i) { if(f(x, i)) { filtered.push(x); } }, xs); + + return filtered; +}); + +function compose() { + if (arguments.length === 0) { throw new Error('compose requires at least one argument'); } + + var funcs = Array.prototype.slice.call(arguments).reverse(); + + var f0 = funcs[0]; + var fRem = funcs.slice(1); + + return function () { + return reduce(function (acc, next) { + return next(acc); + }, f0.apply(null, arguments), fRem); + }; +} + +var includes = curry(function (values, value) { + for (var i = 0; i < values.length; i += 1) { + if (values[i] === value){ + return true; + } + } + + return false; +}); + +function always(value) { return function () { return value ;} } + +var prop = curry(function (name, obj) { return obj[name]; }); + +function toString (x) { return x.toString(); } +var join = curry(function (s, xs) { return xs.join(s); }); +var wrap = curry(function (pref, suf, str) { return pref + str + suf; }); + +function assign(target) { // .length of function is 2 + var to = Object(target); + + for (var index = 1; index < arguments.length; index++) { + var nextSource = arguments[index]; + + if (nextSource != null) { // Skip over if undefined or null + for (var nextKey in nextSource) { + // Avoid bugs when hasOwnProperty is shadowed + if (Object.prototype.hasOwnProperty.call(nextSource, nextKey)) { + to[nextKey] = nextSource[nextKey]; + } + } + } + } + + return to; +} + +// XPathParser /////////////////////////////////////////////////////////////// + +XPathParser.prototype = new Object(); +XPathParser.prototype.constructor = XPathParser; +XPathParser.superclass = Object.prototype; + +function XPathParser() { + this.init(); +} + +XPathParser.prototype.init = function() { + this.reduceActions = []; + + this.reduceActions[3] = function(rhs) { + return new OrOperation(rhs[0], rhs[2]); + }; + this.reduceActions[5] = function(rhs) { + return new AndOperation(rhs[0], rhs[2]); + }; + this.reduceActions[7] = function(rhs) { + return new EqualsOperation(rhs[0], rhs[2]); + }; + this.reduceActions[8] = function(rhs) { + return new NotEqualOperation(rhs[0], rhs[2]); + }; + this.reduceActions[10] = function(rhs) { + return new LessThanOperation(rhs[0], rhs[2]); + }; + this.reduceActions[11] = function(rhs) { + return new GreaterThanOperation(rhs[0], rhs[2]); + }; + this.reduceActions[12] = function(rhs) { + return new LessThanOrEqualOperation(rhs[0], rhs[2]); + }; + this.reduceActions[13] = function(rhs) { + return new GreaterThanOrEqualOperation(rhs[0], rhs[2]); + }; + this.reduceActions[15] = function(rhs) { + return new PlusOperation(rhs[0], rhs[2]); + }; + this.reduceActions[16] = function(rhs) { + return new MinusOperation(rhs[0], rhs[2]); + }; + this.reduceActions[18] = function(rhs) { + return new MultiplyOperation(rhs[0], rhs[2]); + }; + this.reduceActions[19] = function(rhs) { + return new DivOperation(rhs[0], rhs[2]); + }; + this.reduceActions[20] = function(rhs) { + return new ModOperation(rhs[0], rhs[2]); + }; + this.reduceActions[22] = function(rhs) { + return new UnaryMinusOperation(rhs[1]); + }; + this.reduceActions[24] = function(rhs) { + return new BarOperation(rhs[0], rhs[2]); + }; + this.reduceActions[25] = function(rhs) { + return new PathExpr(undefined, undefined, rhs[0]); + }; + this.reduceActions[27] = function(rhs) { + rhs[0].locationPath = rhs[2]; + return rhs[0]; + }; + this.reduceActions[28] = function(rhs) { + rhs[0].locationPath = rhs[2]; + rhs[0].locationPath.steps.unshift(new Step(Step.DESCENDANTORSELF, NodeTest.nodeTest, [])); + return rhs[0]; + }; + this.reduceActions[29] = function(rhs) { + return new PathExpr(rhs[0], [], undefined); + }; + this.reduceActions[30] = function(rhs) { + if (Utilities.instance_of(rhs[0], PathExpr)) { + if (rhs[0].filterPredicates == undefined) { + rhs[0].filterPredicates = []; + } + rhs[0].filterPredicates.push(rhs[1]); + return rhs[0]; + } else { + return new PathExpr(rhs[0], [rhs[1]], undefined); + } + }; + this.reduceActions[32] = function(rhs) { + return rhs[1]; + }; + this.reduceActions[33] = function(rhs) { + return new XString(rhs[0]); + }; + this.reduceActions[34] = function(rhs) { + return new XNumber(rhs[0]); + }; + this.reduceActions[36] = function(rhs) { + return new FunctionCall(rhs[0], []); + }; + this.reduceActions[37] = function(rhs) { + return new FunctionCall(rhs[0], rhs[2]); + }; + this.reduceActions[38] = function(rhs) { + return [ rhs[0] ]; + }; + this.reduceActions[39] = function(rhs) { + rhs[2].unshift(rhs[0]); + return rhs[2]; + }; + this.reduceActions[43] = function(rhs) { + return new LocationPath(true, []); + }; + this.reduceActions[44] = function(rhs) { + rhs[1].absolute = true; + return rhs[1]; + }; + this.reduceActions[46] = function(rhs) { + return new LocationPath(false, [ rhs[0] ]); + }; + this.reduceActions[47] = function(rhs) { + rhs[0].steps.push(rhs[2]); + return rhs[0]; + }; + this.reduceActions[49] = function(rhs) { + return new Step(rhs[0], rhs[1], []); + }; + this.reduceActions[50] = function(rhs) { + return new Step(Step.CHILD, rhs[0], []); + }; + this.reduceActions[51] = function(rhs) { + return new Step(rhs[0], rhs[1], rhs[2]); + }; + this.reduceActions[52] = function(rhs) { + return new Step(Step.CHILD, rhs[0], rhs[1]); + }; + this.reduceActions[54] = function(rhs) { + return [ rhs[0] ]; + }; + this.reduceActions[55] = function(rhs) { + rhs[1].unshift(rhs[0]); + return rhs[1]; + }; + this.reduceActions[56] = function(rhs) { + if (rhs[0] == "ancestor") { + return Step.ANCESTOR; + } else if (rhs[0] == "ancestor-or-self") { + return Step.ANCESTORORSELF; + } else if (rhs[0] == "attribute") { + return Step.ATTRIBUTE; + } else if (rhs[0] == "child") { + return Step.CHILD; + } else if (rhs[0] == "descendant") { + return Step.DESCENDANT; + } else if (rhs[0] == "descendant-or-self") { + return Step.DESCENDANTORSELF; + } else if (rhs[0] == "following") { + return Step.FOLLOWING; + } else if (rhs[0] == "following-sibling") { + return Step.FOLLOWINGSIBLING; + } else if (rhs[0] == "namespace") { + return Step.NAMESPACE; + } else if (rhs[0] == "parent") { + return Step.PARENT; + } else if (rhs[0] == "preceding") { + return Step.PRECEDING; + } else if (rhs[0] == "preceding-sibling") { + return Step.PRECEDINGSIBLING; + } else if (rhs[0] == "self") { + return Step.SELF; + } + return -1; + }; + this.reduceActions[57] = function(rhs) { + return Step.ATTRIBUTE; + }; + this.reduceActions[59] = function(rhs) { + if (rhs[0] == "comment") { + return NodeTest.commentTest; + } else if (rhs[0] == "text") { + return NodeTest.textTest; + } else if (rhs[0] == "processing-instruction") { + return NodeTest.anyPiTest; + } else if (rhs[0] == "node") { + return NodeTest.nodeTest; + } + return new NodeTest(-1, undefined); + }; + this.reduceActions[60] = function(rhs) { + return new NodeTest.PITest(rhs[2]); + }; + this.reduceActions[61] = function(rhs) { + return rhs[1]; + }; + this.reduceActions[63] = function(rhs) { + rhs[1].absolute = true; + rhs[1].steps.unshift(new Step(Step.DESCENDANTORSELF, NodeTest.nodeTest, [])); + return rhs[1]; + }; + this.reduceActions[64] = function(rhs) { + rhs[0].steps.push(new Step(Step.DESCENDANTORSELF, NodeTest.nodeTest, [])); + rhs[0].steps.push(rhs[2]); + return rhs[0]; + }; + this.reduceActions[65] = function(rhs) { + return new Step(Step.SELF, NodeTest.nodeTest, []); + }; + this.reduceActions[66] = function(rhs) { + return new Step(Step.PARENT, NodeTest.nodeTest, []); + }; + this.reduceActions[67] = function(rhs) { + return new VariableReference(rhs[1]); + }; + this.reduceActions[68] = function(rhs) { + return NodeTest.nameTestAny; + }; + this.reduceActions[69] = function(rhs) { + return new NodeTest.NameTestPrefixAny(rhs[0].split(':')[0]); + }; + this.reduceActions[70] = function(rhs) { + return new NodeTest.NameTestQName(rhs[0]); + }; +}; + +XPathParser.actionTable = [ + " s s sssssssss s ss s ss", + " s ", + "r rrrrrrrrr rrrrrrr rr r ", + " rrrrr ", + " s s sssssssss s ss s ss", + "rs rrrrrrrr s sssssrrrrrr rrs rs ", + " s s sssssssss s ss s ss", + " s ", + " s ", + "r rrrrrrrrr rrrrrrr rr rr ", + "r rrrrrrrrr rrrrrrr rr rr ", + "r rrrrrrrrr rrrrrrr rr rr ", + "r rrrrrrrrr rrrrrrr rr rr ", + "r rrrrrrrrr rrrrrrr rr rr ", + " s ", + " s ", + " s s sssss s s ", + "r rrrrrrrrr rrrrrrr rr r ", + "a ", + "r s rr r ", + "r sr rr r ", + "r s rr s rr r ", + "r rssrr rss rr r ", + "r rrrrr rrrss rr r ", + "r rrrrrsss rrrrr rr r ", + "r rrrrrrrr rrrrr rr r ", + "r rrrrrrrr rrrrrs rr r ", + "r rrrrrrrr rrrrrr rr r ", + "r rrrrrrrr rrrrrr rr r ", + "r srrrrrrrr rrrrrrs rr sr ", + "r srrrrrrrr rrrrrrs rr r ", + "r rrrrrrrrr rrrrrrr rr rr ", + "r rrrrrrrrr rrrrrrr rr rr ", + "r rrrrrrrrr rrrrrrr rr rr ", + "r rrrrrrrr rrrrrr rr r ", + "r rrrrrrrr rrrrrr rr r ", + "r rrrrrrrrr rrrrrrr rr r ", + "r rrrrrrrrr rrrrrrr rr r ", + " sssss ", + "r rrrrrrrrr rrrrrrr rr sr ", + "r rrrrrrrrr rrrrrrr rr r ", + "r rrrrrrrrr rrrrrrr rr rr ", + "r rrrrrrrrr rrrrrrr rr rr ", + " s ", + "r srrrrrrrr rrrrrrs rr r ", + "r rrrrrrrr rrrrr rr r ", + " s ", + " s ", + " rrrrr ", + " s s sssssssss s sss s ss", + "r srrrrrrrr rrrrrrs rr r ", + " s s sssssssss s ss s ss", + " s s sssssssss s ss s ss", + " s s sssssssss s ss s ss", + " s s sssssssss s ss s ss", + " s s sssssssss s ss s ss", + " s s sssssssss s ss s ss", + " s s sssssssss s ss s ss", + " s s sssssssss s ss s ss", + " s s sssssssss s ss s ss", + " s s sssssssss s ss s ss", + " s s sssssssss s ss s ss", + " s s sssssssss s ss s ss", + " s s sssssssss s ss s ss", + " s s sssssssss ss s ss", + " s s sssssssss s ss s ss", + " s s sssss s s ", + " s s sssss s s ", + "r rrrrrrrrr rrrrrrr rr rr ", + " s s sssss s s ", + " s s sssss s s ", + "r rrrrrrrrr rrrrrrr rr sr ", + "r rrrrrrrrr rrrrrrr rr sr ", + "r rrrrrrrrr rrrrrrr rr r ", + "r rrrrrrrrr rrrrrrr rr rr ", + " s ", + "r rrrrrrrrr rrrrrrr rr rr ", + "r rrrrrrrrr rrrrrrr rr rr ", + " rr ", + " s ", + " rs ", + "r sr rr r ", + "r s rr s rr r ", + "r rssrr rss rr r ", + "r rssrr rss rr r ", + "r rrrrr rrrss rr r ", + "r rrrrr rrrss rr r ", + "r rrrrr rrrss rr r ", + "r rrrrr rrrss rr r ", + "r rrrrrsss rrrrr rr r ", + "r rrrrrsss rrrrr rr r ", + "r rrrrrrrr rrrrr rr r ", + "r rrrrrrrr rrrrr rr r ", + "r rrrrrrrr rrrrr rr r ", + "r rrrrrrrr rrrrrr rr r ", + " r ", + " s ", + "r srrrrrrrr rrrrrrs rr r ", + "r srrrrrrrr rrrrrrs rr r ", + "r rrrrrrrrr rrrrrrr rr r ", + "r rrrrrrrrr rrrrrrr rr r ", + "r rrrrrrrrr rrrrrrr rr r ", + "r rrrrrrrrr rrrrrrr rr r ", + "r rrrrrrrrr rrrrrrr rr rr ", + "r rrrrrrrrr rrrrrrr rr rr ", + " s s sssssssss s ss s ss", + "r rrrrrrrrr rrrrrrr rr rr ", + " r " +]; + +XPathParser.actionTableNumber = [ + " 1 0 /.-,+*)(' & %$ # \"!", + " J ", + "a aaaaaaaaa aaaaaaa aa a ", + " YYYYY ", + " 1 0 /.-,+*)(' & %$ # \"!", + "K1 KKKKKKKK . +*)('KKKKKK KK# K\" ", + " 1 0 /.-,+*)(' & %$ # \"!", + " N ", + " O ", + "e eeeeeeeee eeeeeee ee ee ", + "f fffffffff fffffff ff ff ", + "d ddddddddd ddddddd dd dd ", + "B BBBBBBBBB BBBBBBB BB BB ", + "A AAAAAAAAA AAAAAAA AA AA ", + " P ", + " Q ", + " 1 . +*)(' # \" ", + "b bbbbbbbbb bbbbbbb bb b ", + " ", + "! S !! ! ", + "\" T\" \"\" \" ", + "$ V $$ U $$ $ ", + "& &ZY&& &XW && & ", + ") ))))) )))\\[ )) ) ", + ". ....._^] ..... .. . ", + "1 11111111 11111 11 1 ", + "5 55555555 55555` 55 5 ", + "7 77777777 777777 77 7 ", + "9 99999999 999999 99 9 ", + ": c:::::::: ::::::b :: a: ", + "I fIIIIIIII IIIIIIe II I ", + "= ========= ======= == == ", + "? ????????? ??????? ?? ?? ", + "C CCCCCCCCC CCCCCCC CC CC ", + "J JJJJJJJJ JJJJJJ JJ J ", + "M MMMMMMMM MMMMMM MM M ", + "N NNNNNNNNN NNNNNNN NN N ", + "P PPPPPPPPP PPPPPPP PP P ", + " +*)(' ", + "R RRRRRRRRR RRRRRRR RR aR ", + "U UUUUUUUUU UUUUUUU UU U ", + "Z ZZZZZZZZZ ZZZZZZZ ZZ ZZ ", + "c ccccccccc ccccccc cc cc ", + " j ", + "L fLLLLLLLL LLLLLLe LL L ", + "6 66666666 66666 66 6 ", + " k ", + " l ", + " XXXXX ", + " 1 0 /.-,+*)(' & %$m # \"!", + "_ f________ ______e __ _ ", + " 1 0 /.-,+*)(' & %$ # \"!", + " 1 0 /.-,+*)(' & %$ # \"!", + " 1 0 /.-,+*)(' & %$ # \"!", + " 1 0 /.-,+*)(' & %$ # \"!", + " 1 0 /.-,+*)(' & %$ # \"!", + " 1 0 /.-,+*)(' & %$ # \"!", + " 1 0 /.-,+*)(' & %$ # \"!", + " 1 0 /.-,+*)(' & %$ # \"!", + " 1 0 /.-,+*)(' & %$ # \"!", + " 1 0 /.-,+*)(' & %$ # \"!", + " 1 0 /.-,+*)(' & %$ # \"!", + " 1 0 /.-,+*)(' & %$ # \"!", + " 1 0 /.-,+*)(' & %$ # \"!", + " 1 0 /.-,+*)(' %$ # \"!", + " 1 0 /.-,+*)(' & %$ # \"!", + " 1 . +*)(' # \" ", + " 1 . +*)(' # \" ", + "> >>>>>>>>> >>>>>>> >> >> ", + " 1 . +*)(' # \" ", + " 1 . +*)(' # \" ", + "Q QQQQQQQQQ QQQQQQQ QQ aQ ", + "V VVVVVVVVV VVVVVVV VV aV ", + "T TTTTTTTTT TTTTTTT TT T ", + "@ @@@@@@@@@ @@@@@@@ @@ @@ ", + " \x87 ", + "[ [[[[[[[[[ [[[[[[[ [[ [[ ", + "D DDDDDDDDD DDDDDDD DD DD ", + " HH ", + " \x88 ", + " F\x89 ", + "# T# ## # ", + "% V %% U %% % ", + "' 'ZY'' 'XW '' ' ", + "( (ZY(( (XW (( ( ", + "+ +++++ +++\\[ ++ + ", + "* ***** ***\\[ ** * ", + "- ----- ---\\[ -- - ", + ", ,,,,, ,,,\\[ ,, , ", + "0 00000_^] 00000 00 0 ", + "/ /////_^] ///// // / ", + "2 22222222 22222 22 2 ", + "3 33333333 33333 33 3 ", + "4 44444444 44444 44 4 ", + "8 88888888 888888 88 8 ", + " ^ ", + " \x8a ", + "; f;;;;;;;; ;;;;;;e ;; ; ", + "< f<<<<<<<< <<<<<?@ AB CDEFGH IJ ", + " ", + " ", + " ", + "L456789:;<=>?@ AB CDEFGH IJ ", + " M EFGH IJ ", + " N;<=>?@ AB CDEFGH IJ ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " S EFGH IJ ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " e ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " h J ", + " i j ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + "o456789:;<=>?@ ABpqCDEFGH IJ ", + " ", + " r6789:;<=>?@ AB CDEFGH IJ ", + " s789:;<=>?@ AB CDEFGH IJ ", + " t89:;<=>?@ AB CDEFGH IJ ", + " u89:;<=>?@ AB CDEFGH IJ ", + " v9:;<=>?@ AB CDEFGH IJ ", + " w9:;<=>?@ AB CDEFGH IJ ", + " x9:;<=>?@ AB CDEFGH IJ ", + " y9:;<=>?@ AB CDEFGH IJ ", + " z:;<=>?@ AB CDEFGH IJ ", + " {:;<=>?@ AB CDEFGH IJ ", + " |;<=>?@ AB CDEFGH IJ ", + " };<=>?@ AB CDEFGH IJ ", + " ~;<=>?@ AB CDEFGH IJ ", + " \x7f=>?@ AB CDEFGH IJ ", + "\x80456789:;<=>?@ AB CDEFGH IJ\x81", + " \x82 EFGH IJ ", + " \x83 EFGH IJ ", + " ", + " \x84 GH IJ ", + " \x85 GH IJ ", + " i \x86 ", + " i \x87 ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + "o456789:;<=>?@ AB\x8cqCDEFGH IJ ", + " ", + " " +]; + +XPathParser.productions = [ + [1, 1, 2], + [2, 1, 3], + [3, 1, 4], + [3, 3, 3, -9, 4], + [4, 1, 5], + [4, 3, 4, -8, 5], + [5, 1, 6], + [5, 3, 5, -22, 6], + [5, 3, 5, -5, 6], + [6, 1, 7], + [6, 3, 6, -23, 7], + [6, 3, 6, -24, 7], + [6, 3, 6, -6, 7], + [6, 3, 6, -7, 7], + [7, 1, 8], + [7, 3, 7, -25, 8], + [7, 3, 7, -26, 8], + [8, 1, 9], + [8, 3, 8, -12, 9], + [8, 3, 8, -11, 9], + [8, 3, 8, -10, 9], + [9, 1, 10], + [9, 2, -26, 9], + [10, 1, 11], + [10, 3, 10, -27, 11], + [11, 1, 12], + [11, 1, 13], + [11, 3, 13, -28, 14], + [11, 3, 13, -4, 14], + [13, 1, 15], + [13, 2, 13, 16], + [15, 1, 17], + [15, 3, -29, 2, -30], + [15, 1, -15], + [15, 1, -16], + [15, 1, 18], + [18, 3, -13, -29, -30], + [18, 4, -13, -29, 19, -30], + [19, 1, 20], + [19, 3, 20, -31, 19], + [20, 1, 2], + [12, 1, 14], + [12, 1, 21], + [21, 1, -28], + [21, 2, -28, 14], + [21, 1, 22], + [14, 1, 23], + [14, 3, 14, -28, 23], + [14, 1, 24], + [23, 2, 25, 26], + [23, 1, 26], + [23, 3, 25, 26, 27], + [23, 2, 26, 27], + [23, 1, 28], + [27, 1, 16], + [27, 2, 16, 27], + [25, 2, -14, -3], + [25, 1, -32], + [26, 1, 29], + [26, 3, -20, -29, -30], + [26, 4, -21, -29, -15, -30], + [16, 3, -33, 30, -34], + [30, 1, 2], + [22, 2, -4, 14], + [24, 3, 14, -4, 23], + [28, 1, -35], + [28, 1, -2], + [17, 2, -36, -18], + [29, 1, -17], + [29, 1, -19], + [29, 1, -18] +]; + +XPathParser.DOUBLEDOT = 2; +XPathParser.DOUBLECOLON = 3; +XPathParser.DOUBLESLASH = 4; +XPathParser.NOTEQUAL = 5; +XPathParser.LESSTHANOREQUAL = 6; +XPathParser.GREATERTHANOREQUAL = 7; +XPathParser.AND = 8; +XPathParser.OR = 9; +XPathParser.MOD = 10; +XPathParser.DIV = 11; +XPathParser.MULTIPLYOPERATOR = 12; +XPathParser.FUNCTIONNAME = 13; +XPathParser.AXISNAME = 14; +XPathParser.LITERAL = 15; +XPathParser.NUMBER = 16; +XPathParser.ASTERISKNAMETEST = 17; +XPathParser.QNAME = 18; +XPathParser.NCNAMECOLONASTERISK = 19; +XPathParser.NODETYPE = 20; +XPathParser.PROCESSINGINSTRUCTIONWITHLITERAL = 21; +XPathParser.EQUALS = 22; +XPathParser.LESSTHAN = 23; +XPathParser.GREATERTHAN = 24; +XPathParser.PLUS = 25; +XPathParser.MINUS = 26; +XPathParser.BAR = 27; +XPathParser.SLASH = 28; +XPathParser.LEFTPARENTHESIS = 29; +XPathParser.RIGHTPARENTHESIS = 30; +XPathParser.COMMA = 31; +XPathParser.AT = 32; +XPathParser.LEFTBRACKET = 33; +XPathParser.RIGHTBRACKET = 34; +XPathParser.DOT = 35; +XPathParser.DOLLAR = 36; + +XPathParser.prototype.tokenize = function(s1) { + var types = []; + var values = []; + var s = s1 + '\0'; + + var pos = 0; + var c = s.charAt(pos++); + while (1) { + while (c == ' ' || c == '\t' || c == '\r' || c == '\n') { + c = s.charAt(pos++); + } + if (c == '\0' || pos >= s.length) { + break; + } + + if (c == '(') { + types.push(XPathParser.LEFTPARENTHESIS); + values.push(c); + c = s.charAt(pos++); + continue; + } + if (c == ')') { + types.push(XPathParser.RIGHTPARENTHESIS); + values.push(c); + c = s.charAt(pos++); + continue; + } + if (c == '[') { + types.push(XPathParser.LEFTBRACKET); + values.push(c); + c = s.charAt(pos++); + continue; + } + if (c == ']') { + types.push(XPathParser.RIGHTBRACKET); + values.push(c); + c = s.charAt(pos++); + continue; + } + if (c == '@') { + types.push(XPathParser.AT); + values.push(c); + c = s.charAt(pos++); + continue; + } + if (c == ',') { + types.push(XPathParser.COMMA); + values.push(c); + c = s.charAt(pos++); + continue; + } + if (c == '|') { + types.push(XPathParser.BAR); + values.push(c); + c = s.charAt(pos++); + continue; + } + if (c == '+') { + types.push(XPathParser.PLUS); + values.push(c); + c = s.charAt(pos++); + continue; + } + if (c == '-') { + types.push(XPathParser.MINUS); + values.push(c); + c = s.charAt(pos++); + continue; + } + if (c == '=') { + types.push(XPathParser.EQUALS); + values.push(c); + c = s.charAt(pos++); + continue; + } + if (c == '$') { + types.push(XPathParser.DOLLAR); + values.push(c); + c = s.charAt(pos++); + continue; + } + + if (c == '.') { + c = s.charAt(pos++); + if (c == '.') { + types.push(XPathParser.DOUBLEDOT); + values.push(".."); + c = s.charAt(pos++); + continue; + } + if (c >= '0' && c <= '9') { + var number = "." + c; + c = s.charAt(pos++); + while (c >= '0' && c <= '9') { + number += c; + c = s.charAt(pos++); + } + types.push(XPathParser.NUMBER); + values.push(number); + continue; + } + types.push(XPathParser.DOT); + values.push('.'); + continue; + } + + if (c == '\'' || c == '"') { + var delimiter = c; + var literal = ""; + while (pos < s.length && (c = s.charAt(pos)) !== delimiter) { + literal += c; + pos += 1; + } + if (c !== delimiter) { + throw XPathException.fromMessage("Unterminated string literal: " + delimiter + literal); + } + pos += 1; + types.push(XPathParser.LITERAL); + values.push(literal); + c = s.charAt(pos++); + continue; + } + + if (c >= '0' && c <= '9') { + var number = c; + c = s.charAt(pos++); + while (c >= '0' && c <= '9') { + number += c; + c = s.charAt(pos++); + } + if (c == '.') { + if (s.charAt(pos) >= '0' && s.charAt(pos) <= '9') { + number += c; + number += s.charAt(pos++); + c = s.charAt(pos++); + while (c >= '0' && c <= '9') { + number += c; + c = s.charAt(pos++); + } + } + } + types.push(XPathParser.NUMBER); + values.push(number); + continue; + } + + if (c == '*') { + if (types.length > 0) { + var last = types[types.length - 1]; + if (last != XPathParser.AT + && last != XPathParser.DOUBLECOLON + && last != XPathParser.LEFTPARENTHESIS + && last != XPathParser.LEFTBRACKET + && last != XPathParser.AND + && last != XPathParser.OR + && last != XPathParser.MOD + && last != XPathParser.DIV + && last != XPathParser.MULTIPLYOPERATOR + && last != XPathParser.SLASH + && last != XPathParser.DOUBLESLASH + && last != XPathParser.BAR + && last != XPathParser.PLUS + && last != XPathParser.MINUS + && last != XPathParser.EQUALS + && last != XPathParser.NOTEQUAL + && last != XPathParser.LESSTHAN + && last != XPathParser.LESSTHANOREQUAL + && last != XPathParser.GREATERTHAN + && last != XPathParser.GREATERTHANOREQUAL) { + types.push(XPathParser.MULTIPLYOPERATOR); + values.push(c); + c = s.charAt(pos++); + continue; + } + } + types.push(XPathParser.ASTERISKNAMETEST); + values.push(c); + c = s.charAt(pos++); + continue; + } + + if (c == ':') { + if (s.charAt(pos) == ':') { + types.push(XPathParser.DOUBLECOLON); + values.push("::"); + pos++; + c = s.charAt(pos++); + continue; + } + } + + if (c == '/') { + c = s.charAt(pos++); + if (c == '/') { + types.push(XPathParser.DOUBLESLASH); + values.push("//"); + c = s.charAt(pos++); + continue; + } + types.push(XPathParser.SLASH); + values.push('/'); + continue; + } + + if (c == '!') { + if (s.charAt(pos) == '=') { + types.push(XPathParser.NOTEQUAL); + values.push("!="); + pos++; + c = s.charAt(pos++); + continue; + } + } + + if (c == '<') { + if (s.charAt(pos) == '=') { + types.push(XPathParser.LESSTHANOREQUAL); + values.push("<="); + pos++; + c = s.charAt(pos++); + continue; + } + types.push(XPathParser.LESSTHAN); + values.push('<'); + c = s.charAt(pos++); + continue; + } + + if (c == '>') { + if (s.charAt(pos) == '=') { + types.push(XPathParser.GREATERTHANOREQUAL); + values.push(">="); + pos++; + c = s.charAt(pos++); + continue; + } + types.push(XPathParser.GREATERTHAN); + values.push('>'); + c = s.charAt(pos++); + continue; + } + + if (c == '_' || Utilities.isLetter(c.charCodeAt(0))) { + var name = c; + c = s.charAt(pos++); + while (Utilities.isNCNameChar(c.charCodeAt(0))) { + name += c; + c = s.charAt(pos++); + } + if (types.length > 0) { + var last = types[types.length - 1]; + if (last != XPathParser.AT + && last != XPathParser.DOUBLECOLON + && last != XPathParser.LEFTPARENTHESIS + && last != XPathParser.LEFTBRACKET + && last != XPathParser.AND + && last != XPathParser.OR + && last != XPathParser.MOD + && last != XPathParser.DIV + && last != XPathParser.MULTIPLYOPERATOR + && last != XPathParser.SLASH + && last != XPathParser.DOUBLESLASH + && last != XPathParser.BAR + && last != XPathParser.PLUS + && last != XPathParser.MINUS + && last != XPathParser.EQUALS + && last != XPathParser.NOTEQUAL + && last != XPathParser.LESSTHAN + && last != XPathParser.LESSTHANOREQUAL + && last != XPathParser.GREATERTHAN + && last != XPathParser.GREATERTHANOREQUAL) { + if (name == "and") { + types.push(XPathParser.AND); + values.push(name); + continue; + } + if (name == "or") { + types.push(XPathParser.OR); + values.push(name); + continue; + } + if (name == "mod") { + types.push(XPathParser.MOD); + values.push(name); + continue; + } + if (name == "div") { + types.push(XPathParser.DIV); + values.push(name); + continue; + } + } + } + if (c == ':') { + if (s.charAt(pos) == '*') { + types.push(XPathParser.NCNAMECOLONASTERISK); + values.push(name + ":*"); + pos++; + c = s.charAt(pos++); + continue; + } + if (s.charAt(pos) == '_' || Utilities.isLetter(s.charCodeAt(pos))) { + name += ':'; + c = s.charAt(pos++); + while (Utilities.isNCNameChar(c.charCodeAt(0))) { + name += c; + c = s.charAt(pos++); + } + if (c == '(') { + types.push(XPathParser.FUNCTIONNAME); + values.push(name); + continue; + } + types.push(XPathParser.QNAME); + values.push(name); + continue; + } + if (s.charAt(pos) == ':') { + types.push(XPathParser.AXISNAME); + values.push(name); + continue; + } + } + if (c == '(') { + if (name == "comment" || name == "text" || name == "node") { + types.push(XPathParser.NODETYPE); + values.push(name); + continue; + } + if (name == "processing-instruction") { + if (s.charAt(pos) == ')') { + types.push(XPathParser.NODETYPE); + } else { + types.push(XPathParser.PROCESSINGINSTRUCTIONWITHLITERAL); + } + values.push(name); + continue; + } + types.push(XPathParser.FUNCTIONNAME); + values.push(name); + continue; + } + types.push(XPathParser.QNAME); + values.push(name); + continue; + } + + throw new Error("Unexpected character " + c); + } + types.push(1); + values.push("[EOF]"); + return [types, values]; +}; + +XPathParser.SHIFT = 's'; +XPathParser.REDUCE = 'r'; +XPathParser.ACCEPT = 'a'; + +XPathParser.prototype.parse = function(s) { + var types; + var values; + var res = this.tokenize(s); + if (res == undefined) { + return undefined; + } + types = res[0]; + values = res[1]; + var tokenPos = 0; + var state = []; + var tokenType = []; + var tokenValue = []; + var s; + var a; + var t; + + state.push(0); + tokenType.push(1); + tokenValue.push("_S"); + + a = types[tokenPos]; + t = values[tokenPos++]; + while (1) { + s = state[state.length - 1]; + switch (XPathParser.actionTable[s].charAt(a - 1)) { + case XPathParser.SHIFT: + tokenType.push(-a); + tokenValue.push(t); + state.push(XPathParser.actionTableNumber[s].charCodeAt(a - 1) - 32); + a = types[tokenPos]; + t = values[tokenPos++]; + break; + case XPathParser.REDUCE: + var num = XPathParser.productions[XPathParser.actionTableNumber[s].charCodeAt(a - 1) - 32][1]; + var rhs = []; + for (var i = 0; i < num; i++) { + tokenType.pop(); + rhs.unshift(tokenValue.pop()); + state.pop(); + } + var s_ = state[state.length - 1]; + tokenType.push(XPathParser.productions[XPathParser.actionTableNumber[s].charCodeAt(a - 1) - 32][0]); + if (this.reduceActions[XPathParser.actionTableNumber[s].charCodeAt(a - 1) - 32] == undefined) { + tokenValue.push(rhs[0]); + } else { + tokenValue.push(this.reduceActions[XPathParser.actionTableNumber[s].charCodeAt(a - 1) - 32](rhs)); + } + state.push(XPathParser.gotoTable[s_].charCodeAt(XPathParser.productions[XPathParser.actionTableNumber[s].charCodeAt(a - 1) - 32][0] - 2) - 33); + break; + case XPathParser.ACCEPT: + return new XPath(tokenValue.pop()); + default: + throw new Error("XPath parse error"); + } + } +}; + +// XPath ///////////////////////////////////////////////////////////////////// + +XPath.prototype = new Object(); +XPath.prototype.constructor = XPath; +XPath.superclass = Object.prototype; + +function XPath(e) { + this.expression = e; +} + +XPath.prototype.toString = function() { + return this.expression.toString(); +}; + +function setIfUnset(obj, prop, value) { + if (!(prop in obj)) { + obj[prop] = value; + } +} + +XPath.prototype.evaluate = function(c) { + c.contextNode = c.expressionContextNode; + c.contextSize = 1; + c.contextPosition = 1; + + // [2017-11-25] Removed usage of .implementation.hasFeature() since it does + // not reliably detect HTML DOMs (always returns false in xmldom and true in browsers) + if (c.isHtml) { + setIfUnset(c, 'caseInsensitive', true); + setIfUnset(c, 'allowAnyNamespaceForNoPrefix', true); + } + + setIfUnset(c, 'caseInsensitive', false); + + return this.expression.evaluate(c); +}; + +XPath.XML_NAMESPACE_URI = "http://www.w3.org/XML/1998/namespace"; +XPath.XMLNS_NAMESPACE_URI = "http://www.w3.org/2000/xmlns/"; + +// Expression //////////////////////////////////////////////////////////////// + +Expression.prototype = new Object(); +Expression.prototype.constructor = Expression; +Expression.superclass = Object.prototype; + +function Expression() { +} + +Expression.prototype.init = function() { +}; + +Expression.prototype.toString = function() { + return ""; +}; + +Expression.prototype.evaluate = function(c) { + throw new Error("Could not evaluate expression."); +}; + +// UnaryOperation //////////////////////////////////////////////////////////// + +UnaryOperation.prototype = new Expression(); +UnaryOperation.prototype.constructor = UnaryOperation; +UnaryOperation.superclass = Expression.prototype; + +function UnaryOperation(rhs) { + if (arguments.length > 0) { + this.init(rhs); + } +} + +UnaryOperation.prototype.init = function(rhs) { + this.rhs = rhs; +}; + +// UnaryMinusOperation /////////////////////////////////////////////////////// + +UnaryMinusOperation.prototype = new UnaryOperation(); +UnaryMinusOperation.prototype.constructor = UnaryMinusOperation; +UnaryMinusOperation.superclass = UnaryOperation.prototype; + +function UnaryMinusOperation(rhs) { + if (arguments.length > 0) { + this.init(rhs); + } +} + +UnaryMinusOperation.prototype.init = function(rhs) { + UnaryMinusOperation.superclass.init.call(this, rhs); +}; + +UnaryMinusOperation.prototype.evaluate = function(c) { + return this.rhs.evaluate(c).number().negate(); +}; + +UnaryMinusOperation.prototype.toString = function() { + return "-" + this.rhs.toString(); +}; + +// BinaryOperation /////////////////////////////////////////////////////////// + +BinaryOperation.prototype = new Expression(); +BinaryOperation.prototype.constructor = BinaryOperation; +BinaryOperation.superclass = Expression.prototype; + +function BinaryOperation(lhs, rhs) { + if (arguments.length > 0) { + this.init(lhs, rhs); + } +} + +BinaryOperation.prototype.init = function(lhs, rhs) { + this.lhs = lhs; + this.rhs = rhs; +}; + +// OrOperation /////////////////////////////////////////////////////////////// + +OrOperation.prototype = new BinaryOperation(); +OrOperation.prototype.constructor = OrOperation; +OrOperation.superclass = BinaryOperation.prototype; + +function OrOperation(lhs, rhs) { + if (arguments.length > 0) { + this.init(lhs, rhs); + } +} + +OrOperation.prototype.init = function(lhs, rhs) { + OrOperation.superclass.init.call(this, lhs, rhs); +}; + +OrOperation.prototype.toString = function() { + return "(" + this.lhs.toString() + " or " + this.rhs.toString() + ")"; +}; + +OrOperation.prototype.evaluate = function(c) { + var b = this.lhs.evaluate(c).bool(); + if (b.booleanValue()) { + return b; + } + return this.rhs.evaluate(c).bool(); +}; + +// AndOperation ////////////////////////////////////////////////////////////// + +AndOperation.prototype = new BinaryOperation(); +AndOperation.prototype.constructor = AndOperation; +AndOperation.superclass = BinaryOperation.prototype; + +function AndOperation(lhs, rhs) { + if (arguments.length > 0) { + this.init(lhs, rhs); + } +} + +AndOperation.prototype.init = function(lhs, rhs) { + AndOperation.superclass.init.call(this, lhs, rhs); +}; + +AndOperation.prototype.toString = function() { + return "(" + this.lhs.toString() + " and " + this.rhs.toString() + ")"; +}; + +AndOperation.prototype.evaluate = function(c) { + var b = this.lhs.evaluate(c).bool(); + if (!b.booleanValue()) { + return b; + } + return this.rhs.evaluate(c).bool(); +}; + +// EqualsOperation /////////////////////////////////////////////////////////// + +EqualsOperation.prototype = new BinaryOperation(); +EqualsOperation.prototype.constructor = EqualsOperation; +EqualsOperation.superclass = BinaryOperation.prototype; + +function EqualsOperation(lhs, rhs) { + if (arguments.length > 0) { + this.init(lhs, rhs); + } +} + +EqualsOperation.prototype.init = function(lhs, rhs) { + EqualsOperation.superclass.init.call(this, lhs, rhs); +}; + +EqualsOperation.prototype.toString = function() { + return "(" + this.lhs.toString() + " = " + this.rhs.toString() + ")"; +}; + +EqualsOperation.prototype.evaluate = function(c) { + return this.lhs.evaluate(c).equals(this.rhs.evaluate(c)); +}; + +// NotEqualOperation ///////////////////////////////////////////////////////// + +NotEqualOperation.prototype = new BinaryOperation(); +NotEqualOperation.prototype.constructor = NotEqualOperation; +NotEqualOperation.superclass = BinaryOperation.prototype; + +function NotEqualOperation(lhs, rhs) { + if (arguments.length > 0) { + this.init(lhs, rhs); + } +} + +NotEqualOperation.prototype.init = function(lhs, rhs) { + NotEqualOperation.superclass.init.call(this, lhs, rhs); +}; + +NotEqualOperation.prototype.toString = function() { + return "(" + this.lhs.toString() + " != " + this.rhs.toString() + ")"; +}; + +NotEqualOperation.prototype.evaluate = function(c) { + return this.lhs.evaluate(c).notequal(this.rhs.evaluate(c)); +}; + +// LessThanOperation ///////////////////////////////////////////////////////// + +LessThanOperation.prototype = new BinaryOperation(); +LessThanOperation.prototype.constructor = LessThanOperation; +LessThanOperation.superclass = BinaryOperation.prototype; + +function LessThanOperation(lhs, rhs) { + if (arguments.length > 0) { + this.init(lhs, rhs); + } +} + +LessThanOperation.prototype.init = function(lhs, rhs) { + LessThanOperation.superclass.init.call(this, lhs, rhs); +}; + +LessThanOperation.prototype.evaluate = function(c) { + return this.lhs.evaluate(c).lessthan(this.rhs.evaluate(c)); +}; + +LessThanOperation.prototype.toString = function() { + return "(" + this.lhs.toString() + " < " + this.rhs.toString() + ")"; +}; + +// GreaterThanOperation ////////////////////////////////////////////////////// + +GreaterThanOperation.prototype = new BinaryOperation(); +GreaterThanOperation.prototype.constructor = GreaterThanOperation; +GreaterThanOperation.superclass = BinaryOperation.prototype; + +function GreaterThanOperation(lhs, rhs) { + if (arguments.length > 0) { + this.init(lhs, rhs); + } +} + +GreaterThanOperation.prototype.init = function(lhs, rhs) { + GreaterThanOperation.superclass.init.call(this, lhs, rhs); +}; + +GreaterThanOperation.prototype.evaluate = function(c) { + return this.lhs.evaluate(c).greaterthan(this.rhs.evaluate(c)); +}; + +GreaterThanOperation.prototype.toString = function() { + return "(" + this.lhs.toString() + " > " + this.rhs.toString() + ")"; +}; + +// LessThanOrEqualOperation ////////////////////////////////////////////////// + +LessThanOrEqualOperation.prototype = new BinaryOperation(); +LessThanOrEqualOperation.prototype.constructor = LessThanOrEqualOperation; +LessThanOrEqualOperation.superclass = BinaryOperation.prototype; + +function LessThanOrEqualOperation(lhs, rhs) { + if (arguments.length > 0) { + this.init(lhs, rhs); + } +} + +LessThanOrEqualOperation.prototype.init = function(lhs, rhs) { + LessThanOrEqualOperation.superclass.init.call(this, lhs, rhs); +}; + +LessThanOrEqualOperation.prototype.evaluate = function(c) { + return this.lhs.evaluate(c).lessthanorequal(this.rhs.evaluate(c)); +}; + +LessThanOrEqualOperation.prototype.toString = function() { + return "(" + this.lhs.toString() + " <= " + this.rhs.toString() + ")"; +}; + +// GreaterThanOrEqualOperation /////////////////////////////////////////////// + +GreaterThanOrEqualOperation.prototype = new BinaryOperation(); +GreaterThanOrEqualOperation.prototype.constructor = GreaterThanOrEqualOperation; +GreaterThanOrEqualOperation.superclass = BinaryOperation.prototype; + +function GreaterThanOrEqualOperation(lhs, rhs) { + if (arguments.length > 0) { + this.init(lhs, rhs); + } +} + +GreaterThanOrEqualOperation.prototype.init = function(lhs, rhs) { + GreaterThanOrEqualOperation.superclass.init.call(this, lhs, rhs); +}; + +GreaterThanOrEqualOperation.prototype.evaluate = function(c) { + return this.lhs.evaluate(c).greaterthanorequal(this.rhs.evaluate(c)); +}; + +GreaterThanOrEqualOperation.prototype.toString = function() { + return "(" + this.lhs.toString() + " >= " + this.rhs.toString() + ")"; +}; + +// PlusOperation ///////////////////////////////////////////////////////////// + +PlusOperation.prototype = new BinaryOperation(); +PlusOperation.prototype.constructor = PlusOperation; +PlusOperation.superclass = BinaryOperation.prototype; + +function PlusOperation(lhs, rhs) { + if (arguments.length > 0) { + this.init(lhs, rhs); + } +} + +PlusOperation.prototype.init = function(lhs, rhs) { + PlusOperation.superclass.init.call(this, lhs, rhs); +}; + +PlusOperation.prototype.evaluate = function(c) { + return this.lhs.evaluate(c).number().plus(this.rhs.evaluate(c).number()); +}; + +PlusOperation.prototype.toString = function() { + return "(" + this.lhs.toString() + " + " + this.rhs.toString() + ")"; +}; + +// MinusOperation //////////////////////////////////////////////////////////// + +MinusOperation.prototype = new BinaryOperation(); +MinusOperation.prototype.constructor = MinusOperation; +MinusOperation.superclass = BinaryOperation.prototype; + +function MinusOperation(lhs, rhs) { + if (arguments.length > 0) { + this.init(lhs, rhs); + } +} + +MinusOperation.prototype.init = function(lhs, rhs) { + MinusOperation.superclass.init.call(this, lhs, rhs); +}; + +MinusOperation.prototype.evaluate = function(c) { + return this.lhs.evaluate(c).number().minus(this.rhs.evaluate(c).number()); +}; + +MinusOperation.prototype.toString = function() { + return "(" + this.lhs.toString() + " - " + this.rhs.toString() + ")"; +}; + +// MultiplyOperation ///////////////////////////////////////////////////////// + +MultiplyOperation.prototype = new BinaryOperation(); +MultiplyOperation.prototype.constructor = MultiplyOperation; +MultiplyOperation.superclass = BinaryOperation.prototype; + +function MultiplyOperation(lhs, rhs) { + if (arguments.length > 0) { + this.init(lhs, rhs); + } +} + +MultiplyOperation.prototype.init = function(lhs, rhs) { + MultiplyOperation.superclass.init.call(this, lhs, rhs); +}; + +MultiplyOperation.prototype.evaluate = function(c) { + return this.lhs.evaluate(c).number().multiply(this.rhs.evaluate(c).number()); +}; + +MultiplyOperation.prototype.toString = function() { + return "(" + this.lhs.toString() + " * " + this.rhs.toString() + ")"; +}; + +// DivOperation ////////////////////////////////////////////////////////////// + +DivOperation.prototype = new BinaryOperation(); +DivOperation.prototype.constructor = DivOperation; +DivOperation.superclass = BinaryOperation.prototype; + +function DivOperation(lhs, rhs) { + if (arguments.length > 0) { + this.init(lhs, rhs); + } +} + +DivOperation.prototype.init = function(lhs, rhs) { + DivOperation.superclass.init.call(this, lhs, rhs); +}; + +DivOperation.prototype.evaluate = function(c) { + return this.lhs.evaluate(c).number().div(this.rhs.evaluate(c).number()); +}; + +DivOperation.prototype.toString = function() { + return "(" + this.lhs.toString() + " div " + this.rhs.toString() + ")"; +}; + +// ModOperation ////////////////////////////////////////////////////////////// + +ModOperation.prototype = new BinaryOperation(); +ModOperation.prototype.constructor = ModOperation; +ModOperation.superclass = BinaryOperation.prototype; + +function ModOperation(lhs, rhs) { + if (arguments.length > 0) { + this.init(lhs, rhs); + } +} + +ModOperation.prototype.init = function(lhs, rhs) { + ModOperation.superclass.init.call(this, lhs, rhs); +}; + +ModOperation.prototype.evaluate = function(c) { + return this.lhs.evaluate(c).number().mod(this.rhs.evaluate(c).number()); +}; + +ModOperation.prototype.toString = function() { + return "(" + this.lhs.toString() + " mod " + this.rhs.toString() + ")"; +}; + +// BarOperation ////////////////////////////////////////////////////////////// + +BarOperation.prototype = new BinaryOperation(); +BarOperation.prototype.constructor = BarOperation; +BarOperation.superclass = BinaryOperation.prototype; + +function BarOperation(lhs, rhs) { + if (arguments.length > 0) { + this.init(lhs, rhs); + } +} + +BarOperation.prototype.init = function(lhs, rhs) { + BarOperation.superclass.init.call(this, lhs, rhs); +}; + +BarOperation.prototype.evaluate = function(c) { + return this.lhs.evaluate(c).nodeset().union(this.rhs.evaluate(c).nodeset()); +}; + +BarOperation.prototype.toString = function() { + return map(toString, [this.lhs, this.rhs]).join(' | '); +}; + +// PathExpr ////////////////////////////////////////////////////////////////// + +PathExpr.prototype = new Expression(); +PathExpr.prototype.constructor = PathExpr; +PathExpr.superclass = Expression.prototype; + +function PathExpr(filter, filterPreds, locpath) { + if (arguments.length > 0) { + this.init(filter, filterPreds, locpath); + } +} + +PathExpr.prototype.init = function(filter, filterPreds, locpath) { + PathExpr.superclass.init.call(this); + this.filter = filter; + this.filterPredicates = filterPreds; + this.locationPath = locpath; +}; + +/** + * Returns the topmost node of the tree containing node + */ +function findRoot(node) { + while (node && node.parentNode) { + node = node.parentNode; + } + + return node; +} + +PathExpr.applyPredicates = function (predicates, c, nodes) { + return reduce(function (inNodes, pred) { + var ctx = c.extend({ contextSize: inNodes.length }); + + return filter(function (node, i) { + return PathExpr.predicateMatches(pred, ctx.extend({ contextNode: node, contextPosition: i + 1 })); + }, inNodes); + }, nodes, predicates); +}; + +PathExpr.getRoot = function (xpc, nodes) { + var firstNode = nodes[0]; + + if (firstNode.nodeType === 9 /*Node.DOCUMENT_NODE*/) { + return firstNode; + } + + if (xpc.virtualRoot) { + return xpc.virtualRoot; + } + + var ownerDoc = firstNode.ownerDocument; + + if (ownerDoc) { + return ownerDoc; + } + + // IE 5.5 doesn't have ownerDocument? + var n = firstNode; + while (n.parentNode != null) { + n = n.parentNode; + } + return n; +} + +PathExpr.applyStep = function (step, xpc, node) { + var self = this; + var newNodes = []; + xpc.contextNode = node; + + switch (step.axis) { + case Step.ANCESTOR: + // look at all the ancestor nodes + if (xpc.contextNode === xpc.virtualRoot) { + break; + } + var m; + if (xpc.contextNode.nodeType == 2 /*Node.ATTRIBUTE_NODE*/) { + m = PathExpr.getOwnerElement(xpc.contextNode); + } else { + m = xpc.contextNode.parentNode; + } + while (m != null) { + if (step.nodeTest.matches(m, xpc)) { + newNodes.push(m); + } + if (m === xpc.virtualRoot) { + break; + } + m = m.parentNode; + } + break; + + case Step.ANCESTORORSELF: + // look at all the ancestor nodes and the current node + for (var m = xpc.contextNode; m != null; m = m.nodeType == 2 /*Node.ATTRIBUTE_NODE*/ ? PathExpr.getOwnerElement(m) : m.parentNode) { + if (step.nodeTest.matches(m, xpc)) { + newNodes.push(m); + } + if (m === xpc.virtualRoot) { + break; + } + } + break; + + case Step.ATTRIBUTE: + // look at the attributes + var nnm = xpc.contextNode.attributes; + if (nnm != null) { + for (var k = 0; k < nnm.length; k++) { + var m = nnm.item(k); + if (step.nodeTest.matches(m, xpc)) { + newNodes.push(m); + } + } + } + break; + + case Step.CHILD: + // look at all child elements + for (var m = xpc.contextNode.firstChild; m != null; m = m.nextSibling) { + if (step.nodeTest.matches(m, xpc)) { + newNodes.push(m); + } + } + break; + + case Step.DESCENDANT: + // look at all descendant nodes + var st = [ xpc.contextNode.firstChild ]; + while (st.length > 0) { + for (var m = st.pop(); m != null; ) { + if (step.nodeTest.matches(m, xpc)) { + newNodes.push(m); + } + if (m.firstChild != null) { + st.push(m.nextSibling); + m = m.firstChild; + } else { + m = m.nextSibling; + } + } + } + break; + + case Step.DESCENDANTORSELF: + // look at self + if (step.nodeTest.matches(xpc.contextNode, xpc)) { + newNodes.push(xpc.contextNode); + } + // look at all descendant nodes + var st = [ xpc.contextNode.firstChild ]; + while (st.length > 0) { + for (var m = st.pop(); m != null; ) { + if (step.nodeTest.matches(m, xpc)) { + newNodes.push(m); + } + if (m.firstChild != null) { + st.push(m.nextSibling); + m = m.firstChild; + } else { + m = m.nextSibling; + } + } + } + break; + + case Step.FOLLOWING: + if (xpc.contextNode === xpc.virtualRoot) { + break; + } + var st = []; + if (xpc.contextNode.firstChild != null) { + st.unshift(xpc.contextNode.firstChild); + } else { + st.unshift(xpc.contextNode.nextSibling); + } + for (var m = xpc.contextNode.parentNode; m != null && m.nodeType != 9 /*Node.DOCUMENT_NODE*/ && m !== xpc.virtualRoot; m = m.parentNode) { + st.unshift(m.nextSibling); + } + do { + for (var m = st.pop(); m != null; ) { + if (step.nodeTest.matches(m, xpc)) { + newNodes.push(m); + } + if (m.firstChild != null) { + st.push(m.nextSibling); + m = m.firstChild; + } else { + m = m.nextSibling; + } + } + } while (st.length > 0); + break; + + case Step.FOLLOWINGSIBLING: + if (xpc.contextNode === xpc.virtualRoot) { + break; + } + for (var m = xpc.contextNode.nextSibling; m != null; m = m.nextSibling) { + if (step.nodeTest.matches(m, xpc)) { + newNodes.push(m); + } + } + break; + + case Step.NAMESPACE: + var n = {}; + if (xpc.contextNode.nodeType == 1 /*Node.ELEMENT_NODE*/) { + n["xml"] = XPath.XML_NAMESPACE_URI; + n["xmlns"] = XPath.XMLNS_NAMESPACE_URI; + for (var m = xpc.contextNode; m != null && m.nodeType == 1 /*Node.ELEMENT_NODE*/; m = m.parentNode) { + for (var k = 0; k < m.attributes.length; k++) { + var attr = m.attributes.item(k); + var nm = String(attr.name); + if (nm == "xmlns") { + if (n[""] == undefined) { + n[""] = attr.value; + } + } else if (nm.length > 6 && nm.substring(0, 6) == "xmlns:") { + var pre = nm.substring(6, nm.length); + if (n[pre] == undefined) { + n[pre] = attr.value; + } + } + } + } + for (var pre in n) { + var nsn = new XPathNamespace(pre, n[pre], xpc.contextNode); + if (step.nodeTest.matches(nsn, xpc)) { + newNodes.push(nsn); + } + } + } + break; + + case Step.PARENT: + m = null; + if (xpc.contextNode !== xpc.virtualRoot) { + if (xpc.contextNode.nodeType == 2 /*Node.ATTRIBUTE_NODE*/) { + m = PathExpr.getOwnerElement(xpc.contextNode); + } else { + m = xpc.contextNode.parentNode; + } + } + if (m != null && step.nodeTest.matches(m, xpc)) { + newNodes.push(m); + } + break; + + case Step.PRECEDING: + var st; + if (xpc.virtualRoot != null) { + st = [ xpc.virtualRoot ]; + } else { + // cannot rely on .ownerDocument because the node may be in a document fragment + st = [findRoot(xpc.contextNode)]; + } + outer: while (st.length > 0) { + for (var m = st.pop(); m != null; ) { + if (m == xpc.contextNode) { + break outer; + } + if (step.nodeTest.matches(m, xpc)) { + newNodes.unshift(m); + } + if (m.firstChild != null) { + st.push(m.nextSibling); + m = m.firstChild; + } else { + m = m.nextSibling; + } + } + } + break; + + case Step.PRECEDINGSIBLING: + if (xpc.contextNode === xpc.virtualRoot) { + break; + } + for (var m = xpc.contextNode.previousSibling; m != null; m = m.previousSibling) { + if (step.nodeTest.matches(m, xpc)) { + newNodes.push(m); + } + } + break; + + case Step.SELF: + if (step.nodeTest.matches(xpc.contextNode, xpc)) { + newNodes.push(xpc.contextNode); + } + break; + + default: + } + + return newNodes; +}; + +PathExpr.applySteps = function (steps, xpc, nodes) { + return reduce(function (inNodes, step) { + return [].concat.apply([], map(function (node) { + return PathExpr.applyPredicates(step.predicates, xpc, PathExpr.applyStep(step, xpc, node)); + }, inNodes)); + }, nodes, steps); +} + +PathExpr.prototype.applyFilter = function(c, xpc) { + if (!this.filter) { + return { nodes: [ c.contextNode ] }; + } + + var ns = this.filter.evaluate(c); + + if (!Utilities.instance_of(ns, XNodeSet)) { + if (this.filterPredicates != null && this.filterPredicates.length > 0 || this.locationPath != null) { + throw new Error("Path expression filter must evaluate to a nodeset if predicates or location path are used"); + } + + return { nonNodes: ns }; + } + + return { + nodes: PathExpr.applyPredicates(this.filterPredicates || [], xpc, ns.toUnsortedArray()) + }; +}; + +PathExpr.applyLocationPath = function (locationPath, xpc, nodes) { + if (!locationPath) { + return nodes; + } + + var startNodes = locationPath.absolute ? [ PathExpr.getRoot(xpc, nodes) ] : nodes; + + return PathExpr.applySteps(locationPath.steps, xpc, startNodes); +}; + +PathExpr.prototype.evaluate = function(c) { + var xpc = assign(new XPathContext(), c); + + var filterResult = this.applyFilter(c, xpc); + + if ('nonNodes' in filterResult) { + return filterResult.nonNodes; + } + + var ns = new XNodeSet(); + ns.addArray(PathExpr.applyLocationPath(this.locationPath, xpc, filterResult.nodes)); + return ns; +}; + +PathExpr.predicateMatches = function(pred, c) { + var res = pred.evaluate(c); + + return Utilities.instance_of(res, XNumber) + ? c.contextPosition == res.numberValue() + : res.booleanValue(); +}; + +PathExpr.predicateString = compose(wrap('[', ']'), toString); +PathExpr.predicatesString = compose(join(''), map(PathExpr.predicateString)); + +PathExpr.prototype.toString = function() { + if (this.filter != undefined) { + var filterStr = toString(this.filter); + + if (Utilities.instance_of(this.filter, XString)) { + return wrap("'", "'", filterStr); + } + if (this.filterPredicates != undefined && this.filterPredicates.length) { + return wrap('(', ')', filterStr) + + PathExpr.predicatesString(this.filterPredicates); + } + if (this.locationPath != undefined) { + return filterStr + + (this.locationPath.absolute ? '' : '/') + + toString(this.locationPath); + } + + return filterStr; + } + + return toString(this.locationPath); +}; + +PathExpr.getOwnerElement = function(n) { + // DOM 2 has ownerElement + if (n.ownerElement) { + return n.ownerElement; + } + // DOM 1 Internet Explorer can use selectSingleNode (ironically) + try { + if (n.selectSingleNode) { + return n.selectSingleNode(".."); + } + } catch (e) { + } + // Other DOM 1 implementations must use this egregious search + var doc = n.nodeType == 9 /*Node.DOCUMENT_NODE*/ + ? n + : n.ownerDocument; + var elts = doc.getElementsByTagName("*"); + for (var i = 0; i < elts.length; i++) { + var elt = elts.item(i); + var nnm = elt.attributes; + for (var j = 0; j < nnm.length; j++) { + var an = nnm.item(j); + if (an === n) { + return elt; + } + } + } + return null; +}; + +// LocationPath ////////////////////////////////////////////////////////////// + +LocationPath.prototype = new Object(); +LocationPath.prototype.constructor = LocationPath; +LocationPath.superclass = Object.prototype; + +function LocationPath(abs, steps) { + if (arguments.length > 0) { + this.init(abs, steps); + } +} + +LocationPath.prototype.init = function(abs, steps) { + this.absolute = abs; + this.steps = steps; +}; + +LocationPath.prototype.toString = function() { + return ( + (this.absolute ? '/' : '') + + map(toString, this.steps).join('/') + ); +}; + +// Step ////////////////////////////////////////////////////////////////////// + +Step.prototype = new Object(); +Step.prototype.constructor = Step; +Step.superclass = Object.prototype; + +function Step(axis, nodetest, preds) { + if (arguments.length > 0) { + this.init(axis, nodetest, preds); + } +} + +Step.prototype.init = function(axis, nodetest, preds) { + this.axis = axis; + this.nodeTest = nodetest; + this.predicates = preds; +}; + +Step.prototype.toString = function() { + return Step.STEPNAMES[this.axis] + + "::" + + this.nodeTest.toString() + + PathExpr.predicatesString(this.predicates); +}; + + +Step.ANCESTOR = 0; +Step.ANCESTORORSELF = 1; +Step.ATTRIBUTE = 2; +Step.CHILD = 3; +Step.DESCENDANT = 4; +Step.DESCENDANTORSELF = 5; +Step.FOLLOWING = 6; +Step.FOLLOWINGSIBLING = 7; +Step.NAMESPACE = 8; +Step.PARENT = 9; +Step.PRECEDING = 10; +Step.PRECEDINGSIBLING = 11; +Step.SELF = 12; + +Step.STEPNAMES = reduce(function (acc, x) { return acc[x[0]] = x[1], acc; }, {}, [ + [Step.ANCESTOR, 'ancestor'], + [Step.ANCESTORORSELF, 'ancestor-or-self'], + [Step.ATTRIBUTE, 'attribute'], + [Step.CHILD, 'child'], + [Step.DESCENDANT, 'descendant'], + [Step.DESCENDANTORSELF, 'descendant-or-self'], + [Step.FOLLOWING, 'following'], + [Step.FOLLOWINGSIBLING, 'following-sibling'], + [Step.NAMESPACE, 'namespace'], + [Step.PARENT, 'parent'], + [Step.PRECEDING, 'preceding'], + [Step.PRECEDINGSIBLING, 'preceding-sibling'], + [Step.SELF, 'self'] + ]); + +// NodeTest ////////////////////////////////////////////////////////////////// + +NodeTest.prototype = new Object(); +NodeTest.prototype.constructor = NodeTest; +NodeTest.superclass = Object.prototype; + +function NodeTest(type, value) { + if (arguments.length > 0) { + this.init(type, value); + } +} + +NodeTest.prototype.init = function(type, value) { + this.type = type; + this.value = value; +}; + +NodeTest.prototype.toString = function() { + return ""; +}; + +NodeTest.prototype.matches = function (n, xpc) { + console.warn('unknown node test type'); +}; + +NodeTest.NAMETESTANY = 0; +NodeTest.NAMETESTPREFIXANY = 1; +NodeTest.NAMETESTQNAME = 2; +NodeTest.COMMENT = 3; +NodeTest.TEXT = 4; +NodeTest.PI = 5; +NodeTest.NODE = 6; + +NodeTest.isNodeType = function (types){ + return compose(includes(types), prop('nodeType')); +}; + +NodeTest.makeNodeTestType = function (type, members, ctor) { + var newType = ctor || function () {}; + + newType.prototype = new NodeTest(members.type); + newType.prototype.constructor = type; + + for (var key in members) { + newType.prototype[key] = members[key]; + } + + return newType; +}; +// create invariant node test for certain node types +NodeTest.makeNodeTypeTest = function (type, nodeTypes, stringVal) { + return new (NodeTest.makeNodeTestType(type, { + matches: NodeTest.isNodeType(nodeTypes), + toString: always(stringVal) + }))(); +}; + +NodeTest.hasPrefix = function (node) { + return node.prefix || (node.nodeName || node.tagName).indexOf(':') !== -1; +}; + +NodeTest.isElementOrAttribute = NodeTest.isNodeType([1, 2]); +NodeTest.nameSpaceMatches = function (prefix, xpc, n) { + var nNamespace = (n.namespaceURI || ''); + + if (!prefix) { + return !nNamespace || (xpc.allowAnyNamespaceForNoPrefix && !NodeTest.hasPrefix(n)); + } + + var ns = xpc.namespaceResolver.getNamespace(prefix, xpc.expressionContextNode); + + if (ns == null) { + throw new Error("Cannot resolve QName " + prefix); + } + + return ns === nNamespace; +}; +NodeTest.localNameMatches = function (localName, xpc, n) { + var nLocalName = (n.localName || n.nodeName); + + return xpc.caseInsensitive + ? localName.toLowerCase() === nLocalName.toLowerCase() + : localName === nLocalName; +}; + +NodeTest.NameTestPrefixAny = NodeTest.makeNodeTestType(NodeTest.NAMETESTPREFIXANY, { + matches: function (n, xpc){ + return NodeTest.isElementOrAttribute(n) && + NodeTest.nameSpaceMatches(this.prefix, xpc, n); + }, + toString: function () { + return this.prefix + ":*"; + } +}, function (prefix) { this.prefix = prefix; }); + +NodeTest.NameTestQName = NodeTest.makeNodeTestType(NodeTest.NAMETESTQNAME, { + matches: function (n, xpc) { + return NodeTest.isNodeType([1, 2, XPathNamespace.XPATH_NAMESPACE_NODE])(n) && + NodeTest.nameSpaceMatches(this.prefix, xpc, n) && + NodeTest.localNameMatches(this.localName, xpc, n); + }, + toString: function () { + return this.name; + } +}, function (name) { + var nameParts = name.split(':'); + + this.name = name; + this.prefix = nameParts.length > 1 ? nameParts[0] : null; + this.localName = nameParts[nameParts.length > 1 ? 1 : 0]; +}); + +NodeTest.PITest = NodeTest.makeNodeTestType(NodeTest.PI, { + matches: function (n, xpc) { + return NodeTest.isNodeType([7])(n) && (n.target || n.nodeName) === this.name; + }, + toString: function () { + return wrap('processing-instruction("', '")', this.name); + } +}, function (name) { this.name = name; }) + +// singletons + +// elements, attributes, namespaces +NodeTest.nameTestAny = NodeTest.makeNodeTypeTest(NodeTest.NAMETESTANY, [1, 2, XPathNamespace.XPATH_NAMESPACE_NODE], '*'); +// text, cdata +NodeTest.textTest = NodeTest.makeNodeTypeTest(NodeTest.TEXT, [3, 4], 'text()'); +NodeTest.commentTest = NodeTest.makeNodeTypeTest(NodeTest.COMMENT, [8], 'comment()'); +// elements, attributes, text, cdata, PIs, comments, document nodes +NodeTest.nodeTest = NodeTest.makeNodeTypeTest(NodeTest.NODE, [1, 2, 3, 4, 7, 8, 9], 'node()'); +NodeTest.anyPiTest = NodeTest.makeNodeTypeTest(NodeTest.PI, [7], 'processing-instruction()'); + +// VariableReference ///////////////////////////////////////////////////////// + +VariableReference.prototype = new Expression(); +VariableReference.prototype.constructor = VariableReference; +VariableReference.superclass = Expression.prototype; + +function VariableReference(v) { + if (arguments.length > 0) { + this.init(v); + } +} + +VariableReference.prototype.init = function(v) { + this.variable = v; +}; + +VariableReference.prototype.toString = function() { + return "$" + this.variable; +}; + +VariableReference.prototype.evaluate = function(c) { + var parts = Utilities.resolveQName(this.variable, c.namespaceResolver, c.contextNode, false); + + if (parts[0] == null) { + throw new Error("Cannot resolve QName " + fn); + } + var result = c.variableResolver.getVariable(parts[1], parts[0]); + if (!result) { + throw XPathException.fromMessage("Undeclared variable: " + this.toString()); + } + return result; +}; + +// FunctionCall ////////////////////////////////////////////////////////////// + +FunctionCall.prototype = new Expression(); +FunctionCall.prototype.constructor = FunctionCall; +FunctionCall.superclass = Expression.prototype; + +function FunctionCall(fn, args) { + if (arguments.length > 0) { + this.init(fn, args); + } +} + +FunctionCall.prototype.init = function(fn, args) { + this.functionName = fn; + this.arguments = args; +}; + +FunctionCall.prototype.toString = function() { + var s = this.functionName + "("; + for (var i = 0; i < this.arguments.length; i++) { + if (i > 0) { + s += ", "; + } + s += this.arguments[i].toString(); + } + return s + ")"; +}; + +FunctionCall.prototype.evaluate = function(c) { + var f = FunctionResolver.getFunctionFromContext(this.functionName, c); + + if (!f) { + throw new Error("Unknown function " + this.functionName); + } + + var a = [c].concat(this.arguments); + return f.apply(c.functionResolver.thisArg, a); +}; + +// Operators ///////////////////////////////////////////////////////////////// + +var Operators = new Object(); + +Operators.equals = function(l, r) { + return l.equals(r); +}; + +Operators.notequal = function(l, r) { + return l.notequal(r); +}; + +Operators.lessthan = function(l, r) { + return l.lessthan(r); +}; + +Operators.greaterthan = function(l, r) { + return l.greaterthan(r); +}; + +Operators.lessthanorequal = function(l, r) { + return l.lessthanorequal(r); +}; + +Operators.greaterthanorequal = function(l, r) { + return l.greaterthanorequal(r); +}; + +// XString /////////////////////////////////////////////////////////////////// + +XString.prototype = new Expression(); +XString.prototype.constructor = XString; +XString.superclass = Expression.prototype; + +function XString(s) { + if (arguments.length > 0) { + this.init(s); + } +} + +XString.prototype.init = function(s) { + this.str = String(s); +}; + +XString.prototype.toString = function() { + return this.str; +}; + +XString.prototype.evaluate = function(c) { + return this; +}; + +XString.prototype.string = function() { + return this; +}; + +XString.prototype.number = function() { + return new XNumber(this.str); +}; + +XString.prototype.bool = function() { + return new XBoolean(this.str); +}; + +XString.prototype.nodeset = function() { + throw new Error("Cannot convert string to nodeset"); +}; + +XString.prototype.stringValue = function() { + return this.str; +}; + +XString.prototype.numberValue = function() { + return this.number().numberValue(); +}; + +XString.prototype.booleanValue = function() { + return this.bool().booleanValue(); +}; + +XString.prototype.equals = function(r) { + if (Utilities.instance_of(r, XBoolean)) { + return this.bool().equals(r); + } + if (Utilities.instance_of(r, XNumber)) { + return this.number().equals(r); + } + if (Utilities.instance_of(r, XNodeSet)) { + return r.compareWithString(this, Operators.equals); + } + return new XBoolean(this.str == r.str); +}; + +XString.prototype.notequal = function(r) { + if (Utilities.instance_of(r, XBoolean)) { + return this.bool().notequal(r); + } + if (Utilities.instance_of(r, XNumber)) { + return this.number().notequal(r); + } + if (Utilities.instance_of(r, XNodeSet)) { + return r.compareWithString(this, Operators.notequal); + } + return new XBoolean(this.str != r.str); +}; + +XString.prototype.lessthan = function(r) { + return this.number().lessthan(r); +}; + +XString.prototype.greaterthan = function(r) { + return this.number().greaterthan(r); +}; + +XString.prototype.lessthanorequal = function(r) { + return this.number().lessthanorequal(r); +}; + +XString.prototype.greaterthanorequal = function(r) { + return this.number().greaterthanorequal(r); +}; + +// XNumber /////////////////////////////////////////////////////////////////// + +XNumber.prototype = new Expression(); +XNumber.prototype.constructor = XNumber; +XNumber.superclass = Expression.prototype; + +function XNumber(n) { + if (arguments.length > 0) { + this.init(n); + } +} + +XNumber.prototype.init = function(n) { + this.num = typeof n === "string" ? this.parse(n) : Number(n); +}; + +XNumber.prototype.numberFormat = /^\s*-?[0-9]*\.?[0-9]+\s*$/; + +XNumber.prototype.parse = function(s) { + // XPath representation of numbers is more restrictive than what Number() or parseFloat() allow + return this.numberFormat.test(s) ? parseFloat(s) : Number.NaN; +}; + +function padSmallNumber(numberStr) { + var parts = numberStr.split('e-'); + var base = parts[0].replace('.', ''); + var exponent = Number(parts[1]); + + for (var i = 0; i < exponent - 1; i += 1) { + base = '0' + base; + } + + return '0.' + base; +} + +function padLargeNumber(numberStr) { + var parts = numberStr.split('e'); + var base = parts[0].replace('.', ''); + var exponent = Number(parts[1]); + var zerosToAppend = exponent + 1 - base.length; + + for (var i = 0; i < zerosToAppend; i += 1){ + base += '0'; + } + + return base; +} + +XNumber.prototype.toString = function() { + var strValue = this.num.toString(); + + if (strValue.indexOf('e-') !== -1) { + return padSmallNumber(strValue); + } + + if (strValue.indexOf('e') !== -1) { + return padLargeNumber(strValue); + } + + return strValue; +}; + +XNumber.prototype.evaluate = function(c) { + return this; +}; + +XNumber.prototype.string = function() { + + + return new XString(this.toString()); +}; + +XNumber.prototype.number = function() { + return this; +}; + +XNumber.prototype.bool = function() { + return new XBoolean(this.num); +}; + +XNumber.prototype.nodeset = function() { + throw new Error("Cannot convert number to nodeset"); +}; + +XNumber.prototype.stringValue = function() { + return this.string().stringValue(); +}; + +XNumber.prototype.numberValue = function() { + return this.num; +}; + +XNumber.prototype.booleanValue = function() { + return this.bool().booleanValue(); +}; + +XNumber.prototype.negate = function() { + return new XNumber(-this.num); +}; + +XNumber.prototype.equals = function(r) { + if (Utilities.instance_of(r, XBoolean)) { + return this.bool().equals(r); + } + if (Utilities.instance_of(r, XString)) { + return this.equals(r.number()); + } + if (Utilities.instance_of(r, XNodeSet)) { + return r.compareWithNumber(this, Operators.equals); + } + return new XBoolean(this.num == r.num); +}; + +XNumber.prototype.notequal = function(r) { + if (Utilities.instance_of(r, XBoolean)) { + return this.bool().notequal(r); + } + if (Utilities.instance_of(r, XString)) { + return this.notequal(r.number()); + } + if (Utilities.instance_of(r, XNodeSet)) { + return r.compareWithNumber(this, Operators.notequal); + } + return new XBoolean(this.num != r.num); +}; + +XNumber.prototype.lessthan = function(r) { + if (Utilities.instance_of(r, XNodeSet)) { + return r.compareWithNumber(this, Operators.greaterthan); + } + if (Utilities.instance_of(r, XBoolean) || Utilities.instance_of(r, XString)) { + return this.lessthan(r.number()); + } + return new XBoolean(this.num < r.num); +}; + +XNumber.prototype.greaterthan = function(r) { + if (Utilities.instance_of(r, XNodeSet)) { + return r.compareWithNumber(this, Operators.lessthan); + } + if (Utilities.instance_of(r, XBoolean) || Utilities.instance_of(r, XString)) { + return this.greaterthan(r.number()); + } + return new XBoolean(this.num > r.num); +}; + +XNumber.prototype.lessthanorequal = function(r) { + if (Utilities.instance_of(r, XNodeSet)) { + return r.compareWithNumber(this, Operators.greaterthanorequal); + } + if (Utilities.instance_of(r, XBoolean) || Utilities.instance_of(r, XString)) { + return this.lessthanorequal(r.number()); + } + return new XBoolean(this.num <= r.num); +}; + +XNumber.prototype.greaterthanorequal = function(r) { + if (Utilities.instance_of(r, XNodeSet)) { + return r.compareWithNumber(this, Operators.lessthanorequal); + } + if (Utilities.instance_of(r, XBoolean) || Utilities.instance_of(r, XString)) { + return this.greaterthanorequal(r.number()); + } + return new XBoolean(this.num >= r.num); +}; + +XNumber.prototype.plus = function(r) { + return new XNumber(this.num + r.num); +}; + +XNumber.prototype.minus = function(r) { + return new XNumber(this.num - r.num); +}; + +XNumber.prototype.multiply = function(r) { + return new XNumber(this.num * r.num); +}; + +XNumber.prototype.div = function(r) { + return new XNumber(this.num / r.num); +}; + +XNumber.prototype.mod = function(r) { + return new XNumber(this.num % r.num); +}; + +// XBoolean ////////////////////////////////////////////////////////////////// + +XBoolean.prototype = new Expression(); +XBoolean.prototype.constructor = XBoolean; +XBoolean.superclass = Expression.prototype; + +function XBoolean(b) { + if (arguments.length > 0) { + this.init(b); + } +} + +XBoolean.prototype.init = function(b) { + this.b = Boolean(b); +}; + +XBoolean.prototype.toString = function() { + return this.b.toString(); +}; + +XBoolean.prototype.evaluate = function(c) { + return this; +}; + +XBoolean.prototype.string = function() { + return new XString(this.b); +}; + +XBoolean.prototype.number = function() { + return new XNumber(this.b); +}; + +XBoolean.prototype.bool = function() { + return this; +}; + +XBoolean.prototype.nodeset = function() { + throw new Error("Cannot convert boolean to nodeset"); +}; + +XBoolean.prototype.stringValue = function() { + return this.string().stringValue(); +}; + +XBoolean.prototype.numberValue = function() { + return this.number().numberValue(); +}; + +XBoolean.prototype.booleanValue = function() { + return this.b; +}; + +XBoolean.prototype.not = function() { + return new XBoolean(!this.b); +}; + +XBoolean.prototype.equals = function(r) { + if (Utilities.instance_of(r, XString) || Utilities.instance_of(r, XNumber)) { + return this.equals(r.bool()); + } + if (Utilities.instance_of(r, XNodeSet)) { + return r.compareWithBoolean(this, Operators.equals); + } + return new XBoolean(this.b == r.b); +}; + +XBoolean.prototype.notequal = function(r) { + if (Utilities.instance_of(r, XString) || Utilities.instance_of(r, XNumber)) { + return this.notequal(r.bool()); + } + if (Utilities.instance_of(r, XNodeSet)) { + return r.compareWithBoolean(this, Operators.notequal); + } + return new XBoolean(this.b != r.b); +}; + +XBoolean.prototype.lessthan = function(r) { + return this.number().lessthan(r); +}; + +XBoolean.prototype.greaterthan = function(r) { + return this.number().greaterthan(r); +}; + +XBoolean.prototype.lessthanorequal = function(r) { + return this.number().lessthanorequal(r); +}; + +XBoolean.prototype.greaterthanorequal = function(r) { + return this.number().greaterthanorequal(r); +}; + +XBoolean.true_ = new XBoolean(true); +XBoolean.false_ = new XBoolean(false); + +// AVLTree /////////////////////////////////////////////////////////////////// + +AVLTree.prototype = new Object(); +AVLTree.prototype.constructor = AVLTree; +AVLTree.superclass = Object.prototype; + +function AVLTree(n) { + this.init(n); +} + +AVLTree.prototype.init = function(n) { + this.left = null; + this.right = null; + this.node = n; + this.depth = 1; +}; + +AVLTree.prototype.balance = function() { + var ldepth = this.left == null ? 0 : this.left.depth; + var rdepth = this.right == null ? 0 : this.right.depth; + + if (ldepth > rdepth + 1) { + // LR or LL rotation + var lldepth = this.left.left == null ? 0 : this.left.left.depth; + var lrdepth = this.left.right == null ? 0 : this.left.right.depth; + + if (lldepth < lrdepth) { + // LR rotation consists of a RR rotation of the left child + this.left.rotateRR(); + // plus a LL rotation of this node, which happens anyway + } + this.rotateLL(); + } else if (ldepth + 1 < rdepth) { + // RR or RL rorarion + var rrdepth = this.right.right == null ? 0 : this.right.right.depth; + var rldepth = this.right.left == null ? 0 : this.right.left.depth; + + if (rldepth > rrdepth) { + // RR rotation consists of a LL rotation of the right child + this.right.rotateLL(); + // plus a RR rotation of this node, which happens anyway + } + this.rotateRR(); + } +}; + +AVLTree.prototype.rotateLL = function() { + // the left side is too long => rotate from the left (_not_ leftwards) + var nodeBefore = this.node; + var rightBefore = this.right; + this.node = this.left.node; + this.right = this.left; + this.left = this.left.left; + this.right.left = this.right.right; + this.right.right = rightBefore; + this.right.node = nodeBefore; + this.right.updateInNewLocation(); + this.updateInNewLocation(); +}; + +AVLTree.prototype.rotateRR = function() { + // the right side is too long => rotate from the right (_not_ rightwards) + var nodeBefore = this.node; + var leftBefore = this.left; + this.node = this.right.node; + this.left = this.right; + this.right = this.right.right; + this.left.right = this.left.left; + this.left.left = leftBefore; + this.left.node = nodeBefore; + this.left.updateInNewLocation(); + this.updateInNewLocation(); +}; + +AVLTree.prototype.updateInNewLocation = function() { + this.getDepthFromChildren(); +}; + +AVLTree.prototype.getDepthFromChildren = function() { + this.depth = this.node == null ? 0 : 1; + if (this.left != null) { + this.depth = this.left.depth + 1; + } + if (this.right != null && this.depth <= this.right.depth) { + this.depth = this.right.depth + 1; + } +}; + +function nodeOrder(n1, n2) { + if (n1 === n2) { + return 0; + } + + if (n1.compareDocumentPosition) { + var cpos = n1.compareDocumentPosition(n2); + + if (cpos & 0x01) { + // not in the same document; return an arbitrary result (is there a better way to do this) + return 1; + } + if (cpos & 0x0A) { + // n2 precedes or contains n1 + return 1; + } + if (cpos & 0x14) { + // n2 follows or is contained by n1 + return -1; + } + + return 0; + } + + var d1 = 0, + d2 = 0; + for (var m1 = n1; m1 != null; m1 = m1.parentNode || m1.ownerElement) { + d1++; + } + for (var m2 = n2; m2 != null; m2 = m2.parentNode || m2.ownerElement) { + d2++; + } + + // step up to same depth + if (d1 > d2) { + while (d1 > d2) { + n1 = n1.parentNode || n1.ownerElement; + d1--; + } + if (n1 === n2) { + return 1; + } + } else if (d2 > d1) { + while (d2 > d1) { + n2 = n2.parentNode || n2.ownerElement; + d2--; + } + if (n1 === n2) { + return -1; + } + } + + var n1Par = n1.parentNode || n1.ownerElement, + n2Par = n2.parentNode || n2.ownerElement; + + // find common parent + while (n1Par !== n2Par) { + n1 = n1Par; + n2 = n2Par; + n1Par = n1.parentNode || n1.ownerElement; + n2Par = n2.parentNode || n2.ownerElement; + } + + var n1isAttr = Utilities.isAttribute(n1); + var n2isAttr = Utilities.isAttribute(n2); + + if (n1isAttr && !n2isAttr) { + return -1; + } + if (!n1isAttr && n2isAttr) { + return 1; + } + + if(n1Par) { + var cn = n1isAttr ? n1Par.attributes : n1Par.childNodes, + len = cn.length; + for (var i = 0; i < len; i += 1) { + var n = cn[i]; + if (n === n1) { + return -1; + } + if (n === n2) { + return 1; + } + } + } + + throw new Error('Unexpected: could not determine node order'); +} + +AVLTree.prototype.add = function(n) { + if (n === this.node) { + return false; + } + + var o = nodeOrder(n, this.node); + + var ret = false; + if (o == -1) { + if (this.left == null) { + this.left = new AVLTree(n); + ret = true; + } else { + ret = this.left.add(n); + if (ret) { + this.balance(); + } + } + } else if (o == 1) { + if (this.right == null) { + this.right = new AVLTree(n); + ret = true; + } else { + ret = this.right.add(n); + if (ret) { + this.balance(); + } + } + } + + if (ret) { + this.getDepthFromChildren(); + } + return ret; +}; + +// XNodeSet ////////////////////////////////////////////////////////////////// + +XNodeSet.prototype = new Expression(); +XNodeSet.prototype.constructor = XNodeSet; +XNodeSet.superclass = Expression.prototype; + +function XNodeSet() { + this.init(); +} + +XNodeSet.prototype.init = function() { + this.tree = null; + this.nodes = []; + this.size = 0; +}; + +XNodeSet.prototype.toString = function() { + var p = this.first(); + if (p == null) { + return ""; + } + return this.stringForNode(p); +}; + +XNodeSet.prototype.evaluate = function(c) { + return this; +}; + +XNodeSet.prototype.string = function() { + return new XString(this.toString()); +}; + +XNodeSet.prototype.stringValue = function() { + return this.toString(); +}; + +XNodeSet.prototype.number = function() { + return new XNumber(this.string()); +}; + +XNodeSet.prototype.numberValue = function() { + return Number(this.string()); +}; + +XNodeSet.prototype.bool = function() { + return new XBoolean(this.booleanValue()); +}; + +XNodeSet.prototype.booleanValue = function() { + return !!this.size; +}; + +XNodeSet.prototype.nodeset = function() { + return this; +}; + +XNodeSet.prototype.stringForNode = function(n) { + if (n.nodeType == 9 /*Node.DOCUMENT_NODE*/ || + n.nodeType == 1 /*Node.ELEMENT_NODE */ || + n.nodeType === 11 /*Node.DOCUMENT_FRAGMENT*/) { + return this.stringForContainerNode(n); + } + if (n.nodeType === 2 /* Node.ATTRIBUTE_NODE */) { + return n.value || n.nodeValue; + } + if (n.isNamespaceNode) { + return n.namespace; + } + return n.nodeValue; +}; + +XNodeSet.prototype.stringForContainerNode = function(n) { + var s = ""; + for (var n2 = n.firstChild; n2 != null; n2 = n2.nextSibling) { + var nt = n2.nodeType; + // Element, Text, CDATA, Document, Document Fragment + if (nt === 1 || nt === 3 || nt === 4 || nt === 9 || nt === 11) { + s += this.stringForNode(n2); + } + } + return s; +}; + +XNodeSet.prototype.buildTree = function () { + if (!this.tree && this.nodes.length) { + this.tree = new AVLTree(this.nodes[0]); + for (var i = 1; i < this.nodes.length; i += 1) { + this.tree.add(this.nodes[i]); + } + } + + return this.tree; +}; + +XNodeSet.prototype.first = function() { + var p = this.buildTree(); + if (p == null) { + return null; + } + while (p.left != null) { + p = p.left; + } + return p.node; +}; + +XNodeSet.prototype.add = function(n) { + for (var i = 0; i < this.nodes.length; i += 1) { + if (n === this.nodes[i]) { + return; + } + } + + this.tree = null; + this.nodes.push(n); + this.size += 1; +}; + +XNodeSet.prototype.addArray = function(ns) { + var self = this; + + forEach(function (x) { self.add(x); }, ns); +}; + +/** + * Returns an array of the node set's contents in document order + */ +XNodeSet.prototype.toArray = function() { + var a = []; + this.toArrayRec(this.buildTree(), a); + return a; +}; + +XNodeSet.prototype.toArrayRec = function(t, a) { + if (t != null) { + this.toArrayRec(t.left, a); + a.push(t.node); + this.toArrayRec(t.right, a); + } +}; + +/** + * Returns an array of the node set's contents in arbitrary order + */ +XNodeSet.prototype.toUnsortedArray = function () { + return this.nodes.slice(); +}; + +XNodeSet.prototype.compareWithString = function(r, o) { + var a = this.toUnsortedArray(); + for (var i = 0; i < a.length; i++) { + var n = a[i]; + var l = new XString(this.stringForNode(n)); + var res = o(l, r); + if (res.booleanValue()) { + return res; + } + } + return new XBoolean(false); +}; + +XNodeSet.prototype.compareWithNumber = function(r, o) { + var a = this.toUnsortedArray(); + for (var i = 0; i < a.length; i++) { + var n = a[i]; + var l = new XNumber(this.stringForNode(n)); + var res = o(l, r); + if (res.booleanValue()) { + return res; + } + } + return new XBoolean(false); +}; + +XNodeSet.prototype.compareWithBoolean = function(r, o) { + return o(this.bool(), r); +}; + +XNodeSet.prototype.compareWithNodeSet = function(r, o) { + var arr = this.toUnsortedArray(); + var oInvert = function (lop, rop) { return o(rop, lop); }; + + for (var i = 0; i < arr.length; i++) { + var l = new XString(this.stringForNode(arr[i])); + + var res = r.compareWithString(l, oInvert); + if (res.booleanValue()) { + return res; + } + } + + return new XBoolean(false); +}; + +XNodeSet.compareWith = curry(function (o, r) { + if (Utilities.instance_of(r, XString)) { + return this.compareWithString(r, o); + } + if (Utilities.instance_of(r, XNumber)) { + return this.compareWithNumber(r, o); + } + if (Utilities.instance_of(r, XBoolean)) { + return this.compareWithBoolean(r, o); + } + return this.compareWithNodeSet(r, o); +}); + +XNodeSet.prototype.equals = XNodeSet.compareWith(Operators.equals); +XNodeSet.prototype.notequal = XNodeSet.compareWith(Operators.notequal); +XNodeSet.prototype.lessthan = XNodeSet.compareWith(Operators.lessthan); +XNodeSet.prototype.greaterthan = XNodeSet.compareWith(Operators.greaterthan); +XNodeSet.prototype.lessthanorequal = XNodeSet.compareWith(Operators.lessthanorequal); +XNodeSet.prototype.greaterthanorequal = XNodeSet.compareWith(Operators.greaterthanorequal); + +XNodeSet.prototype.union = function(r) { + var ns = new XNodeSet(); + ns.addArray(this.toUnsortedArray()); + ns.addArray(r.toUnsortedArray()); + return ns; +}; + +// XPathNamespace //////////////////////////////////////////////////////////// + +XPathNamespace.prototype = new Object(); +XPathNamespace.prototype.constructor = XPathNamespace; +XPathNamespace.superclass = Object.prototype; + +function XPathNamespace(pre, ns, p) { + this.isXPathNamespace = true; + this.ownerDocument = p.ownerDocument; + this.nodeName = "#namespace"; + this.prefix = pre; + this.localName = pre; + this.namespaceURI = ns; + this.nodeValue = ns; + this.ownerElement = p; + this.nodeType = XPathNamespace.XPATH_NAMESPACE_NODE; +} + +XPathNamespace.prototype.toString = function() { + return "{ \"" + this.prefix + "\", \"" + this.namespaceURI + "\" }"; +}; + +// XPathContext ////////////////////////////////////////////////////////////// + +XPathContext.prototype = new Object(); +XPathContext.prototype.constructor = XPathContext; +XPathContext.superclass = Object.prototype; + +function XPathContext(vr, nr, fr) { + this.variableResolver = vr != null ? vr : new VariableResolver(); + this.namespaceResolver = nr != null ? nr : new NamespaceResolver(); + this.functionResolver = fr != null ? fr : new FunctionResolver(); +} + +XPathContext.prototype.extend = function (newProps) { + return assign(new XPathContext(), this, newProps); +}; + +// VariableResolver ////////////////////////////////////////////////////////// + +VariableResolver.prototype = new Object(); +VariableResolver.prototype.constructor = VariableResolver; +VariableResolver.superclass = Object.prototype; + +function VariableResolver() { +} + +VariableResolver.prototype.getVariable = function(ln, ns) { + return null; +}; + +// FunctionResolver ////////////////////////////////////////////////////////// + +FunctionResolver.prototype = new Object(); +FunctionResolver.prototype.constructor = FunctionResolver; +FunctionResolver.superclass = Object.prototype; + +function FunctionResolver(thisArg) { + this.thisArg = thisArg != null ? thisArg : Functions; + this.functions = new Object(); + this.addStandardFunctions(); +} + +FunctionResolver.prototype.addStandardFunctions = function() { + this.functions["{}last"] = Functions.last; + this.functions["{}position"] = Functions.position; + this.functions["{}count"] = Functions.count; + this.functions["{}id"] = Functions.id; + this.functions["{}local-name"] = Functions.localName; + this.functions["{}namespace-uri"] = Functions.namespaceURI; + this.functions["{}name"] = Functions.name; + this.functions["{}string"] = Functions.string; + this.functions["{}concat"] = Functions.concat; + this.functions["{}starts-with"] = Functions.startsWith; + this.functions["{}contains"] = Functions.contains; + this.functions["{}substring-before"] = Functions.substringBefore; + this.functions["{}substring-after"] = Functions.substringAfter; + this.functions["{}substring"] = Functions.substring; + this.functions["{}string-length"] = Functions.stringLength; + this.functions["{}normalize-space"] = Functions.normalizeSpace; + this.functions["{}translate"] = Functions.translate; + this.functions["{}boolean"] = Functions.boolean_; + this.functions["{}not"] = Functions.not; + this.functions["{}true"] = Functions.true_; + this.functions["{}false"] = Functions.false_; + this.functions["{}lang"] = Functions.lang; + this.functions["{}number"] = Functions.number; + this.functions["{}sum"] = Functions.sum; + this.functions["{}floor"] = Functions.floor; + this.functions["{}ceiling"] = Functions.ceiling; + this.functions["{}round"] = Functions.round; +}; + +FunctionResolver.prototype.addFunction = function(ns, ln, f) { + this.functions["{" + ns + "}" + ln] = f; +}; + +FunctionResolver.getFunctionFromContext = function(qName, context) { + var parts = Utilities.resolveQName(qName, context.namespaceResolver, context.contextNode, false); + + if (parts[0] === null) { + throw new Error("Cannot resolve QName " + name); + } + + return context.functionResolver.getFunction(parts[1], parts[0]); +}; + +FunctionResolver.prototype.getFunction = function(localName, namespace) { + return this.functions["{" + namespace + "}" + localName]; +}; + +// NamespaceResolver ///////////////////////////////////////////////////////// + +NamespaceResolver.prototype = new Object(); +NamespaceResolver.prototype.constructor = NamespaceResolver; +NamespaceResolver.superclass = Object.prototype; + +function NamespaceResolver() { +} + +NamespaceResolver.prototype.getNamespace = function(prefix, n) { + if (prefix == "xml") { + return XPath.XML_NAMESPACE_URI; + } else if (prefix == "xmlns") { + return XPath.XMLNS_NAMESPACE_URI; + } + if (n.nodeType == 9 /*Node.DOCUMENT_NODE*/) { + n = n.documentElement; + } else if (n.nodeType == 2 /*Node.ATTRIBUTE_NODE*/) { + n = PathExpr.getOwnerElement(n); + } else if (n.nodeType != 1 /*Node.ELEMENT_NODE*/) { + n = n.parentNode; + } + while (n != null && n.nodeType == 1 /*Node.ELEMENT_NODE*/) { + var nnm = n.attributes; + for (var i = 0; i < nnm.length; i++) { + var a = nnm.item(i); + var aname = a.name || a.nodeName; + if ((aname === "xmlns" && prefix === "") + || aname === "xmlns:" + prefix) { + return String(a.value || a.nodeValue); + } + } + n = n.parentNode; + } + return null; +}; + +// Functions ///////////////////////////////////////////////////////////////// + +var Functions = new Object(); + +Functions.last = function(c) { + if (arguments.length != 1) { + throw new Error("Function last expects ()"); + } + + return new XNumber(c.contextSize); +}; + +Functions.position = function(c) { + if (arguments.length != 1) { + throw new Error("Function position expects ()"); + } + + return new XNumber(c.contextPosition); +}; + +Functions.count = function() { + var c = arguments[0]; + var ns; + if (arguments.length != 2 || !Utilities.instance_of(ns = arguments[1].evaluate(c), XNodeSet)) { + throw new Error("Function count expects (node-set)"); + } + return new XNumber(ns.size); +}; + +Functions.id = function() { + var c = arguments[0]; + var id; + if (arguments.length != 2) { + throw new Error("Function id expects (object)"); + } + id = arguments[1].evaluate(c); + if (Utilities.instance_of(id, XNodeSet)) { + id = id.toArray().join(" "); + } else { + id = id.stringValue(); + } + var ids = id.split(/[\x0d\x0a\x09\x20]+/); + var count = 0; + var ns = new XNodeSet(); + var doc = c.contextNode.nodeType == 9 /*Node.DOCUMENT_NODE*/ + ? c.contextNode + : c.contextNode.ownerDocument; + for (var i = 0; i < ids.length; i++) { + var n; + if (doc.getElementById) { + n = doc.getElementById(ids[i]); + } else { + n = Utilities.getElementById(doc, ids[i]); + } + if (n != null) { + ns.add(n); + count++; + } + } + return ns; +}; + +Functions.localName = function(c, eNode) { + var n; + + if (arguments.length == 1) { + n = c.contextNode; + } else if (arguments.length == 2) { + n = eNode.evaluate(c).first(); + } else { + throw new Error("Function local-name expects (node-set?)"); + } + + if (n == null) { + return new XString(""); + } + + return new XString(n.localName || // standard elements and attributes + n.baseName || // IE + n.target || // processing instructions + n.nodeName || // DOM1 elements + ""); // fallback +}; + +Functions.namespaceURI = function() { + var c = arguments[0]; + var n; + if (arguments.length == 1) { + n = c.contextNode; + } else if (arguments.length == 2) { + n = arguments[1].evaluate(c).first(); + } else { + throw new Error("Function namespace-uri expects (node-set?)"); + } + if (n == null) { + return new XString(""); + } + return new XString(n.namespaceURI); +}; + +Functions.name = function() { + var c = arguments[0]; + var n; + if (arguments.length == 1) { + n = c.contextNode; + } else if (arguments.length == 2) { + n = arguments[1].evaluate(c).first(); + } else { + throw new Error("Function name expects (node-set?)"); + } + if (n == null) { + return new XString(""); + } + if (n.nodeType == 1 /*Node.ELEMENT_NODE*/) { + return new XString(n.nodeName); + } else if (n.nodeType == 2 /*Node.ATTRIBUTE_NODE*/) { + return new XString(n.name || n.nodeName); + } else if (n.nodeType === 7 /*Node.PROCESSING_INSTRUCTION_NODE*/) { + return new XString(n.target || n.nodeName); + } else if (n.localName == null) { + return new XString(""); + } else { + return new XString(n.localName); + } +}; + +Functions.string = function() { + var c = arguments[0]; + if (arguments.length == 1) { + return new XString(XNodeSet.prototype.stringForNode(c.contextNode)); + } else if (arguments.length == 2) { + return arguments[1].evaluate(c).string(); + } + throw new Error("Function string expects (object?)"); +}; + +Functions.concat = function(c) { + if (arguments.length < 3) { + throw new Error("Function concat expects (string, string[, string]*)"); + } + var s = ""; + for (var i = 1; i < arguments.length; i++) { + s += arguments[i].evaluate(c).stringValue(); + } + return new XString(s); +}; + +Functions.startsWith = function() { + var c = arguments[0]; + if (arguments.length != 3) { + throw new Error("Function startsWith expects (string, string)"); + } + var s1 = arguments[1].evaluate(c).stringValue(); + var s2 = arguments[2].evaluate(c).stringValue(); + return new XBoolean(s1.substring(0, s2.length) == s2); +}; + +Functions.contains = function() { + var c = arguments[0]; + if (arguments.length != 3) { + throw new Error("Function contains expects (string, string)"); + } + var s1 = arguments[1].evaluate(c).stringValue(); + var s2 = arguments[2].evaluate(c).stringValue(); + return new XBoolean(s1.indexOf(s2) !== -1); +}; + +Functions.substringBefore = function() { + var c = arguments[0]; + if (arguments.length != 3) { + throw new Error("Function substring-before expects (string, string)"); + } + var s1 = arguments[1].evaluate(c).stringValue(); + var s2 = arguments[2].evaluate(c).stringValue(); + return new XString(s1.substring(0, s1.indexOf(s2))); +}; + +Functions.substringAfter = function() { + var c = arguments[0]; + if (arguments.length != 3) { + throw new Error("Function substring-after expects (string, string)"); + } + var s1 = arguments[1].evaluate(c).stringValue(); + var s2 = arguments[2].evaluate(c).stringValue(); + if (s2.length == 0) { + return new XString(s1); + } + var i = s1.indexOf(s2); + if (i == -1) { + return new XString(""); + } + return new XString(s1.substring(i + s2.length)); +}; + +Functions.substring = function() { + var c = arguments[0]; + if (!(arguments.length == 3 || arguments.length == 4)) { + throw new Error("Function substring expects (string, number, number?)"); + } + var s = arguments[1].evaluate(c).stringValue(); + var n1 = Math.round(arguments[2].evaluate(c).numberValue()) - 1; + var n2 = arguments.length == 4 ? n1 + Math.round(arguments[3].evaluate(c).numberValue()) : undefined; + return new XString(s.substring(n1, n2)); +}; + +Functions.stringLength = function() { + var c = arguments[0]; + var s; + if (arguments.length == 1) { + s = XNodeSet.prototype.stringForNode(c.contextNode); + } else if (arguments.length == 2) { + s = arguments[1].evaluate(c).stringValue(); + } else { + throw new Error("Function string-length expects (string?)"); + } + return new XNumber(s.length); +}; + +Functions.normalizeSpace = function() { + var c = arguments[0]; + var s; + if (arguments.length == 1) { + s = XNodeSet.prototype.stringForNode(c.contextNode); + } else if (arguments.length == 2) { + s = arguments[1].evaluate(c).stringValue(); + } else { + throw new Error("Function normalize-space expects (string?)"); + } + var i = 0; + var j = s.length - 1; + while (Utilities.isSpace(s.charCodeAt(j))) { + j--; + } + var t = ""; + while (i <= j && Utilities.isSpace(s.charCodeAt(i))) { + i++; + } + while (i <= j) { + if (Utilities.isSpace(s.charCodeAt(i))) { + t += " "; + while (i <= j && Utilities.isSpace(s.charCodeAt(i))) { + i++; + } + } else { + t += s.charAt(i); + i++; + } + } + return new XString(t); +}; + +Functions.translate = function(c, eValue, eFrom, eTo) { + if (arguments.length != 4) { + throw new Error("Function translate expects (string, string, string)"); + } + + var value = eValue.evaluate(c).stringValue(); + var from = eFrom.evaluate(c).stringValue(); + var to = eTo.evaluate(c).stringValue(); + + var cMap = reduce(function (acc, ch, i) { + if (!(ch in acc)) { + acc[ch] = i > to.length ? '' : to[i]; + } + return acc; + }, {}, from); + + var t = join('', map(function (ch) { + return ch in cMap ? cMap[ch] : ch; + }, value)); + + return new XString(t); +}; + +Functions.boolean_ = function() { + var c = arguments[0]; + if (arguments.length != 2) { + throw new Error("Function boolean expects (object)"); + } + return arguments[1].evaluate(c).bool(); +}; + +Functions.not = function(c, eValue) { + if (arguments.length != 2) { + throw new Error("Function not expects (object)"); + } + return eValue.evaluate(c).bool().not(); +}; + +Functions.true_ = function() { + if (arguments.length != 1) { + throw new Error("Function true expects ()"); + } + return XBoolean.true_; +}; + +Functions.false_ = function() { + if (arguments.length != 1) { + throw new Error("Function false expects ()"); + } + return XBoolean.false_; +}; + +Functions.lang = function() { + var c = arguments[0]; + if (arguments.length != 2) { + throw new Error("Function lang expects (string)"); + } + var lang; + for (var n = c.contextNode; n != null && n.nodeType != 9 /*Node.DOCUMENT_NODE*/; n = n.parentNode) { + var a = n.getAttributeNS(XPath.XML_NAMESPACE_URI, "lang"); + if (a != null) { + lang = String(a); + break; + } + } + if (lang == null) { + return XBoolean.false_; + } + var s = arguments[1].evaluate(c).stringValue(); + return new XBoolean(lang.substring(0, s.length) == s + && (lang.length == s.length || lang.charAt(s.length) == '-')); +}; + +Functions.number = function() { + var c = arguments[0]; + if (!(arguments.length == 1 || arguments.length == 2)) { + throw new Error("Function number expects (object?)"); + } + if (arguments.length == 1) { + return new XNumber(XNodeSet.prototype.stringForNode(c.contextNode)); + } + return arguments[1].evaluate(c).number(); +}; + +Functions.sum = function() { + var c = arguments[0]; + var ns; + if (arguments.length != 2 || !Utilities.instance_of((ns = arguments[1].evaluate(c)), XNodeSet)) { + throw new Error("Function sum expects (node-set)"); + } + ns = ns.toUnsortedArray(); + var n = 0; + for (var i = 0; i < ns.length; i++) { + n += new XNumber(XNodeSet.prototype.stringForNode(ns[i])).numberValue(); + } + return new XNumber(n); +}; + +Functions.floor = function() { + var c = arguments[0]; + if (arguments.length != 2) { + throw new Error("Function floor expects (number)"); + } + return new XNumber(Math.floor(arguments[1].evaluate(c).numberValue())); +}; + +Functions.ceiling = function() { + var c = arguments[0]; + if (arguments.length != 2) { + throw new Error("Function ceiling expects (number)"); + } + return new XNumber(Math.ceil(arguments[1].evaluate(c).numberValue())); +}; + +Functions.round = function() { + var c = arguments[0]; + if (arguments.length != 2) { + throw new Error("Function round expects (number)"); + } + return new XNumber(Math.round(arguments[1].evaluate(c).numberValue())); +}; + +// Utilities ///////////////////////////////////////////////////////////////// + +var Utilities = new Object(); + +Utilities.isAttribute = function (val) { + return val && (val.nodeType === 2 || val.ownerElement); +} + +Utilities.splitQName = function(qn) { + var i = qn.indexOf(":"); + if (i == -1) { + return [ null, qn ]; + } + return [ qn.substring(0, i), qn.substring(i + 1) ]; +}; + +Utilities.resolveQName = function(qn, nr, n, useDefault) { + var parts = Utilities.splitQName(qn); + if (parts[0] != null) { + parts[0] = nr.getNamespace(parts[0], n); + } else { + if (useDefault) { + parts[0] = nr.getNamespace("", n); + if (parts[0] == null) { + parts[0] = ""; + } + } else { + parts[0] = ""; + } + } + return parts; +}; + +Utilities.isSpace = function(c) { + return c == 0x9 || c == 0xd || c == 0xa || c == 0x20; +}; + +Utilities.isLetter = function(c) { + return c >= 0x0041 && c <= 0x005A || + c >= 0x0061 && c <= 0x007A || + c >= 0x00C0 && c <= 0x00D6 || + c >= 0x00D8 && c <= 0x00F6 || + c >= 0x00F8 && c <= 0x00FF || + c >= 0x0100 && c <= 0x0131 || + c >= 0x0134 && c <= 0x013E || + c >= 0x0141 && c <= 0x0148 || + c >= 0x014A && c <= 0x017E || + c >= 0x0180 && c <= 0x01C3 || + c >= 0x01CD && c <= 0x01F0 || + c >= 0x01F4 && c <= 0x01F5 || + c >= 0x01FA && c <= 0x0217 || + c >= 0x0250 && c <= 0x02A8 || + c >= 0x02BB && c <= 0x02C1 || + c == 0x0386 || + c >= 0x0388 && c <= 0x038A || + c == 0x038C || + c >= 0x038E && c <= 0x03A1 || + c >= 0x03A3 && c <= 0x03CE || + c >= 0x03D0 && c <= 0x03D6 || + c == 0x03DA || + c == 0x03DC || + c == 0x03DE || + c == 0x03E0 || + c >= 0x03E2 && c <= 0x03F3 || + c >= 0x0401 && c <= 0x040C || + c >= 0x040E && c <= 0x044F || + c >= 0x0451 && c <= 0x045C || + c >= 0x045E && c <= 0x0481 || + c >= 0x0490 && c <= 0x04C4 || + c >= 0x04C7 && c <= 0x04C8 || + c >= 0x04CB && c <= 0x04CC || + c >= 0x04D0 && c <= 0x04EB || + c >= 0x04EE && c <= 0x04F5 || + c >= 0x04F8 && c <= 0x04F9 || + c >= 0x0531 && c <= 0x0556 || + c == 0x0559 || + c >= 0x0561 && c <= 0x0586 || + c >= 0x05D0 && c <= 0x05EA || + c >= 0x05F0 && c <= 0x05F2 || + c >= 0x0621 && c <= 0x063A || + c >= 0x0641 && c <= 0x064A || + c >= 0x0671 && c <= 0x06B7 || + c >= 0x06BA && c <= 0x06BE || + c >= 0x06C0 && c <= 0x06CE || + c >= 0x06D0 && c <= 0x06D3 || + c == 0x06D5 || + c >= 0x06E5 && c <= 0x06E6 || + c >= 0x0905 && c <= 0x0939 || + c == 0x093D || + c >= 0x0958 && c <= 0x0961 || + c >= 0x0985 && c <= 0x098C || + c >= 0x098F && c <= 0x0990 || + c >= 0x0993 && c <= 0x09A8 || + c >= 0x09AA && c <= 0x09B0 || + c == 0x09B2 || + c >= 0x09B6 && c <= 0x09B9 || + c >= 0x09DC && c <= 0x09DD || + c >= 0x09DF && c <= 0x09E1 || + c >= 0x09F0 && c <= 0x09F1 || + c >= 0x0A05 && c <= 0x0A0A || + c >= 0x0A0F && c <= 0x0A10 || + c >= 0x0A13 && c <= 0x0A28 || + c >= 0x0A2A && c <= 0x0A30 || + c >= 0x0A32 && c <= 0x0A33 || + c >= 0x0A35 && c <= 0x0A36 || + c >= 0x0A38 && c <= 0x0A39 || + c >= 0x0A59 && c <= 0x0A5C || + c == 0x0A5E || + c >= 0x0A72 && c <= 0x0A74 || + c >= 0x0A85 && c <= 0x0A8B || + c == 0x0A8D || + c >= 0x0A8F && c <= 0x0A91 || + c >= 0x0A93 && c <= 0x0AA8 || + c >= 0x0AAA && c <= 0x0AB0 || + c >= 0x0AB2 && c <= 0x0AB3 || + c >= 0x0AB5 && c <= 0x0AB9 || + c == 0x0ABD || + c == 0x0AE0 || + c >= 0x0B05 && c <= 0x0B0C || + c >= 0x0B0F && c <= 0x0B10 || + c >= 0x0B13 && c <= 0x0B28 || + c >= 0x0B2A && c <= 0x0B30 || + c >= 0x0B32 && c <= 0x0B33 || + c >= 0x0B36 && c <= 0x0B39 || + c == 0x0B3D || + c >= 0x0B5C && c <= 0x0B5D || + c >= 0x0B5F && c <= 0x0B61 || + c >= 0x0B85 && c <= 0x0B8A || + c >= 0x0B8E && c <= 0x0B90 || + c >= 0x0B92 && c <= 0x0B95 || + c >= 0x0B99 && c <= 0x0B9A || + c == 0x0B9C || + c >= 0x0B9E && c <= 0x0B9F || + c >= 0x0BA3 && c <= 0x0BA4 || + c >= 0x0BA8 && c <= 0x0BAA || + c >= 0x0BAE && c <= 0x0BB5 || + c >= 0x0BB7 && c <= 0x0BB9 || + c >= 0x0C05 && c <= 0x0C0C || + c >= 0x0C0E && c <= 0x0C10 || + c >= 0x0C12 && c <= 0x0C28 || + c >= 0x0C2A && c <= 0x0C33 || + c >= 0x0C35 && c <= 0x0C39 || + c >= 0x0C60 && c <= 0x0C61 || + c >= 0x0C85 && c <= 0x0C8C || + c >= 0x0C8E && c <= 0x0C90 || + c >= 0x0C92 && c <= 0x0CA8 || + c >= 0x0CAA && c <= 0x0CB3 || + c >= 0x0CB5 && c <= 0x0CB9 || + c == 0x0CDE || + c >= 0x0CE0 && c <= 0x0CE1 || + c >= 0x0D05 && c <= 0x0D0C || + c >= 0x0D0E && c <= 0x0D10 || + c >= 0x0D12 && c <= 0x0D28 || + c >= 0x0D2A && c <= 0x0D39 || + c >= 0x0D60 && c <= 0x0D61 || + c >= 0x0E01 && c <= 0x0E2E || + c == 0x0E30 || + c >= 0x0E32 && c <= 0x0E33 || + c >= 0x0E40 && c <= 0x0E45 || + c >= 0x0E81 && c <= 0x0E82 || + c == 0x0E84 || + c >= 0x0E87 && c <= 0x0E88 || + c == 0x0E8A || + c == 0x0E8D || + c >= 0x0E94 && c <= 0x0E97 || + c >= 0x0E99 && c <= 0x0E9F || + c >= 0x0EA1 && c <= 0x0EA3 || + c == 0x0EA5 || + c == 0x0EA7 || + c >= 0x0EAA && c <= 0x0EAB || + c >= 0x0EAD && c <= 0x0EAE || + c == 0x0EB0 || + c >= 0x0EB2 && c <= 0x0EB3 || + c == 0x0EBD || + c >= 0x0EC0 && c <= 0x0EC4 || + c >= 0x0F40 && c <= 0x0F47 || + c >= 0x0F49 && c <= 0x0F69 || + c >= 0x10A0 && c <= 0x10C5 || + c >= 0x10D0 && c <= 0x10F6 || + c == 0x1100 || + c >= 0x1102 && c <= 0x1103 || + c >= 0x1105 && c <= 0x1107 || + c == 0x1109 || + c >= 0x110B && c <= 0x110C || + c >= 0x110E && c <= 0x1112 || + c == 0x113C || + c == 0x113E || + c == 0x1140 || + c == 0x114C || + c == 0x114E || + c == 0x1150 || + c >= 0x1154 && c <= 0x1155 || + c == 0x1159 || + c >= 0x115F && c <= 0x1161 || + c == 0x1163 || + c == 0x1165 || + c == 0x1167 || + c == 0x1169 || + c >= 0x116D && c <= 0x116E || + c >= 0x1172 && c <= 0x1173 || + c == 0x1175 || + c == 0x119E || + c == 0x11A8 || + c == 0x11AB || + c >= 0x11AE && c <= 0x11AF || + c >= 0x11B7 && c <= 0x11B8 || + c == 0x11BA || + c >= 0x11BC && c <= 0x11C2 || + c == 0x11EB || + c == 0x11F0 || + c == 0x11F9 || + c >= 0x1E00 && c <= 0x1E9B || + c >= 0x1EA0 && c <= 0x1EF9 || + c >= 0x1F00 && c <= 0x1F15 || + c >= 0x1F18 && c <= 0x1F1D || + c >= 0x1F20 && c <= 0x1F45 || + c >= 0x1F48 && c <= 0x1F4D || + c >= 0x1F50 && c <= 0x1F57 || + c == 0x1F59 || + c == 0x1F5B || + c == 0x1F5D || + c >= 0x1F5F && c <= 0x1F7D || + c >= 0x1F80 && c <= 0x1FB4 || + c >= 0x1FB6 && c <= 0x1FBC || + c == 0x1FBE || + c >= 0x1FC2 && c <= 0x1FC4 || + c >= 0x1FC6 && c <= 0x1FCC || + c >= 0x1FD0 && c <= 0x1FD3 || + c >= 0x1FD6 && c <= 0x1FDB || + c >= 0x1FE0 && c <= 0x1FEC || + c >= 0x1FF2 && c <= 0x1FF4 || + c >= 0x1FF6 && c <= 0x1FFC || + c == 0x2126 || + c >= 0x212A && c <= 0x212B || + c == 0x212E || + c >= 0x2180 && c <= 0x2182 || + c >= 0x3041 && c <= 0x3094 || + c >= 0x30A1 && c <= 0x30FA || + c >= 0x3105 && c <= 0x312C || + c >= 0xAC00 && c <= 0xD7A3 || + c >= 0x4E00 && c <= 0x9FA5 || + c == 0x3007 || + c >= 0x3021 && c <= 0x3029; +}; + +Utilities.isNCNameChar = function(c) { + return c >= 0x0030 && c <= 0x0039 + || c >= 0x0660 && c <= 0x0669 + || c >= 0x06F0 && c <= 0x06F9 + || c >= 0x0966 && c <= 0x096F + || c >= 0x09E6 && c <= 0x09EF + || c >= 0x0A66 && c <= 0x0A6F + || c >= 0x0AE6 && c <= 0x0AEF + || c >= 0x0B66 && c <= 0x0B6F + || c >= 0x0BE7 && c <= 0x0BEF + || c >= 0x0C66 && c <= 0x0C6F + || c >= 0x0CE6 && c <= 0x0CEF + || c >= 0x0D66 && c <= 0x0D6F + || c >= 0x0E50 && c <= 0x0E59 + || c >= 0x0ED0 && c <= 0x0ED9 + || c >= 0x0F20 && c <= 0x0F29 + || c == 0x002E + || c == 0x002D + || c == 0x005F + || Utilities.isLetter(c) + || c >= 0x0300 && c <= 0x0345 + || c >= 0x0360 && c <= 0x0361 + || c >= 0x0483 && c <= 0x0486 + || c >= 0x0591 && c <= 0x05A1 + || c >= 0x05A3 && c <= 0x05B9 + || c >= 0x05BB && c <= 0x05BD + || c == 0x05BF + || c >= 0x05C1 && c <= 0x05C2 + || c == 0x05C4 + || c >= 0x064B && c <= 0x0652 + || c == 0x0670 + || c >= 0x06D6 && c <= 0x06DC + || c >= 0x06DD && c <= 0x06DF + || c >= 0x06E0 && c <= 0x06E4 + || c >= 0x06E7 && c <= 0x06E8 + || c >= 0x06EA && c <= 0x06ED + || c >= 0x0901 && c <= 0x0903 + || c == 0x093C + || c >= 0x093E && c <= 0x094C + || c == 0x094D + || c >= 0x0951 && c <= 0x0954 + || c >= 0x0962 && c <= 0x0963 + || c >= 0x0981 && c <= 0x0983 + || c == 0x09BC + || c == 0x09BE + || c == 0x09BF + || c >= 0x09C0 && c <= 0x09C4 + || c >= 0x09C7 && c <= 0x09C8 + || c >= 0x09CB && c <= 0x09CD + || c == 0x09D7 + || c >= 0x09E2 && c <= 0x09E3 + || c == 0x0A02 + || c == 0x0A3C + || c == 0x0A3E + || c == 0x0A3F + || c >= 0x0A40 && c <= 0x0A42 + || c >= 0x0A47 && c <= 0x0A48 + || c >= 0x0A4B && c <= 0x0A4D + || c >= 0x0A70 && c <= 0x0A71 + || c >= 0x0A81 && c <= 0x0A83 + || c == 0x0ABC + || c >= 0x0ABE && c <= 0x0AC5 + || c >= 0x0AC7 && c <= 0x0AC9 + || c >= 0x0ACB && c <= 0x0ACD + || c >= 0x0B01 && c <= 0x0B03 + || c == 0x0B3C + || c >= 0x0B3E && c <= 0x0B43 + || c >= 0x0B47 && c <= 0x0B48 + || c >= 0x0B4B && c <= 0x0B4D + || c >= 0x0B56 && c <= 0x0B57 + || c >= 0x0B82 && c <= 0x0B83 + || c >= 0x0BBE && c <= 0x0BC2 + || c >= 0x0BC6 && c <= 0x0BC8 + || c >= 0x0BCA && c <= 0x0BCD + || c == 0x0BD7 + || c >= 0x0C01 && c <= 0x0C03 + || c >= 0x0C3E && c <= 0x0C44 + || c >= 0x0C46 && c <= 0x0C48 + || c >= 0x0C4A && c <= 0x0C4D + || c >= 0x0C55 && c <= 0x0C56 + || c >= 0x0C82 && c <= 0x0C83 + || c >= 0x0CBE && c <= 0x0CC4 + || c >= 0x0CC6 && c <= 0x0CC8 + || c >= 0x0CCA && c <= 0x0CCD + || c >= 0x0CD5 && c <= 0x0CD6 + || c >= 0x0D02 && c <= 0x0D03 + || c >= 0x0D3E && c <= 0x0D43 + || c >= 0x0D46 && c <= 0x0D48 + || c >= 0x0D4A && c <= 0x0D4D + || c == 0x0D57 + || c == 0x0E31 + || c >= 0x0E34 && c <= 0x0E3A + || c >= 0x0E47 && c <= 0x0E4E + || c == 0x0EB1 + || c >= 0x0EB4 && c <= 0x0EB9 + || c >= 0x0EBB && c <= 0x0EBC + || c >= 0x0EC8 && c <= 0x0ECD + || c >= 0x0F18 && c <= 0x0F19 + || c == 0x0F35 + || c == 0x0F37 + || c == 0x0F39 + || c == 0x0F3E + || c == 0x0F3F + || c >= 0x0F71 && c <= 0x0F84 + || c >= 0x0F86 && c <= 0x0F8B + || c >= 0x0F90 && c <= 0x0F95 + || c == 0x0F97 + || c >= 0x0F99 && c <= 0x0FAD + || c >= 0x0FB1 && c <= 0x0FB7 + || c == 0x0FB9 + || c >= 0x20D0 && c <= 0x20DC + || c == 0x20E1 + || c >= 0x302A && c <= 0x302F + || c == 0x3099 + || c == 0x309A + || c == 0x00B7 + || c == 0x02D0 + || c == 0x02D1 + || c == 0x0387 + || c == 0x0640 + || c == 0x0E46 + || c == 0x0EC6 + || c == 0x3005 + || c >= 0x3031 && c <= 0x3035 + || c >= 0x309D && c <= 0x309E + || c >= 0x30FC && c <= 0x30FE; +}; + +Utilities.coalesceText = function(n) { + for (var m = n.firstChild; m != null; m = m.nextSibling) { + if (m.nodeType == 3 /*Node.TEXT_NODE*/ || m.nodeType == 4 /*Node.CDATA_SECTION_NODE*/) { + var s = m.nodeValue; + var first = m; + m = m.nextSibling; + while (m != null && (m.nodeType == 3 /*Node.TEXT_NODE*/ || m.nodeType == 4 /*Node.CDATA_SECTION_NODE*/)) { + s += m.nodeValue; + var del = m; + m = m.nextSibling; + del.parentNode.removeChild(del); + } + if (first.nodeType == 4 /*Node.CDATA_SECTION_NODE*/) { + var p = first.parentNode; + if (first.nextSibling == null) { + p.removeChild(first); + p.appendChild(p.ownerDocument.createTextNode(s)); + } else { + var next = first.nextSibling; + p.removeChild(first); + p.insertBefore(p.ownerDocument.createTextNode(s), next); + } + } else { + first.nodeValue = s; + } + if (m == null) { + break; + } + } else if (m.nodeType == 1 /*Node.ELEMENT_NODE*/) { + Utilities.coalesceText(m); + } + } +}; + +Utilities.instance_of = function(o, c) { + while (o != null) { + if (o.constructor === c) { + return true; + } + if (o === Object) { + return false; + } + o = o.constructor.superclass; + } + return false; +}; + +Utilities.getElementById = function(n, id) { + // Note that this does not check the DTD to check for actual + // attributes of type ID, so this may be a bit wrong. + if (n.nodeType == 1 /*Node.ELEMENT_NODE*/) { + if (n.getAttribute("id") == id + || n.getAttributeNS(null, "id") == id) { + return n; + } + } + for (var m = n.firstChild; m != null; m = m.nextSibling) { + var res = Utilities.getElementById(m, id); + if (res != null) { + return res; + } + } + return null; +}; + +// XPathException //////////////////////////////////////////////////////////// + +var XPathException = (function () { + function getMessage(code, exception) { + var msg = exception ? ": " + exception.toString() : ""; + switch (code) { + case XPathException.INVALID_EXPRESSION_ERR: + return "Invalid expression" + msg; + case XPathException.TYPE_ERR: + return "Type error" + msg; + } + return null; + } + + function XPathException(code, error, message) { + var err = Error.call(this, getMessage(code, error) || message); + + err.code = code; + err.exception = error; + + return err; + } + + XPathException.prototype = Object.create(Error.prototype); + XPathException.prototype.constructor = XPathException; + XPathException.superclass = Error; + + XPathException.prototype.toString = function() { + return this.message; + }; + + XPathException.fromMessage = function(message, error) { + return new XPathException(null, error, message); + }; + + XPathException.INVALID_EXPRESSION_ERR = 51; + XPathException.TYPE_ERR = 52; + + return XPathException; +})(); + +// XPathExpression /////////////////////////////////////////////////////////// + +XPathExpression.prototype = {}; +XPathExpression.prototype.constructor = XPathExpression; +XPathExpression.superclass = Object.prototype; + +function XPathExpression(e, r, p) { + this.xpath = p.parse(e); + this.context = new XPathContext(); + this.context.namespaceResolver = new XPathNSResolverWrapper(r); +} + +XPathExpression.getOwnerDocument = function (n) { + return n.nodeType === 9 /*Node.DOCUMENT_NODE*/ ? n : n.ownerDocument; +} + +XPathExpression.detectHtmlDom = function (n) { + if (!n) { return false; } + + var doc = XPathExpression.getOwnerDocument(n); + + try { + return doc.implementation.hasFeature("HTML", "2.0"); + } catch (e) { + return true; + } +} + +XPathExpression.prototype.evaluate = function(n, t, res) { + this.context.expressionContextNode = n; + // backward compatibility - no reliable way to detect whether the DOM is HTML, but + // this library has been using this method up until now, so we will continue to use it + // ONLY when using an XPathExpression + this.context.caseInsensitive = XPathExpression.detectHtmlDom(n); + + var result = this.xpath.evaluate(this.context); + return new XPathResult(result, t); +} + +// XPathNSResolverWrapper //////////////////////////////////////////////////// + +XPathNSResolverWrapper.prototype = {}; +XPathNSResolverWrapper.prototype.constructor = XPathNSResolverWrapper; +XPathNSResolverWrapper.superclass = Object.prototype; + +function XPathNSResolverWrapper(r) { + this.xpathNSResolver = r; +} + +XPathNSResolverWrapper.prototype.getNamespace = function(prefix, n) { + if (this.xpathNSResolver == null) { + return null; + } + return this.xpathNSResolver.lookupNamespaceURI(prefix); +}; + +// NodeXPathNSResolver /////////////////////////////////////////////////////// + +NodeXPathNSResolver.prototype = {}; +NodeXPathNSResolver.prototype.constructor = NodeXPathNSResolver; +NodeXPathNSResolver.superclass = Object.prototype; + +function NodeXPathNSResolver(n) { + this.node = n; + this.namespaceResolver = new NamespaceResolver(); +} + +NodeXPathNSResolver.prototype.lookupNamespaceURI = function(prefix) { + return this.namespaceResolver.getNamespace(prefix, this.node); +}; + +// XPathResult /////////////////////////////////////////////////////////////// + +XPathResult.prototype = {}; +XPathResult.prototype.constructor = XPathResult; +XPathResult.superclass = Object.prototype; + +function XPathResult(v, t) { + if (t == XPathResult.ANY_TYPE) { + if (v.constructor === XString) { + t = XPathResult.STRING_TYPE; + } else if (v.constructor === XNumber) { + t = XPathResult.NUMBER_TYPE; + } else if (v.constructor === XBoolean) { + t = XPathResult.BOOLEAN_TYPE; + } else if (v.constructor === XNodeSet) { + t = XPathResult.UNORDERED_NODE_ITERATOR_TYPE; + } + } + this.resultType = t; + switch (t) { + case XPathResult.NUMBER_TYPE: + this.numberValue = v.numberValue(); + return; + case XPathResult.STRING_TYPE: + this.stringValue = v.stringValue(); + return; + case XPathResult.BOOLEAN_TYPE: + this.booleanValue = v.booleanValue(); + return; + case XPathResult.ANY_UNORDERED_NODE_TYPE: + case XPathResult.FIRST_ORDERED_NODE_TYPE: + if (v.constructor === XNodeSet) { + this.singleNodeValue = v.first(); + return; + } + break; + case XPathResult.UNORDERED_NODE_ITERATOR_TYPE: + case XPathResult.ORDERED_NODE_ITERATOR_TYPE: + if (v.constructor === XNodeSet) { + this.invalidIteratorState = false; + this.nodes = v.toArray(); + this.iteratorIndex = 0; + return; + } + break; + case XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE: + case XPathResult.ORDERED_NODE_SNAPSHOT_TYPE: + if (v.constructor === XNodeSet) { + this.nodes = v.toArray(); + this.snapshotLength = this.nodes.length; + return; + } + break; + } + throw new XPathException(XPathException.TYPE_ERR); +}; + +XPathResult.prototype.iterateNext = function() { + if (this.resultType != XPathResult.UNORDERED_NODE_ITERATOR_TYPE + && this.resultType != XPathResult.ORDERED_NODE_ITERATOR_TYPE) { + throw new XPathException(XPathException.TYPE_ERR); + } + return this.nodes[this.iteratorIndex++]; +}; + +XPathResult.prototype.snapshotItem = function(i) { + if (this.resultType != XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE + && this.resultType != XPathResult.ORDERED_NODE_SNAPSHOT_TYPE) { + throw new XPathException(XPathException.TYPE_ERR); + } + return this.nodes[i]; +}; + +XPathResult.ANY_TYPE = 0; +XPathResult.NUMBER_TYPE = 1; +XPathResult.STRING_TYPE = 2; +XPathResult.BOOLEAN_TYPE = 3; +XPathResult.UNORDERED_NODE_ITERATOR_TYPE = 4; +XPathResult.ORDERED_NODE_ITERATOR_TYPE = 5; +XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE = 6; +XPathResult.ORDERED_NODE_SNAPSHOT_TYPE = 7; +XPathResult.ANY_UNORDERED_NODE_TYPE = 8; +XPathResult.FIRST_ORDERED_NODE_TYPE = 9; + +// DOM 3 XPath support /////////////////////////////////////////////////////// + +function installDOM3XPathSupport(doc, p) { + doc.createExpression = function(e, r) { + try { + return new XPathExpression(e, r, p); + } catch (e) { + throw new XPathException(XPathException.INVALID_EXPRESSION_ERR, e); + } + }; + doc.createNSResolver = function(n) { + return new NodeXPathNSResolver(n); + }; + doc.evaluate = function(e, cn, r, t, res) { + if (t < 0 || t > 9) { + throw { code: 0, toString: function() { return "Request type not supported"; } }; + } + return doc.createExpression(e, r, p).evaluate(cn, t, res); + }; +}; + +// --------------------------------------------------------------------------- + +// Install DOM 3 XPath support for the current document. +try { + var shouldInstall = true; + try { + if (document.implementation + && document.implementation.hasFeature + && document.implementation.hasFeature("XPath", null)) { + shouldInstall = false; + } + } catch (e) { + } + if (shouldInstall) { + installDOM3XPathSupport(document, new XPathParser()); + } +} catch (e) { +} + +// --------------------------------------------------------------------------- +// exports for node.js + +installDOM3XPathSupport(exports, new XPathParser()); + +(function() { + var parser = new XPathParser(); + + var defaultNSResolver = new NamespaceResolver(); + var defaultFunctionResolver = new FunctionResolver(); + var defaultVariableResolver = new VariableResolver(); + + function makeNSResolverFromFunction(func) { + return { + getNamespace: function (prefix, node) { + var ns = func(prefix, node); + + return ns || defaultNSResolver.getNamespace(prefix, node); + } + }; + } + + function makeNSResolverFromObject(obj) { + return makeNSResolverFromFunction(obj.getNamespace.bind(obj)); + } + + function makeNSResolverFromMap(map) { + return makeNSResolverFromFunction(function (prefix) { + return map[prefix]; + }); + } + + function makeNSResolver(resolver) { + if (resolver && typeof resolver.getNamespace === "function") { + return makeNSResolverFromObject(resolver); + } + + if (typeof resolver === "function") { + return makeNSResolverFromFunction(resolver); + } + + // assume prefix -> uri mapping + if (typeof resolver === "object") { + return makeNSResolverFromMap(resolver); + } + + return defaultNSResolver; + } + + /** Converts native JavaScript types to their XPath library equivalent */ + function convertValue(value) { + if (value === null || + typeof value === "undefined" || + value instanceof XString || + value instanceof XBoolean || + value instanceof XNumber || + value instanceof XNodeSet) { + return value; + } + + switch (typeof value) { + case "string": return new XString(value); + case "boolean": return new XBoolean(value); + case "number": return new XNumber(value); + } + + // assume node(s) + var ns = new XNodeSet(); + ns.addArray([].concat(value)); + return ns; + } + + function makeEvaluator(func) { + return function (context) { + var args = Array.prototype.slice.call(arguments, 1).map(function (arg) { + return arg.evaluate(context); + }); + var result = func.apply(this, [].concat(context, args)); + return convertValue(result); + }; + } + + function makeFunctionResolverFromFunction(func) { + return { + getFunction: function (name, namespace) { + var found = func(name, namespace); + if (found) { + return makeEvaluator(found); + } + return defaultFunctionResolver.getFunction(name, namespace); + } + }; + } + + function makeFunctionResolverFromObject(obj) { + return makeFunctionResolverFromFunction(obj.getFunction.bind(obj)); + } + + function makeFunctionResolverFromMap(map) { + return makeFunctionResolverFromFunction(function (name) { + return map[name]; + }); + } + + function makeFunctionResolver(resolver) { + if (resolver && typeof resolver.getFunction === "function") { + return makeFunctionResolverFromObject(resolver); + } + + if (typeof resolver === "function") { + return makeFunctionResolverFromFunction(resolver); + } + + // assume map + if (typeof resolver === "object") { + return makeFunctionResolverFromMap(resolver); + } + + return defaultFunctionResolver; + } + + function makeVariableResolverFromFunction(func) { + return { + getVariable: function (name, namespace) { + var value = func(name, namespace); + return convertValue(value); + } + }; + } + + function makeVariableResolver(resolver) { + if (resolver) { + if (typeof resolver.getVariable === "function") { + return makeVariableResolverFromFunction(resolver.getVariable.bind(resolver)); + } + + if (typeof resolver === "function") { + return makeVariableResolverFromFunction(resolver); + } + + // assume map + if (typeof resolver === "object") { + return makeVariableResolverFromFunction(function (name) { + return resolver[name]; + }); + } + } + + return defaultVariableResolver; + } + + function copyIfPresent(prop, dest, source) { + if (prop in source) { dest[prop] = source[prop]; } + } + + function makeContext(options) { + var context = new XPathContext(); + + if (options) { + context.namespaceResolver = makeNSResolver(options.namespaces); + context.functionResolver = makeFunctionResolver(options.functions); + context.variableResolver = makeVariableResolver(options.variables); + context.expressionContextNode = options.node; + copyIfPresent('allowAnyNamespaceForNoPrefix', context, options); + copyIfPresent('isHtml', context, options); + } else { + context.namespaceResolver = defaultNSResolver; + } + + return context; + } + + function evaluate(parsedExpression, options) { + var context = makeContext(options); + + return parsedExpression.evaluate(context); + } + + var evaluatorPrototype = { + evaluate: function (options) { + return evaluate(this.expression, options); + } + + ,evaluateNumber: function (options) { + return this.evaluate(options).numberValue(); + } + + ,evaluateString: function (options) { + return this.evaluate(options).stringValue(); + } + + ,evaluateBoolean: function (options) { + return this.evaluate(options).booleanValue(); + } + + ,evaluateNodeSet: function (options) { + return this.evaluate(options).nodeset(); + } + + ,select: function (options) { + return this.evaluateNodeSet(options).toArray() + } + + ,select1: function (options) { + return this.select(options)[0]; + } + }; + + function parse(xpath) { + var parsed = parser.parse(xpath); + + return Object.create(evaluatorPrototype, { + expression: { + value: parsed + } + }); + } + + exports.parse = parse; +})(); + +exports.XPath = XPath; +exports.XPathParser = XPathParser; +exports.XPathResult = XPathResult; + +exports.Step = Step; +exports.NodeTest = NodeTest; +exports.BarOperation = BarOperation; + +exports.NamespaceResolver = NamespaceResolver; +exports.FunctionResolver = FunctionResolver; +exports.VariableResolver = VariableResolver; + +exports.Utilities = Utilities; + +exports.XPathContext = XPathContext; +exports.XNodeSet = XNodeSet; +exports.XBoolean = XBoolean; +exports.XString = XString; +exports.XNumber = XNumber; + +// helper +exports.select = function(e, doc, single) { + return exports.selectWithResolver(e, doc, null, single); +}; + +exports.useNamespaces = function(mappings) { + var resolver = { + mappings: mappings || {}, + lookupNamespaceURI: function(prefix) { + return this.mappings[prefix]; + } + }; + + return function(e, doc, single) { + return exports.selectWithResolver(e, doc, resolver, single); + }; +}; + +exports.selectWithResolver = function(e, doc, resolver, single) { + var expression = new XPathExpression(e, resolver, new XPathParser()); + var type = XPathResult.ANY_TYPE; + + var result = expression.evaluate(doc, type, null); + + if (result.resultType == XPathResult.STRING_TYPE) { + result = result.stringValue; + } + else if (result.resultType == XPathResult.NUMBER_TYPE) { + result = result.numberValue; + } + else if (result.resultType == XPathResult.BOOLEAN_TYPE) { + result = result.booleanValue; + } + else { + result = result.nodes; + if (single) { + result = result[0]; + } + } + + return result; +}; + +exports.select1 = function(e, doc) { + return exports.select(e, doc, true); +}; + +// end non-node wrapper +})(xpath); diff --git a/node_modules/xtend/package.json b/node_modules/xtend/package.json index 88919a0c6..f7a39d10a 100644 --- a/node_modules/xtend/package.json +++ b/node_modules/xtend/package.json @@ -52,8 +52,4 @@ "engines": { "node": ">=0.4" } - -,"_resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz" -,"_integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" -,"_from": "xtend@4.0.2" -} \ No newline at end of file +} diff --git a/node_modules/zip-stream/CHANGELOG.md b/node_modules/zip-stream/CHANGELOG.md index ac0c93c5e..2564f1b26 100644 --- a/node_modules/zip-stream/CHANGELOG.md +++ b/node_modules/zip-stream/CHANGELOG.md @@ -1,18 +1,18 @@ -## Changelog - -**1.2.0** — June 16, 2017 — [Diff](https://github.com/archiverjs/node-zip-stream/compare/1.1.1...1.2.0) - -- groundwork for symlinks support. - -*NOTE: this will be the last release for node v0.10 and v0.12. node v4 will become the minimum and a version bump to 2.0.0 will take place.* - -**1.1.1** — _January 17, 2017_ — [Diff](https://github.com/archiverjs/node-zip-stream/compare/1.1.0...1.1.1) - -- actually use STORE method if level is 0 (GH #21) -- bump deps to ensure latest versions are used. - -**1.1.0** — _August 27, 2016_ — [Diff](https://github.com/archiverjs/node-zip-stream/compare/1.0.0...1.1.0) - -- bump deps to ensure latest versions are used. - +## Changelog + +**1.2.0** — June 16, 2017 — [Diff](https://github.com/archiverjs/node-zip-stream/compare/1.1.1...1.2.0) + +- groundwork for symlinks support. + +*NOTE: this will be the last release for node v0.10 and v0.12. node v4 will become the minimum and a version bump to 2.0.0 will take place.* + +**1.1.1** — _January 17, 2017_ — [Diff](https://github.com/archiverjs/node-zip-stream/compare/1.1.0...1.1.1) + +- actually use STORE method if level is 0 (GH #21) +- bump deps to ensure latest versions are used. + +**1.1.0** — _August 27, 2016_ — [Diff](https://github.com/archiverjs/node-zip-stream/compare/1.0.0...1.1.0) + +- bump deps to ensure latest versions are used. + [Release Archive](https://github.com/archiverjs/node-zip-stream/releases) \ No newline at end of file diff --git a/node_modules/zip-stream/LICENSE b/node_modules/zip-stream/LICENSE index 56420a6a0..819b403f0 100644 --- a/node_modules/zip-stream/LICENSE +++ b/node_modules/zip-stream/LICENSE @@ -1,22 +1,22 @@ -Copyright (c) 2014 Chris Talkington, contributors. - -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 +Copyright (c) 2014 Chris Talkington, contributors. + +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. \ No newline at end of file diff --git a/node_modules/zip-stream/README.md b/node_modules/zip-stream/README.md index 982e08d87..e43680b53 100644 --- a/node_modules/zip-stream/README.md +++ b/node_modules/zip-stream/README.md @@ -1,45 +1,45 @@ -# ZipStream v1.2.0 [![Build Status](https://travis-ci.org/archiverjs/node-zip-stream.svg?branch=master)](https://travis-ci.org/archiverjs/node-zip-stream) [![Build status](https://ci.appveyor.com/api/projects/status/2sraarbaadwbtti2/branch/master?svg=true)](https://ci.appveyor.com/project/ctalkington/node-zip-stream/branch/master) - -zip-stream is a streaming zip archive generator based on the `ZipArchiveOutputStream` prototype found in the [compress-commons](https://www.npmjs.org/package/compress-commons) project. - -It was originally created to be a successor to [zipstream](https://npmjs.org/package/zipstream). - -Visit the [API documentation](http://archiverjs.com/zip-stream) for a list of all methods available. - -### Install - -```bash -npm install zip-stream --save -``` - -You can also use `npm install https://github.com/archiverjs/node-zip-stream/archive/master.tar.gz` to test upcoming versions. - -### Usage - -This module is meant to be wrapped internally by other modules and therefore lacks any queue management. This means you have to wait until the previous entry has been fully consumed to add another. Nested callbacks should be used to add multiple entries. There are modules like [async](https://npmjs.org/package/async) that ease the so called "callback hell". - -If you want a module that handles entry queueing and much more, you should check out [archiver](https://npmjs.org/package/archiver) which uses this module internally. - -```js -var packer = require('zip-stream'); -var archive = new packer(); // OR new packer(options) - -archive.on('error', function(err) { - throw err; -}); - -// pipe archive where you want it (ie fs, http, etc) -// listen to the destination's end, close, or finish event - -archive.entry('string contents', { name: 'string.txt' }, function(err, entry) { - if (err) throw err; - archive.entry(null, { name: 'directory/' }, function(err, entry) { - if (err) throw err; - archive.finish(); - }); -}); -``` - -## Credits - +# ZipStream v1.2.0 [![Build Status](https://travis-ci.org/archiverjs/node-zip-stream.svg?branch=master)](https://travis-ci.org/archiverjs/node-zip-stream) [![Build status](https://ci.appveyor.com/api/projects/status/2sraarbaadwbtti2/branch/master?svg=true)](https://ci.appveyor.com/project/ctalkington/node-zip-stream/branch/master) + +zip-stream is a streaming zip archive generator based on the `ZipArchiveOutputStream` prototype found in the [compress-commons](https://www.npmjs.org/package/compress-commons) project. + +It was originally created to be a successor to [zipstream](https://npmjs.org/package/zipstream). + +Visit the [API documentation](http://archiverjs.com/zip-stream) for a list of all methods available. + +### Install + +```bash +npm install zip-stream --save +``` + +You can also use `npm install https://github.com/archiverjs/node-zip-stream/archive/master.tar.gz` to test upcoming versions. + +### Usage + +This module is meant to be wrapped internally by other modules and therefore lacks any queue management. This means you have to wait until the previous entry has been fully consumed to add another. Nested callbacks should be used to add multiple entries. There are modules like [async](https://npmjs.org/package/async) that ease the so called "callback hell". + +If you want a module that handles entry queueing and much more, you should check out [archiver](https://npmjs.org/package/archiver) which uses this module internally. + +```js +var packer = require('zip-stream'); +var archive = new packer(); // OR new packer(options) + +archive.on('error', function(err) { + throw err; +}); + +// pipe archive where you want it (ie fs, http, etc) +// listen to the destination's end, close, or finish event + +archive.entry('string contents', { name: 'string.txt' }, function(err, entry) { + if (err) throw err; + archive.entry(null, { name: 'directory/' }, function(err, entry) { + if (err) throw err; + archive.finish(); + }); +}); +``` + +## Credits + Concept inspired by Antoine van Wel's [zipstream](https://npmjs.org/package/zipstream) module, which is no longer being updated. \ No newline at end of file diff --git a/node_modules/zip-stream/index.js b/node_modules/zip-stream/index.js index 99b202459..acb5d0df2 100644 --- a/node_modules/zip-stream/index.js +++ b/node_modules/zip-stream/index.js @@ -1,180 +1,180 @@ -/** - * ZipStream - * - * @ignore - * @license [MIT]{@link https://github.com/archiverjs/node-zip-stream/blob/master/LICENSE} - * @copyright (c) 2014 Chris Talkington, contributors. - */ -var inherits = require('util').inherits; - -var ZipArchiveOutputStream = require('compress-commons').ZipArchiveOutputStream; -var ZipArchiveEntry = require('compress-commons').ZipArchiveEntry; - -var util = require('archiver-utils'); - -/** - * @constructor - * @extends external:ZipArchiveOutputStream - * @param {Object} [options] - * @param {String} [options.comment] Sets the zip archive comment. - * @param {Boolean} [options.forceLocalTime=false] Forces the archive to contain local file times instead of UTC. - * @param {Boolean} [options.forceZip64=false] Forces the archive to contain ZIP64 headers. - * @param {Boolean} [options.store=false] Sets the compression method to STORE. - * @param {Object} [options.zlib] Passed to [zlib]{@link https://nodejs.org/api/zlib.html#zlib_class_options} - * to control compression. - */ -var ZipStream = module.exports = function(options) { - if (!(this instanceof ZipStream)) { - return new ZipStream(options); - } - - options = this.options = options || {}; - options.zlib = options.zlib || {}; - - ZipArchiveOutputStream.call(this, options); - - if (typeof options.level === 'number' && options.level >= 0) { - options.zlib.level = options.level; - delete options.level; - } - - if (typeof options.zlib.level === 'number' && options.zlib.level === 0) { - options.store = true; - } - - if (options.comment && options.comment.length > 0) { - this.setComment(options.comment); - } -}; - -inherits(ZipStream, ZipArchiveOutputStream); - -/** - * Normalizes entry data with fallbacks for key properties. - * - * @private - * @param {Object} data - * @return {Object} - */ -ZipStream.prototype._normalizeFileData = function(data) { - data = util.defaults(data, { - type: 'file', - name: null, - linkname: null, - date: null, - mode: null, - store: this.options.store, - comment: '' - }); - - var isDir = data.type === 'directory'; - var isSymlink = data.type === 'symlink'; - - if (data.name) { - data.name = util.sanitizePath(data.name); - - if (!isSymlink && data.name.slice(-1) === '/') { - isDir = true; - data.type = 'directory'; - } else if (isDir) { - data.name += '/'; - } - } - - if (isDir || isSymlink) { - data.store = true; - } - - data.date = util.dateify(data.date); - - return data; -}; - -/** - * Appends an entry given an input source (text string, buffer, or stream). - * - * @param {(Buffer|Stream|String)} source The input source. - * @param {Object} data - * @param {String} data.name Sets the entry name including internal path. - * @param {String} [data.comment] Sets the entry comment. - * @param {(String|Date)} [data.date=NOW()] Sets the entry date. - * @param {Number} [data.mode=D:0755/F:0644] Sets the entry permissions. - * @param {Boolean} [data.store=options.store] Sets the compression method to STORE. - * @param {String} [data.type=file] Sets the entry type. Defaults to `directory` - * if name ends with trailing slash. - * @param {Function} callback - * @return this - */ -ZipStream.prototype.entry = function(source, data, callback) { - if (typeof callback !== 'function') { - callback = this._emitErrorCallback.bind(this); - } - - data = this._normalizeFileData(data); - - if (data.type !== 'file' && data.type !== 'directory' && data.type !== 'symlink') { - callback(new Error(data.type + ' entries not currently supported')); - return; - } - - if (typeof data.name !== 'string' || data.name.length === 0) { - callback(new Error('entry name must be a non-empty string value')); - return; - } - - if (data.type === 'symlink' && typeof data.linkname !== 'string') { - callback(new Error('entry linkname must be a non-empty string value when type equals symlink')); - return; - } - - var entry = new ZipArchiveEntry(data.name); - entry.setTime(data.date); - - if (data.store) { - entry.setMethod(0); - } - - if (data.comment.length > 0) { - entry.setComment(data.comment); - } - - if (data.type === 'symlink' && typeof data.mode !== 'number') { - data.mode = 40960; // 0120000 - } - - if (typeof data.mode === 'number') { - if (data.type === 'symlink') { - data.mode |= 40960; - } - - entry.setUnixMode(data.mode); - } - - if (data.type === 'symlink' && typeof data.linkname === 'string') { - source = new Buffer(data.linkname); - } - - return ZipArchiveOutputStream.prototype.entry.call(this, entry, source, callback); -}; - -/** - * Finalizes the instance and prevents further appending to the archive - * structure (queue will continue til drained). - * - * @return void - */ -ZipStream.prototype.finalize = function() { - this.finish(); -}; - -/** - * Returns the current number of bytes written to this stream. - * @function ZipStream#getBytesWritten - * @returns {Number} - */ - -/** - * Compress Commons ZipArchiveOutputStream - * @external ZipArchiveOutputStream - * @see {@link https://github.com/archiverjs/node-compress-commons} +/** + * ZipStream + * + * @ignore + * @license [MIT]{@link https://github.com/archiverjs/node-zip-stream/blob/master/LICENSE} + * @copyright (c) 2014 Chris Talkington, contributors. + */ +var inherits = require('util').inherits; + +var ZipArchiveOutputStream = require('compress-commons').ZipArchiveOutputStream; +var ZipArchiveEntry = require('compress-commons').ZipArchiveEntry; + +var util = require('archiver-utils'); + +/** + * @constructor + * @extends external:ZipArchiveOutputStream + * @param {Object} [options] + * @param {String} [options.comment] Sets the zip archive comment. + * @param {Boolean} [options.forceLocalTime=false] Forces the archive to contain local file times instead of UTC. + * @param {Boolean} [options.forceZip64=false] Forces the archive to contain ZIP64 headers. + * @param {Boolean} [options.store=false] Sets the compression method to STORE. + * @param {Object} [options.zlib] Passed to [zlib]{@link https://nodejs.org/api/zlib.html#zlib_class_options} + * to control compression. + */ +var ZipStream = module.exports = function(options) { + if (!(this instanceof ZipStream)) { + return new ZipStream(options); + } + + options = this.options = options || {}; + options.zlib = options.zlib || {}; + + ZipArchiveOutputStream.call(this, options); + + if (typeof options.level === 'number' && options.level >= 0) { + options.zlib.level = options.level; + delete options.level; + } + + if (typeof options.zlib.level === 'number' && options.zlib.level === 0) { + options.store = true; + } + + if (options.comment && options.comment.length > 0) { + this.setComment(options.comment); + } +}; + +inherits(ZipStream, ZipArchiveOutputStream); + +/** + * Normalizes entry data with fallbacks for key properties. + * + * @private + * @param {Object} data + * @return {Object} + */ +ZipStream.prototype._normalizeFileData = function(data) { + data = util.defaults(data, { + type: 'file', + name: null, + linkname: null, + date: null, + mode: null, + store: this.options.store, + comment: '' + }); + + var isDir = data.type === 'directory'; + var isSymlink = data.type === 'symlink'; + + if (data.name) { + data.name = util.sanitizePath(data.name); + + if (!isSymlink && data.name.slice(-1) === '/') { + isDir = true; + data.type = 'directory'; + } else if (isDir) { + data.name += '/'; + } + } + + if (isDir || isSymlink) { + data.store = true; + } + + data.date = util.dateify(data.date); + + return data; +}; + +/** + * Appends an entry given an input source (text string, buffer, or stream). + * + * @param {(Buffer|Stream|String)} source The input source. + * @param {Object} data + * @param {String} data.name Sets the entry name including internal path. + * @param {String} [data.comment] Sets the entry comment. + * @param {(String|Date)} [data.date=NOW()] Sets the entry date. + * @param {Number} [data.mode=D:0755/F:0644] Sets the entry permissions. + * @param {Boolean} [data.store=options.store] Sets the compression method to STORE. + * @param {String} [data.type=file] Sets the entry type. Defaults to `directory` + * if name ends with trailing slash. + * @param {Function} callback + * @return this + */ +ZipStream.prototype.entry = function(source, data, callback) { + if (typeof callback !== 'function') { + callback = this._emitErrorCallback.bind(this); + } + + data = this._normalizeFileData(data); + + if (data.type !== 'file' && data.type !== 'directory' && data.type !== 'symlink') { + callback(new Error(data.type + ' entries not currently supported')); + return; + } + + if (typeof data.name !== 'string' || data.name.length === 0) { + callback(new Error('entry name must be a non-empty string value')); + return; + } + + if (data.type === 'symlink' && typeof data.linkname !== 'string') { + callback(new Error('entry linkname must be a non-empty string value when type equals symlink')); + return; + } + + var entry = new ZipArchiveEntry(data.name); + entry.setTime(data.date); + + if (data.store) { + entry.setMethod(0); + } + + if (data.comment.length > 0) { + entry.setComment(data.comment); + } + + if (data.type === 'symlink' && typeof data.mode !== 'number') { + data.mode = 40960; // 0120000 + } + + if (typeof data.mode === 'number') { + if (data.type === 'symlink') { + data.mode |= 40960; + } + + entry.setUnixMode(data.mode); + } + + if (data.type === 'symlink' && typeof data.linkname === 'string') { + source = new Buffer(data.linkname); + } + + return ZipArchiveOutputStream.prototype.entry.call(this, entry, source, callback); +}; + +/** + * Finalizes the instance and prevents further appending to the archive + * structure (queue will continue til drained). + * + * @return void + */ +ZipStream.prototype.finalize = function() { + this.finish(); +}; + +/** + * Returns the current number of bytes written to this stream. + * @function ZipStream#getBytesWritten + * @returns {Number} + */ + +/** + * Compress Commons ZipArchiveOutputStream + * @external ZipArchiveOutputStream + * @see {@link https://github.com/archiverjs/node-compress-commons} */ \ No newline at end of file diff --git a/node_modules/zip-stream/package.json b/node_modules/zip-stream/package.json index c8af05bdb..59adadd49 100644 --- a/node_modules/zip-stream/package.json +++ b/node_modules/zip-stream/package.json @@ -1,57 +1,53 @@ -{ - "name": "zip-stream", - "version": "1.2.0", - "description": "a streaming zip archive generator.", - "homepage": "https://github.com/archiverjs/node-zip-stream", - "author": { - "name": "Chris Talkington", - "url": "http://christalkington.com/" - }, - "repository": { - "type": "git", - "url": "https://github.com/archiverjs/node-zip-stream.git" - }, - "bugs": { - "url": "https://github.com/archiverjs/node-zip-stream/issues" - }, - "license": "MIT", - "main": "index.js", - "files": [ - "index.js" - ], - "engines": { - "node": ">= 0.10.0" - }, - "scripts": { - "test": "mocha --reporter dot", - "jsdoc": "jsdoc -c jsdoc.json README.md" - }, - "dependencies": { - "archiver-utils": "^1.3.0", - "compress-commons": "^1.2.0", - "lodash": "^4.8.0", - "readable-stream": "^2.0.0" - }, - "devDependencies": { - "archiver-jsdoc-theme": "^1.0.0", - "jsdoc": "~3.4.0", - "chai": "^4.0.0", - "minami": "^1.1.0", - "mocha": "^3.2.0", - "rimraf": "^2.4.3", - "mkdirp": "^0.5.0" - }, - "keywords": [ - "archive", - "stream", - "zip-stream", - "zip" - ], - "publishConfig": { - "registry": "https://registry.npmjs.org/" - } - -,"_resolved": "https://registry.npmjs.org/zip-stream/-/zip-stream-1.2.0.tgz" -,"_integrity": "sha1-qLxF9MG0lpnGuQGYuqyqzbzUugQ=" -,"_from": "zip-stream@1.2.0" +{ + "name": "zip-stream", + "version": "1.2.0", + "description": "a streaming zip archive generator.", + "homepage": "https://github.com/archiverjs/node-zip-stream", + "author": { + "name": "Chris Talkington", + "url": "http://christalkington.com/" + }, + "repository": { + "type": "git", + "url": "https://github.com/archiverjs/node-zip-stream.git" + }, + "bugs": { + "url": "https://github.com/archiverjs/node-zip-stream/issues" + }, + "license": "MIT", + "main": "index.js", + "files": [ + "index.js" + ], + "engines": { + "node": ">= 0.10.0" + }, + "scripts": { + "test": "mocha --reporter dot", + "jsdoc": "jsdoc -c jsdoc.json README.md" + }, + "dependencies": { + "archiver-utils": "^1.3.0", + "compress-commons": "^1.2.0", + "lodash": "^4.8.0", + "readable-stream": "^2.0.0" + }, + "devDependencies": { + "archiver-jsdoc-theme": "^1.0.0", + "jsdoc": "~3.4.0", + "chai": "^4.0.0", + "minami": "^1.1.0", + "mocha": "^3.2.0", + "rimraf": "^2.4.3", + "mkdirp": "^0.5.0" + }, + "keywords": [ + "archive", + "stream", + "zip-stream", + "zip" + ], + "publishConfig": { + "registry": "https://registry.npmjs.org/" + } } \ No newline at end of file