backup: 2025-02-24
This commit is contained in:
parent
6d6bcf309d
commit
7196e9a046
|
@ -0,0 +1 @@
|
|||
node_modules/
|
|
@ -1,12 +0,0 @@
|
|||
#!/bin/sh
|
||||
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||
|
||||
case `uname` in
|
||||
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
|
||||
esac
|
||||
|
||||
if [ -x "$basedir/node" ]; then
|
||||
exec "$basedir/node" "$basedir/../mime/cli.js" "$@"
|
||||
else
|
||||
exec node "$basedir/../mime/cli.js" "$@"
|
||||
fi
|
|
@ -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" %*
|
|
@ -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
|
|
@ -1,12 +0,0 @@
|
|||
#!/bin/sh
|
||||
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||
|
||||
case `uname` in
|
||||
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
|
||||
esac
|
||||
|
||||
if [ -x "$basedir/node" ]; then
|
||||
exec "$basedir/node" "$basedir/../mkdirp/bin/cmd.js" "$@"
|
||||
else
|
||||
exec node "$basedir/../mkdirp/bin/cmd.js" "$@"
|
||||
fi
|
|
@ -1,17 +0,0 @@
|
|||
@ECHO off
|
||||
GOTO start
|
||||
:find_dp0
|
||||
SET dp0=%~dp0
|
||||
EXIT /b
|
||||
:start
|
||||
SETLOCAL
|
||||
CALL :find_dp0
|
||||
|
||||
IF EXIST "%dp0%\node.exe" (
|
||||
SET "_prog=%dp0%\node.exe"
|
||||
) ELSE (
|
||||
SET "_prog=node"
|
||||
SET PATHEXT=%PATHEXT:;.JS;=;%
|
||||
)
|
||||
|
||||
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\mkdirp\bin\cmd.js" %*
|
|
@ -1,28 +0,0 @@
|
|||
#!/usr/bin/env pwsh
|
||||
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
|
||||
|
||||
$exe=""
|
||||
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
|
||||
# Fix case when both the Windows and Linux builds of Node
|
||||
# are installed in the same directory
|
||||
$exe=".exe"
|
||||
}
|
||||
$ret=0
|
||||
if (Test-Path "$basedir/node$exe") {
|
||||
# Support pipeline input
|
||||
if ($MyInvocation.ExpectingInput) {
|
||||
$input | & "$basedir/node$exe" "$basedir/../mkdirp/bin/cmd.js" $args
|
||||
} else {
|
||||
& "$basedir/node$exe" "$basedir/../mkdirp/bin/cmd.js" $args
|
||||
}
|
||||
$ret=$LASTEXITCODE
|
||||
} else {
|
||||
# Support pipeline input
|
||||
if ($MyInvocation.ExpectingInput) {
|
||||
$input | & "node$exe" "$basedir/../mkdirp/bin/cmd.js" $args
|
||||
} else {
|
||||
& "node$exe" "$basedir/../mkdirp/bin/cmd.js" $args
|
||||
}
|
||||
$ret=$LASTEXITCODE
|
||||
}
|
||||
exit $ret
|
|
@ -1,12 +0,0 @@
|
|||
#!/bin/sh
|
||||
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||
|
||||
case `uname` in
|
||||
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
|
||||
esac
|
||||
|
||||
if [ -x "$basedir/node" ]; then
|
||||
exec "$basedir/node" "$basedir/../mustache/bin/mustache" "$@"
|
||||
else
|
||||
exec node "$basedir/../mustache/bin/mustache" "$@"
|
||||
fi
|
|
@ -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%\..\mustache\bin\mustache" %*
|
|
@ -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/../mustache/bin/mustache" $args
|
||||
} else {
|
||||
& "$basedir/node$exe" "$basedir/../mustache/bin/mustache" $args
|
||||
}
|
||||
$ret=$LASTEXITCODE
|
||||
} else {
|
||||
# Support pipeline input
|
||||
if ($MyInvocation.ExpectingInput) {
|
||||
$input | & "node$exe" "$basedir/../mustache/bin/mustache" $args
|
||||
} else {
|
||||
& "node$exe" "$basedir/../mustache/bin/mustache" $args
|
||||
}
|
||||
$ret=$LASTEXITCODE
|
||||
}
|
||||
exit $ret
|
|
@ -1,12 +0,0 @@
|
|||
#!/bin/sh
|
||||
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||
|
||||
case `uname` in
|
||||
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
|
||||
esac
|
||||
|
||||
if [ -x "$basedir/node" ]; then
|
||||
exec "$basedir/node" "$basedir/../which/bin/node-which" "$@"
|
||||
else
|
||||
exec node "$basedir/../which/bin/node-which" "$@"
|
||||
fi
|
|
@ -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" %*
|
|
@ -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
|
|
@ -1,12 +0,0 @@
|
|||
#!/bin/sh
|
||||
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||
|
||||
case `uname` in
|
||||
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
|
||||
esac
|
||||
|
||||
if [ -x "$basedir/node" ]; then
|
||||
exec "$basedir/node" "$basedir/../pixelmatch/bin/pixelmatch" "$@"
|
||||
else
|
||||
exec node "$basedir/../pixelmatch/bin/pixelmatch" "$@"
|
||||
fi
|
|
@ -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%\..\pixelmatch\bin\pixelmatch" %*
|
|
@ -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/../pixelmatch/bin/pixelmatch" $args
|
||||
} else {
|
||||
& "$basedir/node$exe" "$basedir/../pixelmatch/bin/pixelmatch" $args
|
||||
}
|
||||
$ret=$LASTEXITCODE
|
||||
} else {
|
||||
# Support pipeline input
|
||||
if ($MyInvocation.ExpectingInput) {
|
||||
$input | & "node$exe" "$basedir/../pixelmatch/bin/pixelmatch" $args
|
||||
} else {
|
||||
& "node$exe" "$basedir/../pixelmatch/bin/pixelmatch" $args
|
||||
}
|
||||
$ret=$LASTEXITCODE
|
||||
}
|
||||
exit $ret
|
|
@ -1,12 +0,0 @@
|
|||
#!/bin/sh
|
||||
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||
|
||||
case `uname` in
|
||||
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
|
||||
esac
|
||||
|
||||
if [ -x "$basedir/node" ]; then
|
||||
exec "$basedir/node" "$basedir/../prebuild-install/bin.js" "$@"
|
||||
else
|
||||
exec node "$basedir/../prebuild-install/bin.js" "$@"
|
||||
fi
|
|
@ -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%\..\prebuild-install\bin.js" %*
|
|
@ -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/../prebuild-install/bin.js" $args
|
||||
} else {
|
||||
& "$basedir/node$exe" "$basedir/../prebuild-install/bin.js" $args
|
||||
}
|
||||
$ret=$LASTEXITCODE
|
||||
} else {
|
||||
# Support pipeline input
|
||||
if ($MyInvocation.ExpectingInput) {
|
||||
$input | & "node$exe" "$basedir/../prebuild-install/bin.js" $args
|
||||
} else {
|
||||
& "node$exe" "$basedir/../prebuild-install/bin.js" $args
|
||||
}
|
||||
$ret=$LASTEXITCODE
|
||||
}
|
||||
exit $ret
|
|
@ -1,12 +0,0 @@
|
|||
#!/bin/sh
|
||||
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||
|
||||
case `uname` in
|
||||
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
|
||||
esac
|
||||
|
||||
if [ -x "$basedir/node" ]; then
|
||||
exec "$basedir/node" "$basedir/../qrcode/bin/qrcode" "$@"
|
||||
else
|
||||
exec node "$basedir/../qrcode/bin/qrcode" "$@"
|
||||
fi
|
|
@ -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%\..\qrcode\bin\qrcode" %*
|
|
@ -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/../qrcode/bin/qrcode" $args
|
||||
} else {
|
||||
& "$basedir/node$exe" "$basedir/../qrcode/bin/qrcode" $args
|
||||
}
|
||||
$ret=$LASTEXITCODE
|
||||
} else {
|
||||
# Support pipeline input
|
||||
if ($MyInvocation.ExpectingInput) {
|
||||
$input | & "node$exe" "$basedir/../qrcode/bin/qrcode" $args
|
||||
} else {
|
||||
& "node$exe" "$basedir/../qrcode/bin/qrcode" $args
|
||||
}
|
||||
$ret=$LASTEXITCODE
|
||||
}
|
||||
exit $ret
|
|
@ -1,12 +0,0 @@
|
|||
#!/bin/sh
|
||||
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||
|
||||
case `uname` in
|
||||
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
|
||||
esac
|
||||
|
||||
if [ -x "$basedir/node" ]; then
|
||||
exec "$basedir/node" "$basedir/../rc/cli.js" "$@"
|
||||
else
|
||||
exec node "$basedir/../rc/cli.js" "$@"
|
||||
fi
|
|
@ -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%\..\rc\cli.js" %*
|
|
@ -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/../rc/cli.js" $args
|
||||
} else {
|
||||
& "$basedir/node$exe" "$basedir/../rc/cli.js" $args
|
||||
}
|
||||
$ret=$LASTEXITCODE
|
||||
} else {
|
||||
# Support pipeline input
|
||||
if ($MyInvocation.ExpectingInput) {
|
||||
$input | & "node$exe" "$basedir/../rc/cli.js" $args
|
||||
} else {
|
||||
& "node$exe" "$basedir/../rc/cli.js" $args
|
||||
}
|
||||
$ret=$LASTEXITCODE
|
||||
}
|
||||
exit $ret
|
|
@ -1,12 +0,0 @@
|
|||
#!/bin/sh
|
||||
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||
|
||||
case `uname` in
|
||||
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
|
||||
esac
|
||||
|
||||
if [ -x "$basedir/node" ]; then
|
||||
exec "$basedir/node" "$basedir/../semver/bin/semver.js" "$@"
|
||||
else
|
||||
exec node "$basedir/../semver/bin/semver.js" "$@"
|
||||
fi
|
|
@ -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" %*
|
|
@ -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
|
|
@ -1,12 +0,0 @@
|
|||
#!/bin/sh
|
||||
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||
|
||||
case `uname` in
|
||||
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
|
||||
esac
|
||||
|
||||
if [ -x "$basedir/node" ]; then
|
||||
exec "$basedir/node" --no-warnings --loader ts-node/esm --experimental-vm-modules "$basedir/../sidecar/dist/esm/bin/sidecar-dump.js" "$@"
|
||||
else
|
||||
exec node --no-warnings --loader ts-node/esm --experimental-vm-modules "$basedir/../sidecar/dist/esm/bin/sidecar-dump.js" "$@"
|
||||
fi
|
|
@ -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%" --no-warnings --loader ts-node/esm --experimental-vm-modules "%dp0%\..\sidecar\dist\esm\bin\sidecar-dump.js" %*
|
|
@ -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" --no-warnings --loader ts-node/esm --experimental-vm-modules "$basedir/../sidecar/dist/esm/bin/sidecar-dump.js" $args
|
||||
} else {
|
||||
& "$basedir/node$exe" --no-warnings --loader ts-node/esm --experimental-vm-modules "$basedir/../sidecar/dist/esm/bin/sidecar-dump.js" $args
|
||||
}
|
||||
$ret=$LASTEXITCODE
|
||||
} else {
|
||||
# Support pipeline input
|
||||
if ($MyInvocation.ExpectingInput) {
|
||||
$input | & "node$exe" --no-warnings --loader ts-node/esm --experimental-vm-modules "$basedir/../sidecar/dist/esm/bin/sidecar-dump.js" $args
|
||||
} else {
|
||||
& "node$exe" --no-warnings --loader ts-node/esm --experimental-vm-modules "$basedir/../sidecar/dist/esm/bin/sidecar-dump.js" $args
|
||||
}
|
||||
$ret=$LASTEXITCODE
|
||||
}
|
||||
exit $ret
|
|
@ -1,12 +0,0 @@
|
|||
#!/bin/sh
|
||||
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||
|
||||
case `uname` in
|
||||
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
|
||||
esac
|
||||
|
||||
if [ -x "$basedir/node" ]; then
|
||||
exec "$basedir/node" "$basedir/../uuid/dist/bin/uuid" "$@"
|
||||
else
|
||||
exec node "$basedir/../uuid/dist/bin/uuid" "$@"
|
||||
fi
|
|
@ -1,17 +0,0 @@
|
|||
@ECHO off
|
||||
GOTO start
|
||||
:find_dp0
|
||||
SET dp0=%~dp0
|
||||
EXIT /b
|
||||
:start
|
||||
SETLOCAL
|
||||
CALL :find_dp0
|
||||
|
||||
IF EXIST "%dp0%\node.exe" (
|
||||
SET "_prog=%dp0%\node.exe"
|
||||
) ELSE (
|
||||
SET "_prog=node"
|
||||
SET PATHEXT=%PATHEXT:;.JS;=;%
|
||||
)
|
||||
|
||||
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\uuid\dist\bin\uuid" %*
|
|
@ -1,28 +0,0 @@
|
|||
#!/usr/bin/env pwsh
|
||||
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
|
||||
|
||||
$exe=""
|
||||
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
|
||||
# Fix case when both the Windows and Linux builds of Node
|
||||
# are installed in the same directory
|
||||
$exe=".exe"
|
||||
}
|
||||
$ret=0
|
||||
if (Test-Path "$basedir/node$exe") {
|
||||
# Support pipeline input
|
||||
if ($MyInvocation.ExpectingInput) {
|
||||
$input | & "$basedir/node$exe" "$basedir/../uuid/dist/bin/uuid" $args
|
||||
} else {
|
||||
& "$basedir/node$exe" "$basedir/../uuid/dist/bin/uuid" $args
|
||||
}
|
||||
$ret=$LASTEXITCODE
|
||||
} else {
|
||||
# Support pipeline input
|
||||
if ($MyInvocation.ExpectingInput) {
|
||||
$input | & "node$exe" "$basedir/../uuid/dist/bin/uuid" $args
|
||||
} else {
|
||||
& "node$exe" "$basedir/../uuid/dist/bin/uuid" $args
|
||||
}
|
||||
$ret=$LASTEXITCODE
|
||||
}
|
||||
exit $ret
|
|
@ -1,128 +0,0 @@
|
|||
declare namespace QuickLRU {
|
||||
interface Options<KeyType, ValueType> {
|
||||
/**
|
||||
The maximum number of milliseconds an item should remain in the cache.
|
||||
|
||||
@default Infinity
|
||||
|
||||
By default, `maxAge` will be `Infinity`, which means that items will never expire.
|
||||
Lazy expiration upon the next write or read call.
|
||||
|
||||
Individual expiration of an item can be specified by the `set(key, value, maxAge)` method.
|
||||
*/
|
||||
readonly maxAge?: number;
|
||||
|
||||
/**
|
||||
The maximum number of items before evicting the least recently used items.
|
||||
*/
|
||||
readonly maxSize: number;
|
||||
|
||||
/**
|
||||
Called right before an item is evicted from the cache.
|
||||
|
||||
Useful for side effects or for items like object URLs that need explicit cleanup (`revokeObjectURL`).
|
||||
*/
|
||||
onEviction?: (key: KeyType, value: ValueType) => void;
|
||||
}
|
||||
}
|
||||
|
||||
declare class QuickLRU<KeyType, ValueType>
|
||||
implements Iterable<[KeyType, ValueType]> {
|
||||
/**
|
||||
The stored item count.
|
||||
*/
|
||||
readonly size: number;
|
||||
|
||||
/**
|
||||
Simple ["Least Recently Used" (LRU) cache](https://en.m.wikipedia.org/wiki/Cache_replacement_policies#Least_Recently_Used_.28LRU.29).
|
||||
|
||||
The instance is [`iterable`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Iteration_protocols) so you can use it directly in a [`for…of`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Statements/for...of) loop.
|
||||
|
||||
@example
|
||||
```
|
||||
import QuickLRU = require('quick-lru');
|
||||
|
||||
const lru = new QuickLRU({maxSize: 1000});
|
||||
|
||||
lru.set('🦄', '🌈');
|
||||
|
||||
lru.has('🦄');
|
||||
//=> true
|
||||
|
||||
lru.get('🦄');
|
||||
//=> '🌈'
|
||||
```
|
||||
*/
|
||||
constructor(options: QuickLRU.Options<KeyType, ValueType>);
|
||||
|
||||
[Symbol.iterator](): IterableIterator<[KeyType, ValueType]>;
|
||||
|
||||
/**
|
||||
Set an item. Returns the instance.
|
||||
|
||||
Individual expiration of an item can be specified with the `maxAge` option. If not specified, the global `maxAge` value will be used in case it is specified in the constructor, otherwise the item will never expire.
|
||||
|
||||
@returns The list instance.
|
||||
*/
|
||||
set(key: KeyType, value: ValueType, options?: {maxAge?: number}): this;
|
||||
|
||||
/**
|
||||
Get an item.
|
||||
|
||||
@returns The stored item or `undefined`.
|
||||
*/
|
||||
get(key: KeyType): ValueType | undefined;
|
||||
|
||||
/**
|
||||
Check if an item exists.
|
||||
*/
|
||||
has(key: KeyType): boolean;
|
||||
|
||||
/**
|
||||
Get an item without marking it as recently used.
|
||||
|
||||
@returns The stored item or `undefined`.
|
||||
*/
|
||||
peek(key: KeyType): ValueType | undefined;
|
||||
|
||||
/**
|
||||
Delete an item.
|
||||
|
||||
@returns `true` if the item is removed or `false` if the item doesn't exist.
|
||||
*/
|
||||
delete(key: KeyType): boolean;
|
||||
|
||||
/**
|
||||
Delete all items.
|
||||
*/
|
||||
clear(): void;
|
||||
|
||||
/**
|
||||
Update the `maxSize` in-place, discarding items as necessary. Insertion order is mostly preserved, though this is not a strong guarantee.
|
||||
|
||||
Useful for on-the-fly tuning of cache sizes in live systems.
|
||||
*/
|
||||
resize(maxSize: number): void;
|
||||
|
||||
/**
|
||||
Iterable for all the keys.
|
||||
*/
|
||||
keys(): IterableIterator<KeyType>;
|
||||
|
||||
/**
|
||||
Iterable for all the values.
|
||||
*/
|
||||
values(): IterableIterator<ValueType>;
|
||||
|
||||
/**
|
||||
Iterable for all entries, starting with the oldest (ascending in recency).
|
||||
*/
|
||||
entriesAscending(): IterableIterator<[KeyType, ValueType]>;
|
||||
|
||||
/**
|
||||
Iterable for all entries, starting with the newest (descending in recency).
|
||||
*/
|
||||
entriesDescending(): IterableIterator<[KeyType, ValueType]>;
|
||||
}
|
||||
|
||||
export = QuickLRU;
|
|
@ -1,263 +0,0 @@
|
|||
'use strict';
|
||||
|
||||
class QuickLRU {
|
||||
constructor(options = {}) {
|
||||
if (!(options.maxSize && options.maxSize > 0)) {
|
||||
throw new TypeError('`maxSize` must be a number greater than 0');
|
||||
}
|
||||
|
||||
if (typeof options.maxAge === 'number' && options.maxAge === 0) {
|
||||
throw new TypeError('`maxAge` must be a number greater than 0');
|
||||
}
|
||||
|
||||
this.maxSize = options.maxSize;
|
||||
this.maxAge = options.maxAge || Infinity;
|
||||
this.onEviction = options.onEviction;
|
||||
this.cache = new Map();
|
||||
this.oldCache = new Map();
|
||||
this._size = 0;
|
||||
}
|
||||
|
||||
_emitEvictions(cache) {
|
||||
if (typeof this.onEviction !== 'function') {
|
||||
return;
|
||||
}
|
||||
|
||||
for (const [key, item] of cache) {
|
||||
this.onEviction(key, item.value);
|
||||
}
|
||||
}
|
||||
|
||||
_deleteIfExpired(key, item) {
|
||||
if (typeof item.expiry === 'number' && item.expiry <= Date.now()) {
|
||||
if (typeof this.onEviction === 'function') {
|
||||
this.onEviction(key, item.value);
|
||||
}
|
||||
|
||||
return this.delete(key);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
_getOrDeleteIfExpired(key, item) {
|
||||
const deleted = this._deleteIfExpired(key, item);
|
||||
if (deleted === false) {
|
||||
return item.value;
|
||||
}
|
||||
}
|
||||
|
||||
_getItemValue(key, item) {
|
||||
return item.expiry ? this._getOrDeleteIfExpired(key, item) : item.value;
|
||||
}
|
||||
|
||||
_peek(key, cache) {
|
||||
const item = cache.get(key);
|
||||
|
||||
return this._getItemValue(key, item);
|
||||
}
|
||||
|
||||
_set(key, value) {
|
||||
this.cache.set(key, value);
|
||||
this._size++;
|
||||
|
||||
if (this._size >= this.maxSize) {
|
||||
this._size = 0;
|
||||
this._emitEvictions(this.oldCache);
|
||||
this.oldCache = this.cache;
|
||||
this.cache = new Map();
|
||||
}
|
||||
}
|
||||
|
||||
_moveToRecent(key, item) {
|
||||
this.oldCache.delete(key);
|
||||
this._set(key, item);
|
||||
}
|
||||
|
||||
* _entriesAscending() {
|
||||
for (const item of this.oldCache) {
|
||||
const [key, value] = item;
|
||||
if (!this.cache.has(key)) {
|
||||
const deleted = this._deleteIfExpired(key, value);
|
||||
if (deleted === false) {
|
||||
yield item;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (const item of this.cache) {
|
||||
const [key, value] = item;
|
||||
const deleted = this._deleteIfExpired(key, value);
|
||||
if (deleted === false) {
|
||||
yield item;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
get(key) {
|
||||
if (this.cache.has(key)) {
|
||||
const item = this.cache.get(key);
|
||||
|
||||
return this._getItemValue(key, item);
|
||||
}
|
||||
|
||||
if (this.oldCache.has(key)) {
|
||||
const item = this.oldCache.get(key);
|
||||
if (this._deleteIfExpired(key, item) === false) {
|
||||
this._moveToRecent(key, item);
|
||||
return item.value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
set(key, value, {maxAge = this.maxAge === Infinity ? undefined : Date.now() + this.maxAge} = {}) {
|
||||
if (this.cache.has(key)) {
|
||||
this.cache.set(key, {
|
||||
value,
|
||||
maxAge
|
||||
});
|
||||
} else {
|
||||
this._set(key, {value, expiry: maxAge});
|
||||
}
|
||||
}
|
||||
|
||||
has(key) {
|
||||
if (this.cache.has(key)) {
|
||||
return !this._deleteIfExpired(key, this.cache.get(key));
|
||||
}
|
||||
|
||||
if (this.oldCache.has(key)) {
|
||||
return !this._deleteIfExpired(key, this.oldCache.get(key));
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
peek(key) {
|
||||
if (this.cache.has(key)) {
|
||||
return this._peek(key, this.cache);
|
||||
}
|
||||
|
||||
if (this.oldCache.has(key)) {
|
||||
return this._peek(key, this.oldCache);
|
||||
}
|
||||
}
|
||||
|
||||
delete(key) {
|
||||
const deleted = this.cache.delete(key);
|
||||
if (deleted) {
|
||||
this._size--;
|
||||
}
|
||||
|
||||
return this.oldCache.delete(key) || deleted;
|
||||
}
|
||||
|
||||
clear() {
|
||||
this.cache.clear();
|
||||
this.oldCache.clear();
|
||||
this._size = 0;
|
||||
}
|
||||
|
||||
resize(newSize) {
|
||||
if (!(newSize && newSize > 0)) {
|
||||
throw new TypeError('`maxSize` must be a number greater than 0');
|
||||
}
|
||||
|
||||
const items = [...this._entriesAscending()];
|
||||
const removeCount = items.length - newSize;
|
||||
if (removeCount < 0) {
|
||||
this.cache = new Map(items);
|
||||
this.oldCache = new Map();
|
||||
this._size = items.length;
|
||||
} else {
|
||||
if (removeCount > 0) {
|
||||
this._emitEvictions(items.slice(0, removeCount));
|
||||
}
|
||||
|
||||
this.oldCache = new Map(items.slice(removeCount));
|
||||
this.cache = new Map();
|
||||
this._size = 0;
|
||||
}
|
||||
|
||||
this.maxSize = newSize;
|
||||
}
|
||||
|
||||
* keys() {
|
||||
for (const [key] of this) {
|
||||
yield key;
|
||||
}
|
||||
}
|
||||
|
||||
* values() {
|
||||
for (const [, value] of this) {
|
||||
yield value;
|
||||
}
|
||||
}
|
||||
|
||||
* [Symbol.iterator]() {
|
||||
for (const item of this.cache) {
|
||||
const [key, value] = item;
|
||||
const deleted = this._deleteIfExpired(key, value);
|
||||
if (deleted === false) {
|
||||
yield [key, value.value];
|
||||
}
|
||||
}
|
||||
|
||||
for (const item of this.oldCache) {
|
||||
const [key, value] = item;
|
||||
if (!this.cache.has(key)) {
|
||||
const deleted = this._deleteIfExpired(key, value);
|
||||
if (deleted === false) {
|
||||
yield [key, value.value];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
* entriesDescending() {
|
||||
let items = [...this.cache];
|
||||
for (let i = items.length - 1; i >= 0; --i) {
|
||||
const item = items[i];
|
||||
const [key, value] = item;
|
||||
const deleted = this._deleteIfExpired(key, value);
|
||||
if (deleted === false) {
|
||||
yield [key, value.value];
|
||||
}
|
||||
}
|
||||
|
||||
items = [...this.oldCache];
|
||||
for (let i = items.length - 1; i >= 0; --i) {
|
||||
const item = items[i];
|
||||
const [key, value] = item;
|
||||
if (!this.cache.has(key)) {
|
||||
const deleted = this._deleteIfExpired(key, value);
|
||||
if (deleted === false) {
|
||||
yield [key, value.value];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
* entriesAscending() {
|
||||
for (const [key, value] of this._entriesAscending()) {
|
||||
yield [key, value.value];
|
||||
}
|
||||
}
|
||||
|
||||
get size() {
|
||||
if (!this._size) {
|
||||
return this.oldCache.size;
|
||||
}
|
||||
|
||||
let oldCacheSize = 0;
|
||||
for (const key of this.oldCache.keys()) {
|
||||
if (!this.cache.has(key)) {
|
||||
oldCacheSize++;
|
||||
}
|
||||
}
|
||||
|
||||
return Math.min(this._size + oldCacheSize, this.maxSize);
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = QuickLRU;
|
|
@ -1,9 +0,0 @@
|
|||
MIT License
|
||||
|
||||
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@ -1,43 +0,0 @@
|
|||
{
|
||||
"name": "@alloc/quick-lru",
|
||||
"version": "5.2.0",
|
||||
"description": "Simple “Least Recently Used” (LRU) cache",
|
||||
"license": "MIT",
|
||||
"repository": "sindresorhus/quick-lru",
|
||||
"funding": "https://github.com/sponsors/sindresorhus",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "https://sindresorhus.com"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && nyc ava && tsd"
|
||||
},
|
||||
"files": [
|
||||
"index.js",
|
||||
"index.d.ts"
|
||||
],
|
||||
"keywords": [
|
||||
"lru",
|
||||
"quick",
|
||||
"cache",
|
||||
"caching",
|
||||
"least",
|
||||
"recently",
|
||||
"used",
|
||||
"fast",
|
||||
"map",
|
||||
"hash",
|
||||
"buffer"
|
||||
],
|
||||
"devDependencies": {
|
||||
"ava": "^2.0.0",
|
||||
"coveralls": "^3.0.3",
|
||||
"nyc": "^15.0.0",
|
||||
"tsd": "^0.11.0",
|
||||
"xo": "^0.26.0"
|
||||
}
|
||||
}
|
|
@ -1,139 +0,0 @@
|
|||
# quick-lru [](https://travis-ci.org/sindresorhus/quick-lru) [](https://coveralls.io/github/sindresorhus/quick-lru?branch=master)
|
||||
|
||||
> Simple [“Least Recently Used” (LRU) cache](https://en.m.wikipedia.org/wiki/Cache_replacement_policies#Least_Recently_Used_.28LRU.29)
|
||||
|
||||
Useful when you need to cache something and limit memory usage.
|
||||
|
||||
Inspired by the [`hashlru` algorithm](https://github.com/dominictarr/hashlru#algorithm), but instead uses [`Map`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Map) to support keys of any type, not just strings, and values can be `undefined`.
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install quick-lru
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const QuickLRU = require('quick-lru');
|
||||
|
||||
const lru = new QuickLRU({maxSize: 1000});
|
||||
|
||||
lru.set('🦄', '🌈');
|
||||
|
||||
lru.has('🦄');
|
||||
//=> true
|
||||
|
||||
lru.get('🦄');
|
||||
//=> '🌈'
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
### new QuickLRU(options?)
|
||||
|
||||
Returns a new instance.
|
||||
|
||||
### options
|
||||
|
||||
Type: `object`
|
||||
|
||||
#### maxSize
|
||||
|
||||
*Required*\
|
||||
Type: `number`
|
||||
|
||||
The maximum number of items before evicting the least recently used items.
|
||||
|
||||
#### maxAge
|
||||
|
||||
Type: `number`\
|
||||
Default: `Infinity`
|
||||
|
||||
The maximum number of milliseconds an item should remain in cache.
|
||||
By default maxAge will be Infinity, which means that items will never expire.
|
||||
|
||||
Lazy expiration happens upon the next `write` or `read` call.
|
||||
|
||||
Individual expiration of an item can be specified by the `set(key, value, options)` method.
|
||||
|
||||
#### onEviction
|
||||
|
||||
*Optional*\
|
||||
Type: `(key, value) => void`
|
||||
|
||||
Called right before an item is evicted from the cache.
|
||||
|
||||
Useful for side effects or for items like object URLs that need explicit cleanup (`revokeObjectURL`).
|
||||
|
||||
### Instance
|
||||
|
||||
The instance is [`iterable`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Iteration_protocols) so you can use it directly in a [`for…of`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Statements/for...of) loop.
|
||||
|
||||
Both `key` and `value` can be of any type.
|
||||
|
||||
#### .set(key, value, options?)
|
||||
|
||||
Set an item. Returns the instance.
|
||||
|
||||
Individual expiration of an item can be specified with the `maxAge` option. If not specified, the global `maxAge` value will be used in case it is specified on the constructor, otherwise the item will never expire.
|
||||
|
||||
#### .get(key)
|
||||
|
||||
Get an item.
|
||||
|
||||
#### .has(key)
|
||||
|
||||
Check if an item exists.
|
||||
|
||||
#### .peek(key)
|
||||
|
||||
Get an item without marking it as recently used.
|
||||
|
||||
#### .delete(key)
|
||||
|
||||
Delete an item.
|
||||
|
||||
Returns `true` if the item is removed or `false` if the item doesn't exist.
|
||||
|
||||
#### .clear()
|
||||
|
||||
Delete all items.
|
||||
|
||||
#### .resize(maxSize)
|
||||
|
||||
Update the `maxSize`, discarding items as necessary. Insertion order is mostly preserved, though this is not a strong guarantee.
|
||||
|
||||
Useful for on-the-fly tuning of cache sizes in live systems.
|
||||
|
||||
#### .keys()
|
||||
|
||||
Iterable for all the keys.
|
||||
|
||||
#### .values()
|
||||
|
||||
Iterable for all the values.
|
||||
|
||||
#### .entriesAscending()
|
||||
|
||||
Iterable for all entries, starting with the oldest (ascending in recency).
|
||||
|
||||
#### .entriesDescending()
|
||||
|
||||
Iterable for all entries, starting with the newest (descending in recency).
|
||||
|
||||
#### .size
|
||||
|
||||
The stored item count.
|
||||
|
||||
---
|
||||
|
||||
<div align="center">
|
||||
<b>
|
||||
<a href="https://tidelift.com/subscription/pkg/npm-quick-lru?utm_source=npm-quick-lru&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a>
|
||||
</b>
|
||||
<br>
|
||||
<sub>
|
||||
Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
|
||||
</sub>
|
||||
</div>
|
|
@ -1,22 +0,0 @@
|
|||
MIT License
|
||||
|
||||
Copyright (c) 2014-present Sebastian McKenzie and other contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@ -1,19 +0,0 @@
|
|||
# @babel/runtime
|
||||
|
||||
> babel's modular runtime helpers
|
||||
|
||||
See our website [@babel/runtime](https://babeljs.io/docs/babel-runtime) for more information.
|
||||
|
||||
## Install
|
||||
|
||||
Using npm:
|
||||
|
||||
```sh
|
||||
npm install --save @babel/runtime
|
||||
```
|
||||
|
||||
or using yarn:
|
||||
|
||||
```sh
|
||||
yarn add @babel/runtime
|
||||
```
|
|
@ -1,64 +0,0 @@
|
|||
var OverloadYield = require("./OverloadYield.js");
|
||||
function AsyncGenerator(gen) {
|
||||
var front, back;
|
||||
function resume(key, arg) {
|
||||
try {
|
||||
var result = gen[key](arg),
|
||||
value = result.value,
|
||||
overloaded = value instanceof OverloadYield;
|
||||
Promise.resolve(overloaded ? value.v : value).then(function (arg) {
|
||||
if (overloaded) {
|
||||
var nextKey = "return" === key ? "return" : "next";
|
||||
if (!value.k || arg.done) return resume(nextKey, arg);
|
||||
arg = gen[nextKey](arg).value;
|
||||
}
|
||||
settle(result.done ? "return" : "normal", arg);
|
||||
}, function (err) {
|
||||
resume("throw", err);
|
||||
});
|
||||
} catch (err) {
|
||||
settle("throw", err);
|
||||
}
|
||||
}
|
||||
function settle(type, value) {
|
||||
switch (type) {
|
||||
case "return":
|
||||
front.resolve({
|
||||
value: value,
|
||||
done: !0
|
||||
});
|
||||
break;
|
||||
case "throw":
|
||||
front.reject(value);
|
||||
break;
|
||||
default:
|
||||
front.resolve({
|
||||
value: value,
|
||||
done: !1
|
||||
});
|
||||
}
|
||||
(front = front.next) ? resume(front.key, front.arg) : back = null;
|
||||
}
|
||||
this._invoke = function (key, arg) {
|
||||
return new Promise(function (resolve, reject) {
|
||||
var request = {
|
||||
key: key,
|
||||
arg: arg,
|
||||
resolve: resolve,
|
||||
reject: reject,
|
||||
next: null
|
||||
};
|
||||
back ? back = back.next = request : (front = back = request, resume(key, arg));
|
||||
});
|
||||
}, "function" != typeof gen["return"] && (this["return"] = void 0);
|
||||
}
|
||||
AsyncGenerator.prototype["function" == typeof Symbol && Symbol.asyncIterator || "@@asyncIterator"] = function () {
|
||||
return this;
|
||||
}, AsyncGenerator.prototype.next = function (arg) {
|
||||
return this._invoke("next", arg);
|
||||
}, AsyncGenerator.prototype["throw"] = function (arg) {
|
||||
return this._invoke("throw", arg);
|
||||
}, AsyncGenerator.prototype["return"] = function (arg) {
|
||||
return this._invoke("return", arg);
|
||||
};
|
||||
module.exports = AsyncGenerator, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
@ -1,4 +0,0 @@
|
|||
function _AwaitValue(value) {
|
||||
this.wrapped = value;
|
||||
}
|
||||
module.exports = _AwaitValue, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
@ -1,4 +0,0 @@
|
|||
function _OverloadYield(value, kind) {
|
||||
this.v = value, this.k = kind;
|
||||
}
|
||||
module.exports = _OverloadYield, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
@ -1,24 +0,0 @@
|
|||
function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) {
|
||||
var desc = {};
|
||||
Object.keys(descriptor).forEach(function (key) {
|
||||
desc[key] = descriptor[key];
|
||||
});
|
||||
desc.enumerable = !!desc.enumerable;
|
||||
desc.configurable = !!desc.configurable;
|
||||
if ('value' in desc || desc.initializer) {
|
||||
desc.writable = true;
|
||||
}
|
||||
desc = decorators.slice().reverse().reduce(function (desc, decorator) {
|
||||
return decorator(target, property, desc) || desc;
|
||||
}, desc);
|
||||
if (context && desc.initializer !== void 0) {
|
||||
desc.value = desc.initializer ? desc.initializer.call(context) : void 0;
|
||||
desc.initializer = undefined;
|
||||
}
|
||||
if (desc.initializer === void 0) {
|
||||
Object.defineProperty(target, property, desc);
|
||||
desc = null;
|
||||
}
|
||||
return desc;
|
||||
}
|
||||
module.exports = _applyDecoratedDescriptor, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
@ -1,236 +0,0 @@
|
|||
var _typeof = require("./typeof.js")["default"];
|
||||
function old_createMetadataMethodsForProperty(metadataMap, kind, property, decoratorFinishedRef) {
|
||||
return {
|
||||
getMetadata: function getMetadata(key) {
|
||||
old_assertNotFinished(decoratorFinishedRef, "getMetadata"), old_assertMetadataKey(key);
|
||||
var metadataForKey = metadataMap[key];
|
||||
if (void 0 !== metadataForKey) if (1 === kind) {
|
||||
var pub = metadataForKey["public"];
|
||||
if (void 0 !== pub) return pub[property];
|
||||
} else if (2 === kind) {
|
||||
var priv = metadataForKey["private"];
|
||||
if (void 0 !== priv) return priv.get(property);
|
||||
} else if (Object.hasOwnProperty.call(metadataForKey, "constructor")) return metadataForKey.constructor;
|
||||
},
|
||||
setMetadata: function setMetadata(key, value) {
|
||||
old_assertNotFinished(decoratorFinishedRef, "setMetadata"), old_assertMetadataKey(key);
|
||||
var metadataForKey = metadataMap[key];
|
||||
if (void 0 === metadataForKey && (metadataForKey = metadataMap[key] = {}), 1 === kind) {
|
||||
var pub = metadataForKey["public"];
|
||||
void 0 === pub && (pub = metadataForKey["public"] = {}), pub[property] = value;
|
||||
} else if (2 === kind) {
|
||||
var priv = metadataForKey.priv;
|
||||
void 0 === priv && (priv = metadataForKey["private"] = new Map()), priv.set(property, value);
|
||||
} else metadataForKey.constructor = value;
|
||||
}
|
||||
};
|
||||
}
|
||||
function old_convertMetadataMapToFinal(obj, metadataMap) {
|
||||
var parentMetadataMap = obj[Symbol.metadata || Symbol["for"]("Symbol.metadata")],
|
||||
metadataKeys = Object.getOwnPropertySymbols(metadataMap);
|
||||
if (0 !== metadataKeys.length) {
|
||||
for (var i = 0; i < metadataKeys.length; i++) {
|
||||
var key = metadataKeys[i],
|
||||
metaForKey = metadataMap[key],
|
||||
parentMetaForKey = parentMetadataMap ? parentMetadataMap[key] : null,
|
||||
pub = metaForKey["public"],
|
||||
parentPub = parentMetaForKey ? parentMetaForKey["public"] : null;
|
||||
pub && parentPub && Object.setPrototypeOf(pub, parentPub);
|
||||
var priv = metaForKey["private"];
|
||||
if (priv) {
|
||||
var privArr = Array.from(priv.values()),
|
||||
parentPriv = parentMetaForKey ? parentMetaForKey["private"] : null;
|
||||
parentPriv && (privArr = privArr.concat(parentPriv)), metaForKey["private"] = privArr;
|
||||
}
|
||||
parentMetaForKey && Object.setPrototypeOf(metaForKey, parentMetaForKey);
|
||||
}
|
||||
parentMetadataMap && Object.setPrototypeOf(metadataMap, parentMetadataMap), obj[Symbol.metadata || Symbol["for"]("Symbol.metadata")] = metadataMap;
|
||||
}
|
||||
}
|
||||
function old_createAddInitializerMethod(initializers, decoratorFinishedRef) {
|
||||
return function (initializer) {
|
||||
old_assertNotFinished(decoratorFinishedRef, "addInitializer"), old_assertCallable(initializer, "An initializer"), initializers.push(initializer);
|
||||
};
|
||||
}
|
||||
function old_memberDec(dec, name, desc, metadataMap, initializers, kind, isStatic, isPrivate, value) {
|
||||
var kindStr;
|
||||
switch (kind) {
|
||||
case 1:
|
||||
kindStr = "accessor";
|
||||
break;
|
||||
case 2:
|
||||
kindStr = "method";
|
||||
break;
|
||||
case 3:
|
||||
kindStr = "getter";
|
||||
break;
|
||||
case 4:
|
||||
kindStr = "setter";
|
||||
break;
|
||||
default:
|
||||
kindStr = "field";
|
||||
}
|
||||
var metadataKind,
|
||||
metadataName,
|
||||
ctx = {
|
||||
kind: kindStr,
|
||||
name: isPrivate ? "#" + name : name,
|
||||
isStatic: isStatic,
|
||||
isPrivate: isPrivate
|
||||
},
|
||||
decoratorFinishedRef = {
|
||||
v: !1
|
||||
};
|
||||
if (0 !== kind && (ctx.addInitializer = old_createAddInitializerMethod(initializers, decoratorFinishedRef)), isPrivate) {
|
||||
metadataKind = 2, metadataName = Symbol(name);
|
||||
var access = {};
|
||||
0 === kind ? (access.get = desc.get, access.set = desc.set) : 2 === kind ? access.get = function () {
|
||||
return desc.value;
|
||||
} : (1 !== kind && 3 !== kind || (access.get = function () {
|
||||
return desc.get.call(this);
|
||||
}), 1 !== kind && 4 !== kind || (access.set = function (v) {
|
||||
desc.set.call(this, v);
|
||||
})), ctx.access = access;
|
||||
} else metadataKind = 1, metadataName = name;
|
||||
try {
|
||||
return dec(value, Object.assign(ctx, old_createMetadataMethodsForProperty(metadataMap, metadataKind, metadataName, decoratorFinishedRef)));
|
||||
} finally {
|
||||
decoratorFinishedRef.v = !0;
|
||||
}
|
||||
}
|
||||
function old_assertNotFinished(decoratorFinishedRef, fnName) {
|
||||
if (decoratorFinishedRef.v) throw new Error("attempted to call " + fnName + " after decoration was finished");
|
||||
}
|
||||
function old_assertMetadataKey(key) {
|
||||
if ("symbol" != _typeof(key)) throw new TypeError("Metadata keys must be symbols, received: " + key);
|
||||
}
|
||||
function old_assertCallable(fn, hint) {
|
||||
if ("function" != typeof fn) throw new TypeError(hint + " must be a function");
|
||||
}
|
||||
function old_assertValidReturnValue(kind, value) {
|
||||
var type = _typeof(value);
|
||||
if (1 === kind) {
|
||||
if ("object" !== type || null === value) throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0");
|
||||
void 0 !== value.get && old_assertCallable(value.get, "accessor.get"), void 0 !== value.set && old_assertCallable(value.set, "accessor.set"), void 0 !== value.init && old_assertCallable(value.init, "accessor.init"), void 0 !== value.initializer && old_assertCallable(value.initializer, "accessor.initializer");
|
||||
} else if ("function" !== type) {
|
||||
var hint;
|
||||
throw hint = 0 === kind ? "field" : 10 === kind ? "class" : "method", new TypeError(hint + " decorators must return a function or void 0");
|
||||
}
|
||||
}
|
||||
function old_getInit(desc) {
|
||||
var initializer;
|
||||
return null == (initializer = desc.init) && (initializer = desc.initializer) && "undefined" != typeof console && console.warn(".initializer has been renamed to .init as of March 2022"), initializer;
|
||||
}
|
||||
function old_applyMemberDec(ret, base, decInfo, name, kind, isStatic, isPrivate, metadataMap, initializers) {
|
||||
var desc,
|
||||
initializer,
|
||||
value,
|
||||
newValue,
|
||||
get,
|
||||
set,
|
||||
decs = decInfo[0];
|
||||
if (isPrivate ? desc = 0 === kind || 1 === kind ? {
|
||||
get: decInfo[3],
|
||||
set: decInfo[4]
|
||||
} : 3 === kind ? {
|
||||
get: decInfo[3]
|
||||
} : 4 === kind ? {
|
||||
set: decInfo[3]
|
||||
} : {
|
||||
value: decInfo[3]
|
||||
} : 0 !== kind && (desc = Object.getOwnPropertyDescriptor(base, name)), 1 === kind ? value = {
|
||||
get: desc.get,
|
||||
set: desc.set
|
||||
} : 2 === kind ? value = desc.value : 3 === kind ? value = desc.get : 4 === kind && (value = desc.set), "function" == typeof decs) void 0 !== (newValue = old_memberDec(decs, name, desc, metadataMap, initializers, kind, isStatic, isPrivate, value)) && (old_assertValidReturnValue(kind, newValue), 0 === kind ? initializer = newValue : 1 === kind ? (initializer = old_getInit(newValue), get = newValue.get || value.get, set = newValue.set || value.set, value = {
|
||||
get: get,
|
||||
set: set
|
||||
}) : value = newValue);else for (var i = decs.length - 1; i >= 0; i--) {
|
||||
var newInit;
|
||||
if (void 0 !== (newValue = old_memberDec(decs[i], name, desc, metadataMap, initializers, kind, isStatic, isPrivate, value))) old_assertValidReturnValue(kind, newValue), 0 === kind ? newInit = newValue : 1 === kind ? (newInit = old_getInit(newValue), get = newValue.get || value.get, set = newValue.set || value.set, value = {
|
||||
get: get,
|
||||
set: set
|
||||
}) : value = newValue, void 0 !== newInit && (void 0 === initializer ? initializer = newInit : "function" == typeof initializer ? initializer = [initializer, newInit] : initializer.push(newInit));
|
||||
}
|
||||
if (0 === kind || 1 === kind) {
|
||||
if (void 0 === initializer) initializer = function initializer(instance, init) {
|
||||
return init;
|
||||
};else if ("function" != typeof initializer) {
|
||||
var ownInitializers = initializer;
|
||||
initializer = function initializer(instance, init) {
|
||||
for (var value = init, i = 0; i < ownInitializers.length; i++) value = ownInitializers[i].call(instance, value);
|
||||
return value;
|
||||
};
|
||||
} else {
|
||||
var originalInitializer = initializer;
|
||||
initializer = function initializer(instance, init) {
|
||||
return originalInitializer.call(instance, init);
|
||||
};
|
||||
}
|
||||
ret.push(initializer);
|
||||
}
|
||||
0 !== kind && (1 === kind ? (desc.get = value.get, desc.set = value.set) : 2 === kind ? desc.value = value : 3 === kind ? desc.get = value : 4 === kind && (desc.set = value), isPrivate ? 1 === kind ? (ret.push(function (instance, args) {
|
||||
return value.get.call(instance, args);
|
||||
}), ret.push(function (instance, args) {
|
||||
return value.set.call(instance, args);
|
||||
})) : 2 === kind ? ret.push(value) : ret.push(function (instance, args) {
|
||||
return value.call(instance, args);
|
||||
}) : Object.defineProperty(base, name, desc));
|
||||
}
|
||||
function old_applyMemberDecs(ret, Class, protoMetadataMap, staticMetadataMap, decInfos) {
|
||||
for (var protoInitializers, staticInitializers, existingProtoNonFields = new Map(), existingStaticNonFields = new Map(), i = 0; i < decInfos.length; i++) {
|
||||
var decInfo = decInfos[i];
|
||||
if (Array.isArray(decInfo)) {
|
||||
var base,
|
||||
metadataMap,
|
||||
initializers,
|
||||
kind = decInfo[1],
|
||||
name = decInfo[2],
|
||||
isPrivate = decInfo.length > 3,
|
||||
isStatic = kind >= 5;
|
||||
if (isStatic ? (base = Class, metadataMap = staticMetadataMap, 0 !== (kind -= 5) && (initializers = staticInitializers = staticInitializers || [])) : (base = Class.prototype, metadataMap = protoMetadataMap, 0 !== kind && (initializers = protoInitializers = protoInitializers || [])), 0 !== kind && !isPrivate) {
|
||||
var existingNonFields = isStatic ? existingStaticNonFields : existingProtoNonFields,
|
||||
existingKind = existingNonFields.get(name) || 0;
|
||||
if (!0 === existingKind || 3 === existingKind && 4 !== kind || 4 === existingKind && 3 !== kind) throw new Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + name);
|
||||
!existingKind && kind > 2 ? existingNonFields.set(name, kind) : existingNonFields.set(name, !0);
|
||||
}
|
||||
old_applyMemberDec(ret, base, decInfo, name, kind, isStatic, isPrivate, metadataMap, initializers);
|
||||
}
|
||||
}
|
||||
old_pushInitializers(ret, protoInitializers), old_pushInitializers(ret, staticInitializers);
|
||||
}
|
||||
function old_pushInitializers(ret, initializers) {
|
||||
initializers && ret.push(function (instance) {
|
||||
for (var i = 0; i < initializers.length; i++) initializers[i].call(instance);
|
||||
return instance;
|
||||
});
|
||||
}
|
||||
function old_applyClassDecs(ret, targetClass, metadataMap, classDecs) {
|
||||
if (classDecs.length > 0) {
|
||||
for (var initializers = [], newClass = targetClass, name = targetClass.name, i = classDecs.length - 1; i >= 0; i--) {
|
||||
var decoratorFinishedRef = {
|
||||
v: !1
|
||||
};
|
||||
try {
|
||||
var ctx = Object.assign({
|
||||
kind: "class",
|
||||
name: name,
|
||||
addInitializer: old_createAddInitializerMethod(initializers, decoratorFinishedRef)
|
||||
}, old_createMetadataMethodsForProperty(metadataMap, 0, name, decoratorFinishedRef)),
|
||||
nextNewClass = classDecs[i](newClass, ctx);
|
||||
} finally {
|
||||
decoratorFinishedRef.v = !0;
|
||||
}
|
||||
void 0 !== nextNewClass && (old_assertValidReturnValue(10, nextNewClass), newClass = nextNewClass);
|
||||
}
|
||||
ret.push(newClass, function () {
|
||||
for (var i = 0; i < initializers.length; i++) initializers[i].call(newClass);
|
||||
});
|
||||
}
|
||||
}
|
||||
function applyDecs(targetClass, memberDecs, classDecs) {
|
||||
var ret = [],
|
||||
staticMetadataMap = {},
|
||||
protoMetadataMap = {};
|
||||
return old_applyMemberDecs(ret, targetClass, protoMetadataMap, staticMetadataMap, memberDecs), old_convertMetadataMapToFinal(targetClass.prototype, protoMetadataMap), old_applyClassDecs(ret, targetClass, staticMetadataMap, classDecs), old_convertMetadataMapToFinal(targetClass, staticMetadataMap), ret;
|
||||
}
|
||||
module.exports = applyDecs, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
@ -1,187 +0,0 @@
|
|||
var _typeof = require("./typeof.js")["default"];
|
||||
function applyDecs2203Factory() {
|
||||
function createAddInitializerMethod(initializers, decoratorFinishedRef) {
|
||||
return function (initializer) {
|
||||
!function (decoratorFinishedRef, fnName) {
|
||||
if (decoratorFinishedRef.v) throw new Error("attempted to call " + fnName + " after decoration was finished");
|
||||
}(decoratorFinishedRef, "addInitializer"), assertCallable(initializer, "An initializer"), initializers.push(initializer);
|
||||
};
|
||||
}
|
||||
function memberDec(dec, name, desc, initializers, kind, isStatic, isPrivate, value) {
|
||||
var kindStr;
|
||||
switch (kind) {
|
||||
case 1:
|
||||
kindStr = "accessor";
|
||||
break;
|
||||
case 2:
|
||||
kindStr = "method";
|
||||
break;
|
||||
case 3:
|
||||
kindStr = "getter";
|
||||
break;
|
||||
case 4:
|
||||
kindStr = "setter";
|
||||
break;
|
||||
default:
|
||||
kindStr = "field";
|
||||
}
|
||||
var get,
|
||||
set,
|
||||
ctx = {
|
||||
kind: kindStr,
|
||||
name: isPrivate ? "#" + name : name,
|
||||
"static": isStatic,
|
||||
"private": isPrivate
|
||||
},
|
||||
decoratorFinishedRef = {
|
||||
v: !1
|
||||
};
|
||||
0 !== kind && (ctx.addInitializer = createAddInitializerMethod(initializers, decoratorFinishedRef)), 0 === kind ? isPrivate ? (get = desc.get, set = desc.set) : (get = function get() {
|
||||
return this[name];
|
||||
}, set = function set(v) {
|
||||
this[name] = v;
|
||||
}) : 2 === kind ? get = function get() {
|
||||
return desc.value;
|
||||
} : (1 !== kind && 3 !== kind || (get = function get() {
|
||||
return desc.get.call(this);
|
||||
}), 1 !== kind && 4 !== kind || (set = function set(v) {
|
||||
desc.set.call(this, v);
|
||||
})), ctx.access = get && set ? {
|
||||
get: get,
|
||||
set: set
|
||||
} : get ? {
|
||||
get: get
|
||||
} : {
|
||||
set: set
|
||||
};
|
||||
try {
|
||||
return dec(value, ctx);
|
||||
} finally {
|
||||
decoratorFinishedRef.v = !0;
|
||||
}
|
||||
}
|
||||
function assertCallable(fn, hint) {
|
||||
if ("function" != typeof fn) throw new TypeError(hint + " must be a function");
|
||||
}
|
||||
function assertValidReturnValue(kind, value) {
|
||||
var type = _typeof(value);
|
||||
if (1 === kind) {
|
||||
if ("object" !== type || null === value) throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0");
|
||||
void 0 !== value.get && assertCallable(value.get, "accessor.get"), void 0 !== value.set && assertCallable(value.set, "accessor.set"), void 0 !== value.init && assertCallable(value.init, "accessor.init");
|
||||
} else if ("function" !== type) {
|
||||
var hint;
|
||||
throw hint = 0 === kind ? "field" : 10 === kind ? "class" : "method", new TypeError(hint + " decorators must return a function or void 0");
|
||||
}
|
||||
}
|
||||
function applyMemberDec(ret, base, decInfo, name, kind, isStatic, isPrivate, initializers) {
|
||||
var desc,
|
||||
init,
|
||||
value,
|
||||
newValue,
|
||||
get,
|
||||
set,
|
||||
decs = decInfo[0];
|
||||
if (isPrivate ? desc = 0 === kind || 1 === kind ? {
|
||||
get: decInfo[3],
|
||||
set: decInfo[4]
|
||||
} : 3 === kind ? {
|
||||
get: decInfo[3]
|
||||
} : 4 === kind ? {
|
||||
set: decInfo[3]
|
||||
} : {
|
||||
value: decInfo[3]
|
||||
} : 0 !== kind && (desc = Object.getOwnPropertyDescriptor(base, name)), 1 === kind ? value = {
|
||||
get: desc.get,
|
||||
set: desc.set
|
||||
} : 2 === kind ? value = desc.value : 3 === kind ? value = desc.get : 4 === kind && (value = desc.set), "function" == typeof decs) void 0 !== (newValue = memberDec(decs, name, desc, initializers, kind, isStatic, isPrivate, value)) && (assertValidReturnValue(kind, newValue), 0 === kind ? init = newValue : 1 === kind ? (init = newValue.init, get = newValue.get || value.get, set = newValue.set || value.set, value = {
|
||||
get: get,
|
||||
set: set
|
||||
}) : value = newValue);else for (var i = decs.length - 1; i >= 0; i--) {
|
||||
var newInit;
|
||||
if (void 0 !== (newValue = memberDec(decs[i], name, desc, initializers, kind, isStatic, isPrivate, value))) assertValidReturnValue(kind, newValue), 0 === kind ? newInit = newValue : 1 === kind ? (newInit = newValue.init, get = newValue.get || value.get, set = newValue.set || value.set, value = {
|
||||
get: get,
|
||||
set: set
|
||||
}) : value = newValue, void 0 !== newInit && (void 0 === init ? init = newInit : "function" == typeof init ? init = [init, newInit] : init.push(newInit));
|
||||
}
|
||||
if (0 === kind || 1 === kind) {
|
||||
if (void 0 === init) init = function init(instance, _init) {
|
||||
return _init;
|
||||
};else if ("function" != typeof init) {
|
||||
var ownInitializers = init;
|
||||
init = function init(instance, _init2) {
|
||||
for (var value = _init2, i = 0; i < ownInitializers.length; i++) value = ownInitializers[i].call(instance, value);
|
||||
return value;
|
||||
};
|
||||
} else {
|
||||
var originalInitializer = init;
|
||||
init = function init(instance, _init3) {
|
||||
return originalInitializer.call(instance, _init3);
|
||||
};
|
||||
}
|
||||
ret.push(init);
|
||||
}
|
||||
0 !== kind && (1 === kind ? (desc.get = value.get, desc.set = value.set) : 2 === kind ? desc.value = value : 3 === kind ? desc.get = value : 4 === kind && (desc.set = value), isPrivate ? 1 === kind ? (ret.push(function (instance, args) {
|
||||
return value.get.call(instance, args);
|
||||
}), ret.push(function (instance, args) {
|
||||
return value.set.call(instance, args);
|
||||
})) : 2 === kind ? ret.push(value) : ret.push(function (instance, args) {
|
||||
return value.call(instance, args);
|
||||
}) : Object.defineProperty(base, name, desc));
|
||||
}
|
||||
function pushInitializers(ret, initializers) {
|
||||
initializers && ret.push(function (instance) {
|
||||
for (var i = 0; i < initializers.length; i++) initializers[i].call(instance);
|
||||
return instance;
|
||||
});
|
||||
}
|
||||
return function (targetClass, memberDecs, classDecs) {
|
||||
var ret = [];
|
||||
return function (ret, Class, decInfos) {
|
||||
for (var protoInitializers, staticInitializers, existingProtoNonFields = new Map(), existingStaticNonFields = new Map(), i = 0; i < decInfos.length; i++) {
|
||||
var decInfo = decInfos[i];
|
||||
if (Array.isArray(decInfo)) {
|
||||
var base,
|
||||
initializers,
|
||||
kind = decInfo[1],
|
||||
name = decInfo[2],
|
||||
isPrivate = decInfo.length > 3,
|
||||
isStatic = kind >= 5;
|
||||
if (isStatic ? (base = Class, 0 != (kind -= 5) && (initializers = staticInitializers = staticInitializers || [])) : (base = Class.prototype, 0 !== kind && (initializers = protoInitializers = protoInitializers || [])), 0 !== kind && !isPrivate) {
|
||||
var existingNonFields = isStatic ? existingStaticNonFields : existingProtoNonFields,
|
||||
existingKind = existingNonFields.get(name) || 0;
|
||||
if (!0 === existingKind || 3 === existingKind && 4 !== kind || 4 === existingKind && 3 !== kind) throw new Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + name);
|
||||
!existingKind && kind > 2 ? existingNonFields.set(name, kind) : existingNonFields.set(name, !0);
|
||||
}
|
||||
applyMemberDec(ret, base, decInfo, name, kind, isStatic, isPrivate, initializers);
|
||||
}
|
||||
}
|
||||
pushInitializers(ret, protoInitializers), pushInitializers(ret, staticInitializers);
|
||||
}(ret, targetClass, memberDecs), function (ret, targetClass, classDecs) {
|
||||
if (classDecs.length > 0) {
|
||||
for (var initializers = [], newClass = targetClass, name = targetClass.name, i = classDecs.length - 1; i >= 0; i--) {
|
||||
var decoratorFinishedRef = {
|
||||
v: !1
|
||||
};
|
||||
try {
|
||||
var nextNewClass = classDecs[i](newClass, {
|
||||
kind: "class",
|
||||
name: name,
|
||||
addInitializer: createAddInitializerMethod(initializers, decoratorFinishedRef)
|
||||
});
|
||||
} finally {
|
||||
decoratorFinishedRef.v = !0;
|
||||
}
|
||||
void 0 !== nextNewClass && (assertValidReturnValue(10, nextNewClass), newClass = nextNewClass);
|
||||
}
|
||||
ret.push(newClass, function () {
|
||||
for (var i = 0; i < initializers.length; i++) initializers[i].call(newClass);
|
||||
});
|
||||
}
|
||||
}(ret, targetClass, classDecs), ret;
|
||||
};
|
||||
}
|
||||
var applyDecs2203Impl;
|
||||
function applyDecs2203(targetClass, memberDecs, classDecs) {
|
||||
return (applyDecs2203Impl = applyDecs2203Impl || applyDecs2203Factory())(targetClass, memberDecs, classDecs);
|
||||
}
|
||||
module.exports = applyDecs2203, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
@ -1,191 +0,0 @@
|
|||
var _typeof = require("./typeof.js")["default"];
|
||||
function applyDecs2203RFactory() {
|
||||
function createAddInitializerMethod(initializers, decoratorFinishedRef) {
|
||||
return function (initializer) {
|
||||
!function (decoratorFinishedRef, fnName) {
|
||||
if (decoratorFinishedRef.v) throw new Error("attempted to call " + fnName + " after decoration was finished");
|
||||
}(decoratorFinishedRef, "addInitializer"), assertCallable(initializer, "An initializer"), initializers.push(initializer);
|
||||
};
|
||||
}
|
||||
function memberDec(dec, name, desc, initializers, kind, isStatic, isPrivate, value) {
|
||||
var kindStr;
|
||||
switch (kind) {
|
||||
case 1:
|
||||
kindStr = "accessor";
|
||||
break;
|
||||
case 2:
|
||||
kindStr = "method";
|
||||
break;
|
||||
case 3:
|
||||
kindStr = "getter";
|
||||
break;
|
||||
case 4:
|
||||
kindStr = "setter";
|
||||
break;
|
||||
default:
|
||||
kindStr = "field";
|
||||
}
|
||||
var get,
|
||||
set,
|
||||
ctx = {
|
||||
kind: kindStr,
|
||||
name: isPrivate ? "#" + name : name,
|
||||
"static": isStatic,
|
||||
"private": isPrivate
|
||||
},
|
||||
decoratorFinishedRef = {
|
||||
v: !1
|
||||
};
|
||||
0 !== kind && (ctx.addInitializer = createAddInitializerMethod(initializers, decoratorFinishedRef)), 0 === kind ? isPrivate ? (get = desc.get, set = desc.set) : (get = function get() {
|
||||
return this[name];
|
||||
}, set = function set(v) {
|
||||
this[name] = v;
|
||||
}) : 2 === kind ? get = function get() {
|
||||
return desc.value;
|
||||
} : (1 !== kind && 3 !== kind || (get = function get() {
|
||||
return desc.get.call(this);
|
||||
}), 1 !== kind && 4 !== kind || (set = function set(v) {
|
||||
desc.set.call(this, v);
|
||||
})), ctx.access = get && set ? {
|
||||
get: get,
|
||||
set: set
|
||||
} : get ? {
|
||||
get: get
|
||||
} : {
|
||||
set: set
|
||||
};
|
||||
try {
|
||||
return dec(value, ctx);
|
||||
} finally {
|
||||
decoratorFinishedRef.v = !0;
|
||||
}
|
||||
}
|
||||
function assertCallable(fn, hint) {
|
||||
if ("function" != typeof fn) throw new TypeError(hint + " must be a function");
|
||||
}
|
||||
function assertValidReturnValue(kind, value) {
|
||||
var type = _typeof(value);
|
||||
if (1 === kind) {
|
||||
if ("object" !== type || null === value) throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0");
|
||||
void 0 !== value.get && assertCallable(value.get, "accessor.get"), void 0 !== value.set && assertCallable(value.set, "accessor.set"), void 0 !== value.init && assertCallable(value.init, "accessor.init");
|
||||
} else if ("function" !== type) {
|
||||
var hint;
|
||||
throw hint = 0 === kind ? "field" : 10 === kind ? "class" : "method", new TypeError(hint + " decorators must return a function or void 0");
|
||||
}
|
||||
}
|
||||
function applyMemberDec(ret, base, decInfo, name, kind, isStatic, isPrivate, initializers) {
|
||||
var desc,
|
||||
init,
|
||||
value,
|
||||
newValue,
|
||||
get,
|
||||
set,
|
||||
decs = decInfo[0];
|
||||
if (isPrivate ? desc = 0 === kind || 1 === kind ? {
|
||||
get: decInfo[3],
|
||||
set: decInfo[4]
|
||||
} : 3 === kind ? {
|
||||
get: decInfo[3]
|
||||
} : 4 === kind ? {
|
||||
set: decInfo[3]
|
||||
} : {
|
||||
value: decInfo[3]
|
||||
} : 0 !== kind && (desc = Object.getOwnPropertyDescriptor(base, name)), 1 === kind ? value = {
|
||||
get: desc.get,
|
||||
set: desc.set
|
||||
} : 2 === kind ? value = desc.value : 3 === kind ? value = desc.get : 4 === kind && (value = desc.set), "function" == typeof decs) void 0 !== (newValue = memberDec(decs, name, desc, initializers, kind, isStatic, isPrivate, value)) && (assertValidReturnValue(kind, newValue), 0 === kind ? init = newValue : 1 === kind ? (init = newValue.init, get = newValue.get || value.get, set = newValue.set || value.set, value = {
|
||||
get: get,
|
||||
set: set
|
||||
}) : value = newValue);else for (var i = decs.length - 1; i >= 0; i--) {
|
||||
var newInit;
|
||||
if (void 0 !== (newValue = memberDec(decs[i], name, desc, initializers, kind, isStatic, isPrivate, value))) assertValidReturnValue(kind, newValue), 0 === kind ? newInit = newValue : 1 === kind ? (newInit = newValue.init, get = newValue.get || value.get, set = newValue.set || value.set, value = {
|
||||
get: get,
|
||||
set: set
|
||||
}) : value = newValue, void 0 !== newInit && (void 0 === init ? init = newInit : "function" == typeof init ? init = [init, newInit] : init.push(newInit));
|
||||
}
|
||||
if (0 === kind || 1 === kind) {
|
||||
if (void 0 === init) init = function init(instance, _init) {
|
||||
return _init;
|
||||
};else if ("function" != typeof init) {
|
||||
var ownInitializers = init;
|
||||
init = function init(instance, _init2) {
|
||||
for (var value = _init2, i = 0; i < ownInitializers.length; i++) value = ownInitializers[i].call(instance, value);
|
||||
return value;
|
||||
};
|
||||
} else {
|
||||
var originalInitializer = init;
|
||||
init = function init(instance, _init3) {
|
||||
return originalInitializer.call(instance, _init3);
|
||||
};
|
||||
}
|
||||
ret.push(init);
|
||||
}
|
||||
0 !== kind && (1 === kind ? (desc.get = value.get, desc.set = value.set) : 2 === kind ? desc.value = value : 3 === kind ? desc.get = value : 4 === kind && (desc.set = value), isPrivate ? 1 === kind ? (ret.push(function (instance, args) {
|
||||
return value.get.call(instance, args);
|
||||
}), ret.push(function (instance, args) {
|
||||
return value.set.call(instance, args);
|
||||
})) : 2 === kind ? ret.push(value) : ret.push(function (instance, args) {
|
||||
return value.call(instance, args);
|
||||
}) : Object.defineProperty(base, name, desc));
|
||||
}
|
||||
function applyMemberDecs(Class, decInfos) {
|
||||
for (var protoInitializers, staticInitializers, ret = [], existingProtoNonFields = new Map(), existingStaticNonFields = new Map(), i = 0; i < decInfos.length; i++) {
|
||||
var decInfo = decInfos[i];
|
||||
if (Array.isArray(decInfo)) {
|
||||
var base,
|
||||
initializers,
|
||||
kind = decInfo[1],
|
||||
name = decInfo[2],
|
||||
isPrivate = decInfo.length > 3,
|
||||
isStatic = kind >= 5;
|
||||
if (isStatic ? (base = Class, 0 !== (kind -= 5) && (initializers = staticInitializers = staticInitializers || [])) : (base = Class.prototype, 0 !== kind && (initializers = protoInitializers = protoInitializers || [])), 0 !== kind && !isPrivate) {
|
||||
var existingNonFields = isStatic ? existingStaticNonFields : existingProtoNonFields,
|
||||
existingKind = existingNonFields.get(name) || 0;
|
||||
if (!0 === existingKind || 3 === existingKind && 4 !== kind || 4 === existingKind && 3 !== kind) throw new Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + name);
|
||||
!existingKind && kind > 2 ? existingNonFields.set(name, kind) : existingNonFields.set(name, !0);
|
||||
}
|
||||
applyMemberDec(ret, base, decInfo, name, kind, isStatic, isPrivate, initializers);
|
||||
}
|
||||
}
|
||||
return pushInitializers(ret, protoInitializers), pushInitializers(ret, staticInitializers), ret;
|
||||
}
|
||||
function pushInitializers(ret, initializers) {
|
||||
initializers && ret.push(function (instance) {
|
||||
for (var i = 0; i < initializers.length; i++) initializers[i].call(instance);
|
||||
return instance;
|
||||
});
|
||||
}
|
||||
return function (targetClass, memberDecs, classDecs) {
|
||||
return {
|
||||
e: applyMemberDecs(targetClass, memberDecs),
|
||||
get c() {
|
||||
return function (targetClass, classDecs) {
|
||||
if (classDecs.length > 0) {
|
||||
for (var initializers = [], newClass = targetClass, name = targetClass.name, i = classDecs.length - 1; i >= 0; i--) {
|
||||
var decoratorFinishedRef = {
|
||||
v: !1
|
||||
};
|
||||
try {
|
||||
var nextNewClass = classDecs[i](newClass, {
|
||||
kind: "class",
|
||||
name: name,
|
||||
addInitializer: createAddInitializerMethod(initializers, decoratorFinishedRef)
|
||||
});
|
||||
} finally {
|
||||
decoratorFinishedRef.v = !0;
|
||||
}
|
||||
void 0 !== nextNewClass && (assertValidReturnValue(10, nextNewClass), newClass = nextNewClass);
|
||||
}
|
||||
return [newClass, function () {
|
||||
for (var i = 0; i < initializers.length; i++) initializers[i].call(newClass);
|
||||
}];
|
||||
}
|
||||
}(targetClass, classDecs);
|
||||
}
|
||||
};
|
||||
};
|
||||
}
|
||||
function applyDecs2203R(targetClass, memberDecs, classDecs) {
|
||||
return (module.exports = applyDecs2203R = applyDecs2203RFactory(), module.exports.__esModule = true, module.exports["default"] = module.exports)(targetClass, memberDecs, classDecs);
|
||||
}
|
||||
module.exports = applyDecs2203R, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
@ -1,222 +0,0 @@
|
|||
var _typeof = require("./typeof.js")["default"];
|
||||
var checkInRHS = require("./checkInRHS.js");
|
||||
function applyDecs2301Factory() {
|
||||
function createAddInitializerMethod(initializers, decoratorFinishedRef) {
|
||||
return function (initializer) {
|
||||
!function (decoratorFinishedRef, fnName) {
|
||||
if (decoratorFinishedRef.v) throw new Error("attempted to call " + fnName + " after decoration was finished");
|
||||
}(decoratorFinishedRef, "addInitializer"), assertCallable(initializer, "An initializer"), initializers.push(initializer);
|
||||
};
|
||||
}
|
||||
function assertInstanceIfPrivate(has, target) {
|
||||
if (!has(target)) throw new TypeError("Attempted to access private element on non-instance");
|
||||
}
|
||||
function memberDec(dec, name, desc, initializers, kind, isStatic, isPrivate, value, hasPrivateBrand) {
|
||||
var kindStr;
|
||||
switch (kind) {
|
||||
case 1:
|
||||
kindStr = "accessor";
|
||||
break;
|
||||
case 2:
|
||||
kindStr = "method";
|
||||
break;
|
||||
case 3:
|
||||
kindStr = "getter";
|
||||
break;
|
||||
case 4:
|
||||
kindStr = "setter";
|
||||
break;
|
||||
default:
|
||||
kindStr = "field";
|
||||
}
|
||||
var get,
|
||||
set,
|
||||
ctx = {
|
||||
kind: kindStr,
|
||||
name: isPrivate ? "#" + name : name,
|
||||
"static": isStatic,
|
||||
"private": isPrivate
|
||||
},
|
||||
decoratorFinishedRef = {
|
||||
v: !1
|
||||
};
|
||||
if (0 !== kind && (ctx.addInitializer = createAddInitializerMethod(initializers, decoratorFinishedRef)), isPrivate || 0 !== kind && 2 !== kind) {
|
||||
if (2 === kind) get = function get(target) {
|
||||
return assertInstanceIfPrivate(hasPrivateBrand, target), desc.value;
|
||||
};else {
|
||||
var t = 0 === kind || 1 === kind;
|
||||
(t || 3 === kind) && (get = isPrivate ? function (target) {
|
||||
return assertInstanceIfPrivate(hasPrivateBrand, target), desc.get.call(target);
|
||||
} : function (target) {
|
||||
return desc.get.call(target);
|
||||
}), (t || 4 === kind) && (set = isPrivate ? function (target, value) {
|
||||
assertInstanceIfPrivate(hasPrivateBrand, target), desc.set.call(target, value);
|
||||
} : function (target, value) {
|
||||
desc.set.call(target, value);
|
||||
});
|
||||
}
|
||||
} else get = function get(target) {
|
||||
return target[name];
|
||||
}, 0 === kind && (set = function set(target, v) {
|
||||
target[name] = v;
|
||||
});
|
||||
var has = isPrivate ? hasPrivateBrand.bind() : function (target) {
|
||||
return name in target;
|
||||
};
|
||||
ctx.access = get && set ? {
|
||||
get: get,
|
||||
set: set,
|
||||
has: has
|
||||
} : get ? {
|
||||
get: get,
|
||||
has: has
|
||||
} : {
|
||||
set: set,
|
||||
has: has
|
||||
};
|
||||
try {
|
||||
return dec(value, ctx);
|
||||
} finally {
|
||||
decoratorFinishedRef.v = !0;
|
||||
}
|
||||
}
|
||||
function assertCallable(fn, hint) {
|
||||
if ("function" != typeof fn) throw new TypeError(hint + " must be a function");
|
||||
}
|
||||
function assertValidReturnValue(kind, value) {
|
||||
var type = _typeof(value);
|
||||
if (1 === kind) {
|
||||
if ("object" !== type || null === value) throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0");
|
||||
void 0 !== value.get && assertCallable(value.get, "accessor.get"), void 0 !== value.set && assertCallable(value.set, "accessor.set"), void 0 !== value.init && assertCallable(value.init, "accessor.init");
|
||||
} else if ("function" !== type) {
|
||||
var hint;
|
||||
throw hint = 0 === kind ? "field" : 10 === kind ? "class" : "method", new TypeError(hint + " decorators must return a function or void 0");
|
||||
}
|
||||
}
|
||||
function curryThis2(fn) {
|
||||
return function (value) {
|
||||
fn(this, value);
|
||||
};
|
||||
}
|
||||
function applyMemberDec(ret, base, decInfo, name, kind, isStatic, isPrivate, initializers, hasPrivateBrand) {
|
||||
var desc,
|
||||
init,
|
||||
value,
|
||||
fn,
|
||||
newValue,
|
||||
get,
|
||||
set,
|
||||
decs = decInfo[0];
|
||||
if (isPrivate ? desc = 0 === kind || 1 === kind ? {
|
||||
get: (fn = decInfo[3], function () {
|
||||
return fn(this);
|
||||
}),
|
||||
set: curryThis2(decInfo[4])
|
||||
} : 3 === kind ? {
|
||||
get: decInfo[3]
|
||||
} : 4 === kind ? {
|
||||
set: decInfo[3]
|
||||
} : {
|
||||
value: decInfo[3]
|
||||
} : 0 !== kind && (desc = Object.getOwnPropertyDescriptor(base, name)), 1 === kind ? value = {
|
||||
get: desc.get,
|
||||
set: desc.set
|
||||
} : 2 === kind ? value = desc.value : 3 === kind ? value = desc.get : 4 === kind && (value = desc.set), "function" == typeof decs) void 0 !== (newValue = memberDec(decs, name, desc, initializers, kind, isStatic, isPrivate, value, hasPrivateBrand)) && (assertValidReturnValue(kind, newValue), 0 === kind ? init = newValue : 1 === kind ? (init = newValue.init, get = newValue.get || value.get, set = newValue.set || value.set, value = {
|
||||
get: get,
|
||||
set: set
|
||||
}) : value = newValue);else for (var i = decs.length - 1; i >= 0; i--) {
|
||||
var newInit;
|
||||
if (void 0 !== (newValue = memberDec(decs[i], name, desc, initializers, kind, isStatic, isPrivate, value, hasPrivateBrand))) assertValidReturnValue(kind, newValue), 0 === kind ? newInit = newValue : 1 === kind ? (newInit = newValue.init, get = newValue.get || value.get, set = newValue.set || value.set, value = {
|
||||
get: get,
|
||||
set: set
|
||||
}) : value = newValue, void 0 !== newInit && (void 0 === init ? init = newInit : "function" == typeof init ? init = [init, newInit] : init.push(newInit));
|
||||
}
|
||||
if (0 === kind || 1 === kind) {
|
||||
if (void 0 === init) init = function init(instance, _init) {
|
||||
return _init;
|
||||
};else if ("function" != typeof init) {
|
||||
var ownInitializers = init;
|
||||
init = function init(instance, _init2) {
|
||||
for (var value = _init2, i = 0; i < ownInitializers.length; i++) value = ownInitializers[i].call(instance, value);
|
||||
return value;
|
||||
};
|
||||
} else {
|
||||
var originalInitializer = init;
|
||||
init = function init(instance, _init3) {
|
||||
return originalInitializer.call(instance, _init3);
|
||||
};
|
||||
}
|
||||
ret.push(init);
|
||||
}
|
||||
0 !== kind && (1 === kind ? (desc.get = value.get, desc.set = value.set) : 2 === kind ? desc.value = value : 3 === kind ? desc.get = value : 4 === kind && (desc.set = value), isPrivate ? 1 === kind ? (ret.push(function (instance, args) {
|
||||
return value.get.call(instance, args);
|
||||
}), ret.push(function (instance, args) {
|
||||
return value.set.call(instance, args);
|
||||
})) : 2 === kind ? ret.push(value) : ret.push(function (instance, args) {
|
||||
return value.call(instance, args);
|
||||
}) : Object.defineProperty(base, name, desc));
|
||||
}
|
||||
function applyMemberDecs(Class, decInfos, instanceBrand) {
|
||||
for (var protoInitializers, staticInitializers, staticBrand, ret = [], existingProtoNonFields = new Map(), existingStaticNonFields = new Map(), i = 0; i < decInfos.length; i++) {
|
||||
var decInfo = decInfos[i];
|
||||
if (Array.isArray(decInfo)) {
|
||||
var base,
|
||||
initializers,
|
||||
kind = decInfo[1],
|
||||
name = decInfo[2],
|
||||
isPrivate = decInfo.length > 3,
|
||||
isStatic = kind >= 5,
|
||||
hasPrivateBrand = instanceBrand;
|
||||
if (isStatic ? (base = Class, 0 !== (kind -= 5) && (initializers = staticInitializers = staticInitializers || []), isPrivate && !staticBrand && (staticBrand = function staticBrand(_) {
|
||||
return checkInRHS(_) === Class;
|
||||
}), hasPrivateBrand = staticBrand) : (base = Class.prototype, 0 !== kind && (initializers = protoInitializers = protoInitializers || [])), 0 !== kind && !isPrivate) {
|
||||
var existingNonFields = isStatic ? existingStaticNonFields : existingProtoNonFields,
|
||||
existingKind = existingNonFields.get(name) || 0;
|
||||
if (!0 === existingKind || 3 === existingKind && 4 !== kind || 4 === existingKind && 3 !== kind) throw new Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + name);
|
||||
!existingKind && kind > 2 ? existingNonFields.set(name, kind) : existingNonFields.set(name, !0);
|
||||
}
|
||||
applyMemberDec(ret, base, decInfo, name, kind, isStatic, isPrivate, initializers, hasPrivateBrand);
|
||||
}
|
||||
}
|
||||
return pushInitializers(ret, protoInitializers), pushInitializers(ret, staticInitializers), ret;
|
||||
}
|
||||
function pushInitializers(ret, initializers) {
|
||||
initializers && ret.push(function (instance) {
|
||||
for (var i = 0; i < initializers.length; i++) initializers[i].call(instance);
|
||||
return instance;
|
||||
});
|
||||
}
|
||||
return function (targetClass, memberDecs, classDecs, instanceBrand) {
|
||||
return {
|
||||
e: applyMemberDecs(targetClass, memberDecs, instanceBrand),
|
||||
get c() {
|
||||
return function (targetClass, classDecs) {
|
||||
if (classDecs.length > 0) {
|
||||
for (var initializers = [], newClass = targetClass, name = targetClass.name, i = classDecs.length - 1; i >= 0; i--) {
|
||||
var decoratorFinishedRef = {
|
||||
v: !1
|
||||
};
|
||||
try {
|
||||
var nextNewClass = classDecs[i](newClass, {
|
||||
kind: "class",
|
||||
name: name,
|
||||
addInitializer: createAddInitializerMethod(initializers, decoratorFinishedRef)
|
||||
});
|
||||
} finally {
|
||||
decoratorFinishedRef.v = !0;
|
||||
}
|
||||
void 0 !== nextNewClass && (assertValidReturnValue(10, nextNewClass), newClass = nextNewClass);
|
||||
}
|
||||
return [newClass, function () {
|
||||
for (var i = 0; i < initializers.length; i++) initializers[i].call(newClass);
|
||||
}];
|
||||
}
|
||||
}(targetClass, classDecs);
|
||||
}
|
||||
};
|
||||
};
|
||||
}
|
||||
function applyDecs2301(targetClass, memberDecs, classDecs, instanceBrand) {
|
||||
return (module.exports = applyDecs2301 = applyDecs2301Factory(), module.exports.__esModule = true, module.exports["default"] = module.exports)(targetClass, memberDecs, classDecs, instanceBrand);
|
||||
}
|
||||
module.exports = applyDecs2301, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
@ -1,220 +0,0 @@
|
|||
var _typeof = require("./typeof.js")["default"];
|
||||
var checkInRHS = require("./checkInRHS.js");
|
||||
function createAddInitializerMethod(initializers, decoratorFinishedRef) {
|
||||
return function (initializer) {
|
||||
assertNotFinished(decoratorFinishedRef, "addInitializer"), assertCallable(initializer, "An initializer"), initializers.push(initializer);
|
||||
};
|
||||
}
|
||||
function assertInstanceIfPrivate(has, target) {
|
||||
if (!has(target)) throw new TypeError("Attempted to access private element on non-instance");
|
||||
}
|
||||
function memberDec(dec, thisArg, name, desc, initializers, kind, isStatic, isPrivate, value, hasPrivateBrand) {
|
||||
var kindStr;
|
||||
switch (kind) {
|
||||
case 1:
|
||||
kindStr = "accessor";
|
||||
break;
|
||||
case 2:
|
||||
kindStr = "method";
|
||||
break;
|
||||
case 3:
|
||||
kindStr = "getter";
|
||||
break;
|
||||
case 4:
|
||||
kindStr = "setter";
|
||||
break;
|
||||
default:
|
||||
kindStr = "field";
|
||||
}
|
||||
var get,
|
||||
set,
|
||||
ctx = {
|
||||
kind: kindStr,
|
||||
name: isPrivate ? "#" + name : name,
|
||||
"static": isStatic,
|
||||
"private": isPrivate
|
||||
},
|
||||
decoratorFinishedRef = {
|
||||
v: !1
|
||||
};
|
||||
if (0 !== kind && (ctx.addInitializer = createAddInitializerMethod(initializers, decoratorFinishedRef)), isPrivate || 0 !== kind && 2 !== kind) {
|
||||
if (2 === kind) get = function get(target) {
|
||||
return assertInstanceIfPrivate(hasPrivateBrand, target), desc.value;
|
||||
};else {
|
||||
var t = 0 === kind || 1 === kind;
|
||||
(t || 3 === kind) && (get = isPrivate ? function (target) {
|
||||
return assertInstanceIfPrivate(hasPrivateBrand, target), desc.get.call(target);
|
||||
} : function (target) {
|
||||
return desc.get.call(target);
|
||||
}), (t || 4 === kind) && (set = isPrivate ? function (target, value) {
|
||||
assertInstanceIfPrivate(hasPrivateBrand, target), desc.set.call(target, value);
|
||||
} : function (target, value) {
|
||||
desc.set.call(target, value);
|
||||
});
|
||||
}
|
||||
} else get = function get(target) {
|
||||
return target[name];
|
||||
}, 0 === kind && (set = function set(target, v) {
|
||||
target[name] = v;
|
||||
});
|
||||
var has = isPrivate ? hasPrivateBrand.bind() : function (target) {
|
||||
return name in target;
|
||||
};
|
||||
ctx.access = get && set ? {
|
||||
get: get,
|
||||
set: set,
|
||||
has: has
|
||||
} : get ? {
|
||||
get: get,
|
||||
has: has
|
||||
} : {
|
||||
set: set,
|
||||
has: has
|
||||
};
|
||||
try {
|
||||
return dec.call(thisArg, value, ctx);
|
||||
} finally {
|
||||
decoratorFinishedRef.v = !0;
|
||||
}
|
||||
}
|
||||
function assertNotFinished(decoratorFinishedRef, fnName) {
|
||||
if (decoratorFinishedRef.v) throw new Error("attempted to call " + fnName + " after decoration was finished");
|
||||
}
|
||||
function assertCallable(fn, hint) {
|
||||
if ("function" != typeof fn) throw new TypeError(hint + " must be a function");
|
||||
}
|
||||
function assertValidReturnValue(kind, value) {
|
||||
var type = _typeof(value);
|
||||
if (1 === kind) {
|
||||
if ("object" !== type || null === value) throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0");
|
||||
void 0 !== value.get && assertCallable(value.get, "accessor.get"), void 0 !== value.set && assertCallable(value.set, "accessor.set"), void 0 !== value.init && assertCallable(value.init, "accessor.init");
|
||||
} else if ("function" !== type) {
|
||||
var hint;
|
||||
throw hint = 0 === kind ? "field" : 5 === kind ? "class" : "method", new TypeError(hint + " decorators must return a function or void 0");
|
||||
}
|
||||
}
|
||||
function curryThis1(fn) {
|
||||
return function () {
|
||||
return fn(this);
|
||||
};
|
||||
}
|
||||
function curryThis2(fn) {
|
||||
return function (value) {
|
||||
fn(this, value);
|
||||
};
|
||||
}
|
||||
function applyMemberDec(ret, base, decInfo, decoratorsHaveThis, name, kind, isStatic, isPrivate, initializers, hasPrivateBrand) {
|
||||
var desc,
|
||||
init,
|
||||
value,
|
||||
newValue,
|
||||
get,
|
||||
set,
|
||||
decs = decInfo[0];
|
||||
decoratorsHaveThis || Array.isArray(decs) || (decs = [decs]), isPrivate ? desc = 0 === kind || 1 === kind ? {
|
||||
get: curryThis1(decInfo[3]),
|
||||
set: curryThis2(decInfo[4])
|
||||
} : 3 === kind ? {
|
||||
get: decInfo[3]
|
||||
} : 4 === kind ? {
|
||||
set: decInfo[3]
|
||||
} : {
|
||||
value: decInfo[3]
|
||||
} : 0 !== kind && (desc = Object.getOwnPropertyDescriptor(base, name)), 1 === kind ? value = {
|
||||
get: desc.get,
|
||||
set: desc.set
|
||||
} : 2 === kind ? value = desc.value : 3 === kind ? value = desc.get : 4 === kind && (value = desc.set);
|
||||
for (var inc = decoratorsHaveThis ? 2 : 1, i = decs.length - 1; i >= 0; i -= inc) {
|
||||
var newInit;
|
||||
if (void 0 !== (newValue = memberDec(decs[i], decoratorsHaveThis ? decs[i - 1] : void 0, name, desc, initializers, kind, isStatic, isPrivate, value, hasPrivateBrand))) assertValidReturnValue(kind, newValue), 0 === kind ? newInit = newValue : 1 === kind ? (newInit = newValue.init, get = newValue.get || value.get, set = newValue.set || value.set, value = {
|
||||
get: get,
|
||||
set: set
|
||||
}) : value = newValue, void 0 !== newInit && (void 0 === init ? init = newInit : "function" == typeof init ? init = [init, newInit] : init.push(newInit));
|
||||
}
|
||||
if (0 === kind || 1 === kind) {
|
||||
if (void 0 === init) init = function init(instance, _init) {
|
||||
return _init;
|
||||
};else if ("function" != typeof init) {
|
||||
var ownInitializers = init;
|
||||
init = function init(instance, _init2) {
|
||||
for (var value = _init2, i = ownInitializers.length - 1; i >= 0; i--) value = ownInitializers[i].call(instance, value);
|
||||
return value;
|
||||
};
|
||||
} else {
|
||||
var originalInitializer = init;
|
||||
init = function init(instance, _init3) {
|
||||
return originalInitializer.call(instance, _init3);
|
||||
};
|
||||
}
|
||||
ret.push(init);
|
||||
}
|
||||
0 !== kind && (1 === kind ? (desc.get = value.get, desc.set = value.set) : 2 === kind ? desc.value = value : 3 === kind ? desc.get = value : 4 === kind && (desc.set = value), isPrivate ? 1 === kind ? (ret.push(function (instance, args) {
|
||||
return value.get.call(instance, args);
|
||||
}), ret.push(function (instance, args) {
|
||||
return value.set.call(instance, args);
|
||||
})) : 2 === kind ? ret.push(value) : ret.push(function (instance, args) {
|
||||
return value.call(instance, args);
|
||||
}) : Object.defineProperty(base, name, desc));
|
||||
}
|
||||
function applyMemberDecs(Class, decInfos, instanceBrand) {
|
||||
for (var protoInitializers, staticInitializers, staticBrand, ret = [], existingProtoNonFields = new Map(), existingStaticNonFields = new Map(), i = 0; i < decInfos.length; i++) {
|
||||
var decInfo = decInfos[i];
|
||||
if (Array.isArray(decInfo)) {
|
||||
var base,
|
||||
initializers,
|
||||
kind = decInfo[1],
|
||||
name = decInfo[2],
|
||||
isPrivate = decInfo.length > 3,
|
||||
decoratorsHaveThis = 16 & kind,
|
||||
isStatic = !!(8 & kind),
|
||||
hasPrivateBrand = instanceBrand;
|
||||
if (kind &= 7, isStatic ? (base = Class, 0 !== kind && (initializers = staticInitializers = staticInitializers || []), isPrivate && !staticBrand && (staticBrand = function staticBrand(_) {
|
||||
return checkInRHS(_) === Class;
|
||||
}), hasPrivateBrand = staticBrand) : (base = Class.prototype, 0 !== kind && (initializers = protoInitializers = protoInitializers || [])), 0 !== kind && !isPrivate) {
|
||||
var existingNonFields = isStatic ? existingStaticNonFields : existingProtoNonFields,
|
||||
existingKind = existingNonFields.get(name) || 0;
|
||||
if (!0 === existingKind || 3 === existingKind && 4 !== kind || 4 === existingKind && 3 !== kind) throw new Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + name);
|
||||
existingNonFields.set(name, !(!existingKind && kind > 2) || kind);
|
||||
}
|
||||
applyMemberDec(ret, base, decInfo, decoratorsHaveThis, name, kind, isStatic, isPrivate, initializers, hasPrivateBrand);
|
||||
}
|
||||
}
|
||||
return pushInitializers(ret, protoInitializers), pushInitializers(ret, staticInitializers), ret;
|
||||
}
|
||||
function pushInitializers(ret, initializers) {
|
||||
initializers && ret.push(function (instance) {
|
||||
for (var i = 0; i < initializers.length; i++) initializers[i].call(instance);
|
||||
return instance;
|
||||
});
|
||||
}
|
||||
function applyClassDecs(targetClass, classDecs, decoratorsHaveThis) {
|
||||
if (classDecs.length) {
|
||||
for (var initializers = [], newClass = targetClass, name = targetClass.name, inc = decoratorsHaveThis ? 2 : 1, i = classDecs.length - 1; i >= 0; i -= inc) {
|
||||
var decoratorFinishedRef = {
|
||||
v: !1
|
||||
};
|
||||
try {
|
||||
var nextNewClass = classDecs[i].call(decoratorsHaveThis ? classDecs[i - 1] : void 0, newClass, {
|
||||
kind: "class",
|
||||
name: name,
|
||||
addInitializer: createAddInitializerMethod(initializers, decoratorFinishedRef)
|
||||
});
|
||||
} finally {
|
||||
decoratorFinishedRef.v = !0;
|
||||
}
|
||||
void 0 !== nextNewClass && (assertValidReturnValue(5, nextNewClass), newClass = nextNewClass);
|
||||
}
|
||||
return [newClass, function () {
|
||||
for (var i = 0; i < initializers.length; i++) initializers[i].call(newClass);
|
||||
}];
|
||||
}
|
||||
}
|
||||
function applyDecs2305(targetClass, memberDecs, classDecs, classDecsHaveThis, instanceBrand) {
|
||||
return {
|
||||
e: applyMemberDecs(targetClass, memberDecs, instanceBrand),
|
||||
get c() {
|
||||
return applyClassDecs(targetClass, classDecs, classDecsHaveThis);
|
||||
}
|
||||
};
|
||||
}
|
||||
module.exports = applyDecs2305, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
@ -1,6 +0,0 @@
|
|||
function _arrayLikeToArray(arr, len) {
|
||||
if (len == null || len > arr.length) len = arr.length;
|
||||
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
||||
return arr2;
|
||||
}
|
||||
module.exports = _arrayLikeToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
@ -1,4 +0,0 @@
|
|||
function _arrayWithHoles(arr) {
|
||||
if (Array.isArray(arr)) return arr;
|
||||
}
|
||||
module.exports = _arrayWithHoles, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
@ -1,5 +0,0 @@
|
|||
var arrayLikeToArray = require("./arrayLikeToArray.js");
|
||||
function _arrayWithoutHoles(arr) {
|
||||
if (Array.isArray(arr)) return arrayLikeToArray(arr);
|
||||
}
|
||||
module.exports = _arrayWithoutHoles, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
@ -1,7 +0,0 @@
|
|||
function _assertThisInitialized(self) {
|
||||
if (self === void 0) {
|
||||
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
||||
}
|
||||
return self;
|
||||
}
|
||||
module.exports = _assertThisInitialized, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
@ -1,24 +0,0 @@
|
|||
var OverloadYield = require("./OverloadYield.js");
|
||||
function _asyncGeneratorDelegate(inner) {
|
||||
var iter = {},
|
||||
waiting = !1;
|
||||
function pump(key, value) {
|
||||
return waiting = !0, value = new Promise(function (resolve) {
|
||||
resolve(inner[key](value));
|
||||
}), {
|
||||
done: !1,
|
||||
value: new OverloadYield(value, 1)
|
||||
};
|
||||
}
|
||||
return iter["undefined" != typeof Symbol && Symbol.iterator || "@@iterator"] = function () {
|
||||
return this;
|
||||
}, iter.next = function (value) {
|
||||
return waiting ? (waiting = !1, value) : pump("next", value);
|
||||
}, "function" == typeof inner["throw"] && (iter["throw"] = function (value) {
|
||||
if (waiting) throw waiting = !1, value;
|
||||
return pump("throw", value);
|
||||
}), "function" == typeof inner["return"] && (iter["return"] = function (value) {
|
||||
return waiting ? (waiting = !1, value) : pump("return", value);
|
||||
}), iter;
|
||||
}
|
||||
module.exports = _asyncGeneratorDelegate, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
@ -1,45 +0,0 @@
|
|||
function _asyncIterator(iterable) {
|
||||
var method,
|
||||
async,
|
||||
sync,
|
||||
retry = 2;
|
||||
for ("undefined" != typeof Symbol && (async = Symbol.asyncIterator, sync = Symbol.iterator); retry--;) {
|
||||
if (async && null != (method = iterable[async])) return method.call(iterable);
|
||||
if (sync && null != (method = iterable[sync])) return new AsyncFromSyncIterator(method.call(iterable));
|
||||
async = "@@asyncIterator", sync = "@@iterator";
|
||||
}
|
||||
throw new TypeError("Object is not async iterable");
|
||||
}
|
||||
function AsyncFromSyncIterator(s) {
|
||||
function AsyncFromSyncIteratorContinuation(r) {
|
||||
if (Object(r) !== r) return Promise.reject(new TypeError(r + " is not an object."));
|
||||
var done = r.done;
|
||||
return Promise.resolve(r.value).then(function (value) {
|
||||
return {
|
||||
value: value,
|
||||
done: done
|
||||
};
|
||||
});
|
||||
}
|
||||
return AsyncFromSyncIterator = function AsyncFromSyncIterator(s) {
|
||||
this.s = s, this.n = s.next;
|
||||
}, AsyncFromSyncIterator.prototype = {
|
||||
s: null,
|
||||
n: null,
|
||||
next: function next() {
|
||||
return AsyncFromSyncIteratorContinuation(this.n.apply(this.s, arguments));
|
||||
},
|
||||
"return": function _return(value) {
|
||||
var ret = this.s["return"];
|
||||
return void 0 === ret ? Promise.resolve({
|
||||
value: value,
|
||||
done: !0
|
||||
}) : AsyncFromSyncIteratorContinuation(ret.apply(this.s, arguments));
|
||||
},
|
||||
"throw": function _throw(value) {
|
||||
var thr = this.s["return"];
|
||||
return void 0 === thr ? Promise.reject(value) : AsyncFromSyncIteratorContinuation(thr.apply(this.s, arguments));
|
||||
}
|
||||
}, new AsyncFromSyncIterator(s);
|
||||
}
|
||||
module.exports = _asyncIterator, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
@ -1,31 +0,0 @@
|
|||
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
||||
try {
|
||||
var info = gen[key](arg);
|
||||
var value = info.value;
|
||||
} catch (error) {
|
||||
reject(error);
|
||||
return;
|
||||
}
|
||||
if (info.done) {
|
||||
resolve(value);
|
||||
} else {
|
||||
Promise.resolve(value).then(_next, _throw);
|
||||
}
|
||||
}
|
||||
function _asyncToGenerator(fn) {
|
||||
return function () {
|
||||
var self = this,
|
||||
args = arguments;
|
||||
return new Promise(function (resolve, reject) {
|
||||
var gen = fn.apply(self, args);
|
||||
function _next(value) {
|
||||
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
||||
}
|
||||
function _throw(err) {
|
||||
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
||||
}
|
||||
_next(undefined);
|
||||
});
|
||||
};
|
||||
}
|
||||
module.exports = _asyncToGenerator, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
@ -1,5 +0,0 @@
|
|||
var OverloadYield = require("./OverloadYield.js");
|
||||
function _awaitAsyncGenerator(value) {
|
||||
return new OverloadYield(value, 0);
|
||||
}
|
||||
module.exports = _awaitAsyncGenerator, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
@ -1,6 +0,0 @@
|
|||
var _typeof = require("./typeof.js")["default"];
|
||||
function _checkInRHS(value) {
|
||||
if (Object(value) !== value) throw TypeError("right-hand side of 'in' should be an object, got " + (null !== value ? _typeof(value) : "null"));
|
||||
return value;
|
||||
}
|
||||
module.exports = _checkInRHS, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
@ -1,6 +0,0 @@
|
|||
function _checkPrivateRedeclaration(obj, privateCollection) {
|
||||
if (privateCollection.has(obj)) {
|
||||
throw new TypeError("Cannot initialize the same private elements twice on an object");
|
||||
}
|
||||
}
|
||||
module.exports = _checkPrivateRedeclaration, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
18
微信机器人/node_modules/@babel/runtime/helpers/classApplyDescriptorDestructureSet.js
generated
vendored
18
微信机器人/node_modules/@babel/runtime/helpers/classApplyDescriptorDestructureSet.js
generated
vendored
|
@ -1,18 +0,0 @@
|
|||
function _classApplyDescriptorDestructureSet(receiver, descriptor) {
|
||||
if (descriptor.set) {
|
||||
if (!("__destrObj" in descriptor)) {
|
||||
descriptor.__destrObj = {
|
||||
set value(v) {
|
||||
descriptor.set.call(receiver, v);
|
||||
}
|
||||
};
|
||||
}
|
||||
return descriptor.__destrObj;
|
||||
} else {
|
||||
if (!descriptor.writable) {
|
||||
throw new TypeError("attempted to set read only private field");
|
||||
}
|
||||
return descriptor;
|
||||
}
|
||||
}
|
||||
module.exports = _classApplyDescriptorDestructureSet, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
@ -1,7 +0,0 @@
|
|||
function _classApplyDescriptorGet(receiver, descriptor) {
|
||||
if (descriptor.get) {
|
||||
return descriptor.get.call(receiver);
|
||||
}
|
||||
return descriptor.value;
|
||||
}
|
||||
module.exports = _classApplyDescriptorGet, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
@ -1,11 +0,0 @@
|
|||
function _classApplyDescriptorSet(receiver, descriptor, value) {
|
||||
if (descriptor.set) {
|
||||
descriptor.set.call(receiver, value);
|
||||
} else {
|
||||
if (!descriptor.writable) {
|
||||
throw new TypeError("attempted to set read only private field");
|
||||
}
|
||||
descriptor.value = value;
|
||||
}
|
||||
}
|
||||
module.exports = _classApplyDescriptorSet, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
@ -1,6 +0,0 @@
|
|||
function _classCallCheck(instance, Constructor) {
|
||||
if (!(instance instanceof Constructor)) {
|
||||
throw new TypeError("Cannot call a class as a function");
|
||||
}
|
||||
}
|
||||
module.exports = _classCallCheck, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
@ -1,6 +0,0 @@
|
|||
function _classCheckPrivateStaticAccess(receiver, classConstructor) {
|
||||
if (receiver !== classConstructor) {
|
||||
throw new TypeError("Private static access of wrong provenance");
|
||||
}
|
||||
}
|
||||
module.exports = _classCheckPrivateStaticAccess, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
6
微信机器人/node_modules/@babel/runtime/helpers/classCheckPrivateStaticFieldDescriptor.js
generated
vendored
6
微信机器人/node_modules/@babel/runtime/helpers/classCheckPrivateStaticFieldDescriptor.js
generated
vendored
|
@ -1,6 +0,0 @@
|
|||
function _classCheckPrivateStaticFieldDescriptor(descriptor, action) {
|
||||
if (descriptor === undefined) {
|
||||
throw new TypeError("attempted to " + action + " private static field before its declaration");
|
||||
}
|
||||
}
|
||||
module.exports = _classCheckPrivateStaticFieldDescriptor, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
@ -1,7 +0,0 @@
|
|||
function _classExtractFieldDescriptor(receiver, privateMap, action) {
|
||||
if (!privateMap.has(receiver)) {
|
||||
throw new TypeError("attempted to " + action + " private field on non-instance");
|
||||
}
|
||||
return privateMap.get(receiver);
|
||||
}
|
||||
module.exports = _classExtractFieldDescriptor, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
@ -1,4 +0,0 @@
|
|||
function _classNameTDZError(name) {
|
||||
throw new ReferenceError("Class \"" + name + "\" cannot be referenced in computed property keys.");
|
||||
}
|
||||
module.exports = _classNameTDZError, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
@ -1,7 +0,0 @@
|
|||
var classApplyDescriptorDestructureSet = require("./classApplyDescriptorDestructureSet.js");
|
||||
var classExtractFieldDescriptor = require("./classExtractFieldDescriptor.js");
|
||||
function _classPrivateFieldDestructureSet(receiver, privateMap) {
|
||||
var descriptor = classExtractFieldDescriptor(receiver, privateMap, "set");
|
||||
return classApplyDescriptorDestructureSet(receiver, descriptor);
|
||||
}
|
||||
module.exports = _classPrivateFieldDestructureSet, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
@ -1,7 +0,0 @@
|
|||
var classApplyDescriptorGet = require("./classApplyDescriptorGet.js");
|
||||
var classExtractFieldDescriptor = require("./classExtractFieldDescriptor.js");
|
||||
function _classPrivateFieldGet(receiver, privateMap) {
|
||||
var descriptor = classExtractFieldDescriptor(receiver, privateMap, "get");
|
||||
return classApplyDescriptorGet(receiver, descriptor);
|
||||
}
|
||||
module.exports = _classPrivateFieldGet, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
@ -1,6 +0,0 @@
|
|||
var checkPrivateRedeclaration = require("./checkPrivateRedeclaration.js");
|
||||
function _classPrivateFieldInitSpec(obj, privateMap, value) {
|
||||
checkPrivateRedeclaration(obj, privateMap);
|
||||
privateMap.set(obj, value);
|
||||
}
|
||||
module.exports = _classPrivateFieldInitSpec, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
@ -1,7 +0,0 @@
|
|||
function _classPrivateFieldBase(receiver, privateKey) {
|
||||
if (!Object.prototype.hasOwnProperty.call(receiver, privateKey)) {
|
||||
throw new TypeError("attempted to use private field on non-instance");
|
||||
}
|
||||
return receiver;
|
||||
}
|
||||
module.exports = _classPrivateFieldBase, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
@ -1,5 +0,0 @@
|
|||
var id = 0;
|
||||
function _classPrivateFieldKey(name) {
|
||||
return "__private_" + id++ + "_" + name;
|
||||
}
|
||||
module.exports = _classPrivateFieldKey, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
@ -1,8 +0,0 @@
|
|||
var classApplyDescriptorSet = require("./classApplyDescriptorSet.js");
|
||||
var classExtractFieldDescriptor = require("./classExtractFieldDescriptor.js");
|
||||
function _classPrivateFieldSet(receiver, privateMap, value) {
|
||||
var descriptor = classExtractFieldDescriptor(receiver, privateMap, "set");
|
||||
classApplyDescriptorSet(receiver, descriptor, value);
|
||||
return value;
|
||||
}
|
||||
module.exports = _classPrivateFieldSet, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
@ -1,7 +0,0 @@
|
|||
function _classPrivateMethodGet(receiver, privateSet, fn) {
|
||||
if (!privateSet.has(receiver)) {
|
||||
throw new TypeError("attempted to get private field on non-instance");
|
||||
}
|
||||
return fn;
|
||||
}
|
||||
module.exports = _classPrivateMethodGet, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
@ -1,6 +0,0 @@
|
|||
var checkPrivateRedeclaration = require("./checkPrivateRedeclaration.js");
|
||||
function _classPrivateMethodInitSpec(obj, privateSet) {
|
||||
checkPrivateRedeclaration(obj, privateSet);
|
||||
privateSet.add(obj);
|
||||
}
|
||||
module.exports = _classPrivateMethodInitSpec, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
@ -1,4 +0,0 @@
|
|||
function _classPrivateMethodSet() {
|
||||
throw new TypeError("attempted to reassign private method");
|
||||
}
|
||||
module.exports = _classPrivateMethodSet, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
9
微信机器人/node_modules/@babel/runtime/helpers/classStaticPrivateFieldDestructureSet.js
generated
vendored
9
微信机器人/node_modules/@babel/runtime/helpers/classStaticPrivateFieldDestructureSet.js
generated
vendored
|
@ -1,9 +0,0 @@
|
|||
var classApplyDescriptorDestructureSet = require("./classApplyDescriptorDestructureSet.js");
|
||||
var classCheckPrivateStaticAccess = require("./classCheckPrivateStaticAccess.js");
|
||||
var classCheckPrivateStaticFieldDescriptor = require("./classCheckPrivateStaticFieldDescriptor.js");
|
||||
function _classStaticPrivateFieldDestructureSet(receiver, classConstructor, descriptor) {
|
||||
classCheckPrivateStaticAccess(receiver, classConstructor);
|
||||
classCheckPrivateStaticFieldDescriptor(descriptor, "set");
|
||||
return classApplyDescriptorDestructureSet(receiver, descriptor);
|
||||
}
|
||||
module.exports = _classStaticPrivateFieldDestructureSet, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
@ -1,9 +0,0 @@
|
|||
var classApplyDescriptorGet = require("./classApplyDescriptorGet.js");
|
||||
var classCheckPrivateStaticAccess = require("./classCheckPrivateStaticAccess.js");
|
||||
var classCheckPrivateStaticFieldDescriptor = require("./classCheckPrivateStaticFieldDescriptor.js");
|
||||
function _classStaticPrivateFieldSpecGet(receiver, classConstructor, descriptor) {
|
||||
classCheckPrivateStaticAccess(receiver, classConstructor);
|
||||
classCheckPrivateStaticFieldDescriptor(descriptor, "get");
|
||||
return classApplyDescriptorGet(receiver, descriptor);
|
||||
}
|
||||
module.exports = _classStaticPrivateFieldSpecGet, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
@ -1,10 +0,0 @@
|
|||
var classApplyDescriptorSet = require("./classApplyDescriptorSet.js");
|
||||
var classCheckPrivateStaticAccess = require("./classCheckPrivateStaticAccess.js");
|
||||
var classCheckPrivateStaticFieldDescriptor = require("./classCheckPrivateStaticFieldDescriptor.js");
|
||||
function _classStaticPrivateFieldSpecSet(receiver, classConstructor, descriptor, value) {
|
||||
classCheckPrivateStaticAccess(receiver, classConstructor);
|
||||
classCheckPrivateStaticFieldDescriptor(descriptor, "set");
|
||||
classApplyDescriptorSet(receiver, descriptor, value);
|
||||
return value;
|
||||
}
|
||||
module.exports = _classStaticPrivateFieldSpecSet, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
@ -1,6 +0,0 @@
|
|||
var classCheckPrivateStaticAccess = require("./classCheckPrivateStaticAccess.js");
|
||||
function _classStaticPrivateMethodGet(receiver, classConstructor, method) {
|
||||
classCheckPrivateStaticAccess(receiver, classConstructor);
|
||||
return method;
|
||||
}
|
||||
module.exports = _classStaticPrivateMethodGet, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
@ -1,4 +0,0 @@
|
|||
function _classStaticPrivateMethodSet() {
|
||||
throw new TypeError("attempted to set read only static private field");
|
||||
}
|
||||
module.exports = _classStaticPrivateMethodSet, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
@ -1,18 +0,0 @@
|
|||
var setPrototypeOf = require("./setPrototypeOf.js");
|
||||
var isNativeReflectConstruct = require("./isNativeReflectConstruct.js");
|
||||
function _construct(Parent, args, Class) {
|
||||
if (isNativeReflectConstruct()) {
|
||||
module.exports = _construct = Reflect.construct.bind(), module.exports.__esModule = true, module.exports["default"] = module.exports;
|
||||
} else {
|
||||
module.exports = _construct = function _construct(Parent, args, Class) {
|
||||
var a = [null];
|
||||
a.push.apply(a, args);
|
||||
var Constructor = Function.bind.apply(Parent, a);
|
||||
var instance = new Constructor();
|
||||
if (Class) setPrototypeOf(instance, Class.prototype);
|
||||
return instance;
|
||||
}, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
||||
}
|
||||
return _construct.apply(null, arguments);
|
||||
}
|
||||
module.exports = _construct, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
@ -1,19 +0,0 @@
|
|||
var toPropertyKey = require("./toPropertyKey.js");
|
||||
function _defineProperties(target, props) {
|
||||
for (var i = 0; i < props.length; i++) {
|
||||
var descriptor = props[i];
|
||||
descriptor.enumerable = descriptor.enumerable || false;
|
||||
descriptor.configurable = true;
|
||||
if ("value" in descriptor) descriptor.writable = true;
|
||||
Object.defineProperty(target, toPropertyKey(descriptor.key), descriptor);
|
||||
}
|
||||
}
|
||||
function _createClass(Constructor, protoProps, staticProps) {
|
||||
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
||||
if (staticProps) _defineProperties(Constructor, staticProps);
|
||||
Object.defineProperty(Constructor, "prototype", {
|
||||
writable: false
|
||||
});
|
||||
return Constructor;
|
||||
}
|
||||
module.exports = _createClass, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
@ -1,53 +0,0 @@
|
|||
var unsupportedIterableToArray = require("./unsupportedIterableToArray.js");
|
||||
function _createForOfIteratorHelper(o, allowArrayLike) {
|
||||
var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
|
||||
if (!it) {
|
||||
if (Array.isArray(o) || (it = unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
|
||||
if (it) o = it;
|
||||
var i = 0;
|
||||
var F = function F() {};
|
||||
return {
|
||||
s: F,
|
||||
n: function n() {
|
||||
if (i >= o.length) return {
|
||||
done: true
|
||||
};
|
||||
return {
|
||||
done: false,
|
||||
value: o[i++]
|
||||
};
|
||||
},
|
||||
e: function e(_e) {
|
||||
throw _e;
|
||||
},
|
||||
f: F
|
||||
};
|
||||
}
|
||||
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
||||
}
|
||||
var normalCompletion = true,
|
||||
didErr = false,
|
||||
err;
|
||||
return {
|
||||
s: function s() {
|
||||
it = it.call(o);
|
||||
},
|
||||
n: function n() {
|
||||
var step = it.next();
|
||||
normalCompletion = step.done;
|
||||
return step;
|
||||
},
|
||||
e: function e(_e2) {
|
||||
didErr = true;
|
||||
err = _e2;
|
||||
},
|
||||
f: function f() {
|
||||
try {
|
||||
if (!normalCompletion && it["return"] != null) it["return"]();
|
||||
} finally {
|
||||
if (didErr) throw err;
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
module.exports = _createForOfIteratorHelper, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
@ -1,20 +0,0 @@
|
|||
var unsupportedIterableToArray = require("./unsupportedIterableToArray.js");
|
||||
function _createForOfIteratorHelperLoose(o, allowArrayLike) {
|
||||
var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
|
||||
if (it) return (it = it.call(o)).next.bind(it);
|
||||
if (Array.isArray(o) || (it = unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
|
||||
if (it) o = it;
|
||||
var i = 0;
|
||||
return function () {
|
||||
if (i >= o.length) return {
|
||||
done: true
|
||||
};
|
||||
return {
|
||||
done: false,
|
||||
value: o[i++]
|
||||
};
|
||||
};
|
||||
}
|
||||
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
||||
}
|
||||
module.exports = _createForOfIteratorHelperLoose, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
@ -1,18 +0,0 @@
|
|||
var getPrototypeOf = require("./getPrototypeOf.js");
|
||||
var isNativeReflectConstruct = require("./isNativeReflectConstruct.js");
|
||||
var possibleConstructorReturn = require("./possibleConstructorReturn.js");
|
||||
function _createSuper(Derived) {
|
||||
var hasNativeReflectConstruct = isNativeReflectConstruct();
|
||||
return function _createSuperInternal() {
|
||||
var Super = getPrototypeOf(Derived),
|
||||
result;
|
||||
if (hasNativeReflectConstruct) {
|
||||
var NewTarget = getPrototypeOf(this).constructor;
|
||||
result = Reflect.construct(Super, arguments, NewTarget);
|
||||
} else {
|
||||
result = Super.apply(this, arguments);
|
||||
}
|
||||
return possibleConstructorReturn(this, result);
|
||||
};
|
||||
}
|
||||
module.exports = _createSuper, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
@ -1,343 +0,0 @@
|
|||
var toArray = require("./toArray.js");
|
||||
var toPropertyKey = require("./toPropertyKey.js");
|
||||
function _decorate(decorators, factory, superClass, mixins) {
|
||||
var api = _getDecoratorsApi();
|
||||
if (mixins) {
|
||||
for (var i = 0; i < mixins.length; i++) {
|
||||
api = mixins[i](api);
|
||||
}
|
||||
}
|
||||
var r = factory(function initialize(O) {
|
||||
api.initializeInstanceElements(O, decorated.elements);
|
||||
}, superClass);
|
||||
var decorated = api.decorateClass(_coalesceClassElements(r.d.map(_createElementDescriptor)), decorators);
|
||||
api.initializeClassElements(r.F, decorated.elements);
|
||||
return api.runClassFinishers(r.F, decorated.finishers);
|
||||
}
|
||||
function _getDecoratorsApi() {
|
||||
_getDecoratorsApi = function _getDecoratorsApi() {
|
||||
return api;
|
||||
};
|
||||
var api = {
|
||||
elementsDefinitionOrder: [["method"], ["field"]],
|
||||
initializeInstanceElements: function initializeInstanceElements(O, elements) {
|
||||
["method", "field"].forEach(function (kind) {
|
||||
elements.forEach(function (element) {
|
||||
if (element.kind === kind && element.placement === "own") {
|
||||
this.defineClassElement(O, element);
|
||||
}
|
||||
}, this);
|
||||
}, this);
|
||||
},
|
||||
initializeClassElements: function initializeClassElements(F, elements) {
|
||||
var proto = F.prototype;
|
||||
["method", "field"].forEach(function (kind) {
|
||||
elements.forEach(function (element) {
|
||||
var placement = element.placement;
|
||||
if (element.kind === kind && (placement === "static" || placement === "prototype")) {
|
||||
var receiver = placement === "static" ? F : proto;
|
||||
this.defineClassElement(receiver, element);
|
||||
}
|
||||
}, this);
|
||||
}, this);
|
||||
},
|
||||
defineClassElement: function defineClassElement(receiver, element) {
|
||||
var descriptor = element.descriptor;
|
||||
if (element.kind === "field") {
|
||||
var initializer = element.initializer;
|
||||
descriptor = {
|
||||
enumerable: descriptor.enumerable,
|
||||
writable: descriptor.writable,
|
||||
configurable: descriptor.configurable,
|
||||
value: initializer === void 0 ? void 0 : initializer.call(receiver)
|
||||
};
|
||||
}
|
||||
Object.defineProperty(receiver, element.key, descriptor);
|
||||
},
|
||||
decorateClass: function decorateClass(elements, decorators) {
|
||||
var newElements = [];
|
||||
var finishers = [];
|
||||
var placements = {
|
||||
"static": [],
|
||||
prototype: [],
|
||||
own: []
|
||||
};
|
||||
elements.forEach(function (element) {
|
||||
this.addElementPlacement(element, placements);
|
||||
}, this);
|
||||
elements.forEach(function (element) {
|
||||
if (!_hasDecorators(element)) return newElements.push(element);
|
||||
var elementFinishersExtras = this.decorateElement(element, placements);
|
||||
newElements.push(elementFinishersExtras.element);
|
||||
newElements.push.apply(newElements, elementFinishersExtras.extras);
|
||||
finishers.push.apply(finishers, elementFinishersExtras.finishers);
|
||||
}, this);
|
||||
if (!decorators) {
|
||||
return {
|
||||
elements: newElements,
|
||||
finishers: finishers
|
||||
};
|
||||
}
|
||||
var result = this.decorateConstructor(newElements, decorators);
|
||||
finishers.push.apply(finishers, result.finishers);
|
||||
result.finishers = finishers;
|
||||
return result;
|
||||
},
|
||||
addElementPlacement: function addElementPlacement(element, placements, silent) {
|
||||
var keys = placements[element.placement];
|
||||
if (!silent && keys.indexOf(element.key) !== -1) {
|
||||
throw new TypeError("Duplicated element (" + element.key + ")");
|
||||
}
|
||||
keys.push(element.key);
|
||||
},
|
||||
decorateElement: function decorateElement(element, placements) {
|
||||
var extras = [];
|
||||
var finishers = [];
|
||||
for (var decorators = element.decorators, i = decorators.length - 1; i >= 0; i--) {
|
||||
var keys = placements[element.placement];
|
||||
keys.splice(keys.indexOf(element.key), 1);
|
||||
var elementObject = this.fromElementDescriptor(element);
|
||||
var elementFinisherExtras = this.toElementFinisherExtras((0, decorators[i])(elementObject) || elementObject);
|
||||
element = elementFinisherExtras.element;
|
||||
this.addElementPlacement(element, placements);
|
||||
if (elementFinisherExtras.finisher) {
|
||||
finishers.push(elementFinisherExtras.finisher);
|
||||
}
|
||||
var newExtras = elementFinisherExtras.extras;
|
||||
if (newExtras) {
|
||||
for (var j = 0; j < newExtras.length; j++) {
|
||||
this.addElementPlacement(newExtras[j], placements);
|
||||
}
|
||||
extras.push.apply(extras, newExtras);
|
||||
}
|
||||
}
|
||||
return {
|
||||
element: element,
|
||||
finishers: finishers,
|
||||
extras: extras
|
||||
};
|
||||
},
|
||||
decorateConstructor: function decorateConstructor(elements, decorators) {
|
||||
var finishers = [];
|
||||
for (var i = decorators.length - 1; i >= 0; i--) {
|
||||
var obj = this.fromClassDescriptor(elements);
|
||||
var elementsAndFinisher = this.toClassDescriptor((0, decorators[i])(obj) || obj);
|
||||
if (elementsAndFinisher.finisher !== undefined) {
|
||||
finishers.push(elementsAndFinisher.finisher);
|
||||
}
|
||||
if (elementsAndFinisher.elements !== undefined) {
|
||||
elements = elementsAndFinisher.elements;
|
||||
for (var j = 0; j < elements.length - 1; j++) {
|
||||
for (var k = j + 1; k < elements.length; k++) {
|
||||
if (elements[j].key === elements[k].key && elements[j].placement === elements[k].placement) {
|
||||
throw new TypeError("Duplicated element (" + elements[j].key + ")");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return {
|
||||
elements: elements,
|
||||
finishers: finishers
|
||||
};
|
||||
},
|
||||
fromElementDescriptor: function fromElementDescriptor(element) {
|
||||
var obj = {
|
||||
kind: element.kind,
|
||||
key: element.key,
|
||||
placement: element.placement,
|
||||
descriptor: element.descriptor
|
||||
};
|
||||
var desc = {
|
||||
value: "Descriptor",
|
||||
configurable: true
|
||||
};
|
||||
Object.defineProperty(obj, Symbol.toStringTag, desc);
|
||||
if (element.kind === "field") obj.initializer = element.initializer;
|
||||
return obj;
|
||||
},
|
||||
toElementDescriptors: function toElementDescriptors(elementObjects) {
|
||||
if (elementObjects === undefined) return;
|
||||
return toArray(elementObjects).map(function (elementObject) {
|
||||
var element = this.toElementDescriptor(elementObject);
|
||||
this.disallowProperty(elementObject, "finisher", "An element descriptor");
|
||||
this.disallowProperty(elementObject, "extras", "An element descriptor");
|
||||
return element;
|
||||
}, this);
|
||||
},
|
||||
toElementDescriptor: function toElementDescriptor(elementObject) {
|
||||
var kind = String(elementObject.kind);
|
||||
if (kind !== "method" && kind !== "field") {
|
||||
throw new TypeError('An element descriptor\'s .kind property must be either "method" or' + ' "field", but a decorator created an element descriptor with' + ' .kind "' + kind + '"');
|
||||
}
|
||||
var key = toPropertyKey(elementObject.key);
|
||||
var placement = String(elementObject.placement);
|
||||
if (placement !== "static" && placement !== "prototype" && placement !== "own") {
|
||||
throw new TypeError('An element descriptor\'s .placement property must be one of "static",' + ' "prototype" or "own", but a decorator created an element descriptor' + ' with .placement "' + placement + '"');
|
||||
}
|
||||
var descriptor = elementObject.descriptor;
|
||||
this.disallowProperty(elementObject, "elements", "An element descriptor");
|
||||
var element = {
|
||||
kind: kind,
|
||||
key: key,
|
||||
placement: placement,
|
||||
descriptor: Object.assign({}, descriptor)
|
||||
};
|
||||
if (kind !== "field") {
|
||||
this.disallowProperty(elementObject, "initializer", "A method descriptor");
|
||||
} else {
|
||||
this.disallowProperty(descriptor, "get", "The property descriptor of a field descriptor");
|
||||
this.disallowProperty(descriptor, "set", "The property descriptor of a field descriptor");
|
||||
this.disallowProperty(descriptor, "value", "The property descriptor of a field descriptor");
|
||||
element.initializer = elementObject.initializer;
|
||||
}
|
||||
return element;
|
||||
},
|
||||
toElementFinisherExtras: function toElementFinisherExtras(elementObject) {
|
||||
var element = this.toElementDescriptor(elementObject);
|
||||
var finisher = _optionalCallableProperty(elementObject, "finisher");
|
||||
var extras = this.toElementDescriptors(elementObject.extras);
|
||||
return {
|
||||
element: element,
|
||||
finisher: finisher,
|
||||
extras: extras
|
||||
};
|
||||
},
|
||||
fromClassDescriptor: function fromClassDescriptor(elements) {
|
||||
var obj = {
|
||||
kind: "class",
|
||||
elements: elements.map(this.fromElementDescriptor, this)
|
||||
};
|
||||
var desc = {
|
||||
value: "Descriptor",
|
||||
configurable: true
|
||||
};
|
||||
Object.defineProperty(obj, Symbol.toStringTag, desc);
|
||||
return obj;
|
||||
},
|
||||
toClassDescriptor: function toClassDescriptor(obj) {
|
||||
var kind = String(obj.kind);
|
||||
if (kind !== "class") {
|
||||
throw new TypeError('A class descriptor\'s .kind property must be "class", but a decorator' + ' created a class descriptor with .kind "' + kind + '"');
|
||||
}
|
||||
this.disallowProperty(obj, "key", "A class descriptor");
|
||||
this.disallowProperty(obj, "placement", "A class descriptor");
|
||||
this.disallowProperty(obj, "descriptor", "A class descriptor");
|
||||
this.disallowProperty(obj, "initializer", "A class descriptor");
|
||||
this.disallowProperty(obj, "extras", "A class descriptor");
|
||||
var finisher = _optionalCallableProperty(obj, "finisher");
|
||||
var elements = this.toElementDescriptors(obj.elements);
|
||||
return {
|
||||
elements: elements,
|
||||
finisher: finisher
|
||||
};
|
||||
},
|
||||
runClassFinishers: function runClassFinishers(constructor, finishers) {
|
||||
for (var i = 0; i < finishers.length; i++) {
|
||||
var newConstructor = (0, finishers[i])(constructor);
|
||||
if (newConstructor !== undefined) {
|
||||
if (typeof newConstructor !== "function") {
|
||||
throw new TypeError("Finishers must return a constructor.");
|
||||
}
|
||||
constructor = newConstructor;
|
||||
}
|
||||
}
|
||||
return constructor;
|
||||
},
|
||||
disallowProperty: function disallowProperty(obj, name, objectType) {
|
||||
if (obj[name] !== undefined) {
|
||||
throw new TypeError(objectType + " can't have a ." + name + " property.");
|
||||
}
|
||||
}
|
||||
};
|
||||
return api;
|
||||
}
|
||||
function _createElementDescriptor(def) {
|
||||
var key = toPropertyKey(def.key);
|
||||
var descriptor;
|
||||
if (def.kind === "method") {
|
||||
descriptor = {
|
||||
value: def.value,
|
||||
writable: true,
|
||||
configurable: true,
|
||||
enumerable: false
|
||||
};
|
||||
} else if (def.kind === "get") {
|
||||
descriptor = {
|
||||
get: def.value,
|
||||
configurable: true,
|
||||
enumerable: false
|
||||
};
|
||||
} else if (def.kind === "set") {
|
||||
descriptor = {
|
||||
set: def.value,
|
||||
configurable: true,
|
||||
enumerable: false
|
||||
};
|
||||
} else if (def.kind === "field") {
|
||||
descriptor = {
|
||||
configurable: true,
|
||||
writable: true,
|
||||
enumerable: true
|
||||
};
|
||||
}
|
||||
var element = {
|
||||
kind: def.kind === "field" ? "field" : "method",
|
||||
key: key,
|
||||
placement: def["static"] ? "static" : def.kind === "field" ? "own" : "prototype",
|
||||
descriptor: descriptor
|
||||
};
|
||||
if (def.decorators) element.decorators = def.decorators;
|
||||
if (def.kind === "field") element.initializer = def.value;
|
||||
return element;
|
||||
}
|
||||
function _coalesceGetterSetter(element, other) {
|
||||
if (element.descriptor.get !== undefined) {
|
||||
other.descriptor.get = element.descriptor.get;
|
||||
} else {
|
||||
other.descriptor.set = element.descriptor.set;
|
||||
}
|
||||
}
|
||||
function _coalesceClassElements(elements) {
|
||||
var newElements = [];
|
||||
var isSameElement = function isSameElement(other) {
|
||||
return other.kind === "method" && other.key === element.key && other.placement === element.placement;
|
||||
};
|
||||
for (var i = 0; i < elements.length; i++) {
|
||||
var element = elements[i];
|
||||
var other;
|
||||
if (element.kind === "method" && (other = newElements.find(isSameElement))) {
|
||||
if (_isDataDescriptor(element.descriptor) || _isDataDescriptor(other.descriptor)) {
|
||||
if (_hasDecorators(element) || _hasDecorators(other)) {
|
||||
throw new ReferenceError("Duplicated methods (" + element.key + ") can't be decorated.");
|
||||
}
|
||||
other.descriptor = element.descriptor;
|
||||
} else {
|
||||
if (_hasDecorators(element)) {
|
||||
if (_hasDecorators(other)) {
|
||||
throw new ReferenceError("Decorators can't be placed on different accessors with for " + "the same property (" + element.key + ").");
|
||||
}
|
||||
other.decorators = element.decorators;
|
||||
}
|
||||
_coalesceGetterSetter(element, other);
|
||||
}
|
||||
} else {
|
||||
newElements.push(element);
|
||||
}
|
||||
}
|
||||
return newElements;
|
||||
}
|
||||
function _hasDecorators(element) {
|
||||
return element.decorators && element.decorators.length;
|
||||
}
|
||||
function _isDataDescriptor(desc) {
|
||||
return desc !== undefined && !(desc.value === undefined && desc.writable === undefined);
|
||||
}
|
||||
function _optionalCallableProperty(obj, name) {
|
||||
var value = obj[name];
|
||||
if (value !== undefined && typeof value !== "function") {
|
||||
throw new TypeError("Expected '" + name + "' to be a function");
|
||||
}
|
||||
return value;
|
||||
}
|
||||
module.exports = _decorate, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
@ -1,12 +0,0 @@
|
|||
function _defaults(obj, defaults) {
|
||||
var keys = Object.getOwnPropertyNames(defaults);
|
||||
for (var i = 0; i < keys.length; i++) {
|
||||
var key = keys[i];
|
||||
var value = Object.getOwnPropertyDescriptor(defaults, key);
|
||||
if (value && value.configurable && obj[key] === undefined) {
|
||||
Object.defineProperty(obj, key, value);
|
||||
}
|
||||
}
|
||||
return obj;
|
||||
}
|
||||
module.exports = _defaults, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
@ -1,8 +0,0 @@
|
|||
function _defineAccessor(type, obj, key, fn) {
|
||||
var desc = {
|
||||
configurable: !0,
|
||||
enumerable: !0
|
||||
};
|
||||
return desc[type] = fn, Object.defineProperty(obj, key, desc);
|
||||
}
|
||||
module.exports = _defineAccessor, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
@ -1,20 +0,0 @@
|
|||
function _defineEnumerableProperties(obj, descs) {
|
||||
for (var key in descs) {
|
||||
var desc = descs[key];
|
||||
desc.configurable = desc.enumerable = true;
|
||||
if ("value" in desc) desc.writable = true;
|
||||
Object.defineProperty(obj, key, desc);
|
||||
}
|
||||
if (Object.getOwnPropertySymbols) {
|
||||
var objectSymbols = Object.getOwnPropertySymbols(descs);
|
||||
for (var i = 0; i < objectSymbols.length; i++) {
|
||||
var sym = objectSymbols[i];
|
||||
var desc = descs[sym];
|
||||
desc.configurable = desc.enumerable = true;
|
||||
if ("value" in desc) desc.writable = true;
|
||||
Object.defineProperty(obj, sym, desc);
|
||||
}
|
||||
}
|
||||
return obj;
|
||||
}
|
||||
module.exports = _defineEnumerableProperties, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
@ -1,16 +0,0 @@
|
|||
var toPropertyKey = require("./toPropertyKey.js");
|
||||
function _defineProperty(obj, key, value) {
|
||||
key = toPropertyKey(key);
|
||||
if (key in obj) {
|
||||
Object.defineProperty(obj, key, {
|
||||
value: value,
|
||||
enumerable: true,
|
||||
configurable: true,
|
||||
writable: true
|
||||
});
|
||||
} else {
|
||||
obj[key] = value;
|
||||
}
|
||||
return obj;
|
||||
}
|
||||
module.exports = _defineProperty, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
@ -1,28 +0,0 @@
|
|||
function dispose_SuppressedError(suppressed, error) {
|
||||
return "undefined" != typeof SuppressedError ? dispose_SuppressedError = SuppressedError : (dispose_SuppressedError = function dispose_SuppressedError(suppressed, error) {
|
||||
this.suppressed = suppressed, this.error = error, this.stack = new Error().stack;
|
||||
}, dispose_SuppressedError.prototype = Object.create(Error.prototype, {
|
||||
constructor: {
|
||||
value: dispose_SuppressedError,
|
||||
writable: !0,
|
||||
configurable: !0
|
||||
}
|
||||
})), new dispose_SuppressedError(suppressed, error);
|
||||
}
|
||||
function _dispose(stack, error, hasError) {
|
||||
function next() {
|
||||
for (; stack.length > 0;) try {
|
||||
var r = stack.pop(),
|
||||
p = r.d.call(r.v);
|
||||
if (r.a) return Promise.resolve(p).then(next, err);
|
||||
} catch (e) {
|
||||
return err(e);
|
||||
}
|
||||
if (hasError) throw error;
|
||||
}
|
||||
function err(e) {
|
||||
return error = hasError ? new dispose_SuppressedError(e, error) : e, hasError = !0, next();
|
||||
}
|
||||
return next();
|
||||
}
|
||||
module.exports = _dispose, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
@ -1,63 +0,0 @@
|
|||
import OverloadYield from "./OverloadYield.js";
|
||||
export default function AsyncGenerator(gen) {
|
||||
var front, back;
|
||||
function resume(key, arg) {
|
||||
try {
|
||||
var result = gen[key](arg),
|
||||
value = result.value,
|
||||
overloaded = value instanceof OverloadYield;
|
||||
Promise.resolve(overloaded ? value.v : value).then(function (arg) {
|
||||
if (overloaded) {
|
||||
var nextKey = "return" === key ? "return" : "next";
|
||||
if (!value.k || arg.done) return resume(nextKey, arg);
|
||||
arg = gen[nextKey](arg).value;
|
||||
}
|
||||
settle(result.done ? "return" : "normal", arg);
|
||||
}, function (err) {
|
||||
resume("throw", err);
|
||||
});
|
||||
} catch (err) {
|
||||
settle("throw", err);
|
||||
}
|
||||
}
|
||||
function settle(type, value) {
|
||||
switch (type) {
|
||||
case "return":
|
||||
front.resolve({
|
||||
value: value,
|
||||
done: !0
|
||||
});
|
||||
break;
|
||||
case "throw":
|
||||
front.reject(value);
|
||||
break;
|
||||
default:
|
||||
front.resolve({
|
||||
value: value,
|
||||
done: !1
|
||||
});
|
||||
}
|
||||
(front = front.next) ? resume(front.key, front.arg) : back = null;
|
||||
}
|
||||
this._invoke = function (key, arg) {
|
||||
return new Promise(function (resolve, reject) {
|
||||
var request = {
|
||||
key: key,
|
||||
arg: arg,
|
||||
resolve: resolve,
|
||||
reject: reject,
|
||||
next: null
|
||||
};
|
||||
back ? back = back.next = request : (front = back = request, resume(key, arg));
|
||||
});
|
||||
}, "function" != typeof gen["return"] && (this["return"] = void 0);
|
||||
}
|
||||
AsyncGenerator.prototype["function" == typeof Symbol && Symbol.asyncIterator || "@@asyncIterator"] = function () {
|
||||
return this;
|
||||
}, AsyncGenerator.prototype.next = function (arg) {
|
||||
return this._invoke("next", arg);
|
||||
}, AsyncGenerator.prototype["throw"] = function (arg) {
|
||||
return this._invoke("throw", arg);
|
||||
}, AsyncGenerator.prototype["return"] = function (arg) {
|
||||
return this._invoke("return", arg);
|
||||
};
|
|
@ -1,3 +0,0 @@
|
|||
export default function _AwaitValue(value) {
|
||||
this.wrapped = value;
|
||||
}
|
|
@ -1,3 +0,0 @@
|
|||
export default function _OverloadYield(value, kind) {
|
||||
this.v = value, this.k = kind;
|
||||
}
|
|
@ -1,23 +0,0 @@
|
|||
export default function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) {
|
||||
var desc = {};
|
||||
Object.keys(descriptor).forEach(function (key) {
|
||||
desc[key] = descriptor[key];
|
||||
});
|
||||
desc.enumerable = !!desc.enumerable;
|
||||
desc.configurable = !!desc.configurable;
|
||||
if ('value' in desc || desc.initializer) {
|
||||
desc.writable = true;
|
||||
}
|
||||
desc = decorators.slice().reverse().reduce(function (desc, decorator) {
|
||||
return decorator(target, property, desc) || desc;
|
||||
}, desc);
|
||||
if (context && desc.initializer !== void 0) {
|
||||
desc.value = desc.initializer ? desc.initializer.call(context) : void 0;
|
||||
desc.initializer = undefined;
|
||||
}
|
||||
if (desc.initializer === void 0) {
|
||||
Object.defineProperty(target, property, desc);
|
||||
desc = null;
|
||||
}
|
||||
return desc;
|
||||
}
|
|
@ -1,235 +0,0 @@
|
|||
import _typeof from "./typeof.js";
|
||||
function old_createMetadataMethodsForProperty(metadataMap, kind, property, decoratorFinishedRef) {
|
||||
return {
|
||||
getMetadata: function getMetadata(key) {
|
||||
old_assertNotFinished(decoratorFinishedRef, "getMetadata"), old_assertMetadataKey(key);
|
||||
var metadataForKey = metadataMap[key];
|
||||
if (void 0 !== metadataForKey) if (1 === kind) {
|
||||
var pub = metadataForKey["public"];
|
||||
if (void 0 !== pub) return pub[property];
|
||||
} else if (2 === kind) {
|
||||
var priv = metadataForKey["private"];
|
||||
if (void 0 !== priv) return priv.get(property);
|
||||
} else if (Object.hasOwnProperty.call(metadataForKey, "constructor")) return metadataForKey.constructor;
|
||||
},
|
||||
setMetadata: function setMetadata(key, value) {
|
||||
old_assertNotFinished(decoratorFinishedRef, "setMetadata"), old_assertMetadataKey(key);
|
||||
var metadataForKey = metadataMap[key];
|
||||
if (void 0 === metadataForKey && (metadataForKey = metadataMap[key] = {}), 1 === kind) {
|
||||
var pub = metadataForKey["public"];
|
||||
void 0 === pub && (pub = metadataForKey["public"] = {}), pub[property] = value;
|
||||
} else if (2 === kind) {
|
||||
var priv = metadataForKey.priv;
|
||||
void 0 === priv && (priv = metadataForKey["private"] = new Map()), priv.set(property, value);
|
||||
} else metadataForKey.constructor = value;
|
||||
}
|
||||
};
|
||||
}
|
||||
function old_convertMetadataMapToFinal(obj, metadataMap) {
|
||||
var parentMetadataMap = obj[Symbol.metadata || Symbol["for"]("Symbol.metadata")],
|
||||
metadataKeys = Object.getOwnPropertySymbols(metadataMap);
|
||||
if (0 !== metadataKeys.length) {
|
||||
for (var i = 0; i < metadataKeys.length; i++) {
|
||||
var key = metadataKeys[i],
|
||||
metaForKey = metadataMap[key],
|
||||
parentMetaForKey = parentMetadataMap ? parentMetadataMap[key] : null,
|
||||
pub = metaForKey["public"],
|
||||
parentPub = parentMetaForKey ? parentMetaForKey["public"] : null;
|
||||
pub && parentPub && Object.setPrototypeOf(pub, parentPub);
|
||||
var priv = metaForKey["private"];
|
||||
if (priv) {
|
||||
var privArr = Array.from(priv.values()),
|
||||
parentPriv = parentMetaForKey ? parentMetaForKey["private"] : null;
|
||||
parentPriv && (privArr = privArr.concat(parentPriv)), metaForKey["private"] = privArr;
|
||||
}
|
||||
parentMetaForKey && Object.setPrototypeOf(metaForKey, parentMetaForKey);
|
||||
}
|
||||
parentMetadataMap && Object.setPrototypeOf(metadataMap, parentMetadataMap), obj[Symbol.metadata || Symbol["for"]("Symbol.metadata")] = metadataMap;
|
||||
}
|
||||
}
|
||||
function old_createAddInitializerMethod(initializers, decoratorFinishedRef) {
|
||||
return function (initializer) {
|
||||
old_assertNotFinished(decoratorFinishedRef, "addInitializer"), old_assertCallable(initializer, "An initializer"), initializers.push(initializer);
|
||||
};
|
||||
}
|
||||
function old_memberDec(dec, name, desc, metadataMap, initializers, kind, isStatic, isPrivate, value) {
|
||||
var kindStr;
|
||||
switch (kind) {
|
||||
case 1:
|
||||
kindStr = "accessor";
|
||||
break;
|
||||
case 2:
|
||||
kindStr = "method";
|
||||
break;
|
||||
case 3:
|
||||
kindStr = "getter";
|
||||
break;
|
||||
case 4:
|
||||
kindStr = "setter";
|
||||
break;
|
||||
default:
|
||||
kindStr = "field";
|
||||
}
|
||||
var metadataKind,
|
||||
metadataName,
|
||||
ctx = {
|
||||
kind: kindStr,
|
||||
name: isPrivate ? "#" + name : name,
|
||||
isStatic: isStatic,
|
||||
isPrivate: isPrivate
|
||||
},
|
||||
decoratorFinishedRef = {
|
||||
v: !1
|
||||
};
|
||||
if (0 !== kind && (ctx.addInitializer = old_createAddInitializerMethod(initializers, decoratorFinishedRef)), isPrivate) {
|
||||
metadataKind = 2, metadataName = Symbol(name);
|
||||
var access = {};
|
||||
0 === kind ? (access.get = desc.get, access.set = desc.set) : 2 === kind ? access.get = function () {
|
||||
return desc.value;
|
||||
} : (1 !== kind && 3 !== kind || (access.get = function () {
|
||||
return desc.get.call(this);
|
||||
}), 1 !== kind && 4 !== kind || (access.set = function (v) {
|
||||
desc.set.call(this, v);
|
||||
})), ctx.access = access;
|
||||
} else metadataKind = 1, metadataName = name;
|
||||
try {
|
||||
return dec(value, Object.assign(ctx, old_createMetadataMethodsForProperty(metadataMap, metadataKind, metadataName, decoratorFinishedRef)));
|
||||
} finally {
|
||||
decoratorFinishedRef.v = !0;
|
||||
}
|
||||
}
|
||||
function old_assertNotFinished(decoratorFinishedRef, fnName) {
|
||||
if (decoratorFinishedRef.v) throw new Error("attempted to call " + fnName + " after decoration was finished");
|
||||
}
|
||||
function old_assertMetadataKey(key) {
|
||||
if ("symbol" != _typeof(key)) throw new TypeError("Metadata keys must be symbols, received: " + key);
|
||||
}
|
||||
function old_assertCallable(fn, hint) {
|
||||
if ("function" != typeof fn) throw new TypeError(hint + " must be a function");
|
||||
}
|
||||
function old_assertValidReturnValue(kind, value) {
|
||||
var type = _typeof(value);
|
||||
if (1 === kind) {
|
||||
if ("object" !== type || null === value) throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0");
|
||||
void 0 !== value.get && old_assertCallable(value.get, "accessor.get"), void 0 !== value.set && old_assertCallable(value.set, "accessor.set"), void 0 !== value.init && old_assertCallable(value.init, "accessor.init"), void 0 !== value.initializer && old_assertCallable(value.initializer, "accessor.initializer");
|
||||
} else if ("function" !== type) {
|
||||
var hint;
|
||||
throw hint = 0 === kind ? "field" : 10 === kind ? "class" : "method", new TypeError(hint + " decorators must return a function or void 0");
|
||||
}
|
||||
}
|
||||
function old_getInit(desc) {
|
||||
var initializer;
|
||||
return null == (initializer = desc.init) && (initializer = desc.initializer) && "undefined" != typeof console && console.warn(".initializer has been renamed to .init as of March 2022"), initializer;
|
||||
}
|
||||
function old_applyMemberDec(ret, base, decInfo, name, kind, isStatic, isPrivate, metadataMap, initializers) {
|
||||
var desc,
|
||||
initializer,
|
||||
value,
|
||||
newValue,
|
||||
get,
|
||||
set,
|
||||
decs = decInfo[0];
|
||||
if (isPrivate ? desc = 0 === kind || 1 === kind ? {
|
||||
get: decInfo[3],
|
||||
set: decInfo[4]
|
||||
} : 3 === kind ? {
|
||||
get: decInfo[3]
|
||||
} : 4 === kind ? {
|
||||
set: decInfo[3]
|
||||
} : {
|
||||
value: decInfo[3]
|
||||
} : 0 !== kind && (desc = Object.getOwnPropertyDescriptor(base, name)), 1 === kind ? value = {
|
||||
get: desc.get,
|
||||
set: desc.set
|
||||
} : 2 === kind ? value = desc.value : 3 === kind ? value = desc.get : 4 === kind && (value = desc.set), "function" == typeof decs) void 0 !== (newValue = old_memberDec(decs, name, desc, metadataMap, initializers, kind, isStatic, isPrivate, value)) && (old_assertValidReturnValue(kind, newValue), 0 === kind ? initializer = newValue : 1 === kind ? (initializer = old_getInit(newValue), get = newValue.get || value.get, set = newValue.set || value.set, value = {
|
||||
get: get,
|
||||
set: set
|
||||
}) : value = newValue);else for (var i = decs.length - 1; i >= 0; i--) {
|
||||
var newInit;
|
||||
if (void 0 !== (newValue = old_memberDec(decs[i], name, desc, metadataMap, initializers, kind, isStatic, isPrivate, value))) old_assertValidReturnValue(kind, newValue), 0 === kind ? newInit = newValue : 1 === kind ? (newInit = old_getInit(newValue), get = newValue.get || value.get, set = newValue.set || value.set, value = {
|
||||
get: get,
|
||||
set: set
|
||||
}) : value = newValue, void 0 !== newInit && (void 0 === initializer ? initializer = newInit : "function" == typeof initializer ? initializer = [initializer, newInit] : initializer.push(newInit));
|
||||
}
|
||||
if (0 === kind || 1 === kind) {
|
||||
if (void 0 === initializer) initializer = function initializer(instance, init) {
|
||||
return init;
|
||||
};else if ("function" != typeof initializer) {
|
||||
var ownInitializers = initializer;
|
||||
initializer = function initializer(instance, init) {
|
||||
for (var value = init, i = 0; i < ownInitializers.length; i++) value = ownInitializers[i].call(instance, value);
|
||||
return value;
|
||||
};
|
||||
} else {
|
||||
var originalInitializer = initializer;
|
||||
initializer = function initializer(instance, init) {
|
||||
return originalInitializer.call(instance, init);
|
||||
};
|
||||
}
|
||||
ret.push(initializer);
|
||||
}
|
||||
0 !== kind && (1 === kind ? (desc.get = value.get, desc.set = value.set) : 2 === kind ? desc.value = value : 3 === kind ? desc.get = value : 4 === kind && (desc.set = value), isPrivate ? 1 === kind ? (ret.push(function (instance, args) {
|
||||
return value.get.call(instance, args);
|
||||
}), ret.push(function (instance, args) {
|
||||
return value.set.call(instance, args);
|
||||
})) : 2 === kind ? ret.push(value) : ret.push(function (instance, args) {
|
||||
return value.call(instance, args);
|
||||
}) : Object.defineProperty(base, name, desc));
|
||||
}
|
||||
function old_applyMemberDecs(ret, Class, protoMetadataMap, staticMetadataMap, decInfos) {
|
||||
for (var protoInitializers, staticInitializers, existingProtoNonFields = new Map(), existingStaticNonFields = new Map(), i = 0; i < decInfos.length; i++) {
|
||||
var decInfo = decInfos[i];
|
||||
if (Array.isArray(decInfo)) {
|
||||
var base,
|
||||
metadataMap,
|
||||
initializers,
|
||||
kind = decInfo[1],
|
||||
name = decInfo[2],
|
||||
isPrivate = decInfo.length > 3,
|
||||
isStatic = kind >= 5;
|
||||
if (isStatic ? (base = Class, metadataMap = staticMetadataMap, 0 !== (kind -= 5) && (initializers = staticInitializers = staticInitializers || [])) : (base = Class.prototype, metadataMap = protoMetadataMap, 0 !== kind && (initializers = protoInitializers = protoInitializers || [])), 0 !== kind && !isPrivate) {
|
||||
var existingNonFields = isStatic ? existingStaticNonFields : existingProtoNonFields,
|
||||
existingKind = existingNonFields.get(name) || 0;
|
||||
if (!0 === existingKind || 3 === existingKind && 4 !== kind || 4 === existingKind && 3 !== kind) throw new Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + name);
|
||||
!existingKind && kind > 2 ? existingNonFields.set(name, kind) : existingNonFields.set(name, !0);
|
||||
}
|
||||
old_applyMemberDec(ret, base, decInfo, name, kind, isStatic, isPrivate, metadataMap, initializers);
|
||||
}
|
||||
}
|
||||
old_pushInitializers(ret, protoInitializers), old_pushInitializers(ret, staticInitializers);
|
||||
}
|
||||
function old_pushInitializers(ret, initializers) {
|
||||
initializers && ret.push(function (instance) {
|
||||
for (var i = 0; i < initializers.length; i++) initializers[i].call(instance);
|
||||
return instance;
|
||||
});
|
||||
}
|
||||
function old_applyClassDecs(ret, targetClass, metadataMap, classDecs) {
|
||||
if (classDecs.length > 0) {
|
||||
for (var initializers = [], newClass = targetClass, name = targetClass.name, i = classDecs.length - 1; i >= 0; i--) {
|
||||
var decoratorFinishedRef = {
|
||||
v: !1
|
||||
};
|
||||
try {
|
||||
var ctx = Object.assign({
|
||||
kind: "class",
|
||||
name: name,
|
||||
addInitializer: old_createAddInitializerMethod(initializers, decoratorFinishedRef)
|
||||
}, old_createMetadataMethodsForProperty(metadataMap, 0, name, decoratorFinishedRef)),
|
||||
nextNewClass = classDecs[i](newClass, ctx);
|
||||
} finally {
|
||||
decoratorFinishedRef.v = !0;
|
||||
}
|
||||
void 0 !== nextNewClass && (old_assertValidReturnValue(10, nextNewClass), newClass = nextNewClass);
|
||||
}
|
||||
ret.push(newClass, function () {
|
||||
for (var i = 0; i < initializers.length; i++) initializers[i].call(newClass);
|
||||
});
|
||||
}
|
||||
}
|
||||
export default function applyDecs(targetClass, memberDecs, classDecs) {
|
||||
var ret = [],
|
||||
staticMetadataMap = {},
|
||||
protoMetadataMap = {};
|
||||
return old_applyMemberDecs(ret, targetClass, protoMetadataMap, staticMetadataMap, memberDecs), old_convertMetadataMapToFinal(targetClass.prototype, protoMetadataMap), old_applyClassDecs(ret, targetClass, staticMetadataMap, classDecs), old_convertMetadataMapToFinal(targetClass, staticMetadataMap), ret;
|
||||
}
|
|
@ -1,186 +0,0 @@
|
|||
import _typeof from "./typeof.js";
|
||||
function applyDecs2203Factory() {
|
||||
function createAddInitializerMethod(initializers, decoratorFinishedRef) {
|
||||
return function (initializer) {
|
||||
!function (decoratorFinishedRef, fnName) {
|
||||
if (decoratorFinishedRef.v) throw new Error("attempted to call " + fnName + " after decoration was finished");
|
||||
}(decoratorFinishedRef, "addInitializer"), assertCallable(initializer, "An initializer"), initializers.push(initializer);
|
||||
};
|
||||
}
|
||||
function memberDec(dec, name, desc, initializers, kind, isStatic, isPrivate, value) {
|
||||
var kindStr;
|
||||
switch (kind) {
|
||||
case 1:
|
||||
kindStr = "accessor";
|
||||
break;
|
||||
case 2:
|
||||
kindStr = "method";
|
||||
break;
|
||||
case 3:
|
||||
kindStr = "getter";
|
||||
break;
|
||||
case 4:
|
||||
kindStr = "setter";
|
||||
break;
|
||||
default:
|
||||
kindStr = "field";
|
||||
}
|
||||
var get,
|
||||
set,
|
||||
ctx = {
|
||||
kind: kindStr,
|
||||
name: isPrivate ? "#" + name : name,
|
||||
"static": isStatic,
|
||||
"private": isPrivate
|
||||
},
|
||||
decoratorFinishedRef = {
|
||||
v: !1
|
||||
};
|
||||
0 !== kind && (ctx.addInitializer = createAddInitializerMethod(initializers, decoratorFinishedRef)), 0 === kind ? isPrivate ? (get = desc.get, set = desc.set) : (get = function get() {
|
||||
return this[name];
|
||||
}, set = function set(v) {
|
||||
this[name] = v;
|
||||
}) : 2 === kind ? get = function get() {
|
||||
return desc.value;
|
||||
} : (1 !== kind && 3 !== kind || (get = function get() {
|
||||
return desc.get.call(this);
|
||||
}), 1 !== kind && 4 !== kind || (set = function set(v) {
|
||||
desc.set.call(this, v);
|
||||
})), ctx.access = get && set ? {
|
||||
get: get,
|
||||
set: set
|
||||
} : get ? {
|
||||
get: get
|
||||
} : {
|
||||
set: set
|
||||
};
|
||||
try {
|
||||
return dec(value, ctx);
|
||||
} finally {
|
||||
decoratorFinishedRef.v = !0;
|
||||
}
|
||||
}
|
||||
function assertCallable(fn, hint) {
|
||||
if ("function" != typeof fn) throw new TypeError(hint + " must be a function");
|
||||
}
|
||||
function assertValidReturnValue(kind, value) {
|
||||
var type = _typeof(value);
|
||||
if (1 === kind) {
|
||||
if ("object" !== type || null === value) throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0");
|
||||
void 0 !== value.get && assertCallable(value.get, "accessor.get"), void 0 !== value.set && assertCallable(value.set, "accessor.set"), void 0 !== value.init && assertCallable(value.init, "accessor.init");
|
||||
} else if ("function" !== type) {
|
||||
var hint;
|
||||
throw hint = 0 === kind ? "field" : 10 === kind ? "class" : "method", new TypeError(hint + " decorators must return a function or void 0");
|
||||
}
|
||||
}
|
||||
function applyMemberDec(ret, base, decInfo, name, kind, isStatic, isPrivate, initializers) {
|
||||
var desc,
|
||||
init,
|
||||
value,
|
||||
newValue,
|
||||
get,
|
||||
set,
|
||||
decs = decInfo[0];
|
||||
if (isPrivate ? desc = 0 === kind || 1 === kind ? {
|
||||
get: decInfo[3],
|
||||
set: decInfo[4]
|
||||
} : 3 === kind ? {
|
||||
get: decInfo[3]
|
||||
} : 4 === kind ? {
|
||||
set: decInfo[3]
|
||||
} : {
|
||||
value: decInfo[3]
|
||||
} : 0 !== kind && (desc = Object.getOwnPropertyDescriptor(base, name)), 1 === kind ? value = {
|
||||
get: desc.get,
|
||||
set: desc.set
|
||||
} : 2 === kind ? value = desc.value : 3 === kind ? value = desc.get : 4 === kind && (value = desc.set), "function" == typeof decs) void 0 !== (newValue = memberDec(decs, name, desc, initializers, kind, isStatic, isPrivate, value)) && (assertValidReturnValue(kind, newValue), 0 === kind ? init = newValue : 1 === kind ? (init = newValue.init, get = newValue.get || value.get, set = newValue.set || value.set, value = {
|
||||
get: get,
|
||||
set: set
|
||||
}) : value = newValue);else for (var i = decs.length - 1; i >= 0; i--) {
|
||||
var newInit;
|
||||
if (void 0 !== (newValue = memberDec(decs[i], name, desc, initializers, kind, isStatic, isPrivate, value))) assertValidReturnValue(kind, newValue), 0 === kind ? newInit = newValue : 1 === kind ? (newInit = newValue.init, get = newValue.get || value.get, set = newValue.set || value.set, value = {
|
||||
get: get,
|
||||
set: set
|
||||
}) : value = newValue, void 0 !== newInit && (void 0 === init ? init = newInit : "function" == typeof init ? init = [init, newInit] : init.push(newInit));
|
||||
}
|
||||
if (0 === kind || 1 === kind) {
|
||||
if (void 0 === init) init = function init(instance, _init) {
|
||||
return _init;
|
||||
};else if ("function" != typeof init) {
|
||||
var ownInitializers = init;
|
||||
init = function init(instance, _init2) {
|
||||
for (var value = _init2, i = 0; i < ownInitializers.length; i++) value = ownInitializers[i].call(instance, value);
|
||||
return value;
|
||||
};
|
||||
} else {
|
||||
var originalInitializer = init;
|
||||
init = function init(instance, _init3) {
|
||||
return originalInitializer.call(instance, _init3);
|
||||
};
|
||||
}
|
||||
ret.push(init);
|
||||
}
|
||||
0 !== kind && (1 === kind ? (desc.get = value.get, desc.set = value.set) : 2 === kind ? desc.value = value : 3 === kind ? desc.get = value : 4 === kind && (desc.set = value), isPrivate ? 1 === kind ? (ret.push(function (instance, args) {
|
||||
return value.get.call(instance, args);
|
||||
}), ret.push(function (instance, args) {
|
||||
return value.set.call(instance, args);
|
||||
})) : 2 === kind ? ret.push(value) : ret.push(function (instance, args) {
|
||||
return value.call(instance, args);
|
||||
}) : Object.defineProperty(base, name, desc));
|
||||
}
|
||||
function pushInitializers(ret, initializers) {
|
||||
initializers && ret.push(function (instance) {
|
||||
for (var i = 0; i < initializers.length; i++) initializers[i].call(instance);
|
||||
return instance;
|
||||
});
|
||||
}
|
||||
return function (targetClass, memberDecs, classDecs) {
|
||||
var ret = [];
|
||||
return function (ret, Class, decInfos) {
|
||||
for (var protoInitializers, staticInitializers, existingProtoNonFields = new Map(), existingStaticNonFields = new Map(), i = 0; i < decInfos.length; i++) {
|
||||
var decInfo = decInfos[i];
|
||||
if (Array.isArray(decInfo)) {
|
||||
var base,
|
||||
initializers,
|
||||
kind = decInfo[1],
|
||||
name = decInfo[2],
|
||||
isPrivate = decInfo.length > 3,
|
||||
isStatic = kind >= 5;
|
||||
if (isStatic ? (base = Class, 0 != (kind -= 5) && (initializers = staticInitializers = staticInitializers || [])) : (base = Class.prototype, 0 !== kind && (initializers = protoInitializers = protoInitializers || [])), 0 !== kind && !isPrivate) {
|
||||
var existingNonFields = isStatic ? existingStaticNonFields : existingProtoNonFields,
|
||||
existingKind = existingNonFields.get(name) || 0;
|
||||
if (!0 === existingKind || 3 === existingKind && 4 !== kind || 4 === existingKind && 3 !== kind) throw new Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + name);
|
||||
!existingKind && kind > 2 ? existingNonFields.set(name, kind) : existingNonFields.set(name, !0);
|
||||
}
|
||||
applyMemberDec(ret, base, decInfo, name, kind, isStatic, isPrivate, initializers);
|
||||
}
|
||||
}
|
||||
pushInitializers(ret, protoInitializers), pushInitializers(ret, staticInitializers);
|
||||
}(ret, targetClass, memberDecs), function (ret, targetClass, classDecs) {
|
||||
if (classDecs.length > 0) {
|
||||
for (var initializers = [], newClass = targetClass, name = targetClass.name, i = classDecs.length - 1; i >= 0; i--) {
|
||||
var decoratorFinishedRef = {
|
||||
v: !1
|
||||
};
|
||||
try {
|
||||
var nextNewClass = classDecs[i](newClass, {
|
||||
kind: "class",
|
||||
name: name,
|
||||
addInitializer: createAddInitializerMethod(initializers, decoratorFinishedRef)
|
||||
});
|
||||
} finally {
|
||||
decoratorFinishedRef.v = !0;
|
||||
}
|
||||
void 0 !== nextNewClass && (assertValidReturnValue(10, nextNewClass), newClass = nextNewClass);
|
||||
}
|
||||
ret.push(newClass, function () {
|
||||
for (var i = 0; i < initializers.length; i++) initializers[i].call(newClass);
|
||||
});
|
||||
}
|
||||
}(ret, targetClass, classDecs), ret;
|
||||
};
|
||||
}
|
||||
var applyDecs2203Impl;
|
||||
export default function applyDecs2203(targetClass, memberDecs, classDecs) {
|
||||
return (applyDecs2203Impl = applyDecs2203Impl || applyDecs2203Factory())(targetClass, memberDecs, classDecs);
|
||||
}
|
|
@ -1,190 +0,0 @@
|
|||
import _typeof from "./typeof.js";
|
||||
function applyDecs2203RFactory() {
|
||||
function createAddInitializerMethod(initializers, decoratorFinishedRef) {
|
||||
return function (initializer) {
|
||||
!function (decoratorFinishedRef, fnName) {
|
||||
if (decoratorFinishedRef.v) throw new Error("attempted to call " + fnName + " after decoration was finished");
|
||||
}(decoratorFinishedRef, "addInitializer"), assertCallable(initializer, "An initializer"), initializers.push(initializer);
|
||||
};
|
||||
}
|
||||
function memberDec(dec, name, desc, initializers, kind, isStatic, isPrivate, value) {
|
||||
var kindStr;
|
||||
switch (kind) {
|
||||
case 1:
|
||||
kindStr = "accessor";
|
||||
break;
|
||||
case 2:
|
||||
kindStr = "method";
|
||||
break;
|
||||
case 3:
|
||||
kindStr = "getter";
|
||||
break;
|
||||
case 4:
|
||||
kindStr = "setter";
|
||||
break;
|
||||
default:
|
||||
kindStr = "field";
|
||||
}
|
||||
var get,
|
||||
set,
|
||||
ctx = {
|
||||
kind: kindStr,
|
||||
name: isPrivate ? "#" + name : name,
|
||||
"static": isStatic,
|
||||
"private": isPrivate
|
||||
},
|
||||
decoratorFinishedRef = {
|
||||
v: !1
|
||||
};
|
||||
0 !== kind && (ctx.addInitializer = createAddInitializerMethod(initializers, decoratorFinishedRef)), 0 === kind ? isPrivate ? (get = desc.get, set = desc.set) : (get = function get() {
|
||||
return this[name];
|
||||
}, set = function set(v) {
|
||||
this[name] = v;
|
||||
}) : 2 === kind ? get = function get() {
|
||||
return desc.value;
|
||||
} : (1 !== kind && 3 !== kind || (get = function get() {
|
||||
return desc.get.call(this);
|
||||
}), 1 !== kind && 4 !== kind || (set = function set(v) {
|
||||
desc.set.call(this, v);
|
||||
})), ctx.access = get && set ? {
|
||||
get: get,
|
||||
set: set
|
||||
} : get ? {
|
||||
get: get
|
||||
} : {
|
||||
set: set
|
||||
};
|
||||
try {
|
||||
return dec(value, ctx);
|
||||
} finally {
|
||||
decoratorFinishedRef.v = !0;
|
||||
}
|
||||
}
|
||||
function assertCallable(fn, hint) {
|
||||
if ("function" != typeof fn) throw new TypeError(hint + " must be a function");
|
||||
}
|
||||
function assertValidReturnValue(kind, value) {
|
||||
var type = _typeof(value);
|
||||
if (1 === kind) {
|
||||
if ("object" !== type || null === value) throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0");
|
||||
void 0 !== value.get && assertCallable(value.get, "accessor.get"), void 0 !== value.set && assertCallable(value.set, "accessor.set"), void 0 !== value.init && assertCallable(value.init, "accessor.init");
|
||||
} else if ("function" !== type) {
|
||||
var hint;
|
||||
throw hint = 0 === kind ? "field" : 10 === kind ? "class" : "method", new TypeError(hint + " decorators must return a function or void 0");
|
||||
}
|
||||
}
|
||||
function applyMemberDec(ret, base, decInfo, name, kind, isStatic, isPrivate, initializers) {
|
||||
var desc,
|
||||
init,
|
||||
value,
|
||||
newValue,
|
||||
get,
|
||||
set,
|
||||
decs = decInfo[0];
|
||||
if (isPrivate ? desc = 0 === kind || 1 === kind ? {
|
||||
get: decInfo[3],
|
||||
set: decInfo[4]
|
||||
} : 3 === kind ? {
|
||||
get: decInfo[3]
|
||||
} : 4 === kind ? {
|
||||
set: decInfo[3]
|
||||
} : {
|
||||
value: decInfo[3]
|
||||
} : 0 !== kind && (desc = Object.getOwnPropertyDescriptor(base, name)), 1 === kind ? value = {
|
||||
get: desc.get,
|
||||
set: desc.set
|
||||
} : 2 === kind ? value = desc.value : 3 === kind ? value = desc.get : 4 === kind && (value = desc.set), "function" == typeof decs) void 0 !== (newValue = memberDec(decs, name, desc, initializers, kind, isStatic, isPrivate, value)) && (assertValidReturnValue(kind, newValue), 0 === kind ? init = newValue : 1 === kind ? (init = newValue.init, get = newValue.get || value.get, set = newValue.set || value.set, value = {
|
||||
get: get,
|
||||
set: set
|
||||
}) : value = newValue);else for (var i = decs.length - 1; i >= 0; i--) {
|
||||
var newInit;
|
||||
if (void 0 !== (newValue = memberDec(decs[i], name, desc, initializers, kind, isStatic, isPrivate, value))) assertValidReturnValue(kind, newValue), 0 === kind ? newInit = newValue : 1 === kind ? (newInit = newValue.init, get = newValue.get || value.get, set = newValue.set || value.set, value = {
|
||||
get: get,
|
||||
set: set
|
||||
}) : value = newValue, void 0 !== newInit && (void 0 === init ? init = newInit : "function" == typeof init ? init = [init, newInit] : init.push(newInit));
|
||||
}
|
||||
if (0 === kind || 1 === kind) {
|
||||
if (void 0 === init) init = function init(instance, _init) {
|
||||
return _init;
|
||||
};else if ("function" != typeof init) {
|
||||
var ownInitializers = init;
|
||||
init = function init(instance, _init2) {
|
||||
for (var value = _init2, i = 0; i < ownInitializers.length; i++) value = ownInitializers[i].call(instance, value);
|
||||
return value;
|
||||
};
|
||||
} else {
|
||||
var originalInitializer = init;
|
||||
init = function init(instance, _init3) {
|
||||
return originalInitializer.call(instance, _init3);
|
||||
};
|
||||
}
|
||||
ret.push(init);
|
||||
}
|
||||
0 !== kind && (1 === kind ? (desc.get = value.get, desc.set = value.set) : 2 === kind ? desc.value = value : 3 === kind ? desc.get = value : 4 === kind && (desc.set = value), isPrivate ? 1 === kind ? (ret.push(function (instance, args) {
|
||||
return value.get.call(instance, args);
|
||||
}), ret.push(function (instance, args) {
|
||||
return value.set.call(instance, args);
|
||||
})) : 2 === kind ? ret.push(value) : ret.push(function (instance, args) {
|
||||
return value.call(instance, args);
|
||||
}) : Object.defineProperty(base, name, desc));
|
||||
}
|
||||
function applyMemberDecs(Class, decInfos) {
|
||||
for (var protoInitializers, staticInitializers, ret = [], existingProtoNonFields = new Map(), existingStaticNonFields = new Map(), i = 0; i < decInfos.length; i++) {
|
||||
var decInfo = decInfos[i];
|
||||
if (Array.isArray(decInfo)) {
|
||||
var base,
|
||||
initializers,
|
||||
kind = decInfo[1],
|
||||
name = decInfo[2],
|
||||
isPrivate = decInfo.length > 3,
|
||||
isStatic = kind >= 5;
|
||||
if (isStatic ? (base = Class, 0 !== (kind -= 5) && (initializers = staticInitializers = staticInitializers || [])) : (base = Class.prototype, 0 !== kind && (initializers = protoInitializers = protoInitializers || [])), 0 !== kind && !isPrivate) {
|
||||
var existingNonFields = isStatic ? existingStaticNonFields : existingProtoNonFields,
|
||||
existingKind = existingNonFields.get(name) || 0;
|
||||
if (!0 === existingKind || 3 === existingKind && 4 !== kind || 4 === existingKind && 3 !== kind) throw new Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + name);
|
||||
!existingKind && kind > 2 ? existingNonFields.set(name, kind) : existingNonFields.set(name, !0);
|
||||
}
|
||||
applyMemberDec(ret, base, decInfo, name, kind, isStatic, isPrivate, initializers);
|
||||
}
|
||||
}
|
||||
return pushInitializers(ret, protoInitializers), pushInitializers(ret, staticInitializers), ret;
|
||||
}
|
||||
function pushInitializers(ret, initializers) {
|
||||
initializers && ret.push(function (instance) {
|
||||
for (var i = 0; i < initializers.length; i++) initializers[i].call(instance);
|
||||
return instance;
|
||||
});
|
||||
}
|
||||
return function (targetClass, memberDecs, classDecs) {
|
||||
return {
|
||||
e: applyMemberDecs(targetClass, memberDecs),
|
||||
get c() {
|
||||
return function (targetClass, classDecs) {
|
||||
if (classDecs.length > 0) {
|
||||
for (var initializers = [], newClass = targetClass, name = targetClass.name, i = classDecs.length - 1; i >= 0; i--) {
|
||||
var decoratorFinishedRef = {
|
||||
v: !1
|
||||
};
|
||||
try {
|
||||
var nextNewClass = classDecs[i](newClass, {
|
||||
kind: "class",
|
||||
name: name,
|
||||
addInitializer: createAddInitializerMethod(initializers, decoratorFinishedRef)
|
||||
});
|
||||
} finally {
|
||||
decoratorFinishedRef.v = !0;
|
||||
}
|
||||
void 0 !== nextNewClass && (assertValidReturnValue(10, nextNewClass), newClass = nextNewClass);
|
||||
}
|
||||
return [newClass, function () {
|
||||
for (var i = 0; i < initializers.length; i++) initializers[i].call(newClass);
|
||||
}];
|
||||
}
|
||||
}(targetClass, classDecs);
|
||||
}
|
||||
};
|
||||
};
|
||||
}
|
||||
export default function applyDecs2203R(targetClass, memberDecs, classDecs) {
|
||||
return (applyDecs2203R = applyDecs2203RFactory())(targetClass, memberDecs, classDecs);
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue