cdk-common 2.0.1045 → 2.0.1046
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.jsii +2 -2
- package/lib/main.js +1 -1
- package/node_modules/call-bound/CHANGELOG.md +9 -0
- package/node_modules/call-bound/README.md +1 -1
- package/node_modules/call-bound/index.d.ts +9 -1
- package/node_modules/call-bound/index.js +5 -5
- package/node_modules/call-bound/package.json +4 -3
- package/package.json +4 -4
- package/node_modules/call-bind/.eslintignore +0 -1
- package/node_modules/call-bind/.eslintrc +0 -16
- package/node_modules/call-bind/.github/FUNDING.yml +0 -12
- package/node_modules/call-bind/.nycrc +0 -9
- package/node_modules/call-bind/CHANGELOG.md +0 -106
- package/node_modules/call-bind/LICENSE +0 -21
- package/node_modules/call-bind/README.md +0 -64
- package/node_modules/call-bind/callBound.js +0 -15
- package/node_modules/call-bind/index.js +0 -24
- package/node_modules/call-bind/package.json +0 -93
- package/node_modules/call-bind/test/callBound.js +0 -54
- package/node_modules/call-bind/test/index.js +0 -74
- package/node_modules/define-data-property/.eslintrc +0 -24
- package/node_modules/define-data-property/.github/FUNDING.yml +0 -12
- package/node_modules/define-data-property/.nycrc +0 -13
- package/node_modules/define-data-property/CHANGELOG.md +0 -70
- package/node_modules/define-data-property/LICENSE +0 -21
- package/node_modules/define-data-property/README.md +0 -67
- package/node_modules/define-data-property/index.d.ts +0 -12
- package/node_modules/define-data-property/index.js +0 -56
- package/node_modules/define-data-property/package.json +0 -106
- package/node_modules/define-data-property/test/index.js +0 -392
- package/node_modules/define-data-property/tsconfig.json +0 -59
- package/node_modules/has-property-descriptors/.eslintrc +0 -13
- package/node_modules/has-property-descriptors/.github/FUNDING.yml +0 -12
- package/node_modules/has-property-descriptors/.nycrc +0 -9
- package/node_modules/has-property-descriptors/CHANGELOG.md +0 -35
- package/node_modules/has-property-descriptors/LICENSE +0 -21
- package/node_modules/has-property-descriptors/README.md +0 -43
- package/node_modules/has-property-descriptors/index.js +0 -22
- package/node_modules/has-property-descriptors/package.json +0 -77
- package/node_modules/has-property-descriptors/test/index.js +0 -57
- package/node_modules/set-function-length/.eslintrc +0 -27
- package/node_modules/set-function-length/.github/FUNDING.yml +0 -12
- package/node_modules/set-function-length/.nycrc +0 -13
- package/node_modules/set-function-length/CHANGELOG.md +0 -70
- package/node_modules/set-function-length/LICENSE +0 -21
- package/node_modules/set-function-length/README.md +0 -56
- package/node_modules/set-function-length/env.d.ts +0 -9
- package/node_modules/set-function-length/env.js +0 -25
- package/node_modules/set-function-length/index.d.ts +0 -7
- package/node_modules/set-function-length/index.js +0 -42
- package/node_modules/set-function-length/package.json +0 -102
- package/node_modules/set-function-length/tsconfig.json +0 -9
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "has-property-descriptors",
|
|
3
|
-
"version": "1.0.2",
|
|
4
|
-
"description": "Does the environment have full property descriptor support? Handles IE 8's broken defineProperty/gOPD.",
|
|
5
|
-
"main": "index.js",
|
|
6
|
-
"exports": {
|
|
7
|
-
".": "./index.js",
|
|
8
|
-
"./package.json": "./package.json"
|
|
9
|
-
},
|
|
10
|
-
"sideEffects": false,
|
|
11
|
-
"scripts": {
|
|
12
|
-
"prepack": "npmignore --auto --commentLines=autogenerated",
|
|
13
|
-
"prepublishOnly": "safe-publish-latest",
|
|
14
|
-
"prepublish": "not-in-publish || npm run prepublishOnly",
|
|
15
|
-
"pretest": "npm run lint",
|
|
16
|
-
"prelint": "evalmd README.md",
|
|
17
|
-
"lint": "eslint --ext=js,mjs .",
|
|
18
|
-
"tests-only": "nyc tape 'test/**/*.js'",
|
|
19
|
-
"test": "npm run tests-only",
|
|
20
|
-
"posttest": "aud --production",
|
|
21
|
-
"version": "auto-changelog && git add CHANGELOG.md",
|
|
22
|
-
"postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\""
|
|
23
|
-
},
|
|
24
|
-
"repository": {
|
|
25
|
-
"type": "git",
|
|
26
|
-
"url": "git+https://github.com/inspect-js/has-property-descriptors.git"
|
|
27
|
-
},
|
|
28
|
-
"keywords": [
|
|
29
|
-
"property",
|
|
30
|
-
"descriptors",
|
|
31
|
-
"has",
|
|
32
|
-
"environment",
|
|
33
|
-
"env",
|
|
34
|
-
"defineProperty",
|
|
35
|
-
"getOwnPropertyDescriptor"
|
|
36
|
-
],
|
|
37
|
-
"author": "Jordan Harband <ljharb@gmail.com>",
|
|
38
|
-
"funding": {
|
|
39
|
-
"url": "https://github.com/sponsors/ljharb"
|
|
40
|
-
},
|
|
41
|
-
"license": "MIT",
|
|
42
|
-
"bugs": {
|
|
43
|
-
"url": "https://github.com/inspect-js/has-property-descriptors/issues"
|
|
44
|
-
},
|
|
45
|
-
"homepage": "https://github.com/inspect-js/has-property-descriptors#readme",
|
|
46
|
-
"devDependencies": {
|
|
47
|
-
"@ljharb/eslint-config": "^21.1.0",
|
|
48
|
-
"aud": "^2.0.4",
|
|
49
|
-
"auto-changelog": "^2.4.0",
|
|
50
|
-
"eslint": "=8.8.0",
|
|
51
|
-
"evalmd": "^0.0.19",
|
|
52
|
-
"in-publish": "^2.0.1",
|
|
53
|
-
"npmignore": "^0.3.1",
|
|
54
|
-
"nyc": "^10.3.2",
|
|
55
|
-
"safe-publish-latest": "^2.0.0",
|
|
56
|
-
"tape": "^5.7.4"
|
|
57
|
-
},
|
|
58
|
-
"dependencies": {
|
|
59
|
-
"es-define-property": "^1.0.0"
|
|
60
|
-
},
|
|
61
|
-
"testling": {
|
|
62
|
-
"files": "test/index.js"
|
|
63
|
-
},
|
|
64
|
-
"auto-changelog": {
|
|
65
|
-
"output": "CHANGELOG.md",
|
|
66
|
-
"template": "keepachangelog",
|
|
67
|
-
"unreleased": false,
|
|
68
|
-
"commitLimit": false,
|
|
69
|
-
"backfillLimit": false,
|
|
70
|
-
"hideCredit": true
|
|
71
|
-
},
|
|
72
|
-
"publishConfig": {
|
|
73
|
-
"ignore": [
|
|
74
|
-
".github/workflows"
|
|
75
|
-
]
|
|
76
|
-
}
|
|
77
|
-
}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var test = require('tape');
|
|
4
|
-
|
|
5
|
-
var hasPropertyDescriptors = require('../');
|
|
6
|
-
|
|
7
|
-
var sentinel = {};
|
|
8
|
-
|
|
9
|
-
test('hasPropertyDescriptors', function (t) {
|
|
10
|
-
t.equal(typeof hasPropertyDescriptors, 'function', 'is a function');
|
|
11
|
-
t.equal(typeof hasPropertyDescriptors.hasArrayLengthDefineBug, 'function', '`hasArrayLengthDefineBug` property is a function');
|
|
12
|
-
|
|
13
|
-
var yes = hasPropertyDescriptors();
|
|
14
|
-
t.test('property descriptors', { skip: !yes }, function (st) {
|
|
15
|
-
var o = { a: sentinel };
|
|
16
|
-
|
|
17
|
-
st.deepEqual(
|
|
18
|
-
Object.getOwnPropertyDescriptor(o, 'a'),
|
|
19
|
-
{
|
|
20
|
-
configurable: true,
|
|
21
|
-
enumerable: true,
|
|
22
|
-
value: sentinel,
|
|
23
|
-
writable: true
|
|
24
|
-
},
|
|
25
|
-
'has expected property descriptor'
|
|
26
|
-
);
|
|
27
|
-
|
|
28
|
-
Object.defineProperty(o, 'a', { enumerable: false, writable: false });
|
|
29
|
-
|
|
30
|
-
st.deepEqual(
|
|
31
|
-
Object.getOwnPropertyDescriptor(o, 'a'),
|
|
32
|
-
{
|
|
33
|
-
configurable: true,
|
|
34
|
-
enumerable: false,
|
|
35
|
-
value: sentinel,
|
|
36
|
-
writable: false
|
|
37
|
-
},
|
|
38
|
-
'has expected property descriptor after [[Define]]'
|
|
39
|
-
);
|
|
40
|
-
|
|
41
|
-
st.end();
|
|
42
|
-
});
|
|
43
|
-
|
|
44
|
-
var arrayBug = hasPropertyDescriptors.hasArrayLengthDefineBug();
|
|
45
|
-
t.test('defining array lengths', { skip: !yes || arrayBug }, function (st) {
|
|
46
|
-
var arr = [1, , 3]; // eslint-disable-line no-sparse-arrays
|
|
47
|
-
st.equal(arr.length, 3, 'array starts with length 3');
|
|
48
|
-
|
|
49
|
-
Object.defineProperty(arr, 'length', { value: 5 });
|
|
50
|
-
|
|
51
|
-
st.equal(arr.length, 5, 'array ends with length 5');
|
|
52
|
-
|
|
53
|
-
st.end();
|
|
54
|
-
});
|
|
55
|
-
|
|
56
|
-
t.end();
|
|
57
|
-
});
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"root": true,
|
|
3
|
-
|
|
4
|
-
"extends": "@ljharb",
|
|
5
|
-
|
|
6
|
-
"rules": {
|
|
7
|
-
"id-length": "off",
|
|
8
|
-
"new-cap": ["error", {
|
|
9
|
-
"capIsNewExceptions": [
|
|
10
|
-
"GetIntrinsic"
|
|
11
|
-
],
|
|
12
|
-
}],
|
|
13
|
-
"no-extra-parens": "off",
|
|
14
|
-
},
|
|
15
|
-
|
|
16
|
-
"overrides": [
|
|
17
|
-
{
|
|
18
|
-
"files": ["test/**/*.js"],
|
|
19
|
-
"rules": {
|
|
20
|
-
"id-length": "off",
|
|
21
|
-
"max-lines-per-function": "off",
|
|
22
|
-
"multiline-comment-style": "off",
|
|
23
|
-
"no-empty-function": "off",
|
|
24
|
-
},
|
|
25
|
-
},
|
|
26
|
-
],
|
|
27
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
# These are supported funding model platforms
|
|
2
|
-
|
|
3
|
-
github: [ljharb]
|
|
4
|
-
patreon: # Replace with a single Patreon username
|
|
5
|
-
open_collective: # Replace with a single Open Collective username
|
|
6
|
-
ko_fi: # Replace with a single Ko-fi username
|
|
7
|
-
tidelift: npm/set-function-name
|
|
8
|
-
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
|
|
9
|
-
liberapay: # Replace with a single Liberapay username
|
|
10
|
-
issuehunt: # Replace with a single IssueHunt username
|
|
11
|
-
otechie: # Replace with a single Otechie username
|
|
12
|
-
custom: # Replace with a single custom sponsorship URL
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
|
|
3
|
-
All notable changes to this project will be documented in this file.
|
|
4
|
-
|
|
5
|
-
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
|
|
6
|
-
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
-
|
|
8
|
-
## [v1.2.2](https://github.com/ljharb/set-function-length/compare/v1.2.1...v1.2.2) - 2024-03-09
|
|
9
|
-
|
|
10
|
-
### Commits
|
|
11
|
-
|
|
12
|
-
- [types] use shared config [`027032f`](https://github.com/ljharb/set-function-length/commit/027032fe9cc439644a07248ea6a8d813fcc767cb)
|
|
13
|
-
- [actions] remove redundant finisher; use reusable workflow [`1fd4fb1`](https://github.com/ljharb/set-function-length/commit/1fd4fb1c58bd5170f0dcff7e320077c0aa2ffdeb)
|
|
14
|
-
- [types] use a handwritten d.ts file instead of emit [`01b9761`](https://github.com/ljharb/set-function-length/commit/01b9761742c95e1118e8c2d153ce2ae43d9731aa)
|
|
15
|
-
- [Deps] update `define-data-property`, `get-intrinsic`, `has-property-descriptors` [`bee8eaf`](https://github.com/ljharb/set-function-length/commit/bee8eaf7749f325357ade85cffeaeef679e513d4)
|
|
16
|
-
- [Dev Deps] update `call-bind`, `tape` [`5dae579`](https://github.com/ljharb/set-function-length/commit/5dae579fdc3aab91b14ebb58f9c19ee3f509d434)
|
|
17
|
-
- [Tests] use `@arethetypeswrong/cli` [`7e22425`](https://github.com/ljharb/set-function-length/commit/7e22425d15957fd3d6da0b6bca4afc0c8d255d2d)
|
|
18
|
-
|
|
19
|
-
## [v1.2.1](https://github.com/ljharb/set-function-length/compare/v1.2.0...v1.2.1) - 2024-02-06
|
|
20
|
-
|
|
21
|
-
### Commits
|
|
22
|
-
|
|
23
|
-
- [Dev Deps] update `call-bind`, `tape`, `typescript` [`d9a4601`](https://github.com/ljharb/set-function-length/commit/d9a460199c4c1fa37da9ebe055e2c884128f0738)
|
|
24
|
-
- [Deps] update `define-data-property`, `get-intrinsic` [`38d39ae`](https://github.com/ljharb/set-function-length/commit/38d39aed13a757ed36211d5b0437b88485090c6b)
|
|
25
|
-
- [Refactor] use `es-errors`, so things that only need those do not need `get-intrinsic` [`b4bfe5a`](https://github.com/ljharb/set-function-length/commit/b4bfe5ae0953b906d55b85f867eca5e7f673ebf4)
|
|
26
|
-
|
|
27
|
-
## [v1.2.0](https://github.com/ljharb/set-function-length/compare/v1.1.1...v1.2.0) - 2024-01-14
|
|
28
|
-
|
|
29
|
-
### Commits
|
|
30
|
-
|
|
31
|
-
- [New] add types [`f6d9088`](https://github.com/ljharb/set-function-length/commit/f6d9088b9283a3112b21c6776e8bef6d1f30558a)
|
|
32
|
-
- [Fix] ensure `env` properties are always booleans [`0c42f84`](https://github.com/ljharb/set-function-length/commit/0c42f84979086389b3229e1b4272697fd352275a)
|
|
33
|
-
- [Dev Deps] update `aud`, `call-bind`, `npmignore`, `tape` [`2b75f75`](https://github.com/ljharb/set-function-length/commit/2b75f75468093a4bb8ce8ca989b2edd2e80d95d1)
|
|
34
|
-
- [Deps] update `get-intrinsic`, `has-property-descriptors` [`19bf0fc`](https://github.com/ljharb/set-function-length/commit/19bf0fc4ffaa5ad425acbfa150516be9f3b6263a)
|
|
35
|
-
- [meta] add `sideEffects` flag [`8bb9b78`](https://github.com/ljharb/set-function-length/commit/8bb9b78c11c621123f725c9470222f43466c01d0)
|
|
36
|
-
|
|
37
|
-
## [v1.1.1](https://github.com/ljharb/set-function-length/compare/v1.1.0...v1.1.1) - 2023-10-19
|
|
38
|
-
|
|
39
|
-
### Fixed
|
|
40
|
-
|
|
41
|
-
- [Fix] move `define-data-property` to runtime deps [`#2`](https://github.com/ljharb/set-function-length/issues/2)
|
|
42
|
-
|
|
43
|
-
### Commits
|
|
44
|
-
|
|
45
|
-
- [Dev Deps] update `object-inspect`; add missing `call-bind` [`5aecf79`](https://github.com/ljharb/set-function-length/commit/5aecf79e7d6400957a5d9bd9ac20d4528908ca18)
|
|
46
|
-
|
|
47
|
-
## [v1.1.0](https://github.com/ljharb/set-function-length/compare/v1.0.1...v1.1.0) - 2023-10-13
|
|
48
|
-
|
|
49
|
-
### Commits
|
|
50
|
-
|
|
51
|
-
- [New] add `env` entry point [`475c87a`](https://github.com/ljharb/set-function-length/commit/475c87aa2f59b700aaed589d980624ec596acdcb)
|
|
52
|
-
- [Tests] add coverage with `nyc` [`14f0bf8`](https://github.com/ljharb/set-function-length/commit/14f0bf8c145ae60bf14a026420a06bb7be132c36)
|
|
53
|
-
- [eslint] fix linting failure [`fb516f9`](https://github.com/ljharb/set-function-length/commit/fb516f93c664057138c53559ef63c8622a093335)
|
|
54
|
-
- [Deps] update `define-data-property` [`d727e7c`](https://github.com/ljharb/set-function-length/commit/d727e7c6c9a40d7bf26797694e500ea68741feea)
|
|
55
|
-
|
|
56
|
-
## [v1.0.1](https://github.com/ljharb/set-function-length/compare/v1.0.0...v1.0.1) - 2023-10-12
|
|
57
|
-
|
|
58
|
-
### Commits
|
|
59
|
-
|
|
60
|
-
- [Refactor] use `get-intrinsic`, since it‘s in the dep graph anyways [`278a954`](https://github.com/ljharb/set-function-length/commit/278a954a06cd849051c569ff7aee56df6798933e)
|
|
61
|
-
- [meta] add `exports` [`72acfe5`](https://github.com/ljharb/set-function-length/commit/72acfe5a0310071fb205a72caba5ecbab24336a0)
|
|
62
|
-
|
|
63
|
-
## v1.0.0 - 2023-10-12
|
|
64
|
-
|
|
65
|
-
### Commits
|
|
66
|
-
|
|
67
|
-
- Initial implementation, tests, readme [`fce14e1`](https://github.com/ljharb/set-function-length/commit/fce14e17586460e4f294405173be72b6ffdf7e5f)
|
|
68
|
-
- Initial commit [`ca7ba85`](https://github.com/ljharb/set-function-length/commit/ca7ba857c7c283f9d26e21f14e71cd388f2cb722)
|
|
69
|
-
- npm init [`6a7e493`](https://github.com/ljharb/set-function-length/commit/6a7e493927736cebcaf5c1a84e69b8e6b7b744d8)
|
|
70
|
-
- Only apps should have lockfiles [`d2bf6c4`](https://github.com/ljharb/set-function-length/commit/d2bf6c43de8a51b02a0aa53e8d62cb50c4a2b0da)
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) Jordan Harband and contributors
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
# set-function-length <sup>[![Version Badge][npm-version-svg]][package-url]</sup>
|
|
2
|
-
|
|
3
|
-
[![github actions][actions-image]][actions-url]
|
|
4
|
-
[![coverage][codecov-image]][codecov-url]
|
|
5
|
-
[![License][license-image]][license-url]
|
|
6
|
-
[![Downloads][downloads-image]][downloads-url]
|
|
7
|
-
|
|
8
|
-
[![npm badge][npm-badge-png]][package-url]
|
|
9
|
-
|
|
10
|
-
Set a function’s length.
|
|
11
|
-
|
|
12
|
-
Arguments:
|
|
13
|
-
- `fn`: the function
|
|
14
|
-
- `length`: the new length. Must be an integer between 0 and 2**32.
|
|
15
|
-
- `loose`: Optional. If true, and the length fails to be set, do not throw. Default false.
|
|
16
|
-
|
|
17
|
-
Returns `fn`.
|
|
18
|
-
|
|
19
|
-
## Usage
|
|
20
|
-
|
|
21
|
-
```javascript
|
|
22
|
-
var setFunctionLength = require('set-function-length');
|
|
23
|
-
var assert = require('assert');
|
|
24
|
-
|
|
25
|
-
function zero() {}
|
|
26
|
-
function one(_) {}
|
|
27
|
-
function two(_, __) {}
|
|
28
|
-
|
|
29
|
-
assert.equal(zero.length, 0);
|
|
30
|
-
assert.equal(one.length, 1);
|
|
31
|
-
assert.equal(two.length, 2);
|
|
32
|
-
|
|
33
|
-
assert.equal(setFunctionLength(zero, 10), zero);
|
|
34
|
-
assert.equal(setFunctionLength(one, 11), one);
|
|
35
|
-
assert.equal(setFunctionLength(two, 12), two);
|
|
36
|
-
|
|
37
|
-
assert.equal(zero.length, 10);
|
|
38
|
-
assert.equal(one.length, 11);
|
|
39
|
-
assert.equal(two.length, 12);
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
[package-url]: https://npmjs.org/package/set-function-length
|
|
43
|
-
[npm-version-svg]: https://versionbadg.es/ljharb/set-function-length.svg
|
|
44
|
-
[deps-svg]: https://david-dm.org/ljharb/set-function-length.svg
|
|
45
|
-
[deps-url]: https://david-dm.org/ljharb/set-function-length
|
|
46
|
-
[dev-deps-svg]: https://david-dm.org/ljharb/set-function-length/dev-status.svg
|
|
47
|
-
[dev-deps-url]: https://david-dm.org/ljharb/set-function-length#info=devDependencies
|
|
48
|
-
[npm-badge-png]: https://nodei.co/npm/set-function-length.png?downloads=true&stars=true
|
|
49
|
-
[license-image]: https://img.shields.io/npm/l/set-function-length.svg
|
|
50
|
-
[license-url]: LICENSE
|
|
51
|
-
[downloads-image]: https://img.shields.io/npm/dm/set-function-length.svg
|
|
52
|
-
[downloads-url]: https://npm-stat.com/charts.html?package=set-function-length
|
|
53
|
-
[codecov-image]: https://codecov.io/gh/ljharb/set-function-length/branch/main/graphs/badge.svg
|
|
54
|
-
[codecov-url]: https://app.codecov.io/gh/ljharb/set-function-length/
|
|
55
|
-
[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/ljharb/set-function-length
|
|
56
|
-
[actions-url]: https://github.com/ljharb/set-function-length/actions
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var gOPD = require('gopd');
|
|
4
|
-
var bind = require('function-bind');
|
|
5
|
-
|
|
6
|
-
var unbound = gOPD && gOPD(function () {}, 'length');
|
|
7
|
-
// @ts-expect-error ts(2555) TS is overly strict with .call
|
|
8
|
-
var bound = gOPD && gOPD(bind.call(function () {}), 'length');
|
|
9
|
-
|
|
10
|
-
var functionsHaveConfigurableLengths = !!(unbound && unbound.configurable);
|
|
11
|
-
|
|
12
|
-
var functionsHaveWritableLengths = !!(unbound && unbound.writable);
|
|
13
|
-
|
|
14
|
-
var boundFnsHaveConfigurableLengths = !!(bound && bound.configurable);
|
|
15
|
-
|
|
16
|
-
var boundFnsHaveWritableLengths = !!(bound && bound.writable);
|
|
17
|
-
|
|
18
|
-
/** @type {import('./env')} */
|
|
19
|
-
module.exports = {
|
|
20
|
-
__proto__: null,
|
|
21
|
-
boundFnsHaveConfigurableLengths: boundFnsHaveConfigurableLengths,
|
|
22
|
-
boundFnsHaveWritableLengths: boundFnsHaveWritableLengths,
|
|
23
|
-
functionsHaveConfigurableLengths: functionsHaveConfigurableLengths,
|
|
24
|
-
functionsHaveWritableLengths: functionsHaveWritableLengths
|
|
25
|
-
};
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var GetIntrinsic = require('get-intrinsic');
|
|
4
|
-
var define = require('define-data-property');
|
|
5
|
-
var hasDescriptors = require('has-property-descriptors')();
|
|
6
|
-
var gOPD = require('gopd');
|
|
7
|
-
|
|
8
|
-
var $TypeError = require('es-errors/type');
|
|
9
|
-
var $floor = GetIntrinsic('%Math.floor%');
|
|
10
|
-
|
|
11
|
-
/** @type {import('.')} */
|
|
12
|
-
module.exports = function setFunctionLength(fn, length) {
|
|
13
|
-
if (typeof fn !== 'function') {
|
|
14
|
-
throw new $TypeError('`fn` is not a function');
|
|
15
|
-
}
|
|
16
|
-
if (typeof length !== 'number' || length < 0 || length > 0xFFFFFFFF || $floor(length) !== length) {
|
|
17
|
-
throw new $TypeError('`length` must be a positive 32-bit integer');
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
var loose = arguments.length > 2 && !!arguments[2];
|
|
21
|
-
|
|
22
|
-
var functionLengthIsConfigurable = true;
|
|
23
|
-
var functionLengthIsWritable = true;
|
|
24
|
-
if ('length' in fn && gOPD) {
|
|
25
|
-
var desc = gOPD(fn, 'length');
|
|
26
|
-
if (desc && !desc.configurable) {
|
|
27
|
-
functionLengthIsConfigurable = false;
|
|
28
|
-
}
|
|
29
|
-
if (desc && !desc.writable) {
|
|
30
|
-
functionLengthIsWritable = false;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
if (functionLengthIsConfigurable || functionLengthIsWritable || !loose) {
|
|
35
|
-
if (hasDescriptors) {
|
|
36
|
-
define(/** @type {Parameters<define>[0]} */ (fn), 'length', length, true, true);
|
|
37
|
-
} else {
|
|
38
|
-
define(/** @type {Parameters<define>[0]} */ (fn), 'length', length);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
return fn;
|
|
42
|
-
};
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "set-function-length",
|
|
3
|
-
"version": "1.2.2",
|
|
4
|
-
"description": "Set a function's length property",
|
|
5
|
-
"main": "index.js",
|
|
6
|
-
"exports": {
|
|
7
|
-
".": "./index.js",
|
|
8
|
-
"./env": "./env.js",
|
|
9
|
-
"./package.json": "./package.json"
|
|
10
|
-
},
|
|
11
|
-
"sideEffects": false,
|
|
12
|
-
"directories": {
|
|
13
|
-
"test": "test"
|
|
14
|
-
},
|
|
15
|
-
"scripts": {
|
|
16
|
-
"prepack": "npmignore --auto --commentLines=autogenerated",
|
|
17
|
-
"prepublish": "not-in-publish || npm run prepublishOnly",
|
|
18
|
-
"prepublishOnly": "safe-publish-latest",
|
|
19
|
-
"tsc": "tsc -p .",
|
|
20
|
-
"posttsc": "attw -P",
|
|
21
|
-
"prelint": "evalmd README.md",
|
|
22
|
-
"lint": "eslint --ext=js,mjs .",
|
|
23
|
-
"postlint": "npm run tsc",
|
|
24
|
-
"pretest": "npm run lint",
|
|
25
|
-
"tests-only": "nyc tape 'test/**/*.js'",
|
|
26
|
-
"test": "npm run tests-only",
|
|
27
|
-
"posttest": "aud --production",
|
|
28
|
-
"version": "auto-changelog && git add CHANGELOG.md",
|
|
29
|
-
"postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\""
|
|
30
|
-
},
|
|
31
|
-
"repository": {
|
|
32
|
-
"type": "git",
|
|
33
|
-
"url": "git+https://github.com/ljharb/set-function-length.git"
|
|
34
|
-
},
|
|
35
|
-
"keywords": [
|
|
36
|
-
"javascript",
|
|
37
|
-
"ecmascript",
|
|
38
|
-
"set",
|
|
39
|
-
"function",
|
|
40
|
-
"length",
|
|
41
|
-
"function.length"
|
|
42
|
-
],
|
|
43
|
-
"author": "Jordan Harband <ljharb@gmail.com>",
|
|
44
|
-
"license": "MIT",
|
|
45
|
-
"bugs": {
|
|
46
|
-
"url": "https://github.com/ljharb/set-function-length/issues"
|
|
47
|
-
},
|
|
48
|
-
"homepage": "https://github.com/ljharb/set-function-length#readme",
|
|
49
|
-
"dependencies": {
|
|
50
|
-
"define-data-property": "^1.1.4",
|
|
51
|
-
"es-errors": "^1.3.0",
|
|
52
|
-
"function-bind": "^1.1.2",
|
|
53
|
-
"get-intrinsic": "^1.2.4",
|
|
54
|
-
"gopd": "^1.0.1",
|
|
55
|
-
"has-property-descriptors": "^1.0.2"
|
|
56
|
-
},
|
|
57
|
-
"devDependencies": {
|
|
58
|
-
"@arethetypeswrong/cli": "^0.15.1",
|
|
59
|
-
"@ljharb/eslint-config": "^21.1.0",
|
|
60
|
-
"@ljharb/tsconfig": "^0.1.1",
|
|
61
|
-
"@types/call-bind": "^1.0.5",
|
|
62
|
-
"@types/define-properties": "^1.1.5",
|
|
63
|
-
"@types/es-value-fixtures": "^1.4.4",
|
|
64
|
-
"@types/for-each": "^0.3.3",
|
|
65
|
-
"@types/function-bind": "^1.1.10",
|
|
66
|
-
"@types/gopd": "^1.0.3",
|
|
67
|
-
"@types/has-property-descriptors": "^1.0.3",
|
|
68
|
-
"@types/object-inspect": "^1.8.4",
|
|
69
|
-
"@types/tape": "^5.6.4",
|
|
70
|
-
"aud": "^2.0.4",
|
|
71
|
-
"auto-changelog": "^2.4.0",
|
|
72
|
-
"call-bind": "^1.0.7",
|
|
73
|
-
"es-value-fixtures": "^1.4.2",
|
|
74
|
-
"eslint": "=8.8.0",
|
|
75
|
-
"evalmd": "^0.0.19",
|
|
76
|
-
"for-each": "^0.3.3",
|
|
77
|
-
"in-publish": "^2.0.1",
|
|
78
|
-
"npmignore": "^0.3.1",
|
|
79
|
-
"nyc": "^10.3.2",
|
|
80
|
-
"object-inspect": "^1.13.1",
|
|
81
|
-
"safe-publish-latest": "^2.0.0",
|
|
82
|
-
"tape": "^5.7.5",
|
|
83
|
-
"typescript": "next"
|
|
84
|
-
},
|
|
85
|
-
"engines": {
|
|
86
|
-
"node": ">= 0.4"
|
|
87
|
-
},
|
|
88
|
-
"auto-changelog": {
|
|
89
|
-
"output": "CHANGELOG.md",
|
|
90
|
-
"template": "keepachangelog",
|
|
91
|
-
"unreleased": false,
|
|
92
|
-
"commitLimit": false,
|
|
93
|
-
"backfillLimit": false,
|
|
94
|
-
"hideCredit": true
|
|
95
|
-
},
|
|
96
|
-
"publishConfig": {
|
|
97
|
-
"ignore": [
|
|
98
|
-
".github/workflows",
|
|
99
|
-
"test"
|
|
100
|
-
]
|
|
101
|
-
}
|
|
102
|
-
}
|