Deployed the page to Github Pages.
This commit is contained in:
parent
1d79754e93
commit
2c89899458
62797 changed files with 6551425 additions and 15279 deletions
20
node_modules/internal-slot/.editorconfig
generated
vendored
Normal file
20
node_modules/internal-slot/.editorconfig
generated
vendored
Normal file
|
@ -0,0 +1,20 @@
|
|||
root = true
|
||||
|
||||
[*]
|
||||
indent_style = tab
|
||||
indent_size = 4
|
||||
end_of_line = lf
|
||||
charset = utf-8
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
max_line_length = 150
|
||||
|
||||
[CHANGELOG.md]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
|
||||
[*.json]
|
||||
max_line_length = off
|
||||
|
||||
[Makefile]
|
||||
max_line_length = off
|
11
node_modules/internal-slot/.eslintrc
generated
vendored
Normal file
11
node_modules/internal-slot/.eslintrc
generated
vendored
Normal file
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
"root": true,
|
||||
|
||||
"extends": "@ljharb",
|
||||
|
||||
"rules": {
|
||||
"max-params": [2, 3],
|
||||
"new-cap": [2, { "capIsNewExceptions": ["GetIntrinsic"] }],
|
||||
"no-magic-numbers": 0,
|
||||
},
|
||||
}
|
12
node_modules/internal-slot/.github/FUNDING.yml
generated
vendored
Normal file
12
node_modules/internal-slot/.github/FUNDING.yml
generated
vendored
Normal file
|
@ -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/internal-slot
|
||||
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 a single custom sponsorship URL
|
9
node_modules/internal-slot/.nycrc
generated
vendored
Normal file
9
node_modules/internal-slot/.nycrc
generated
vendored
Normal file
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
"all": true,
|
||||
"check-coverage": false,
|
||||
"reporter": ["text-summary", "text", "html", "json"],
|
||||
"exclude": [
|
||||
"coverage",
|
||||
"test"
|
||||
]
|
||||
}
|
103
node_modules/internal-slot/CHANGELOG.md
generated
vendored
Normal file
103
node_modules/internal-slot/CHANGELOG.md
generated
vendored
Normal file
|
@ -0,0 +1,103 @@
|
|||
### Changelog
|
||||
|
||||
All notable changes to this project will be documented in this file. Dates are displayed in UTC.
|
||||
|
||||
Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
||||
|
||||
#### [v1.0.7](https://github.com/ljharb/internal-slot/compare/v1.0.6...v1.0.7)
|
||||
|
||||
> 5 February 2024
|
||||
|
||||
- [Dev Deps] update `aud`, `npmignore`, `tape` [`89c88c1`](https://github.com/ljharb/internal-slot/commit/89c88c1ed8de7c681fd3cec7bb2f045db0268d84)
|
||||
- [Refactor] use `es-errors`, so things that only need those do not need `get-intrinsic` [`b437631`](https://github.com/ljharb/internal-slot/commit/b4376312d4a5d7bc99fb383cae3f15bd2f3d36d1)
|
||||
|
||||
#### [v1.0.6](https://github.com/ljharb/internal-slot/compare/v1.0.5...v1.0.6)
|
||||
|
||||
> 20 October 2023
|
||||
|
||||
- [Dev Deps] update `@ljharb/eslint-config`, `aud`, `object-inspect`, `tape` [`4d568d2`](https://github.com/ljharb/internal-slot/commit/4d568d2897a2efe9b0604ae240bc89787924070f)
|
||||
- [Refactor] use `hasown` instead of `has` [`f946e94`](https://github.com/ljharb/internal-slot/commit/f946e94885f5fa092a4de04f366d746c0c5a2f2f)
|
||||
- [Deps] update `get-intrinsic` [`1bbc885`](https://github.com/ljharb/internal-slot/commit/1bbc885b0225dadac6e50f421cda5814c242b0bb)
|
||||
- [meta] remove unused `.eslintignore` [`6fdde1a`](https://github.com/ljharb/internal-slot/commit/6fdde1a25348cf9fc41c9808d342e6502f37658d)
|
||||
|
||||
#### [v1.0.5](https://github.com/ljharb/internal-slot/compare/v1.0.4...v1.0.5)
|
||||
|
||||
> 9 February 2023
|
||||
|
||||
- [Dev Deps] update `@ljharb/eslint-config`, `aud`, `object-inspect`, `tape` [`e427703`](https://github.com/ljharb/internal-slot/commit/e427703bfc669c590a863ec77ecd3789d7b7c458)
|
||||
- [Deps] update `get-intrinsic` [`aa652f0`](https://github.com/ljharb/internal-slot/commit/aa652f05c5c15b4ed1a118be60f0565e47bd7208)
|
||||
- [Fix] improve assertion message [`8df86e3`](https://github.com/ljharb/internal-slot/commit/8df86e3ea21786b5eb7654f22202665c8b63accf)
|
||||
|
||||
#### [v1.0.4](https://github.com/ljharb/internal-slot/compare/v1.0.3...v1.0.4)
|
||||
|
||||
> 13 December 2022
|
||||
|
||||
- [actions] reuse common workflows [`82a1aee`](https://github.com/ljharb/internal-slot/commit/82a1aee603bce8627930597edb3a04b4970ed151)
|
||||
- [meta] use `npmignore` to autogenerate an npmignore file [`56f7e71`](https://github.com/ljharb/internal-slot/commit/56f7e7182dd934dd6c1b80497a110670d02a91b9)
|
||||
- [actions] use `node/install` instead of `node/run`; use `codecov` action [`e25ff67`](https://github.com/ljharb/internal-slot/commit/e25ff67d568f77c1b66168957d82b080779e1c0a)
|
||||
- [actions] update rebase action to use reusable workflow [`227e81e`](https://github.com/ljharb/internal-slot/commit/227e81eaef7230a265103ef1ef0618d2920c3f30)
|
||||
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `auto-changelog`, `foreach`, `object-inspect`, `tape` [`fc9f319`](https://github.com/ljharb/internal-slot/commit/fc9f319d136ddf2e79910390d1e7ad279d41cc01)
|
||||
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `auto-changelog`, `object-inspect`, `safe-publish-latest`, `tape` [`0a72a0f`](https://github.com/ljharb/internal-slot/commit/0a72a0f389511b41645f441da19257a266cb37f7)
|
||||
- [actions] update codecov uploader [`e2b993f`](https://github.com/ljharb/internal-slot/commit/e2b993f143278a30424ebd5526019e59828989d0)
|
||||
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `object-inspect`, `tape` [`8f0ab80`](https://github.com/ljharb/internal-slot/commit/8f0ab808afdd458001c35c828962dc714d824754)
|
||||
- [actions] update checkout action [`8da4b91`](https://github.com/ljharb/internal-slot/commit/8da4b91c3454671da2e53a831ca0928147965a09)
|
||||
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `@safe-publish-latest`, `tape` [`7ab37aa`](https://github.com/ljharb/internal-slot/commit/7ab37aabf01ded2605fa583a9866b62172f82e30)
|
||||
- [readme] add github actions/codecov badges [`71234be`](https://github.com/ljharb/internal-slot/commit/71234bef4ef99e2f17d72ae3a1b7c0522519b7d7)
|
||||
- [Fix] `assert`: throw on a nonexistent slot even when an object already has other slots [`12580bd`](https://github.com/ljharb/internal-slot/commit/12580bd26fe9f8603566e9e076092b5e1fb7340b)
|
||||
- [Tests] use `for-each` instead of `foreach` [`7229df0`](https://github.com/ljharb/internal-slot/commit/7229df01666ccb022dde82686d84b97b7bcfc53a)
|
||||
- [meta] use `prepublishOnly` script for npm 7+ [`8728872`](https://github.com/ljharb/internal-slot/commit/8728872cfbd735d3ae87e885c081a08d5b26edf0)
|
||||
- [Deps] update `get-intrinsic` [`1b7088f`](https://github.com/ljharb/internal-slot/commit/1b7088fa970c33757816b08357814bdbf6d722b6)
|
||||
- [Deps] update `get-intrinsic` [`063621e`](https://github.com/ljharb/internal-slot/commit/063621ec99d1b9262d3898c0ecad0e1e98be5f75)
|
||||
|
||||
#### [v1.0.3](https://github.com/ljharb/internal-slot/compare/v1.0.2...v1.0.3)
|
||||
|
||||
> 26 January 2021
|
||||
|
||||
- [Tests] use shared travis-ci configs [`0ef2263`](https://github.com/ljharb/internal-slot/commit/0ef22634fa2269d9df0d784aca3c5748e8eabd3b)
|
||||
- [Tests] migrate tests to Github Actions [`6253915`](https://github.com/ljharb/internal-slot/commit/6253915d28721df2eda5630849bc6b57647e3ee2)
|
||||
- [meta] do not publish github action workflow files [`ef94e55`](https://github.com/ljharb/internal-slot/commit/ef94e555727ed6a649ef64010904fe89a468d459)
|
||||
- [Tests] run `nyc` on all tests; use `tape` runner [`917d6ca`](https://github.com/ljharb/internal-slot/commit/917d6ca630cdcd6b4da9a2c300c6a3abb6e724fe)
|
||||
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `auto-changelog`, `object-inspect`, `tape` [`8dcb6fe`](https://github.com/ljharb/internal-slot/commit/8dcb6fe01d6a45e1af17a9dace95ca47c99b4328)
|
||||
- [actions] add "Allow Edits" workflow [`7aa3e86`](https://github.com/ljharb/internal-slot/commit/7aa3e86edb0149fd882717481885760aeb28474e)
|
||||
- [Refactor] use `get-intrinsic` instead of `es-abstract`; update `side-channel` [`11ad17d`](https://github.com/ljharb/internal-slot/commit/11ad17d4255adcbc55fd4eca0bf6733bac59f1bf)
|
||||
- [readme] remove travis badge [`5b75452`](https://github.com/ljharb/internal-slot/commit/5b754523aa07e8f67d0135df75059a18047292bb)
|
||||
- [actions] switch Automatic Rebase workflow to `pull_request_target` event [`d531688`](https://github.com/ljharb/internal-slot/commit/d5316880956b4dd83e6b6c9ab48fdd8171a4a268)
|
||||
- [Dev Deps] update `@ljharb/eslint-config`, `tape` [`c76fa91`](https://github.com/ljharb/internal-slot/commit/c76fa91a7e623a738e22332bee4e985aea41122e)
|
||||
- [Dev Deps] update `eslint`, `tape` [`e733ccd`](https://github.com/ljharb/internal-slot/commit/e733ccd68e81c72ef2e02726e001895053de7887)
|
||||
- [Dev Deps] update `auto-changelog`; add `aud` [`df20bf5`](https://github.com/ljharb/internal-slot/commit/df20bf5d3943a533c20799d8cc1449997e85d53b)
|
||||
- [meta] fix autochangelog [`e89e6f1`](https://github.com/ljharb/internal-slot/commit/e89e6f1ff9f10f386e6400b586db78ad9c0f1309)
|
||||
- [Tests] only audit prod deps [`71317b9`](https://github.com/ljharb/internal-slot/commit/71317b95ec6bbd9877807da0c0316ee9f5f30fab)
|
||||
- [Deps] update `es-abstract` [`c17ccf4`](https://github.com/ljharb/internal-slot/commit/c17ccf45f4cb0d3b7a1536e9cd3a7ff9a7dafd21)
|
||||
- [Dev Deps] update `tape` [`d81ae03`](https://github.com/ljharb/internal-slot/commit/d81ae030a0e8f58cee00f752601ce60405a93d78)
|
||||
- [Deps] update `es-abstract` [`b56303b`](https://github.com/ljharb/internal-slot/commit/b56303b4c3af7a510f9f51860895a46fd2e14752)
|
||||
- [Deps] update `es-abstract` [`9996d1c`](https://github.com/ljharb/internal-slot/commit/9996d1cf3507750c7a6845a2fb0d0f849ea898a1)
|
||||
|
||||
#### [v1.0.2](https://github.com/ljharb/internal-slot/compare/v1.0.1...v1.0.2)
|
||||
|
||||
> 20 December 2019
|
||||
|
||||
- [Deps] update `es-abstract`, `side-channel` [`5c9df03`](https://github.com/ljharb/internal-slot/commit/5c9df03a25518f5c482cff4e1447a26fa071df9a)
|
||||
- [Dev Deps] update `@ljharb/eslint-config`, `tape` [`7820f98`](https://github.com/ljharb/internal-slot/commit/7820f984e523a64ddf3068c4e5631abf61eb1ea4)
|
||||
|
||||
#### [v1.0.1](https://github.com/ljharb/internal-slot/compare/v1.0.0...v1.0.1)
|
||||
|
||||
> 1 December 2019
|
||||
|
||||
- [Refactor] use `side-channel` package [`d38639f`](https://github.com/ljharb/internal-slot/commit/d38639f0a3cdb5090711179d0e78df857ecbd5d3)
|
||||
- [actions] add automatic rebasing / merge commit blocking [`74267e6`](https://github.com/ljharb/internal-slot/commit/74267e6e591e18ba39186cb99139d3fd7a757c9f)
|
||||
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `auto-changelog`, `object-inspect`, `safe-publish-latest` [`b042eef`](https://github.com/ljharb/internal-slot/commit/b042eefc067b830bbd370833f7f21754e802b0b2)
|
||||
- [Deps] update `es-abstract` [`98cf4e8`](https://github.com/ljharb/internal-slot/commit/98cf4e86c1bfe99eda7b11a8ea70394368f33e4f)
|
||||
|
||||
#### v1.0.0
|
||||
|
||||
> 20 October 2019
|
||||
|
||||
- Tests [`b50fa41`](https://github.com/ljharb/internal-slot/commit/b50fa41b6f47aba39ac4cb733658580974a0b00a)
|
||||
- implementation [`c5a59f3`](https://github.com/ljharb/internal-slot/commit/c5a59f3753677f81aa12a0226d3b1187846d06dd)
|
||||
- Initial commit [`15ebe4d`](https://github.com/ljharb/internal-slot/commit/15ebe4dc6d46885f67969d64c9c3e705780963f8)
|
||||
- readme [`382a3f5`](https://github.com/ljharb/internal-slot/commit/382a3f53d8975e6488373a0fc2abcdc7c4c44247)
|
||||
- npm init [`d5e7c97`](https://github.com/ljharb/internal-slot/commit/d5e7c977ef694e89c245fd11165f63c06a7a5040)
|
||||
- [meta] add FUNDING.yml [`685b608`](https://github.com/ljharb/internal-slot/commit/685b6087613f6735f4411a558500d92f8a3ec3f2)
|
||||
- [meta] add `auto-changelog`, `safe-publish-latest` [`f8fdf1c`](https://github.com/ljharb/internal-slot/commit/f8fdf1c3f0c592f71746da6d7f8bea18f8946dda)
|
||||
- [Tests] add `npm run lint` [`baaaa09`](https://github.com/ljharb/internal-slot/commit/baaaa09ab6e5bc5fcc0e7c76e10c55aa18f4ca7e)
|
||||
- Only apps should have lockfiles [`dfa7efa`](https://github.com/ljharb/internal-slot/commit/dfa7efa3d5cd23261cb75c2adab6ee3c06790fee)
|
21
node_modules/internal-slot/LICENSE
generated
vendored
Normal file
21
node_modules/internal-slot/LICENSE
generated
vendored
Normal file
|
@ -0,0 +1,21 @@
|
|||
MIT License
|
||||
|
||||
Copyright (c) 2019 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.
|
58
node_modules/internal-slot/README.md
generated
vendored
Normal file
58
node_modules/internal-slot/README.md
generated
vendored
Normal file
|
@ -0,0 +1,58 @@
|
|||
# internal-slot <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]
|
||||
|
||||
Truly private storage, akin to the JS spec’s concept of internal slots.
|
||||
|
||||
Uses a WeakMap when available; a Map when not; and a regular object in even older engines. Performance and garbage collection behavior will reflect the environment’s capabilities accordingly.
|
||||
|
||||
## Example
|
||||
|
||||
```js
|
||||
var SLOT = require('internal-slot');
|
||||
var assert = require('assert');
|
||||
|
||||
var o = {};
|
||||
|
||||
assert.throws(function () { SLOT.assert(o, 'foo'); });
|
||||
|
||||
assert.equal(SLOT.has(o, 'foo'), false);
|
||||
assert.equal(SLOT.get(o, 'foo'), undefined);
|
||||
|
||||
SLOT.set(o, 'foo', 42);
|
||||
|
||||
assert.equal(SLOT.has(o, 'foo'), true);
|
||||
assert.equal(SLOT.get(o, 'foo'), 42);
|
||||
|
||||
assert.doesNotThrow(function () { SLOT.assert(o, 'foo'); });
|
||||
```
|
||||
|
||||
## Tests
|
||||
Simply clone the repo, `npm install`, and run `npm test`
|
||||
|
||||
## Security
|
||||
|
||||
Please email [@ljharb](https://github.com/ljharb) or see https://tidelift.com/security if you have a potential security vulnerability to report.
|
||||
|
||||
[package-url]: https://npmjs.org/package/internal-slot
|
||||
[npm-version-svg]: https://versionbadg.es/ljharb/internal-slot.svg
|
||||
[deps-svg]: https://david-dm.org/ljharb/internal-slot.svg
|
||||
[deps-url]: https://david-dm.org/ljharb/internal-slot
|
||||
[dev-deps-svg]: https://david-dm.org/ljharb/internal-slot/dev-status.svg
|
||||
[dev-deps-url]: https://david-dm.org/ljharb/internal-slot#info=devDependencies
|
||||
[npm-badge-png]: https://nodei.co/npm/internal-slot.png?downloads=true&stars=true
|
||||
[license-image]: https://img.shields.io/npm/l/internal-slot.svg
|
||||
[license-url]: LICENSE
|
||||
[downloads-image]: https://img.shields.io/npm/dm/internal-slot.svg
|
||||
[downloads-url]: https://npm-stat.com/charts.html?package=internal-slot
|
||||
[codecov-image]: https://codecov.io/gh/ljharb/internal-slot/branch/main/graphs/badge.svg
|
||||
[codecov-url]: https://app.codecov.io/gh/ljharb/internal-slot/
|
||||
[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/ljharb/internal-slot
|
||||
[actions-url]: https://github.com/ljharb/internal-slot/actions
|
61
node_modules/internal-slot/index.js
generated
vendored
Normal file
61
node_modules/internal-slot/index.js
generated
vendored
Normal file
|
@ -0,0 +1,61 @@
|
|||
'use strict';
|
||||
|
||||
var hasOwn = require('hasown');
|
||||
var channel = require('side-channel')();
|
||||
|
||||
var $TypeError = require('es-errors/type');
|
||||
|
||||
var SLOT = {
|
||||
assert: function (O, slot) {
|
||||
if (!O || (typeof O !== 'object' && typeof O !== 'function')) {
|
||||
throw new $TypeError('`O` is not an object');
|
||||
}
|
||||
if (typeof slot !== 'string') {
|
||||
throw new $TypeError('`slot` must be a string');
|
||||
}
|
||||
channel.assert(O);
|
||||
if (!SLOT.has(O, slot)) {
|
||||
throw new $TypeError('`' + slot + '` is not present on `O`');
|
||||
}
|
||||
},
|
||||
get: function (O, slot) {
|
||||
if (!O || (typeof O !== 'object' && typeof O !== 'function')) {
|
||||
throw new $TypeError('`O` is not an object');
|
||||
}
|
||||
if (typeof slot !== 'string') {
|
||||
throw new $TypeError('`slot` must be a string');
|
||||
}
|
||||
var slots = channel.get(O);
|
||||
return slots && slots['$' + slot];
|
||||
},
|
||||
has: function (O, slot) {
|
||||
if (!O || (typeof O !== 'object' && typeof O !== 'function')) {
|
||||
throw new $TypeError('`O` is not an object');
|
||||
}
|
||||
if (typeof slot !== 'string') {
|
||||
throw new $TypeError('`slot` must be a string');
|
||||
}
|
||||
var slots = channel.get(O);
|
||||
return !!slots && hasOwn(slots, '$' + slot);
|
||||
},
|
||||
set: function (O, slot, V) {
|
||||
if (!O || (typeof O !== 'object' && typeof O !== 'function')) {
|
||||
throw new $TypeError('`O` is not an object');
|
||||
}
|
||||
if (typeof slot !== 'string') {
|
||||
throw new $TypeError('`slot` must be a string');
|
||||
}
|
||||
var slots = channel.get(O);
|
||||
if (!slots) {
|
||||
slots = {};
|
||||
channel.set(O, slots);
|
||||
}
|
||||
slots['$' + slot] = V;
|
||||
}
|
||||
};
|
||||
|
||||
if (Object.freeze) {
|
||||
Object.freeze(SLOT);
|
||||
}
|
||||
|
||||
module.exports = SLOT;
|
71
node_modules/internal-slot/package.json
generated
vendored
Normal file
71
node_modules/internal-slot/package.json
generated
vendored
Normal file
|
@ -0,0 +1,71 @@
|
|||
{
|
||||
"name": "internal-slot",
|
||||
"version": "1.0.7",
|
||||
"description": "ES spec-like internal slots",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"prepack": "npmignore --auto --commentLines=autogenerated",
|
||||
"prepublishOnly": "safe-publish-latest",
|
||||
"prepublish": "not-in-publish || npm run prepublishOnly",
|
||||
"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)\")\"",
|
||||
"pretest": "npm run lint",
|
||||
"lint": "eslint .",
|
||||
"tests-only": "nyc tape 'test/**/*.js'",
|
||||
"test": "npm run tests-only",
|
||||
"posttest": "aud --production"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/ljharb/internal-slot.git"
|
||||
},
|
||||
"keywords": [
|
||||
"internal",
|
||||
"slot",
|
||||
"internal slot",
|
||||
"ecmascript",
|
||||
"es",
|
||||
"spec",
|
||||
"private",
|
||||
"data",
|
||||
"private data",
|
||||
"weakmap"
|
||||
],
|
||||
"author": "Jordan Harband <ljharb@gmail.com>",
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
"url": "https://github.com/ljharb/internal-slot/issues"
|
||||
},
|
||||
"homepage": "https://github.com/ljharb/internal-slot#readme",
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@ljharb/eslint-config": "^21.1.0",
|
||||
"aud": "^2.0.4",
|
||||
"auto-changelog": "^2.4.0",
|
||||
"eslint": "=8.8.0",
|
||||
"for-each": "^0.3.3",
|
||||
"npmignore": "^0.3.1",
|
||||
"nyc": "^10.3.2",
|
||||
"object-inspect": "^1.13.1",
|
||||
"safe-publish-latest": "^2.0.0",
|
||||
"tape": "^5.7.4"
|
||||
},
|
||||
"dependencies": {
|
||||
"es-errors": "^1.3.0",
|
||||
"hasown": "^2.0.0",
|
||||
"side-channel": "^1.0.4"
|
||||
},
|
||||
"auto-changelog": {
|
||||
"output": "CHANGELOG.md",
|
||||
"unreleased": false,
|
||||
"commitLimit": false,
|
||||
"backfillLimit": false
|
||||
},
|
||||
"publishConfig": {
|
||||
"ignore": [
|
||||
".github/workflows"
|
||||
]
|
||||
}
|
||||
}
|
121
node_modules/internal-slot/test/index.js
generated
vendored
Normal file
121
node_modules/internal-slot/test/index.js
generated
vendored
Normal file
|
@ -0,0 +1,121 @@
|
|||
'use strict';
|
||||
|
||||
var test = require('tape');
|
||||
var inspect = require('object-inspect');
|
||||
var forEach = require('for-each');
|
||||
|
||||
var SLOT = require('../');
|
||||
|
||||
test('assert', function (t) {
|
||||
forEach([null, undefined, true, false, 'foo', '', 42, 0], function (primitive) {
|
||||
t['throws'](
|
||||
function () { SLOT.assert(primitive, ''); },
|
||||
TypeError,
|
||||
inspect(primitive) + ' is not an Object'
|
||||
);
|
||||
});
|
||||
|
||||
forEach([null, undefined, true, false, 42, 0, {}, [], function () {}, /a/g], function (nonString) {
|
||||
t['throws'](
|
||||
function () { SLOT.assert({}, nonString); },
|
||||
TypeError,
|
||||
inspect(nonString) + ' is not a String'
|
||||
);
|
||||
});
|
||||
|
||||
t['throws'](
|
||||
function () { SLOT.assert({}, 'whatever'); },
|
||||
TypeError,
|
||||
'nonexistent slot throws'
|
||||
);
|
||||
|
||||
var o = {};
|
||||
SLOT.set(o, 'x');
|
||||
t.doesNotThrow(function () { SLOT.assert(o, 'x'); }, 'existent slot noops');
|
||||
t['throws'](function () { SLOT.assert(o, 'y'); }, 'thing with a slot throws on a nonexistent slot');
|
||||
|
||||
t.end();
|
||||
});
|
||||
|
||||
test('has', function (t) {
|
||||
forEach([null, undefined, true, false, 'foo', '', 42, 0], function (primitive) {
|
||||
t['throws'](
|
||||
function () { SLOT.has(primitive, ''); },
|
||||
TypeError,
|
||||
inspect(primitive) + ' is not an Object'
|
||||
);
|
||||
});
|
||||
|
||||
forEach([null, undefined, true, false, 42, 0, {}, [], function () {}, /a/g], function (nonString) {
|
||||
t['throws'](
|
||||
function () { SLOT.has({}, nonString); },
|
||||
TypeError,
|
||||
inspect(nonString) + ' is not a String'
|
||||
);
|
||||
});
|
||||
|
||||
var o = {};
|
||||
|
||||
t.equal(SLOT.has(o, 'nonexistent'), false, 'nonexistent slot yields false');
|
||||
|
||||
SLOT.set(o, 'foo');
|
||||
t.equal(SLOT.has(o, 'foo'), true, 'existent slot yields true');
|
||||
|
||||
t.end();
|
||||
});
|
||||
|
||||
test('get', function (t) {
|
||||
forEach([null, undefined, true, false, 'foo', '', 42, 0], function (primitive) {
|
||||
t['throws'](
|
||||
function () { SLOT.get(primitive, ''); },
|
||||
TypeError,
|
||||
inspect(primitive) + ' is not an Object'
|
||||
);
|
||||
});
|
||||
|
||||
forEach([null, undefined, true, false, 42, 0, {}, [], function () {}, /a/g], function (nonString) {
|
||||
t['throws'](
|
||||
function () { SLOT.get({}, nonString); },
|
||||
TypeError,
|
||||
inspect(nonString) + ' is not a String'
|
||||
);
|
||||
});
|
||||
|
||||
var o = {};
|
||||
t.equal(SLOT.get(o, 'nonexistent'), undefined, 'nonexistent slot is undefined');
|
||||
|
||||
var v = {};
|
||||
SLOT.set(o, 'f', v);
|
||||
t.equal(SLOT.get(o, 'f'), v, '"get" retrieves value set by "set"');
|
||||
|
||||
t.end();
|
||||
});
|
||||
|
||||
test('set', function (t) {
|
||||
forEach([null, undefined, true, false, 'foo', '', 42, 0], function (primitive) {
|
||||
t['throws'](
|
||||
function () { SLOT.set(primitive, ''); },
|
||||
TypeError,
|
||||
inspect(primitive) + ' is not an Object'
|
||||
);
|
||||
});
|
||||
|
||||
forEach([null, undefined, true, false, 42, 0, {}, [], function () {}, /a/g], function (nonString) {
|
||||
t['throws'](
|
||||
function () { SLOT.set({}, nonString); },
|
||||
TypeError,
|
||||
inspect(nonString) + ' is not a String'
|
||||
);
|
||||
});
|
||||
|
||||
var o = function () {};
|
||||
t.equal(SLOT.get(o, 'f'), undefined, 'slot not set');
|
||||
|
||||
SLOT.set(o, 'f', 42);
|
||||
t.equal(SLOT.get(o, 'f'), 42, 'slot was set');
|
||||
|
||||
SLOT.set(o, 'f', Infinity);
|
||||
t.equal(SLOT.get(o, 'f'), Infinity, 'slot was set again');
|
||||
|
||||
t.end();
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue