@ -1,15 +1 @@ | |||
#!/bin/sh | |||
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") | |||
case `uname` in | |||
*CYGWIN*) basedir=`cygpath -w "$basedir"`;; | |||
esac | |||
if [ -x "$basedir/node" ]; then | |||
"$basedir/node" "$basedir/../acorn/bin/acorn" "$@" | |||
ret=$? | |||
else | |||
node "$basedir/../acorn/bin/acorn" "$@" | |||
ret=$? | |||
fi | |||
exit $ret | |||
../acorn/bin/acorn |
@ -1,15 +1 @@ | |||
#!/bin/sh | |||
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") | |||
case `uname` in | |||
*CYGWIN*) basedir=`cygpath -w "$basedir"`;; | |||
esac | |||
if [ -x "$basedir/node" ]; then | |||
"$basedir/node" "$basedir/../eslint/bin/eslint.js" "$@" | |||
ret=$? | |||
else | |||
node "$basedir/../eslint/bin/eslint.js" "$@" | |||
ret=$? | |||
fi | |||
exit $ret | |||
../eslint/bin/eslint.js |
@ -1,15 +1 @@ | |||
#!/bin/sh | |||
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") | |||
case `uname` in | |||
*CYGWIN*) basedir=`cygpath -w "$basedir"`;; | |||
esac | |||
if [ -x "$basedir/node" ]; then | |||
"$basedir/node" "$basedir/../js-yaml/bin/js-yaml.js" "$@" | |||
ret=$? | |||
else | |||
node "$basedir/../js-yaml/bin/js-yaml.js" "$@" | |||
ret=$? | |||
fi | |||
exit $ret | |||
../js-yaml/bin/js-yaml.js |
@ -1,15 +1 @@ | |||
#!/bin/sh | |||
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") | |||
case `uname` in | |||
*CYGWIN*) basedir=`cygpath -w "$basedir"`;; | |||
esac | |||
if [ -x "$basedir/node" ]; then | |||
"$basedir/node" "$basedir/../mime/cli.js" "$@" | |||
ret=$? | |||
else | |||
node "$basedir/../mime/cli.js" "$@" | |||
ret=$? | |||
fi | |||
exit $ret | |||
../mime/cli.js |
@ -1,15 +1 @@ | |||
#!/bin/sh | |||
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") | |||
case `uname` in | |||
*CYGWIN*) basedir=`cygpath -w "$basedir"`;; | |||
esac | |||
if [ -x "$basedir/node" ]; then | |||
"$basedir/node" "$basedir/../mkdirp/bin/cmd.js" "$@" | |||
ret=$? | |||
else | |||
node "$basedir/../mkdirp/bin/cmd.js" "$@" | |||
ret=$? | |||
fi | |||
exit $ret | |||
../mkdirp/bin/cmd.js |
@ -1,15 +1 @@ | |||
#!/bin/sh | |||
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") | |||
case `uname` in | |||
*CYGWIN*) basedir=`cygpath -w "$basedir"`;; | |||
esac | |||
if [ -x "$basedir/node" ]; then | |||
"$basedir/node" "$basedir/../which/bin/node-which" "$@" | |||
ret=$? | |||
else | |||
node "$basedir/../which/bin/node-which" "$@" | |||
ret=$? | |||
fi | |||
exit $ret | |||
../which/bin/node-which |
@ -1,15 +1 @@ | |||
#!/bin/sh | |||
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") | |||
case `uname` in | |||
*CYGWIN*) basedir=`cygpath -w "$basedir"`;; | |||
esac | |||
if [ -x "$basedir/node" ]; then | |||
"$basedir/node" "$basedir/../os-name/cli.js" "$@" | |||
ret=$? | |||
else | |||
node "$basedir/../os-name/cli.js" "$@" | |||
ret=$? | |||
fi | |||
exit $ret | |||
../os-name/cli.js |
@ -1,15 +1 @@ | |||
#!/bin/sh | |||
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") | |||
case `uname` in | |||
*CYGWIN*) basedir=`cygpath -w "$basedir"`;; | |||
esac | |||
if [ -x "$basedir/node" ]; then | |||
"$basedir/node" "$basedir/../osx-release/cli.js" "$@" | |||
ret=$? | |||
else | |||
node "$basedir/../osx-release/cli.js" "$@" | |||
ret=$? | |||
fi | |||
exit $ret | |||
../osx-release/cli.js |
@ -1,15 +1 @@ | |||
#!/bin/sh | |||
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") | |||
case `uname` in | |||
*CYGWIN*) basedir=`cygpath -w "$basedir"`;; | |||
esac | |||
if [ -x "$basedir/node" ]; then | |||
"$basedir/node" "$basedir/../rimraf/bin.js" "$@" | |||
ret=$? | |||
else | |||
node "$basedir/../rimraf/bin.js" "$@" | |||
ret=$? | |||
fi | |||
exit $ret | |||
../rimraf/bin.js |
@ -1,15 +1 @@ | |||
#!/bin/sh | |||
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") | |||
case `uname` in | |||
*CYGWIN*) basedir=`cygpath -w "$basedir"`;; | |||
esac | |||
if [ -x "$basedir/node" ]; then | |||
"$basedir/node" "$basedir/../semver/bin/semver.js" "$@" | |||
ret=$? | |||
else | |||
node "$basedir/../semver/bin/semver.js" "$@" | |||
ret=$? | |||
fi | |||
exit $ret | |||
../semver/bin/semver.js |
@ -0,0 +1,246 @@ | |||
{ | |||
"systemParams": "darwin-x64-83", | |||
"modulesFolders": [ | |||
"node_modules" | |||
], | |||
"flags": [], | |||
"linkedModules": [], | |||
"topLevelPatterns": [ | |||
"ali-oss@^6.21.0", | |||
"dayjs@^1.11.12", | |||
"eslint-config-airbnb@^19.0.0", | |||
"eslint@^8.2.0" | |||
], | |||
"lockfileEntries": { | |||
"@eslint-community/eslint-utils@^4.2.0": "https://registry.yarnpkg.com/@eslint-community/eslint-utils/-/eslint-utils-4.4.1.tgz#d1145bf2c20132d6400495d6df4bf59362fd9d56", | |||
"@eslint-community/regexpp@^4.6.1": "https://registry.yarnpkg.com/@eslint-community/regexpp/-/regexpp-4.12.1.tgz#cfc6cffe39df390a3841cde2abccf92eaa7ae0e0", | |||
"@eslint/eslintrc@^2.1.4": "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-2.1.4.tgz#388a269f0f25c1b6adc317b5a2c55714894c70ad", | |||
"@eslint/js@8.57.1": "https://registry.yarnpkg.com/@eslint/js/-/js-8.57.1.tgz#de633db3ec2ef6a3c89e2f19038063e8a122e2c2", | |||
"@humanwhocodes/config-array@^0.13.0": "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.13.0.tgz#fb907624df3256d04b9aa2df50d7aa97ec648748", | |||
"@humanwhocodes/module-importer@^1.0.1": "https://registry.yarnpkg.com/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz#af5b2691a22b44be847b0ca81641c5fb6ad0172c", | |||
"@humanwhocodes/object-schema@^2.0.3": "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-2.0.3.tgz#4a2868d75d6d6963e423bcf90b7fd1be343409d3", | |||
"@nodelib/fs.scandir@2.1.5": "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz#7619c2eb21b25483f6d167548b4cfd5a7488c3d5", | |||
"@nodelib/fs.stat@2.0.5": "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz#5bd262af94e9d25bd1e71b05deed44876a222e8b", | |||
"@nodelib/fs.walk@^1.2.8": "https://registry.yarnpkg.com/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz#e95737e8bb6746ddedf69c556953494f196fe69a", | |||
"@ungap/structured-clone@^1.2.0": "https://registry.yarnpkg.com/@ungap/structured-clone/-/structured-clone-1.3.0.tgz#d06bbb384ebcf6c505fde1c3d0ed4ddffe0aaff8", | |||
"acorn-jsx@^5.3.2": "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.2.tgz#7ed5bb55908b3b2f1bc55c6af1653bada7f07937", | |||
"acorn@^8.9.0": "https://registry.yarnpkg.com/acorn/-/acorn-8.14.0.tgz#063e2c70cac5fb4f6467f0b11152e04c682795b0", | |||
"address@^1.2.2": "https://registry.yarnpkg.com/address/-/address-1.2.2.tgz#2b5248dac5485a6390532c6a517fda2e3faac89e", | |||
"agentkeepalive@^3.4.1": "https://registry.yarnpkg.com/agentkeepalive/-/agentkeepalive-3.5.3.tgz#c210afce942b4287e2df2fbfe6c0d57eda2ce634", | |||
"ajv@^6.12.4": "https://registry.yarnpkg.com/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4", | |||
"ali-oss@^6.21.0": "https://registry.yarnpkg.com/ali-oss/-/ali-oss-6.22.0.tgz#084a20b54f2fc0ef607701cb8b2aaf1cfb4019bb", | |||
"ansi-regex@^5.0.1": "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304", | |||
"ansi-styles@^4.1.0": "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937", | |||
"any-promise@^1.0.0": "https://registry.yarnpkg.com/any-promise/-/any-promise-1.3.0.tgz#abc6afeedcea52e809cdc0376aed3ce39635d17f", | |||
"any-promise@^1.3.0": "https://registry.yarnpkg.com/any-promise/-/any-promise-1.3.0.tgz#abc6afeedcea52e809cdc0376aed3ce39635d17f", | |||
"argparse@^2.0.1": "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38", | |||
"balanced-match@^1.0.0": "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee", | |||
"bowser@^1.6.0": "https://registry.yarnpkg.com/bowser/-/bowser-1.9.4.tgz#890c58a2813a9d3243704334fa81b96a5c150c9a", | |||
"brace-expansion@^1.1.7": "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd", | |||
"builtin-status-codes@^3.0.0": "https://registry.yarnpkg.com/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz#85982878e21b98e1c66425e03d0174788f569ee8", | |||
"call-bind-apply-helpers@^1.0.0": "https://registry.yarnpkg.com/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.1.tgz#32e5892e6361b29b0b545ba6f7763378daca2840", | |||
"call-bind-apply-helpers@^1.0.1": "https://registry.yarnpkg.com/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.1.tgz#32e5892e6361b29b0b545ba6f7763378daca2840", | |||
"call-bind@^1.0.7": "https://registry.yarnpkg.com/call-bind/-/call-bind-1.0.8.tgz#0736a9660f537e3388826f440d5ec45f744eaa4c", | |||
"call-bind@^1.0.8": "https://registry.yarnpkg.com/call-bind/-/call-bind-1.0.8.tgz#0736a9660f537e3388826f440d5ec45f744eaa4c", | |||
"call-bound@^1.0.2": "https://registry.yarnpkg.com/call-bound/-/call-bound-1.0.3.tgz#41cfd032b593e39176a71533ab4f384aa04fd681", | |||
"call-bound@^1.0.3": "https://registry.yarnpkg.com/call-bound/-/call-bound-1.0.3.tgz#41cfd032b593e39176a71533ab4f384aa04fd681", | |||
"callsites@^3.0.0": "https://registry.yarnpkg.com/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73", | |||
"chalk@^4.0.0": "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01", | |||
"color-convert@^2.0.1": "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3", | |||
"color-name@~1.1.4": "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2", | |||
"concat-map@0.0.1": "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b", | |||
"confusing-browser-globals@^1.0.10": "https://registry.yarnpkg.com/confusing-browser-globals/-/confusing-browser-globals-1.0.11.tgz#ae40e9b57cdd3915408a2805ebd3a5585608dc81", | |||
"content-type@^1.0.2": "https://registry.yarnpkg.com/content-type/-/content-type-1.0.5.tgz#8b773162656d1d1086784c8f23a54ce6d73d7918", | |||
"copy-to@^2.0.1": "https://registry.yarnpkg.com/copy-to/-/copy-to-2.0.1.tgz#2680fbb8068a48d08656b6098092bdafc906f4a5", | |||
"core-util-is@^1.0.2": "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.3.tgz#a6042d3634c2b27e9328f837b965fac83808db85", | |||
"core-util-is@~1.0.0": "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.3.tgz#a6042d3634c2b27e9328f837b965fac83808db85", | |||
"cross-spawn@^7.0.2": "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.6.tgz#8a58fe78f00dcd70c370451759dfbfaf03e8ee9f", | |||
"dateformat@^2.0.0": "https://registry.yarnpkg.com/dateformat/-/dateformat-2.2.0.tgz#4065e2013cf9fb916ddfd82efb506ad4c6769062", | |||
"dayjs@^1.11.12": "https://registry.yarnpkg.com/dayjs/-/dayjs-1.11.13.tgz#92430b0139055c3ebb60150aa13e860a4b5a366c", | |||
"debug@^4.3.1": "https://registry.yarnpkg.com/debug/-/debug-4.4.0.tgz#2b3f2aea2ffeb776477460267377dc8710faba8a", | |||
"debug@^4.3.2": "https://registry.yarnpkg.com/debug/-/debug-4.4.0.tgz#2b3f2aea2ffeb776477460267377dc8710faba8a", | |||
"debug@^4.3.4": "https://registry.yarnpkg.com/debug/-/debug-4.4.0.tgz#2b3f2aea2ffeb776477460267377dc8710faba8a", | |||
"deep-is@^0.1.3": "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.4.tgz#a6f2dce612fadd2ef1f519b73551f17e85199831", | |||
"default-user-agent@^1.0.0": "https://registry.yarnpkg.com/default-user-agent/-/default-user-agent-1.0.0.tgz#16c46efdcaba3edc45f24f2bd4868b01b7c2adc6", | |||
"define-data-property@^1.0.1": "https://registry.yarnpkg.com/define-data-property/-/define-data-property-1.1.4.tgz#894dc141bb7d3060ae4366f6a0107e68fbe48c5e", | |||
"define-data-property@^1.1.4": "https://registry.yarnpkg.com/define-data-property/-/define-data-property-1.1.4.tgz#894dc141bb7d3060ae4366f6a0107e68fbe48c5e", | |||
"define-properties@^1.2.1": "https://registry.yarnpkg.com/define-properties/-/define-properties-1.2.1.tgz#10781cc616eb951a80a034bafcaa7377f6af2b6c", | |||
"destroy@^1.0.4": "https://registry.yarnpkg.com/destroy/-/destroy-1.2.0.tgz#4803735509ad8be552934c67df614f94e66fa015", | |||
"digest-header@^1.0.0": "https://registry.yarnpkg.com/digest-header/-/digest-header-1.1.0.tgz#e16ab6cf4545bc4eea878c8c35acd1b89664d800", | |||
"doctrine@^3.0.0": "https://registry.yarnpkg.com/doctrine/-/doctrine-3.0.0.tgz#addebead72a6574db783639dc87a121773973961", | |||
"dunder-proto@^1.0.1": "https://registry.yarnpkg.com/dunder-proto/-/dunder-proto-1.0.1.tgz#d7ae667e1dc83482f8b70fd0f6eefc50da30f58a", | |||
"ee-first@~1.1.1": "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d", | |||
"end-of-stream@^1.1.0": "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.4.tgz#5ae64a5f45057baf3626ec14da0ca5e4b2431eb0", | |||
"end-or-error@^1.0.1": "https://registry.yarnpkg.com/end-or-error/-/end-or-error-1.0.1.tgz#dc7a6210fe78d372fee24a8b4899dbd155414dcb", | |||
"es-define-property@^1.0.0": "https://registry.yarnpkg.com/es-define-property/-/es-define-property-1.0.1.tgz#983eb2f9a6724e9303f61addf011c72e09e0b0fa", | |||
"es-define-property@^1.0.1": "https://registry.yarnpkg.com/es-define-property/-/es-define-property-1.0.1.tgz#983eb2f9a6724e9303f61addf011c72e09e0b0fa", | |||
"es-errors@^1.3.0": "https://registry.yarnpkg.com/es-errors/-/es-errors-1.3.0.tgz#05f75a25dab98e4fb1dcd5e1472c0546d5057c8f", | |||
"es-object-atoms@^1.0.0": "https://registry.yarnpkg.com/es-object-atoms/-/es-object-atoms-1.1.1.tgz#1c4f2c4837327597ce69d2ca190a7fdd172338c1", | |||
"escape-html@^1.0.3": "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988", | |||
"escape-string-regexp@^4.0.0": "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34", | |||
"eslint-config-airbnb-base@^15.0.0": "https://registry.yarnpkg.com/eslint-config-airbnb-base/-/eslint-config-airbnb-base-15.0.0.tgz#6b09add90ac79c2f8d723a2580e07f3925afd236", | |||
"eslint-config-airbnb@^19.0.0": "https://registry.yarnpkg.com/eslint-config-airbnb/-/eslint-config-airbnb-19.0.4.tgz#84d4c3490ad70a0ffa571138ebcdea6ab085fdc3", | |||
"eslint-scope@^7.2.2": "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-7.2.2.tgz#deb4f92563390f32006894af62a22dba1c46423f", | |||
"eslint-visitor-keys@^3.4.1": "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz#0cd72fe8550e3c2eae156a96a4dddcd1c8ac5800", | |||
"eslint-visitor-keys@^3.4.3": "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz#0cd72fe8550e3c2eae156a96a4dddcd1c8ac5800", | |||
"eslint@^8.2.0": "https://registry.yarnpkg.com/eslint/-/eslint-8.57.1.tgz#7df109654aba7e3bbe5c8eae533c5e461d3c6ca9", | |||
"espree@^9.6.0": "https://registry.yarnpkg.com/espree/-/espree-9.6.1.tgz#a2a17b8e434690a5432f2f8018ce71d331a48c6f", | |||
"espree@^9.6.1": "https://registry.yarnpkg.com/espree/-/espree-9.6.1.tgz#a2a17b8e434690a5432f2f8018ce71d331a48c6f", | |||
"esquery@^1.4.2": "https://registry.yarnpkg.com/esquery/-/esquery-1.6.0.tgz#91419234f804d852a82dceec3e16cdc22cf9dae7", | |||
"esrecurse@^4.3.0": "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.3.0.tgz#7ad7964d679abb28bee72cec63758b1c5d2c9921", | |||
"estraverse@^5.1.0": "https://registry.yarnpkg.com/estraverse/-/estraverse-5.3.0.tgz#2eea5290702f26ab8fe5370370ff86c965d21123", | |||
"estraverse@^5.2.0": "https://registry.yarnpkg.com/estraverse/-/estraverse-5.3.0.tgz#2eea5290702f26ab8fe5370370ff86c965d21123", | |||
"esutils@^2.0.2": "https://registry.yarnpkg.com/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64", | |||
"extend-shallow@^2.0.1": "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-2.0.1.tgz#51af7d614ad9a9f610ea1bafbb989d6b1c56890f", | |||
"fast-deep-equal@^3.1.1": "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525", | |||
"fast-deep-equal@^3.1.3": "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525", | |||
"fast-json-stable-stringify@^2.0.0": "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633", | |||
"fast-levenshtein@^2.0.6": "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917", | |||
"fastq@^1.6.0": "https://registry.yarnpkg.com/fastq/-/fastq-1.18.0.tgz#d631d7e25faffea81887fe5ea8c9010e1b36fee0", | |||
"file-entry-cache@^6.0.1": "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-6.0.1.tgz#211b2dd9659cb0394b073e7323ac3c933d522027", | |||
"find-up@^5.0.0": "https://registry.yarnpkg.com/find-up/-/find-up-5.0.0.tgz#4c92819ecb7083561e4f4a240a86be5198f536fc", | |||
"flat-cache@^3.0.4": "https://registry.yarnpkg.com/flat-cache/-/flat-cache-3.2.0.tgz#2c0c2d5040c99b1632771a9d105725c0115363ee", | |||
"flatted@^3.2.9": "https://registry.yarnpkg.com/flatted/-/flatted-3.3.2.tgz#adba1448a9841bec72b42c532ea23dbbedef1a27", | |||
"formstream@^1.1.0": "https://registry.yarnpkg.com/formstream/-/formstream-1.5.1.tgz#b25f8121aa434cc82e8b36cdd765338b7b8df4de", | |||
"fs.realpath@^1.0.0": "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f", | |||
"function-bind@^1.1.2": "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.2.tgz#2c02d864d97f3ea6c8830c464cbd11ab6eab7a1c", | |||
"get-intrinsic@^1.2.4": "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.2.7.tgz#dcfcb33d3272e15f445d15124bc0a216189b9044", | |||
"get-intrinsic@^1.2.5": "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.2.7.tgz#dcfcb33d3272e15f445d15124bc0a216189b9044", | |||
"get-intrinsic@^1.2.6": "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.2.7.tgz#dcfcb33d3272e15f445d15124bc0a216189b9044", | |||
"get-proto@^1.0.0": "https://registry.yarnpkg.com/get-proto/-/get-proto-1.0.1.tgz#150b3f2743869ef3e851ec0c49d15b1d14d00ee1", | |||
"get-ready@^1.0.0": "https://registry.yarnpkg.com/get-ready/-/get-ready-1.0.0.tgz#f91817f1e9adecfea13a562adfc8de883ab34782", | |||
"get-ready@~1.0.0": "https://registry.yarnpkg.com/get-ready/-/get-ready-1.0.0.tgz#f91817f1e9adecfea13a562adfc8de883ab34782", | |||
"glob-parent@^6.0.2": "https://registry.yarnpkg.com/glob-parent/-/glob-parent-6.0.2.tgz#6d237d99083950c79290f24c7642a3de9a28f9e3", | |||
"glob@^7.1.3": "https://registry.yarnpkg.com/glob/-/glob-7.2.3.tgz#b8df0fb802bbfa8e89bd1d938b4e16578ed44f2b", | |||
"globals@^13.19.0": "https://registry.yarnpkg.com/globals/-/globals-13.24.0.tgz#8432a19d78ce0c1e833949c36adb345400bb1171", | |||
"gopd@^1.0.1": "https://registry.yarnpkg.com/gopd/-/gopd-1.2.0.tgz#89f56b8217bdbc8802bd299df6d7f1081d7e51a1", | |||
"gopd@^1.2.0": "https://registry.yarnpkg.com/gopd/-/gopd-1.2.0.tgz#89f56b8217bdbc8802bd299df6d7f1081d7e51a1", | |||
"graphemer@^1.4.0": "https://registry.yarnpkg.com/graphemer/-/graphemer-1.4.0.tgz#fb2f1d55e0e3a1849aeffc90c4fa0dd53a0e66c6", | |||
"has-flag@^4.0.0": "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b", | |||
"has-property-descriptors@^1.0.0": "https://registry.yarnpkg.com/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz#963ed7d071dc7bf5f084c5bfbe0d1b6222586854", | |||
"has-property-descriptors@^1.0.2": "https://registry.yarnpkg.com/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz#963ed7d071dc7bf5f084c5bfbe0d1b6222586854", | |||
"has-symbols@^1.1.0": "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.1.0.tgz#fc9c6a783a084951d0b971fe1018de813707a338", | |||
"hasown@^2.0.2": "https://registry.yarnpkg.com/hasown/-/hasown-2.0.2.tgz#003eaf91be7adc372e84ec59dc37252cedb80003", | |||
"humanize-ms@^1.2.0": "https://registry.yarnpkg.com/humanize-ms/-/humanize-ms-1.2.1.tgz#c46e3159a293f6b896da29316d8b6fe8bb79bbed", | |||
"humanize-ms@^1.2.1": "https://registry.yarnpkg.com/humanize-ms/-/humanize-ms-1.2.1.tgz#c46e3159a293f6b896da29316d8b6fe8bb79bbed", | |||
"iconv-lite@^0.6.3": "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.6.3.tgz#a52f80bf38da1952eb5c681790719871a1a72501", | |||
"ignore@^5.2.0": "https://registry.yarnpkg.com/ignore/-/ignore-5.3.2.tgz#3cd40e729f3643fd87cb04e50bf0eb722bc596f5", | |||
"import-fresh@^3.2.1": "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.3.0.tgz#37162c25fcb9ebaa2e6e53d5b4d88ce17d9e0c2b", | |||
"imurmurhash@^0.1.4": "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea", | |||
"inflight@^1.0.4": "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9", | |||
"inherits@2": "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c", | |||
"inherits@^2.0.1": "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c", | |||
"inherits@~2.0.3": "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c", | |||
"is-class-hotfix@~0.0.6": "https://registry.yarnpkg.com/is-class-hotfix/-/is-class-hotfix-0.0.6.tgz#a527d31fb23279281dde5f385c77b5de70a72435", | |||
"is-extendable@^0.1.0": "https://registry.yarnpkg.com/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89", | |||
"is-extglob@^2.1.1": "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2", | |||
"is-glob@^4.0.0": "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084", | |||
"is-glob@^4.0.3": "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084", | |||
"is-path-inside@^3.0.3": "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-3.0.3.tgz#d231362e53a07ff2b0e0ea7fed049161ffd16283", | |||
"is-type-of@^1.4.0": "https://registry.yarnpkg.com/is-type-of/-/is-type-of-1.4.0.tgz#3ed175a0eee888b1da4983332e7714feb8a8fb2b", | |||
"isarray@~1.0.0": "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11", | |||
"isexe@^2.0.0": "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10", | |||
"isstream@~0.1.2": "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a", | |||
"js-base64@^2.5.2": "https://registry.yarnpkg.com/js-base64/-/js-base64-2.6.4.tgz#f4e686c5de1ea1f867dbcad3d46d969428df98c4", | |||
"js-yaml@^4.1.0": "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.0.tgz#c1fb65f8f5017901cdd2c951864ba18458a10602", | |||
"json-buffer@3.0.1": "https://registry.yarnpkg.com/json-buffer/-/json-buffer-3.0.1.tgz#9338802a30d3b6605fbe0613e094008ca8c05a13", | |||
"json-schema-traverse@^0.4.1": "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660", | |||
"json-stable-stringify-without-jsonify@^1.0.1": "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651", | |||
"jstoxml@^2.0.0": "https://registry.yarnpkg.com/jstoxml/-/jstoxml-2.2.9.tgz#2eebd5e55383fe66a375022ca0aa88f77bc4fb84", | |||
"keyv@^4.5.3": "https://registry.yarnpkg.com/keyv/-/keyv-4.5.4.tgz#a879a99e29452f942439f2a405e3af8b31d4de93", | |||
"levn@^0.4.1": "https://registry.yarnpkg.com/levn/-/levn-0.4.1.tgz#ae4562c007473b932a6200d403268dd2fffc6ade", | |||
"locate-path@^6.0.0": "https://registry.yarnpkg.com/locate-path/-/locate-path-6.0.0.tgz#55321eb309febbc59c4801d931a72452a681d286", | |||
"lodash.merge@^4.6.2": "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.2.tgz#558aa53b43b661e1925a0afdfa36a9a1085fe57a", | |||
"lodash@^4.17.21": "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c", | |||
"math-intrinsics@^1.1.0": "https://registry.yarnpkg.com/math-intrinsics/-/math-intrinsics-1.1.0.tgz#a0dd74be81e2aa5c2f27e65ce283605ee4e2b7f9", | |||
"merge-descriptors@^1.0.1": "https://registry.yarnpkg.com/merge-descriptors/-/merge-descriptors-1.0.3.tgz#d80319a65f3c7935351e5cfdac8f9318504dbed5", | |||
"mime@^2.4.5": "https://registry.yarnpkg.com/mime/-/mime-2.6.0.tgz#a2a682a95cd4d0cb1d6257e28f83da7e35800367", | |||
"mime@^2.5.2": "https://registry.yarnpkg.com/mime/-/mime-2.6.0.tgz#a2a682a95cd4d0cb1d6257e28f83da7e35800367", | |||
"minimatch@^3.0.5": "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b", | |||
"minimatch@^3.1.1": "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b", | |||
"minimatch@^3.1.2": "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b", | |||
"minimist@^1.1.0": "https://registry.yarnpkg.com/minimist/-/minimist-1.2.8.tgz#c1a464e7693302e082a075cee0c057741ac4772c", | |||
"minimist@^1.2.6": "https://registry.yarnpkg.com/minimist/-/minimist-1.2.8.tgz#c1a464e7693302e082a075cee0c057741ac4772c", | |||
"mkdirp@^0.5.1": "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.6.tgz#7def03d2432dcae4ba1d611445c48396062255f6", | |||
"ms@^2.0.0": "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2", | |||
"ms@^2.1.3": "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2", | |||
"mz@^2.7.0": "https://registry.yarnpkg.com/mz/-/mz-2.7.0.tgz#95008057a56cafadc2bc63dde7f9ff6955948e32", | |||
"natural-compare@^1.4.0": "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7", | |||
"node-hex@^1.0.1": "https://registry.yarnpkg.com/node-hex/-/node-hex-1.0.1.tgz#606208e91f9c02b9b81531b692b9f1da4860fb24", | |||
"object-assign@^4.0.1": "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863", | |||
"object-inspect@^1.13.3": "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.13.3.tgz#f14c183de51130243d6d18ae149375ff50ea488a", | |||
"object-keys@^1.1.1": "https://registry.yarnpkg.com/object-keys/-/object-keys-1.1.1.tgz#1c47f272df277f3b1daf061677d9c82e2322c60e", | |||
"object.assign@^4.1.2": "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.7.tgz#8c14ca1a424c6a561b0bb2a22f66f5049a945d3d", | |||
"object.entries@^1.1.5": "https://registry.yarnpkg.com/object.entries/-/object.entries-1.1.8.tgz#bffe6f282e01f4d17807204a24f8edd823599c41", | |||
"once@^1.3.0": "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1", | |||
"once@^1.3.1": "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1", | |||
"once@^1.4.0": "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1", | |||
"optionator@^0.9.3": "https://registry.yarnpkg.com/optionator/-/optionator-0.9.4.tgz#7ea1c1a5d91d764fb282139c88fe11e182a3a734", | |||
"os-name@~1.0.3": "https://registry.yarnpkg.com/os-name/-/os-name-1.0.3.tgz#1b379f64835af7c5a7f498b357cb95215c159edf", | |||
"osx-release@^1.0.0": "https://registry.yarnpkg.com/osx-release/-/osx-release-1.1.0.tgz#f217911a28136949af1bf9308b241e2737d3cd6c", | |||
"p-limit@^3.0.2": "https://registry.yarnpkg.com/p-limit/-/p-limit-3.1.0.tgz#e1daccbe78d0d1388ca18c64fea38e3e57e3706b", | |||
"p-locate@^5.0.0": "https://registry.yarnpkg.com/p-locate/-/p-locate-5.0.0.tgz#83c8315c6785005e3bd021839411c9e110e6d834", | |||
"parent-module@^1.0.0": "https://registry.yarnpkg.com/parent-module/-/parent-module-1.0.1.tgz#691d2709e78c79fae3a156622452d00762caaaa2", | |||
"path-exists@^4.0.0": "https://registry.yarnpkg.com/path-exists/-/path-exists-4.0.0.tgz#513bdbe2d3b95d7762e8c1137efa195c6c61b5b3", | |||
"path-is-absolute@^1.0.0": "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f", | |||
"path-key@^3.1.0": "https://registry.yarnpkg.com/path-key/-/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375", | |||
"pause-stream@~0.0.11": "https://registry.yarnpkg.com/pause-stream/-/pause-stream-0.0.11.tgz#fe5a34b0cbce12b5aa6a2b403ee2e73b602f1445", | |||
"platform@^1.3.1": "https://registry.yarnpkg.com/platform/-/platform-1.3.6.tgz#48b4ce983164b209c2d45a107adb31f473a6e7a7", | |||
"prelude-ls@^1.2.1": "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396", | |||
"process-nextick-args@~2.0.0": "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2", | |||
"pump@^3.0.0": "https://registry.yarnpkg.com/pump/-/pump-3.0.2.tgz#836f3edd6bc2ee599256c924ffe0d88573ddcbf8", | |||
"punycode@^2.1.0": "https://registry.yarnpkg.com/punycode/-/punycode-2.3.1.tgz#027422e2faec0b25e1549c3e1bd8309b9133b6e5", | |||
"qs@^6.4.0": "https://registry.yarnpkg.com/qs/-/qs-6.14.0.tgz#c63fa40680d2c5c941412a0e899c89af60c0a930", | |||
"queue-microtask@^1.2.2": "https://registry.yarnpkg.com/queue-microtask/-/queue-microtask-1.2.3.tgz#4929228bbc724dfac43e0efb058caf7b6cfb6243", | |||
"readable-stream@^2.3.6": "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.8.tgz#91125e8042bba1b9887f49345f6277027ce8be9b", | |||
"resolve-from@^4.0.0": "https://registry.yarnpkg.com/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6", | |||
"reusify@^1.0.4": "https://registry.yarnpkg.com/reusify/-/reusify-1.0.4.tgz#90da382b1e126efc02146e90845a88db12925d76", | |||
"rimraf@^3.0.2": "https://registry.yarnpkg.com/rimraf/-/rimraf-3.0.2.tgz#f1a5402ba6220ad52cc1282bac1ae3aa49fd061a", | |||
"run-parallel@^1.1.9": "https://registry.yarnpkg.com/run-parallel/-/run-parallel-1.2.0.tgz#66d1368da7bdf921eb9d95bd1a9229e7f21a43ee", | |||
"safe-buffer@~5.1.0": "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d", | |||
"safe-buffer@~5.1.1": "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d", | |||
"safer-buffer@>= 2.1.2 < 3.0.0": "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a", | |||
"sax@>=0.6.0": "https://registry.yarnpkg.com/sax/-/sax-1.4.1.tgz#44cc8988377f126304d3b3fc1010c733b929ef0f", | |||
"sdk-base@^2.0.1": "https://registry.yarnpkg.com/sdk-base/-/sdk-base-2.0.1.tgz#ba40289e8bdf272ed11dd9ea97eaf98e036d24c6", | |||
"semver@^5.0.1": "https://registry.yarnpkg.com/semver/-/semver-5.7.2.tgz#48d55db737c3287cd4835e17fa13feace1c41ef8", | |||
"semver@^6.3.0": "https://registry.yarnpkg.com/semver/-/semver-6.3.1.tgz#556d2ef8689146e46dcea4bfdd095f3434dffcb4", | |||
"set-function-length@^1.2.2": "https://registry.yarnpkg.com/set-function-length/-/set-function-length-1.2.2.tgz#aac72314198eaed975cf77b2c3b6b880695e5449", | |||
"shebang-command@^2.0.0": "https://registry.yarnpkg.com/shebang-command/-/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea", | |||
"shebang-regex@^3.0.0": "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172", | |||
"side-channel-list@^1.0.0": "https://registry.yarnpkg.com/side-channel-list/-/side-channel-list-1.0.0.tgz#10cb5984263115d3b7a0e336591e290a830af8ad", | |||
"side-channel-map@^1.0.1": "https://registry.yarnpkg.com/side-channel-map/-/side-channel-map-1.0.1.tgz#d6bb6b37902c6fef5174e5f533fab4c732a26f42", | |||
"side-channel-weakmap@^1.0.2": "https://registry.yarnpkg.com/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz#11dda19d5368e40ce9ec2bdc1fb0ecbc0790ecea", | |||
"side-channel@^1.1.0": "https://registry.yarnpkg.com/side-channel/-/side-channel-1.1.0.tgz#c3fcff9c4da932784873335ec9765fa94ff66bc9", | |||
"statuses@^1.3.1": "https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c", | |||
"stream-http@2.8.2": "https://registry.yarnpkg.com/stream-http/-/stream-http-2.8.2.tgz#4126e8c6b107004465918aa2fc35549e77402c87", | |||
"stream-wormhole@^1.0.4": "https://registry.yarnpkg.com/stream-wormhole/-/stream-wormhole-1.1.0.tgz#300aff46ced553cfec642a05251885417693c33d", | |||
"string_decoder@~1.1.1": "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8", | |||
"strip-ansi@^6.0.1": "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9", | |||
"strip-json-comments@^3.1.1": "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006", | |||
"supports-color@^7.1.0": "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da", | |||
"text-table@^0.2.0": "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4", | |||
"thenify-all@^1.0.0": "https://registry.yarnpkg.com/thenify-all/-/thenify-all-1.6.0.tgz#1a1918d402d8fc3f98fbf234db0bcc8cc10e9726", | |||
"thenify@>= 3.1.0 < 4": "https://registry.yarnpkg.com/thenify/-/thenify-3.3.1.tgz#8932e686a4066038a016dd9e2ca46add9838a95f", | |||
"through@~2.3": "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5", | |||
"to-arraybuffer@^1.0.0": "https://registry.yarnpkg.com/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz#7d229b1fcc637e466ca081180836a7aabff83f43", | |||
"type-check@^0.4.0": "https://registry.yarnpkg.com/type-check/-/type-check-0.4.0.tgz#07b8203bfa7056c0657050e3ccd2c37730bab8f1", | |||
"type-check@~0.4.0": "https://registry.yarnpkg.com/type-check/-/type-check-0.4.0.tgz#07b8203bfa7056c0657050e3ccd2c37730bab8f1", | |||
"type-fest@^0.20.2": "https://registry.yarnpkg.com/type-fest/-/type-fest-0.20.2.tgz#1bf207f4b28f91583666cb5fbd327887301cd5f4", | |||
"unescape@^1.0.1": "https://registry.yarnpkg.com/unescape/-/unescape-1.0.1.tgz#956e430f61cad8a4d57d82c518f5e6cc5d0dda96", | |||
"uri-js@^4.2.2": "https://registry.yarnpkg.com/uri-js/-/uri-js-4.4.1.tgz#9b1a52595225859e55f669d928f88c6c57f2a77e", | |||
"urllib@^2.44.0": "https://registry.yarnpkg.com/urllib/-/urllib-2.44.0.tgz#0da4b037550bdc03eb9a408de498fb4025ddc0b4", | |||
"util-deprecate@~1.0.1": "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf", | |||
"utility@^1.16.1": "https://registry.yarnpkg.com/utility/-/utility-1.18.0.tgz#af55f62e6d5a272e0cb02b0ab3e7f37c46435f36", | |||
"utility@^1.18.0": "https://registry.yarnpkg.com/utility/-/utility-1.18.0.tgz#af55f62e6d5a272e0cb02b0ab3e7f37c46435f36", | |||
"which@^2.0.1": "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1", | |||
"win-release@^1.0.0": "https://registry.yarnpkg.com/win-release/-/win-release-1.1.1.tgz#5fa55e02be7ca934edfc12665632e849b72e5209", | |||
"word-wrap@^1.2.5": "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.5.tgz#d2c45c6dd4fbce621a66f136cbe328afd0410b34", | |||
"wrappy@1": "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f", | |||
"xml2js@^0.6.2": "https://registry.yarnpkg.com/xml2js/-/xml2js-0.6.2.tgz#dd0b630083aa09c161e25a4d0901e2b2a929b499", | |||
"xmlbuilder@~11.0.0": "https://registry.yarnpkg.com/xmlbuilder/-/xmlbuilder-11.0.1.tgz#be9bae1c8a046e76b31127726347d0ad7002beb3", | |||
"xtend@^4.0.0": "https://registry.yarnpkg.com/xtend/-/xtend-4.0.2.tgz#bb72779f5fa465186b1f438f674fa347fdb5db54", | |||
"yocto-queue@^0.1.0": "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b" | |||
}, | |||
"files": [], | |||
"artifacts": {} | |||
} |
@ -0,0 +1 @@ | |||
../../../../eslint/bin/eslint.js |
@ -0,0 +1 @@ | |||
../../../../js-yaml/bin/js-yaml.js |
@ -0,0 +1 @@ | |||
../../../acorn/bin/acorn |
@ -0,0 +1 @@ | |||
export declare function signPostObjectPolicyV4(this: any, policy: string | object, date: Date): string; |
@ -0,0 +1,18 @@ | |||
"use strict"; | |||
var __importDefault = (this && this.__importDefault) || function (mod) { | |||
return (mod && mod.__esModule) ? mod : { "default": mod }; | |||
}; | |||
Object.defineProperty(exports, "__esModule", { value: true }); | |||
exports.signPostObjectPolicyV4 = void 0; | |||
const dateformat_1 = __importDefault(require("dateformat")); | |||
const getStandardRegion_1 = require("../utils/getStandardRegion"); | |||
const policy2Str_1 = require("../utils/policy2Str"); | |||
const signUtils_1 = require("../signUtils"); | |||
function signPostObjectPolicyV4(policy, date) { | |||
const policyStr = Buffer.from(policy2Str_1.policy2Str(policy), 'utf8').toString('base64'); | |||
const formattedDate = dateformat_1.default(date, "UTC:yyyymmdd'T'HHMMss'Z'"); | |||
const onlyDate = formattedDate.split('T')[0]; | |||
const signature = signUtils_1.getSignatureV4(this.options.accessKeySecret, onlyDate, getStandardRegion_1.getStandardRegion(this.options.region), policyStr); | |||
return signature; | |||
} | |||
exports.signPostObjectPolicyV4 = signPostObjectPolicyV4; |
@ -0,0 +1,20 @@ | |||
import dateFormat from 'dateformat'; | |||
import { getStandardRegion } from '../utils/getStandardRegion'; | |||
import { policy2Str } from '../utils/policy2Str'; | |||
import { getSignatureV4 } from '../signUtils'; | |||
export function signPostObjectPolicyV4(this: any, policy: string | object, date: Date): string { | |||
const policyStr = Buffer.from(policy2Str(policy), 'utf8').toString('base64'); | |||
const formattedDate = dateFormat(date, "UTC:yyyymmdd'T'HHMMss'Z'"); | |||
const onlyDate = formattedDate.split('T')[0]; | |||
const signature = getSignatureV4( | |||
this.options.accessKeySecret, | |||
onlyDate, | |||
getStandardRegion(this.options.region), | |||
policyStr | |||
); | |||
return signature; | |||
} |
@ -0,0 +1,16 @@ | |||
interface IRestoreInfo { | |||
/** | |||
* Whether the restoration is ongoing | |||
* If a RestoreObject request is sent but the restoration is not complete, the value is true. | |||
* If a RestoreObject request is sent and the restoration is complete, the value is false. | |||
*/ | |||
ongoingRequest: boolean; | |||
/** | |||
* The time before which the restored object can be read. | |||
* If a RestoreObject request is sent but the restoration is not complete, the value is undefined. | |||
* If a RestoreObject request is sent and the restoration is complete, the value is Date. | |||
*/ | |||
expiryDate?: Date; | |||
} | |||
export declare const parseRestoreInfo: (originalRestoreInfo?: string | undefined) => IRestoreInfo | undefined; | |||
export {}; |
@ -0,0 +1,18 @@ | |||
"use strict"; | |||
Object.defineProperty(exports, "__esModule", { value: true }); | |||
exports.parseRestoreInfo = void 0; | |||
exports.parseRestoreInfo = (originalRestoreInfo) => { | |||
let tempRestoreInfo; | |||
if (originalRestoreInfo) { | |||
tempRestoreInfo = { | |||
ongoingRequest: originalRestoreInfo.includes('true') | |||
}; | |||
if (!tempRestoreInfo.ongoingRequest) { | |||
const matchArray = originalRestoreInfo.match(/expiry-date="(.*)"/); | |||
if (matchArray && matchArray[1]) { | |||
tempRestoreInfo.expiryDate = new Date(matchArray[1]); | |||
} | |||
} | |||
} | |||
return tempRestoreInfo; | |||
}; |
@ -0,0 +1,34 @@ | |||
interface IRestoreInfo { | |||
/** | |||
* Whether the restoration is ongoing | |||
* If a RestoreObject request is sent but the restoration is not complete, the value is true. | |||
* If a RestoreObject request is sent and the restoration is complete, the value is false. | |||
*/ | |||
ongoingRequest: boolean; | |||
/** | |||
* The time before which the restored object can be read. | |||
* If a RestoreObject request is sent but the restoration is not complete, the value is undefined. | |||
* If a RestoreObject request is sent and the restoration is complete, the value is Date. | |||
*/ | |||
expiryDate?: Date; | |||
} | |||
export const parseRestoreInfo = (originalRestoreInfo?: string): IRestoreInfo | undefined => { | |||
let tempRestoreInfo: IRestoreInfo | undefined; | |||
if (originalRestoreInfo) { | |||
tempRestoreInfo = { | |||
ongoingRequest: originalRestoreInfo.includes('true') | |||
}; | |||
if (!tempRestoreInfo.ongoingRequest) { | |||
const matchArray = originalRestoreInfo.match(/expiry-date="(.*)"/); | |||
if (matchArray && matchArray[1]) { | |||
tempRestoreInfo.expiryDate = new Date(matchArray[1]); | |||
} | |||
} | |||
} | |||
return tempRestoreInfo; | |||
}; |
@ -0,0 +1 @@ | |||
../../../mime/cli.js |
@ -0,0 +1,16 @@ | |||
{ | |||
"root": true, | |||
"extends": "@ljharb", | |||
"rules": { | |||
"func-name-matching": 0, | |||
"id-length": 0, | |||
"new-cap": [2, { | |||
"capIsNewExceptions": [ | |||
"GetIntrinsic", | |||
], | |||
}], | |||
"no-magic-numbers": 0, | |||
}, | |||
} |
@ -0,0 +1,12 @@ | |||
# These are supported funding model platforms | |||
github: [ljharb] | |||
patreon: # Replace with a single Patreon username | |||
open_collective: # Replace with a single Open Collective username | |||
ko_fi: # Replace with a single Ko-fi username | |||
tidelift: npm/call-bind-apply-helpers | |||
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry | |||
liberapay: # Replace with a single Liberapay username | |||
issuehunt: # Replace with a single IssueHunt username | |||
otechie: # Replace with a single Otechie username | |||
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] |
@ -0,0 +1,9 @@ | |||
{ | |||
"all": true, | |||
"check-coverage": false, | |||
"reporter": ["text-summary", "text", "html", "json"], | |||
"exclude": [ | |||
"coverage", | |||
"test" | |||
] | |||
} |
@ -0,0 +1,23 @@ | |||
# Changelog | |||
All notable changes to this project will be documented in this file. | |||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) | |||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). | |||
## [v1.0.1](https://github.com/ljharb/call-bind-apply-helpers/compare/v1.0.0...v1.0.1) - 2024-12-08 | |||
### Commits | |||
- [types] `reflectApply`: fix types [`4efc396`](https://github.com/ljharb/call-bind-apply-helpers/commit/4efc3965351a4f02cc55e836fa391d3d11ef2ef8) | |||
- [Fix] `reflectApply`: oops, Reflect is not a function [`83cc739`](https://github.com/ljharb/call-bind-apply-helpers/commit/83cc7395de6b79b7730bdf092f1436f0b1263c75) | |||
- [Dev Deps] update `@arethetypeswrong/cli` [`80bd5d3`](https://github.com/ljharb/call-bind-apply-helpers/commit/80bd5d3ae58b4f6b6995ce439dd5a1bcb178a940) | |||
## v1.0.0 - 2024-12-05 | |||
### Commits | |||
- Initial implementation, tests, readme [`7879629`](https://github.com/ljharb/call-bind-apply-helpers/commit/78796290f9b7430c9934d6f33d94ae9bc89fce04) | |||
- Initial commit [`3f1dc16`](https://github.com/ljharb/call-bind-apply-helpers/commit/3f1dc164afc43285631b114a5f9dd9137b2b952f) | |||
- npm init [`081df04`](https://github.com/ljharb/call-bind-apply-helpers/commit/081df048c312fcee400922026f6e97281200a603) | |||
- Only apps should have lockfiles [`5b9ca0f`](https://github.com/ljharb/call-bind-apply-helpers/commit/5b9ca0fe8101ebfaf309c549caac4e0a017ed930) |
@ -0,0 +1,21 @@ | |||
MIT License | |||
Copyright (c) 2024 Jordan Harband | |||
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. |
@ -0,0 +1,62 @@ | |||
# call-bind-apply-helpers <sup>[![Version Badge][npm-version-svg]][package-url]</sup> | |||
[![github actions][actions-image]][actions-url] | |||
[![coverage][codecov-image]][codecov-url] | |||
[![dependency status][deps-svg]][deps-url] | |||
[![dev dependency status][dev-deps-svg]][dev-deps-url] | |||
[![License][license-image]][license-url] | |||
[![Downloads][downloads-image]][downloads-url] | |||
[![npm badge][npm-badge-png]][package-url] | |||
Helper functions around Function call/apply/bind, for use in `call-bind`. | |||
The only packages that should likely ever use this package directly are `call-bind` and `get-intrinsic`. | |||
Please use `call-bind` unless you have a very good reason not to. | |||
## Getting started | |||
```sh | |||
npm install --save call-bind-apply-helpers | |||
``` | |||
## Usage/Examples | |||
```js | |||
const assert = require('assert'); | |||
const callBindBasic = require('call-bind-apply-helpers'); | |||
function f(a, b) { | |||
assert.equal(this, 1); | |||
assert.equal(a, 2); | |||
assert.equal(b, 3); | |||
assert.equal(arguments.length, 2); | |||
} | |||
const fBound = callBindBasic([f, 1]); | |||
delete Function.prototype.call; | |||
delete Function.prototype.bind; | |||
fBound(2, 3); | |||
``` | |||
## Tests | |||
Clone the repo, `npm install`, and run `npm test` | |||
[package-url]: https://npmjs.org/package/call-bind-apply-helpers | |||
[npm-version-svg]: https://versionbadg.es/ljharb/call-bind-apply-helpers.svg | |||
[deps-svg]: https://david-dm.org/ljharb/call-bind-apply-helpers.svg | |||
[deps-url]: https://david-dm.org/ljharb/call-bind-apply-helpers | |||
[dev-deps-svg]: https://david-dm.org/ljharb/call-bind-apply-helpers/dev-status.svg | |||
[dev-deps-url]: https://david-dm.org/ljharb/call-bind-apply-helpers#info=devDependencies | |||
[npm-badge-png]: https://nodei.co/npm/call-bind-apply-helpers.png?downloads=true&stars=true | |||
[license-image]: https://img.shields.io/npm/l/call-bind-apply-helpers.svg | |||
[license-url]: LICENSE | |||
[downloads-image]: https://img.shields.io/npm/dm/call-bind-apply-helpers.svg | |||
[downloads-url]: https://npm-stat.com/charts.html?package=call-bind-apply-helpers | |||
[codecov-image]: https://codecov.io/gh/ljharb/call-bind-apply-helpers/branch/main/graphs/badge.svg | |||
[codecov-url]: https://app.codecov.io/gh/ljharb/call-bind-apply-helpers/ | |||
[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/ljharb/call-bind-apply-helpers | |||
[actions-url]: https://github.com/ljharb/call-bind-apply-helpers/actions |
@ -0,0 +1 @@ | |||
export = Reflect.apply; |
@ -0,0 +1,10 @@ | |||
'use strict'; | |||
var bind = require('function-bind'); | |||
var $apply = require('./functionApply'); | |||
var $call = require('./functionCall'); | |||
var $reflectApply = require('./reflectApply'); | |||
/** @type {import('./actualApply')} */ | |||
module.exports = $reflectApply || bind.call($call, $apply); |
@ -0,0 +1,19 @@ | |||
import actualApply from './actualApply'; | |||
type TupleSplitHead<T extends any[], N extends number> = T['length'] extends N | |||
? T | |||
: T extends [...infer R, any] | |||
? TupleSplitHead<R, N> | |||
: never | |||
type TupleSplitTail<T, N extends number, O extends any[] = []> = O['length'] extends N | |||
? T | |||
: T extends [infer F, ...infer R] | |||
? TupleSplitTail<[...R], N, [...O, F]> | |||
: never | |||
type TupleSplit<T extends any[], N extends number> = [TupleSplitHead<T, N>, TupleSplitTail<T, N>] | |||
declare function applyBind(...args: TupleSplit<Parameters<typeof actualApply>, 2>[1]): ReturnType<typeof actualApply>; | |||
export = applyBind; |
@ -0,0 +1,10 @@ | |||
'use strict'; | |||
var bind = require('function-bind'); | |||
var $apply = require('./functionApply'); | |||
var actualApply = require('./actualApply'); | |||
/** @type {import('./applyBind')} */ | |||
module.exports = function applyBind() { | |||
return actualApply(bind, $apply, arguments); | |||
}; |
@ -0,0 +1 @@ | |||
export = Function.prototype.apply; |
@ -0,0 +1,4 @@ | |||
'use strict'; | |||
/** @type {import('./functionApply')} */ | |||
module.exports = Function.prototype.apply; |
@ -0,0 +1 @@ | |||
export = Function.prototype.call; |
@ -0,0 +1,4 @@ | |||
'use strict'; | |||
/** @type {import('./functionCall')} */ | |||
module.exports = Function.prototype.call; |
@ -0,0 +1,46 @@ | |||
type RemoveFromTuple< | |||
Tuple extends unknown[], | |||
RemoveCount extends number, | |||
Index extends 1[] = [] | |||
> = Index["length"] extends RemoveCount | |||
? Tuple | |||
: Tuple extends [first: unknown, ...infer Rest] | |||
? RemoveFromTuple<Rest, RemoveCount, [...Index, 1]> | |||
: Tuple; | |||
type ConcatTuples< | |||
Prefix extends unknown[], | |||
Suffix extends unknown[] | |||
> = [...Prefix, ...Suffix]; | |||
type ReplaceThis<T, NewThis> = T extends (this: infer OldThis, ...args: infer A) => infer R | |||
? (this: NewThis, ...args: A) => R | |||
: never; | |||
type BindFunction< | |||
TThis, | |||
T extends (this: TThis, ...args: any[]) => any, // Allow specific types to propagate | |||
TBoundArgs extends unknown[], | |||
ReceiverBound extends boolean | |||
> = ReceiverBound extends true | |||
? (...args: RemoveFromTuple<Parameters<T>, TBoundArgs["length"] & number>) => ReturnType<ReplaceThis<T, TThis>> | |||
: (...args: ConcatTuples<[TThis], RemoveFromTuple<Parameters<T>, TBoundArgs["length"] & number>>) => ReturnType<T>; | |||
declare function callBind< | |||
TThis, | |||
T extends (this: TThis, ...args: any[]) => any, | |||
TBoundArgs extends Partial<Parameters<T>> | |||
>( | |||
args: [fn: T, thisArg: TThis, ...boundArgs: TBoundArgs] | |||
): BindFunction<TThis, T, TBoundArgs, true>; | |||
declare function callBind< | |||
TThis, | |||
T extends (this: TThis, ...args: any[]) => any, | |||
TBoundArgs extends Partial<Parameters<T>> | |||
>( | |||
args: [fn: T, ...boundArgs: TBoundArgs] | |||
): BindFunction<TThis, T, TBoundArgs, false>; | |||
export as namespace callBind; | |||
export = callBind; |
@ -0,0 +1,15 @@ | |||
'use strict'; | |||
var bind = require('function-bind'); | |||
var $TypeError = require('es-errors/type'); | |||
var $call = require('./functionCall'); | |||
var $actualApply = require('./actualApply'); | |||
/** @type {import('.')} */ | |||
module.exports = function callBindBasic(args) { | |||
if (args.length < 1 || typeof args[0] !== 'function') { | |||
throw new $TypeError('a function is required'); | |||
} | |||
return $actualApply(bind, $call, args); | |||
}; |
@ -0,0 +1,85 @@ | |||
{ | |||
"name": "call-bind-apply-helpers", | |||
"version": "1.0.1", | |||
"description": "Helper functions around Function call/apply/bind, for use in `call-bind`", | |||
"main": "index.js", | |||
"exports": { | |||
".": "./index.js", | |||
"./actualApply": "./actualApply.js", | |||
"./applyBind": "./applyBind.js", | |||
"./functionApply": "./functionApply.js", | |||
"./functionCall": "./functionCall.js", | |||
"./reflectApply": "./reflectApply.js", | |||
"./package.json": "./package.json" | |||
}, | |||
"scripts": { | |||
"prepack": "npmignore --auto --commentLines=auto", | |||
"prepublish": "not-in-publish || npm run prepublishOnly", | |||
"prepublishOnly": "safe-publish-latest", | |||
"prelint": "evalmd README.md", | |||
"lint": "eslint --ext=.js,.mjs .", | |||
"postlint": "tsc -p . && attw -P", | |||
"pretest": "npm run lint", | |||
"tests-only": "nyc tape 'test/**/*.js'", | |||
"test": "npm run tests-only", | |||
"posttest": "npx npm@'>=10.2' audit --production", | |||
"version": "auto-changelog && git add CHANGELOG.md", | |||
"postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"" | |||
}, | |||
"repository": { | |||
"type": "git", | |||
"url": "git+https://github.com/ljharb/call-bind-apply-helpers.git" | |||
}, | |||
"author": "Jordan Harband <ljharb@gmail.com>", | |||
"license": "MIT", | |||
"bugs": { | |||
"url": "https://github.com/ljharb/call-bind-apply-helpers/issues" | |||
}, | |||
"homepage": "https://github.com/ljharb/call-bind-apply-helpers#readme", | |||
"dependencies": { | |||
"es-errors": "^1.3.0", | |||
"function-bind": "^1.1.2" | |||
}, | |||
"devDependencies": { | |||
"@arethetypeswrong/cli": "^0.17.1", | |||
"@ljharb/eslint-config": "^21.1.1", | |||
"@ljharb/tsconfig": "^0.2.2", | |||
"@types/for-each": "^0.3.3", | |||
"@types/function-bind": "^1.1.10", | |||
"@types/object-inspect": "^1.13.0", | |||
"@types/tape": "^5.6.5", | |||
"auto-changelog": "^2.5.0", | |||
"encoding": "^0.1.13", | |||
"es-value-fixtures": "^1.5.0", | |||
"eslint": "=8.8.0", | |||
"evalmd": "^0.0.19", | |||
"for-each": "^0.3.3", | |||
"has-strict-mode": "^1.0.1", | |||
"in-publish": "^2.0.1", | |||
"npmignore": "^0.3.1", | |||
"nyc": "^10.3.2", | |||
"object-inspect": "^1.13.3", | |||
"safe-publish-latest": "^2.0.0", | |||
"tape": "^5.9.0", | |||
"typescript": "next" | |||
}, | |||
"testling": { | |||
"files": "test/index.js" | |||
}, | |||
"auto-changelog": { | |||
"output": "CHANGELOG.md", | |||
"template": "keepachangelog", | |||
"unreleased": false, | |||
"commitLimit": false, | |||
"backfillLimit": false, | |||
"hideCredit": true | |||
}, | |||
"publishConfig": { | |||
"ignore": [ | |||
".github/workflows" | |||
] | |||
}, | |||
"engines": { | |||
"node": ">= 0.4" | |||
} | |||
} |
@ -0,0 +1,3 @@ | |||
declare const reflectApply: false | typeof Reflect.apply; | |||
export = reflectApply; |
@ -0,0 +1,4 @@ | |||
'use strict'; | |||
/** @type {import('./reflectApply')} */ | |||
module.exports = typeof Reflect !== 'undefined' && Reflect && Reflect.apply; |
@ -0,0 +1,63 @@ | |||
'use strict'; | |||
var callBind = require('../'); | |||
var hasStrictMode = require('has-strict-mode')(); | |||
var forEach = require('for-each'); | |||
var inspect = require('object-inspect'); | |||
var v = require('es-value-fixtures'); | |||
var test = require('tape'); | |||
test('callBindBasic', function (t) { | |||
forEach(v.nonFunctions, function (nonFunction) { | |||
t['throws']( | |||
// @ts-expect-error | |||
function () { callBind([nonFunction]); }, | |||
TypeError, | |||
inspect(nonFunction) + ' is not a function' | |||
); | |||
}); | |||
var sentinel = { sentinel: true }; | |||
/** @type {<T>(this: T, a: number, b: number) => [T | undefined, number, number]} */ | |||
var func = function (a, b) { | |||
// eslint-disable-next-line no-invalid-this | |||
return [!hasStrictMode && this === global ? undefined : this, a, b]; | |||
}; | |||
t.equal(func.length, 2, 'original function length is 2'); | |||
/** type {(thisArg: unknown, a: number, b: number) => [unknown, number, number]} */ | |||
var bound = callBind([func]); | |||
/** type {((a: number, b: number) => [sentinel, typeof a, typeof b])} */ | |||
var boundR = callBind([func, sentinel]); | |||
/** type {((b: number) => [sentinel, number, typeof b])} */ | |||
var boundArg = callBind([func, sentinel, 1]); | |||
// @ts-expect-error | |||
t.deepEqual(bound(), [undefined, undefined, undefined], 'bound func with no args'); | |||
// @ts-expect-error | |||
t.deepEqual(func(), [undefined, undefined, undefined], 'unbound func with too few args'); | |||
// @ts-expect-error | |||
t.deepEqual(bound(1, 2), [hasStrictMode ? 1 : Object(1), 2, undefined], 'bound func too few args'); | |||
// @ts-expect-error | |||
t.deepEqual(boundR(), [sentinel, undefined, undefined], 'bound func with receiver, with too few args'); | |||
// @ts-expect-error | |||
t.deepEqual(boundArg(), [sentinel, 1, undefined], 'bound func with receiver and arg, with too few args'); | |||
t.deepEqual(func(1, 2), [undefined, 1, 2], 'unbound func with right args'); | |||
t.deepEqual(bound(1, 2, 3), [hasStrictMode ? 1 : Object(1), 2, 3], 'bound func with right args'); | |||
t.deepEqual(boundR(1, 2), [sentinel, 1, 2], 'bound func with receiver, with right args'); | |||
t.deepEqual(boundArg(2), [sentinel, 1, 2], 'bound func with receiver and arg, with right arg'); | |||
// @ts-expect-error | |||
t.deepEqual(func(1, 2, 3), [undefined, 1, 2], 'unbound func with too many args'); | |||
// @ts-expect-error | |||
t.deepEqual(bound(1, 2, 3, 4), [hasStrictMode ? 1 : Object(1), 2, 3], 'bound func with too many args'); | |||
// @ts-expect-error | |||
t.deepEqual(boundR(1, 2, 3), [sentinel, 1, 2], 'bound func with receiver, with too many args'); | |||
// @ts-expect-error | |||
t.deepEqual(boundArg(2, 3), [sentinel, 1, 2], 'bound func with receiver and arg, with too many args'); | |||
t.end(); | |||
}); |
@ -0,0 +1,9 @@ | |||
{ | |||
"extends": "@ljharb/tsconfig", | |||
"compilerOptions": { | |||
"target": "es2021", | |||
}, | |||
"exclude": [ | |||
"coverage", | |||
], | |||
} |
@ -0,0 +1,13 @@ | |||
{ | |||
"root": true, | |||
"extends": "@ljharb", | |||
"rules": { | |||
"new-cap": [2, { | |||
"capIsNewExceptions": [ | |||
"GetIntrinsic", | |||
], | |||
}], | |||
}, | |||
} |
@ -0,0 +1,12 @@ | |||
# These are supported funding model platforms | |||
github: [ljharb] | |||
patreon: # Replace with a single Patreon username | |||
open_collective: # Replace with a single Open Collective username | |||
ko_fi: # Replace with a single Ko-fi username | |||
tidelift: npm/call-bound | |||
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry | |||
liberapay: # Replace with a single Liberapay username | |||
issuehunt: # Replace with a single IssueHunt username | |||
otechie: # Replace with a single Otechie username | |||
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] |
@ -0,0 +1,9 @@ | |||
{ | |||
"all": true, | |||
"check-coverage": false, | |||
"reporter": ["text-summary", "text", "html", "json"], | |||
"exclude": [ | |||
"coverage", | |||
"test" | |||
] | |||
} |
@ -0,0 +1,34 @@ | |||
# Changelog | |||
All notable changes to this project will be documented in this file. | |||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) | |||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). | |||
## [v1.0.3](https://github.com/ljharb/call-bound/compare/v1.0.2...v1.0.3) - 2024-12-15 | |||
### Commits | |||
- [Refactor] use `call-bind-apply-helpers` instead of `call-bind` [`5e0b134`](https://github.com/ljharb/call-bound/commit/5e0b13496df14fb7d05dae9412f088da8d3f75be) | |||
- [Deps] update `get-intrinsic` [`41fc967`](https://github.com/ljharb/call-bound/commit/41fc96732a22c7b7e8f381f93ccc54bb6293be2e) | |||
- [readme] fix example [`79a0137`](https://github.com/ljharb/call-bound/commit/79a0137723f7c6d09c9c05452bbf8d5efb5d6e49) | |||
- [meta] add `sideEffects` flag [`08b07be`](https://github.com/ljharb/call-bound/commit/08b07be7f1c03f67dc6f3cdaf0906259771859f7) | |||
## [v1.0.2](https://github.com/ljharb/call-bound/compare/v1.0.1...v1.0.2) - 2024-12-10 | |||
### Commits | |||
- [Dev Deps] update `@arethetypeswrong/cli`, `@ljharb/tsconfig`, `gopd` [`e6a5ffe`](https://github.com/ljharb/call-bound/commit/e6a5ffe849368fe4f74dfd6cdeca1b9baa39e8d5) | |||
- [Deps] update `call-bind`, `get-intrinsic` [`2aeb5b5`](https://github.com/ljharb/call-bound/commit/2aeb5b521dc2b2683d1345c753ea1161de2d1c14) | |||
- [types] improve return type [`1a0c9fe`](https://github.com/ljharb/call-bound/commit/1a0c9fe3114471e7ca1f57d104e2efe713bb4871) | |||
## v1.0.1 - 2024-12-05 | |||
### Commits | |||
- Initial implementation, tests, readme, types [`6d94121`](https://github.com/ljharb/call-bound/commit/6d94121a9243602e506334069f7a03189fe3363d) | |||
- Initial commit [`0eae867`](https://github.com/ljharb/call-bound/commit/0eae867334ea025c33e6e91cdecfc9df96680cf9) | |||
- npm init [`71b2479`](https://github.com/ljharb/call-bound/commit/71b2479c6723e0b7d91a6b663613067e98b7b275) | |||
- Only apps should have lockfiles [`c3754a9`](https://github.com/ljharb/call-bound/commit/c3754a949b7f9132b47e2d18c1729889736741eb) | |||
- [actions] skip `npm ls` in node < 10 [`74275a5`](https://github.com/ljharb/call-bound/commit/74275a5186b8caf6309b6b97472bdcb0df4683a8) | |||
- [Dev Deps] add missing peer dep [`1354de8`](https://github.com/ljharb/call-bound/commit/1354de8679413e4ae9c523d85f76fa7a5e032d97) |
@ -0,0 +1,21 @@ | |||
MIT License | |||
Copyright (c) 2024 Jordan Harband | |||
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. |
@ -0,0 +1,53 @@ | |||
# call-bound <sup>[![Version Badge][npm-version-svg]][package-url]</sup> | |||
[![github actions][actions-image]][actions-url] | |||
[![coverage][codecov-image]][codecov-url] | |||
[![dependency status][deps-svg]][deps-url] | |||
[![dev dependency status][dev-deps-svg]][dev-deps-url] | |||
[![License][license-image]][license-url] | |||
[![Downloads][downloads-image]][downloads-url] | |||
[![npm badge][npm-badge-png]][package-url] | |||
Robust call-bound JavaScript intrinsics, using `call-bind` and `get-intrinsic`. | |||
## Getting started | |||
```sh | |||
npm install --save call-bound | |||
``` | |||
## Usage/Examples | |||
```js | |||
const assert = require('assert'); | |||
const callBound = require('call-bound'); | |||
const slice = callBound('Array.prototype.slice'); | |||
delete Function.prototype.call; | |||
delete Function.prototype.bind; | |||
delete Array.prototype.slice; | |||
assert.deepEqual(slice([1, 2, 3, 4], 1, -1), [2, 3]); | |||
``` | |||
## Tests | |||
Clone the repo, `npm install`, and run `npm test` | |||
[package-url]: https://npmjs.org/package/call-bound | |||
[npm-version-svg]: https://versionbadg.es/ljharb/call-bound.svg | |||
[deps-svg]: https://david-dm.org/ljharb/call-bound.svg | |||
[deps-url]: https://david-dm.org/ljharb/call-bound | |||
[dev-deps-svg]: https://david-dm.org/ljharb/call-bound/dev-status.svg | |||
[dev-deps-url]: https://david-dm.org/ljharb/call-bound#info=devDependencies | |||
[npm-badge-png]: https://nodei.co/npm/call-bound.png?downloads=true&stars=true | |||
[license-image]: https://img.shields.io/npm/l/call-bound.svg | |||
[license-url]: LICENSE | |||
[downloads-image]: https://img.shields.io/npm/dm/call-bound.svg | |||
[downloads-url]: https://npm-stat.com/charts.html?package=call-bound | |||
[codecov-image]: https://codecov.io/gh/ljharb/call-bound/branch/main/graphs/badge.svg | |||
[codecov-url]: https://app.codecov.io/gh/ljharb/call-bound/ | |||
[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/ljharb/call-bound | |||
[actions-url]: https://github.com/ljharb/call-bound/actions |
@ -0,0 +1,13 @@ | |||
import callBind from 'call-bind-apply-helpers'; | |||
declare function callBoundIntrinsic( | |||
name: string, | |||
allowMissing?: false | |||
): ReturnType<typeof callBind>; | |||
declare function callBoundIntrinsic( | |||
name: string, | |||
allowMissing: true | |||
): undefined | ReturnType<typeof callBind>; | |||
export = callBoundIntrinsic; |
@ -0,0 +1,18 @@ | |||
'use strict'; | |||
var GetIntrinsic = require('get-intrinsic'); | |||
var callBindBasic = require('call-bind-apply-helpers'); | |||
/** @type {(thisArg: string, searchString: string, position?: number) => number} */ | |||
var $indexOf = callBindBasic([GetIntrinsic('%String.prototype.indexOf%')]); | |||
/** @type {import('.')} */ | |||
module.exports = function callBoundIntrinsic(name, allowMissing) { | |||
// eslint-disable-next-line no-extra-parens | |||
var intrinsic = /** @type {Parameters<typeof callBindBasic>[0][0]} */ (GetIntrinsic(name, !!allowMissing)); | |||
if (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) { | |||
return callBindBasic([intrinsic]); | |||
} | |||
return intrinsic; | |||
}; |
@ -0,0 +1,99 @@ | |||
{ | |||
"name": "call-bound", | |||
"version": "1.0.3", | |||
"description": "Robust call-bound JavaScript intrinsics, using `call-bind` and `get-intrinsic`.", | |||
"main": "index.js", | |||
"exports": { | |||
".": "./index.js", | |||
"./package.json": "./package.json" | |||
}, | |||
"sideEffects": false, | |||
"scripts": { | |||
"prepack": "npmignore --auto --commentLines=auto", | |||
"prepublish": "not-in-publish || npm run prepublishOnly", | |||
"prepublishOnly": "safe-publish-latest", | |||
"prelint": "evalmd README.md", | |||
"lint": "eslint --ext=.js,.mjs .", | |||
"postlint": "tsc -p . && attw -P", | |||
"pretest": "npm run lint", | |||
"tests-only": "nyc tape 'test/**/*.js'", | |||
"test": "npm run tests-only", | |||
"posttest": "npx npm@'>=10.2' audit --production", | |||
"version": "auto-changelog && git add CHANGELOG.md", | |||
"postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"" | |||
}, | |||
"repository": { | |||
"type": "git", | |||
"url": "git+https://github.com/ljharb/call-bound.git" | |||
}, | |||
"keywords": [ | |||
"javascript", | |||
"ecmascript", | |||
"es", | |||
"js", | |||
"callbind", | |||
"callbound", | |||
"call", | |||
"bind", | |||
"bound", | |||
"call-bind", | |||
"call-bound", | |||
"function", | |||
"es-abstract" | |||
], | |||
"author": "Jordan Harband <ljharb@gmail.com>", | |||
"funding": { | |||
"url": "https://github.com/sponsors/ljharb" | |||
}, | |||
"license": "MIT", | |||
"bugs": { | |||
"url": "https://github.com/ljharb/call-bound/issues" | |||
}, | |||
"homepage": "https://github.com/ljharb/call-bound#readme", | |||
"dependencies": { | |||
"call-bind-apply-helpers": "^1.0.1", | |||
"get-intrinsic": "^1.2.6" | |||
}, | |||
"devDependencies": { | |||
"@arethetypeswrong/cli": "^0.17.1", | |||
"@ljharb/eslint-config": "^21.1.1", | |||
"@ljharb/tsconfig": "^0.2.2", | |||
"@types/call-bind": "^1.0.5", | |||
"@types/get-intrinsic": "^1.2.3", | |||
"@types/tape": "^5.6.5", | |||
"auto-changelog": "^2.5.0", | |||
"encoding": "^0.1.13", | |||
"es-value-fixtures": "^1.5.0", | |||
"eslint": "=8.8.0", | |||
"evalmd": "^0.0.19", | |||
"for-each": "^0.3.3", | |||
"gopd": "^1.2.0", | |||
"has-strict-mode": "^1.0.1", | |||
"in-publish": "^2.0.1", | |||
"npmignore": "^0.3.1", | |||
"nyc": "^10.3.2", | |||
"object-inspect": "^1.13.3", | |||
"safe-publish-latest": "^2.0.0", | |||
"tape": "^5.9.0", | |||
"typescript": "next" | |||
}, | |||
"testling": { | |||
"files": "test/index.js" | |||
}, | |||
"auto-changelog": { | |||
"output": "CHANGELOG.md", | |||
"template": "keepachangelog", | |||
"unreleased": false, | |||
"commitLimit": false, | |||
"backfillLimit": false, | |||
"hideCredit": true | |||
}, | |||
"publishConfig": { | |||
"ignore": [ | |||
".github/workflows" | |||
] | |||
}, | |||
"engines": { | |||
"node": ">= 0.4" | |||
} | |||
} |
@ -0,0 +1,54 @@ | |||
'use strict'; | |||
var test = require('tape'); | |||
var callBound = require('../'); | |||
test('callBound', function (t) { | |||
// static primitive | |||
t.equal(callBound('Array.length'), Array.length, 'Array.length yields itself'); | |||
t.equal(callBound('%Array.length%'), Array.length, '%Array.length% yields itself'); | |||
// static non-function object | |||
t.equal(callBound('Array.prototype'), Array.prototype, 'Array.prototype yields itself'); | |||
t.equal(callBound('%Array.prototype%'), Array.prototype, '%Array.prototype% yields itself'); | |||
t.equal(callBound('Array.constructor'), Array.constructor, 'Array.constructor yields itself'); | |||
t.equal(callBound('%Array.constructor%'), Array.constructor, '%Array.constructor% yields itself'); | |||
// static function | |||
t.equal(callBound('Date.parse'), Date.parse, 'Date.parse yields itself'); | |||
t.equal(callBound('%Date.parse%'), Date.parse, '%Date.parse% yields itself'); | |||
// prototype primitive | |||
t.equal(callBound('Error.prototype.message'), Error.prototype.message, 'Error.prototype.message yields itself'); | |||
t.equal(callBound('%Error.prototype.message%'), Error.prototype.message, '%Error.prototype.message% yields itself'); | |||
// prototype function | |||
t.notEqual(callBound('Object.prototype.toString'), Object.prototype.toString, 'Object.prototype.toString does not yield itself'); | |||
t.notEqual(callBound('%Object.prototype.toString%'), Object.prototype.toString, '%Object.prototype.toString% does not yield itself'); | |||
t.equal(callBound('Object.prototype.toString')(true), Object.prototype.toString.call(true), 'call-bound Object.prototype.toString calls into the original'); | |||
t.equal(callBound('%Object.prototype.toString%')(true), Object.prototype.toString.call(true), 'call-bound %Object.prototype.toString% calls into the original'); | |||
t['throws']( | |||
function () { callBound('does not exist'); }, | |||
SyntaxError, | |||
'nonexistent intrinsic throws' | |||
); | |||
t['throws']( | |||
function () { callBound('does not exist', true); }, | |||
SyntaxError, | |||
'allowMissing arg still throws for unknown intrinsic' | |||
); | |||
t.test('real but absent intrinsic', { skip: typeof WeakRef !== 'undefined' }, function (st) { | |||
st['throws']( | |||
function () { callBound('WeakRef'); }, | |||
TypeError, | |||
'real but absent intrinsic throws' | |||
); | |||
st.equal(callBound('WeakRef', true), undefined, 'allowMissing arg avoids exception'); | |||
st.end(); | |||
}); | |||
t.end(); | |||
}); |
@ -0,0 +1,9 @@ | |||
{ | |||
"extends": "@ljharb/tsconfig", | |||
"compilerOptions": { | |||
"target": "es2021", | |||
}, | |||
"exclude": [ | |||
"coverage", | |||
], | |||
} |
@ -0,0 +1 @@ | |||
../../../which/bin/node-which |
@ -0,0 +1 @@ | |||
../../../os-name/cli.js |
@ -0,0 +1,5 @@ | |||
{ | |||
"root": true, | |||
"extends": "@ljharb", | |||
} |
@ -0,0 +1,12 @@ | |||
# These are supported funding model platforms | |||
github: [ljharb] | |||
patreon: # Replace with a single Patreon username | |||
open_collective: # Replace with a single Open Collective username | |||
ko_fi: # Replace with a single Ko-fi username | |||
tidelift: npm/dunder-proto | |||
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry | |||
liberapay: # Replace with a single Liberapay username | |||
issuehunt: # Replace with a single IssueHunt username | |||
otechie: # Replace with a single Otechie username | |||
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] |
@ -0,0 +1,13 @@ | |||
{ | |||
"all": true, | |||
"check-coverage": false, | |||
"reporter": ["text-summary", "text", "html", "json"], | |||
"lines": 86, | |||
"statements": 85.93, | |||
"functions": 82.43, | |||
"branches": 76.06, | |||
"exclude": [ | |||
"coverage", | |||
"test" | |||
] | |||
} |
@ -0,0 +1,24 @@ | |||
# Changelog | |||
All notable changes to this project will be documented in this file. | |||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) | |||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). | |||
## [v1.0.1](https://github.com/es-shims/dunder-proto/compare/v1.0.0...v1.0.1) - 2024-12-16 | |||
### Commits | |||
- [Fix] do not crash when `--disable-proto=throw` [`6c367d9`](https://github.com/es-shims/dunder-proto/commit/6c367d919bc1604778689a297bbdbfea65752847) | |||
- [Tests] ensure noproto tests only use the current version of dunder-proto [`b02365b`](https://github.com/es-shims/dunder-proto/commit/b02365b9cf889c4a2cac7be0c3cfc90a789af36c) | |||
- [Dev Deps] update `@arethetypeswrong/cli`, `@types/tape` [`e3c5c3b`](https://github.com/es-shims/dunder-proto/commit/e3c5c3bd81cf8cef7dff2eca19e558f0e307f666) | |||
- [Deps] update `call-bind-apply-helpers` [`19f1da0`](https://github.com/es-shims/dunder-proto/commit/19f1da028b8dd0d05c85bfd8f7eed2819b686450) | |||
## v1.0.0 - 2024-12-06 | |||
### Commits | |||
- Initial implementation, tests, readme, types [`a5b74b0`](https://github.com/es-shims/dunder-proto/commit/a5b74b0082f5270cb0905cd9a2e533cee7498373) | |||
- Initial commit [`73fb5a3`](https://github.com/es-shims/dunder-proto/commit/73fb5a353b51ac2ab00c9fdeb0114daffd4c07a8) | |||
- npm init [`80152dc`](https://github.com/es-shims/dunder-proto/commit/80152dc98155da4eb046d9f67a87ed96e8280a1d) | |||
- Only apps should have lockfiles [`03e6660`](https://github.com/es-shims/dunder-proto/commit/03e6660a1d70dc401f3e217a031475ec537243dd) |
@ -0,0 +1,21 @@ | |||
MIT License | |||
Copyright (c) 2024 ECMAScript Shims | |||
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. |
@ -0,0 +1,54 @@ | |||
# dunder-proto <sup>[![Version Badge][npm-version-svg]][package-url]</sup> | |||
[![github actions][actions-image]][actions-url] | |||
[![coverage][codecov-image]][codecov-url] | |||
[![License][license-image]][license-url] | |||
[![Downloads][downloads-image]][downloads-url] | |||
[![npm badge][npm-badge-png]][package-url] | |||
If available, the `Object.prototype.__proto__` accessor and mutator, call-bound. | |||
## Getting started | |||
```sh | |||
npm install --save dunder-proto | |||
``` | |||
## Usage/Examples | |||
```js | |||
const assert = require('assert'); | |||
const getDunder = require('dunder-proto/get'); | |||
const setDunder = require('dunder-proto/set'); | |||
const obj = {}; | |||
assert.equal('toString' in obj, true); | |||
assert.equal(getDunder(obj), Object.prototype); | |||
setDunder(obj, null); | |||
assert.equal('toString' in obj, false); | |||
assert.equal(getDunder(obj), null); | |||
``` | |||
## Tests | |||
Clone the repo, `npm install`, and run `npm test` | |||
[package-url]: https://npmjs.org/package/dunder-proto | |||
[npm-version-svg]: https://versionbadg.es/es-shims/dunder-proto.svg | |||
[deps-svg]: https://david-dm.org/es-shims/dunder-proto.svg | |||
[deps-url]: https://david-dm.org/es-shims/dunder-proto | |||
[dev-deps-svg]: https://david-dm.org/es-shims/dunder-proto/dev-status.svg | |||
[dev-deps-url]: https://david-dm.org/es-shims/dunder-proto#info=devDependencies | |||
[npm-badge-png]: https://nodei.co/npm/dunder-proto.png?downloads=true&stars=true | |||
[license-image]: https://img.shields.io/npm/l/dunder-proto.svg | |||
[license-url]: LICENSE | |||
[downloads-image]: https://img.shields.io/npm/dm/dunder-proto.svg | |||
[downloads-url]: https://npm-stat.com/charts.html?package=dunder-proto | |||
[codecov-image]: https://codecov.io/gh/es-shims/dunder-proto/branch/main/graphs/badge.svg | |||
[codecov-url]: https://app.codecov.io/gh/es-shims/dunder-proto/ | |||
[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/es-shims/dunder-proto | |||
[actions-url]: https://github.com/es-shims/dunder-proto/actions |
@ -0,0 +1,5 @@ | |||
declare function getDunderProto(target: {}): object | null; | |||
declare const x: false | typeof getDunderProto; | |||
export = x; |
@ -0,0 +1,30 @@ | |||
'use strict'; | |||
var callBind = require('call-bind-apply-helpers'); | |||
var gOPD = require('gopd'); | |||
var hasProtoAccessor; | |||
try { | |||
// eslint-disable-next-line no-extra-parens, no-proto | |||
hasProtoAccessor = /** @type {{ __proto__?: typeof Array.prototype }} */ ([]).__proto__ === Array.prototype; | |||
} catch (e) { | |||
if (!e || typeof e !== 'object' || !('code' in e) || e.code !== 'ERR_PROTO_ACCESS') { | |||
throw e; | |||
} | |||
} | |||
// eslint-disable-next-line no-extra-parens | |||
var desc = !!hasProtoAccessor && gOPD && gOPD(Object.prototype, /** @type {keyof typeof Object.prototype} */ ('__proto__')); | |||
var $Object = Object; | |||
var $getPrototypeOf = $Object.getPrototypeOf; | |||
/** @type {import('./get')} */ | |||
module.exports = desc && typeof desc.get === 'function' | |||
? callBind([desc.get]) | |||
: typeof $getPrototypeOf === 'function' | |||
? /** @type {import('./get')} */ function getDunder(value) { | |||
// eslint-disable-next-line eqeqeq | |||
return $getPrototypeOf(value == null ? value : $Object(value)); | |||
} | |||
: false; |
@ -0,0 +1,76 @@ | |||
{ | |||
"name": "dunder-proto", | |||
"version": "1.0.1", | |||
"description": "If available, the `Object.prototype.__proto__` accessor and mutator, call-bound", | |||
"main": false, | |||
"exports": { | |||
"./get": "./get.js", | |||
"./set": "./set.js", | |||
"./package.json": "./package.json" | |||
}, | |||
"sideEffects": false, | |||
"scripts": { | |||
"prepack": "npmignore --auto --commentLines=autogenerated", | |||
"prepublish": "not-in-publish || npm run prepublishOnly", | |||
"prepublishOnly": "safe-publish-latest", | |||
"prelint": "evalmd README.md", | |||
"lint": "eslint --ext=.js,.mjs .", | |||
"postlint": "tsc -p . && attw -P", | |||
"pretest": "npm run lint", | |||
"tests-only": "nyc tape 'test/**/*.js'", | |||
"test": "npm run tests-only", | |||
"posttest": "npx npm@'>= 10.2' audit --production", | |||
"version": "auto-changelog && git add CHANGELOG.md", | |||
"postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"" | |||
}, | |||
"repository": { | |||
"type": "git", | |||
"url": "git+https://github.com/es-shims/dunder-proto.git" | |||
}, | |||
"author": "Jordan Harband <ljharb@gmail.com>", | |||
"license": "MIT", | |||
"bugs": { | |||
"url": "https://github.com/es-shims/dunder-proto/issues" | |||
}, | |||
"homepage": "https://github.com/es-shims/dunder-proto#readme", | |||
"dependencies": { | |||
"call-bind-apply-helpers": "^1.0.1", | |||
"es-errors": "^1.3.0", | |||
"gopd": "^1.2.0" | |||
}, | |||
"devDependencies": { | |||
"@arethetypeswrong/cli": "^0.17.1", | |||
"@ljharb/eslint-config": "^21.1.1", | |||
"@ljharb/tsconfig": "^0.2.2", | |||
"@types/tape": "^5.7.0", | |||
"auto-changelog": "^2.5.0", | |||
"encoding": "^0.1.13", | |||
"eslint": "=8.8.0", | |||
"evalmd": "^0.0.19", | |||
"in-publish": "^2.0.1", | |||
"npmignore": "^0.3.1", | |||
"nyc": "^10.3.2", | |||
"safe-publish-latest": "^2.0.0", | |||
"tape": "^5.9.0", | |||
"typescript": "next" | |||
}, | |||
"auto-changelog": { | |||
"output": "CHANGELOG.md", | |||
"template": "keepachangelog", | |||
"unreleased": false, | |||
"commitLimit": false, | |||
"backfillLimit": false, | |||
"hideCredit": true | |||
}, | |||
"testling": { | |||
"files": "test/index.js" | |||
}, | |||
"publishConfig": { | |||
"ignore": [ | |||
".github/workflows" | |||
] | |||
}, | |||
"engines": { | |||
"node": ">= 0.4" | |||
} | |||
} |
@ -0,0 +1,5 @@ | |||
declare function setDunderProto<P extends null | object>(target: {}, proto: P): P; | |||
declare const x: false | typeof setDunderProto; | |||
export = x; |
@ -0,0 +1,35 @@ | |||
'use strict'; | |||
var callBind = require('call-bind-apply-helpers'); | |||
var gOPD = require('gopd'); | |||
var $TypeError = require('es-errors/type'); | |||
/** @type {{ __proto__?: object | null }} */ | |||
var obj = {}; | |||
try { | |||
obj.__proto__ = null; // eslint-disable-line no-proto | |||
} catch (e) { | |||
if (!e || typeof e !== 'object' || !('code' in e) || e.code !== 'ERR_PROTO_ACCESS') { | |||
throw e; | |||
} | |||
} | |||
var hasProtoMutator = !('toString' in obj); | |||
// eslint-disable-next-line no-extra-parens | |||
var desc = gOPD && gOPD(Object.prototype, /** @type {keyof typeof Object.prototype} */ ('__proto__')); | |||
/** @type {import('./set')} */ | |||
module.exports = hasProtoMutator && ( | |||
// eslint-disable-next-line no-extra-parens | |||
(!!desc && typeof desc.set === 'function' && /** @type {import('./set')} */ (callBind([desc.set]))) | |||
|| /** @type {import('./set')} */ function setDunder(object, proto) { | |||
// this is node v0.10 or older, which doesn't have Object.setPrototypeOf and has undeniable __proto__ | |||
if (object == null) { // eslint-disable-line eqeqeq | |||
throw new $TypeError('set Object.prototype.__proto__ called on null or undefined'); | |||
} | |||
// eslint-disable-next-line no-proto, no-param-reassign, no-extra-parens | |||
/** @type {{ __proto__?: object | null }} */ (object).__proto__ = proto; | |||
return proto; | |||
} | |||
); |
@ -0,0 +1,34 @@ | |||
'use strict'; | |||
var test = require('tape'); | |||
var getDunderProto = require('../get'); | |||
test('getDunderProto', { skip: !getDunderProto }, function (t) { | |||
if (!getDunderProto) { | |||
throw 'should never happen; this is just for type narrowing'; // eslint-disable-line no-throw-literal | |||
} | |||
// @ts-expect-error | |||
t['throws'](function () { getDunderProto(); }, TypeError, 'throws if no argument'); | |||
// @ts-expect-error | |||
t['throws'](function () { getDunderProto(undefined); }, TypeError, 'throws with undefined'); | |||
// @ts-expect-error | |||
t['throws'](function () { getDunderProto(null); }, TypeError, 'throws with null'); | |||
t.equal(getDunderProto({}), Object.prototype); | |||
t.equal(getDunderProto([]), Array.prototype); | |||
t.equal(getDunderProto(function () {}), Function.prototype); | |||
t.equal(getDunderProto(/./g), RegExp.prototype); | |||
t.equal(getDunderProto(42), Number.prototype); | |||
t.equal(getDunderProto(true), Boolean.prototype); | |||
t.equal(getDunderProto('foo'), String.prototype); | |||
t.end(); | |||
}); | |||
test('no dunder proto', { skip: !!getDunderProto }, function (t) { | |||
t.notOk('__proto__' in Object.prototype, 'no __proto__ in Object.prototype'); | |||
t.end(); | |||
}); |
@ -0,0 +1,4 @@ | |||
'use strict'; | |||
require('./get'); | |||
require('./set'); |
@ -0,0 +1,50 @@ | |||
'use strict'; | |||
var test = require('tape'); | |||
var setDunderProto = require('../set'); | |||
test('setDunderProto', { skip: !setDunderProto }, function (t) { | |||
if (!setDunderProto) { | |||
throw 'should never happen; this is just for type narrowing'; // eslint-disable-line no-throw-literal | |||
} | |||
// @ts-expect-error | |||
t['throws'](function () { setDunderProto(); }, TypeError, 'throws if no arguments'); | |||
// @ts-expect-error | |||
t['throws'](function () { setDunderProto(undefined); }, TypeError, 'throws with undefined and nothing'); | |||
// @ts-expect-error | |||
t['throws'](function () { setDunderProto(undefined, undefined); }, TypeError, 'throws with undefined and undefined'); | |||
// @ts-expect-error | |||
t['throws'](function () { setDunderProto(null); }, TypeError, 'throws with null and undefined'); | |||
// @ts-expect-error | |||
t['throws'](function () { setDunderProto(null, undefined); }, TypeError, 'throws with null and undefined'); | |||
/** @type {{ inherited?: boolean }} */ | |||
var obj = {}; | |||
t.ok('toString' in obj, 'object initially has toString'); | |||
setDunderProto(obj, null); | |||
t.notOk('toString' in obj, 'object no longer has toString'); | |||
t.notOk('inherited' in obj, 'object lacks inherited property'); | |||
setDunderProto(obj, { inherited: true }); | |||
t.equal(obj.inherited, true, 'object has inherited property'); | |||
t.end(); | |||
}); | |||
test('no dunder proto', { skip: !!setDunderProto }, function (t) { | |||
if ('__proto__' in Object.prototype) { | |||
t['throws']( | |||
// @ts-expect-error | |||
function () { ({}).__proto__ = null; }, // eslint-disable-line no-proto | |||
Error, | |||
'throws when setting Object.prototype.__proto__' | |||
); | |||
} else { | |||
t.notOk('__proto__' in Object.prototype, 'no __proto__ in Object.prototype'); | |||
} | |||
t.end(); | |||
}); |
@ -0,0 +1,9 @@ | |||
{ | |||
"extends": "@ljharb/tsconfig", | |||
"compilerOptions": { | |||
"target": "ES2021", | |||
}, | |||
"exclude": [ | |||
"coverage", | |||
], | |||
} |
@ -0,0 +1,3 @@ | |||
declare function isObject(x: unknown): x is object; | |||
export = isObject; |
@ -0,0 +1,6 @@ | |||
'use strict'; | |||
/** @type {import('./isObject')} */ | |||
module.exports = function isObject(x) { | |||
return !!x && (typeof x === 'function' || typeof x === 'object'); | |||
}; |
@ -0,0 +1 @@ | |||
../../../eslint/bin/eslint.js |
@ -1,15 +1 @@ | |||
#!/bin/sh | |||
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") | |||
case `uname` in | |||
*CYGWIN*) basedir=`cygpath -w "$basedir"`;; | |||
esac | |||
if [ -x "$basedir/node" ]; then | |||
"$basedir/node" "$basedir/../../../semver/bin/semver.js" "$@" | |||
ret=$? | |||
else | |||
node "$basedir/../../../semver/bin/semver.js" "$@" | |||
ret=$? | |||
fi | |||
exit $ret | |||
../../../semver/bin/semver.js |
@ -0,0 +1 @@ | |||
../../../eslint/bin/eslint.js |
@ -0,0 +1 @@ | |||
../../../js-yaml/bin/js-yaml.js |
@ -0,0 +1 @@ | |||
../../../acorn/bin/acorn |
@ -0,0 +1,15 @@ | |||
# Security Policy | |||
## Supported Versions | |||
Use this section to tell people about which versions of your project are | |||
currently being supported with security updates. | |||
| Version | Supported | | |||
| ------- | ------------------ | | |||
| 1.x | :white_check_mark: | | |||
| < 1.0 | :x: | | |||
## Reporting a Vulnerability | |||
Please report all vulnerabilities at [https://github.com/mcollina/fastq/security](https://github.com/mcollina/fastq/security). |
@ -0,0 +1 @@ | |||
../../../rimraf/bin.js |
@ -0,0 +1 @@ | |||
../../../mime/cli.js |
@ -0,0 +1,10 @@ | |||
{ | |||
"root": true, | |||
"extends": "@ljharb", | |||
"rules": { | |||
"id-length": "off", | |||
"sort-keys": "off", | |||
}, | |||
} |
@ -0,0 +1,12 @@ | |||
# These are supported funding model platforms | |||
github: [ljharb] | |||
patreon: # Replace with a single Patreon username | |||
open_collective: # Replace with a single Open Collective username | |||
ko_fi: # Replace with a single Ko-fi username | |||
tidelift: npm/get-proto | |||
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry | |||
liberapay: # Replace with a single Liberapay username | |||
issuehunt: # Replace with a single IssueHunt username | |||
otechie: # Replace with a single Otechie username | |||
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] |
@ -0,0 +1,9 @@ | |||
{ | |||
"all": true, | |||
"check-coverage": false, | |||
"reporter": ["text-summary", "text", "html", "json"], | |||
"exclude": [ | |||
"coverage", | |||
"test" | |||
] | |||
} |
@ -0,0 +1,21 @@ | |||
# Changelog | |||
All notable changes to this project will be documented in this file. | |||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) | |||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). | |||
## [v1.0.1](https://github.com/ljharb/get-proto/compare/v1.0.0...v1.0.1) - 2025-01-02 | |||
### Commits | |||
- [Fix] for the `Object.getPrototypeOf` window, throw for non-objects [`7fe6508`](https://github.com/ljharb/get-proto/commit/7fe6508b71419ebe1976bedb86001d1feaeaa49a) | |||
## v1.0.0 - 2025-01-01 | |||
### Commits | |||
- Initial implementation, tests, readme, types [`5c70775`](https://github.com/ljharb/get-proto/commit/5c707751e81c3deeb2cf980d185fc7fd43611415) | |||
- Initial commit [`7c65c2a`](https://github.com/ljharb/get-proto/commit/7c65c2ad4e33d5dae2f219ebe1a046ae2256972c) | |||
- npm init [`0b8cf82`](https://github.com/ljharb/get-proto/commit/0b8cf824c9634e4a34ef7dd2a2cdc5be6ac79518) | |||
- Only apps should have lockfiles [`a6d1bff`](https://github.com/ljharb/get-proto/commit/a6d1bffc364f5828377cea7194558b2dbef7aea2) |
@ -0,0 +1,21 @@ | |||
MIT License | |||
Copyright (c) 2025 Jordan Harband | |||
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. |
@ -0,0 +1,5 @@ | |||
declare function getProto<O extends object>(object: O): object | null; | |||
declare const x: typeof getProto | null; | |||
export = x; |
@ -0,0 +1,6 @@ | |||
'use strict'; | |||
var $Object = require('es-object-atoms'); | |||
/** @type {import('./Object.getPrototypeOf')} */ | |||
module.exports = $Object.getPrototypeOf || null; |
@ -0,0 +1,50 @@ | |||
# get-proto <sup>[![Version Badge][npm-version-svg]][package-url]</sup> | |||
[![github actions][actions-image]][actions-url] | |||
[![coverage][codecov-image]][codecov-url] | |||
[![License][license-image]][license-url] | |||
[![Downloads][downloads-image]][downloads-url] | |||
[![npm badge][npm-badge-png]][package-url] | |||
Robustly get the [[Prototype]] of an object. Uses the best available method. | |||
## Getting started | |||
```sh | |||
npm install --save get-proto | |||
``` | |||
## Usage/Examples | |||
```js | |||
const assert = require('assert'); | |||
const getProto = require('get-proto'); | |||
const a = { a: 1, b: 2, [Symbol.toStringTag]: 'foo' }; | |||
const b = { c: 3, __proto__: a }; | |||
assert.equal(getProto(b), a); | |||
assert.equal(getProto(a), Object.prototype); | |||
assert.equal(getProto({ __proto__: null }), null); | |||
``` | |||
## Tests | |||
Clone the repo, `npm install`, and run `npm test` | |||
[package-url]: https://npmjs.org/package/get-proto | |||
[npm-version-svg]: https://versionbadg.es/ljharb/get-proto.svg | |||
[deps-svg]: https://david-dm.org/ljharb/get-proto.svg | |||
[deps-url]: https://david-dm.org/ljharb/get-proto | |||
[dev-deps-svg]: https://david-dm.org/ljharb/get-proto/dev-status.svg | |||
[dev-deps-url]: https://david-dm.org/ljharb/get-proto#info=devDependencies | |||
[npm-badge-png]: https://nodei.co/npm/get-proto.png?downloads=true&stars=true | |||
[license-image]: https://img.shields.io/npm/l/get-proto.svg | |||
[license-url]: LICENSE | |||
[downloads-image]: https://img.shields.io/npm/dm/get-proto.svg | |||
[downloads-url]: https://npm-stat.com/charts.html?package=get-proto | |||
[codecov-image]: https://codecov.io/gh/ljharb/get-proto/branch/main/graphs/badge.svg | |||
[codecov-url]: https://app.codecov.io/gh/ljharb/get-proto/ | |||
[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/ljharb/get-proto | |||
[actions-url]: https://github.com/ljharb/get-proto/actions |
@ -0,0 +1,3 @@ | |||
declare const x: typeof Reflect.getPrototypeOf | null; | |||
export = x; |
@ -0,0 +1,4 @@ | |||
'use strict'; | |||
/** @type {import('./Reflect.getPrototypeOf')} */ | |||
module.exports = (typeof Reflect !== 'undefined' && Reflect.getPrototypeOf) || null; |
@ -0,0 +1,5 @@ | |||
declare function getProto<O extends object>(object: O): object | null; | |||
declare const x: typeof getProto | null; | |||
export = x; |
@ -0,0 +1,27 @@ | |||
'use strict'; | |||
var reflectGetProto = require('./Reflect.getPrototypeOf'); | |||
var originalGetProto = require('./Object.getPrototypeOf'); | |||
var getDunderProto = require('dunder-proto/get'); | |||
/** @type {import('.')} */ | |||
module.exports = reflectGetProto | |||
? function getProto(O) { | |||
// @ts-expect-error TS can't narrow inside a closure, for some reason | |||
return reflectGetProto(O); | |||
} | |||
: originalGetProto | |||
? function getProto(O) { | |||
if (!O || (typeof O !== 'object' && typeof O !== 'function')) { | |||
throw new TypeError('getProto: not an object'); | |||
} | |||
// @ts-expect-error TS can't narrow inside a closure, for some reason | |||
return originalGetProto(O); | |||
} | |||
: getDunderProto | |||
? function getProto(O) { | |||
// @ts-expect-error TS can't narrow inside a closure, for some reason | |||
return getDunderProto(O); | |||
} | |||
: null; |
@ -0,0 +1,81 @@ | |||
{ | |||
"name": "get-proto", | |||
"version": "1.0.1", | |||
"description": "Robustly get the [[Prototype]] of an object", | |||
"main": "index.js", | |||
"exports": { | |||
".": "./index.js", | |||
"./Reflect.getPrototypeOf": "./Reflect.getPrototypeOf.js", | |||
"./Object.getPrototypeOf": "./Object.getPrototypeOf.js", | |||
"./package.json": "./package.json" | |||
}, | |||
"scripts": { | |||
"prepack": "npmignore --auto --commentLines=autogenerated", | |||
"prepublish": "not-in-publish || npm run prepublishOnly", | |||
"prepublishOnly": "safe-publish-latest", | |||
"pretest": "npm run --silent lint", | |||
"test": "npm run tests-only", | |||
"posttest": "npx npm@\">=10.2\" audit --production", | |||
"tests-only": "nyc tape 'test/**/*.js'", | |||
"prelint": "evalmd README.md", | |||
"lint": "eslint --ext=js,mjs .", | |||
"postlint": "tsc && attw -P", | |||
"version": "auto-changelog && git add CHANGELOG.md", | |||
"postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"" | |||
}, | |||
"repository": { | |||
"type": "git", | |||
"url": "git+https://github.com/ljharb/get-proto.git" | |||
}, | |||
"keywords": [ | |||
"get", | |||
"proto", | |||
"prototype", | |||
"getPrototypeOf", | |||
"[[Prototype]]" | |||
], | |||
"author": "Jordan Harband <ljharb@gmail.com>", | |||
"license": "MIT", | |||
"bugs": { | |||
"url": "https://github.com/ljharb/get-proto/issues" | |||
}, | |||
"homepage": "https://github.com/ljharb/get-proto#readme", | |||
"dependencies": { | |||
"dunder-proto": "^1.0.1", | |||
"es-object-atoms": "^1.0.0" | |||
}, | |||
"devDependencies": { | |||
"@arethetypeswrong/cli": "^0.17.2", | |||
"@ljharb/eslint-config": "^21.1.1", | |||
"@ljharb/tsconfig": "^0.2.3", | |||
"@types/tape": "^5.8.0", | |||
"auto-changelog": "^2.5.0", | |||
"eslint": "=8.8.0", | |||
"evalmd": "^0.0.19", | |||
"in-publish": "^2.0.1", | |||
"npmignore": "^0.3.1", | |||
"nyc": "^10.3.2", | |||
"safe-publish-latest": "^2.0.0", | |||
"tape": "^5.9.0", | |||
"typescript": "next" | |||
}, | |||
"engines": { | |||
"node": ">= 0.4" | |||
}, | |||
"auto-changelog": { | |||
"output": "CHANGELOG.md", | |||
"template": "keepachangelog", | |||
"unreleased": false, | |||
"commitLimit": false, | |||
"backfillLimit": false, | |||
"hideCredit": true | |||
}, | |||
"publishConfig": { | |||
"ignore": [ | |||
".github/workflows" | |||
] | |||
}, | |||
"testling": { | |||
"files": "test/index.js" | |||
} | |||
} |
@ -0,0 +1,68 @@ | |||
'use strict'; | |||
var test = require('tape'); | |||
var getProto = require('../'); | |||
test('getProto', function (t) { | |||
t.equal(typeof getProto, 'function', 'is a function'); | |||
t.test('can get', { skip: !getProto }, function (st) { | |||
if (getProto) { // TS doesn't understand tape's skip | |||
var proto = { b: 2 }; | |||
st.equal(getProto(proto), Object.prototype, 'proto: returns the [[Prototype]]'); | |||
st.test('nullish value', function (s2t) { | |||
// @ts-expect-error | |||
s2t['throws'](function () { return getProto(undefined); }, TypeError, 'undefined is not an object'); | |||
// @ts-expect-error | |||
s2t['throws'](function () { return getProto(null); }, TypeError, 'null is not an object'); | |||
s2t.end(); | |||
}); | |||
// @ts-expect-error | |||
st['throws'](function () { getProto(true); }, 'throws for true'); | |||
// @ts-expect-error | |||
st['throws'](function () { getProto(false); }, 'throws for false'); | |||
// @ts-expect-error | |||
st['throws'](function () { getProto(42); }, 'throws for 42'); | |||
// @ts-expect-error | |||
st['throws'](function () { getProto(NaN); }, 'throws for NaN'); | |||
// @ts-expect-error | |||
st['throws'](function () { getProto(0); }, 'throws for +0'); | |||
// @ts-expect-error | |||
st['throws'](function () { getProto(-0); }, 'throws for -0'); | |||
// @ts-expect-error | |||
st['throws'](function () { getProto(Infinity); }, 'throws for ∞'); | |||
// @ts-expect-error | |||
st['throws'](function () { getProto(-Infinity); }, 'throws for -∞'); | |||
// @ts-expect-error | |||
st['throws'](function () { getProto(''); }, 'throws for empty string'); | |||
// @ts-expect-error | |||
st['throws'](function () { getProto('foo'); }, 'throws for non-empty string'); | |||
st.equal(getProto(/a/g), RegExp.prototype); | |||
st.equal(getProto(new Date()), Date.prototype); | |||
st.equal(getProto(function () {}), Function.prototype); | |||
st.equal(getProto([]), Array.prototype); | |||
st.equal(getProto({}), Object.prototype); | |||
var nullObject = { __proto__: null }; | |||
if ('toString' in nullObject) { | |||
st.comment('no null objects in this engine'); | |||
st.equal(getProto(nullObject), Object.prototype, '"null" object has Object.prototype as [[Prototype]]'); | |||
} else { | |||
st.equal(getProto(nullObject), null, 'null object has null [[Prototype]]'); | |||
} | |||
} | |||
st.end(); | |||
}); | |||
t.test('can not get', { skip: !!getProto }, function (st) { | |||
st.equal(getProto, null); | |||
st.end(); | |||
}); | |||
t.end(); | |||
}); |
@ -0,0 +1,9 @@ | |||
{ | |||
"extends": "@ljharb/tsconfig", | |||
"compilerOptions": { | |||
//"target": "es2021", | |||
}, | |||
"exclude": [ | |||
"coverage", | |||
], | |||
} |
@ -0,0 +1 @@ | |||
export = Object.getOwnPropertyDescriptor; |