diff --git a/node_modules/.bin/acorn b/node_modules/.bin/acorn deleted file mode 100644 index 679bd163c..000000000 --- a/node_modules/.bin/acorn +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") - -case `uname` in - *CYGWIN*|*MINGW*|*MSYS*) - if command -v cygpath > /dev/null 2>&1; then - basedir=`cygpath -w "$basedir"` - fi - ;; -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/browserslist b/node_modules/.bin/browserslist deleted file mode 100644 index 60e71ad87..000000000 --- a/node_modules/.bin/browserslist +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") - -case `uname` in - *CYGWIN*|*MINGW*|*MSYS*) - if command -v cygpath > /dev/null 2>&1; then - basedir=`cygpath -w "$basedir"` - fi - ;; -esac - -if [ -x "$basedir/node" ]; then - exec "$basedir/node" "$basedir/../browserslist/cli.js" "$@" -else - exec node "$basedir/../browserslist/cli.js" "$@" -fi diff --git a/node_modules/.bin/browserslist b/node_modules/.bin/browserslist new file mode 120000 index 000000000..3cd991b25 --- /dev/null +++ b/node_modules/.bin/browserslist @@ -0,0 +1 @@ +../browserslist/cli.js \ No newline at end of file diff --git a/node_modules/.bin/browserslist.cmd b/node_modules/.bin/browserslist.cmd deleted file mode 100644 index f93c251ea..000000000 --- a/node_modules/.bin/browserslist.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%\..\browserslist\cli.js" %* diff --git a/node_modules/.bin/browserslist.ps1 b/node_modules/.bin/browserslist.ps1 deleted file mode 100644 index 01e10a08b..000000000 --- a/node_modules/.bin/browserslist.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/../browserslist/cli.js" $args - } else { - & "$basedir/node$exe" "$basedir/../browserslist/cli.js" $args - } - $ret=$LASTEXITCODE -} else { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "node$exe" "$basedir/../browserslist/cli.js" $args - } else { - & "node$exe" "$basedir/../browserslist/cli.js" $args - } - $ret=$LASTEXITCODE -} -exit $ret diff --git a/node_modules/.bin/conc b/node_modules/.bin/conc deleted file mode 100644 index 1333ac0d6..000000000 --- a/node_modules/.bin/conc +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") - -case `uname` in - *CYGWIN*|*MINGW*|*MSYS*) - if command -v cygpath > /dev/null 2>&1; then - basedir=`cygpath -w "$basedir"` - fi - ;; -esac - -if [ -x "$basedir/node" ]; then - exec "$basedir/node" "$basedir/../concurrently/dist/bin/concurrently.js" "$@" -else - exec node "$basedir/../concurrently/dist/bin/concurrently.js" "$@" -fi diff --git a/node_modules/.bin/conc b/node_modules/.bin/conc new file mode 120000 index 000000000..e9da68781 --- /dev/null +++ b/node_modules/.bin/conc @@ -0,0 +1 @@ +../concurrently/dist/bin/concurrently.js \ No newline at end of file diff --git a/node_modules/.bin/conc.cmd b/node_modules/.bin/conc.cmd deleted file mode 100644 index 3bf6fba12..000000000 --- a/node_modules/.bin/conc.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%\..\concurrently\dist\bin\concurrently.js" %* diff --git a/node_modules/.bin/conc.ps1 b/node_modules/.bin/conc.ps1 deleted file mode 100644 index 4ca0e5d14..000000000 --- a/node_modules/.bin/conc.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/../concurrently/dist/bin/concurrently.js" $args - } else { - & "$basedir/node$exe" "$basedir/../concurrently/dist/bin/concurrently.js" $args - } - $ret=$LASTEXITCODE -} else { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "node$exe" "$basedir/../concurrently/dist/bin/concurrently.js" $args - } else { - & "node$exe" "$basedir/../concurrently/dist/bin/concurrently.js" $args - } - $ret=$LASTEXITCODE -} -exit $ret diff --git a/node_modules/.bin/concurrently b/node_modules/.bin/concurrently deleted file mode 100644 index 1333ac0d6..000000000 --- a/node_modules/.bin/concurrently +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") - -case `uname` in - *CYGWIN*|*MINGW*|*MSYS*) - if command -v cygpath > /dev/null 2>&1; then - basedir=`cygpath -w "$basedir"` - fi - ;; -esac - -if [ -x "$basedir/node" ]; then - exec "$basedir/node" "$basedir/../concurrently/dist/bin/concurrently.js" "$@" -else - exec node "$basedir/../concurrently/dist/bin/concurrently.js" "$@" -fi diff --git a/node_modules/.bin/concurrently b/node_modules/.bin/concurrently new file mode 120000 index 000000000..e9da68781 --- /dev/null +++ b/node_modules/.bin/concurrently @@ -0,0 +1 @@ +../concurrently/dist/bin/concurrently.js \ No newline at end of file diff --git a/node_modules/.bin/concurrently.cmd b/node_modules/.bin/concurrently.cmd deleted file mode 100644 index 3bf6fba12..000000000 --- a/node_modules/.bin/concurrently.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%\..\concurrently\dist\bin\concurrently.js" %* diff --git a/node_modules/.bin/concurrently.ps1 b/node_modules/.bin/concurrently.ps1 deleted file mode 100644 index 4ca0e5d14..000000000 --- a/node_modules/.bin/concurrently.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/../concurrently/dist/bin/concurrently.js" $args - } else { - & "$basedir/node$exe" "$basedir/../concurrently/dist/bin/concurrently.js" $args - } - $ret=$LASTEXITCODE -} else { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "node$exe" "$basedir/../concurrently/dist/bin/concurrently.js" $args - } else { - & "node$exe" "$basedir/../concurrently/dist/bin/concurrently.js" $args - } - $ret=$LASTEXITCODE -} -exit $ret diff --git a/node_modules/.bin/create-jest b/node_modules/.bin/create-jest deleted file mode 100644 index 162092d7d..000000000 --- a/node_modules/.bin/create-jest +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") - -case `uname` in - *CYGWIN*|*MINGW*|*MSYS*) - if command -v cygpath > /dev/null 2>&1; then - basedir=`cygpath -w "$basedir"` - fi - ;; -esac - -if [ -x "$basedir/node" ]; then - exec "$basedir/node" "$basedir/../create-jest/bin/create-jest.js" "$@" -else - exec node "$basedir/../create-jest/bin/create-jest.js" "$@" -fi diff --git a/node_modules/.bin/create-jest b/node_modules/.bin/create-jest new file mode 120000 index 000000000..8d6301e0f --- /dev/null +++ b/node_modules/.bin/create-jest @@ -0,0 +1 @@ +../create-jest/bin/create-jest.js \ No newline at end of file diff --git a/node_modules/.bin/create-jest.cmd b/node_modules/.bin/create-jest.cmd deleted file mode 100644 index 585d1037b..000000000 --- a/node_modules/.bin/create-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%\..\create-jest\bin\create-jest.js" %* diff --git a/node_modules/.bin/create-jest.ps1 b/node_modules/.bin/create-jest.ps1 deleted file mode 100644 index cf4288c30..000000000 --- a/node_modules/.bin/create-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/../create-jest/bin/create-jest.js" $args - } else { - & "$basedir/node$exe" "$basedir/../create-jest/bin/create-jest.js" $args - } - $ret=$LASTEXITCODE -} else { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "node$exe" "$basedir/../create-jest/bin/create-jest.js" $args - } else { - & "node$exe" "$basedir/../create-jest/bin/create-jest.js" $args - } - $ret=$LASTEXITCODE -} -exit $ret diff --git a/node_modules/.bin/escodegen b/node_modules/.bin/escodegen deleted file mode 100644 index 1dbc1f020..000000000 --- a/node_modules/.bin/escodegen +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") - -case `uname` in - *CYGWIN*|*MINGW*|*MSYS*) - if command -v cygpath > /dev/null 2>&1; then - basedir=`cygpath -w "$basedir"` - fi - ;; -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 8633c7456..000000000 --- a/node_modules/.bin/esgenerate +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") - -case `uname` in - *CYGWIN*|*MINGW*|*MSYS*) - if command -v cygpath > /dev/null 2>&1; then - basedir=`cygpath -w "$basedir"` - fi - ;; -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 601762cef..000000000 --- a/node_modules/.bin/esparse +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") - -case `uname` in - *CYGWIN*|*MINGW*|*MSYS*) - if command -v cygpath > /dev/null 2>&1; then - basedir=`cygpath -w "$basedir"` - fi - ;; -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 e2fee1f12..000000000 --- a/node_modules/.bin/esvalidate +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") - -case `uname` in - *CYGWIN*|*MINGW*|*MSYS*) - if command -v cygpath > /dev/null 2>&1; then - basedir=`cygpath -w "$basedir"` - fi - ;; -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 3a654413a..000000000 --- a/node_modules/.bin/import-local-fixture +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") - -case `uname` in - *CYGWIN*|*MINGW*|*MSYS*) - if command -v cygpath > /dev/null 2>&1; then - basedir=`cygpath -w "$basedir"` - fi - ;; -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/jest b/node_modules/.bin/jest deleted file mode 100644 index 61b6f565e..000000000 --- a/node_modules/.bin/jest +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") - -case `uname` in - *CYGWIN*|*MINGW*|*MSYS*) - if command -v cygpath > /dev/null 2>&1; then - basedir=`cygpath -w "$basedir"` - fi - ;; -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.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 82416ef1f..000000000 --- a/node_modules/.bin/js-yaml +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") - -case `uname` in - *CYGWIN*|*MINGW*|*MSYS*) - if command -v cygpath > /dev/null 2>&1; then - basedir=`cygpath -w "$basedir"` - fi - ;; -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 879c41331..000000000 --- a/node_modules/.bin/jsesc +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") - -case `uname` in - *CYGWIN*|*MINGW*|*MSYS*) - if command -v cygpath > /dev/null 2>&1; then - basedir=`cygpath -w "$basedir"` - fi - ;; -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 abf72a4ec..000000000 --- a/node_modules/.bin/json5 +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") - -case `uname` in - *CYGWIN*|*MINGW*|*MSYS*) - if command -v cygpath > /dev/null 2>&1; then - basedir=`cygpath -w "$basedir"` - fi - ;; -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/loose-envify b/node_modules/.bin/loose-envify deleted file mode 100644 index 076f91b17..000000000 --- a/node_modules/.bin/loose-envify +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") - -case `uname` in - *CYGWIN*|*MINGW*|*MSYS*) - if command -v cygpath > /dev/null 2>&1; then - basedir=`cygpath -w "$basedir"` - fi - ;; -esac - -if [ -x "$basedir/node" ]; then - exec "$basedir/node" "$basedir/../loose-envify/cli.js" "$@" -else - exec node "$basedir/../loose-envify/cli.js" "$@" -fi diff --git a/node_modules/.bin/loose-envify b/node_modules/.bin/loose-envify new file mode 120000 index 000000000..ed9009c5a --- /dev/null +++ b/node_modules/.bin/loose-envify @@ -0,0 +1 @@ +../loose-envify/cli.js \ No newline at end of file diff --git a/node_modules/.bin/loose-envify.cmd b/node_modules/.bin/loose-envify.cmd deleted file mode 100644 index 599576f93..000000000 --- a/node_modules/.bin/loose-envify.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%\..\loose-envify\cli.js" %* diff --git a/node_modules/.bin/loose-envify.ps1 b/node_modules/.bin/loose-envify.ps1 deleted file mode 100644 index eb866fcaf..000000000 --- a/node_modules/.bin/loose-envify.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/../loose-envify/cli.js" $args - } else { - & "$basedir/node$exe" "$basedir/../loose-envify/cli.js" $args - } - $ret=$LASTEXITCODE -} else { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "node$exe" "$basedir/../loose-envify/cli.js" $args - } else { - & "node$exe" "$basedir/../loose-envify/cli.js" $args - } - $ret=$LASTEXITCODE -} -exit $ret diff --git a/node_modules/.bin/lz-string b/node_modules/.bin/lz-string deleted file mode 100644 index 4d961b0a5..000000000 --- a/node_modules/.bin/lz-string +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") - -case `uname` in - *CYGWIN*|*MINGW*|*MSYS*) - if command -v cygpath > /dev/null 2>&1; then - basedir=`cygpath -w "$basedir"` - fi - ;; -esac - -if [ -x "$basedir/node" ]; then - exec "$basedir/node" "$basedir/../lz-string/bin/bin.js" "$@" -else - exec node "$basedir/../lz-string/bin/bin.js" "$@" -fi diff --git a/node_modules/.bin/lz-string b/node_modules/.bin/lz-string new file mode 120000 index 000000000..14bd70d2d --- /dev/null +++ b/node_modules/.bin/lz-string @@ -0,0 +1 @@ +../lz-string/bin/bin.js \ No newline at end of file diff --git a/node_modules/.bin/lz-string.cmd b/node_modules/.bin/lz-string.cmd deleted file mode 100644 index 3314abc30..000000000 --- a/node_modules/.bin/lz-string.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%\..\lz-string\bin\bin.js" %* diff --git a/node_modules/.bin/lz-string.ps1 b/node_modules/.bin/lz-string.ps1 deleted file mode 100644 index aadcc3484..000000000 --- a/node_modules/.bin/lz-string.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/../lz-string/bin/bin.js" $args - } else { - & "$basedir/node$exe" "$basedir/../lz-string/bin/bin.js" $args - } - $ret=$LASTEXITCODE -} else { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "node$exe" "$basedir/../lz-string/bin/bin.js" $args - } else { - & "node$exe" "$basedir/../lz-string/bin/bin.js" $args - } - $ret=$LASTEXITCODE -} -exit $ret diff --git a/node_modules/.bin/mime b/node_modules/.bin/mime deleted file mode 100644 index 7751de3cb..000000000 --- a/node_modules/.bin/mime +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") - -case `uname` in - *CYGWIN*|*MINGW*|*MSYS*) - if command -v cygpath > /dev/null 2>&1; then - basedir=`cygpath -w "$basedir"` - fi - ;; -esac - -if [ -x "$basedir/node" ]; then - exec "$basedir/node" "$basedir/../mime/cli.js" "$@" -else - exec node "$basedir/../mime/cli.js" "$@" -fi diff --git a/node_modules/.bin/mime b/node_modules/.bin/mime new file mode 120000 index 000000000..fbb7ee0ee --- /dev/null +++ b/node_modules/.bin/mime @@ -0,0 +1 @@ +../mime/cli.js \ No newline at end of file diff --git a/node_modules/.bin/mime.cmd b/node_modules/.bin/mime.cmd deleted file mode 100644 index 54491f12e..000000000 --- a/node_modules/.bin/mime.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%\..\mime\cli.js" %* diff --git a/node_modules/.bin/mime.ps1 b/node_modules/.bin/mime.ps1 deleted file mode 100644 index 2222f40bc..000000000 --- a/node_modules/.bin/mime.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/../mime/cli.js" $args - } else { - & "$basedir/node$exe" "$basedir/../mime/cli.js" $args - } - $ret=$LASTEXITCODE -} else { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "node$exe" "$basedir/../mime/cli.js" $args - } else { - & "node$exe" "$basedir/../mime/cli.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 b49b03f7d..000000000 --- a/node_modules/.bin/node-which +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") - -case `uname` in - *CYGWIN*|*MINGW*|*MSYS*) - if command -v cygpath > /dev/null 2>&1; then - basedir=`cygpath -w "$basedir"` - fi - ;; -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/nodemon b/node_modules/.bin/nodemon deleted file mode 100644 index c477a1898..000000000 --- a/node_modules/.bin/nodemon +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") - -case `uname` in - *CYGWIN*|*MINGW*|*MSYS*) - if command -v cygpath > /dev/null 2>&1; then - basedir=`cygpath -w "$basedir"` - fi - ;; -esac - -if [ -x "$basedir/node" ]; then - exec "$basedir/node" "$basedir/../nodemon/bin/nodemon.js" "$@" -else - exec node "$basedir/../nodemon/bin/nodemon.js" "$@" -fi diff --git a/node_modules/.bin/nodemon b/node_modules/.bin/nodemon new file mode 120000 index 000000000..1056ddc18 --- /dev/null +++ b/node_modules/.bin/nodemon @@ -0,0 +1 @@ +../nodemon/bin/nodemon.js \ No newline at end of file diff --git a/node_modules/.bin/nodemon.cmd b/node_modules/.bin/nodemon.cmd deleted file mode 100644 index 55acf8a4e..000000000 --- a/node_modules/.bin/nodemon.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%\..\nodemon\bin\nodemon.js" %* diff --git a/node_modules/.bin/nodemon.ps1 b/node_modules/.bin/nodemon.ps1 deleted file mode 100644 index d4e3f5d40..000000000 --- a/node_modules/.bin/nodemon.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/../nodemon/bin/nodemon.js" $args - } else { - & "$basedir/node$exe" "$basedir/../nodemon/bin/nodemon.js" $args - } - $ret=$LASTEXITCODE -} else { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "node$exe" "$basedir/../nodemon/bin/nodemon.js" $args - } else { - & "node$exe" "$basedir/../nodemon/bin/nodemon.js" $args - } - $ret=$LASTEXITCODE -} -exit $ret diff --git a/node_modules/.bin/nodetouch b/node_modules/.bin/nodetouch deleted file mode 100644 index 3e146b413..000000000 --- a/node_modules/.bin/nodetouch +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") - -case `uname` in - *CYGWIN*|*MINGW*|*MSYS*) - if command -v cygpath > /dev/null 2>&1; then - basedir=`cygpath -w "$basedir"` - fi - ;; -esac - -if [ -x "$basedir/node" ]; then - exec "$basedir/node" "$basedir/../touch/bin/nodetouch.js" "$@" -else - exec node "$basedir/../touch/bin/nodetouch.js" "$@" -fi diff --git a/node_modules/.bin/nodetouch b/node_modules/.bin/nodetouch new file mode 120000 index 000000000..3409fdb78 --- /dev/null +++ b/node_modules/.bin/nodetouch @@ -0,0 +1 @@ +../touch/bin/nodetouch.js \ No newline at end of file diff --git a/node_modules/.bin/nodetouch.cmd b/node_modules/.bin/nodetouch.cmd deleted file mode 100644 index 8298b9183..000000000 --- a/node_modules/.bin/nodetouch.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%\..\touch\bin\nodetouch.js" %* diff --git a/node_modules/.bin/nodetouch.ps1 b/node_modules/.bin/nodetouch.ps1 deleted file mode 100644 index 5f68b4cb3..000000000 --- a/node_modules/.bin/nodetouch.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/../touch/bin/nodetouch.js" $args - } else { - & "$basedir/node$exe" "$basedir/../touch/bin/nodetouch.js" $args - } - $ret=$LASTEXITCODE -} else { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "node$exe" "$basedir/../touch/bin/nodetouch.js" $args - } else { - & "node$exe" "$basedir/../touch/bin/nodetouch.js" $args - } - $ret=$LASTEXITCODE -} -exit $ret diff --git a/node_modules/.bin/nopt b/node_modules/.bin/nopt deleted file mode 100644 index 0808130fb..000000000 --- a/node_modules/.bin/nopt +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") - -case `uname` in - *CYGWIN*|*MINGW*|*MSYS*) - if command -v cygpath > /dev/null 2>&1; then - basedir=`cygpath -w "$basedir"` - fi - ;; -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 7696ad41d..000000000 --- a/node_modules/.bin/parser +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") - -case `uname` in - *CYGWIN*|*MINGW*|*MSYS*) - if command -v cygpath > /dev/null 2>&1; then - basedir=`cygpath -w "$basedir"` - fi - ;; -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/regjsparser b/node_modules/.bin/regjsparser deleted file mode 100644 index 3e923c7a5..000000000 --- a/node_modules/.bin/regjsparser +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") - -case `uname` in - *CYGWIN*|*MINGW*|*MSYS*) - if command -v cygpath > /dev/null 2>&1; then - basedir=`cygpath -w "$basedir"` - fi - ;; -esac - -if [ -x "$basedir/node" ]; then - exec "$basedir/node" "$basedir/../regjsparser/bin/parser" "$@" -else - exec node "$basedir/../regjsparser/bin/parser" "$@" -fi diff --git a/node_modules/.bin/regjsparser b/node_modules/.bin/regjsparser new file mode 120000 index 000000000..91cec777d --- /dev/null +++ b/node_modules/.bin/regjsparser @@ -0,0 +1 @@ +../regjsparser/bin/parser \ No newline at end of file diff --git a/node_modules/.bin/regjsparser.cmd b/node_modules/.bin/regjsparser.cmd deleted file mode 100644 index 36b5e78da..000000000 --- a/node_modules/.bin/regjsparser.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%\..\regjsparser\bin\parser" %* diff --git a/node_modules/.bin/regjsparser.ps1 b/node_modules/.bin/regjsparser.ps1 deleted file mode 100644 index 7d45ef7d5..000000000 --- a/node_modules/.bin/regjsparser.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/../regjsparser/bin/parser" $args - } else { - & "$basedir/node$exe" "$basedir/../regjsparser/bin/parser" $args - } - $ret=$LASTEXITCODE -} else { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "node$exe" "$basedir/../regjsparser/bin/parser" $args - } else { - & "node$exe" "$basedir/../regjsparser/bin/parser" $args - } - $ret=$LASTEXITCODE -} -exit $ret diff --git a/node_modules/.bin/resolve b/node_modules/.bin/resolve deleted file mode 100644 index c043cba00..000000000 --- a/node_modules/.bin/resolve +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") - -case `uname` in - *CYGWIN*|*MINGW*|*MSYS*) - if command -v cygpath > /dev/null 2>&1; then - basedir=`cygpath -w "$basedir"` - fi - ;; -esac - -if [ -x "$basedir/node" ]; then - exec "$basedir/node" "$basedir/../resolve/bin/resolve" "$@" -else - exec node "$basedir/../resolve/bin/resolve" "$@" -fi diff --git a/node_modules/.bin/resolve b/node_modules/.bin/resolve new file mode 120000 index 000000000..b6afda6c7 --- /dev/null +++ b/node_modules/.bin/resolve @@ -0,0 +1 @@ +../resolve/bin/resolve \ No newline at end of file diff --git a/node_modules/.bin/resolve.cmd b/node_modules/.bin/resolve.cmd deleted file mode 100644 index 1a017c403..000000000 --- a/node_modules/.bin/resolve.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%\..\resolve\bin\resolve" %* diff --git a/node_modules/.bin/resolve.ps1 b/node_modules/.bin/resolve.ps1 deleted file mode 100644 index f22b2d317..000000000 --- a/node_modules/.bin/resolve.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/../resolve/bin/resolve" $args - } else { - & "$basedir/node$exe" "$basedir/../resolve/bin/resolve" $args - } - $ret=$LASTEXITCODE -} else { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "node$exe" "$basedir/../resolve/bin/resolve" $args - } else { - & "node$exe" "$basedir/../resolve/bin/resolve" $args - } - $ret=$LASTEXITCODE -} -exit $ret diff --git a/node_modules/.bin/semver b/node_modules/.bin/semver deleted file mode 100644 index 97c53279f..000000000 --- a/node_modules/.bin/semver +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") - -case `uname` in - *CYGWIN*|*MINGW*|*MSYS*) - if command -v cygpath > /dev/null 2>&1; then - basedir=`cygpath -w "$basedir"` - fi - ;; -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/tree-kill b/node_modules/.bin/tree-kill deleted file mode 100644 index 6bcf984e6..000000000 --- a/node_modules/.bin/tree-kill +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") - -case `uname` in - *CYGWIN*|*MINGW*|*MSYS*) - if command -v cygpath > /dev/null 2>&1; then - basedir=`cygpath -w "$basedir"` - fi - ;; -esac - -if [ -x "$basedir/node" ]; then - exec "$basedir/node" "$basedir/../tree-kill/cli.js" "$@" -else - exec node "$basedir/../tree-kill/cli.js" "$@" -fi diff --git a/node_modules/.bin/tree-kill b/node_modules/.bin/tree-kill new file mode 120000 index 000000000..26dcd2c05 --- /dev/null +++ b/node_modules/.bin/tree-kill @@ -0,0 +1 @@ +../tree-kill/cli.js \ No newline at end of file diff --git a/node_modules/.bin/tree-kill.cmd b/node_modules/.bin/tree-kill.cmd deleted file mode 100644 index dcb9aa69d..000000000 --- a/node_modules/.bin/tree-kill.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%\..\tree-kill\cli.js" %* diff --git a/node_modules/.bin/tree-kill.ps1 b/node_modules/.bin/tree-kill.ps1 deleted file mode 100644 index 61d62ddb8..000000000 --- a/node_modules/.bin/tree-kill.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/../tree-kill/cli.js" $args - } else { - & "$basedir/node$exe" "$basedir/../tree-kill/cli.js" $args - } - $ret=$LASTEXITCODE -} else { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "node$exe" "$basedir/../tree-kill/cli.js" $args - } else { - & "node$exe" "$basedir/../tree-kill/cli.js" $args - } - $ret=$LASTEXITCODE -} -exit $ret diff --git a/node_modules/.bin/update-browserslist-db b/node_modules/.bin/update-browserslist-db deleted file mode 100644 index cced63c46..000000000 --- a/node_modules/.bin/update-browserslist-db +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") - -case `uname` in - *CYGWIN*|*MINGW*|*MSYS*) - if command -v cygpath > /dev/null 2>&1; then - basedir=`cygpath -w "$basedir"` - fi - ;; -esac - -if [ -x "$basedir/node" ]; then - exec "$basedir/node" "$basedir/../update-browserslist-db/cli.js" "$@" -else - exec node "$basedir/../update-browserslist-db/cli.js" "$@" -fi diff --git a/node_modules/.bin/update-browserslist-db b/node_modules/.bin/update-browserslist-db new file mode 120000 index 000000000..b11e16f3d --- /dev/null +++ b/node_modules/.bin/update-browserslist-db @@ -0,0 +1 @@ +../update-browserslist-db/cli.js \ No newline at end of file diff --git a/node_modules/.bin/update-browserslist-db.cmd b/node_modules/.bin/update-browserslist-db.cmd deleted file mode 100644 index 2e14905fb..000000000 --- a/node_modules/.bin/update-browserslist-db.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%\..\update-browserslist-db\cli.js" %* diff --git a/node_modules/.bin/update-browserslist-db.ps1 b/node_modules/.bin/update-browserslist-db.ps1 deleted file mode 100644 index 7abdf26da..000000000 --- a/node_modules/.bin/update-browserslist-db.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/../update-browserslist-db/cli.js" $args - } else { - & "$basedir/node$exe" "$basedir/../update-browserslist-db/cli.js" $args - } - $ret=$LASTEXITCODE -} else { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "node$exe" "$basedir/../update-browserslist-db/cli.js" $args - } else { - & "node$exe" "$basedir/../update-browserslist-db/cli.js" $args - } - $ret=$LASTEXITCODE -} -exit $ret diff --git a/node_modules/.bin/uuid b/node_modules/.bin/uuid deleted file mode 100644 index 5ba3622df..000000000 --- a/node_modules/.bin/uuid +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") - -case `uname` in - *CYGWIN*|*MINGW*|*MSYS*) - if command -v cygpath > /dev/null 2>&1; then - basedir=`cygpath -w "$basedir"` - fi - ;; -esac - -if [ -x "$basedir/node" ]; then - exec "$basedir/node" "$basedir/../node-uuid/bin/uuid" "$@" -else - exec node "$basedir/../node-uuid/bin/uuid" "$@" -fi diff --git a/node_modules/.bin/uuid b/node_modules/.bin/uuid new file mode 120000 index 000000000..80eb14aa1 --- /dev/null +++ b/node_modules/.bin/uuid @@ -0,0 +1 @@ +../node-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 ed2b59e40..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%\..\node-uuid\bin\uuid" %* diff --git a/node_modules/.bin/uuid.ps1 b/node_modules/.bin/uuid.ps1 deleted file mode 100644 index 572b713cb..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/../node-uuid/bin/uuid" $args - } else { - & "$basedir/node$exe" "$basedir/../node-uuid/bin/uuid" $args - } - $ret=$LASTEXITCODE -} else { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "node$exe" "$basedir/../node-uuid/bin/uuid" $args - } else { - & "node$exe" "$basedir/../node-uuid/bin/uuid" $args - } - $ret=$LASTEXITCODE -} -exit $ret diff --git a/node_modules/.package-lock.json b/node_modules/.package-lock.json index 359a15ada..640406b00 100644 --- a/node_modules/.package-lock.json +++ b/node_modules/.package-lock.json @@ -4691,6 +4691,20 @@ "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", "dev": true }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, "node_modules/function-bind": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", diff --git a/node_modules/@babel/code-frame/node_modules/color-name/.npmignore b/node_modules/@babel/code-frame/node_modules/color-name/.npmignore index 3854c07dc..f9f281648 100644 --- a/node_modules/@babel/code-frame/node_modules/color-name/.npmignore +++ b/node_modules/@babel/code-frame/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/code-frame/node_modules/color-name/LICENSE b/node_modules/@babel/code-frame/node_modules/color-name/LICENSE index 4d9802a89..c6b100125 100644 --- a/node_modules/@babel/code-frame/node_modules/color-name/LICENSE +++ b/node_modules/@babel/code-frame/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/code-frame/node_modules/color-name/README.md b/node_modules/@babel/code-frame/node_modules/color-name/README.md index 3611a6b52..932b97917 100644 --- a/node_modules/@babel/code-frame/node_modules/color-name/README.md +++ b/node_modules/@babel/code-frame/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/code-frame/node_modules/color-name/index.js b/node_modules/@babel/code-frame/node_modules/color-name/index.js index e42aa68a5..b7c198a6f 100644 --- a/node_modules/@babel/code-frame/node_modules/color-name/index.js +++ b/node_modules/@babel/code-frame/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/code-frame/node_modules/color-name/test.js b/node_modules/@babel/code-frame/node_modules/color-name/test.js index 7a0874621..6e6bf30bc 100644 --- a/node_modules/@babel/code-frame/node_modules/color-name/test.js +++ b/node_modules/@babel/code-frame/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/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/@sinclair/typebox/license b/node_modules/@sinclair/typebox/license index 08641fd64..1aa539806 100644 --- a/node_modules/@sinclair/typebox/license +++ b/node_modules/@sinclair/typebox/license @@ -1,23 +1,23 @@ -TypeBox: JSON Schema Type Builder with Static Type Resolution for TypeScript - -The MIT License (MIT) - -Copyright (c) 2017-2023 Haydn Paterson (sinclair) - -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 +TypeBox: JSON Schema Type Builder with Static Type Resolution for TypeScript + +The MIT License (MIT) + +Copyright (c) 2017-2023 Haydn Paterson (sinclair) + +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/@sinclair/typebox/package.json b/node_modules/@sinclair/typebox/package.json index eeff01d95..fff6589ec 100644 --- a/node_modules/@sinclair/typebox/package.json +++ b/node_modules/@sinclair/typebox/package.json @@ -1,47 +1,47 @@ -{ - "name": "@sinclair/typebox", - "version": "0.27.8", - "description": "JSONSchema Type Builder with Static Type Resolution for TypeScript", - "keywords": [ - "typescript", - "json-schema", - "validate", - "typecheck" - ], - "author": "sinclairzx81", - "license": "MIT", - "main": "./typebox.js", - "types": "./typebox.d.ts", - "exports": { - "./compiler": "./compiler/index.js", - "./errors": "./errors/index.js", - "./system": "./system/index.js", - "./value": "./value/index.js", - ".": "./typebox.js" - }, - "repository": { - "type": "git", - "url": "https://github.com/sinclairzx81/typebox" - }, - "scripts": { - "clean": "hammer task clean", - "format": "hammer task format", - "start": "hammer task start", - "test": "hammer task test", - "benchmark": "hammer task benchmark", - "build": "hammer task build", - "publish": "hammer task publish" - }, - "devDependencies": { - "@sinclair/hammer": "^0.17.1", - "@types/chai": "^4.3.3", - "@types/mocha": "^9.1.1", - "@types/node": "^18.11.9", - "ajv": "^8.12.0", - "ajv-formats": "^2.1.1", - "chai": "^4.3.6", - "mocha": "^9.2.2", - "prettier": "^2.7.1", - "typescript": "^5.0.2" - } -} +{ + "name": "@sinclair/typebox", + "version": "0.27.8", + "description": "JSONSchema Type Builder with Static Type Resolution for TypeScript", + "keywords": [ + "typescript", + "json-schema", + "validate", + "typecheck" + ], + "author": "sinclairzx81", + "license": "MIT", + "main": "./typebox.js", + "types": "./typebox.d.ts", + "exports": { + "./compiler": "./compiler/index.js", + "./errors": "./errors/index.js", + "./system": "./system/index.js", + "./value": "./value/index.js", + ".": "./typebox.js" + }, + "repository": { + "type": "git", + "url": "https://github.com/sinclairzx81/typebox" + }, + "scripts": { + "clean": "hammer task clean", + "format": "hammer task format", + "start": "hammer task start", + "test": "hammer task test", + "benchmark": "hammer task benchmark", + "build": "hammer task build", + "publish": "hammer task publish" + }, + "devDependencies": { + "@sinclair/hammer": "^0.17.1", + "@types/chai": "^4.3.3", + "@types/mocha": "^9.1.1", + "@types/node": "^18.11.9", + "ajv": "^8.12.0", + "ajv-formats": "^2.1.1", + "chai": "^4.3.6", + "mocha": "^9.2.2", + "prettier": "^2.7.1", + "typescript": "^5.0.2" + } +} diff --git a/node_modules/@sinclair/typebox/readme.md b/node_modules/@sinclair/typebox/readme.md index c5120a9d5..8e71d68d6 100644 --- a/node_modules/@sinclair/typebox/readme.md +++ b/node_modules/@sinclair/typebox/readme.md @@ -1,1424 +1,1424 @@ -
- -

TypeBox

- -

JSON Schema Type Builder with Static Type Resolution for TypeScript

- - - -
-
- -[![npm version](https://badge.fury.io/js/%40sinclair%2Ftypebox.svg)](https://badge.fury.io/js/%40sinclair%2Ftypebox) -[![Downloads](https://img.shields.io/npm/dm/%40sinclair%2Ftypebox.svg)](https://www.npmjs.com/package/%40sinclair%2Ftypebox) -[![GitHub CI](https://github.com/sinclairzx81/typebox/workflows/GitHub%20CI/badge.svg)](https://github.com/sinclairzx81/typebox/actions) - -
- - - -## Install - -#### Npm -```bash -$ npm install @sinclair/typebox --save -``` - -#### Deno -```typescript -import { Static, Type } from 'npm:@sinclair/typebox' -``` - -#### Esm - -```typescript -import { Static, Type } from 'https://esm.sh/@sinclair/typebox' -``` - -## Example - -```typescript -import { Static, Type } from '@sinclair/typebox' - -const T = Type.Object({ // const T = { - x: Type.Number(), // type: 'object', - y: Type.Number(), // required: ['x', 'y', 'z'], - z: Type.Number() // properties: { -}) // x: { type: 'number' }, - // y: { type: 'number' }, - // z: { type: 'number' } - // } - // } - -type T = Static // type T = { - // x: number, - // y: number, - // z: number - // } -``` - - - - -## Overview - -TypeBox is a runtime type builder that creates in-memory JSON Schema objects that can be statically inferred as TypeScript types. The schemas produced by this library are designed to match the static type assertion rules of the TypeScript compiler. TypeBox enables one to create a unified type that can be statically checked by TypeScript and runtime asserted using standard JSON Schema validation. - -This library is designed to enable JSON schema to compose with the same flexibility as TypeScript's type system. It can be used as a simple tool to build up complex schemas or integrated into REST or RPC services to help validate data received over the wire. - -License MIT - -## Contents -- [Install](#install) -- [Overview](#overview) -- [Usage](#usage) -- [Types](#types) - - [Standard](#types-standard) - - [Extended](#types-extended) - - [Modifiers](#types-modifiers) - - [Options](#types-options) - - [Generics](#types-generics) - - [References](#types-references) - - [Recursive](#types-recursive) - - [Conditional](#types-conditional) - - [Template Literal](#types-template-literal) - - [Guards](#types-guards) - - [Unsafe](#types-unsafe) - - [Strict](#types-strict) -- [Values](#values) - - [Create](#values-create) - - [Clone](#values-clone) - - [Check](#values-check) - - [Convert](#values-convert) - - [Cast](#values-cast) - - [Equal](#values-equal) - - [Hash](#values-hash) - - [Diff](#values-diff) - - [Patch](#values-patch) - - [Errors](#values-errors) - - [Mutate](#values-mutate) - - [Pointer](#values-pointer) -- [TypeCheck](#typecheck) - - [Ajv](#typecheck-ajv) - - [TypeCompiler](#typecheck-typecompiler) -- [TypeSystem](#typesystem) - - [Types](#typesystem-types) - - [Formats](#typesystem-formats) - - [Policies](#typesystem-policies) -- [Benchmark](#benchmark) - - [Compile](#benchmark-compile) - - [Validate](#benchmark-validate) - - [Compression](#benchmark-compression) -- [Contribute](#contribute) - - - -## Usage - -The following shows general usage. - -```typescript -import { Static, Type } from '@sinclair/typebox' - -//-------------------------------------------------------------------------------------------- -// -// Let's say you have the following type ... -// -//-------------------------------------------------------------------------------------------- - -type T = { - id: string, - name: string, - timestamp: number -} - -//-------------------------------------------------------------------------------------------- -// -// ... you can express this type in the following way. -// -//-------------------------------------------------------------------------------------------- - -const T = Type.Object({ // const T = { - id: Type.String(), // type: 'object', - name: Type.String(), // properties: { - timestamp: Type.Integer() // id: { -}) // type: 'string' - // }, - // name: { - // type: 'string' - // }, - // timestamp: { - // type: 'integer' - // } - // }, - // required: [ - // 'id', - // 'name', - // 'timestamp' - // ] - // } - -//-------------------------------------------------------------------------------------------- -// -// ... then infer back to the original static type this way. -// -//-------------------------------------------------------------------------------------------- - -type T = Static // type T = { - // id: string, - // name: string, - // timestamp: number - // } - -//-------------------------------------------------------------------------------------------- -// -// ... then use the type both as JSON schema and as a TypeScript type. -// -//-------------------------------------------------------------------------------------------- - -import { Value } from '@sinclair/typebox/value' - -function receive(value: T) { // ... as a Static Type - - if(Value.Check(T, value)) { // ... as a JSON Schema - - // ok... - } -} -``` - - - -## Types - -TypeBox types are JSON schema fragments that can be composed into more complex types. Each fragment is structured such that a JSON schema compliant validator can runtime assert a value the same way TypeScript will statically assert a type. TypeBox provides a set of Standard types which are used create JSON schema compliant schematics as well as an Extended type set used to create schematics for constructs native to JavaScript. - - - -### Standard Types - -The following table lists the Standard TypeBox types. These types are fully compatible with the JSON Schema Draft 6 specification. - -```typescript -┌────────────────────────────────┬─────────────────────────────┬────────────────────────────────┐ -│ TypeBox │ TypeScript │ JSON Schema │ -│ │ │ │ -├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤ -│ const T = Type.Any() │ type T = any │ const T = { } │ -│ │ │ │ -├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤ -│ const T = Type.Unknown() │ type T = unknown │ const T = { } │ -│ │ │ │ -├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤ -│ const T = Type.String() │ type T = string │ const T = { │ -│ │ │ type: 'string' │ -│ │ │ } │ -│ │ │ │ -├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤ -│ const T = Type.Number() │ type T = number │ const T = { │ -│ │ │ type: 'number' │ -│ │ │ } │ -│ │ │ │ -├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤ -│ const T = Type.Integer() │ type T = number │ const T = { │ -│ │ │ type: 'integer' │ -│ │ │ } │ -│ │ │ │ -├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤ -│ const T = Type.Boolean() │ type T = boolean │ const T = { │ -│ │ │ type: 'boolean' │ -│ │ │ } │ -│ │ │ │ -├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤ -│ const T = Type.Null() │ type T = null │ const T = { │ -│ │ │ type: 'null' │ -│ │ │ } │ -│ │ │ │ -├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤ -│ const T = Type.Literal(42) │ type T = 42 │ const T = { │ -│ │ │ const: 42, │ -│ │ │ type: 'number' │ -│ │ │ } │ -│ │ │ │ -├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤ -│ const T = Type.Array( │ type T = number[] │ const T = { │ -│ Type.Number() │ │ type: 'array', │ -│ ) │ │ items: { │ -│ │ │ type: 'number' │ -│ │ │ } │ -│ │ │ } │ -│ │ │ │ -├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤ -│ const T = Type.Object({ │ type T = { │ const T = { │ -│ x: Type.Number(), │ x: number, │ type: 'object', │ -│ y: Type.Number() │ y: number │ required: ['x', 'y'], │ -│ }) │ } │ properties: { │ -│ │ │ x: { │ -│ │ │ type: 'number' │ -│ │ │ }, { │ -│ │ │ type: 'number' │ -│ │ │ } │ -│ │ │ } │ -│ │ │ } │ -│ │ │ │ -├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤ -│ const T = Type.Tuple([ │ type T = [number, number] │ const T = { │ -│ Type.Number(), │ │ type: 'array', │ -│ Type.Number() │ │ items: [{ │ -│ ]) │ │ type: 'number' │ -│ │ │ }, { │ -│ │ │ type: 'number' │ -│ │ │ }], │ -│ │ │ additionalItems: false, │ -│ │ │ minItems: 2, │ -│ │ │ maxItems: 2 │ -│ │ │ } │ -│ │ │ │ -│ │ │ │ -├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤ -│ enum Foo { │ enum Foo { │ const T = { │ -│ A, │ A, │ anyOf: [{ │ -│ B │ B │ type: 'number', │ -│ } │ } │ const: 0 │ -│ │ │ }, { │ -│ const T = Type.Enum(Foo) │ type T = Foo │ type: 'number', │ -│ │ │ const: 1 │ -│ │ │ }] │ -│ │ │ } │ -│ │ │ │ -├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤ -│ const T = Type.KeyOf( │ type T = keyof { │ const T = { │ -│ Type.Object({ │ x: number, │ anyOf: [{ │ -│ x: Type.Number(), │ y: number │ type: 'string', │ -│ y: Type.Number() │ } │ const: 'x' │ -│ }) │ │ }, { │ -│ ) │ │ type: 'string', │ -│ │ │ const: 'y' │ -│ │ │ }] │ -│ │ │ } │ -│ │ │ │ -├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤ -│ const T = Type.Union([ │ type T = string | number │ const T = { │ -│ Type.String(), │ │ anyOf: [{ │ -│ Type.Number() │ │ type: 'string' │ -│ ]) │ │ }, { │ -│ │ │ type: 'number' │ -│ │ │ }] │ -│ │ │ } │ -│ │ │ │ -├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤ -│ const T = Type.Intersect([ │ type T = { │ const T = { │ -│ Type.Object({ │ x: number │ allOf: [{ │ -│ x: Type.Number() │ } & { │ type: 'object', │ -│ }), │ y: number │ required: ['x'], │ -│ Type.Object({ │ } │ properties: { │ -│ y: Type.Number() │ │ x: { │ -│ ]) │ │ type: 'number' │ -│ ]) │ │ } │ -│ │ │ } │ -│ │ │ }, { │ -│ │ │ type: 'object', | -│ │ │ required: ['y'], │ -│ │ │ properties: { │ -│ │ │ y: { │ -│ │ │ type: 'number' │ -│ │ │ } │ -│ │ │ } │ -│ │ │ }] │ -│ │ │ } │ -│ │ │ │ -├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤ -│ const T = Type.Composite([ │ type I = { │ const T = { │ -│ Type.Object({ │ x: number │ type: 'object', │ -│ x: Type.Number() │ } & { │ required: ['x', 'y'], │ -│ }), │ y: number │ properties: { │ -│ Type.Object({ │ } │ x: { │ -│ y: Type.Number() │ │ type: 'number' │ -│ }) │ type T = { │ }, │ -│ ]) │ [K in keyof I]: I[K] │ y: { │ -│ │ } │ type: 'number' │ -│ │ │ } │ -│ │ │ } │ -│ │ │ } │ -│ │ │ │ -├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤ -│ const T = Type.Never() │ type T = never │ const T = { │ -│ │ │ not: {} │ -│ │ │ } │ -│ │ │ │ -├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤ -│ const T = Type.Not( | type T = string │ const T = { │ -| Type.Union([ │ │ allOf: [{ │ -│ Type.Literal('x'), │ │ not: { │ -│ Type.Literal('y'), │ │ anyOf: [ │ -│ Type.Literal('z') │ │ { const: 'x' }, │ -│ ]), │ │ { const: 'y' }, │ -│ Type.String() │ │ { const: 'z' } │ -│ ) │ │ ] │ -│ │ │ } │ -│ │ │ }, { │ -│ │ │ type: 'string' │ -│ │ │ }] │ -│ │ │ } │ -│ │ │ │ -├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤ -│ const T = Type.Extends( │ type T = │ const T = { │ -│ Type.String(), │ string extends number │ const: false, │ -│ Type.Number(), │ true : false │ type: 'boolean' │ -│ Type.Literal(true), │ │ } │ -│ Type.Literal(false) │ │ │ -│ ) │ │ │ -│ │ │ │ -├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤ -│ const T = Type.Extract( │ type T = Extract< │ const T = { │ -│ Type.Union([ │ string | number, │ type: 'string' │ -│ Type.String(), │ string │ } │ -│ Type.Number(), │ > │ │ -│ ]), │ │ │ -│ Type.String() │ │ │ -│ ) │ │ │ -│ │ │ │ -├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤ -│ const T = Type.Exclude( │ type T = Exclude< │ const T = { │ -│ Type.Union([ │ string | number, │ type: 'number' │ -│ Type.String(), │ string │ } │ -│ Type.Number(), │ > │ │ -│ ]), │ │ │ -│ Type.String() │ │ │ -│ ) │ │ │ -│ │ │ │ -├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤ -│ const U = Type.Union([ │ type U = 'open' | 'close' │ const T = { │ -│ Type.Literal('open'), │ │ type: 'string', │ -│ Type.Literal('close') │ type T = `on${U}` │ pattern: '^on(open|close)$' │ -│ ]) │ │ } │ -│ │ │ │ -│ const T = Type │ │ │ -│ .TemplateLiteral([ │ │ │ -│ Type.Literal('on'), │ │ │ -│ U │ │ │ -│ ]) │ │ │ -│ │ │ │ -├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤ -│ const T = Type.Record( │ type T = Record< │ const T = { │ -│ Type.String(), │ string, │ type: 'object', │ -│ Type.Number() │ number │ patternProperties: { │ -│ ) │ > │ '^.*$': { │ -│ │ │ type: 'number' │ -│ │ │ } │ -│ │ │ } │ -│ │ │ } │ -│ │ │ │ -├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤ -│ const T = Type.Partial( │ type T = Partial<{ │ const T = { │ -│ Type.Object({ │ x: number, │ type: 'object', │ -│ x: Type.Number(), │ y: number │ properties: { │ -│ y: Type.Number() | }> │ x: { │ -│ }) │ │ type: 'number' │ -│ ) │ │ }, │ -│ │ │ y: { │ -│ │ │ type: 'number' │ -│ │ │ } │ -│ │ │ } │ -│ │ │ } │ -│ │ │ │ -├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤ -│ const T = Type.Required( │ type T = Required<{ │ const T = { │ -│ Type.Object({ │ x?: number, │ type: 'object', │ -│ x: Type.Optional( │ y?: number │ required: ['x', 'y'], │ -│ Type.Number() | }> │ properties: { │ -│ ), │ │ x: { │ -│ y: Type.Optional( │ │ type: 'number' │ -│ Type.Number() │ │ }, │ -│ ) │ │ y: { │ -│ }) │ │ type: 'number' │ -│ ) │ │ } │ -│ │ │ } │ -│ │ │ } │ -│ │ │ │ -├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤ -│ const T = Type.Pick( │ type T = Pick<{ │ const T = { │ -│ Type.Object({ │ x: number, │ type: 'object', │ -│ x: Type.Number(), │ y: number │ required: ['x'], │ -│ y: Type.Number() │ }, 'x'> │ properties: { │ -│ }), ['x'] | │ x: { │ -│ ) │ │ type: 'number' │ -│ │ │ } │ -│ │ │ } │ -│ │ │ } │ -│ │ │ │ -├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤ -│ const T = Type.Omit( │ type T = Omit<{ │ const T = { │ -│ Type.Object({ │ x: number, │ type: 'object', │ -│ x: Type.Number(), │ y: number │ required: ['y'], │ -│ y: Type.Number() │ }, 'x'> │ properties: { │ -│ }), ['x'] | │ y: { │ -│ ) │ │ type: 'number' │ -│ │ │ } │ -│ │ │ } │ -│ │ │ } │ -│ │ │ │ -├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤ -│ const T = Type.Object({ │ type T = { │ const R = { │ -│ x: Type.Number(), │ x: number, │ $ref: 'T' │ -│ y: Type.Number() │ y: number │ } │ -│ }, { $id: 'T' }) | } │ │ -│ │ │ │ -│ const R = Type.Ref(T) │ type R = T │ │ -│ │ │ │ -│ │ │ │ -│ │ │ │ -│ │ │ │ -└────────────────────────────────┴─────────────────────────────┴────────────────────────────────┘ -``` - - - -### Extended Types - -TypeBox provides several extended types that can be used to produce schematics for common JavaScript constructs. These types can not be used with standard JSON schema validators; but are useful to help frame schematics for RPC interfaces that may receive JSON validated data. Extended types are prefixed with the `[Extended]` doc comment for convenience. The following table lists the supported types. - -```typescript -┌────────────────────────────────┬─────────────────────────────┬────────────────────────────────┐ -│ TypeBox │ TypeScript │ Extended Schema │ -│ │ │ │ -├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤ -│ const T = Type.Constructor([ │ type T = new ( │ const T = { │ -│ Type.String(), │ arg0: string, │ type: 'object', │ -│ Type.Number() │ arg1: number │ instanceOf: 'Constructor', │ -│ ], Type.Boolean()) │ ) => boolean │ parameters: [{ │ -│ │ │ type: 'string' │ -│ │ │ }, { │ -│ │ │ type: 'number' │ -│ │ │ }], │ -│ │ │ return: { │ -│ │ │ type: 'boolean' │ -│ │ │ } │ -│ │ │ } │ -│ │ │ │ -├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤ -│ const T = Type.Function([ │ type T = ( │ const T = { │ -| Type.String(), │ arg0: string, │ type : 'object', │ -│ Type.Number() │ arg1: number │ instanceOf: 'Function', │ -│ ], Type.Boolean()) │ ) => boolean │ parameters: [{ │ -│ │ │ type: 'string' │ -│ │ │ }, { │ -│ │ │ type: 'number' │ -│ │ │ }], │ -│ │ │ return: { │ -│ │ │ type: 'boolean' │ -│ │ │ } │ -│ │ │ } │ -│ │ │ │ -├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤ -│ const T = Type.Promise( │ type T = Promise │ const T = { │ -│ Type.String() │ │ type: 'object', │ -│ ) │ │ instanceOf: 'Promise', │ -│ │ │ item: { │ -│ │ │ type: 'string' │ -│ │ │ } │ -│ │ │ } │ -│ │ │ │ -│ │ │ │ -├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤ -│ const T = Type.Uint8Array() │ type T = Uint8Array │ const T = { │ -│ │ │ type: 'object', │ -│ │ │ instanceOf: 'Uint8Array' │ -│ │ │ } │ -│ │ │ │ -├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤ -│ const T = Type.Date() │ type T = Date │ const T = { │ -│ │ │ type: 'object', │ -│ │ │ instanceOf: 'Date' │ -│ │ │ } │ -│ │ │ │ -├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤ -│ const T = Type.Undefined() │ type T = undefined │ const T = { │ -│ │ │ type: 'null', │ -│ │ │ typeOf: 'Undefined' │ -│ │ │ } │ -│ │ │ │ -├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤ -│ const T = Type.RegEx(/foo/) │ type T = string │ const T = { │ -│ │ │ type: 'string', │ -│ │ │ pattern: 'foo' │ -│ │ │ } │ -│ │ │ │ -├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤ -│ const T = Type.Symbol() │ type T = symbol │ const T = { │ -│ │ │ type: 'null', │ -│ │ │ typeOf: 'Symbol' │ -│ │ │ } │ -│ │ │ │ -├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤ -│ const T = Type.BigInt() │ type T = bigint │ const T = { │ -│ │ │ type: 'null', │ -│ │ │ typeOf: 'BigInt' │ -│ │ │ } │ -│ │ │ │ -├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤ -│ const T = Type.Void() │ type T = void │ const T = { │ -│ │ │ type: 'null' │ -│ │ │ typeOf: 'Void' │ -│ │ │ } │ -│ │ │ │ -└────────────────────────────────┴─────────────────────────────┴────────────────────────────────┘ -``` - - - -### Modifiers - -TypeBox provides modifiers that allow schema properties to be statically inferred as `readonly` or `optional`. The following table shows the supported modifiers and how they map between TypeScript and JSON Schema. - -```typescript -┌────────────────────────────────┬─────────────────────────────┬────────────────────────────────┐ -│ TypeBox │ TypeScript │ JSON Schema │ -│ │ │ │ -├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤ -│ const T = Type.Object({ │ type T = { │ const T = { │ -│ name: Type.Optional( │ name?: string │ type: 'object', │ -│ Type.String() │ } │ properties: { │ -│ ) │ │ name: { │ -│ }) │ │ type: 'string' │ -│ │ │ } │ -│ │ │ } │ -│ │ │ } │ -│ │ │ │ -├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤ -│ const T = Type.Object({ │ type T = { │ const T = { │ -│ name: Type.Readonly( │ readonly name: string │ type: 'object', │ -│ Type.String() │ } │ properties: { │ -│ ) │ │ name: { │ -│ }) │ │ type: 'string' │ -│ │ │ } │ -│ │ │ }, │ -│ │ │ required: ['name'] │ -│ │ │ } │ -│ │ │ │ -├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤ -│ const T = Type.Object({ │ type T = { │ const T = { │ -│ name: Type.ReadonlyOptional( │ readonly name?: string │ type: 'object', │ -│ Type.String() │ } │ properties: { │ -│ ) │ │ name: { │ -│ }) │ │ type: 'string' │ -│ │ │ } │ -│ │ │ } │ -│ │ │ } │ -│ │ │ │ -└────────────────────────────────┴─────────────────────────────┴────────────────────────────────┘ -``` - - - -### Options - -You can pass JSON Schema options on the last argument of any type. Option hints specific to each type are provided for convenience. - -```typescript -// String must be an email -const T = Type.String({ // const T = { - format: 'email' // type: 'string', -}) // format: 'email' - // } - -// Mumber must be a multiple of 2 -const T = Type.Number({ // const T = { - multipleOf: 2 // type: 'number', -}) // multipleOf: 2 - // } - -// Array must have at least 5 integer values -const T = Type.Array(Type.Integer(), { // const T = { - minItems: 5 // type: 'array', -}) // minItems: 5, - // items: { - // type: 'integer' - // } - // } - -``` - - - -### Generic Types - -Generic types can be created with generic functions constrained to type `TSchema`. The following creates a generic `Vector` type. - -```typescript -import { Type, Static, TSchema } from '@sinclair/typebox' - -const Vector = (t: T) => Type.Object({ x: t, y: t, z: t }) - -const NumberVector = Vector(Type.Number()) // const NumberVector = { - // type: 'object', - // required: ['x', 'y', 'z'], - // properties: { - // x: { type: 'number' }, - // y: { type: 'number' }, - // z: { type: 'number' } - // } - // } - -type NumberVector = Static // type NumberVector = { - // x: number, - // y: number, - // z: number - // } - -const BooleanVector = Vector(Type.Boolean()) // const BooleanVector = { - // type: 'object', - // required: ['x', 'y', 'z'], - // properties: { - // x: { type: 'boolean' }, - // y: { type: 'boolean' }, - // z: { type: 'boolean' } - // } - // } - -type BooleanVector = Static // type BooleanVector = { - // x: boolean, - // y: boolean, - // z: boolean - // } -``` - -The following creates a generic `Nullable` type. - -```typescript -const Nullable = (schema: T) => Type.Union([schema, Type.Null()]) - -const T = Nullable(Type.String()) // const T = { - // anyOf: [ - // { type: 'string' }, - // { type: 'null' } - // ] - // } - -type T = Static // type T = string | null -``` - - - -### Reference Types - -Reference types are supported with `Type.Ref`. The target type must specify a valid `$id`. - -```typescript -const T = Type.String({ $id: 'T' }) // const T = { - // $id: 'T', - // type: 'string' - // } - -const R = Type.Ref(T) // const R = { - // $ref: 'T' - // } -``` - - - -### Recursive Types - -Recursive types are supported with `Type.Recursive` - -```typescript -const Node = Type.Recursive(Node => Type.Object({ // const Node = { - id: Type.String(), // $id: 'Node', - nodes: Type.Array(Node) // type: 'object', -}), { $id: 'Node' }) // properties: { - // id: { - // type: 'string' - // }, - // nodes: { - // type: 'array', - // items: { - // $ref: 'Node' - // } - // } - // }, - // required: [ - // 'id', - // 'nodes' - // ] - // } - -type Node = Static // type Node = { - // id: string - // nodes: Node[] - // } - -function test(node: Node) { - const id = node.nodes[0].nodes[0].id // id is string -} -``` - - - -### Conditional Types - -Conditional types are supported with `Type.Extends`, `Type.Exclude` and `Type.Extract` - -```typescript -// TypeScript - -type T0 = string extends number ? true : false // type T0 = false - -type T1 = Extract // type T1 = number - -type T2 = Exclude // type T2 = string - -// TypeBox - -const T0 = Type.Extends(Type.String(), Type.Number(), Type.Literal(true), Type.Literal(false)) - -const T1 = Type.Extract(Type.Union([Type.String(), Type.Number()]), Type.Number()) - -const T2 = Type.Exclude(Type.Union([Type.String(), Type.Number()]), Type.Number()) - - -type T0 = Static // type T0 = false - -type T1 = Static // type T1 = number - -type T2 = Static // type T2 = string -``` - - - -### Template Literal Types - -Template Literal types are supported with `Type.TemplateLiteral` - -```typescript -// TypeScript - -type T = `option${'A'|'B'}` // type T = 'optionA' | 'optionB' - -type R = Record // type R = { - // optionA: string - // optionB: string - // } - -// TypeBox - -const T = Type.TemplateLiteral([ // const T = { - Type.Literal('option'), // pattern: '^option(A|B)$', - Type.Union([ // type: 'string' - Type.Literal('A'), // } - Type.Literal('B') - ]) -]) - -const R = Type.Record(T, Type.String()) // const R = { - // type: 'object', - // required: ['optionA', 'optionB'], - // properties: { - // optionA: { - // type: 'string' - // }, - // optionB: { - // type: 'string' - // } - // } - // } - -type T = Static // type T = 'optionA' | 'optionB' - -type R = Static // type R = { - // optionA: string - // optionB: string - // } -``` - - - -### Unsafe - -Use `Type.Unsafe` to create custom schematics with user defined inference rules. - -```typescript -const T = Type.Unsafe({ type: 'number' }) // const T = { - // type: 'number' - // } - -type T = Static // type T = string -``` - -The `Type.Unsafe` type can be useful to express specific OpenAPI schema representations. - -```typescript -import { Type, Static, TSchema } from '@sinclair/typebox' - -// Nullable - -function Nullable(schema: T) { - return Type.Unsafe | null>({ ...schema, nullable: true }) -} - -const T = Nullable(Type.String()) // const T = { - // type: 'string', - // nullable: true - // } - -type T = Static // type T = string | null - -// StringEnum - -function StringEnum(values: [...T]) { - return Type.Unsafe({ type: 'string', enum: values }) -} - -const T = StringEnum(['A', 'B', 'C']) // const T = { - // enum: ['A', 'B', 'C'] - // } - -type T = Static // type T = 'A' | 'B' | 'C' -``` - - - -### Guards - -TypeBox provides a `TypeGuard` module that can be used for reflection and asserting values as types. - -```typescript -import { Type, TypeGuard } from '@sinclair/typebox' - -const T = Type.String() - -if(TypeGuard.TString(T)) { - - // T is TString -} -``` - - - -### Strict - -TypeBox schemas contain the `Kind` and `Modifier` symbol properties. These properties are used for type composition and reflection. These properties are not strictly valid JSON schema; so in some cases it may be desirable to omit them. TypeBox provides a `Type.Strict` function that will omit these properties if necessary. - -```typescript -const T = Type.Object({ // const T = { - name: Type.Optional(Type.String()) // [Kind]: 'Object', -}) // type: 'object', - // properties: { - // name: { - // [Kind]: 'String', - // type: 'string', - // [Modifier]: 'Optional' - // } - // } - // } - -const U = Type.Strict(T) // const U = { - // type: 'object', - // properties: { - // name: { - // type: 'string' - // } - // } - // } -``` - - - -## Values - -TypeBox provides an optional utility module that can be used to perform common operations on JavaScript values. This module includes functionality to create, check and cast values from types as well as check equality, clone, diff and patch JavaScript values. This module is provided via optional import. - -```typescript -import { Value } from '@sinclair/typebox/value' -``` - - - -### Create - -Use the Create function to create a value from a type. TypeBox will use default values if specified. - -```typescript -const T = Type.Object({ x: Type.Number(), y: Type.Number({ default: 42 }) }) - -const A = Value.Create(T) // const A = { x: 0, y: 42 } -``` - - - -### Clone - -Use the Clone function to deeply clone a value - -```typescript -const A = Value.Clone({ x: 1, y: 2, z: 3 }) // const A = { x: 1, y: 2, z: 3 } -``` - - - -### Check - -Use the Check function to type check a value - -```typescript -const T = Type.Object({ x: Type.Number() }) - -const R = Value.Check(T, { x: 1 }) // const R = true -``` - - - -### Convert - -Use the Convert function to convert a value into its target type if a reasonable conversion is possible. - -```typescript -const T = Type.Object({ x: Type.Number() }) - -const R1 = Value.Convert(T, { x: '3.14' }) // const R1 = { x: 3.14 } - -const R2 = Value.Convert(T, { x: 'not a number' }) // const R2 = { x: 'not a number' } -``` - - - -### Cast - -Use the Cast function to cast a value into a type. The cast function will retain as much information as possible from the original value. - -```typescript -const T = Type.Object({ x: Type.Number(), y: Type.Number() }, { additionalProperties: false }) - -const X = Value.Cast(T, null) // const X = { x: 0, y: 0 } - -const Y = Value.Cast(T, { x: 1 }) // const Y = { x: 1, y: 0 } - -const Z = Value.Cast(T, { x: 1, y: 2, z: 3 }) // const Z = { x: 1, y: 2 } -``` - - - -### Equal - -Use the Equal function to deeply check for value equality. - -```typescript -const R = Value.Equal( // const R = true - { x: 1, y: 2, z: 3 }, - { x: 1, y: 2, z: 3 } -) -``` - - - -### Hash - -Use the Hash function to create a [FNV1A-64](https://en.wikipedia.org/wiki/Fowler%E2%80%93Noll%E2%80%93Vo_hash_function) non cryptographic hash of a value. - -```typescript -const A = Value.Hash({ x: 1, y: 2, z: 3 }) // const A = 2910466848807138541n - -const B = Value.Hash({ x: 1, y: 4, z: 3 }) // const B = 1418369778807423581n -``` - - - -### Diff - -Use the Diff function to produce a sequence of edits to transform one value into another. - -```typescript -const E = Value.Diff( // const E = [ - { x: 1, y: 2, z: 3 }, // { type: 'update', path: '/y', value: 4 }, - { y: 4, z: 5, w: 6 } // { type: 'update', path: '/z', value: 5 }, -) // { type: 'insert', path: '/w', value: 6 }, - // { type: 'delete', path: '/x' } - // ] -``` - - - -### Patch - -Use the Patch function to apply edits - -```typescript -const A = { x: 1, y: 2 } - -const B = { x: 3 } - -const E = Value.Diff(A, B) // const E = [ - // { type: 'update', path: '/x', value: 3 }, - // { type: 'delete', path: '/y' } - // ] - -const C = Value.Patch(A, E) // const C = { x: 3 } -``` - - - -### Errors - -Use the Errors function enumerate validation errors. - -```typescript -const T = Type.Object({ x: Type.Number(), y: Type.Number() }) - -const R = [...Value.Errors(T, { x: '42' })] // const R = [{ - // schema: { type: 'number' }, - // path: '/x', - // value: '42', - // message: 'Expected number' - // }, { - // schema: { type: 'number' }, - // path: '/y', - // value: undefined, - // message: 'Expected number' - // }] -``` - - - -### Mutate - -Use the Mutate function to perform a deep mutable value assignment while retaining internal references. - -```typescript -const Y = { z: 1 } // const Y = { z: 1 } - -const X = { y: Y } // const X = { y: { z: 1 } } - -const A = { x: X } // const A = { x: { y: { z: 1 } } } - - -Value.Mutate(A, { x: { y: { z: 2 } } }) // const A' = { x: { y: { z: 2 } } } - -const R0 = A.x.y.z === 2 // const R0 = 2 - -const R1 = A.x.y === Y // const R1 = true - -const R2 = A.x === X // const R2 = true -``` - - - -### Pointer - -Use ValuePointer to perform mutable updates on existing values using [RFC6901](https://www.rfc-editor.org/rfc/rfc6901) JSON Pointers. - -```typescript -import { ValuePointer } from '@sinclair/typebox/value' - -const A = { x: 0, y: 0, z: 0 } - -ValuePointer.Set(A, '/x', 1) // const A' = { x: 1, y: 0, z: 0 } - -ValuePointer.Set(A, '/y', 1) // const A' = { x: 1, y: 1, z: 0 } - -ValuePointer.Set(A, '/z', 1) // const A' = { x: 1, y: 1, z: 1 } -``` - - - -## TypeCheck - -TypeBox types target JSON Schema draft 6 so are compatible with any validator that supports this specification. TypeBox also provides a built in type checking compiler designed specifically for high performance compilation and value assertion. - -The following sections detail using Ajv and TypeBox's compiler infrastructure. - - - -## Ajv - -The following shows the recommended setup for Ajv. - -```bash -$ npm install ajv ajv-formats --save -``` - -```typescript -import { Type } from '@sinclair/typebox' -import addFormats from 'ajv-formats' -import Ajv from 'ajv' - -const ajv = addFormats(new Ajv({}), [ - 'date-time', - 'time', - 'date', - 'email', - 'hostname', - 'ipv4', - 'ipv6', - 'uri', - 'uri-reference', - 'uuid', - 'uri-template', - 'json-pointer', - 'relative-json-pointer', - 'regex' -]) - -const C = ajv.compile(Type.Object({ - x: Type.Number(), - y: Type.Number(), - z: Type.Number() -})) - -const R = C({ x: 1, y: 2, z: 3 }) // const R = true -``` - - - -### TypeCompiler - -The TypeBox TypeCompiler is a high performance JIT compiler that transforms TypeBox types into optimized JavaScript validation routines. The compiler is tuned for fast compilation as well as fast value assertion. It is designed to serve as a validation backend that can be integrated into larger applications; but can also be used as a general purpose validator. - -The TypeCompiler is provided as an optional import. - -```typescript -import { TypeCompiler } from '@sinclair/typebox/compiler' -``` - -Use the `Compile(...)` function to compile a type. - -```typescript -const C = TypeCompiler.Compile(Type.Object({ // const C: TypeCheck> - -const R = C.Check({ x: 1, y: 2, z: 3 }) // const R = true -``` - -Use the `Errors(...)` function to produce diagnostic errors for a value. The `Errors(...)` function will return an iterator that if enumerated; will perform an exhaustive check across the entire value and yield any error found. For performance, this function should only be called after failed `Check(...)`. Applications may also choose to yield only the first value to avoid exhaustive error generation. - -```typescript -const C = TypeCompiler.Compile(Type.Object({ // const C: TypeCheck> - -const value = { } - -const errors = [...C.Errors(value)] // const errors = [{ - // schema: { type: 'number' }, - // path: '/x', - // value: undefined, - // message: 'Expected number' - // }, { - // schema: { type: 'number' }, - // path: '/y', - // value: undefined, - // message: 'Expected number' - // }, { - // schema: { type: 'number' }, - // path: '/z', - // value: undefined, - // message: 'Expected number' - // }] -``` - -Compiled routines can be inspected with the `.Code()` function. - -```typescript -const C = TypeCompiler.Compile(Type.String()) // const C: TypeCheck - -console.log(C.Code()) // return function check(value) { - // return ( - // (typeof value === 'string') - // ) - // } -``` - - - -## TypeSystem - -The TypeBox TypeSystem module provides functionality to define types above and beyond the Standard and Extended type sets as well as control various assertion polices. Configurations made to the TypeSystem module are observed by both `TypeCompiler` and `Value` modules. - -The TypeSystem module is provided as an optional import. - -```typescript -import { TypeSystem } from '@sinclair/typebox/system' -``` - - - -### Types - -Use the `Type(...)` function to create a custom type. This function will return a type factory function that can be used to construct the type. The following creates a Point type. - -```typescript -type PointOptions = { } // The Type Options - -type PointType = { x: number, y: number } // The Static Type - -const Point = TypeSystem.Type('Point', (options, value) => { - return ( - typeof value === 'object' && value !== null && - typeof value.x === 'number' && - typeof value.y === 'number' - ) -}) - -const T = Point() - -type T = Static // type T = { x: number, y: number } - -const R = Value.Check(T, { x: 1, y: 2 }) // const R = true -``` - - - -### Formats - -Use the `Format(...)` function to create a custom string format. The following creates a format that checks for lowercase strings. - -```typescript -TypeSystem.Format('lowercase', value => value === value.toLowerCase()) // format should be lowercase - -const T = Type.String({ format: 'lowercase' }) - -const A = Value.Check(T, 'Hello') // const A = false - -const B = Value.Check(T, 'hello') // const B = true -``` - - - -### Policies - -TypeBox validates using JSON Schema assertion policies by default. It is possible to override these policies and have TypeBox assert using TypeScript policies. The following overrides are available. - -```typescript -// Allow arrays to validate as object types (default is false) -// -// const A: {} = [] - allowed in TS - -TypeSystem.AllowArrayObjects = true - -// Allow numeric values to be NaN or + or - Infinity (default is false) -// -// const A: number = NaN - allowed in TS - -TypeSystem.AllowNaN = true -``` - - - -## Benchmark - -This project maintains a set of benchmarks that measure Ajv, Value and TypeCompiler compilation and validation performance. These benchmarks can be run locally by cloning this repository and running `npm run benchmark`. The results below show for Ajv version 8.12.0. - -For additional comparative benchmarks, please refer to [typescript-runtime-type-benchmarks](https://moltar.github.io/typescript-runtime-type-benchmarks/). - - - -### Compile - -This benchmark measures compilation performance for varying types. You can review this benchmark [here](https://github.com/sinclairzx81/typebox/blob/master/benchmark/measurement/module/compile.ts). - -```typescript -┌────────────────────────────┬────────────┬──────────────┬──────────────┬──────────────┐ -│ (index) │ Iterations │ Ajv │ TypeCompiler │ Performance │ -├────────────────────────────┼────────────┼──────────────┼──────────────┼──────────────┤ -│ Literal_String │ 1000 │ ' 257 ms' │ ' 8 ms' │ ' 32.13 x' │ -│ Literal_Number │ 1000 │ ' 203 ms' │ ' 4 ms' │ ' 50.75 x' │ -│ Literal_Boolean │ 1000 │ ' 183 ms' │ ' 4 ms' │ ' 45.75 x' │ -│ Primitive_Number │ 1000 │ ' 174 ms' │ ' 8 ms' │ ' 21.75 x' │ -│ Primitive_String │ 1000 │ ' 158 ms' │ ' 9 ms' │ ' 17.56 x' │ -│ Primitive_String_Pattern │ 1000 │ ' 213 ms' │ ' 13 ms' │ ' 16.38 x' │ -│ Primitive_Boolean │ 1000 │ ' 136 ms' │ ' 6 ms' │ ' 22.67 x' │ -│ Primitive_Null │ 1000 │ ' 144 ms' │ ' 6 ms' │ ' 24.00 x' │ -│ Object_Unconstrained │ 1000 │ ' 1176 ms' │ ' 38 ms' │ ' 30.95 x' │ -│ Object_Constrained │ 1000 │ ' 1181 ms' │ ' 31 ms' │ ' 38.10 x' │ -│ Object_Vector3 │ 1000 │ ' 387 ms' │ ' 8 ms' │ ' 48.38 x' │ -│ Object_Box3D │ 1000 │ ' 1693 ms' │ ' 25 ms' │ ' 67.72 x' │ -│ Tuple_Primitive │ 1000 │ ' 470 ms' │ ' 15 ms' │ ' 31.33 x' │ -│ Tuple_Object │ 1000 │ ' 1206 ms' │ ' 17 ms' │ ' 70.94 x' │ -│ Composite_Intersect │ 1000 │ ' 567 ms' │ ' 20 ms' │ ' 28.35 x' │ -│ Composite_Union │ 1000 │ ' 515 ms' │ ' 21 ms' │ ' 24.52 x' │ -│ Math_Vector4 │ 1000 │ ' 787 ms' │ ' 10 ms' │ ' 78.70 x' │ -│ Math_Matrix4 │ 1000 │ ' 386 ms' │ ' 8 ms' │ ' 48.25 x' │ -│ Array_Primitive_Number │ 1000 │ ' 349 ms' │ ' 7 ms' │ ' 49.86 x' │ -│ Array_Primitive_String │ 1000 │ ' 336 ms' │ ' 4 ms' │ ' 84.00 x' │ -│ Array_Primitive_Boolean │ 1000 │ ' 284 ms' │ ' 3 ms' │ ' 94.67 x' │ -│ Array_Object_Unconstrained │ 1000 │ ' 1704 ms' │ ' 19 ms' │ ' 89.68 x' │ -│ Array_Object_Constrained │ 1000 │ ' 1456 ms' │ ' 18 ms' │ ' 80.89 x' │ -│ Array_Tuple_Primitive │ 1000 │ ' 792 ms' │ ' 15 ms' │ ' 52.80 x' │ -│ Array_Tuple_Object │ 1000 │ ' 1552 ms' │ ' 17 ms' │ ' 91.29 x' │ -│ Array_Composite_Intersect │ 1000 │ ' 744 ms' │ ' 18 ms' │ ' 41.33 x' │ -│ Array_Composite_Union │ 1000 │ ' 783 ms' │ ' 15 ms' │ ' 52.20 x' │ -│ Array_Math_Vector4 │ 1000 │ ' 1093 ms' │ ' 14 ms' │ ' 78.07 x' │ -│ Array_Math_Matrix4 │ 1000 │ ' 684 ms' │ ' 6 ms' │ ' 114.00 x' │ -└────────────────────────────┴────────────┴──────────────┴──────────────┴──────────────┘ -``` - - - -### Validate - -This benchmark measures validation performance for varying types. You can review this benchmark [here](https://github.com/sinclairzx81/typebox/blob/master/benchmark/measurement/module/check.ts). - -```typescript -┌────────────────────────────┬────────────┬──────────────┬──────────────┬──────────────┬──────────────┐ -│ (index) │ Iterations │ ValueCheck │ Ajv │ TypeCompiler │ Performance │ -├────────────────────────────┼────────────┼──────────────┼──────────────┼──────────────┼──────────────┤ -│ Literal_String │ 1000000 │ ' 27 ms' │ ' 6 ms' │ ' 5 ms' │ ' 1.20 x' │ -│ Literal_Number │ 1000000 │ ' 23 ms' │ ' 21 ms' │ ' 11 ms' │ ' 1.91 x' │ -│ Literal_Boolean │ 1000000 │ ' 21 ms' │ ' 20 ms' │ ' 10 ms' │ ' 2.00 x' │ -│ Primitive_Number │ 1000000 │ ' 26 ms' │ ' 19 ms' │ ' 11 ms' │ ' 1.73 x' │ -│ Primitive_String │ 1000000 │ ' 25 ms' │ ' 19 ms' │ ' 10 ms' │ ' 1.90 x' │ -│ Primitive_String_Pattern │ 1000000 │ ' 155 ms' │ ' 49 ms' │ ' 43 ms' │ ' 1.14 x' │ -│ Primitive_Boolean │ 1000000 │ ' 23 ms' │ ' 19 ms' │ ' 10 ms' │ ' 1.90 x' │ -│ Primitive_Null │ 1000000 │ ' 24 ms' │ ' 19 ms' │ ' 10 ms' │ ' 1.90 x' │ -│ Object_Unconstrained │ 1000000 │ ' 804 ms' │ ' 35 ms' │ ' 28 ms' │ ' 1.25 x' │ -│ Object_Constrained │ 1000000 │ ' 1041 ms' │ ' 55 ms' │ ' 41 ms' │ ' 1.34 x' │ -│ Object_Vector3 │ 1000000 │ ' 380 ms' │ ' 26 ms' │ ' 20 ms' │ ' 1.30 x' │ -│ Object_Box3D │ 1000000 │ ' 1785 ms' │ ' 65 ms' │ ' 52 ms' │ ' 1.25 x' │ -│ Object_Recursive │ 1000000 │ ' 4984 ms' │ ' 396 ms' │ ' 114 ms' │ ' 3.47 x' │ -│ Tuple_Primitive │ 1000000 │ ' 168 ms' │ ' 24 ms' │ ' 16 ms' │ ' 1.50 x' │ -│ Tuple_Object │ 1000000 │ ' 673 ms' │ ' 30 ms' │ ' 26 ms' │ ' 1.15 x' │ -│ Composite_Intersect │ 1000000 │ ' 751 ms' │ ' 28 ms' │ ' 20 ms' │ ' 1.40 x' │ -│ Composite_Union │ 1000000 │ ' 489 ms' │ ' 24 ms' │ ' 16 ms' │ ' 1.50 x' │ -│ Math_Vector4 │ 1000000 │ ' 259 ms' │ ' 23 ms' │ ' 13 ms' │ ' 1.77 x' │ -│ Math_Matrix4 │ 1000000 │ ' 1002 ms' │ ' 40 ms' │ ' 30 ms' │ ' 1.33 x' │ -│ Array_Primitive_Number │ 1000000 │ ' 252 ms' │ ' 22 ms' │ ' 15 ms' │ ' 1.47 x' │ -│ Array_Primitive_String │ 1000000 │ ' 227 ms' │ ' 22 ms' │ ' 18 ms' │ ' 1.22 x' │ -│ Array_Primitive_Boolean │ 1000000 │ ' 150 ms' │ ' 23 ms' │ ' 22 ms' │ ' 1.05 x' │ -│ Array_Object_Unconstrained │ 1000000 │ ' 4754 ms' │ ' 71 ms' │ ' 64 ms' │ ' 1.11 x' │ -│ Array_Object_Constrained │ 1000000 │ ' 4787 ms' │ ' 142 ms' │ ' 123 ms' │ ' 1.15 x' │ -│ Array_Object_Recursive │ 1000000 │ ' 19088 ms' │ ' 1735 ms' │ ' 314 ms' │ ' 5.53 x' │ -│ Array_Tuple_Primitive │ 1000000 │ ' 650 ms' │ ' 41 ms' │ ' 31 ms' │ ' 1.32 x' │ -│ Array_Tuple_Object │ 1000000 │ ' 2770 ms' │ ' 67 ms' │ ' 55 ms' │ ' 1.22 x' │ -│ Array_Composite_Intersect │ 1000000 │ ' 2693 ms' │ ' 50 ms' │ ' 39 ms' │ ' 1.28 x' │ -│ Array_Composite_Union │ 1000000 │ ' 1982 ms' │ ' 72 ms' │ ' 33 ms' │ ' 2.18 x' │ -│ Array_Math_Vector4 │ 1000000 │ ' 1068 ms' │ ' 40 ms' │ ' 26 ms' │ ' 1.54 x' │ -│ Array_Math_Matrix4 │ 1000000 │ ' 4609 ms' │ ' 115 ms' │ ' 88 ms' │ ' 1.31 x' │ -└────────────────────────────┴────────────┴──────────────┴──────────────┴──────────────┴──────────────┘ -``` - - - -### Compression - -The following table lists esbuild compiled and minified sizes for each TypeBox module. - -```typescript -┌──────────────────────┬────────────┬────────────┬─────────────┐ -│ (index) │ Compiled │ Minified │ Compression │ -├──────────────────────┼────────────┼────────────┼─────────────┤ -│ typebox/compiler │ '124.3 kb' │ ' 55.7 kb' │ '2.23 x' │ -│ typebox/errors │ '107.8 kb' │ ' 47.9 kb' │ '2.25 x' │ -│ typebox/system │ ' 73.3 kb' │ ' 30.2 kb' │ '2.43 x' │ -│ typebox/value │ '170.7 kb' │ ' 74.2 kb' │ '2.30 x' │ -│ typebox │ ' 72.0 kb' │ ' 29.7 kb' │ '2.43 x' │ -└──────────────────────┴────────────┴────────────┴─────────────┘ -``` - - - -## Contribute - -TypeBox is open to community contribution. Please ensure you submit an open issue before submitting your pull request. The TypeBox project preferences open community discussion prior to accepting new features. +
+ +

TypeBox

+ +

JSON Schema Type Builder with Static Type Resolution for TypeScript

+ + + +
+
+ +[![npm version](https://badge.fury.io/js/%40sinclair%2Ftypebox.svg)](https://badge.fury.io/js/%40sinclair%2Ftypebox) +[![Downloads](https://img.shields.io/npm/dm/%40sinclair%2Ftypebox.svg)](https://www.npmjs.com/package/%40sinclair%2Ftypebox) +[![GitHub CI](https://github.com/sinclairzx81/typebox/workflows/GitHub%20CI/badge.svg)](https://github.com/sinclairzx81/typebox/actions) + +
+ + + +## Install + +#### Npm +```bash +$ npm install @sinclair/typebox --save +``` + +#### Deno +```typescript +import { Static, Type } from 'npm:@sinclair/typebox' +``` + +#### Esm + +```typescript +import { Static, Type } from 'https://esm.sh/@sinclair/typebox' +``` + +## Example + +```typescript +import { Static, Type } from '@sinclair/typebox' + +const T = Type.Object({ // const T = { + x: Type.Number(), // type: 'object', + y: Type.Number(), // required: ['x', 'y', 'z'], + z: Type.Number() // properties: { +}) // x: { type: 'number' }, + // y: { type: 'number' }, + // z: { type: 'number' } + // } + // } + +type T = Static // type T = { + // x: number, + // y: number, + // z: number + // } +``` + + + + +## Overview + +TypeBox is a runtime type builder that creates in-memory JSON Schema objects that can be statically inferred as TypeScript types. The schemas produced by this library are designed to match the static type assertion rules of the TypeScript compiler. TypeBox enables one to create a unified type that can be statically checked by TypeScript and runtime asserted using standard JSON Schema validation. + +This library is designed to enable JSON schema to compose with the same flexibility as TypeScript's type system. It can be used as a simple tool to build up complex schemas or integrated into REST or RPC services to help validate data received over the wire. + +License MIT + +## Contents +- [Install](#install) +- [Overview](#overview) +- [Usage](#usage) +- [Types](#types) + - [Standard](#types-standard) + - [Extended](#types-extended) + - [Modifiers](#types-modifiers) + - [Options](#types-options) + - [Generics](#types-generics) + - [References](#types-references) + - [Recursive](#types-recursive) + - [Conditional](#types-conditional) + - [Template Literal](#types-template-literal) + - [Guards](#types-guards) + - [Unsafe](#types-unsafe) + - [Strict](#types-strict) +- [Values](#values) + - [Create](#values-create) + - [Clone](#values-clone) + - [Check](#values-check) + - [Convert](#values-convert) + - [Cast](#values-cast) + - [Equal](#values-equal) + - [Hash](#values-hash) + - [Diff](#values-diff) + - [Patch](#values-patch) + - [Errors](#values-errors) + - [Mutate](#values-mutate) + - [Pointer](#values-pointer) +- [TypeCheck](#typecheck) + - [Ajv](#typecheck-ajv) + - [TypeCompiler](#typecheck-typecompiler) +- [TypeSystem](#typesystem) + - [Types](#typesystem-types) + - [Formats](#typesystem-formats) + - [Policies](#typesystem-policies) +- [Benchmark](#benchmark) + - [Compile](#benchmark-compile) + - [Validate](#benchmark-validate) + - [Compression](#benchmark-compression) +- [Contribute](#contribute) + + + +## Usage + +The following shows general usage. + +```typescript +import { Static, Type } from '@sinclair/typebox' + +//-------------------------------------------------------------------------------------------- +// +// Let's say you have the following type ... +// +//-------------------------------------------------------------------------------------------- + +type T = { + id: string, + name: string, + timestamp: number +} + +//-------------------------------------------------------------------------------------------- +// +// ... you can express this type in the following way. +// +//-------------------------------------------------------------------------------------------- + +const T = Type.Object({ // const T = { + id: Type.String(), // type: 'object', + name: Type.String(), // properties: { + timestamp: Type.Integer() // id: { +}) // type: 'string' + // }, + // name: { + // type: 'string' + // }, + // timestamp: { + // type: 'integer' + // } + // }, + // required: [ + // 'id', + // 'name', + // 'timestamp' + // ] + // } + +//-------------------------------------------------------------------------------------------- +// +// ... then infer back to the original static type this way. +// +//-------------------------------------------------------------------------------------------- + +type T = Static // type T = { + // id: string, + // name: string, + // timestamp: number + // } + +//-------------------------------------------------------------------------------------------- +// +// ... then use the type both as JSON schema and as a TypeScript type. +// +//-------------------------------------------------------------------------------------------- + +import { Value } from '@sinclair/typebox/value' + +function receive(value: T) { // ... as a Static Type + + if(Value.Check(T, value)) { // ... as a JSON Schema + + // ok... + } +} +``` + + + +## Types + +TypeBox types are JSON schema fragments that can be composed into more complex types. Each fragment is structured such that a JSON schema compliant validator can runtime assert a value the same way TypeScript will statically assert a type. TypeBox provides a set of Standard types which are used create JSON schema compliant schematics as well as an Extended type set used to create schematics for constructs native to JavaScript. + + + +### Standard Types + +The following table lists the Standard TypeBox types. These types are fully compatible with the JSON Schema Draft 6 specification. + +```typescript +┌────────────────────────────────┬─────────────────────────────┬────────────────────────────────┐ +│ TypeBox │ TypeScript │ JSON Schema │ +│ │ │ │ +├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤ +│ const T = Type.Any() │ type T = any │ const T = { } │ +│ │ │ │ +├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤ +│ const T = Type.Unknown() │ type T = unknown │ const T = { } │ +│ │ │ │ +├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤ +│ const T = Type.String() │ type T = string │ const T = { │ +│ │ │ type: 'string' │ +│ │ │ } │ +│ │ │ │ +├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤ +│ const T = Type.Number() │ type T = number │ const T = { │ +│ │ │ type: 'number' │ +│ │ │ } │ +│ │ │ │ +├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤ +│ const T = Type.Integer() │ type T = number │ const T = { │ +│ │ │ type: 'integer' │ +│ │ │ } │ +│ │ │ │ +├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤ +│ const T = Type.Boolean() │ type T = boolean │ const T = { │ +│ │ │ type: 'boolean' │ +│ │ │ } │ +│ │ │ │ +├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤ +│ const T = Type.Null() │ type T = null │ const T = { │ +│ │ │ type: 'null' │ +│ │ │ } │ +│ │ │ │ +├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤ +│ const T = Type.Literal(42) │ type T = 42 │ const T = { │ +│ │ │ const: 42, │ +│ │ │ type: 'number' │ +│ │ │ } │ +│ │ │ │ +├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤ +│ const T = Type.Array( │ type T = number[] │ const T = { │ +│ Type.Number() │ │ type: 'array', │ +│ ) │ │ items: { │ +│ │ │ type: 'number' │ +│ │ │ } │ +│ │ │ } │ +│ │ │ │ +├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤ +│ const T = Type.Object({ │ type T = { │ const T = { │ +│ x: Type.Number(), │ x: number, │ type: 'object', │ +│ y: Type.Number() │ y: number │ required: ['x', 'y'], │ +│ }) │ } │ properties: { │ +│ │ │ x: { │ +│ │ │ type: 'number' │ +│ │ │ }, { │ +│ │ │ type: 'number' │ +│ │ │ } │ +│ │ │ } │ +│ │ │ } │ +│ │ │ │ +├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤ +│ const T = Type.Tuple([ │ type T = [number, number] │ const T = { │ +│ Type.Number(), │ │ type: 'array', │ +│ Type.Number() │ │ items: [{ │ +│ ]) │ │ type: 'number' │ +│ │ │ }, { │ +│ │ │ type: 'number' │ +│ │ │ }], │ +│ │ │ additionalItems: false, │ +│ │ │ minItems: 2, │ +│ │ │ maxItems: 2 │ +│ │ │ } │ +│ │ │ │ +│ │ │ │ +├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤ +│ enum Foo { │ enum Foo { │ const T = { │ +│ A, │ A, │ anyOf: [{ │ +│ B │ B │ type: 'number', │ +│ } │ } │ const: 0 │ +│ │ │ }, { │ +│ const T = Type.Enum(Foo) │ type T = Foo │ type: 'number', │ +│ │ │ const: 1 │ +│ │ │ }] │ +│ │ │ } │ +│ │ │ │ +├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤ +│ const T = Type.KeyOf( │ type T = keyof { │ const T = { │ +│ Type.Object({ │ x: number, │ anyOf: [{ │ +│ x: Type.Number(), │ y: number │ type: 'string', │ +│ y: Type.Number() │ } │ const: 'x' │ +│ }) │ │ }, { │ +│ ) │ │ type: 'string', │ +│ │ │ const: 'y' │ +│ │ │ }] │ +│ │ │ } │ +│ │ │ │ +├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤ +│ const T = Type.Union([ │ type T = string | number │ const T = { │ +│ Type.String(), │ │ anyOf: [{ │ +│ Type.Number() │ │ type: 'string' │ +│ ]) │ │ }, { │ +│ │ │ type: 'number' │ +│ │ │ }] │ +│ │ │ } │ +│ │ │ │ +├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤ +│ const T = Type.Intersect([ │ type T = { │ const T = { │ +│ Type.Object({ │ x: number │ allOf: [{ │ +│ x: Type.Number() │ } & { │ type: 'object', │ +│ }), │ y: number │ required: ['x'], │ +│ Type.Object({ │ } │ properties: { │ +│ y: Type.Number() │ │ x: { │ +│ ]) │ │ type: 'number' │ +│ ]) │ │ } │ +│ │ │ } │ +│ │ │ }, { │ +│ │ │ type: 'object', | +│ │ │ required: ['y'], │ +│ │ │ properties: { │ +│ │ │ y: { │ +│ │ │ type: 'number' │ +│ │ │ } │ +│ │ │ } │ +│ │ │ }] │ +│ │ │ } │ +│ │ │ │ +├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤ +│ const T = Type.Composite([ │ type I = { │ const T = { │ +│ Type.Object({ │ x: number │ type: 'object', │ +│ x: Type.Number() │ } & { │ required: ['x', 'y'], │ +│ }), │ y: number │ properties: { │ +│ Type.Object({ │ } │ x: { │ +│ y: Type.Number() │ │ type: 'number' │ +│ }) │ type T = { │ }, │ +│ ]) │ [K in keyof I]: I[K] │ y: { │ +│ │ } │ type: 'number' │ +│ │ │ } │ +│ │ │ } │ +│ │ │ } │ +│ │ │ │ +├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤ +│ const T = Type.Never() │ type T = never │ const T = { │ +│ │ │ not: {} │ +│ │ │ } │ +│ │ │ │ +├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤ +│ const T = Type.Not( | type T = string │ const T = { │ +| Type.Union([ │ │ allOf: [{ │ +│ Type.Literal('x'), │ │ not: { │ +│ Type.Literal('y'), │ │ anyOf: [ │ +│ Type.Literal('z') │ │ { const: 'x' }, │ +│ ]), │ │ { const: 'y' }, │ +│ Type.String() │ │ { const: 'z' } │ +│ ) │ │ ] │ +│ │ │ } │ +│ │ │ }, { │ +│ │ │ type: 'string' │ +│ │ │ }] │ +│ │ │ } │ +│ │ │ │ +├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤ +│ const T = Type.Extends( │ type T = │ const T = { │ +│ Type.String(), │ string extends number │ const: false, │ +│ Type.Number(), │ true : false │ type: 'boolean' │ +│ Type.Literal(true), │ │ } │ +│ Type.Literal(false) │ │ │ +│ ) │ │ │ +│ │ │ │ +├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤ +│ const T = Type.Extract( │ type T = Extract< │ const T = { │ +│ Type.Union([ │ string | number, │ type: 'string' │ +│ Type.String(), │ string │ } │ +│ Type.Number(), │ > │ │ +│ ]), │ │ │ +│ Type.String() │ │ │ +│ ) │ │ │ +│ │ │ │ +├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤ +│ const T = Type.Exclude( │ type T = Exclude< │ const T = { │ +│ Type.Union([ │ string | number, │ type: 'number' │ +│ Type.String(), │ string │ } │ +│ Type.Number(), │ > │ │ +│ ]), │ │ │ +│ Type.String() │ │ │ +│ ) │ │ │ +│ │ │ │ +├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤ +│ const U = Type.Union([ │ type U = 'open' | 'close' │ const T = { │ +│ Type.Literal('open'), │ │ type: 'string', │ +│ Type.Literal('close') │ type T = `on${U}` │ pattern: '^on(open|close)$' │ +│ ]) │ │ } │ +│ │ │ │ +│ const T = Type │ │ │ +│ .TemplateLiteral([ │ │ │ +│ Type.Literal('on'), │ │ │ +│ U │ │ │ +│ ]) │ │ │ +│ │ │ │ +├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤ +│ const T = Type.Record( │ type T = Record< │ const T = { │ +│ Type.String(), │ string, │ type: 'object', │ +│ Type.Number() │ number │ patternProperties: { │ +│ ) │ > │ '^.*$': { │ +│ │ │ type: 'number' │ +│ │ │ } │ +│ │ │ } │ +│ │ │ } │ +│ │ │ │ +├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤ +│ const T = Type.Partial( │ type T = Partial<{ │ const T = { │ +│ Type.Object({ │ x: number, │ type: 'object', │ +│ x: Type.Number(), │ y: number │ properties: { │ +│ y: Type.Number() | }> │ x: { │ +│ }) │ │ type: 'number' │ +│ ) │ │ }, │ +│ │ │ y: { │ +│ │ │ type: 'number' │ +│ │ │ } │ +│ │ │ } │ +│ │ │ } │ +│ │ │ │ +├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤ +│ const T = Type.Required( │ type T = Required<{ │ const T = { │ +│ Type.Object({ │ x?: number, │ type: 'object', │ +│ x: Type.Optional( │ y?: number │ required: ['x', 'y'], │ +│ Type.Number() | }> │ properties: { │ +│ ), │ │ x: { │ +│ y: Type.Optional( │ │ type: 'number' │ +│ Type.Number() │ │ }, │ +│ ) │ │ y: { │ +│ }) │ │ type: 'number' │ +│ ) │ │ } │ +│ │ │ } │ +│ │ │ } │ +│ │ │ │ +├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤ +│ const T = Type.Pick( │ type T = Pick<{ │ const T = { │ +│ Type.Object({ │ x: number, │ type: 'object', │ +│ x: Type.Number(), │ y: number │ required: ['x'], │ +│ y: Type.Number() │ }, 'x'> │ properties: { │ +│ }), ['x'] | │ x: { │ +│ ) │ │ type: 'number' │ +│ │ │ } │ +│ │ │ } │ +│ │ │ } │ +│ │ │ │ +├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤ +│ const T = Type.Omit( │ type T = Omit<{ │ const T = { │ +│ Type.Object({ │ x: number, │ type: 'object', │ +│ x: Type.Number(), │ y: number │ required: ['y'], │ +│ y: Type.Number() │ }, 'x'> │ properties: { │ +│ }), ['x'] | │ y: { │ +│ ) │ │ type: 'number' │ +│ │ │ } │ +│ │ │ } │ +│ │ │ } │ +│ │ │ │ +├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤ +│ const T = Type.Object({ │ type T = { │ const R = { │ +│ x: Type.Number(), │ x: number, │ $ref: 'T' │ +│ y: Type.Number() │ y: number │ } │ +│ }, { $id: 'T' }) | } │ │ +│ │ │ │ +│ const R = Type.Ref(T) │ type R = T │ │ +│ │ │ │ +│ │ │ │ +│ │ │ │ +│ │ │ │ +└────────────────────────────────┴─────────────────────────────┴────────────────────────────────┘ +``` + + + +### Extended Types + +TypeBox provides several extended types that can be used to produce schematics for common JavaScript constructs. These types can not be used with standard JSON schema validators; but are useful to help frame schematics for RPC interfaces that may receive JSON validated data. Extended types are prefixed with the `[Extended]` doc comment for convenience. The following table lists the supported types. + +```typescript +┌────────────────────────────────┬─────────────────────────────┬────────────────────────────────┐ +│ TypeBox │ TypeScript │ Extended Schema │ +│ │ │ │ +├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤ +│ const T = Type.Constructor([ │ type T = new ( │ const T = { │ +│ Type.String(), │ arg0: string, │ type: 'object', │ +│ Type.Number() │ arg1: number │ instanceOf: 'Constructor', │ +│ ], Type.Boolean()) │ ) => boolean │ parameters: [{ │ +│ │ │ type: 'string' │ +│ │ │ }, { │ +│ │ │ type: 'number' │ +│ │ │ }], │ +│ │ │ return: { │ +│ │ │ type: 'boolean' │ +│ │ │ } │ +│ │ │ } │ +│ │ │ │ +├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤ +│ const T = Type.Function([ │ type T = ( │ const T = { │ +| Type.String(), │ arg0: string, │ type : 'object', │ +│ Type.Number() │ arg1: number │ instanceOf: 'Function', │ +│ ], Type.Boolean()) │ ) => boolean │ parameters: [{ │ +│ │ │ type: 'string' │ +│ │ │ }, { │ +│ │ │ type: 'number' │ +│ │ │ }], │ +│ │ │ return: { │ +│ │ │ type: 'boolean' │ +│ │ │ } │ +│ │ │ } │ +│ │ │ │ +├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤ +│ const T = Type.Promise( │ type T = Promise │ const T = { │ +│ Type.String() │ │ type: 'object', │ +│ ) │ │ instanceOf: 'Promise', │ +│ │ │ item: { │ +│ │ │ type: 'string' │ +│ │ │ } │ +│ │ │ } │ +│ │ │ │ +│ │ │ │ +├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤ +│ const T = Type.Uint8Array() │ type T = Uint8Array │ const T = { │ +│ │ │ type: 'object', │ +│ │ │ instanceOf: 'Uint8Array' │ +│ │ │ } │ +│ │ │ │ +├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤ +│ const T = Type.Date() │ type T = Date │ const T = { │ +│ │ │ type: 'object', │ +│ │ │ instanceOf: 'Date' │ +│ │ │ } │ +│ │ │ │ +├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤ +│ const T = Type.Undefined() │ type T = undefined │ const T = { │ +│ │ │ type: 'null', │ +│ │ │ typeOf: 'Undefined' │ +│ │ │ } │ +│ │ │ │ +├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤ +│ const T = Type.RegEx(/foo/) │ type T = string │ const T = { │ +│ │ │ type: 'string', │ +│ │ │ pattern: 'foo' │ +│ │ │ } │ +│ │ │ │ +├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤ +│ const T = Type.Symbol() │ type T = symbol │ const T = { │ +│ │ │ type: 'null', │ +│ │ │ typeOf: 'Symbol' │ +│ │ │ } │ +│ │ │ │ +├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤ +│ const T = Type.BigInt() │ type T = bigint │ const T = { │ +│ │ │ type: 'null', │ +│ │ │ typeOf: 'BigInt' │ +│ │ │ } │ +│ │ │ │ +├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤ +│ const T = Type.Void() │ type T = void │ const T = { │ +│ │ │ type: 'null' │ +│ │ │ typeOf: 'Void' │ +│ │ │ } │ +│ │ │ │ +└────────────────────────────────┴─────────────────────────────┴────────────────────────────────┘ +``` + + + +### Modifiers + +TypeBox provides modifiers that allow schema properties to be statically inferred as `readonly` or `optional`. The following table shows the supported modifiers and how they map between TypeScript and JSON Schema. + +```typescript +┌────────────────────────────────┬─────────────────────────────┬────────────────────────────────┐ +│ TypeBox │ TypeScript │ JSON Schema │ +│ │ │ │ +├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤ +│ const T = Type.Object({ │ type T = { │ const T = { │ +│ name: Type.Optional( │ name?: string │ type: 'object', │ +│ Type.String() │ } │ properties: { │ +│ ) │ │ name: { │ +│ }) │ │ type: 'string' │ +│ │ │ } │ +│ │ │ } │ +│ │ │ } │ +│ │ │ │ +├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤ +│ const T = Type.Object({ │ type T = { │ const T = { │ +│ name: Type.Readonly( │ readonly name: string │ type: 'object', │ +│ Type.String() │ } │ properties: { │ +│ ) │ │ name: { │ +│ }) │ │ type: 'string' │ +│ │ │ } │ +│ │ │ }, │ +│ │ │ required: ['name'] │ +│ │ │ } │ +│ │ │ │ +├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤ +│ const T = Type.Object({ │ type T = { │ const T = { │ +│ name: Type.ReadonlyOptional( │ readonly name?: string │ type: 'object', │ +│ Type.String() │ } │ properties: { │ +│ ) │ │ name: { │ +│ }) │ │ type: 'string' │ +│ │ │ } │ +│ │ │ } │ +│ │ │ } │ +│ │ │ │ +└────────────────────────────────┴─────────────────────────────┴────────────────────────────────┘ +``` + + + +### Options + +You can pass JSON Schema options on the last argument of any type. Option hints specific to each type are provided for convenience. + +```typescript +// String must be an email +const T = Type.String({ // const T = { + format: 'email' // type: 'string', +}) // format: 'email' + // } + +// Mumber must be a multiple of 2 +const T = Type.Number({ // const T = { + multipleOf: 2 // type: 'number', +}) // multipleOf: 2 + // } + +// Array must have at least 5 integer values +const T = Type.Array(Type.Integer(), { // const T = { + minItems: 5 // type: 'array', +}) // minItems: 5, + // items: { + // type: 'integer' + // } + // } + +``` + + + +### Generic Types + +Generic types can be created with generic functions constrained to type `TSchema`. The following creates a generic `Vector` type. + +```typescript +import { Type, Static, TSchema } from '@sinclair/typebox' + +const Vector = (t: T) => Type.Object({ x: t, y: t, z: t }) + +const NumberVector = Vector(Type.Number()) // const NumberVector = { + // type: 'object', + // required: ['x', 'y', 'z'], + // properties: { + // x: { type: 'number' }, + // y: { type: 'number' }, + // z: { type: 'number' } + // } + // } + +type NumberVector = Static // type NumberVector = { + // x: number, + // y: number, + // z: number + // } + +const BooleanVector = Vector(Type.Boolean()) // const BooleanVector = { + // type: 'object', + // required: ['x', 'y', 'z'], + // properties: { + // x: { type: 'boolean' }, + // y: { type: 'boolean' }, + // z: { type: 'boolean' } + // } + // } + +type BooleanVector = Static // type BooleanVector = { + // x: boolean, + // y: boolean, + // z: boolean + // } +``` + +The following creates a generic `Nullable` type. + +```typescript +const Nullable = (schema: T) => Type.Union([schema, Type.Null()]) + +const T = Nullable(Type.String()) // const T = { + // anyOf: [ + // { type: 'string' }, + // { type: 'null' } + // ] + // } + +type T = Static // type T = string | null +``` + + + +### Reference Types + +Reference types are supported with `Type.Ref`. The target type must specify a valid `$id`. + +```typescript +const T = Type.String({ $id: 'T' }) // const T = { + // $id: 'T', + // type: 'string' + // } + +const R = Type.Ref(T) // const R = { + // $ref: 'T' + // } +``` + + + +### Recursive Types + +Recursive types are supported with `Type.Recursive` + +```typescript +const Node = Type.Recursive(Node => Type.Object({ // const Node = { + id: Type.String(), // $id: 'Node', + nodes: Type.Array(Node) // type: 'object', +}), { $id: 'Node' }) // properties: { + // id: { + // type: 'string' + // }, + // nodes: { + // type: 'array', + // items: { + // $ref: 'Node' + // } + // } + // }, + // required: [ + // 'id', + // 'nodes' + // ] + // } + +type Node = Static // type Node = { + // id: string + // nodes: Node[] + // } + +function test(node: Node) { + const id = node.nodes[0].nodes[0].id // id is string +} +``` + + + +### Conditional Types + +Conditional types are supported with `Type.Extends`, `Type.Exclude` and `Type.Extract` + +```typescript +// TypeScript + +type T0 = string extends number ? true : false // type T0 = false + +type T1 = Extract // type T1 = number + +type T2 = Exclude // type T2 = string + +// TypeBox + +const T0 = Type.Extends(Type.String(), Type.Number(), Type.Literal(true), Type.Literal(false)) + +const T1 = Type.Extract(Type.Union([Type.String(), Type.Number()]), Type.Number()) + +const T2 = Type.Exclude(Type.Union([Type.String(), Type.Number()]), Type.Number()) + + +type T0 = Static // type T0 = false + +type T1 = Static // type T1 = number + +type T2 = Static // type T2 = string +``` + + + +### Template Literal Types + +Template Literal types are supported with `Type.TemplateLiteral` + +```typescript +// TypeScript + +type T = `option${'A'|'B'}` // type T = 'optionA' | 'optionB' + +type R = Record // type R = { + // optionA: string + // optionB: string + // } + +// TypeBox + +const T = Type.TemplateLiteral([ // const T = { + Type.Literal('option'), // pattern: '^option(A|B)$', + Type.Union([ // type: 'string' + Type.Literal('A'), // } + Type.Literal('B') + ]) +]) + +const R = Type.Record(T, Type.String()) // const R = { + // type: 'object', + // required: ['optionA', 'optionB'], + // properties: { + // optionA: { + // type: 'string' + // }, + // optionB: { + // type: 'string' + // } + // } + // } + +type T = Static // type T = 'optionA' | 'optionB' + +type R = Static // type R = { + // optionA: string + // optionB: string + // } +``` + + + +### Unsafe + +Use `Type.Unsafe` to create custom schematics with user defined inference rules. + +```typescript +const T = Type.Unsafe({ type: 'number' }) // const T = { + // type: 'number' + // } + +type T = Static // type T = string +``` + +The `Type.Unsafe` type can be useful to express specific OpenAPI schema representations. + +```typescript +import { Type, Static, TSchema } from '@sinclair/typebox' + +// Nullable + +function Nullable(schema: T) { + return Type.Unsafe | null>({ ...schema, nullable: true }) +} + +const T = Nullable(Type.String()) // const T = { + // type: 'string', + // nullable: true + // } + +type T = Static // type T = string | null + +// StringEnum + +function StringEnum(values: [...T]) { + return Type.Unsafe({ type: 'string', enum: values }) +} + +const T = StringEnum(['A', 'B', 'C']) // const T = { + // enum: ['A', 'B', 'C'] + // } + +type T = Static // type T = 'A' | 'B' | 'C' +``` + + + +### Guards + +TypeBox provides a `TypeGuard` module that can be used for reflection and asserting values as types. + +```typescript +import { Type, TypeGuard } from '@sinclair/typebox' + +const T = Type.String() + +if(TypeGuard.TString(T)) { + + // T is TString +} +``` + + + +### Strict + +TypeBox schemas contain the `Kind` and `Modifier` symbol properties. These properties are used for type composition and reflection. These properties are not strictly valid JSON schema; so in some cases it may be desirable to omit them. TypeBox provides a `Type.Strict` function that will omit these properties if necessary. + +```typescript +const T = Type.Object({ // const T = { + name: Type.Optional(Type.String()) // [Kind]: 'Object', +}) // type: 'object', + // properties: { + // name: { + // [Kind]: 'String', + // type: 'string', + // [Modifier]: 'Optional' + // } + // } + // } + +const U = Type.Strict(T) // const U = { + // type: 'object', + // properties: { + // name: { + // type: 'string' + // } + // } + // } +``` + + + +## Values + +TypeBox provides an optional utility module that can be used to perform common operations on JavaScript values. This module includes functionality to create, check and cast values from types as well as check equality, clone, diff and patch JavaScript values. This module is provided via optional import. + +```typescript +import { Value } from '@sinclair/typebox/value' +``` + + + +### Create + +Use the Create function to create a value from a type. TypeBox will use default values if specified. + +```typescript +const T = Type.Object({ x: Type.Number(), y: Type.Number({ default: 42 }) }) + +const A = Value.Create(T) // const A = { x: 0, y: 42 } +``` + + + +### Clone + +Use the Clone function to deeply clone a value + +```typescript +const A = Value.Clone({ x: 1, y: 2, z: 3 }) // const A = { x: 1, y: 2, z: 3 } +``` + + + +### Check + +Use the Check function to type check a value + +```typescript +const T = Type.Object({ x: Type.Number() }) + +const R = Value.Check(T, { x: 1 }) // const R = true +``` + + + +### Convert + +Use the Convert function to convert a value into its target type if a reasonable conversion is possible. + +```typescript +const T = Type.Object({ x: Type.Number() }) + +const R1 = Value.Convert(T, { x: '3.14' }) // const R1 = { x: 3.14 } + +const R2 = Value.Convert(T, { x: 'not a number' }) // const R2 = { x: 'not a number' } +``` + + + +### Cast + +Use the Cast function to cast a value into a type. The cast function will retain as much information as possible from the original value. + +```typescript +const T = Type.Object({ x: Type.Number(), y: Type.Number() }, { additionalProperties: false }) + +const X = Value.Cast(T, null) // const X = { x: 0, y: 0 } + +const Y = Value.Cast(T, { x: 1 }) // const Y = { x: 1, y: 0 } + +const Z = Value.Cast(T, { x: 1, y: 2, z: 3 }) // const Z = { x: 1, y: 2 } +``` + + + +### Equal + +Use the Equal function to deeply check for value equality. + +```typescript +const R = Value.Equal( // const R = true + { x: 1, y: 2, z: 3 }, + { x: 1, y: 2, z: 3 } +) +``` + + + +### Hash + +Use the Hash function to create a [FNV1A-64](https://en.wikipedia.org/wiki/Fowler%E2%80%93Noll%E2%80%93Vo_hash_function) non cryptographic hash of a value. + +```typescript +const A = Value.Hash({ x: 1, y: 2, z: 3 }) // const A = 2910466848807138541n + +const B = Value.Hash({ x: 1, y: 4, z: 3 }) // const B = 1418369778807423581n +``` + + + +### Diff + +Use the Diff function to produce a sequence of edits to transform one value into another. + +```typescript +const E = Value.Diff( // const E = [ + { x: 1, y: 2, z: 3 }, // { type: 'update', path: '/y', value: 4 }, + { y: 4, z: 5, w: 6 } // { type: 'update', path: '/z', value: 5 }, +) // { type: 'insert', path: '/w', value: 6 }, + // { type: 'delete', path: '/x' } + // ] +``` + + + +### Patch + +Use the Patch function to apply edits + +```typescript +const A = { x: 1, y: 2 } + +const B = { x: 3 } + +const E = Value.Diff(A, B) // const E = [ + // { type: 'update', path: '/x', value: 3 }, + // { type: 'delete', path: '/y' } + // ] + +const C = Value.Patch(A, E) // const C = { x: 3 } +``` + + + +### Errors + +Use the Errors function enumerate validation errors. + +```typescript +const T = Type.Object({ x: Type.Number(), y: Type.Number() }) + +const R = [...Value.Errors(T, { x: '42' })] // const R = [{ + // schema: { type: 'number' }, + // path: '/x', + // value: '42', + // message: 'Expected number' + // }, { + // schema: { type: 'number' }, + // path: '/y', + // value: undefined, + // message: 'Expected number' + // }] +``` + + + +### Mutate + +Use the Mutate function to perform a deep mutable value assignment while retaining internal references. + +```typescript +const Y = { z: 1 } // const Y = { z: 1 } + +const X = { y: Y } // const X = { y: { z: 1 } } + +const A = { x: X } // const A = { x: { y: { z: 1 } } } + + +Value.Mutate(A, { x: { y: { z: 2 } } }) // const A' = { x: { y: { z: 2 } } } + +const R0 = A.x.y.z === 2 // const R0 = 2 + +const R1 = A.x.y === Y // const R1 = true + +const R2 = A.x === X // const R2 = true +``` + + + +### Pointer + +Use ValuePointer to perform mutable updates on existing values using [RFC6901](https://www.rfc-editor.org/rfc/rfc6901) JSON Pointers. + +```typescript +import { ValuePointer } from '@sinclair/typebox/value' + +const A = { x: 0, y: 0, z: 0 } + +ValuePointer.Set(A, '/x', 1) // const A' = { x: 1, y: 0, z: 0 } + +ValuePointer.Set(A, '/y', 1) // const A' = { x: 1, y: 1, z: 0 } + +ValuePointer.Set(A, '/z', 1) // const A' = { x: 1, y: 1, z: 1 } +``` + + + +## TypeCheck + +TypeBox types target JSON Schema draft 6 so are compatible with any validator that supports this specification. TypeBox also provides a built in type checking compiler designed specifically for high performance compilation and value assertion. + +The following sections detail using Ajv and TypeBox's compiler infrastructure. + + + +## Ajv + +The following shows the recommended setup for Ajv. + +```bash +$ npm install ajv ajv-formats --save +``` + +```typescript +import { Type } from '@sinclair/typebox' +import addFormats from 'ajv-formats' +import Ajv from 'ajv' + +const ajv = addFormats(new Ajv({}), [ + 'date-time', + 'time', + 'date', + 'email', + 'hostname', + 'ipv4', + 'ipv6', + 'uri', + 'uri-reference', + 'uuid', + 'uri-template', + 'json-pointer', + 'relative-json-pointer', + 'regex' +]) + +const C = ajv.compile(Type.Object({ + x: Type.Number(), + y: Type.Number(), + z: Type.Number() +})) + +const R = C({ x: 1, y: 2, z: 3 }) // const R = true +``` + + + +### TypeCompiler + +The TypeBox TypeCompiler is a high performance JIT compiler that transforms TypeBox types into optimized JavaScript validation routines. The compiler is tuned for fast compilation as well as fast value assertion. It is designed to serve as a validation backend that can be integrated into larger applications; but can also be used as a general purpose validator. + +The TypeCompiler is provided as an optional import. + +```typescript +import { TypeCompiler } from '@sinclair/typebox/compiler' +``` + +Use the `Compile(...)` function to compile a type. + +```typescript +const C = TypeCompiler.Compile(Type.Object({ // const C: TypeCheck> + +const R = C.Check({ x: 1, y: 2, z: 3 }) // const R = true +``` + +Use the `Errors(...)` function to produce diagnostic errors for a value. The `Errors(...)` function will return an iterator that if enumerated; will perform an exhaustive check across the entire value and yield any error found. For performance, this function should only be called after failed `Check(...)`. Applications may also choose to yield only the first value to avoid exhaustive error generation. + +```typescript +const C = TypeCompiler.Compile(Type.Object({ // const C: TypeCheck> + +const value = { } + +const errors = [...C.Errors(value)] // const errors = [{ + // schema: { type: 'number' }, + // path: '/x', + // value: undefined, + // message: 'Expected number' + // }, { + // schema: { type: 'number' }, + // path: '/y', + // value: undefined, + // message: 'Expected number' + // }, { + // schema: { type: 'number' }, + // path: '/z', + // value: undefined, + // message: 'Expected number' + // }] +``` + +Compiled routines can be inspected with the `.Code()` function. + +```typescript +const C = TypeCompiler.Compile(Type.String()) // const C: TypeCheck + +console.log(C.Code()) // return function check(value) { + // return ( + // (typeof value === 'string') + // ) + // } +``` + + + +## TypeSystem + +The TypeBox TypeSystem module provides functionality to define types above and beyond the Standard and Extended type sets as well as control various assertion polices. Configurations made to the TypeSystem module are observed by both `TypeCompiler` and `Value` modules. + +The TypeSystem module is provided as an optional import. + +```typescript +import { TypeSystem } from '@sinclair/typebox/system' +``` + + + +### Types + +Use the `Type(...)` function to create a custom type. This function will return a type factory function that can be used to construct the type. The following creates a Point type. + +```typescript +type PointOptions = { } // The Type Options + +type PointType = { x: number, y: number } // The Static Type + +const Point = TypeSystem.Type('Point', (options, value) => { + return ( + typeof value === 'object' && value !== null && + typeof value.x === 'number' && + typeof value.y === 'number' + ) +}) + +const T = Point() + +type T = Static // type T = { x: number, y: number } + +const R = Value.Check(T, { x: 1, y: 2 }) // const R = true +``` + + + +### Formats + +Use the `Format(...)` function to create a custom string format. The following creates a format that checks for lowercase strings. + +```typescript +TypeSystem.Format('lowercase', value => value === value.toLowerCase()) // format should be lowercase + +const T = Type.String({ format: 'lowercase' }) + +const A = Value.Check(T, 'Hello') // const A = false + +const B = Value.Check(T, 'hello') // const B = true +``` + + + +### Policies + +TypeBox validates using JSON Schema assertion policies by default. It is possible to override these policies and have TypeBox assert using TypeScript policies. The following overrides are available. + +```typescript +// Allow arrays to validate as object types (default is false) +// +// const A: {} = [] - allowed in TS + +TypeSystem.AllowArrayObjects = true + +// Allow numeric values to be NaN or + or - Infinity (default is false) +// +// const A: number = NaN - allowed in TS + +TypeSystem.AllowNaN = true +``` + + + +## Benchmark + +This project maintains a set of benchmarks that measure Ajv, Value and TypeCompiler compilation and validation performance. These benchmarks can be run locally by cloning this repository and running `npm run benchmark`. The results below show for Ajv version 8.12.0. + +For additional comparative benchmarks, please refer to [typescript-runtime-type-benchmarks](https://moltar.github.io/typescript-runtime-type-benchmarks/). + + + +### Compile + +This benchmark measures compilation performance for varying types. You can review this benchmark [here](https://github.com/sinclairzx81/typebox/blob/master/benchmark/measurement/module/compile.ts). + +```typescript +┌────────────────────────────┬────────────┬──────────────┬──────────────┬──────────────┐ +│ (index) │ Iterations │ Ajv │ TypeCompiler │ Performance │ +├────────────────────────────┼────────────┼──────────────┼──────────────┼──────────────┤ +│ Literal_String │ 1000 │ ' 257 ms' │ ' 8 ms' │ ' 32.13 x' │ +│ Literal_Number │ 1000 │ ' 203 ms' │ ' 4 ms' │ ' 50.75 x' │ +│ Literal_Boolean │ 1000 │ ' 183 ms' │ ' 4 ms' │ ' 45.75 x' │ +│ Primitive_Number │ 1000 │ ' 174 ms' │ ' 8 ms' │ ' 21.75 x' │ +│ Primitive_String │ 1000 │ ' 158 ms' │ ' 9 ms' │ ' 17.56 x' │ +│ Primitive_String_Pattern │ 1000 │ ' 213 ms' │ ' 13 ms' │ ' 16.38 x' │ +│ Primitive_Boolean │ 1000 │ ' 136 ms' │ ' 6 ms' │ ' 22.67 x' │ +│ Primitive_Null │ 1000 │ ' 144 ms' │ ' 6 ms' │ ' 24.00 x' │ +│ Object_Unconstrained │ 1000 │ ' 1176 ms' │ ' 38 ms' │ ' 30.95 x' │ +│ Object_Constrained │ 1000 │ ' 1181 ms' │ ' 31 ms' │ ' 38.10 x' │ +│ Object_Vector3 │ 1000 │ ' 387 ms' │ ' 8 ms' │ ' 48.38 x' │ +│ Object_Box3D │ 1000 │ ' 1693 ms' │ ' 25 ms' │ ' 67.72 x' │ +│ Tuple_Primitive │ 1000 │ ' 470 ms' │ ' 15 ms' │ ' 31.33 x' │ +│ Tuple_Object │ 1000 │ ' 1206 ms' │ ' 17 ms' │ ' 70.94 x' │ +│ Composite_Intersect │ 1000 │ ' 567 ms' │ ' 20 ms' │ ' 28.35 x' │ +│ Composite_Union │ 1000 │ ' 515 ms' │ ' 21 ms' │ ' 24.52 x' │ +│ Math_Vector4 │ 1000 │ ' 787 ms' │ ' 10 ms' │ ' 78.70 x' │ +│ Math_Matrix4 │ 1000 │ ' 386 ms' │ ' 8 ms' │ ' 48.25 x' │ +│ Array_Primitive_Number │ 1000 │ ' 349 ms' │ ' 7 ms' │ ' 49.86 x' │ +│ Array_Primitive_String │ 1000 │ ' 336 ms' │ ' 4 ms' │ ' 84.00 x' │ +│ Array_Primitive_Boolean │ 1000 │ ' 284 ms' │ ' 3 ms' │ ' 94.67 x' │ +│ Array_Object_Unconstrained │ 1000 │ ' 1704 ms' │ ' 19 ms' │ ' 89.68 x' │ +│ Array_Object_Constrained │ 1000 │ ' 1456 ms' │ ' 18 ms' │ ' 80.89 x' │ +│ Array_Tuple_Primitive │ 1000 │ ' 792 ms' │ ' 15 ms' │ ' 52.80 x' │ +│ Array_Tuple_Object │ 1000 │ ' 1552 ms' │ ' 17 ms' │ ' 91.29 x' │ +│ Array_Composite_Intersect │ 1000 │ ' 744 ms' │ ' 18 ms' │ ' 41.33 x' │ +│ Array_Composite_Union │ 1000 │ ' 783 ms' │ ' 15 ms' │ ' 52.20 x' │ +│ Array_Math_Vector4 │ 1000 │ ' 1093 ms' │ ' 14 ms' │ ' 78.07 x' │ +│ Array_Math_Matrix4 │ 1000 │ ' 684 ms' │ ' 6 ms' │ ' 114.00 x' │ +└────────────────────────────┴────────────┴──────────────┴──────────────┴──────────────┘ +``` + + + +### Validate + +This benchmark measures validation performance for varying types. You can review this benchmark [here](https://github.com/sinclairzx81/typebox/blob/master/benchmark/measurement/module/check.ts). + +```typescript +┌────────────────────────────┬────────────┬──────────────┬──────────────┬──────────────┬──────────────┐ +│ (index) │ Iterations │ ValueCheck │ Ajv │ TypeCompiler │ Performance │ +├────────────────────────────┼────────────┼──────────────┼──────────────┼──────────────┼──────────────┤ +│ Literal_String │ 1000000 │ ' 27 ms' │ ' 6 ms' │ ' 5 ms' │ ' 1.20 x' │ +│ Literal_Number │ 1000000 │ ' 23 ms' │ ' 21 ms' │ ' 11 ms' │ ' 1.91 x' │ +│ Literal_Boolean │ 1000000 │ ' 21 ms' │ ' 20 ms' │ ' 10 ms' │ ' 2.00 x' │ +│ Primitive_Number │ 1000000 │ ' 26 ms' │ ' 19 ms' │ ' 11 ms' │ ' 1.73 x' │ +│ Primitive_String │ 1000000 │ ' 25 ms' │ ' 19 ms' │ ' 10 ms' │ ' 1.90 x' │ +│ Primitive_String_Pattern │ 1000000 │ ' 155 ms' │ ' 49 ms' │ ' 43 ms' │ ' 1.14 x' │ +│ Primitive_Boolean │ 1000000 │ ' 23 ms' │ ' 19 ms' │ ' 10 ms' │ ' 1.90 x' │ +│ Primitive_Null │ 1000000 │ ' 24 ms' │ ' 19 ms' │ ' 10 ms' │ ' 1.90 x' │ +│ Object_Unconstrained │ 1000000 │ ' 804 ms' │ ' 35 ms' │ ' 28 ms' │ ' 1.25 x' │ +│ Object_Constrained │ 1000000 │ ' 1041 ms' │ ' 55 ms' │ ' 41 ms' │ ' 1.34 x' │ +│ Object_Vector3 │ 1000000 │ ' 380 ms' │ ' 26 ms' │ ' 20 ms' │ ' 1.30 x' │ +│ Object_Box3D │ 1000000 │ ' 1785 ms' │ ' 65 ms' │ ' 52 ms' │ ' 1.25 x' │ +│ Object_Recursive │ 1000000 │ ' 4984 ms' │ ' 396 ms' │ ' 114 ms' │ ' 3.47 x' │ +│ Tuple_Primitive │ 1000000 │ ' 168 ms' │ ' 24 ms' │ ' 16 ms' │ ' 1.50 x' │ +│ Tuple_Object │ 1000000 │ ' 673 ms' │ ' 30 ms' │ ' 26 ms' │ ' 1.15 x' │ +│ Composite_Intersect │ 1000000 │ ' 751 ms' │ ' 28 ms' │ ' 20 ms' │ ' 1.40 x' │ +│ Composite_Union │ 1000000 │ ' 489 ms' │ ' 24 ms' │ ' 16 ms' │ ' 1.50 x' │ +│ Math_Vector4 │ 1000000 │ ' 259 ms' │ ' 23 ms' │ ' 13 ms' │ ' 1.77 x' │ +│ Math_Matrix4 │ 1000000 │ ' 1002 ms' │ ' 40 ms' │ ' 30 ms' │ ' 1.33 x' │ +│ Array_Primitive_Number │ 1000000 │ ' 252 ms' │ ' 22 ms' │ ' 15 ms' │ ' 1.47 x' │ +│ Array_Primitive_String │ 1000000 │ ' 227 ms' │ ' 22 ms' │ ' 18 ms' │ ' 1.22 x' │ +│ Array_Primitive_Boolean │ 1000000 │ ' 150 ms' │ ' 23 ms' │ ' 22 ms' │ ' 1.05 x' │ +│ Array_Object_Unconstrained │ 1000000 │ ' 4754 ms' │ ' 71 ms' │ ' 64 ms' │ ' 1.11 x' │ +│ Array_Object_Constrained │ 1000000 │ ' 4787 ms' │ ' 142 ms' │ ' 123 ms' │ ' 1.15 x' │ +│ Array_Object_Recursive │ 1000000 │ ' 19088 ms' │ ' 1735 ms' │ ' 314 ms' │ ' 5.53 x' │ +│ Array_Tuple_Primitive │ 1000000 │ ' 650 ms' │ ' 41 ms' │ ' 31 ms' │ ' 1.32 x' │ +│ Array_Tuple_Object │ 1000000 │ ' 2770 ms' │ ' 67 ms' │ ' 55 ms' │ ' 1.22 x' │ +│ Array_Composite_Intersect │ 1000000 │ ' 2693 ms' │ ' 50 ms' │ ' 39 ms' │ ' 1.28 x' │ +│ Array_Composite_Union │ 1000000 │ ' 1982 ms' │ ' 72 ms' │ ' 33 ms' │ ' 2.18 x' │ +│ Array_Math_Vector4 │ 1000000 │ ' 1068 ms' │ ' 40 ms' │ ' 26 ms' │ ' 1.54 x' │ +│ Array_Math_Matrix4 │ 1000000 │ ' 4609 ms' │ ' 115 ms' │ ' 88 ms' │ ' 1.31 x' │ +└────────────────────────────┴────────────┴──────────────┴──────────────┴──────────────┴──────────────┘ +``` + + + +### Compression + +The following table lists esbuild compiled and minified sizes for each TypeBox module. + +```typescript +┌──────────────────────┬────────────┬────────────┬─────────────┐ +│ (index) │ Compiled │ Minified │ Compression │ +├──────────────────────┼────────────┼────────────┼─────────────┤ +│ typebox/compiler │ '124.3 kb' │ ' 55.7 kb' │ '2.23 x' │ +│ typebox/errors │ '107.8 kb' │ ' 47.9 kb' │ '2.25 x' │ +│ typebox/system │ ' 73.3 kb' │ ' 30.2 kb' │ '2.43 x' │ +│ typebox/value │ '170.7 kb' │ ' 74.2 kb' │ '2.30 x' │ +│ typebox │ ' 72.0 kb' │ ' 29.7 kb' │ '2.43 x' │ +└──────────────────────┴────────────┴────────────┴─────────────┘ +``` + + + +## Contribute + +TypeBox is open to community contribution. Please ensure you submit an open issue before submitting your pull request. The TypeBox project preferences open community discussion prior to accepting new features. diff --git a/node_modules/@testing-library/dom/node_modules/pretty-format/README.md b/node_modules/@testing-library/dom/node_modules/pretty-format/README.md old mode 100644 new mode 100755 diff --git a/node_modules/@testing-library/jest-dom/types/matchers.d.ts b/node_modules/@testing-library/jest-dom/types/matchers.d.ts old mode 100644 new mode 100755 diff --git a/node_modules/@types/aria-query/README.md b/node_modules/@types/aria-query/README.md index 197aa0720..4f98f5eb2 100644 --- a/node_modules/@types/aria-query/README.md +++ b/node_modules/@types/aria-query/README.md @@ -1,15 +1,15 @@ -# Installation -> `npm install --save @types/aria-query` - -# Summary -This package contains type definitions for aria-query (https://github.com/A11yance/aria-query#readme). - -# Details -Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/aria-query. - -### Additional Details - * Last updated: Mon, 06 Nov 2023 22:41:04 GMT - * Dependencies: none - -# Credits -These definitions were written by [Sebastian Silbermann](https://github.com/eps1lon). +# Installation +> `npm install --save @types/aria-query` + +# Summary +This package contains type definitions for aria-query (https://github.com/A11yance/aria-query#readme). + +# Details +Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/aria-query. + +### Additional Details + * Last updated: Mon, 06 Nov 2023 22:41:04 GMT + * Dependencies: none + +# Credits +These definitions were written by [Sebastian Silbermann](https://github.com/eps1lon). diff --git a/node_modules/@types/babel__core/README.md b/node_modules/@types/babel__core/README.md index 5121fc3ac..3e4c02443 100644 --- a/node_modules/@types/babel__core/README.md +++ b/node_modules/@types/babel__core/README.md @@ -1,15 +1,15 @@ -# 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: Mon, 20 Nov 2023 23:36:23 GMT - * Dependencies: [@babel/parser](https://npmjs.com/package/@babel/parser), [@babel/types](https://npmjs.com/package/@babel/types), [@types/babel__generator](https://npmjs.com/package/@types/babel__generator), [@types/babel__template](https://npmjs.com/package/@types/babel__template), [@types/babel__traverse](https://npmjs.com/package/@types/babel__traverse) - -# 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: Mon, 20 Nov 2023 23:36:23 GMT + * Dependencies: [@babel/parser](https://npmjs.com/package/@babel/parser), [@babel/types](https://npmjs.com/package/@babel/types), [@types/babel__generator](https://npmjs.com/package/@types/babel__generator), [@types/babel__template](https://npmjs.com/package/@types/babel__template), [@types/babel__traverse](https://npmjs.com/package/@types/babel__traverse) + +# 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 d11335c00..f212e5e96 100644 --- a/node_modules/@types/babel__generator/README.md +++ b/node_modules/@types/babel__generator/README.md @@ -1,15 +1,15 @@ -# 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: Sat, 16 Dec 2023 09:06:45 GMT - * Dependencies: [@babel/types](https://npmjs.com/package/@babel/types) - -# Credits -These definitions were written by [Troy Gerwien](https://github.com/yortus), [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: Sat, 16 Dec 2023 09:06:45 GMT + * Dependencies: [@babel/types](https://npmjs.com/package/@babel/types) + +# Credits +These definitions were written by [Troy Gerwien](https://github.com/yortus), [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 63be15687..bc4ea0ba4 100644 --- a/node_modules/@types/babel__template/README.md +++ b/node_modules/@types/babel__template/README.md @@ -1,15 +1,15 @@ -# 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: Mon, 06 Nov 2023 22:41:04 GMT - * Dependencies: [@babel/parser](https://npmjs.com/package/@babel/parser), [@babel/types](https://npmjs.com/package/@babel/types) - -# Credits -These definitions were written by [Troy Gerwien](https://github.com/yortus), [Marvin Hagemeister](https://github.com/marvinhagemeister), [Melvin Groenhoff](https://github.com/mgroenhoff), and [ExE Boss](https://github.com/ExE-Boss). +# 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: Mon, 06 Nov 2023 22:41:04 GMT + * Dependencies: [@babel/parser](https://npmjs.com/package/@babel/parser), [@babel/types](https://npmjs.com/package/@babel/types) + +# Credits +These definitions were written by [Troy Gerwien](https://github.com/yortus), [Marvin Hagemeister](https://github.com/marvinhagemeister), [Melvin Groenhoff](https://github.com/mgroenhoff), and [ExE Boss](https://github.com/ExE-Boss). diff --git a/node_modules/@types/babel__traverse/README.md b/node_modules/@types/babel__traverse/README.md index 3cf97647c..e86e22ead 100644 --- a/node_modules/@types/babel__traverse/README.md +++ b/node_modules/@types/babel__traverse/README.md @@ -1,15 +1,15 @@ -# 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: Sat, 30 Dec 2023 13:06:53 GMT - * Dependencies: [@babel/types](https://npmjs.com/package/@babel/types) - -# 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), [ExE Boss](https://github.com/ExE-Boss), and [Daniel Tschinder](https://github.com/danez). +# 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: Sat, 30 Dec 2023 13:06:53 GMT + * Dependencies: [@babel/types](https://npmjs.com/package/@babel/types) + +# 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), [ExE Boss](https://github.com/ExE-Boss), and [Daniel Tschinder](https://github.com/danez). diff --git a/node_modules/@types/graceful-fs/README.md b/node_modules/@types/graceful-fs/README.md index b43f9715d..0f3ceec22 100644 --- a/node_modules/@types/graceful-fs/README.md +++ b/node_modules/@types/graceful-fs/README.md @@ -1,13 +1,13 @@ -# 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. -## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/graceful-fs/index.d.ts) -````ts +# 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. +## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/graceful-fs/index.d.ts) +````ts /// export * from "fs"; @@ -20,12 +20,12 @@ export * from "fs"; * @param fsModule The reference to the fs module or an fs-like module. */ export function gracefulify(fsModule: T): T; - -```` - -### Additional Details - * Last updated: Tue, 07 Nov 2023 03:09:37 GMT - * Dependencies: [@types/node](https://npmjs.com/package/@types/node) - -# Credits -These definitions were written by [Bart van der Schoor](https://github.com/Bartvds), and [BendingBender](https://github.com/BendingBender). + +```` + +### Additional Details + * Last updated: Tue, 07 Nov 2023 03:09:37 GMT + * Dependencies: [@types/node](https://npmjs.com/package/@types/node) + +# Credits +These definitions were written by [Bart van der Schoor](https://github.com/Bartvds), and [BendingBender](https://github.com/BendingBender). diff --git a/node_modules/@types/istanbul-lib-coverage/README.md b/node_modules/@types/istanbul-lib-coverage/README.md index d575d2aca..73a623126 100644 --- a/node_modules/@types/istanbul-lib-coverage/README.md +++ b/node_modules/@types/istanbul-lib-coverage/README.md @@ -1,15 +1,15 @@ -# 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, 07 Nov 2023 03:09:37 GMT - * Dependencies: none - -# Credits -These definitions were written by [Jason Cheatham](https://github.com/jason0x43). +# 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, 07 Nov 2023 03:09:37 GMT + * Dependencies: none + +# Credits +These definitions were written by [Jason Cheatham](https://github.com/jason0x43). diff --git a/node_modules/@types/istanbul-lib-report/README.md b/node_modules/@types/istanbul-lib-report/README.md index 3c9af87ab..26baae198 100644 --- a/node_modules/@types/istanbul-lib-report/README.md +++ b/node_modules/@types/istanbul-lib-report/README.md @@ -1,15 +1,15 @@ -# 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, 07 Nov 2023 03:09:37 GMT - * Dependencies: [@types/istanbul-lib-coverage](https://npmjs.com/package/@types/istanbul-lib-coverage) - -# 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, 07 Nov 2023 03:09:37 GMT + * Dependencies: [@types/istanbul-lib-coverage](https://npmjs.com/package/@types/istanbul-lib-coverage) + +# 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 f91822793..8a4946c17 100644 --- a/node_modules/@types/istanbul-reports/README.md +++ b/node_modules/@types/istanbul-reports/README.md @@ -1,13 +1,13 @@ -# 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. -## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/istanbul-reports/index.d.ts) -````ts +# 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. +## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/istanbul-reports/index.d.ts) +````ts import { Node, ReportBase } from "istanbul-lib-report"; export function create(name: T, options?: Partial): ReportBase; @@ -75,12 +75,12 @@ export interface LinkMapper { relativePath(source: string | Node, target: string | Node): string; assetPath(node: Node, name: string): string; } - -```` - -### Additional Details - * Last updated: Tue, 07 Nov 2023 03:09:37 GMT - * Dependencies: [@types/istanbul-lib-report](https://npmjs.com/package/@types/istanbul-lib-report) - -# Credits -These definitions were written by [Jason Cheatham](https://github.com/jason0x43), and [Elena Shcherbakova](https://github.com/not-a-doctor). + +```` + +### Additional Details + * Last updated: Tue, 07 Nov 2023 03:09:37 GMT + * Dependencies: [@types/istanbul-lib-report](https://npmjs.com/package/@types/istanbul-lib-report) + +# Credits +These definitions were written by [Jason Cheatham](https://github.com/jason0x43), and [Elena Shcherbakova](https://github.com/not-a-doctor). diff --git a/node_modules/@types/jsdom/LICENSE b/node_modules/@types/jsdom/LICENSE old mode 100644 new mode 100755 diff --git a/node_modules/@types/jsdom/README.md b/node_modules/@types/jsdom/README.md old mode 100644 new mode 100755 index 707026ecd..b8bebf646 --- a/node_modules/@types/jsdom/README.md +++ b/node_modules/@types/jsdom/README.md @@ -1,16 +1,16 @@ -# Installation -> `npm install --save @types/jsdom` - -# Summary -This package contains type definitions for jsdom (https://github.com/jsdom/jsdom). - -# Details -Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/jsdom. - -### Additional Details - * Last updated: Mon, 07 Nov 2022 20:33:46 GMT - * Dependencies: [@types/node](https://npmjs.com/package/@types/node), [@types/parse5](https://npmjs.com/package/@types/parse5), [@types/tough-cookie](https://npmjs.com/package/@types/tough-cookie) - * Global values: none - -# Credits -These definitions were written by [Leonard Thieu](https://github.com/leonard-thieu), [Johan Palmfjord](https://github.com/palmfjord), and [ExE Boss](https://github.com/ExE-Boss). +# Installation +> `npm install --save @types/jsdom` + +# Summary +This package contains type definitions for jsdom (https://github.com/jsdom/jsdom). + +# Details +Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/jsdom. + +### Additional Details + * Last updated: Mon, 07 Nov 2022 20:33:46 GMT + * Dependencies: [@types/node](https://npmjs.com/package/@types/node), [@types/parse5](https://npmjs.com/package/@types/parse5), [@types/tough-cookie](https://npmjs.com/package/@types/tough-cookie) + * Global values: none + +# Credits +These definitions were written by [Leonard Thieu](https://github.com/leonard-thieu), [Johan Palmfjord](https://github.com/palmfjord), and [ExE Boss](https://github.com/ExE-Boss). diff --git a/node_modules/@types/jsdom/base.d.ts b/node_modules/@types/jsdom/base.d.ts old mode 100644 new mode 100755 diff --git a/node_modules/@types/jsdom/index.d.ts b/node_modules/@types/jsdom/index.d.ts old mode 100644 new mode 100755 diff --git a/node_modules/@types/jsdom/package.json b/node_modules/@types/jsdom/package.json old mode 100644 new mode 100755 diff --git a/node_modules/@types/node/README.md b/node_modules/@types/node/README.md index bd0732b60..1281eea19 100644 --- a/node_modules/@types/node/README.md +++ b/node_modules/@types/node/README.md @@ -1,15 +1,15 @@ -# Installation -> `npm install --save @types/node` - -# Summary -This package contains type definitions for node (https://nodejs.org/). - -# Details -Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node. - -### Additional Details - * Last updated: Thu, 29 Feb 2024 15:35:59 GMT - * Dependencies: [undici-types](https://npmjs.com/package/undici-types) - -# Credits -These definitions were written by [Microsoft TypeScript](https://github.com/Microsoft), [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), [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), [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), [Junxiao Shi](https://github.com/yoursunny), [Ilia Baryshnikov](https://github.com/qwelias), [ExE Boss](https://github.com/ExE-Boss), [Piotr Błażejewicz](https://github.com/peterblazejewicz), [Anna Henningsen](https://github.com/addaleax), [Victor Perin](https://github.com/victorperin), [Yongsheng Zhang](https://github.com/ZYSzys), [NodeJS Contributors](https://github.com/NodeJS), [Linus Unnebäck](https://github.com/LinusU), [wafuwafu13](https://github.com/wafuwafu13), [Matteo Collina](https://github.com/mcollina), and [Dmitry Semigradsky](https://github.com/Semigradsky). +# Installation +> `npm install --save @types/node` + +# Summary +This package contains type definitions for node (https://nodejs.org/). + +# Details +Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node. + +### Additional Details + * Last updated: Thu, 29 Feb 2024 15:35:59 GMT + * Dependencies: [undici-types](https://npmjs.com/package/undici-types) + +# Credits +These definitions were written by [Microsoft TypeScript](https://github.com/Microsoft), [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), [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), [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), [Junxiao Shi](https://github.com/yoursunny), [Ilia Baryshnikov](https://github.com/qwelias), [ExE Boss](https://github.com/ExE-Boss), [Piotr Błażejewicz](https://github.com/peterblazejewicz), [Anna Henningsen](https://github.com/addaleax), [Victor Perin](https://github.com/victorperin), [Yongsheng Zhang](https://github.com/ZYSzys), [NodeJS Contributors](https://github.com/NodeJS), [Linus Unnebäck](https://github.com/LinusU), [wafuwafu13](https://github.com/wafuwafu13), [Matteo Collina](https://github.com/mcollina), and [Dmitry Semigradsky](https://github.com/Semigradsky). diff --git a/node_modules/@types/prop-types/README.md b/node_modules/@types/prop-types/README.md index 19331d9d8..9da6ba56f 100644 --- a/node_modules/@types/prop-types/README.md +++ b/node_modules/@types/prop-types/README.md @@ -1,15 +1,15 @@ -# Installation -> `npm install --save @types/prop-types` - -# Summary -This package contains type definitions for prop-types (https://github.com/reactjs/prop-types). - -# Details -Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/prop-types. - -### Additional Details - * Last updated: Mon, 20 Nov 2023 23:36:24 GMT - * Dependencies: none - -# Credits -These definitions were written by [DovydasNavickas](https://github.com/DovydasNavickas), [Ferdy Budhidharma](https://github.com/ferdaber), and [Sebastian Silbermann](https://github.com/eps1lon). +# Installation +> `npm install --save @types/prop-types` + +# Summary +This package contains type definitions for prop-types (https://github.com/reactjs/prop-types). + +# Details +Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/prop-types. + +### Additional Details + * Last updated: Mon, 20 Nov 2023 23:36:24 GMT + * Dependencies: none + +# Credits +These definitions were written by [DovydasNavickas](https://github.com/DovydasNavickas), [Ferdy Budhidharma](https://github.com/ferdaber), and [Sebastian Silbermann](https://github.com/eps1lon). diff --git a/node_modules/@types/react-dom/README.md b/node_modules/@types/react-dom/README.md index 193c5a4d2..8ee4e4599 100644 --- a/node_modules/@types/react-dom/README.md +++ b/node_modules/@types/react-dom/README.md @@ -1,15 +1,15 @@ -# Installation -> `npm install --save @types/react-dom` - -# Summary -This package contains type definitions for react-dom (https://reactjs.org). - -# Details -Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-dom. - -### Additional Details - * Last updated: Tue, 05 Mar 2024 16:36:00 GMT - * Dependencies: [@types/react](https://npmjs.com/package/@types/react) - -# Credits -These definitions were written by [Asana](https://asana.com), [AssureSign](http://www.assuresign.com), [Microsoft](https://microsoft.com), [MartynasZilinskas](https://github.com/MartynasZilinskas), [Josh Rutherford](https://github.com/theruther4d), [Jessica Franco](https://github.com/Jessidhia), and [Sebastian Silbermann](https://github.com/eps1lon). +# Installation +> `npm install --save @types/react-dom` + +# Summary +This package contains type definitions for react-dom (https://reactjs.org). + +# Details +Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-dom. + +### Additional Details + * Last updated: Tue, 05 Mar 2024 16:36:00 GMT + * Dependencies: [@types/react](https://npmjs.com/package/@types/react) + +# Credits +These definitions were written by [Asana](https://asana.com), [AssureSign](http://www.assuresign.com), [Microsoft](https://microsoft.com), [MartynasZilinskas](https://github.com/MartynasZilinskas), [Josh Rutherford](https://github.com/theruther4d), [Jessica Franco](https://github.com/Jessidhia), and [Sebastian Silbermann](https://github.com/eps1lon). diff --git a/node_modules/@types/react-transition-group/README.md b/node_modules/@types/react-transition-group/README.md index 1cee9ff00..57405324a 100644 --- a/node_modules/@types/react-transition-group/README.md +++ b/node_modules/@types/react-transition-group/README.md @@ -1,15 +1,15 @@ -# Installation -> `npm install --save @types/react-transition-group` - -# Summary -This package contains type definitions for react-transition-group (https://github.com/reactjs/react-transition-group). - -# Details -Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-transition-group. - -### Additional Details - * Last updated: Tue, 05 Dec 2023 16:38:07 GMT - * Dependencies: [@types/react](https://npmjs.com/package/@types/react) - -# Credits -These definitions were written by [Karol Janyst](https://github.com/LKay), [Epskampie](https://github.com/Epskampie), [Masafumi Koba](https://github.com/ybiquitous), and [Ben Grynhaus](https://github.com/bengry). +# Installation +> `npm install --save @types/react-transition-group` + +# Summary +This package contains type definitions for react-transition-group (https://github.com/reactjs/react-transition-group). + +# Details +Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-transition-group. + +### Additional Details + * Last updated: Tue, 05 Dec 2023 16:38:07 GMT + * Dependencies: [@types/react](https://npmjs.com/package/@types/react) + +# Credits +These definitions were written by [Karol Janyst](https://github.com/LKay), [Epskampie](https://github.com/Epskampie), [Masafumi Koba](https://github.com/ybiquitous), and [Ben Grynhaus](https://github.com/bengry). diff --git a/node_modules/@types/react/README.md b/node_modules/@types/react/README.md index 6fcceabe6..fc5a87848 100644 --- a/node_modules/@types/react/README.md +++ b/node_modules/@types/react/README.md @@ -1,15 +1,15 @@ -# Installation -> `npm install --save @types/react` - -# Summary -This package contains type definitions for react (https://react.dev/). - -# Details -Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react. - -### Additional Details - * Last updated: Tue, 05 Mar 2024 09:07:02 GMT - * Dependencies: [@types/prop-types](https://npmjs.com/package/@types/prop-types), [@types/scheduler](https://npmjs.com/package/@types/scheduler), [csstype](https://npmjs.com/package/csstype) - -# Credits -These definitions were written by [Asana](https://asana.com), [AssureSign](http://www.assuresign.com), [Microsoft](https://microsoft.com), [John Reilly](https://github.com/johnnyreilly), [Benoit Benezech](https://github.com/bbenezech), [Patricio Zavolinsky](https://github.com/pzavolinsky), [Eric Anderson](https://github.com/ericanderson), [Dovydas Navickas](https://github.com/DovydasNavickas), [Josh Rutherford](https://github.com/theruther4d), [Guilherme Hübner](https://github.com/guilhermehubner), [Ferdy Budhidharma](https://github.com/ferdaber), [Johann Rakotoharisoa](https://github.com/jrakotoharisoa), [Olivier Pascal](https://github.com/pascaloliv), [Martin Hochel](https://github.com/hotell), [Frank Li](https://github.com/franklixuefei), [Jessica Franco](https://github.com/Jessidhia), [Saransh Kataria](https://github.com/saranshkataria), [Kanitkorn Sujautra](https://github.com/lukyth), [Sebastian Silbermann](https://github.com/eps1lon), [Kyle Scully](https://github.com/zieka), [Cong Zhang](https://github.com/dancerphil), [Dimitri Mitropoulos](https://github.com/dimitropoulos), [JongChan Choi](https://github.com/disjukr), [Victor Magalhães](https://github.com/vhfmag), [Dale Tan](https://github.com/hellatan), [Priyanshu Rav](https://github.com/priyanshurav), [Dmitry Semigradsky](https://github.com/Semigradsky), and [Matt Pocock](https://github.com/mattpocock). +# Installation +> `npm install --save @types/react` + +# Summary +This package contains type definitions for react (https://react.dev/). + +# Details +Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react. + +### Additional Details + * Last updated: Tue, 05 Mar 2024 09:07:02 GMT + * Dependencies: [@types/prop-types](https://npmjs.com/package/@types/prop-types), [@types/scheduler](https://npmjs.com/package/@types/scheduler), [csstype](https://npmjs.com/package/csstype) + +# Credits +These definitions were written by [Asana](https://asana.com), [AssureSign](http://www.assuresign.com), [Microsoft](https://microsoft.com), [John Reilly](https://github.com/johnnyreilly), [Benoit Benezech](https://github.com/bbenezech), [Patricio Zavolinsky](https://github.com/pzavolinsky), [Eric Anderson](https://github.com/ericanderson), [Dovydas Navickas](https://github.com/DovydasNavickas), [Josh Rutherford](https://github.com/theruther4d), [Guilherme Hübner](https://github.com/guilhermehubner), [Ferdy Budhidharma](https://github.com/ferdaber), [Johann Rakotoharisoa](https://github.com/jrakotoharisoa), [Olivier Pascal](https://github.com/pascaloliv), [Martin Hochel](https://github.com/hotell), [Frank Li](https://github.com/franklixuefei), [Jessica Franco](https://github.com/Jessidhia), [Saransh Kataria](https://github.com/saranshkataria), [Kanitkorn Sujautra](https://github.com/lukyth), [Sebastian Silbermann](https://github.com/eps1lon), [Kyle Scully](https://github.com/zieka), [Cong Zhang](https://github.com/dancerphil), [Dimitri Mitropoulos](https://github.com/dimitropoulos), [JongChan Choi](https://github.com/disjukr), [Victor Magalhães](https://github.com/vhfmag), [Dale Tan](https://github.com/hellatan), [Priyanshu Rav](https://github.com/priyanshurav), [Dmitry Semigradsky](https://github.com/Semigradsky), and [Matt Pocock](https://github.com/mattpocock). diff --git a/node_modules/@types/scheduler/README.md b/node_modules/@types/scheduler/README.md index b1890d11f..abf6cbee6 100644 --- a/node_modules/@types/scheduler/README.md +++ b/node_modules/@types/scheduler/README.md @@ -1,15 +1,15 @@ -# Installation -> `npm install --save @types/scheduler` - -# Summary -This package contains type definitions for scheduler (https://reactjs.org/). - -# Details -Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/scheduler. - -### Additional Details - * Last updated: Wed, 22 Nov 2023 00:24:48 GMT - * Dependencies: none - -# Credits -These definitions were written by [Nathan Bierema](https://github.com/Methuselah96), and [Sebastian Silbermann](https://github.com/eps1lon). +# Installation +> `npm install --save @types/scheduler` + +# Summary +This package contains type definitions for scheduler (https://reactjs.org/). + +# Details +Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/scheduler. + +### Additional Details + * Last updated: Wed, 22 Nov 2023 00:24:48 GMT + * Dependencies: none + +# Credits +These definitions were written by [Nathan Bierema](https://github.com/Methuselah96), and [Sebastian Silbermann](https://github.com/eps1lon). diff --git a/node_modules/@types/stack-utils/README.md b/node_modules/@types/stack-utils/README.md index cc85c54bc..1a305cdc4 100644 --- a/node_modules/@types/stack-utils/README.md +++ b/node_modules/@types/stack-utils/README.md @@ -1,13 +1,13 @@ -# 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://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/stack-utils. -## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/stack-utils/index.d.ts) -````ts +# 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://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/stack-utils. +## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/stack-utils/index.d.ts) +````ts export = StackUtils; declare class StackUtils { @@ -67,12 +67,12 @@ declare namespace StackUtils { method?: string | undefined; } } - -```` - -### Additional Details - * Last updated: Tue, 07 Nov 2023 15:11:36 GMT - * Dependencies: none - -# Credits -These definitions were written by [BendingBender](https://github.com/BendingBender). + +```` + +### Additional Details + * Last updated: Tue, 07 Nov 2023 15:11:36 GMT + * Dependencies: none + +# Credits +These definitions were written by [BendingBender](https://github.com/BendingBender). diff --git a/node_modules/@types/tough-cookie/README.md b/node_modules/@types/tough-cookie/README.md index 7c5b1e8d2..c889560d8 100644 --- a/node_modules/@types/tough-cookie/README.md +++ b/node_modules/@types/tough-cookie/README.md @@ -1,15 +1,15 @@ -# Installation -> `npm install --save @types/tough-cookie` - -# Summary -This package contains type definitions for tough-cookie (https://github.com/salesforce/tough-cookie). - -# Details -Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/tough-cookie. - -### Additional Details - * Last updated: Tue, 07 Nov 2023 20:08:00 GMT - * Dependencies: none - -# Credits -These definitions were written by [Leonard Thieu](https://github.com/leonard-thieu), [LiJinyao](https://github.com/LiJinyao), and [Michael Wei](https://github.com/no2chem). +# Installation +> `npm install --save @types/tough-cookie` + +# Summary +This package contains type definitions for tough-cookie (https://github.com/salesforce/tough-cookie). + +# Details +Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/tough-cookie. + +### Additional Details + * Last updated: Tue, 07 Nov 2023 20:08:00 GMT + * Dependencies: none + +# Credits +These definitions were written by [Leonard Thieu](https://github.com/leonard-thieu), [LiJinyao](https://github.com/LiJinyao), and [Michael Wei](https://github.com/no2chem). diff --git a/node_modules/@types/warning/README.md b/node_modules/@types/warning/README.md index bfc63c781..b0e2ee21f 100644 --- a/node_modules/@types/warning/README.md +++ b/node_modules/@types/warning/README.md @@ -1,21 +1,21 @@ -# Installation -> `npm install --save @types/warning` - -# Summary -This package contains type definitions for warning (https://github.com/BerkeleyTrue/warning). - -# Details -Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/warning. -## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/warning/index.d.ts) -````ts +# Installation +> `npm install --save @types/warning` + +# Summary +This package contains type definitions for warning (https://github.com/BerkeleyTrue/warning). + +# Details +Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/warning. +## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/warning/index.d.ts) +````ts declare const warning: (condition: any, format?: string, ...extra: any[]) => void; export = warning; - -```` - -### Additional Details - * Last updated: Tue, 07 Nov 2023 15:11:36 GMT - * Dependencies: none - -# Credits -These definitions were written by [Chi Vinh Le](https://github.com/cvle). + +```` + +### Additional Details + * Last updated: Tue, 07 Nov 2023 15:11:36 GMT + * Dependencies: none + +# Credits +These definitions were written by [Chi Vinh Le](https://github.com/cvle). diff --git a/node_modules/@types/webidl-conversions/README.md b/node_modules/@types/webidl-conversions/README.md index a0f3f9def..7cd5c9d66 100644 --- a/node_modules/@types/webidl-conversions/README.md +++ b/node_modules/@types/webidl-conversions/README.md @@ -1,15 +1,15 @@ -# Installation -> `npm install --save @types/webidl-conversions` - -# Summary -This package contains type definitions for webidl-conversions (https://github.com/jsdom/webidl-conversions#readme). - -# Details -Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/webidl-conversions. - -### Additional Details - * Last updated: Tue, 07 Nov 2023 15:11:36 GMT - * Dependencies: none - -# Credits -These definitions were written by [ExE Boss](https://github.com/ExE-Boss), and [BendingBender](https://github.com/BendingBender). +# Installation +> `npm install --save @types/webidl-conversions` + +# Summary +This package contains type definitions for webidl-conversions (https://github.com/jsdom/webidl-conversions#readme). + +# Details +Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/webidl-conversions. + +### Additional Details + * Last updated: Tue, 07 Nov 2023 15:11:36 GMT + * Dependencies: none + +# Credits +These definitions were written by [ExE Boss](https://github.com/ExE-Boss), and [BendingBender](https://github.com/BendingBender). diff --git a/node_modules/@types/whatwg-url/README.md b/node_modules/@types/whatwg-url/README.md index 940de69d0..afba80c58 100644 --- a/node_modules/@types/whatwg-url/README.md +++ b/node_modules/@types/whatwg-url/README.md @@ -1,15 +1,15 @@ -# Installation -> `npm install --save @types/whatwg-url` - -# Summary -This package contains type definitions for whatwg-url (https://github.com/jsdom/whatwg-url#readme). - -# Details -Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/whatwg-url. - -### Additional Details - * Last updated: Tue, 09 Jan 2024 19:06:33 GMT - * Dependencies: [@types/webidl-conversions](https://npmjs.com/package/@types/webidl-conversions) - -# Credits -These definitions were written by [Alexander Marks](https://github.com/aomarks), [ExE Boss](https://github.com/ExE-Boss), and [BendingBender](https://github.com/BendingBender). +# Installation +> `npm install --save @types/whatwg-url` + +# Summary +This package contains type definitions for whatwg-url (https://github.com/jsdom/whatwg-url#readme). + +# Details +Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/whatwg-url. + +### Additional Details + * Last updated: Tue, 09 Jan 2024 19:06:33 GMT + * Dependencies: [@types/webidl-conversions](https://npmjs.com/package/@types/webidl-conversions) + +# Credits +These definitions were written by [Alexander Marks](https://github.com/aomarks), [ExE Boss](https://github.com/ExE-Boss), and [BendingBender](https://github.com/BendingBender). diff --git a/node_modules/@types/yargs-parser/README.md b/node_modules/@types/yargs-parser/README.md index 47ff5a8e0..74ad4e740 100644 --- a/node_modules/@types/yargs-parser/README.md +++ b/node_modules/@types/yargs-parser/README.md @@ -1,15 +1,15 @@ -# 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: Tue, 07 Nov 2023 21:36:25 GMT - * Dependencies: 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: Tue, 07 Nov 2023 21:36:25 GMT + * Dependencies: 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 27a846aa0..e587cdcb6 100644 --- a/node_modules/@types/yargs/README.md +++ b/node_modules/@types/yargs/README.md @@ -1,15 +1,15 @@ -# 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: Mon, 20 Nov 2023 23:36:24 GMT - * Dependencies: [@types/yargs-parser](https://npmjs.com/package/@types/yargs-parser) - -# 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), [Aankhen](https://github.com/Aankhen), and [Ben Coe](https://github.com/bcoe). +# 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: Mon, 20 Nov 2023 23:36:24 GMT + * Dependencies: [@types/yargs-parser](https://npmjs.com/package/@types/yargs-parser) + +# 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), [Aankhen](https://github.com/Aankhen), and [Ben Coe](https://github.com/bcoe). 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/async/lib/async.js b/node_modules/async/lib/async.js old mode 100644 new mode 100755 diff --git a/node_modules/boom/.npmignore b/node_modules/boom/.npmignore index 77ba16cb0..b3bb51763 100644 --- a/node_modules/boom/.npmignore +++ b/node_modules/boom/.npmignore @@ -1,18 +1,18 @@ -.idea -*.iml -npm-debug.log -dump.rdb -node_modules -results.tap -results.xml -npm-shrinkwrap.json -config.json -.DS_Store -*/.DS_Store -*/*/.DS_Store -._* -*/._* -*/*/._* -coverage.* -lib-cov - +.idea +*.iml +npm-debug.log +dump.rdb +node_modules +results.tap +results.xml +npm-shrinkwrap.json +config.json +.DS_Store +*/.DS_Store +*/*/.DS_Store +._* +*/._* +*/*/._* +coverage.* +lib-cov + diff --git a/node_modules/boom/.travis.yml b/node_modules/boom/.travis.yml old mode 100644 new mode 100755 index d8523c933..e27a5fb3b --- a/node_modules/boom/.travis.yml +++ b/node_modules/boom/.travis.yml @@ -1,5 +1,5 @@ -language: node_js - -node_js: - - 0.8 - +language: node_js + +node_js: + - 0.8 + diff --git a/node_modules/boom/LICENSE b/node_modules/boom/LICENSE old mode 100644 new mode 100755 index e699a7bdb..41578cb8d --- a/node_modules/boom/LICENSE +++ b/node_modules/boom/LICENSE @@ -1,24 +1,24 @@ -Copyright (c) 2012-2013, Eran Hammer. -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 Eran Hammer 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 ERAN HAMMER 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. +Copyright (c) 2012-2013, Eran Hammer. +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 Eran Hammer 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 ERAN HAMMER 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. diff --git a/node_modules/boom/Makefile b/node_modules/boom/Makefile old mode 100644 new mode 100755 index 7514e2ab0..4ea486a21 --- a/node_modules/boom/Makefile +++ b/node_modules/boom/Makefile @@ -1,33 +1,33 @@ -REPORTER = dot - -test: - @#lib-cov - @NODE_ENV=test ./node_modules/.bin/mocha --recursive --reporter $(REPORTER) --ignore-leaks --timeout 3000 - @#$(MAKE) rm-lib-cov - -tests: test - -lib-cov: rm-lib-cov - @jscoverage lib lib-cov - -rm-lib-cov: - @rm -rf ./lib-cov/ - -test-cov: lib-cov - @$(MAKE) test TEST_COV=1 REPORTER=json-cov > coverage.json - @$(MAKE) rm-lib-cov - -test-cov-html: lib-cov - @$(MAKE) test TEST_COV=1 REPORTER=html-cov > coverage.html - @$(MAKE) rm-lib-cov - -tap: lib-cov - @NODE_ENV=test ./node_modules/.bin/mocha -R tap > results.tap - @$(MAKE) rm-lib-cov - -unit: - @#lib-cov - @NODE_ENV=test ./node_modules/.bin/mocha --recursive -R xunit --ignore-leaks > results.xml --timeout 3000 - @#$(MAKE) rm-lib-cov - +REPORTER = dot + +test: + @#lib-cov + @NODE_ENV=test ./node_modules/.bin/mocha --recursive --reporter $(REPORTER) --ignore-leaks --timeout 3000 + @#$(MAKE) rm-lib-cov + +tests: test + +lib-cov: rm-lib-cov + @jscoverage lib lib-cov + +rm-lib-cov: + @rm -rf ./lib-cov/ + +test-cov: lib-cov + @$(MAKE) test TEST_COV=1 REPORTER=json-cov > coverage.json + @$(MAKE) rm-lib-cov + +test-cov-html: lib-cov + @$(MAKE) test TEST_COV=1 REPORTER=html-cov > coverage.html + @$(MAKE) rm-lib-cov + +tap: lib-cov + @NODE_ENV=test ./node_modules/.bin/mocha -R tap > results.tap + @$(MAKE) rm-lib-cov + +unit: + @#lib-cov + @NODE_ENV=test ./node_modules/.bin/mocha --recursive -R xunit --ignore-leaks > results.xml --timeout 3000 + @#$(MAKE) rm-lib-cov + .PHONY: test tap test-cov test-cov-html unit lib-cov rm-lib-cov \ No newline at end of file diff --git a/node_modules/boom/README.md b/node_modules/boom/README.md old mode 100644 new mode 100755 index b4a6e2b28..1977ae4c3 --- a/node_modules/boom/README.md +++ b/node_modules/boom/README.md @@ -1,5 +1,5 @@ -# boom - -HTTP-friendly error objects - -[![Build Status](https://secure.travis-ci.org/hueniverse/boom.png)](http://travis-ci.org/hueniverse/boom) +# boom + +HTTP-friendly error objects + +[![Build Status](https://secure.travis-ci.org/hueniverse/boom.png)](http://travis-ci.org/hueniverse/boom) diff --git a/node_modules/boom/index.js b/node_modules/boom/index.js old mode 100644 new mode 100755 diff --git a/node_modules/boom/lib/index.js b/node_modules/boom/lib/index.js old mode 100644 new mode 100755 index 4ed403fc6..8a86a5653 --- a/node_modules/boom/lib/index.js +++ b/node_modules/boom/lib/index.js @@ -1,203 +1,203 @@ -// Load modules - -var Http = require('http'); -var NodeUtil = require('util'); -var Hoek = require('hoek'); - - -// Declare internals - -var internals = {}; - -/* - Boom(new Error) - Boom(code, message) -*/ - -exports = module.exports = internals.Boom = function () { - - var self = this; - - Hoek.assert(this.constructor === internals.Boom, 'Error must be instantiated using new'); - - Error.call(this); - this.isBoom = true; - - this.response = { - code: 0, - payload: {}, - headers: {} - // type: 'content-type' - }; - - if (arguments[0] instanceof Error) { - - // Error - - var error = arguments[0]; - - this.data = error; - this.response.code = error.code || 500; - if (error.message) { - this.message = error.message - } - } - else { - - // code, message - - var code = arguments[0]; - var message = arguments[1]; - - Hoek.assert(!isNaN(parseFloat(code)) && isFinite(code) && code >= 400, 'First argument must be a number (400+)'); - - this.response.code = code; - if (message) { - this.message = message - } - } - - // Response format - - this.reformat(); - - return this; -}; - -NodeUtil.inherits(internals.Boom, Error); - - -internals.Boom.prototype.reformat = function () { - - this.response.payload.code = this.response.code; - this.response.payload.error = Http.STATUS_CODES[this.response.code] || 'Unknown'; - if (this.message) { - this.response.payload.message = this.message; - } -}; - - -// Utilities - -internals.Boom.badRequest = function (message) { - - return new internals.Boom(400, message); -}; - - -internals.Boom.unauthorized = function (error, scheme, attributes) { // Or function (error, wwwAuthenticate[]) - - var err = new internals.Boom(401, error); - - if (!scheme) { - return err; - } - - var wwwAuthenticate = ''; - - if (typeof scheme === 'string') { - - // function (error, scheme, attributes) - - wwwAuthenticate = scheme; - if (attributes) { - var names = Object.keys(attributes); - for (var i = 0, il = names.length; i < il; ++i) { - if (i) { - wwwAuthenticate += ','; - } - - var value = attributes[names[i]]; - if (value === null || - value === undefined) { // Value can be zero - - value = ''; - } - wwwAuthenticate += ' ' + names[i] + '="' + Hoek.escapeHeaderAttribute(value.toString()) + '"'; - } - } - - if (error) { - if (attributes) { - wwwAuthenticate += ','; - } - wwwAuthenticate += ' error="' + Hoek.escapeHeaderAttribute(error) + '"'; - } - else { - err.isMissing = true; - } - } - else { - - // function (error, wwwAuthenticate[]) - - var wwwArray = scheme; - for (var i = 0, il = wwwArray.length; i < il; ++i) { - if (i) { - wwwAuthenticate += ', '; - } - - wwwAuthenticate += wwwArray[i]; - } - } - - err.response.headers['WWW-Authenticate'] = wwwAuthenticate; - - return err; -}; - - -internals.Boom.clientTimeout = function (message) { - - return new internals.Boom(408, message); -}; - - -internals.Boom.serverTimeout = function (message) { - - return new internals.Boom(503, message); -}; - - -internals.Boom.forbidden = function (message) { - - return new internals.Boom(403, message); -}; - - -internals.Boom.notFound = function (message) { - - return new internals.Boom(404, message); -}; - - -internals.Boom.internal = function (message, data) { - - var err = new internals.Boom(500, message); - err.trace = Hoek.displayStack(1); - err.data = data; - err.response.payload.message = 'An internal server error occurred'; // Hide actual error from user - - return err; -}; - - -internals.Boom.passThrough = function (code, payload, contentType, headers) { - - var err = new internals.Boom(500, 'Pass-through'); // 500 code is only used to initialize - - err.data = { - code: code, - payload: payload, - type: contentType - }; - - err.response.code = code; - err.response.type = contentType; - err.response.headers = headers; - err.response.payload = payload; - - return err; -}; - - +// Load modules + +var Http = require('http'); +var NodeUtil = require('util'); +var Hoek = require('hoek'); + + +// Declare internals + +var internals = {}; + +/* + Boom(new Error) + Boom(code, message) +*/ + +exports = module.exports = internals.Boom = function () { + + var self = this; + + Hoek.assert(this.constructor === internals.Boom, 'Error must be instantiated using new'); + + Error.call(this); + this.isBoom = true; + + this.response = { + code: 0, + payload: {}, + headers: {} + // type: 'content-type' + }; + + if (arguments[0] instanceof Error) { + + // Error + + var error = arguments[0]; + + this.data = error; + this.response.code = error.code || 500; + if (error.message) { + this.message = error.message + } + } + else { + + // code, message + + var code = arguments[0]; + var message = arguments[1]; + + Hoek.assert(!isNaN(parseFloat(code)) && isFinite(code) && code >= 400, 'First argument must be a number (400+)'); + + this.response.code = code; + if (message) { + this.message = message + } + } + + // Response format + + this.reformat(); + + return this; +}; + +NodeUtil.inherits(internals.Boom, Error); + + +internals.Boom.prototype.reformat = function () { + + this.response.payload.code = this.response.code; + this.response.payload.error = Http.STATUS_CODES[this.response.code] || 'Unknown'; + if (this.message) { + this.response.payload.message = this.message; + } +}; + + +// Utilities + +internals.Boom.badRequest = function (message) { + + return new internals.Boom(400, message); +}; + + +internals.Boom.unauthorized = function (error, scheme, attributes) { // Or function (error, wwwAuthenticate[]) + + var err = new internals.Boom(401, error); + + if (!scheme) { + return err; + } + + var wwwAuthenticate = ''; + + if (typeof scheme === 'string') { + + // function (error, scheme, attributes) + + wwwAuthenticate = scheme; + if (attributes) { + var names = Object.keys(attributes); + for (var i = 0, il = names.length; i < il; ++i) { + if (i) { + wwwAuthenticate += ','; + } + + var value = attributes[names[i]]; + if (value === null || + value === undefined) { // Value can be zero + + value = ''; + } + wwwAuthenticate += ' ' + names[i] + '="' + Hoek.escapeHeaderAttribute(value.toString()) + '"'; + } + } + + if (error) { + if (attributes) { + wwwAuthenticate += ','; + } + wwwAuthenticate += ' error="' + Hoek.escapeHeaderAttribute(error) + '"'; + } + else { + err.isMissing = true; + } + } + else { + + // function (error, wwwAuthenticate[]) + + var wwwArray = scheme; + for (var i = 0, il = wwwArray.length; i < il; ++i) { + if (i) { + wwwAuthenticate += ', '; + } + + wwwAuthenticate += wwwArray[i]; + } + } + + err.response.headers['WWW-Authenticate'] = wwwAuthenticate; + + return err; +}; + + +internals.Boom.clientTimeout = function (message) { + + return new internals.Boom(408, message); +}; + + +internals.Boom.serverTimeout = function (message) { + + return new internals.Boom(503, message); +}; + + +internals.Boom.forbidden = function (message) { + + return new internals.Boom(403, message); +}; + + +internals.Boom.notFound = function (message) { + + return new internals.Boom(404, message); +}; + + +internals.Boom.internal = function (message, data) { + + var err = new internals.Boom(500, message); + err.trace = Hoek.displayStack(1); + err.data = data; + err.response.payload.message = 'An internal server error occurred'; // Hide actual error from user + + return err; +}; + + +internals.Boom.passThrough = function (code, payload, contentType, headers) { + + var err = new internals.Boom(500, 'Pass-through'); // 500 code is only used to initialize + + err.data = { + code: code, + payload: payload, + type: contentType + }; + + err.response.code = code; + err.response.type = contentType; + err.response.headers = headers; + err.response.payload = payload; + + return err; +}; + + diff --git a/node_modules/boom/node_modules/hoek/.npmignore b/node_modules/boom/node_modules/hoek/.npmignore index 77ba16cb0..b3bb51763 100644 --- a/node_modules/boom/node_modules/hoek/.npmignore +++ b/node_modules/boom/node_modules/hoek/.npmignore @@ -1,18 +1,18 @@ -.idea -*.iml -npm-debug.log -dump.rdb -node_modules -results.tap -results.xml -npm-shrinkwrap.json -config.json -.DS_Store -*/.DS_Store -*/*/.DS_Store -._* -*/._* -*/*/._* -coverage.* -lib-cov - +.idea +*.iml +npm-debug.log +dump.rdb +node_modules +results.tap +results.xml +npm-shrinkwrap.json +config.json +.DS_Store +*/.DS_Store +*/*/.DS_Store +._* +*/._* +*/*/._* +coverage.* +lib-cov + diff --git a/node_modules/boom/node_modules/hoek/.travis.yml b/node_modules/boom/node_modules/hoek/.travis.yml old mode 100644 new mode 100755 index d8523c933..e27a5fb3b --- a/node_modules/boom/node_modules/hoek/.travis.yml +++ b/node_modules/boom/node_modules/hoek/.travis.yml @@ -1,5 +1,5 @@ -language: node_js - -node_js: - - 0.8 - +language: node_js + +node_js: + - 0.8 + diff --git a/node_modules/boom/node_modules/hoek/LICENSE b/node_modules/boom/node_modules/hoek/LICENSE old mode 100644 new mode 100755 index 87c1f4e11..394adcff2 --- a/node_modules/boom/node_modules/hoek/LICENSE +++ b/node_modules/boom/node_modules/hoek/LICENSE @@ -1,33 +1,33 @@ -Copyright (c) 2011-2013, Walmart. -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 Walmart 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 WALMART 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. - - - * * * - - -Portions of this project were initially based on Postmile, Copyright (c) 2011, Yahoo Inc. -Postmile is published at https://github.com/yahoo/postmile and its licensing terms are -published at https://github.com/yahoo/postmile/blob/master/LICENSE. - +Copyright (c) 2011-2013, Walmart. +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 Walmart 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 WALMART 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. + + + * * * + + +Portions of this project were initially based on Postmile, Copyright (c) 2011, Yahoo Inc. +Postmile is published at https://github.com/yahoo/postmile and its licensing terms are +published at https://github.com/yahoo/postmile/blob/master/LICENSE. + diff --git a/node_modules/boom/node_modules/hoek/Makefile b/node_modules/boom/node_modules/hoek/Makefile old mode 100644 new mode 100755 index 7514e2ab0..4ea486a21 --- a/node_modules/boom/node_modules/hoek/Makefile +++ b/node_modules/boom/node_modules/hoek/Makefile @@ -1,33 +1,33 @@ -REPORTER = dot - -test: - @#lib-cov - @NODE_ENV=test ./node_modules/.bin/mocha --recursive --reporter $(REPORTER) --ignore-leaks --timeout 3000 - @#$(MAKE) rm-lib-cov - -tests: test - -lib-cov: rm-lib-cov - @jscoverage lib lib-cov - -rm-lib-cov: - @rm -rf ./lib-cov/ - -test-cov: lib-cov - @$(MAKE) test TEST_COV=1 REPORTER=json-cov > coverage.json - @$(MAKE) rm-lib-cov - -test-cov-html: lib-cov - @$(MAKE) test TEST_COV=1 REPORTER=html-cov > coverage.html - @$(MAKE) rm-lib-cov - -tap: lib-cov - @NODE_ENV=test ./node_modules/.bin/mocha -R tap > results.tap - @$(MAKE) rm-lib-cov - -unit: - @#lib-cov - @NODE_ENV=test ./node_modules/.bin/mocha --recursive -R xunit --ignore-leaks > results.xml --timeout 3000 - @#$(MAKE) rm-lib-cov - +REPORTER = dot + +test: + @#lib-cov + @NODE_ENV=test ./node_modules/.bin/mocha --recursive --reporter $(REPORTER) --ignore-leaks --timeout 3000 + @#$(MAKE) rm-lib-cov + +tests: test + +lib-cov: rm-lib-cov + @jscoverage lib lib-cov + +rm-lib-cov: + @rm -rf ./lib-cov/ + +test-cov: lib-cov + @$(MAKE) test TEST_COV=1 REPORTER=json-cov > coverage.json + @$(MAKE) rm-lib-cov + +test-cov-html: lib-cov + @$(MAKE) test TEST_COV=1 REPORTER=html-cov > coverage.html + @$(MAKE) rm-lib-cov + +tap: lib-cov + @NODE_ENV=test ./node_modules/.bin/mocha -R tap > results.tap + @$(MAKE) rm-lib-cov + +unit: + @#lib-cov + @NODE_ENV=test ./node_modules/.bin/mocha --recursive -R xunit --ignore-leaks > results.xml --timeout 3000 + @#$(MAKE) rm-lib-cov + .PHONY: test tap test-cov test-cov-html unit lib-cov rm-lib-cov \ No newline at end of file diff --git a/node_modules/boom/node_modules/hoek/README.md b/node_modules/boom/node_modules/hoek/README.md old mode 100644 new mode 100755 index a92235241..5b8ed6bf6 --- a/node_modules/boom/node_modules/hoek/README.md +++ b/node_modules/boom/node_modules/hoek/README.md @@ -1,7 +1,7 @@ - -![hoek Logo](/images/hoek.png) - -General purpose node utilities - -[![Build Status](https://secure.travis-ci.org/walmartlabs/hoek.png)](http://travis-ci.org/walmartlabs/hoek) - + +![hoek Logo](/images/hoek.png) + +General purpose node utilities + +[![Build Status](https://secure.travis-ci.org/walmartlabs/hoek.png)](http://travis-ci.org/walmartlabs/hoek) + diff --git a/node_modules/boom/node_modules/hoek/images/hoek.png b/node_modules/boom/node_modules/hoek/images/hoek.png old mode 100644 new mode 100755 diff --git a/node_modules/boom/node_modules/hoek/index.js b/node_modules/boom/node_modules/hoek/index.js old mode 100644 new mode 100755 diff --git a/node_modules/boom/node_modules/hoek/lib/index.js b/node_modules/boom/node_modules/hoek/lib/index.js old mode 100644 new mode 100755 index b9b31d412..6c1fcad19 --- a/node_modules/boom/node_modules/hoek/lib/index.js +++ b/node_modules/boom/node_modules/hoek/lib/index.js @@ -1,491 +1,491 @@ -// Load modules - -var Fs = require('fs'); - - -// Declare internals - -var internals = {}; - - -// Clone object or array - -exports.clone = function (obj) { - - if (obj === null || - obj === undefined) { - - return null; - } - - var newObj = (obj instanceof Array) ? [] : {}; - - for (var i in obj) { - if (obj.hasOwnProperty(i)) { - if (obj[i] instanceof Date) { - newObj[i] = new Date(obj[i].getTime()); - } - else if (obj[i] instanceof RegExp) { - var flags = '' + (obj[i].global ? 'g' : '') + (obj[i].ignoreCase ? 'i' : '') + (obj[i].multiline ? 'm' : '') + (obj[i].sticky ? 'y' : ''); - newObj[i] = new RegExp(obj[i].source, flags); - } - else if (typeof obj[i] === 'object') { - newObj[i] = exports.clone(obj[i]); - } - else { - newObj[i] = obj[i]; - } - } - } - - return newObj; -}; - - -// Merge all the properties of source into target, source wins in conflic, and by default null and undefined from source are applied - -exports.merge = function (target, source, isNullOverride /* = true */, isMergeArrays /* = true */) { - - if (source) { - if (source instanceof Array) { - if (isMergeArrays !== false) { // Defaults to true - target = (target || []).concat(source); - } - else { - target = source; - } - } - else { - target = target || {}; - - for (var key in source) { - if (source.hasOwnProperty(key)) { - var value = source[key]; - - if (value && - typeof value === 'object') { - - if (value instanceof Date) { - target[key] = new Date(value.getTime()); - } - else if (value instanceof RegExp) { - var flags = '' + (value.global ? 'g' : '') + (value.ignoreCase ? 'i' : '') + (value.multiline ? 'm' : '') + (value.sticky ? 'y' : ''); - target[key] = new RegExp(value.source, flags); - } - else { - target[key] = exports.merge(target[key], source[key], isNullOverride, isMergeArrays); - } - } - else { - if (value !== null && value !== undefined) { // Explicit to preserve empty strings - target[key] = value; - } - else if (isNullOverride !== false) { // Defaults to true - target[key] = value; - } - } - } - } - } - } - - return target; -}; - - -// Apply options to a copy of the defaults - -exports.applyToDefaults = function (defaults, options) { - - if (!options) { // If no options, return null - return null; - } - - var copy = exports.clone(defaults); - - if (options === true) { // If options is set to true, use defaults - return copy; - } - - return exports.merge(copy, options, false, false); -}; - - -// Remove duplicate items from array - -exports.unique = function (array, key) { - - var index = {}; - var result = []; - - for (var i = 0, il = array.length; i < il; ++i) { - var id = (key ? array[i][key] : array[i]); - if (index[id] !== true) { - - result.push(array[i]); - index[id] = true; - } - } - - return result; -}; - - -// Convert array into object - -exports.mapToObject = function (array, key) { - - if (!array) { - return null; - } - - var obj = {}; - for (var i = 0, il = array.length; i < il; ++i) { - if (key) { - if (array[i][key]) { - obj[array[i][key]] = true; - } - } - else { - obj[array[i]] = true; - } - } - - return obj; -}; - - -// Find the common unique items in two arrays - -exports.intersect = function (array1, array2) { - - if (!array1 || !array2) { - return []; - } - - var common = []; - var hash = exports.mapToObject(array1); - var found = {}; - for (var i = 0, il = array2.length; i < il; ++i) { - if (hash[array2[i]] && !found[array2[i]]) { - common.push(array2[i]); - found[array2[i]] = true; - } - } - - return common; -}; - - -// Find which keys are present - -exports.matchKeys = function (obj, keys) { - - var matched = []; - for (var i = 0, il = keys.length; i < il; ++i) { - if (obj.hasOwnProperty(keys[i])) { - matched.push(keys[i]); - } - } - return matched; -}; - - -// Flatten array - -exports.flatten = function (array, target) { - - var result = target || []; - - for (var i = 0, il = array.length; i < il; ++i) { - if (Array.isArray(array[i])) { - exports.flatten(array[i], result); - } - else { - result.push(array[i]); - } - } - - return result; -}; - - -// Remove keys - -exports.removeKeys = function (object, keys) { - - for (var i = 0, il = keys.length; i < il; i++) { - delete object[keys[i]]; - } -}; - - -// Convert an object key chain string ('a.b.c') to reference (object[a][b][c]) - -exports.reach = function (obj, chain) { - - var path = chain.split('.'); - var ref = obj; - path.forEach(function (level) { - - if (ref) { - ref = ref[level]; - } - }); - - return ref; -}; - - -// Inherits a selected set of methods from an object, wrapping functions in asynchronous syntax and catching errors - -exports.inheritAsync = function (self, obj, keys) { - - keys = keys || null; - - for (var i in obj) { - if (obj.hasOwnProperty(i)) { - if (keys instanceof Array && - keys.indexOf(i) < 0) { - - continue; - } - - self.prototype[i] = (function (fn) { - - return function (callback) { - - var result = null; - try { - result = fn(); - } - catch (err) { - return callback(err); - } - - return callback(null, result); - }; - })(obj[i]); - } - } -}; - - -exports.callStack = function (slice) { - - // http://code.google.com/p/v8/wiki/JavaScriptStackTraceApi - - var v8 = Error.prepareStackTrace; - Error.prepareStackTrace = function (err, stack) { - - return stack; - }; - - var capture = {}; - Error.captureStackTrace(capture, arguments.callee); - var stack = capture.stack; - - Error.prepareStackTrace = v8; - - var trace = []; - stack.forEach(function (item) { - - trace.push([item.getFileName(), item.getLineNumber(), item.getColumnNumber(), item.getFunctionName(), item.isConstructor()]); - }); - - if (slice) { - return trace.slice(slice); - } - - return trace; -}; - - -exports.displayStack = function (slice) { - - var trace = exports.callStack(slice === undefined ? 1 : slice + 1); - var display = []; - trace.forEach(function (row) { - - display.push((row[4] ? 'new ' : '') + row[3] + ' (' + row[0] + ':' + row[1] + ':' + row[2] + ')'); - }); - - return display; -}; - - -exports.abort = function (message) { - - if (process.env.NODE_ENV === 'test') { - throw new Error(message || 'Unknown error'); - } - else { - console.log('ABORT: ' + message + '\n\t' + exports.displayStack(1).join('\n\t')); - process.exit(1); - } -}; - - -exports.assert = function (condition, message) { - - if (!condition) { - exports.abort(message); - } -}; - - -exports.loadDirModules = function (path, excludeFiles, target) { // target(filename, name, capName) - - var exclude = {}; - for (var i = 0, il = excludeFiles.length; i < il; ++i) { - exclude[excludeFiles[i] + '.js'] = true; - } - - Fs.readdirSync(path).forEach(function (filename) { - - if (/\.js$/.test(filename) && - !exclude[filename]) { - - var name = filename.substr(0, filename.lastIndexOf('.')); - var capName = name.charAt(0).toUpperCase() + name.substr(1).toLowerCase(); - - if (typeof target !== 'function') { - target[capName] = require(path + '/' + name); - } - else { - target(path + '/' + name, name, capName); - } - } - }); -}; - - -exports.rename = function (obj, from, to) { - - obj[to] = obj[from]; - delete obj[from]; -}; - - -exports.Timer = function () { - - this.reset(); -}; - - -exports.Timer.prototype.reset = function () { - - this.ts = Date.now(); -}; - - -exports.Timer.prototype.elapsed = function () { - - return Date.now() - this.ts; -}; - - -// Load and parse package.json process root or given directory - -exports.loadPackage = function (dir) { - - var result = {}; - var filepath = (dir || process.env.PWD) + '/package.json'; - if (Fs.existsSync(filepath)) { - try { - result = JSON.parse(Fs.readFileSync(filepath)); - } - catch (e) { } - } - - return result; -}; - - -// Escape string for Regex construction - -exports.escapeRegex = function (string) { - - // Escape ^$.*+-?=!:|\/()[]{}, - return string.replace(/[\^\$\.\*\+\-\?\=\!\:\|\\\/\(\)\[\]\{\}\,]/g, '\\$&'); -}; - - -// Return an error as first argument of a callback - -exports.toss = function (condition /*, [message], callback */) { - - var message = (arguments.length === 3 ? arguments[1] : ''); - var callback = (arguments.length === 3 ? arguments[2] : arguments[1]); - - var err = (message instanceof Error ? message : (message ? new Error(message) : (condition instanceof Error ? condition : new Error()))); - - if (condition instanceof Error || - !condition) { - - return callback(err); - } -}; - - -// Base64url (RFC 4648) encode - -exports.base64urlEncode = function (value) { - - return (new Buffer(value, 'binary')).toString('base64').replace(/\+/g, '-').replace(/\//g, '_').replace(/\=/g, ''); -}; - - -// Base64url (RFC 4648) decode - -exports.base64urlDecode = function (encoded) { - - if (encoded && - !encoded.match(/^[\w\-]*$/)) { - - return new Error('Invalid character'); - } - - try { - return (new Buffer(encoded.replace(/-/g, '+').replace(/:/g, '/'), 'base64')).toString('binary'); - } - catch (err) { - return err; - } -}; - - -// Escape attribute value for use in HTTP header - -exports.escapeHeaderAttribute = function (attribute) { - - return attribute.replace(/\\/g, '\\\\').replace(/\"/g, '\\"'); -}; - - -// Escape string for inclusion in HTML - -internals.htmlEscaped = { - '&': '&', - '<': '<', - '>': '>', - '"': '"', - "'": ''', - '`': '`' -}; - -exports.escapeHtml = function (string) { - - if (!string) { - return ''; - } - - if (/[&<>"'`]/.test(string) === false) { - return string; - } - - return string.replace(/[&<>"'`]/g, function (chr) { - - return internals.htmlEscaped[chr]; - }); -}; +// Load modules + +var Fs = require('fs'); + + +// Declare internals + +var internals = {}; + + +// Clone object or array + +exports.clone = function (obj) { + + if (obj === null || + obj === undefined) { + + return null; + } + + var newObj = (obj instanceof Array) ? [] : {}; + + for (var i in obj) { + if (obj.hasOwnProperty(i)) { + if (obj[i] instanceof Date) { + newObj[i] = new Date(obj[i].getTime()); + } + else if (obj[i] instanceof RegExp) { + var flags = '' + (obj[i].global ? 'g' : '') + (obj[i].ignoreCase ? 'i' : '') + (obj[i].multiline ? 'm' : '') + (obj[i].sticky ? 'y' : ''); + newObj[i] = new RegExp(obj[i].source, flags); + } + else if (typeof obj[i] === 'object') { + newObj[i] = exports.clone(obj[i]); + } + else { + newObj[i] = obj[i]; + } + } + } + + return newObj; +}; + + +// Merge all the properties of source into target, source wins in conflic, and by default null and undefined from source are applied + +exports.merge = function (target, source, isNullOverride /* = true */, isMergeArrays /* = true */) { + + if (source) { + if (source instanceof Array) { + if (isMergeArrays !== false) { // Defaults to true + target = (target || []).concat(source); + } + else { + target = source; + } + } + else { + target = target || {}; + + for (var key in source) { + if (source.hasOwnProperty(key)) { + var value = source[key]; + + if (value && + typeof value === 'object') { + + if (value instanceof Date) { + target[key] = new Date(value.getTime()); + } + else if (value instanceof RegExp) { + var flags = '' + (value.global ? 'g' : '') + (value.ignoreCase ? 'i' : '') + (value.multiline ? 'm' : '') + (value.sticky ? 'y' : ''); + target[key] = new RegExp(value.source, flags); + } + else { + target[key] = exports.merge(target[key], source[key], isNullOverride, isMergeArrays); + } + } + else { + if (value !== null && value !== undefined) { // Explicit to preserve empty strings + target[key] = value; + } + else if (isNullOverride !== false) { // Defaults to true + target[key] = value; + } + } + } + } + } + } + + return target; +}; + + +// Apply options to a copy of the defaults + +exports.applyToDefaults = function (defaults, options) { + + if (!options) { // If no options, return null + return null; + } + + var copy = exports.clone(defaults); + + if (options === true) { // If options is set to true, use defaults + return copy; + } + + return exports.merge(copy, options, false, false); +}; + + +// Remove duplicate items from array + +exports.unique = function (array, key) { + + var index = {}; + var result = []; + + for (var i = 0, il = array.length; i < il; ++i) { + var id = (key ? array[i][key] : array[i]); + if (index[id] !== true) { + + result.push(array[i]); + index[id] = true; + } + } + + return result; +}; + + +// Convert array into object + +exports.mapToObject = function (array, key) { + + if (!array) { + return null; + } + + var obj = {}; + for (var i = 0, il = array.length; i < il; ++i) { + if (key) { + if (array[i][key]) { + obj[array[i][key]] = true; + } + } + else { + obj[array[i]] = true; + } + } + + return obj; +}; + + +// Find the common unique items in two arrays + +exports.intersect = function (array1, array2) { + + if (!array1 || !array2) { + return []; + } + + var common = []; + var hash = exports.mapToObject(array1); + var found = {}; + for (var i = 0, il = array2.length; i < il; ++i) { + if (hash[array2[i]] && !found[array2[i]]) { + common.push(array2[i]); + found[array2[i]] = true; + } + } + + return common; +}; + + +// Find which keys are present + +exports.matchKeys = function (obj, keys) { + + var matched = []; + for (var i = 0, il = keys.length; i < il; ++i) { + if (obj.hasOwnProperty(keys[i])) { + matched.push(keys[i]); + } + } + return matched; +}; + + +// Flatten array + +exports.flatten = function (array, target) { + + var result = target || []; + + for (var i = 0, il = array.length; i < il; ++i) { + if (Array.isArray(array[i])) { + exports.flatten(array[i], result); + } + else { + result.push(array[i]); + } + } + + return result; +}; + + +// Remove keys + +exports.removeKeys = function (object, keys) { + + for (var i = 0, il = keys.length; i < il; i++) { + delete object[keys[i]]; + } +}; + + +// Convert an object key chain string ('a.b.c') to reference (object[a][b][c]) + +exports.reach = function (obj, chain) { + + var path = chain.split('.'); + var ref = obj; + path.forEach(function (level) { + + if (ref) { + ref = ref[level]; + } + }); + + return ref; +}; + + +// Inherits a selected set of methods from an object, wrapping functions in asynchronous syntax and catching errors + +exports.inheritAsync = function (self, obj, keys) { + + keys = keys || null; + + for (var i in obj) { + if (obj.hasOwnProperty(i)) { + if (keys instanceof Array && + keys.indexOf(i) < 0) { + + continue; + } + + self.prototype[i] = (function (fn) { + + return function (callback) { + + var result = null; + try { + result = fn(); + } + catch (err) { + return callback(err); + } + + return callback(null, result); + }; + })(obj[i]); + } + } +}; + + +exports.callStack = function (slice) { + + // http://code.google.com/p/v8/wiki/JavaScriptStackTraceApi + + var v8 = Error.prepareStackTrace; + Error.prepareStackTrace = function (err, stack) { + + return stack; + }; + + var capture = {}; + Error.captureStackTrace(capture, arguments.callee); + var stack = capture.stack; + + Error.prepareStackTrace = v8; + + var trace = []; + stack.forEach(function (item) { + + trace.push([item.getFileName(), item.getLineNumber(), item.getColumnNumber(), item.getFunctionName(), item.isConstructor()]); + }); + + if (slice) { + return trace.slice(slice); + } + + return trace; +}; + + +exports.displayStack = function (slice) { + + var trace = exports.callStack(slice === undefined ? 1 : slice + 1); + var display = []; + trace.forEach(function (row) { + + display.push((row[4] ? 'new ' : '') + row[3] + ' (' + row[0] + ':' + row[1] + ':' + row[2] + ')'); + }); + + return display; +}; + + +exports.abort = function (message) { + + if (process.env.NODE_ENV === 'test') { + throw new Error(message || 'Unknown error'); + } + else { + console.log('ABORT: ' + message + '\n\t' + exports.displayStack(1).join('\n\t')); + process.exit(1); + } +}; + + +exports.assert = function (condition, message) { + + if (!condition) { + exports.abort(message); + } +}; + + +exports.loadDirModules = function (path, excludeFiles, target) { // target(filename, name, capName) + + var exclude = {}; + for (var i = 0, il = excludeFiles.length; i < il; ++i) { + exclude[excludeFiles[i] + '.js'] = true; + } + + Fs.readdirSync(path).forEach(function (filename) { + + if (/\.js$/.test(filename) && + !exclude[filename]) { + + var name = filename.substr(0, filename.lastIndexOf('.')); + var capName = name.charAt(0).toUpperCase() + name.substr(1).toLowerCase(); + + if (typeof target !== 'function') { + target[capName] = require(path + '/' + name); + } + else { + target(path + '/' + name, name, capName); + } + } + }); +}; + + +exports.rename = function (obj, from, to) { + + obj[to] = obj[from]; + delete obj[from]; +}; + + +exports.Timer = function () { + + this.reset(); +}; + + +exports.Timer.prototype.reset = function () { + + this.ts = Date.now(); +}; + + +exports.Timer.prototype.elapsed = function () { + + return Date.now() - this.ts; +}; + + +// Load and parse package.json process root or given directory + +exports.loadPackage = function (dir) { + + var result = {}; + var filepath = (dir || process.env.PWD) + '/package.json'; + if (Fs.existsSync(filepath)) { + try { + result = JSON.parse(Fs.readFileSync(filepath)); + } + catch (e) { } + } + + return result; +}; + + +// Escape string for Regex construction + +exports.escapeRegex = function (string) { + + // Escape ^$.*+-?=!:|\/()[]{}, + return string.replace(/[\^\$\.\*\+\-\?\=\!\:\|\\\/\(\)\[\]\{\}\,]/g, '\\$&'); +}; + + +// Return an error as first argument of a callback + +exports.toss = function (condition /*, [message], callback */) { + + var message = (arguments.length === 3 ? arguments[1] : ''); + var callback = (arguments.length === 3 ? arguments[2] : arguments[1]); + + var err = (message instanceof Error ? message : (message ? new Error(message) : (condition instanceof Error ? condition : new Error()))); + + if (condition instanceof Error || + !condition) { + + return callback(err); + } +}; + + +// Base64url (RFC 4648) encode + +exports.base64urlEncode = function (value) { + + return (new Buffer(value, 'binary')).toString('base64').replace(/\+/g, '-').replace(/\//g, '_').replace(/\=/g, ''); +}; + + +// Base64url (RFC 4648) decode + +exports.base64urlDecode = function (encoded) { + + if (encoded && + !encoded.match(/^[\w\-]*$/)) { + + return new Error('Invalid character'); + } + + try { + return (new Buffer(encoded.replace(/-/g, '+').replace(/:/g, '/'), 'base64')).toString('binary'); + } + catch (err) { + return err; + } +}; + + +// Escape attribute value for use in HTTP header + +exports.escapeHeaderAttribute = function (attribute) { + + return attribute.replace(/\\/g, '\\\\').replace(/\"/g, '\\"'); +}; + + +// Escape string for inclusion in HTML + +internals.htmlEscaped = { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + "'": ''', + '`': '`' +}; + +exports.escapeHtml = function (string) { + + if (!string) { + return ''; + } + + if (/[&<>"'`]/.test(string) === false) { + return string; + } + + return string.replace(/[&<>"'`]/g, function (chr) { + + return internals.htmlEscaped[chr]; + }); +}; diff --git a/node_modules/boom/node_modules/hoek/package.json b/node_modules/boom/node_modules/hoek/package.json old mode 100644 new mode 100755 index 3b3ae3933..03b63972e --- a/node_modules/boom/node_modules/hoek/package.json +++ b/node_modules/boom/node_modules/hoek/package.json @@ -1,32 +1,32 @@ -{ - "name": "hoek", - "description": "General purpose node utilities", - "version": "0.4.2", - "author": "Eran Hammer (http://hueniverse.com)", - "contributors":[ - "Van Nguyen " - ], - "repository": "git://github.com/walmartlabs/hoek", - "main": "index", - "keywords": [ - "utilities" - ], - "engines": { - "node": ">=0.8.0" - }, - "dependencies": { - }, - "devDependencies": { - "mocha": "1.x.x", - "chai": "1.x.x" - }, - "scripts": { - "test": "make test && make unit" - }, - "licenses": [ - { - "type": "BSD", - "url": "http://github.com/walmartlabs/hoek/raw/master/LICENSE" - } - ] -} +{ + "name": "hoek", + "description": "General purpose node utilities", + "version": "0.4.2", + "author": "Eran Hammer (http://hueniverse.com)", + "contributors":[ + "Van Nguyen " + ], + "repository": "git://github.com/walmartlabs/hoek", + "main": "index", + "keywords": [ + "utilities" + ], + "engines": { + "node": ">=0.8.0" + }, + "dependencies": { + }, + "devDependencies": { + "mocha": "1.x.x", + "chai": "1.x.x" + }, + "scripts": { + "test": "make test && make unit" + }, + "licenses": [ + { + "type": "BSD", + "url": "http://github.com/walmartlabs/hoek/raw/master/LICENSE" + } + ] +} diff --git a/node_modules/boom/node_modules/hoek/test/index.js b/node_modules/boom/node_modules/hoek/test/index.js old mode 100644 new mode 100755 index 0668d36e7..d4de13bf3 --- a/node_modules/boom/node_modules/hoek/test/index.js +++ b/node_modules/boom/node_modules/hoek/test/index.js @@ -1,589 +1,589 @@ -// Load modules - -var Chai = require('chai'); -var Hoek = process.env.TEST_COV ? require('../lib-cov') : require('../lib'); - - -// Declare internals - -var internals = {}; - - -// Test shortcuts - -var expect = Chai.expect; - - -describe('Hoek', function () { - - var nestedObj = { - w: /^something$/ig, - x: { - a: [1, 2, 3], - b: 123456, - c: new Date() - }, - y: 'y', - z: new Date() - }; - - var dupsArray = [nestedObj, { z: 'z' }, nestedObj]; - var reducedDupsArray = [nestedObj, { z: 'z' }]; - - describe('#clone', function () { - - it('should clone a nested object', function (done) { - - var a = nestedObj; - var b = Hoek.clone(a); - - expect(a).to.deep.equal(b) - expect(a.z.getTime()).to.equal(b.z.getTime()); - done(); - }) - - it('should clone a null object', function (done) { - - var b = Hoek.clone(null); - - expect(b).to.equal(null); - done(); - }) - }); - - describe('#merge', function () { - - it('should combine an empty object with a non-empty object', function (done) { - - var a = {}; - var b = nestedObj; - - var c = Hoek.merge(a, b); - expect(a).to.deep.equal(b); - expect(c).to.deep.equal(b); - done(); - }); - - it('should override values in target', function (done) { - - var a = { x: 1, y: 2, z: 3, v: 5 }; - var b = { x: null, z: 4, v: 0 }; - - var c = Hoek.merge(a, b); - expect(c.x).to.equal(null); - expect(c.y).to.equal(2); - expect(c.z).to.equal(4); - expect(c.v).to.equal(0); - done(); - }); - }); - - describe('#applyToDefaults', function () { - - var defaults = { - a: 1, - b: 2, - c: { - d: 3, - e: [5, 6] - }, - f: 6 - }; - - it('should return null if options is false', function (done) { - - var result = Hoek.applyToDefaults(defaults, false); - expect(result).to.equal(null); - done(); - }); - - it('should return a copy of defaults if options is true', function (done) { - - var result = Hoek.applyToDefaults(defaults, true); - expect(result).to.deep.equal(result); - done(); - }); - - it('should apply object to defaults', function (done) { - - var obj = { - a: null, - c: { - e: [4] - }, - f: 0 - }; - - var result = Hoek.applyToDefaults(defaults, obj); - expect(result.c.e).to.deep.equal([4]); - expect(result.a).to.equal(1); - expect(result.b).to.equal(2); - expect(result.f).to.equal(0); - done(); - }); - }); - - describe('#unique', function () { - - it('should ensure uniqueness within array of objects based on subkey', function (done) { - - var a = Hoek.unique(dupsArray, 'x'); - expect(a).to.deep.equal(reducedDupsArray); - done(); - }); - - it('removes duplicated without key', function (done) { - - expect(Hoek.unique([1, 2, 3, 4, 2, 1, 5])).to.deep.equal([1, 2, 3, 4, 5]); - done(); - }); - }); - - describe('#mapToObject', function () { - - it('should return null on null array', function (done) { - - var a = Hoek.mapToObject(null); - expect(a).to.equal(null); - done(); - }); - - it('should convert basic array to existential object', function (done) { - - var keys = [1, 2, 3, 4]; - var a = Hoek.mapToObject(keys); - for (var i in keys) { - expect(a[keys[i]]).to.equal(true); - } - done(); - }); - - it('should convert array of objects to existential object', function (done) { - - var keys = [{ x: 1 }, { x: 2 }, { x: 3 }]; - var subkey = 'x'; - var a = Hoek.mapToObject(keys, subkey); - for (var i in keys) { - expect(a[keys[i][subkey]]).to.equal(true); - } - done(); - }); - }); - - describe('#intersect', function () { - - it('should return the common objects of two arrays', function (done) { - - var array1 = [1, 2, 3, 4, 4, 5, 5]; - var array2 = [5, 4, 5, 6, 7]; - var common = Hoek.intersect(array1, array2); - expect(common.length).to.equal(2); - done(); - }); - - it('should return an empty array if either input is null', function (done) { - - expect(Hoek.intersect([1], null).length).to.equal(0); - expect(Hoek.intersect(null, [1]).length).to.equal(0); - done(); - }); - }); - - describe('#matchKeys', function () { - - it('should match the existing object keys', function (done) { - - var obj = { - a: 1, - b: 2, - c: 3, - d: null - }; - - expect(Hoek.matchKeys(obj, ['b', 'c', 'd', 'e'])).to.deep.equal(['b', 'c', 'd']); - done(); - }); - }); - - describe('#flatten', function () { - - it('should return a flat array', function (done) { - - var result = Hoek.flatten([1, 2, [3, 4, [5, 6], [7], 8], [9], [10, [11, 12]], 13]); - expect(result.length).to.equal(13); - expect(result).to.deep.equal([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]); - done(); - }); - }); - - describe('#removeKeys', function () { - - var objWithHiddenKeys = { - location: { - name: 'San Bruno' - }, - company: { - name: '@WalmartLabs' - } - }; - - it('should delete params with definition\'s hide set to true', function (done) { - - var a = Hoek.removeKeys(objWithHiddenKeys, ['location']); - expect(objWithHiddenKeys.location).to.not.exist; - expect(objWithHiddenKeys.company).to.exist; - done(); - }); - }); - - describe('#reach', function () { - - var obj = { - a: { - b: { - c: { - d: 1, - e: 2 - }, - f: 'hello', - }, - g: { - h: 3 - } - }, - i: function () { } - }; - - it('returns a valid member', function (done) { - - expect(Hoek.reach(obj, 'a.b.c.d')).to.equal(1); - done(); - }); - - it('returns null on null object', function (done) { - - expect(Hoek.reach(null, 'a.b.c.d')).to.not.exist; - done(); - }); - - it('returns null on missing member', function (done) { - - expect(Hoek.reach(obj, 'a.b.c.d.x')).to.not.exist; - done(); - }); - - it('returns null on invalid member', function (done) { - - expect(Hoek.reach(obj, 'a.b.c.d-.x')).to.not.exist; - done(); - }); - - it('returns function member', function (done) { - - expect(typeof Hoek.reach(obj, 'i')).to.equal('function'); - done(); - }); - }); - - describe('#inheritAsync', function () { - - it('should inherit selected methods and wrap in async call', function (done) { - - var proto = { - a: function () { - return 'a!'; - }, - b: function () { - return 'b!'; - }, - c: function () { - throw new Error('c!'); - } - }; - - var targetFunc = function () { }; - targetFunc.prototype.c = function () { - - return 'oops'; - }; - - Hoek.inheritAsync(targetFunc, proto, ['a', 'c']); - var target = new targetFunc(); - - expect(typeof target.a).to.equal('function'); - expect(typeof target.c).to.equal('function'); - expect(target.b).to.not.exist; - - target.a(function (err, result) { - - expect(err).to.not.exist; - expect(result).to.equal('a!'); - - target.c(function (err, result) { - - expect(result).to.not.exist; - expect(err.message).to.equal('c!'); - done(); - }); - }); - }); - }); - - describe('#callStack', function () { - - it('should return the full call stack', function (done) { - - var stack = Hoek.callStack(); - expect(stack[0][0]).to.contain('index.js'); - expect(stack[0][2]).to.equal(30); - done(); - }); - }); - - describe('#displayStack ', function () { - - it('should return the full call stack for display', function (done) { - - var stack = Hoek.displayStack(); - expect(stack[0]).to.contain('test/index.js:'); - done(); - }); - }); - - describe('#abort', function () { - - it('should exit process when not in test mode', function (done) { - - var env = process.env.NODE_ENV; - var write = process.stdout.write; - var exit = process.exit; - - process.env.NODE_ENV = 'nottatest'; - process.stdout.write = function () {}; - process.exit = function (state) { - - process.env.NODE_ENV = env; - process.stdout.write = write; - process.exist = exit; - - expect(state).to.equal(1); - done(); - }; - - Hoek.abort('Boom'); - }); - }); - - describe('#assert', function () { - - it('should throw an Error when using assert in a test', function (done) { - - var fn = function () { - - Hoek.assert(false, 'my error message'); - }; - - expect(fn).to.throw('my error message'); - done(); - }); - }); - - describe('#loadDirModules', function () { - - it('should load modules from directory', function (done) { - - var target = {}; - Hoek.loadDirModules(__dirname + '/modules', ['test2'], target); - expect(target.Test1.x).to.equal(1); - expect(target.Test2).to.not.exist; - expect(target.Test3.z).to.equal(3); - done(); - }); - - it('should list modules from directory into function', function (done) { - - var target = {}; - Hoek.loadDirModules(__dirname + '/modules', ['test2'], function (path, name, capName) { - - target[name] = capName; - }); - - expect(target.test1).to.equal('Test1'); - expect(target.test2).to.not.exist; - expect(target.test3).to.equal('Test3'); - done(); - }); - }); - - describe('#rename', function () { - - it('should rename object key', function (done) { - - var a = { b: 'c' }; - Hoek.rename(a, 'b', 'x'); - expect(a.b).to.not.exist; - expect(a.x).to.equal('c'); - done(); - }); - }); - - describe('Timer', function () { - - it('should return time elapsed', function (done) { - - var timer = new Hoek.Timer(); - setTimeout(function () { - - expect(timer.elapsed()).to.be.above(9); - done(); - }, 12); - }); - }); - - describe('#loadPackage', function () { - - it('should', function (done) { - - var pack = Hoek.loadPackage(); - expect(pack.name).to.equal('hoek'); - done(); - }); - }); - - describe('#escapeRegex', function () { - - it('should escape all special regular expression characters', function (done) { - - var a = Hoek.escapeRegex('4^f$s.4*5+-_?%=#!:@|~\\/`"(>)[<]d{}s,'); - expect(a).to.equal('4\\^f\\$s\\.4\\*5\\+\\-_\\?%\\=#\\!\\:@\\|~\\\\\\/`"\\(>\\)\\[<\\]d\\{\\}s\\,'); - done(); - }); - }); - - describe('#toss', function () { - - it('should call callback with new error', function (done) { - - var callback = function (err) { - - expect(err).to.exist; - expect(err.message).to.equal('bug'); - done(); - }; - - Hoek.toss(true, 'feature', callback); - Hoek.toss(false, 'bug', callback); - }); - - it('should call callback with new error and no message', function (done) { - - Hoek.toss(false, function (err) { - - expect(err).to.exist; - expect(err.message).to.equal(''); - done(); - }); - }); - - it('should call callback with error condition', function (done) { - - Hoek.toss(new Error('boom'), function (err) { - - expect(err).to.exist; - expect(err.message).to.equal('boom'); - done(); - }); - }); - - it('should call callback with new error using message with error condition', function (done) { - - Hoek.toss(new Error('ka'), 'boom', function (err) { - - expect(err).to.exist; - expect(err.message).to.equal('boom'); - done(); - }); - }); - - it('should call callback with new error using passed error with error condition', function (done) { - - Hoek.toss(new Error('ka'), new Error('boom'), function (err) { - - expect(err).to.exist; - expect(err.message).to.equal('boom'); - done(); - }); - }); - }); - - describe('Base64Url', function () { - - var base64str = 'AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISIjJCUmJygpKissLS4vMDEyMzQ1Njc4OTo7PD0-P0BBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWltcXV5fYGFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6e3x9fn-AgYKDhIWGh4iJiouMjY6PkJGSk5SVlpeYmZqbnJ2en6ChoqOkpaanqKmqq6ytrq-wsbKztLW2t7i5uru8vb6_wMHCw8TFxsfIycrLzM3Oz9DR0tPU1dbX2Nna29zd3t_g4eLj5OXm5-jp6uvs7e7v8PHy8_T19vf4-fr7_P3-_w'; - var str = unescape('%00%01%02%03%04%05%06%07%08%09%0A%0B%0C%0D%0E%0F%10%11%12%13%14%15%16%17%18%19%1A%1B%1C%1D%1E%1F%20%21%22%23%24%25%26%27%28%29*+%2C-./0123456789%3A%3B%3C%3D%3E%3F@ABCDEFGHIJKLMNOPQRSTUVWXYZ%5B%5C%5D%5E_%60abcdefghijklmnopqrstuvwxyz%7B%7C%7D%7E%7F%80%81%82%83%84%85%86%87%88%89%8A%8B%8C%8D%8E%8F%90%91%92%93%94%95%96%97%98%99%9A%9B%9C%9D%9E%9F%A0%A1%A2%A3%A4%A5%A6%A7%A8%A9%AA%AB%AC%AD%AE%AF%B0%B1%B2%B3%B4%B5%B6%B7%B8%B9%BA%BB%BC%BD%BE%BF%C0%C1%C2%C3%C4%C5%C6%C7%C8%C9%CA%CB%CC%CD%CE%CF%D0%D1%D2%D3%D4%D5%D6%D7%D8%D9%DA%DB%DC%DD%DE%DF%E0%E1%E2%E3%E4%E5%E6%E7%E8%E9%EA%EB%EC%ED%EE%EF%F0%F1%F2%F3%F4%F5%F6%F7%F8%F9%FA%FB%FC%FD%FE%FF'); - - describe('#base64urlEncode', function () { - - it('should base64 URL-safe a string', function (done) { - - expect(Hoek.base64urlEncode(str)).to.equal(base64str); - done(); - }); - }); - - describe('#base64urlDecode', function () { - - it('should un-base64 URL-safe a string', function (done) { - - expect(Hoek.base64urlDecode(base64str)).to.equal(str); - done(); - }); - - it('should return error on undefined input', function (done) { - - expect(Hoek.base64urlDecode().message).to.exist; - done(); - }); - - it('should return error on invalid input', function (done) { - - expect(Hoek.base64urlDecode('*').message).to.exist; - done(); - }); - }); - }); - - describe('#escapeHeaderAttribute', function () { - - it('should escape all special HTTP header attribute characters', function (done) { - - var a = Hoek.escapeHeaderAttribute('I said "go w\\o me"'); - expect(a).to.equal('I said \\"go w\\\\o me\\"'); - done(); - }); - }); - - describe('#escapeHtml', function () { - - it('should escape all special HTML characters', function (done) { - - var a = Hoek.escapeHtml('&<>"\'`'); - expect(a).to.equal('&<>"'`'); - done(); - }); - - it('should return empty string on falsy input', function (done) { - - var a = Hoek.escapeHtml(''); - expect(a).to.equal(''); - done(); - }); - - it('should return unchanged string on no reserved input', function (done) { - - var a = Hoek.escapeHtml('abc'); - expect(a).to.equal('abc'); - done(); - }); - }); -}); - +// Load modules + +var Chai = require('chai'); +var Hoek = process.env.TEST_COV ? require('../lib-cov') : require('../lib'); + + +// Declare internals + +var internals = {}; + + +// Test shortcuts + +var expect = Chai.expect; + + +describe('Hoek', function () { + + var nestedObj = { + w: /^something$/ig, + x: { + a: [1, 2, 3], + b: 123456, + c: new Date() + }, + y: 'y', + z: new Date() + }; + + var dupsArray = [nestedObj, { z: 'z' }, nestedObj]; + var reducedDupsArray = [nestedObj, { z: 'z' }]; + + describe('#clone', function () { + + it('should clone a nested object', function (done) { + + var a = nestedObj; + var b = Hoek.clone(a); + + expect(a).to.deep.equal(b) + expect(a.z.getTime()).to.equal(b.z.getTime()); + done(); + }) + + it('should clone a null object', function (done) { + + var b = Hoek.clone(null); + + expect(b).to.equal(null); + done(); + }) + }); + + describe('#merge', function () { + + it('should combine an empty object with a non-empty object', function (done) { + + var a = {}; + var b = nestedObj; + + var c = Hoek.merge(a, b); + expect(a).to.deep.equal(b); + expect(c).to.deep.equal(b); + done(); + }); + + it('should override values in target', function (done) { + + var a = { x: 1, y: 2, z: 3, v: 5 }; + var b = { x: null, z: 4, v: 0 }; + + var c = Hoek.merge(a, b); + expect(c.x).to.equal(null); + expect(c.y).to.equal(2); + expect(c.z).to.equal(4); + expect(c.v).to.equal(0); + done(); + }); + }); + + describe('#applyToDefaults', function () { + + var defaults = { + a: 1, + b: 2, + c: { + d: 3, + e: [5, 6] + }, + f: 6 + }; + + it('should return null if options is false', function (done) { + + var result = Hoek.applyToDefaults(defaults, false); + expect(result).to.equal(null); + done(); + }); + + it('should return a copy of defaults if options is true', function (done) { + + var result = Hoek.applyToDefaults(defaults, true); + expect(result).to.deep.equal(result); + done(); + }); + + it('should apply object to defaults', function (done) { + + var obj = { + a: null, + c: { + e: [4] + }, + f: 0 + }; + + var result = Hoek.applyToDefaults(defaults, obj); + expect(result.c.e).to.deep.equal([4]); + expect(result.a).to.equal(1); + expect(result.b).to.equal(2); + expect(result.f).to.equal(0); + done(); + }); + }); + + describe('#unique', function () { + + it('should ensure uniqueness within array of objects based on subkey', function (done) { + + var a = Hoek.unique(dupsArray, 'x'); + expect(a).to.deep.equal(reducedDupsArray); + done(); + }); + + it('removes duplicated without key', function (done) { + + expect(Hoek.unique([1, 2, 3, 4, 2, 1, 5])).to.deep.equal([1, 2, 3, 4, 5]); + done(); + }); + }); + + describe('#mapToObject', function () { + + it('should return null on null array', function (done) { + + var a = Hoek.mapToObject(null); + expect(a).to.equal(null); + done(); + }); + + it('should convert basic array to existential object', function (done) { + + var keys = [1, 2, 3, 4]; + var a = Hoek.mapToObject(keys); + for (var i in keys) { + expect(a[keys[i]]).to.equal(true); + } + done(); + }); + + it('should convert array of objects to existential object', function (done) { + + var keys = [{ x: 1 }, { x: 2 }, { x: 3 }]; + var subkey = 'x'; + var a = Hoek.mapToObject(keys, subkey); + for (var i in keys) { + expect(a[keys[i][subkey]]).to.equal(true); + } + done(); + }); + }); + + describe('#intersect', function () { + + it('should return the common objects of two arrays', function (done) { + + var array1 = [1, 2, 3, 4, 4, 5, 5]; + var array2 = [5, 4, 5, 6, 7]; + var common = Hoek.intersect(array1, array2); + expect(common.length).to.equal(2); + done(); + }); + + it('should return an empty array if either input is null', function (done) { + + expect(Hoek.intersect([1], null).length).to.equal(0); + expect(Hoek.intersect(null, [1]).length).to.equal(0); + done(); + }); + }); + + describe('#matchKeys', function () { + + it('should match the existing object keys', function (done) { + + var obj = { + a: 1, + b: 2, + c: 3, + d: null + }; + + expect(Hoek.matchKeys(obj, ['b', 'c', 'd', 'e'])).to.deep.equal(['b', 'c', 'd']); + done(); + }); + }); + + describe('#flatten', function () { + + it('should return a flat array', function (done) { + + var result = Hoek.flatten([1, 2, [3, 4, [5, 6], [7], 8], [9], [10, [11, 12]], 13]); + expect(result.length).to.equal(13); + expect(result).to.deep.equal([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]); + done(); + }); + }); + + describe('#removeKeys', function () { + + var objWithHiddenKeys = { + location: { + name: 'San Bruno' + }, + company: { + name: '@WalmartLabs' + } + }; + + it('should delete params with definition\'s hide set to true', function (done) { + + var a = Hoek.removeKeys(objWithHiddenKeys, ['location']); + expect(objWithHiddenKeys.location).to.not.exist; + expect(objWithHiddenKeys.company).to.exist; + done(); + }); + }); + + describe('#reach', function () { + + var obj = { + a: { + b: { + c: { + d: 1, + e: 2 + }, + f: 'hello', + }, + g: { + h: 3 + } + }, + i: function () { } + }; + + it('returns a valid member', function (done) { + + expect(Hoek.reach(obj, 'a.b.c.d')).to.equal(1); + done(); + }); + + it('returns null on null object', function (done) { + + expect(Hoek.reach(null, 'a.b.c.d')).to.not.exist; + done(); + }); + + it('returns null on missing member', function (done) { + + expect(Hoek.reach(obj, 'a.b.c.d.x')).to.not.exist; + done(); + }); + + it('returns null on invalid member', function (done) { + + expect(Hoek.reach(obj, 'a.b.c.d-.x')).to.not.exist; + done(); + }); + + it('returns function member', function (done) { + + expect(typeof Hoek.reach(obj, 'i')).to.equal('function'); + done(); + }); + }); + + describe('#inheritAsync', function () { + + it('should inherit selected methods and wrap in async call', function (done) { + + var proto = { + a: function () { + return 'a!'; + }, + b: function () { + return 'b!'; + }, + c: function () { + throw new Error('c!'); + } + }; + + var targetFunc = function () { }; + targetFunc.prototype.c = function () { + + return 'oops'; + }; + + Hoek.inheritAsync(targetFunc, proto, ['a', 'c']); + var target = new targetFunc(); + + expect(typeof target.a).to.equal('function'); + expect(typeof target.c).to.equal('function'); + expect(target.b).to.not.exist; + + target.a(function (err, result) { + + expect(err).to.not.exist; + expect(result).to.equal('a!'); + + target.c(function (err, result) { + + expect(result).to.not.exist; + expect(err.message).to.equal('c!'); + done(); + }); + }); + }); + }); + + describe('#callStack', function () { + + it('should return the full call stack', function (done) { + + var stack = Hoek.callStack(); + expect(stack[0][0]).to.contain('index.js'); + expect(stack[0][2]).to.equal(30); + done(); + }); + }); + + describe('#displayStack ', function () { + + it('should return the full call stack for display', function (done) { + + var stack = Hoek.displayStack(); + expect(stack[0]).to.contain('test/index.js:'); + done(); + }); + }); + + describe('#abort', function () { + + it('should exit process when not in test mode', function (done) { + + var env = process.env.NODE_ENV; + var write = process.stdout.write; + var exit = process.exit; + + process.env.NODE_ENV = 'nottatest'; + process.stdout.write = function () {}; + process.exit = function (state) { + + process.env.NODE_ENV = env; + process.stdout.write = write; + process.exist = exit; + + expect(state).to.equal(1); + done(); + }; + + Hoek.abort('Boom'); + }); + }); + + describe('#assert', function () { + + it('should throw an Error when using assert in a test', function (done) { + + var fn = function () { + + Hoek.assert(false, 'my error message'); + }; + + expect(fn).to.throw('my error message'); + done(); + }); + }); + + describe('#loadDirModules', function () { + + it('should load modules from directory', function (done) { + + var target = {}; + Hoek.loadDirModules(__dirname + '/modules', ['test2'], target); + expect(target.Test1.x).to.equal(1); + expect(target.Test2).to.not.exist; + expect(target.Test3.z).to.equal(3); + done(); + }); + + it('should list modules from directory into function', function (done) { + + var target = {}; + Hoek.loadDirModules(__dirname + '/modules', ['test2'], function (path, name, capName) { + + target[name] = capName; + }); + + expect(target.test1).to.equal('Test1'); + expect(target.test2).to.not.exist; + expect(target.test3).to.equal('Test3'); + done(); + }); + }); + + describe('#rename', function () { + + it('should rename object key', function (done) { + + var a = { b: 'c' }; + Hoek.rename(a, 'b', 'x'); + expect(a.b).to.not.exist; + expect(a.x).to.equal('c'); + done(); + }); + }); + + describe('Timer', function () { + + it('should return time elapsed', function (done) { + + var timer = new Hoek.Timer(); + setTimeout(function () { + + expect(timer.elapsed()).to.be.above(9); + done(); + }, 12); + }); + }); + + describe('#loadPackage', function () { + + it('should', function (done) { + + var pack = Hoek.loadPackage(); + expect(pack.name).to.equal('hoek'); + done(); + }); + }); + + describe('#escapeRegex', function () { + + it('should escape all special regular expression characters', function (done) { + + var a = Hoek.escapeRegex('4^f$s.4*5+-_?%=#!:@|~\\/`"(>)[<]d{}s,'); + expect(a).to.equal('4\\^f\\$s\\.4\\*5\\+\\-_\\?%\\=#\\!\\:@\\|~\\\\\\/`"\\(>\\)\\[<\\]d\\{\\}s\\,'); + done(); + }); + }); + + describe('#toss', function () { + + it('should call callback with new error', function (done) { + + var callback = function (err) { + + expect(err).to.exist; + expect(err.message).to.equal('bug'); + done(); + }; + + Hoek.toss(true, 'feature', callback); + Hoek.toss(false, 'bug', callback); + }); + + it('should call callback with new error and no message', function (done) { + + Hoek.toss(false, function (err) { + + expect(err).to.exist; + expect(err.message).to.equal(''); + done(); + }); + }); + + it('should call callback with error condition', function (done) { + + Hoek.toss(new Error('boom'), function (err) { + + expect(err).to.exist; + expect(err.message).to.equal('boom'); + done(); + }); + }); + + it('should call callback with new error using message with error condition', function (done) { + + Hoek.toss(new Error('ka'), 'boom', function (err) { + + expect(err).to.exist; + expect(err.message).to.equal('boom'); + done(); + }); + }); + + it('should call callback with new error using passed error with error condition', function (done) { + + Hoek.toss(new Error('ka'), new Error('boom'), function (err) { + + expect(err).to.exist; + expect(err.message).to.equal('boom'); + done(); + }); + }); + }); + + describe('Base64Url', function () { + + var base64str = 'AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISIjJCUmJygpKissLS4vMDEyMzQ1Njc4OTo7PD0-P0BBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWltcXV5fYGFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6e3x9fn-AgYKDhIWGh4iJiouMjY6PkJGSk5SVlpeYmZqbnJ2en6ChoqOkpaanqKmqq6ytrq-wsbKztLW2t7i5uru8vb6_wMHCw8TFxsfIycrLzM3Oz9DR0tPU1dbX2Nna29zd3t_g4eLj5OXm5-jp6uvs7e7v8PHy8_T19vf4-fr7_P3-_w'; + var str = unescape('%00%01%02%03%04%05%06%07%08%09%0A%0B%0C%0D%0E%0F%10%11%12%13%14%15%16%17%18%19%1A%1B%1C%1D%1E%1F%20%21%22%23%24%25%26%27%28%29*+%2C-./0123456789%3A%3B%3C%3D%3E%3F@ABCDEFGHIJKLMNOPQRSTUVWXYZ%5B%5C%5D%5E_%60abcdefghijklmnopqrstuvwxyz%7B%7C%7D%7E%7F%80%81%82%83%84%85%86%87%88%89%8A%8B%8C%8D%8E%8F%90%91%92%93%94%95%96%97%98%99%9A%9B%9C%9D%9E%9F%A0%A1%A2%A3%A4%A5%A6%A7%A8%A9%AA%AB%AC%AD%AE%AF%B0%B1%B2%B3%B4%B5%B6%B7%B8%B9%BA%BB%BC%BD%BE%BF%C0%C1%C2%C3%C4%C5%C6%C7%C8%C9%CA%CB%CC%CD%CE%CF%D0%D1%D2%D3%D4%D5%D6%D7%D8%D9%DA%DB%DC%DD%DE%DF%E0%E1%E2%E3%E4%E5%E6%E7%E8%E9%EA%EB%EC%ED%EE%EF%F0%F1%F2%F3%F4%F5%F6%F7%F8%F9%FA%FB%FC%FD%FE%FF'); + + describe('#base64urlEncode', function () { + + it('should base64 URL-safe a string', function (done) { + + expect(Hoek.base64urlEncode(str)).to.equal(base64str); + done(); + }); + }); + + describe('#base64urlDecode', function () { + + it('should un-base64 URL-safe a string', function (done) { + + expect(Hoek.base64urlDecode(base64str)).to.equal(str); + done(); + }); + + it('should return error on undefined input', function (done) { + + expect(Hoek.base64urlDecode().message).to.exist; + done(); + }); + + it('should return error on invalid input', function (done) { + + expect(Hoek.base64urlDecode('*').message).to.exist; + done(); + }); + }); + }); + + describe('#escapeHeaderAttribute', function () { + + it('should escape all special HTTP header attribute characters', function (done) { + + var a = Hoek.escapeHeaderAttribute('I said "go w\\o me"'); + expect(a).to.equal('I said \\"go w\\\\o me\\"'); + done(); + }); + }); + + describe('#escapeHtml', function () { + + it('should escape all special HTML characters', function (done) { + + var a = Hoek.escapeHtml('&<>"\'`'); + expect(a).to.equal('&<>"'`'); + done(); + }); + + it('should return empty string on falsy input', function (done) { + + var a = Hoek.escapeHtml(''); + expect(a).to.equal(''); + done(); + }); + + it('should return unchanged string on no reserved input', function (done) { + + var a = Hoek.escapeHtml('abc'); + expect(a).to.equal('abc'); + done(); + }); + }); +}); + diff --git a/node_modules/boom/node_modules/hoek/test/modules/test1.js b/node_modules/boom/node_modules/hoek/test/modules/test1.js old mode 100644 new mode 100755 index fa4e06abe..3f41e601e --- a/node_modules/boom/node_modules/hoek/test/modules/test1.js +++ b/node_modules/boom/node_modules/hoek/test/modules/test1.js @@ -1 +1 @@ -exports.x = 1; +exports.x = 1; diff --git a/node_modules/boom/node_modules/hoek/test/modules/test2.js b/node_modules/boom/node_modules/hoek/test/modules/test2.js old mode 100644 new mode 100755 index 88e9166e8..38556b274 --- a/node_modules/boom/node_modules/hoek/test/modules/test2.js +++ b/node_modules/boom/node_modules/hoek/test/modules/test2.js @@ -1 +1 @@ -exports.y = 2; +exports.y = 2; diff --git a/node_modules/boom/node_modules/hoek/test/modules/test3.js b/node_modules/boom/node_modules/hoek/test/modules/test3.js old mode 100644 new mode 100755 index 670e724a6..436b860b8 --- a/node_modules/boom/node_modules/hoek/test/modules/test3.js +++ b/node_modules/boom/node_modules/hoek/test/modules/test3.js @@ -1 +1 @@ -exports.z = 3; +exports.z = 3; diff --git a/node_modules/boom/package.json b/node_modules/boom/package.json old mode 100644 new mode 100755 index bc5da19da..b308eba26 --- a/node_modules/boom/package.json +++ b/node_modules/boom/package.json @@ -1,32 +1,32 @@ -{ - "name": "boom", - "description": "HTTP-friendly error objects", - "version": "0.3.1", - "author": "Eran Hammer (http://hueniverse.com)", - "contributors": [], - "repository": "git://github.com/hueniverse/boom", - "main": "index", - "keywords": [ - "error", - "http" - ], - "engines": { - "node": ">=0.8.0" - }, - "dependencies": { - "hoek": "0.4.x" - }, - "devDependencies": { - "mocha": "1.x.x", - "chai": "1.x.x" - }, - "scripts": { - "test": "make test && make unit" - }, - "licenses": [ - { - "type": "BSD", - "url": "http://github.com/hueniverse/boom/raw/master/LICENSE" - } - ] -} +{ + "name": "boom", + "description": "HTTP-friendly error objects", + "version": "0.3.1", + "author": "Eran Hammer (http://hueniverse.com)", + "contributors": [], + "repository": "git://github.com/hueniverse/boom", + "main": "index", + "keywords": [ + "error", + "http" + ], + "engines": { + "node": ">=0.8.0" + }, + "dependencies": { + "hoek": "0.4.x" + }, + "devDependencies": { + "mocha": "1.x.x", + "chai": "1.x.x" + }, + "scripts": { + "test": "make test && make unit" + }, + "licenses": [ + { + "type": "BSD", + "url": "http://github.com/hueniverse/boom/raw/master/LICENSE" + } + ] +} diff --git a/node_modules/boom/test/index.js b/node_modules/boom/test/index.js old mode 100644 new mode 100755 index 8908ff064..e618481e1 --- a/node_modules/boom/test/index.js +++ b/node_modules/boom/test/index.js @@ -1,223 +1,223 @@ -// Load modules - -var Chai = require('chai'); -var Boom = process.env.TEST_COV ? require('../lib-cov') : require('../lib'); - - -// Declare internals - -var internals = {}; - - -// Test shortcuts - -var expect = Chai.expect; - - -describe('Boom', function () { - - it('returns an error with info when constructed using another error', function (done) { - - var error = new Error('ka-boom'); - error.xyz = 123; - var err = new Boom(error); - expect(err.data.xyz).to.equal(123); - expect(err.message).to.equal('ka-boom'); - expect(err.response).to.deep.equal({ - code: 500, - payload: { - code: 500, - error: 'Internal Server Error', - message: 'ka-boom' - }, - headers: {} - }); - done(); - }); - - describe('#isBoom', function () { - - it('returns true for Boom object', function (done) { - - expect(Boom.badRequest().isBoom).to.equal(true); - done(); - }); - - it('returns false for Error object', function (done) { - - expect(new Error().isBoom).to.not.exist; - done(); - }); - }); - - describe('#badRequest', function () { - - it('returns a 400 error code', function (done) { - - expect(Boom.badRequest().response.code).to.equal(400); - done(); - }); - - it('sets the message with the passed in message', function (done) { - - expect(Boom.badRequest('my message').message).to.equal('my message'); - done(); - }); - }); - - describe('#unauthorized', function () { - - it('returns a 401 error code', function (done) { - - var err = Boom.unauthorized(); - expect(err.response.code).to.equal(401); - expect(err.response.headers).to.deep.equal({}); - done(); - }); - - it('sets the message with the passed in message', function (done) { - - expect(Boom.unauthorized('my message').message).to.equal('my message'); - done(); - }); - - it('returns a WWW-Authenticate header when passed a scheme', function (done) { - - var err = Boom.unauthorized('boom', 'Test'); - expect(err.response.code).to.equal(401); - expect(err.response.headers['WWW-Authenticate']).to.equal('Test error="boom"'); - done(); - }); - - it('returns a WWW-Authenticate header when passed a scheme and attributes', function (done) { - - var err = Boom.unauthorized('boom', 'Test', { a: 1, b: 'something', c: null, d: 0 }); - expect(err.response.code).to.equal(401); - expect(err.response.headers['WWW-Authenticate']).to.equal('Test a="1", b="something", c="", d="0", error="boom"'); - done(); - }); - - it('sets the isMissing flag when error message is empty', function (done) { - - var err = Boom.unauthorized('', 'Basic'); - expect(err.isMissing).to.equal(true); - done(); - }); - - it('does not set the isMissing flag when error message is not empty', function (done) { - - var err = Boom.unauthorized('message', 'Basic'); - expect(err.isMissing).to.equal(undefined); - done(); - }); - - it('sets a WWW-Authenticate when passed as an array', function (done) { - - var err = Boom.unauthorized('message', ['Basic', 'Example e="1"', 'Another x="3", y="4"']); - expect(err.response.headers['WWW-Authenticate']).to.equal('Basic, Example e="1", Another x="3", y="4"'); - done(); - }); - }); - - describe('#clientTimeout', function () { - - it('returns a 408 error code', function (done) { - - expect(Boom.clientTimeout().response.code).to.equal(408); - done(); - }); - - it('sets the message with the passed in message', function (done) { - - expect(Boom.clientTimeout('my message').message).to.equal('my message'); - done(); - }); - }); - - describe('#serverTimeout', function () { - - it('returns a 503 error code', function (done) { - - expect(Boom.serverTimeout().response.code).to.equal(503); - done(); - }); - - it('sets the message with the passed in message', function (done) { - - expect(Boom.serverTimeout('my message').message).to.equal('my message'); - done(); - }); - }); - - describe('#forbidden', function () { - - it('returns a 403 error code', function (done) { - - expect(Boom.forbidden().response.code).to.equal(403); - done(); - }); - - it('sets the message with the passed in message', function (done) { - - expect(Boom.forbidden('my message').message).to.equal('my message'); - done(); - }); - }); - - describe('#notFound', function () { - - it('returns a 404 error code', function (done) { - - expect(Boom.notFound().response.code).to.equal(404); - done(); - }); - - it('sets the message with the passed in message', function (done) { - - expect(Boom.notFound('my message').message).to.equal('my message'); - done(); - }); - }); - - describe('#internal', function () { - - it('returns a 500 error code', function (done) { - - expect(Boom.internal().response.code).to.equal(500); - done(); - }); - - it('sets the message with the passed in message', function (done) { - - var err = Boom.internal('my message'); - expect(err.message).to.equal('my message'); - expect(err.response.payload.message).to.equal('An internal server error occurred'); - done(); - }); - - it('passes data on the callback if its passed in', function (done) { - - expect(Boom.internal('my message', { my: 'data' }).data.my).to.equal('data'); - done(); - }); - }); - - describe('#passThrough', function () { - - it('returns a pass-through error', function (done) { - - var err = Boom.passThrough(499, { a: 1 }, 'application/text', { 'X-Test': 'Boom' }); - expect(err.response.code).to.equal(499); - expect(err.message).to.equal('Pass-through'); - expect(err.response).to.deep.equal({ - code: 499, - payload: { a: 1 }, - headers: { 'X-Test': 'Boom' }, - type: 'application/text' - }); - done(); - }); - }); -}); - - +// Load modules + +var Chai = require('chai'); +var Boom = process.env.TEST_COV ? require('../lib-cov') : require('../lib'); + + +// Declare internals + +var internals = {}; + + +// Test shortcuts + +var expect = Chai.expect; + + +describe('Boom', function () { + + it('returns an error with info when constructed using another error', function (done) { + + var error = new Error('ka-boom'); + error.xyz = 123; + var err = new Boom(error); + expect(err.data.xyz).to.equal(123); + expect(err.message).to.equal('ka-boom'); + expect(err.response).to.deep.equal({ + code: 500, + payload: { + code: 500, + error: 'Internal Server Error', + message: 'ka-boom' + }, + headers: {} + }); + done(); + }); + + describe('#isBoom', function () { + + it('returns true for Boom object', function (done) { + + expect(Boom.badRequest().isBoom).to.equal(true); + done(); + }); + + it('returns false for Error object', function (done) { + + expect(new Error().isBoom).to.not.exist; + done(); + }); + }); + + describe('#badRequest', function () { + + it('returns a 400 error code', function (done) { + + expect(Boom.badRequest().response.code).to.equal(400); + done(); + }); + + it('sets the message with the passed in message', function (done) { + + expect(Boom.badRequest('my message').message).to.equal('my message'); + done(); + }); + }); + + describe('#unauthorized', function () { + + it('returns a 401 error code', function (done) { + + var err = Boom.unauthorized(); + expect(err.response.code).to.equal(401); + expect(err.response.headers).to.deep.equal({}); + done(); + }); + + it('sets the message with the passed in message', function (done) { + + expect(Boom.unauthorized('my message').message).to.equal('my message'); + done(); + }); + + it('returns a WWW-Authenticate header when passed a scheme', function (done) { + + var err = Boom.unauthorized('boom', 'Test'); + expect(err.response.code).to.equal(401); + expect(err.response.headers['WWW-Authenticate']).to.equal('Test error="boom"'); + done(); + }); + + it('returns a WWW-Authenticate header when passed a scheme and attributes', function (done) { + + var err = Boom.unauthorized('boom', 'Test', { a: 1, b: 'something', c: null, d: 0 }); + expect(err.response.code).to.equal(401); + expect(err.response.headers['WWW-Authenticate']).to.equal('Test a="1", b="something", c="", d="0", error="boom"'); + done(); + }); + + it('sets the isMissing flag when error message is empty', function (done) { + + var err = Boom.unauthorized('', 'Basic'); + expect(err.isMissing).to.equal(true); + done(); + }); + + it('does not set the isMissing flag when error message is not empty', function (done) { + + var err = Boom.unauthorized('message', 'Basic'); + expect(err.isMissing).to.equal(undefined); + done(); + }); + + it('sets a WWW-Authenticate when passed as an array', function (done) { + + var err = Boom.unauthorized('message', ['Basic', 'Example e="1"', 'Another x="3", y="4"']); + expect(err.response.headers['WWW-Authenticate']).to.equal('Basic, Example e="1", Another x="3", y="4"'); + done(); + }); + }); + + describe('#clientTimeout', function () { + + it('returns a 408 error code', function (done) { + + expect(Boom.clientTimeout().response.code).to.equal(408); + done(); + }); + + it('sets the message with the passed in message', function (done) { + + expect(Boom.clientTimeout('my message').message).to.equal('my message'); + done(); + }); + }); + + describe('#serverTimeout', function () { + + it('returns a 503 error code', function (done) { + + expect(Boom.serverTimeout().response.code).to.equal(503); + done(); + }); + + it('sets the message with the passed in message', function (done) { + + expect(Boom.serverTimeout('my message').message).to.equal('my message'); + done(); + }); + }); + + describe('#forbidden', function () { + + it('returns a 403 error code', function (done) { + + expect(Boom.forbidden().response.code).to.equal(403); + done(); + }); + + it('sets the message with the passed in message', function (done) { + + expect(Boom.forbidden('my message').message).to.equal('my message'); + done(); + }); + }); + + describe('#notFound', function () { + + it('returns a 404 error code', function (done) { + + expect(Boom.notFound().response.code).to.equal(404); + done(); + }); + + it('sets the message with the passed in message', function (done) { + + expect(Boom.notFound('my message').message).to.equal('my message'); + done(); + }); + }); + + describe('#internal', function () { + + it('returns a 500 error code', function (done) { + + expect(Boom.internal().response.code).to.equal(500); + done(); + }); + + it('sets the message with the passed in message', function (done) { + + var err = Boom.internal('my message'); + expect(err.message).to.equal('my message'); + expect(err.response.payload.message).to.equal('An internal server error occurred'); + done(); + }); + + it('passes data on the callback if its passed in', function (done) { + + expect(Boom.internal('my message', { my: 'data' }).data.my).to.equal('data'); + done(); + }); + }); + + describe('#passThrough', function () { + + it('returns a pass-through error', function (done) { + + var err = Boom.passThrough(499, { a: 1 }, 'application/text', { 'X-Test': 'Boom' }); + expect(err.response.code).to.equal(499); + expect(err.message).to.equal('Pass-through'); + expect(err.response).to.deep.equal({ + code: 499, + payload: { a: 1 }, + headers: { 'X-Test': 'Boom' }, + type: 'application/text' + }); + done(); + }); + }); +}); + + diff --git a/node_modules/browserslist/cli.js b/node_modules/browserslist/cli.js old mode 100644 new mode 100755 diff --git a/node_modules/bson/etc/prepare.js b/node_modules/bson/etc/prepare.js old mode 100644 new mode 100755 diff --git a/node_modules/char-regex/LICENSE b/node_modules/char-regex/LICENSE index 04c5e7688..2377f69e6 100644 --- a/node_modules/char-regex/LICENSE +++ b/node_modules/char-regex/LICENSE @@ -1,21 +1,21 @@ -MIT License - -Copyright (c) 2019 Richie Bendall - -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) 2019 Richie Bendall + +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/char-regex/README.md b/node_modules/char-regex/README.md index 835ae8a13..08ea78bde 100644 --- a/node_modules/char-regex/README.md +++ b/node_modules/char-regex/README.md @@ -1,27 +1,27 @@ -# Char Regex [![Travis CI Build Status](https://img.shields.io/travis/com/Richienb/char-regex/master.svg?style=for-the-badge)](https://travis-ci.com/Richienb/char-regex) - -A regex to match any full character, considering weird character ranges. Tested on every single emoji and unicode character. Based on the Lodash implementation. - -[![NPM Badge](https://nodei.co/npm/char-regex.png)](https://npmjs.com/package/char-regex) - -## Install - -```sh -npm install char-regex -``` - -## Usage - -```js -const charRegex = require("char-regex"); - -"❤️👊🏽".match(/./); -//=> ["", "", "", "", "", "", ""] - -"❤️👊🏽".match(charRegex()); -//=> ["❤️", "👊🏽"] -``` - -## API - -### charRegex() +# Char Regex [![Travis CI Build Status](https://img.shields.io/travis/com/Richienb/char-regex/master.svg?style=for-the-badge)](https://travis-ci.com/Richienb/char-regex) + +A regex to match any full character, considering weird character ranges. Tested on every single emoji and unicode character. Based on the Lodash implementation. + +[![NPM Badge](https://nodei.co/npm/char-regex.png)](https://npmjs.com/package/char-regex) + +## Install + +```sh +npm install char-regex +``` + +## Usage + +```js +const charRegex = require("char-regex"); + +"❤️👊🏽".match(/./); +//=> ["", "", "", "", "", "", ""] + +"❤️👊🏽".match(charRegex()); +//=> ["❤️", "👊🏽"] +``` + +## API + +### charRegex() diff --git a/node_modules/char-regex/index.d.ts b/node_modules/char-regex/index.d.ts index e074471db..17defa270 100644 --- a/node_modules/char-regex/index.d.ts +++ b/node_modules/char-regex/index.d.ts @@ -1,13 +1,13 @@ -/** - * A regex to match any full character, considering weird character ranges. - * @example - * ``` - * const charRegex = require("char-regex"); - * - * "❤️👊🏽".match(charRegex()); - * //=> ["❤️", "👊🏽"] - * ``` -*/ -declare function charRegex(): RegExp - -export = charRegex +/** + * A regex to match any full character, considering weird character ranges. + * @example + * ``` + * const charRegex = require("char-regex"); + * + * "❤️👊🏽".match(charRegex()); + * //=> ["❤️", "👊🏽"] + * ``` +*/ +declare function charRegex(): RegExp + +export = charRegex diff --git a/node_modules/char-regex/index.js b/node_modules/char-regex/index.js index 436cc681d..cddafddbd 100644 --- a/node_modules/char-regex/index.js +++ b/node_modules/char-regex/index.js @@ -1,39 +1,39 @@ -"use strict" - -// Based on: https://github.com/lodash/lodash/blob/6018350ac10d5ce6a5b7db625140b82aeab804df/.internal/unicodeSize.js - -module.exports = () => { - // Used to compose unicode character classes. - const astralRange = "\\ud800-\\udfff" - const comboMarksRange = "\\u0300-\\u036f" - const comboHalfMarksRange = "\\ufe20-\\ufe2f" - const comboSymbolsRange = "\\u20d0-\\u20ff" - const comboMarksExtendedRange = "\\u1ab0-\\u1aff" - const comboMarksSupplementRange = "\\u1dc0-\\u1dff" - const comboRange = comboMarksRange + comboHalfMarksRange + comboSymbolsRange + comboMarksExtendedRange + comboMarksSupplementRange - const varRange = "\\ufe0e\\ufe0f" - const familyRange = "\\uD83D\\uDC69\\uD83C\\uDFFB\\u200D\\uD83C\\uDF93" - - // Used to compose unicode capture groups. - const astral = `[${astralRange}]` - const combo = `[${comboRange}]` - const fitz = "\\ud83c[\\udffb-\\udfff]" - const modifier = `(?:${combo}|${fitz})` - const nonAstral = `[^${astralRange}]` - const regional = "(?:\\uD83C[\\uDDE6-\\uDDFF]){2}" - const surrogatePair = "[\\ud800-\\udbff][\\udc00-\\udfff]" - const zwj = "\\u200d" - const blackFlag = "(?:\\ud83c\\udff4\\udb40\\udc67\\udb40\\udc62\\udb40(?:\\udc65|\\udc73|\\udc77)\\udb40(?:\\udc6e|\\udc63|\\udc6c)\\udb40(?:\\udc67|\\udc74|\\udc73)\\udb40\\udc7f)" - const family = `[${familyRange}]` - - // Used to compose unicode regexes. - const optModifier = `${modifier}?` - const optVar = `[${varRange}]?` - const optJoin = `(?:${zwj}(?:${[nonAstral, regional, surrogatePair].join("|")})${optVar + optModifier})*` - const seq = optVar + optModifier + optJoin - const nonAstralCombo = `${nonAstral}${combo}?` - const symbol = `(?:${[nonAstralCombo, combo, regional, surrogatePair, astral, family].join("|")})` - - // Used to match [String symbols](https://mathiasbynens.be/notes/javascript-unicode). - return new RegExp(`${blackFlag}|${fitz}(?=${fitz})|${symbol + seq}`, "g") -} +"use strict" + +// Based on: https://github.com/lodash/lodash/blob/6018350ac10d5ce6a5b7db625140b82aeab804df/.internal/unicodeSize.js + +module.exports = () => { + // Used to compose unicode character classes. + const astralRange = "\\ud800-\\udfff" + const comboMarksRange = "\\u0300-\\u036f" + const comboHalfMarksRange = "\\ufe20-\\ufe2f" + const comboSymbolsRange = "\\u20d0-\\u20ff" + const comboMarksExtendedRange = "\\u1ab0-\\u1aff" + const comboMarksSupplementRange = "\\u1dc0-\\u1dff" + const comboRange = comboMarksRange + comboHalfMarksRange + comboSymbolsRange + comboMarksExtendedRange + comboMarksSupplementRange + const varRange = "\\ufe0e\\ufe0f" + const familyRange = "\\uD83D\\uDC69\\uD83C\\uDFFB\\u200D\\uD83C\\uDF93" + + // Used to compose unicode capture groups. + const astral = `[${astralRange}]` + const combo = `[${comboRange}]` + const fitz = "\\ud83c[\\udffb-\\udfff]" + const modifier = `(?:${combo}|${fitz})` + const nonAstral = `[^${astralRange}]` + const regional = "(?:\\uD83C[\\uDDE6-\\uDDFF]){2}" + const surrogatePair = "[\\ud800-\\udbff][\\udc00-\\udfff]" + const zwj = "\\u200d" + const blackFlag = "(?:\\ud83c\\udff4\\udb40\\udc67\\udb40\\udc62\\udb40(?:\\udc65|\\udc73|\\udc77)\\udb40(?:\\udc6e|\\udc63|\\udc6c)\\udb40(?:\\udc67|\\udc74|\\udc73)\\udb40\\udc7f)" + const family = `[${familyRange}]` + + // Used to compose unicode regexes. + const optModifier = `${modifier}?` + const optVar = `[${varRange}]?` + const optJoin = `(?:${zwj}(?:${[nonAstral, regional, surrogatePair].join("|")})${optVar + optModifier})*` + const seq = optVar + optModifier + optJoin + const nonAstralCombo = `${nonAstral}${combo}?` + const symbol = `(?:${[nonAstralCombo, combo, regional, surrogatePair, astral, family].join("|")})` + + // Used to match [String symbols](https://mathiasbynens.be/notes/javascript-unicode). + return new RegExp(`${blackFlag}|${fitz}(?=${fitz})|${symbol + seq}`, "g") +} diff --git a/node_modules/char-regex/package.json b/node_modules/char-regex/package.json index ac12599ba..d7c2808e6 100644 --- a/node_modules/char-regex/package.json +++ b/node_modules/char-regex/package.json @@ -1,44 +1,44 @@ -{ - "name": "char-regex", - "version": "1.0.2", - "description": "A regex to match any full character, considering weird character ranges.", - "repository": "https://github.com/Richienb/char-regex.git", - "author": "Richie Bendall ", - "license": "MIT", - "main": "index.js", - "files": [ - "index.js", - "index.d.ts" - ], - "engines": { - "node": ">=10" - }, - "scripts": { - "lint": "xo", - "test": "yarn lint && ava" - }, - "keywords": [ - "character", - "regex", - "match", - "split", - "length" - ], - "dependencies": {}, - "devDependencies": { - "@babel/core": "^7.8.4", - "@babel/plugin-proposal-unicode-property-regex": "^7.8.3", - "array-uniq": "^2.1.0", - "ava": "^3.0.0", - "emoji.json": "^12.1.1", - "eslint-config-richienb": "^0.3.0", - "unicode-chars": "^1.0.1", - "xo": "^0.25.3" - }, - "resolutions": { - "eslint": "^6.8.0" - }, - "xo": { - "extends": "richienb/node" - } -} +{ + "name": "char-regex", + "version": "1.0.2", + "description": "A regex to match any full character, considering weird character ranges.", + "repository": "https://github.com/Richienb/char-regex.git", + "author": "Richie Bendall ", + "license": "MIT", + "main": "index.js", + "files": [ + "index.js", + "index.d.ts" + ], + "engines": { + "node": ">=10" + }, + "scripts": { + "lint": "xo", + "test": "yarn lint && ava" + }, + "keywords": [ + "character", + "regex", + "match", + "split", + "length" + ], + "dependencies": {}, + "devDependencies": { + "@babel/core": "^7.8.4", + "@babel/plugin-proposal-unicode-property-regex": "^7.8.3", + "array-uniq": "^2.1.0", + "ava": "^3.0.0", + "emoji.json": "^12.1.1", + "eslint-config-richienb": "^0.3.0", + "unicode-chars": "^1.0.1", + "xo": "^0.25.3" + }, + "resolutions": { + "eslint": "^6.8.0" + }, + "xo": { + "extends": "richienb/node" + } +} diff --git a/node_modules/cjs-module-lexer/LICENSE b/node_modules/cjs-module-lexer/LICENSE index 935b35796..b31c17aa3 100644 --- a/node_modules/cjs-module-lexer/LICENSE +++ b/node_modules/cjs-module-lexer/LICENSE @@ -1,10 +1,10 @@ -MIT License ------------ - -Copyright (C) 2018-2020 Guy Bedford - -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) 2018-2020 Guy Bedford + +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/cjs-module-lexer/README.md b/node_modules/cjs-module-lexer/README.md index 10fe998ac..852cad214 100644 --- a/node_modules/cjs-module-lexer/README.md +++ b/node_modules/cjs-module-lexer/README.md @@ -1,461 +1,461 @@ -# CJS Module Lexer - -[![Build Status][travis-image]][travis-url] - -A [very fast](#benchmarks) JS CommonJS module syntax lexer used to detect the most likely list of named exports of a CommonJS module. - -Outputs the list of named exports (`exports.name = ...`) and possible module reexports (`module.exports = require('...')`), including the common transpiler variations of these cases. - -Forked from https://github.com/guybedford/es-module-lexer. - -_Comprehensively handles the JS language grammar while remaining small and fast. - ~90ms per MB of JS cold and ~15ms per MB of JS warm, [see benchmarks](#benchmarks) for more info._ - -### Project Status - -This project is used in Node.js core for detecting the named exports available when importing a CJS module into ESM, and is maintained for this purpose. - -PRs will be accepted and upstreamed for parser bugs, performance improvements or new syntax support only. - -_Detection patterns for this project are **frozen**_. This is because adding any new export detection patterns would result in fragmented backwards-compatibility. Specifically, it would be very difficult to figure out why an ES module named export for CommonJS might work in newer Node.js versions but not older versions. This problem would only be discovered downstream of module authors, with the fix for module authors being to then have to understand which patterns in this project provide full backwards-compatibily. Rather, by fully freezing the detected patterns, if it works in any Node.js version it will work in any other. Build tools can also reliably treat the supported syntax for this project as a part of their output target for ensuring syntax support. - -### Usage - -``` -npm install cjs-module-lexer -``` - -For use in CommonJS: - -```js -const { parse } = require('cjs-module-lexer'); - -// `init` return a promise for parity with the ESM API, but you do not have to call it - -const { exports, reexports } = parse(` - // named exports detection - module.exports.a = 'a'; - (function () { - exports.b = 'b'; - })(); - Object.defineProperty(exports, 'c', { value: 'c' }); - /* exports.d = 'not detected'; */ - - // reexports detection - if (maybe) module.exports = require('./dep1.js'); - if (another) module.exports = require('./dep2.js'); - - // literal exports assignments - module.exports = { a, b: c, d, 'e': f } - - // __esModule detection - Object.defineProperty(module.exports, '__esModule', { value: true }) -`); - -// exports === ['a', 'b', 'c', '__esModule'] -// reexports === ['./dep1.js', './dep2.js'] -``` - -When using the ESM version, Wasm is supported instead: - -```js -import { parse, init } from 'cjs-module-lexer'; -// init needs to be called and waited upon -await init(); -const { exports, reexports } = parse(source); -``` - -The Wasm build is around 1.5x faster and without a cold start. - -### Grammar - -CommonJS exports matches are run against the source token stream. - -The token grammar is: - -``` -IDENTIFIER: As defined by ECMA-262, without support for identifier `\` escapes, filtered to remove strict reserved words: - "implements", "interface", "let", "package", "private", "protected", "public", "static", "yield", "enum" - -STRING_LITERAL: A `"` or `'` bounded ECMA-262 string literal. - -MODULE_EXPORTS: `module` `.` `exports` - -EXPORTS_IDENTIFIER: MODULE_EXPORTS_IDENTIFIER | `exports` - -EXPORTS_DOT_ASSIGN: EXPORTS_IDENTIFIER `.` IDENTIFIER `=` - -EXPORTS_LITERAL_COMPUTED_ASSIGN: EXPORTS_IDENTIFIER `[` STRING_LITERAL `]` `=` - -EXPORTS_LITERAL_PROP: (IDENTIFIER (`:` IDENTIFIER)?) | (STRING_LITERAL `:` IDENTIFIER) - -EXPORTS_SPREAD: `...` (IDENTIFIER | REQUIRE) - -EXPORTS_MEMBER: EXPORTS_DOT_ASSIGN | EXPORTS_LITERAL_COMPUTED_ASSIGN - -EXPORTS_DEFINE: `Object` `.` `defineProperty `(` EXPORTS_IDENFITIER `,` STRING_LITERAL - -EXPORTS_DEFINE_VALUE: EXPORTS_DEFINE `, {` - (`enumerable: true,`)? - ( - `value:` | - `get` (`: function` IDENTIFIER? )? `() {` return IDENTIFIER (`.` IDENTIFIER | `[` STRING_LITERAL `]`)? `;`? `}` `,`? - ) - `})` - -EXPORTS_LITERAL: MODULE_EXPORTS `=` `{` (EXPORTS_LITERAL_PROP | EXPORTS_SPREAD) `,`)+ `}` - -REQUIRE: `require` `(` STRING_LITERAL `)` - -EXPORTS_ASSIGN: (`var` | `const` | `let`) IDENTIFIER `=` (`_interopRequireWildcard (`)? REQUIRE - -MODULE_EXPORTS_ASSIGN: MODULE_EXPORTS `=` REQUIRE - -EXPORT_STAR: (`__export` | `__exportStar`) `(` REQUIRE - -EXPORT_STAR_LIB: `Object.keys(` IDENTIFIER$1 `).forEach(function (` IDENTIFIER$2 `) {` - ( - ( - `if (` IDENTIFIER$2 `===` ( `'default'` | `"default"` ) `||` IDENTIFIER$2 `===` ( '__esModule' | `"__esModule"` ) `) return` `;`? - ( - (`if (Object` `.prototype`? `.hasOwnProperty.call(` IDENTIFIER `, ` IDENTIFIER$2 `)) return` `;`?)? - (`if (` IDENTIFIER$2 `in` EXPORTS_IDENTIFIER `&&` EXPORTS_IDENTIFIER `[` IDENTIFIER$2 `] ===` IDENTIFIER$1 `[` IDENTIFIER$2 `]) return` `;`)? - )? - ) | - `if (` IDENTIFIER$2 `!==` ( `'default'` | `"default"` ) (`&& !` (`Object` `.prototype`? `.hasOwnProperty.call(` IDENTIFIER `, ` IDENTIFIER$2 `)` | IDENTIFIER `.hasOwnProperty(` IDENTIFIER$2 `)`))? `)` - ) - ( - EXPORTS_IDENTIFIER `[` IDENTIFIER$2 `] =` IDENTIFIER$1 `[` IDENTIFIER$2 `]` `;`? | - `Object.defineProperty(` EXPORTS_IDENTIFIER `, ` IDENTIFIER$2 `, { enumerable: true, get` (`: function` IDENTIFIER? )? `() { return ` IDENTIFIER$1 `[` IDENTIFIER$2 `]` `;`? `}` `,`? `})` `;`? - ) - `})` -``` - -Spacing between tokens is taken to be any ECMA-262 whitespace, ECMA-262 block comment or ECMA-262 line comment. - -* The returned export names are taken to be the combination of: - 1. All `IDENTIFIER` and `STRING_LITERAL` slots for `EXPORTS_MEMBER` and `EXPORTS_LITERAL` matches. - 2. The first `STRING_LITERAL` slot for all `EXPORTS_DEFINE_VALUE` matches where that same string is not an `EXPORTS_DEFINE` match that is not also an `EXPORTS_DEFINE_VALUE` match. -* The reexport specifiers are taken to be the combination of: - 1. The `REQUIRE` matches of the last matched of either `MODULE_EXPORTS_ASSIGN` or `EXPORTS_LITERAL`. - 2. All _top-level_ `EXPORT_STAR` `REQUIRE` matches and `EXPORTS_ASSIGN` matches whose `IDENTIFIER` also matches the first `IDENTIFIER` in `EXPORT_STAR_LIB`. - -### Parsing Examples - -#### Named Exports Parsing - -The basic matching rules for named exports are `exports.name`, `exports['name']` or `Object.defineProperty(exports, 'name', ...)`. This matching is done without scope analysis and regardless of the expression position: - -```js -// DETECTS EXPORTS: a, b -(function (exports) { - exports.a = 'a'; - exports['b'] = 'b'; -})(exports); -``` - -Because there is no scope analysis, the above detection may overclassify: - -```js -// DETECTS EXPORTS: a, b, c -(function (exports, Object) { - exports.a = 'a'; - exports['b'] = 'b'; - if (false) - exports.c = 'c'; -})(NOT_EXPORTS, NOT_OBJECT); -``` - -It will in turn underclassify in cases where the identifiers are renamed: - -```js -// DETECTS: NO EXPORTS -(function (e) { - e.a = 'a'; - e['b'] = 'b'; -})(exports); -``` - -#### Getter Exports Parsing - -`Object.defineProperty` is detected for specifically value and getter forms returning an identifier or member expression: - -```js -// DETECTS: a, b, c, d, __esModule -Object.defineProperty(exports, 'a', { - enumerable: true, - get: function () { - return q.p; - } -}); -Object.defineProperty(exports, 'b', { - enumerable: true, - get: function () { - return q['p']; - } -}); -Object.defineProperty(exports, 'c', { - enumerable: true, - get () { - return b; - } -}); -Object.defineProperty(exports, 'd', { value: 'd' }); -Object.defineProperty(exports, '__esModule', { value: true }); -``` - -Value properties are also detected specifically: - -```js -Object.defineProperty(exports, 'a', { - value: 'no problem' -}); -``` - -To avoid matching getters that have side effects, any getter for an export name that does not support the forms above will -opt-out of the getter matching: - -```js -// DETECTS: NO EXPORTS -Object.defineProperty(exports, 'a', { - get () { - return 'nope'; - } -}); - -if (false) { - Object.defineProperty(module.exports, 'a', { - get () { - return dynamic(); - } - }) -} -``` - -Alternative object definition structures or getter function bodies are not detected: - -```js -// DETECTS: NO EXPORTS -Object.defineProperty(exports, 'a', { - enumerable: false, - get () { - return p; - } -}); -Object.defineProperty(exports, 'b', { - configurable: true, - get () { - return p; - } -}); -Object.defineProperty(exports, 'c', { - get: () => p -}); -Object.defineProperty(exports, 'd', { - enumerable: true, - get: function () { - return dynamic(); - } -}); -Object.defineProperty(exports, 'e', { - enumerable: true, - get () { - return 'str'; - } -}); -``` - -`Object.defineProperties` is also not supported. - -#### Exports Object Assignment - -A best-effort is made to detect `module.exports` object assignments, but because this is not a full parser, arbitrary expressions are not handled in the -object parsing process. - -Simple object definitions are supported: - -```js -// DETECTS EXPORTS: a, b, c -module.exports = { - a, - 'b': b, - c: c, - ...d -}; -``` - -Object properties that are not identifiers or string expressions will bail out of the object detection, while spreads are ignored: - -```js -// DETECTS EXPORTS: a, b -module.exports = { - a, - ...d, - b: require('c'), - c: "not detected since require('c') above bails the object detection" -} -``` - -`Object.defineProperties` is not currently supported either. - -#### module.exports reexport assignment - -Any `module.exports = require('mod')` assignment is detected as a reexport, but only the last one is returned: - -```js -// DETECTS REEXPORTS: c -module.exports = require('a'); -(module => module.exports = require('b'))(NOT_MODULE); -if (false) module.exports = require('c'); -``` - -This is to avoid over-classification in Webpack bundles with externals which include `module.exports = require('external')` in their source for every external dependency. - -In exports object assignment, any spread of `require()` are detected as multiple separate reexports: - -```js -// DETECTS REEXPORTS: a, b -module.exports = require('ignored'); -module.exports = { - ...require('a'), - ...require('b') -}; -``` - -#### Transpiler Re-exports - -For named exports, transpiler output works well with the rules described above. - -But for star re-exports, special care is taken to support common patterns of transpiler outputs from Babel and TypeScript as well as bundlers like RollupJS. -These reexport and star reexport patterns are restricted to only be detected at the top-level as provided by the direct output of these tools. - -For example, `export * from 'external'` is output by Babel as: - -```js -"use strict"; - -exports.__esModule = true; - -var _external = require("external"); - -Object.keys(_external).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - exports[key] = _external[key]; -}); -``` - -Where the `var _external = require("external")` is specifically detected as well as the `Object.keys(_external)` statement, down to the exact -for of that entire expression including minor variations of the output. The `_external` and `key` identifiers are carefully matched in this -detection. - -Similarly for TypeScript, `export * from 'external'` is output as: - -```js -"use strict"; -function __export(m) { - for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; -} -Object.defineProperty(exports, "__esModule", { value: true }); -__export(require("external")); -``` - -Where the `__export(require("external"))` statement is explicitly detected as a reexport, including variations `tslib.__export` and `__exportStar`. - -### Environment Support - -Node.js 10+, and [all browsers with Web Assembly support](https://caniuse.com/#feat=wasm). - -### JS Grammar Support - -* Token state parses all line comments, block comments, strings, template strings, blocks, parens and punctuators. -* Division operator / regex token ambiguity is handled via backtracking checks against punctuator prefixes, including closing brace or paren backtracking. -* Always correctly parses valid JS source, but may parse invalid JS source without errors. - -### Benchmarks - -Benchmarks can be run with `npm run bench`. - -Current results: - -JS Build: - -``` -Module load time -> 4ms -Cold Run, All Samples -test/samples/*.js (3635 KiB) -> 299ms - -Warm Runs (average of 25 runs) -test/samples/angular.js (1410 KiB) -> 13.96ms -test/samples/angular.min.js (303 KiB) -> 4.72ms -test/samples/d3.js (553 KiB) -> 6.76ms -test/samples/d3.min.js (250 KiB) -> 4ms -test/samples/magic-string.js (34 KiB) -> 0.64ms -test/samples/magic-string.min.js (20 KiB) -> 0ms -test/samples/rollup.js (698 KiB) -> 8.48ms -test/samples/rollup.min.js (367 KiB) -> 5.36ms - -Warm Runs, All Samples (average of 25 runs) -test/samples/*.js (3635 KiB) -> 40.28ms -``` - -Wasm Build: -``` -Module load time -> 10ms -Cold Run, All Samples -test/samples/*.js (3635 KiB) -> 43ms - -Warm Runs (average of 25 runs) -test/samples/angular.js (1410 KiB) -> 9.32ms -test/samples/angular.min.js (303 KiB) -> 3.16ms -test/samples/d3.js (553 KiB) -> 5ms -test/samples/d3.min.js (250 KiB) -> 2.32ms -test/samples/magic-string.js (34 KiB) -> 0.16ms -test/samples/magic-string.min.js (20 KiB) -> 0ms -test/samples/rollup.js (698 KiB) -> 6.28ms -test/samples/rollup.min.js (367 KiB) -> 3.6ms - -Warm Runs, All Samples (average of 25 runs) -test/samples/*.js (3635 KiB) -> 27.76ms -``` - -### Wasm Build Steps - -To build download the WASI SDK from https://github.com/WebAssembly/wasi-sdk/releases. - -The Makefile assumes the existence of "wasi-sdk-11.0" and "wabt" (optional) as sibling folders to this project. - -The build through the Makefile is then run via `make lib/lexer.wasm`, which can also be triggered via `npm run build-wasm` to create `dist/lexer.js`. - -On Windows it may be preferable to use the Linux subsystem. - -After the Web Assembly build, the CJS build can be triggered via `npm run build`. - -Optimization passes are run with [Binaryen](https://github.com/WebAssembly/binaryen) prior to publish to reduce the Web Assembly footprint. - -### License - -MIT - -[travis-url]: https://travis-ci.org/guybedford/es-module-lexer -[travis-image]: https://travis-ci.org/guybedford/es-module-lexer.svg?branch=master +# CJS Module Lexer + +[![Build Status][travis-image]][travis-url] + +A [very fast](#benchmarks) JS CommonJS module syntax lexer used to detect the most likely list of named exports of a CommonJS module. + +Outputs the list of named exports (`exports.name = ...`) and possible module reexports (`module.exports = require('...')`), including the common transpiler variations of these cases. + +Forked from https://github.com/guybedford/es-module-lexer. + +_Comprehensively handles the JS language grammar while remaining small and fast. - ~90ms per MB of JS cold and ~15ms per MB of JS warm, [see benchmarks](#benchmarks) for more info._ + +### Project Status + +This project is used in Node.js core for detecting the named exports available when importing a CJS module into ESM, and is maintained for this purpose. + +PRs will be accepted and upstreamed for parser bugs, performance improvements or new syntax support only. + +_Detection patterns for this project are **frozen**_. This is because adding any new export detection patterns would result in fragmented backwards-compatibility. Specifically, it would be very difficult to figure out why an ES module named export for CommonJS might work in newer Node.js versions but not older versions. This problem would only be discovered downstream of module authors, with the fix for module authors being to then have to understand which patterns in this project provide full backwards-compatibily. Rather, by fully freezing the detected patterns, if it works in any Node.js version it will work in any other. Build tools can also reliably treat the supported syntax for this project as a part of their output target for ensuring syntax support. + +### Usage + +``` +npm install cjs-module-lexer +``` + +For use in CommonJS: + +```js +const { parse } = require('cjs-module-lexer'); + +// `init` return a promise for parity with the ESM API, but you do not have to call it + +const { exports, reexports } = parse(` + // named exports detection + module.exports.a = 'a'; + (function () { + exports.b = 'b'; + })(); + Object.defineProperty(exports, 'c', { value: 'c' }); + /* exports.d = 'not detected'; */ + + // reexports detection + if (maybe) module.exports = require('./dep1.js'); + if (another) module.exports = require('./dep2.js'); + + // literal exports assignments + module.exports = { a, b: c, d, 'e': f } + + // __esModule detection + Object.defineProperty(module.exports, '__esModule', { value: true }) +`); + +// exports === ['a', 'b', 'c', '__esModule'] +// reexports === ['./dep1.js', './dep2.js'] +``` + +When using the ESM version, Wasm is supported instead: + +```js +import { parse, init } from 'cjs-module-lexer'; +// init needs to be called and waited upon +await init(); +const { exports, reexports } = parse(source); +``` + +The Wasm build is around 1.5x faster and without a cold start. + +### Grammar + +CommonJS exports matches are run against the source token stream. + +The token grammar is: + +``` +IDENTIFIER: As defined by ECMA-262, without support for identifier `\` escapes, filtered to remove strict reserved words: + "implements", "interface", "let", "package", "private", "protected", "public", "static", "yield", "enum" + +STRING_LITERAL: A `"` or `'` bounded ECMA-262 string literal. + +MODULE_EXPORTS: `module` `.` `exports` + +EXPORTS_IDENTIFIER: MODULE_EXPORTS_IDENTIFIER | `exports` + +EXPORTS_DOT_ASSIGN: EXPORTS_IDENTIFIER `.` IDENTIFIER `=` + +EXPORTS_LITERAL_COMPUTED_ASSIGN: EXPORTS_IDENTIFIER `[` STRING_LITERAL `]` `=` + +EXPORTS_LITERAL_PROP: (IDENTIFIER (`:` IDENTIFIER)?) | (STRING_LITERAL `:` IDENTIFIER) + +EXPORTS_SPREAD: `...` (IDENTIFIER | REQUIRE) + +EXPORTS_MEMBER: EXPORTS_DOT_ASSIGN | EXPORTS_LITERAL_COMPUTED_ASSIGN + +EXPORTS_DEFINE: `Object` `.` `defineProperty `(` EXPORTS_IDENFITIER `,` STRING_LITERAL + +EXPORTS_DEFINE_VALUE: EXPORTS_DEFINE `, {` + (`enumerable: true,`)? + ( + `value:` | + `get` (`: function` IDENTIFIER? )? `() {` return IDENTIFIER (`.` IDENTIFIER | `[` STRING_LITERAL `]`)? `;`? `}` `,`? + ) + `})` + +EXPORTS_LITERAL: MODULE_EXPORTS `=` `{` (EXPORTS_LITERAL_PROP | EXPORTS_SPREAD) `,`)+ `}` + +REQUIRE: `require` `(` STRING_LITERAL `)` + +EXPORTS_ASSIGN: (`var` | `const` | `let`) IDENTIFIER `=` (`_interopRequireWildcard (`)? REQUIRE + +MODULE_EXPORTS_ASSIGN: MODULE_EXPORTS `=` REQUIRE + +EXPORT_STAR: (`__export` | `__exportStar`) `(` REQUIRE + +EXPORT_STAR_LIB: `Object.keys(` IDENTIFIER$1 `).forEach(function (` IDENTIFIER$2 `) {` + ( + ( + `if (` IDENTIFIER$2 `===` ( `'default'` | `"default"` ) `||` IDENTIFIER$2 `===` ( '__esModule' | `"__esModule"` ) `) return` `;`? + ( + (`if (Object` `.prototype`? `.hasOwnProperty.call(` IDENTIFIER `, ` IDENTIFIER$2 `)) return` `;`?)? + (`if (` IDENTIFIER$2 `in` EXPORTS_IDENTIFIER `&&` EXPORTS_IDENTIFIER `[` IDENTIFIER$2 `] ===` IDENTIFIER$1 `[` IDENTIFIER$2 `]) return` `;`)? + )? + ) | + `if (` IDENTIFIER$2 `!==` ( `'default'` | `"default"` ) (`&& !` (`Object` `.prototype`? `.hasOwnProperty.call(` IDENTIFIER `, ` IDENTIFIER$2 `)` | IDENTIFIER `.hasOwnProperty(` IDENTIFIER$2 `)`))? `)` + ) + ( + EXPORTS_IDENTIFIER `[` IDENTIFIER$2 `] =` IDENTIFIER$1 `[` IDENTIFIER$2 `]` `;`? | + `Object.defineProperty(` EXPORTS_IDENTIFIER `, ` IDENTIFIER$2 `, { enumerable: true, get` (`: function` IDENTIFIER? )? `() { return ` IDENTIFIER$1 `[` IDENTIFIER$2 `]` `;`? `}` `,`? `})` `;`? + ) + `})` +``` + +Spacing between tokens is taken to be any ECMA-262 whitespace, ECMA-262 block comment or ECMA-262 line comment. + +* The returned export names are taken to be the combination of: + 1. All `IDENTIFIER` and `STRING_LITERAL` slots for `EXPORTS_MEMBER` and `EXPORTS_LITERAL` matches. + 2. The first `STRING_LITERAL` slot for all `EXPORTS_DEFINE_VALUE` matches where that same string is not an `EXPORTS_DEFINE` match that is not also an `EXPORTS_DEFINE_VALUE` match. +* The reexport specifiers are taken to be the combination of: + 1. The `REQUIRE` matches of the last matched of either `MODULE_EXPORTS_ASSIGN` or `EXPORTS_LITERAL`. + 2. All _top-level_ `EXPORT_STAR` `REQUIRE` matches and `EXPORTS_ASSIGN` matches whose `IDENTIFIER` also matches the first `IDENTIFIER` in `EXPORT_STAR_LIB`. + +### Parsing Examples + +#### Named Exports Parsing + +The basic matching rules for named exports are `exports.name`, `exports['name']` or `Object.defineProperty(exports, 'name', ...)`. This matching is done without scope analysis and regardless of the expression position: + +```js +// DETECTS EXPORTS: a, b +(function (exports) { + exports.a = 'a'; + exports['b'] = 'b'; +})(exports); +``` + +Because there is no scope analysis, the above detection may overclassify: + +```js +// DETECTS EXPORTS: a, b, c +(function (exports, Object) { + exports.a = 'a'; + exports['b'] = 'b'; + if (false) + exports.c = 'c'; +})(NOT_EXPORTS, NOT_OBJECT); +``` + +It will in turn underclassify in cases where the identifiers are renamed: + +```js +// DETECTS: NO EXPORTS +(function (e) { + e.a = 'a'; + e['b'] = 'b'; +})(exports); +``` + +#### Getter Exports Parsing + +`Object.defineProperty` is detected for specifically value and getter forms returning an identifier or member expression: + +```js +// DETECTS: a, b, c, d, __esModule +Object.defineProperty(exports, 'a', { + enumerable: true, + get: function () { + return q.p; + } +}); +Object.defineProperty(exports, 'b', { + enumerable: true, + get: function () { + return q['p']; + } +}); +Object.defineProperty(exports, 'c', { + enumerable: true, + get () { + return b; + } +}); +Object.defineProperty(exports, 'd', { value: 'd' }); +Object.defineProperty(exports, '__esModule', { value: true }); +``` + +Value properties are also detected specifically: + +```js +Object.defineProperty(exports, 'a', { + value: 'no problem' +}); +``` + +To avoid matching getters that have side effects, any getter for an export name that does not support the forms above will +opt-out of the getter matching: + +```js +// DETECTS: NO EXPORTS +Object.defineProperty(exports, 'a', { + get () { + return 'nope'; + } +}); + +if (false) { + Object.defineProperty(module.exports, 'a', { + get () { + return dynamic(); + } + }) +} +``` + +Alternative object definition structures or getter function bodies are not detected: + +```js +// DETECTS: NO EXPORTS +Object.defineProperty(exports, 'a', { + enumerable: false, + get () { + return p; + } +}); +Object.defineProperty(exports, 'b', { + configurable: true, + get () { + return p; + } +}); +Object.defineProperty(exports, 'c', { + get: () => p +}); +Object.defineProperty(exports, 'd', { + enumerable: true, + get: function () { + return dynamic(); + } +}); +Object.defineProperty(exports, 'e', { + enumerable: true, + get () { + return 'str'; + } +}); +``` + +`Object.defineProperties` is also not supported. + +#### Exports Object Assignment + +A best-effort is made to detect `module.exports` object assignments, but because this is not a full parser, arbitrary expressions are not handled in the +object parsing process. + +Simple object definitions are supported: + +```js +// DETECTS EXPORTS: a, b, c +module.exports = { + a, + 'b': b, + c: c, + ...d +}; +``` + +Object properties that are not identifiers or string expressions will bail out of the object detection, while spreads are ignored: + +```js +// DETECTS EXPORTS: a, b +module.exports = { + a, + ...d, + b: require('c'), + c: "not detected since require('c') above bails the object detection" +} +``` + +`Object.defineProperties` is not currently supported either. + +#### module.exports reexport assignment + +Any `module.exports = require('mod')` assignment is detected as a reexport, but only the last one is returned: + +```js +// DETECTS REEXPORTS: c +module.exports = require('a'); +(module => module.exports = require('b'))(NOT_MODULE); +if (false) module.exports = require('c'); +``` + +This is to avoid over-classification in Webpack bundles with externals which include `module.exports = require('external')` in their source for every external dependency. + +In exports object assignment, any spread of `require()` are detected as multiple separate reexports: + +```js +// DETECTS REEXPORTS: a, b +module.exports = require('ignored'); +module.exports = { + ...require('a'), + ...require('b') +}; +``` + +#### Transpiler Re-exports + +For named exports, transpiler output works well with the rules described above. + +But for star re-exports, special care is taken to support common patterns of transpiler outputs from Babel and TypeScript as well as bundlers like RollupJS. +These reexport and star reexport patterns are restricted to only be detected at the top-level as provided by the direct output of these tools. + +For example, `export * from 'external'` is output by Babel as: + +```js +"use strict"; + +exports.__esModule = true; + +var _external = require("external"); + +Object.keys(_external).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + exports[key] = _external[key]; +}); +``` + +Where the `var _external = require("external")` is specifically detected as well as the `Object.keys(_external)` statement, down to the exact +for of that entire expression including minor variations of the output. The `_external` and `key` identifiers are carefully matched in this +detection. + +Similarly for TypeScript, `export * from 'external'` is output as: + +```js +"use strict"; +function __export(m) { + for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; +} +Object.defineProperty(exports, "__esModule", { value: true }); +__export(require("external")); +``` + +Where the `__export(require("external"))` statement is explicitly detected as a reexport, including variations `tslib.__export` and `__exportStar`. + +### Environment Support + +Node.js 10+, and [all browsers with Web Assembly support](https://caniuse.com/#feat=wasm). + +### JS Grammar Support + +* Token state parses all line comments, block comments, strings, template strings, blocks, parens and punctuators. +* Division operator / regex token ambiguity is handled via backtracking checks against punctuator prefixes, including closing brace or paren backtracking. +* Always correctly parses valid JS source, but may parse invalid JS source without errors. + +### Benchmarks + +Benchmarks can be run with `npm run bench`. + +Current results: + +JS Build: + +``` +Module load time +> 4ms +Cold Run, All Samples +test/samples/*.js (3635 KiB) +> 299ms + +Warm Runs (average of 25 runs) +test/samples/angular.js (1410 KiB) +> 13.96ms +test/samples/angular.min.js (303 KiB) +> 4.72ms +test/samples/d3.js (553 KiB) +> 6.76ms +test/samples/d3.min.js (250 KiB) +> 4ms +test/samples/magic-string.js (34 KiB) +> 0.64ms +test/samples/magic-string.min.js (20 KiB) +> 0ms +test/samples/rollup.js (698 KiB) +> 8.48ms +test/samples/rollup.min.js (367 KiB) +> 5.36ms + +Warm Runs, All Samples (average of 25 runs) +test/samples/*.js (3635 KiB) +> 40.28ms +``` + +Wasm Build: +``` +Module load time +> 10ms +Cold Run, All Samples +test/samples/*.js (3635 KiB) +> 43ms + +Warm Runs (average of 25 runs) +test/samples/angular.js (1410 KiB) +> 9.32ms +test/samples/angular.min.js (303 KiB) +> 3.16ms +test/samples/d3.js (553 KiB) +> 5ms +test/samples/d3.min.js (250 KiB) +> 2.32ms +test/samples/magic-string.js (34 KiB) +> 0.16ms +test/samples/magic-string.min.js (20 KiB) +> 0ms +test/samples/rollup.js (698 KiB) +> 6.28ms +test/samples/rollup.min.js (367 KiB) +> 3.6ms + +Warm Runs, All Samples (average of 25 runs) +test/samples/*.js (3635 KiB) +> 27.76ms +``` + +### Wasm Build Steps + +To build download the WASI SDK from https://github.com/WebAssembly/wasi-sdk/releases. + +The Makefile assumes the existence of "wasi-sdk-11.0" and "wabt" (optional) as sibling folders to this project. + +The build through the Makefile is then run via `make lib/lexer.wasm`, which can also be triggered via `npm run build-wasm` to create `dist/lexer.js`. + +On Windows it may be preferable to use the Linux subsystem. + +After the Web Assembly build, the CJS build can be triggered via `npm run build`. + +Optimization passes are run with [Binaryen](https://github.com/WebAssembly/binaryen) prior to publish to reduce the Web Assembly footprint. + +### License + +MIT + +[travis-url]: https://travis-ci.org/guybedford/es-module-lexer +[travis-image]: https://travis-ci.org/guybedford/es-module-lexer.svg?branch=master diff --git a/node_modules/cjs-module-lexer/lexer.d.ts b/node_modules/cjs-module-lexer/lexer.d.ts index 99aa9137d..cdc94fbe9 100644 --- a/node_modules/cjs-module-lexer/lexer.d.ts +++ b/node_modules/cjs-module-lexer/lexer.d.ts @@ -1,7 +1,7 @@ -export interface Exports { - exports: string[]; - reexports: string[]; -} - -export declare function parse(source: string, name?: string): Exports; -export declare function init(): Promise; +export interface Exports { + exports: string[]; + reexports: string[]; +} + +export declare function parse(source: string, name?: string): Exports; +export declare function init(): Promise; diff --git a/node_modules/cjs-module-lexer/lexer.js b/node_modules/cjs-module-lexer/lexer.js index 1bf3123c1..ce80a676e 100644 --- a/node_modules/cjs-module-lexer/lexer.js +++ b/node_modules/cjs-module-lexer/lexer.js @@ -1,1438 +1,1438 @@ -let source, pos, end; -let openTokenDepth, - templateDepth, - lastTokenPos, - lastSlashWasDivision, - templateStack, - templateStackDepth, - openTokenPosStack, - openClassPosStack, - nextBraceIsClass, - starExportMap, - lastStarExportSpecifier, - _exports, - unsafeGetters, - reexports; - -function resetState () { - openTokenDepth = 0; - templateDepth = -1; - lastTokenPos = -1; - lastSlashWasDivision = false; - templateStack = new Array(1024); - templateStackDepth = 0; - openTokenPosStack = new Array(1024); - openClassPosStack = new Array(1024); - nextBraceIsClass = false; - starExportMap = Object.create(null); - lastStarExportSpecifier = null; - - _exports = new Set(); - unsafeGetters = new Set(); - reexports = new Set(); -} - -// RequireType -const Import = 0; -const ExportAssign = 1; -const ExportStar = 2; - -function parseCJS (source, name = '@') { - resetState(); - try { - parseSource(source); - } - catch (e) { - e.message += `\n at ${name}:${source.slice(0, pos).split('\n').length}:${pos - source.lastIndexOf('\n', pos - 1)}`; - e.loc = pos; - throw e; - } - const result = { exports: [..._exports].filter(expt => expt !== undefined && !unsafeGetters.has(expt)), reexports: [...reexports].filter(reexpt => reexpt !== undefined) }; - resetState(); - return result; -} - -function decode (str) { - if (str[0] === '"' || str[0] === '\'') { - try { - const decoded = (0, eval)(str); - // Filter to exclude non-matching UTF-16 surrogate strings - for (let i = 0; i < decoded.length; i++) { - const surrogatePrefix = decoded.charCodeAt(i) & 0xFC00; - if (surrogatePrefix < 0xD800) { - // Not a surrogate - continue; - } - else if (surrogatePrefix === 0xD800) { - // Validate surrogate pair - if ((decoded.charCodeAt(++i) & 0xFC00) !== 0xDC00) - return; - } - else { - // Out-of-range surrogate code (above 0xD800) - return; - } - } - return decoded; - } - catch {} - } - else { - return str; - } -} - -function parseSource (cjsSource) { - source = cjsSource; - pos = -1; - end = source.length - 1; - let ch = 0; - - // Handle #! - if (source.charCodeAt(0) === 35/*#*/ && source.charCodeAt(1) === 33/*!*/) { - if (source.length === 2) - return true; - pos += 2; - while (pos++ < end) { - ch = source.charCodeAt(pos); - if (ch === 10/*\n*/ || ch === 13/*\r*/) - break; - } - } - - while (pos++ < end) { - ch = source.charCodeAt(pos); - - if (ch === 32 || ch < 14 && ch > 8) - continue; - - if (openTokenDepth === 0) { - switch (ch) { - case 105/*i*/: - if (source.startsWith('mport', pos + 1) && keywordStart(pos)) - throwIfImportStatement(); - lastTokenPos = pos; - continue; - case 114/*r*/: - const startPos = pos; - if (tryParseRequire(Import) && keywordStart(startPos)) - tryBacktrackAddStarExportBinding(startPos - 1); - lastTokenPos = pos; - continue; - case 95/*_*/: - if (source.startsWith('interopRequireWildcard', pos + 1) && (keywordStart(pos) || source.charCodeAt(pos - 1) === 46/*.*/)) { - const startPos = pos; - pos += 23; - if (source.charCodeAt(pos) === 40/*(*/) { - pos++; - openTokenPosStack[openTokenDepth++] = lastTokenPos; - if (tryParseRequire(Import) && keywordStart(startPos)) { - tryBacktrackAddStarExportBinding(startPos - 1); - } - } - } - else if (source.startsWith('_export', pos + 1) && (keywordStart(pos) || source.charCodeAt(pos - 1) === 46/*.*/)) { - pos += 8; - if (source.startsWith('Star', pos)) - pos += 4; - if (source.charCodeAt(pos) === 40/*(*/) { - openTokenPosStack[openTokenDepth++] = lastTokenPos; - if (source.charCodeAt(++pos) === 114/*r*/) - tryParseRequire(ExportStar); - } - } - lastTokenPos = pos; - continue; - } - } - - switch (ch) { - case 101/*e*/: - if (source.startsWith('xport', pos + 1) && keywordStart(pos)) { - if (source.charCodeAt(pos + 6) === 115/*s*/) - tryParseExportsDotAssign(false); - else if (openTokenDepth === 0) - throwIfExportStatement(); - } - break; - case 99/*c*/: - if (keywordStart(pos) && source.startsWith('lass', pos + 1) && isBrOrWs(source.charCodeAt(pos + 5))) - nextBraceIsClass = true; - break; - case 109/*m*/: - if (source.startsWith('odule', pos + 1) && keywordStart(pos)) - tryParseModuleExportsDotAssign(); - break; - case 79/*O*/: - if (source.startsWith('bject', pos + 1) && keywordStart(pos)) - tryParseObjectDefineOrKeys(openTokenDepth === 0); - break; - case 40/*(*/: - openTokenPosStack[openTokenDepth++] = lastTokenPos; - break; - case 41/*)*/: - if (openTokenDepth === 0) - throw new Error('Unexpected closing bracket.'); - openTokenDepth--; - break; - case 123/*{*/: - openClassPosStack[openTokenDepth] = nextBraceIsClass; - nextBraceIsClass = false; - openTokenPosStack[openTokenDepth++] = lastTokenPos; - break; - case 125/*}*/: - if (openTokenDepth === 0) - throw new Error('Unexpected closing brace.'); - if (openTokenDepth-- === templateDepth) { - templateDepth = templateStack[--templateStackDepth]; - templateString(); - } - else { - if (templateDepth !== -1 && openTokenDepth < templateDepth) - throw new Error('Unexpected closing brace.'); - } - break; - case 60/*>*/: - // TODO: