cdk-lambda-subminute 2.0.271 → 2.0.273
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 +3 -3
- package/lib/cdk-lambda-subminute.js +3 -3
- package/node_modules/aws-sdk/CHANGELOG.md +16 -1
- package/node_modules/aws-sdk/README.md +1 -1
- package/node_modules/aws-sdk/apis/kendra-2019-02-03.min.json +94 -24
- package/node_modules/aws-sdk/apis/metadata.json +0 -3
- package/node_modules/aws-sdk/apis/omics-2022-11-28.min.json +30 -21
- package/node_modules/aws-sdk/apis/opensearch-2021-01-01.min.json +134 -9
- package/node_modules/aws-sdk/apis/opensearch-2021-01-01.paginators.json +5 -0
- package/node_modules/aws-sdk/apis/quicksight-2018-04-01.min.json +776 -698
- package/node_modules/aws-sdk/apis/rds-2014-10-31.min.json +263 -253
- package/node_modules/aws-sdk/clients/all.d.ts +0 -1
- package/node_modules/aws-sdk/clients/all.js +0 -1
- package/node_modules/aws-sdk/clients/cloud9.d.ts +1 -1
- package/node_modules/aws-sdk/clients/dynamodb.d.ts +4 -4
- package/node_modules/aws-sdk/clients/ec2.d.ts +1 -1
- package/node_modules/aws-sdk/clients/kendra.d.ts +86 -9
- package/node_modules/aws-sdk/clients/managedblockchainquery.d.ts +1 -1
- package/node_modules/aws-sdk/clients/neptunedata.d.ts +81 -81
- package/node_modules/aws-sdk/clients/omics.d.ts +27 -1
- package/node_modules/aws-sdk/clients/opensearch.d.ts +152 -1
- package/node_modules/aws-sdk/clients/quicksight.d.ts +111 -7
- package/node_modules/aws-sdk/clients/rds.d.ts +17 -0
- package/node_modules/aws-sdk/clients/secretsmanager.d.ts +7 -7
- package/node_modules/aws-sdk/clients/servicecatalog.d.ts +9 -9
- package/node_modules/aws-sdk/clients/verifiedpermissions.d.ts +2 -2
- package/node_modules/aws-sdk/clients/workspaces.d.ts +2 -2
- package/node_modules/aws-sdk/dist/aws-sdk-core-react-native.js +2 -2
- package/node_modules/aws-sdk/dist/aws-sdk-react-native.js +370 -407
- package/node_modules/aws-sdk/dist/aws-sdk.js +266 -259
- package/node_modules/aws-sdk/dist/aws-sdk.min.js +30 -30
- package/node_modules/aws-sdk/lib/config_service_placeholders.d.ts +0 -2
- package/node_modules/aws-sdk/lib/core.js +1 -1
- package/node_modules/aws-sdk/lib/dynamodb/document_client.d.ts +4 -4
- package/node_modules/aws-sdk/package.json +1 -1
- package/node_modules/call-bind/.eslintrc +0 -1
- package/node_modules/call-bind/.nycrc +0 -4
- package/node_modules/call-bind/CHANGELOG.md +28 -0
- package/node_modules/call-bind/README.md +63 -1
- package/node_modules/call-bind/index.js +6 -13
- package/node_modules/call-bind/package.json +29 -22
- package/node_modules/call-bind/test/callBound.js +0 -1
- package/node_modules/call-bind/test/index.js +7 -4
- package/node_modules/define-data-property/.eslintrc +24 -0
- package/node_modules/define-data-property/.github/FUNDING.yml +12 -0
- package/node_modules/define-data-property/.nycrc +13 -0
- package/node_modules/define-data-property/CHANGELOG.md +41 -0
- package/node_modules/define-data-property/LICENSE +21 -0
- package/node_modules/define-data-property/README.md +67 -0
- package/node_modules/define-data-property/index.d.ts +3 -0
- package/node_modules/define-data-property/index.d.ts.map +1 -0
- package/node_modules/define-data-property/index.js +68 -0
- package/node_modules/define-data-property/package.json +113 -0
- package/node_modules/define-data-property/test/index.js +392 -0
- package/node_modules/define-data-property/tsconfig.json +59 -0
- package/node_modules/has-property-descriptors/.eslintrc +13 -0
- package/node_modules/has-property-descriptors/.github/FUNDING.yml +12 -0
- package/node_modules/has-property-descriptors/.nycrc +9 -0
- package/node_modules/has-property-descriptors/CHANGELOG.md +16 -0
- package/node_modules/has-property-descriptors/LICENSE +21 -0
- package/node_modules/has-property-descriptors/README.md +43 -0
- package/node_modules/has-property-descriptors/index.js +33 -0
- package/node_modules/has-property-descriptors/package.json +70 -0
- package/node_modules/has-property-descriptors/test/index.js +57 -0
- package/node_modules/set-function-length/.eslintrc +27 -0
- package/node_modules/set-function-length/.github/FUNDING.yml +12 -0
- package/node_modules/set-function-length/.nycrc +13 -0
- package/node_modules/set-function-length/CHANGELOG.md +41 -0
- package/node_modules/set-function-length/LICENSE +21 -0
- package/node_modules/set-function-length/README.md +56 -0
- package/node_modules/set-function-length/env.js +19 -0
- package/node_modules/set-function-length/index.js +41 -0
- package/node_modules/set-function-length/package.json +84 -0
- package/node_modules/which-typed-array/CHANGELOG.md +14 -0
- package/node_modules/which-typed-array/index.js +4 -1
- package/node_modules/which-typed-array/package.json +3 -3
- package/package.json +3 -3
- package/node_modules/aws-sdk/apis/gamesparks-2021-08-17.examples.json +0 -5
- package/node_modules/aws-sdk/apis/gamesparks-2021-08-17.min.json +0 -1376
- package/node_modules/aws-sdk/apis/gamesparks-2021-08-17.paginators.json +0 -46
- package/node_modules/aws-sdk/clients/gamesparks.d.ts +0 -1344
- package/node_modules/aws-sdk/clients/gamesparks.js +0 -18
@@ -302,7 +302,6 @@ export abstract class ConfigurationServicePlaceholders {
|
|
302
302
|
amplifyuibuilder?: AWS.AmplifyUIBuilder.Types.ClientConfiguration;
|
303
303
|
keyspaces?: AWS.Keyspaces.Types.ClientConfiguration;
|
304
304
|
billingconductor?: AWS.Billingconductor.Types.ClientConfiguration;
|
305
|
-
gamesparks?: AWS.GameSparks.Types.ClientConfiguration;
|
306
305
|
pinpointsmsvoicev2?: AWS.PinpointSMSVoiceV2.Types.ClientConfiguration;
|
307
306
|
ivschat?: AWS.Ivschat.Types.ClientConfiguration;
|
308
307
|
chimesdkmediapipelines?: AWS.ChimeSDKMediaPipelines.Types.ClientConfiguration;
|
@@ -663,7 +662,6 @@ export interface ConfigurationServiceApiVersions {
|
|
663
662
|
amplifyuibuilder?: AWS.AmplifyUIBuilder.Types.apiVersion;
|
664
663
|
keyspaces?: AWS.Keyspaces.Types.apiVersion;
|
665
664
|
billingconductor?: AWS.Billingconductor.Types.apiVersion;
|
666
|
-
gamesparks?: AWS.GameSparks.Types.apiVersion;
|
667
665
|
pinpointsmsvoicev2?: AWS.PinpointSMSVoiceV2.Types.apiVersion;
|
668
666
|
ivschat?: AWS.Ivschat.Types.apiVersion;
|
669
667
|
chimesdkmediapipelines?: AWS.ChimeSDKMediaPipelines.Types.apiVersion;
|
@@ -1272,7 +1272,7 @@ export namespace DocumentClient {
|
|
1272
1272
|
*/
|
1273
1273
|
ItemCount?: ItemCount;
|
1274
1274
|
/**
|
1275
|
-
*
|
1275
|
+
* The type of export that was performed. Valid values are FULL_EXPORT or INCREMENTAL_EXPORT.
|
1276
1276
|
*/
|
1277
1277
|
ExportType?: ExportType;
|
1278
1278
|
/**
|
@@ -1298,7 +1298,7 @@ export namespace DocumentClient {
|
|
1298
1298
|
*/
|
1299
1299
|
ExportStatus?: ExportStatus;
|
1300
1300
|
/**
|
1301
|
-
*
|
1301
|
+
* The type of export that was performed. Valid values are FULL_EXPORT or INCREMENTAL_EXPORT.
|
1302
1302
|
*/
|
1303
1303
|
ExportType?: ExportType;
|
1304
1304
|
}
|
@@ -1340,7 +1340,7 @@ export namespace DocumentClient {
|
|
1340
1340
|
*/
|
1341
1341
|
ExportFormat?: ExportFormat;
|
1342
1342
|
/**
|
1343
|
-
* Choice of whether to execute as a full export or incremental export. Valid values are FULL_EXPORT or INCREMENTAL_EXPORT. If INCREMENTAL_EXPORT is provided, the IncrementalExportSpecification must also be used.
|
1343
|
+
* Choice of whether to execute as a full export or incremental export. Valid values are FULL_EXPORT or INCREMENTAL_EXPORT. The default value is FULL_EXPORT. If INCREMENTAL_EXPORT is provided, the IncrementalExportSpecification must also be used.
|
1344
1344
|
*/
|
1345
1345
|
ExportType?: ExportType;
|
1346
1346
|
/**
|
@@ -1741,7 +1741,7 @@ export namespace DocumentClient {
|
|
1741
1741
|
*/
|
1742
1742
|
ExportToTime?: ExportToTime;
|
1743
1743
|
/**
|
1744
|
-
*
|
1744
|
+
* The view type that was chosen for the export. Valid values are NEW_AND_OLD_IMAGES and NEW_IMAGES. The default value is NEW_AND_OLD_IMAGES.
|
1745
1745
|
*/
|
1746
1746
|
ExportViewType?: ExportViewType;
|
1747
1747
|
}
|
@@ -5,6 +5,34 @@ All notable changes to this project will be documented in this file.
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
7
7
|
|
8
|
+
## [v1.0.4](https://github.com/ljharb/call-bind/compare/v1.0.3...v1.0.4) - 2023-10-19
|
9
|
+
|
10
|
+
## [v1.0.3](https://github.com/ljharb/call-bind/compare/v1.0.2...v1.0.3) - 2023-10-19
|
11
|
+
|
12
|
+
### Commits
|
13
|
+
|
14
|
+
- [actions] reuse common workflows [`a994df6`](https://github.com/ljharb/call-bind/commit/a994df69f401f4bf735a4ccd77029b85d1549453)
|
15
|
+
- [meta] use `npmignore` to autogenerate an npmignore file [`eef3ef2`](https://github.com/ljharb/call-bind/commit/eef3ef21e1f002790837fedb8af2679c761fbdf5)
|
16
|
+
- [readme] flesh out content [`1845ccf`](https://github.com/ljharb/call-bind/commit/1845ccfd9976a607884cfc7157c93192cc16cf22)
|
17
|
+
- [actions] use `node/install` instead of `node/run`; use `codecov` action [`5b47d53`](https://github.com/ljharb/call-bind/commit/5b47d53d2fd74af5ea0a44f1d51e503cd42f7a90)
|
18
|
+
- [Refactor] use `set-function-length` [`a0e165c`](https://github.com/ljharb/call-bind/commit/a0e165c5dc61db781cbc919b586b1c2b8da0b150)
|
19
|
+
- [Dev Deps] update `@ljharb/eslint-config`, `aud`, `tape` [`9c50103`](https://github.com/ljharb/call-bind/commit/9c50103f44137279a817317cf6cc421a658f85b4)
|
20
|
+
- [meta] simplify "exports" [`019c6d0`](https://github.com/ljharb/call-bind/commit/019c6d06b0e1246ceed8e579f57e44441cbbf6d9)
|
21
|
+
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `auto-changelog`, `safe-publish-latest`, `tape` [`23bd718`](https://github.com/ljharb/call-bind/commit/23bd718a288d3b03042062b4ef5153b3cea83f11)
|
22
|
+
- [actions] update codecov uploader [`62552d7`](https://github.com/ljharb/call-bind/commit/62552d79cc79e05825e99aaba134ae5b37f33da5)
|
23
|
+
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `auto-changelog`, `tape` [`ec81665`](https://github.com/ljharb/call-bind/commit/ec81665b300f87eabff597afdc8b8092adfa7afd)
|
24
|
+
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `safe-publish-latest`, `tape` [`35d67fc`](https://github.com/ljharb/call-bind/commit/35d67fcea883e686650f736f61da5ddca2592de8)
|
25
|
+
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `tape` [`0266d8d`](https://github.com/ljharb/call-bind/commit/0266d8d2a45086a922db366d0c2932fa463662ff)
|
26
|
+
- [Dev Deps] update `@ljharb/eslint-config`, `aud`, `tape` [`43a5b28`](https://github.com/ljharb/call-bind/commit/43a5b28a444e710e1bbf92adb8afb5cf7523a223)
|
27
|
+
- [Deps] update `define-data-property`, `function-bind`, `get-intrinsic` [`780eb36`](https://github.com/ljharb/call-bind/commit/780eb36552514f8cc99c70821ce698697c2726a5)
|
28
|
+
- [Dev Deps] update `aud`, `tape` [`90d50ad`](https://github.com/ljharb/call-bind/commit/90d50ad03b061e0268b3380b0065fcaec183dc05)
|
29
|
+
- [meta] use `prepublishOnly` script for npm 7+ [`44c5433`](https://github.com/ljharb/call-bind/commit/44c5433b7980e02b4870007046407cf6fc543329)
|
30
|
+
- [Deps] update `get-intrinsic` [`86bfbfc`](https://github.com/ljharb/call-bind/commit/86bfbfcf34afdc6eabc93ce3d408548d0e27d958)
|
31
|
+
- [Deps] update `get-intrinsic` [`5c53354`](https://github.com/ljharb/call-bind/commit/5c5335489be0294c18cd7a8bb6e08226ee019ff5)
|
32
|
+
- [actions] update checkout action [`4c393a8`](https://github.com/ljharb/call-bind/commit/4c393a8173b3c8e5b30d5b3297b3b94d48bf87f3)
|
33
|
+
- [Deps] update `get-intrinsic` [`4e70bde`](https://github.com/ljharb/call-bind/commit/4e70bdec0626acb11616d66250fc14565e716e91)
|
34
|
+
- [Deps] update `get-intrinsic` [`55ae803`](https://github.com/ljharb/call-bind/commit/55ae803a920bd93c369cd798c20de31f91e9fc60)
|
35
|
+
|
8
36
|
## [v1.0.2](https://github.com/ljharb/call-bind/compare/v1.0.1...v1.0.2) - 2021-01-11
|
9
37
|
|
10
38
|
### Commits
|
@@ -1,2 +1,64 @@
|
|
1
|
-
# call-bind
|
1
|
+
# call-bind <sup>[![Version Badge][npm-version-svg]][package-url]</sup>
|
2
|
+
|
3
|
+
[![github actions][actions-image]][actions-url]
|
4
|
+
[![coverage][codecov-image]][codecov-url]
|
5
|
+
[![dependency status][deps-svg]][deps-url]
|
6
|
+
[![dev dependency status][dev-deps-svg]][dev-deps-url]
|
7
|
+
[![License][license-image]][license-url]
|
8
|
+
[![Downloads][downloads-image]][downloads-url]
|
9
|
+
|
10
|
+
[![npm badge][npm-badge-png]][package-url]
|
11
|
+
|
2
12
|
Robustly `.call.bind()` a function.
|
13
|
+
|
14
|
+
## Getting started
|
15
|
+
|
16
|
+
```sh
|
17
|
+
npm install --save call-bind
|
18
|
+
```
|
19
|
+
|
20
|
+
## Usage/Examples
|
21
|
+
|
22
|
+
```js
|
23
|
+
const assert = require('assert');
|
24
|
+
const callBind = require('call-bind');
|
25
|
+
const callBound = require('call-bind/callBound');
|
26
|
+
|
27
|
+
function f(a, b) {
|
28
|
+
assert.equal(this, 1);
|
29
|
+
assert.equal(a, 2);
|
30
|
+
assert.equal(b, 3);
|
31
|
+
assert.equal(arguments.length, 2);
|
32
|
+
}
|
33
|
+
|
34
|
+
const fBound = callBind(f);
|
35
|
+
|
36
|
+
const slice = callBound('Array.prototype.slice');
|
37
|
+
|
38
|
+
delete Function.prototype.call;
|
39
|
+
delete Function.prototype.bind;
|
40
|
+
|
41
|
+
fBound(1, 2, 3);
|
42
|
+
|
43
|
+
assert.deepEqual(slice([1, 2, 3, 4], 1, -1), [2, 3]);
|
44
|
+
```
|
45
|
+
|
46
|
+
## Tests
|
47
|
+
|
48
|
+
Clone the repo, `npm install`, and run `npm test`
|
49
|
+
|
50
|
+
[package-url]: https://npmjs.org/package/call-bind
|
51
|
+
[npm-version-svg]: https://versionbadg.es/ljharb/call-bind.svg
|
52
|
+
[deps-svg]: https://david-dm.org/ljharb/call-bind.svg
|
53
|
+
[deps-url]: https://david-dm.org/ljharb/call-bind
|
54
|
+
[dev-deps-svg]: https://david-dm.org/ljharb/call-bind/dev-status.svg
|
55
|
+
[dev-deps-url]: https://david-dm.org/ljharb/call-bind#info=devDependencies
|
56
|
+
[npm-badge-png]: https://nodei.co/npm/call-bind.png?downloads=true&stars=true
|
57
|
+
[license-image]: https://img.shields.io/npm/l/call-bind.svg
|
58
|
+
[license-url]: LICENSE
|
59
|
+
[downloads-image]: https://img.shields.io/npm/dm/call-bind.svg
|
60
|
+
[downloads-url]: https://npm-stat.com/charts.html?package=call-bind
|
61
|
+
[codecov-image]: https://codecov.io/gh/ljharb/call-bind/branch/main/graphs/badge.svg
|
62
|
+
[codecov-url]: https://app.codecov.io/gh/ljharb/call-bind/
|
63
|
+
[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/ljharb/call-bind
|
64
|
+
[actions-url]: https://github.com/ljharb/call-bind/actions
|
@@ -2,12 +2,12 @@
|
|
2
2
|
|
3
3
|
var bind = require('function-bind');
|
4
4
|
var GetIntrinsic = require('get-intrinsic');
|
5
|
+
var setFunctionLength = require('set-function-length');
|
5
6
|
|
6
7
|
var $apply = GetIntrinsic('%Function.prototype.apply%');
|
7
8
|
var $call = GetIntrinsic('%Function.prototype.call%');
|
8
9
|
var $reflectApply = GetIntrinsic('%Reflect.apply%', true) || bind.call($call, $apply);
|
9
10
|
|
10
|
-
var $gOPD = GetIntrinsic('%Object.getOwnPropertyDescriptor%', true);
|
11
11
|
var $defineProperty = GetIntrinsic('%Object.defineProperty%', true);
|
12
12
|
var $max = GetIntrinsic('%Math.max%');
|
13
13
|
|
@@ -22,18 +22,11 @@ if ($defineProperty) {
|
|
22
22
|
|
23
23
|
module.exports = function callBind(originalFunction) {
|
24
24
|
var func = $reflectApply(bind, $call, arguments);
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
func,
|
31
|
-
'length',
|
32
|
-
{ value: 1 + $max(0, originalFunction.length - (arguments.length - 1)) }
|
33
|
-
);
|
34
|
-
}
|
35
|
-
}
|
36
|
-
return func;
|
25
|
+
return setFunctionLength(
|
26
|
+
func,
|
27
|
+
1 + $max(0, originalFunction.length - (arguments.length - 1)),
|
28
|
+
true
|
29
|
+
);
|
37
30
|
};
|
38
31
|
|
39
32
|
var applyBind = function applyBind() {
|
@@ -1,26 +1,19 @@
|
|
1
1
|
{
|
2
2
|
"name": "call-bind",
|
3
|
-
"version": "1.0.
|
3
|
+
"version": "1.0.4",
|
4
4
|
"description": "Robustly `.call.bind()` a function",
|
5
5
|
"main": "index.js",
|
6
6
|
"exports": {
|
7
|
-
".":
|
8
|
-
|
9
|
-
"default": "./index.js"
|
10
|
-
},
|
11
|
-
"./index.js"
|
12
|
-
],
|
13
|
-
"./callBound": [
|
14
|
-
{
|
15
|
-
"default": "./callBound.js"
|
16
|
-
},
|
17
|
-
"./callBound.js"
|
18
|
-
],
|
7
|
+
".": "./index.js",
|
8
|
+
"./callBound": "./callBound.js",
|
19
9
|
"./package.json": "./package.json"
|
20
10
|
},
|
21
11
|
"scripts": {
|
22
|
-
"
|
12
|
+
"prepack": "npmignore --auto --commentLines=auto",
|
13
|
+
"prepublish": "not-in-publish || npm run prepublishOnly",
|
14
|
+
"prepublishOnly": "safe-publish-latest",
|
23
15
|
"lint": "eslint --ext=.js,.mjs .",
|
16
|
+
"postlint": "evalmd README.md",
|
24
17
|
"pretest": "npm run lint",
|
25
18
|
"tests-only": "nyc tape 'test/*'",
|
26
19
|
"test": "npm run tests-only",
|
@@ -57,17 +50,26 @@
|
|
57
50
|
},
|
58
51
|
"homepage": "https://github.com/ljharb/call-bind#readme",
|
59
52
|
"devDependencies": {
|
60
|
-
"@ljharb/eslint-config": "^
|
61
|
-
"aud": "^
|
62
|
-
"auto-changelog": "^2.
|
63
|
-
"eslint": "
|
53
|
+
"@ljharb/eslint-config": "^21.1.0",
|
54
|
+
"aud": "^2.0.3",
|
55
|
+
"auto-changelog": "^2.4.0",
|
56
|
+
"eslint": "=8.8.0",
|
57
|
+
"evalmd": "^0.0.19",
|
58
|
+
"gopd": "^1.0.1",
|
59
|
+
"has-strict-mode": "^1.0.1",
|
60
|
+
"in-publish": "^2.0.1",
|
61
|
+
"npmignore": "^0.3.0",
|
64
62
|
"nyc": "^10.3.2",
|
65
|
-
"safe-publish-latest": "^
|
66
|
-
"tape": "^5.
|
63
|
+
"safe-publish-latest": "^2.0.0",
|
64
|
+
"tape": "^5.7.1"
|
67
65
|
},
|
68
66
|
"dependencies": {
|
69
|
-
"function-bind": "^1.1.
|
70
|
-
"get-intrinsic": "^1.
|
67
|
+
"function-bind": "^1.1.2",
|
68
|
+
"get-intrinsic": "^1.2.1",
|
69
|
+
"set-function-length": "^1.1.0"
|
70
|
+
},
|
71
|
+
"testling": {
|
72
|
+
"files": "test/index.js"
|
71
73
|
},
|
72
74
|
"auto-changelog": {
|
73
75
|
"output": "CHANGELOG.md",
|
@@ -76,5 +78,10 @@
|
|
76
78
|
"commitLimit": false,
|
77
79
|
"backfillLimit": false,
|
78
80
|
"hideCredit": true
|
81
|
+
},
|
82
|
+
"publishConfig": {
|
83
|
+
"ignore": [
|
84
|
+
".github/workflows"
|
85
|
+
]
|
79
86
|
}
|
80
87
|
}
|
@@ -40,7 +40,6 @@ test('callBound', function (t) {
|
|
40
40
|
'allowMissing arg still throws for unknown intrinsic'
|
41
41
|
);
|
42
42
|
|
43
|
-
/* globals WeakRef: false */
|
44
43
|
t.test('real but absent intrinsic', { skip: typeof WeakRef !== 'undefined' }, function (st) {
|
45
44
|
st['throws'](
|
46
45
|
function () { callBound('WeakRef'); },
|
@@ -2,6 +2,8 @@
|
|
2
2
|
|
3
3
|
var callBind = require('../');
|
4
4
|
var bind = require('function-bind');
|
5
|
+
var gOPD = require('gopd');
|
6
|
+
var hasStrictMode = require('has-strict-mode')();
|
5
7
|
|
6
8
|
var test = require('tape');
|
7
9
|
|
@@ -10,7 +12,8 @@ var test = require('tape');
|
|
10
12
|
* in io.js v3, it is configurable except on bound functions, hence the .bind()
|
11
13
|
*/
|
12
14
|
var functionsHaveConfigurableLengths = !!(
|
13
|
-
|
15
|
+
gOPD
|
16
|
+
&& Object.getOwnPropertyDescriptor
|
14
17
|
&& Object.getOwnPropertyDescriptor(bind.call(function () {}), 'length').configurable
|
15
18
|
);
|
16
19
|
|
@@ -18,7 +21,7 @@ test('callBind', function (t) {
|
|
18
21
|
var sentinel = { sentinel: true };
|
19
22
|
var func = function (a, b) {
|
20
23
|
// eslint-disable-next-line no-invalid-this
|
21
|
-
return [this, a, b];
|
24
|
+
return [!hasStrictMode && this === global ? undefined : this, a, b];
|
22
25
|
};
|
23
26
|
t.equal(func.length, 2, 'original function length is 2');
|
24
27
|
t.deepEqual(func(), [undefined, undefined, undefined], 'unbound func with too few args');
|
@@ -28,8 +31,8 @@ test('callBind', function (t) {
|
|
28
31
|
var bound = callBind(func);
|
29
32
|
t.equal(bound.length, func.length + 1, 'function length is preserved', { skip: !functionsHaveConfigurableLengths });
|
30
33
|
t.deepEqual(bound(), [undefined, undefined, undefined], 'bound func with too few args');
|
31
|
-
t.deepEqual(bound(1, 2), [1, 2, undefined], 'bound func with right args');
|
32
|
-
t.deepEqual(bound(1, 2, 3), [1, 2, 3], 'bound func with too many args');
|
34
|
+
t.deepEqual(bound(1, 2), [hasStrictMode ? 1 : Object(1), 2, undefined], 'bound func with right args');
|
35
|
+
t.deepEqual(bound(1, 2, 3), [hasStrictMode ? 1 : Object(1), 2, 3], 'bound func with too many args');
|
33
36
|
|
34
37
|
var boundR = callBind(func, sentinel);
|
35
38
|
t.equal(boundR.length, func.length, 'function length is preserved', { skip: !functionsHaveConfigurableLengths });
|
@@ -0,0 +1,24 @@
|
|
1
|
+
{
|
2
|
+
"root": true,
|
3
|
+
|
4
|
+
"extends": "@ljharb",
|
5
|
+
|
6
|
+
"rules": {
|
7
|
+
"complexity": 0,
|
8
|
+
"id-length": 0,
|
9
|
+
"new-cap": ["error", {
|
10
|
+
"capIsNewExceptions": [
|
11
|
+
"GetIntrinsic",
|
12
|
+
],
|
13
|
+
}],
|
14
|
+
},
|
15
|
+
|
16
|
+
"overrides": [
|
17
|
+
{
|
18
|
+
"files": "test/**",
|
19
|
+
"rules": {
|
20
|
+
"max-lines-per-function": "off",
|
21
|
+
},
|
22
|
+
},
|
23
|
+
],
|
24
|
+
}
|
@@ -0,0 +1,12 @@
|
|
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/define-data-property
|
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 up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
|
@@ -0,0 +1,41 @@
|
|
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.1.1](https://github.com/ljharb/define-data-property/compare/v1.1.0...v1.1.1) - 2023-10-12
|
9
|
+
|
10
|
+
### Commits
|
11
|
+
|
12
|
+
- [Tests] fix tests in ES3 engines [`5c6920e`](https://github.com/ljharb/define-data-property/commit/5c6920edd1f52f675b02f417e539c28135b43f94)
|
13
|
+
- [Dev Deps] update `@types/es-value-fixtures`, `@types/for-each`, `@types/gopd`, `@types/has-property-descriptors`, `tape`, `typescript` [`7d82dfc`](https://github.com/ljharb/define-data-property/commit/7d82dfc20f778b4465bba06335dd53f6f431aea3)
|
14
|
+
- [Fix] IE 8 has a broken `Object.defineProperty` [`0672e1a`](https://github.com/ljharb/define-data-property/commit/0672e1af2a9fcc787e7c23b96dea60d290df5548)
|
15
|
+
- [meta] emit types on prepack [`73acb1f`](https://github.com/ljharb/define-data-property/commit/73acb1f903c21b314ec7156bf10f73c7910530c0)
|
16
|
+
- [Dev Deps] update `tape`, `typescript` [`9489a77`](https://github.com/ljharb/define-data-property/commit/9489a7738bf2ecf0ac71d5b78ec4ca6ad7ba0142)
|
17
|
+
|
18
|
+
## [v1.1.0](https://github.com/ljharb/define-data-property/compare/v1.0.1...v1.1.0) - 2023-09-13
|
19
|
+
|
20
|
+
### Commits
|
21
|
+
|
22
|
+
- [New] add `loose` arg [`155235a`](https://github.com/ljharb/define-data-property/commit/155235a4c4d7741f6de01cd87c99599a56654b72)
|
23
|
+
- [New] allow `null` to be passed for the non* args [`7d2fa5f`](https://github.com/ljharb/define-data-property/commit/7d2fa5f06be0392736c13b126f7cd38979f34792)
|
24
|
+
|
25
|
+
## [v1.0.1](https://github.com/ljharb/define-data-property/compare/v1.0.0...v1.0.1) - 2023-09-12
|
26
|
+
|
27
|
+
### Commits
|
28
|
+
|
29
|
+
- [meta] add TS types [`43d763c`](https://github.com/ljharb/define-data-property/commit/43d763c6c883f652de1c9c02ef6216ee507ffa69)
|
30
|
+
- [Dev Deps] update `@types/tape`, `typescript` [`f444985`](https://github.com/ljharb/define-data-property/commit/f444985811c36f3e6448a03ad2f9b7898917f4c7)
|
31
|
+
- [meta] add `safe-publish-latest`, [`172bb10`](https://github.com/ljharb/define-data-property/commit/172bb10890896ebb160e64398f6ee55760107bee)
|
32
|
+
|
33
|
+
## v1.0.0 - 2023-09-12
|
34
|
+
|
35
|
+
### Commits
|
36
|
+
|
37
|
+
- Initial implementation, tests, readme [`5b43d6b`](https://github.com/ljharb/define-data-property/commit/5b43d6b44e675a904810467a7d4e0adb7efc3196)
|
38
|
+
- Initial commit [`35e577a`](https://github.com/ljharb/define-data-property/commit/35e577a6ba59a98befa97776d70d90f3bea9009d)
|
39
|
+
- npm init [`82a0a04`](https://github.com/ljharb/define-data-property/commit/82a0a04a321ca7de220af02d41e2745e8a9962ed)
|
40
|
+
- Only apps should have lockfiles [`96df244`](https://github.com/ljharb/define-data-property/commit/96df244a3c6f426f9a2437be825d1c6f5dd7158e)
|
41
|
+
- [meta] use `npmignore` to autogenerate an npmignore file [`a87ff18`](https://github.com/ljharb/define-data-property/commit/a87ff18cb79e14c2eb5720486c4759fd9a189375)
|
@@ -0,0 +1,21 @@
|
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2023 Jordan Harband
|
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.
|
@@ -0,0 +1,67 @@
|
|
1
|
+
# define-data-property <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
|
+
Define a data property on an object. Will fall back to assignment in an engine without descriptors.
|
11
|
+
|
12
|
+
The three `non*` argument can also be passed `null`, which will use the existing state if available.
|
13
|
+
|
14
|
+
The `loose` argument will mean that if you attempt to set a non-normal data property, in an environment without descriptor support, it will fall back to normal assignment.
|
15
|
+
|
16
|
+
## Usage
|
17
|
+
|
18
|
+
```javascript
|
19
|
+
var defineDataProperty = require('define-data-property');
|
20
|
+
var assert = require('assert');
|
21
|
+
|
22
|
+
var obj = {};
|
23
|
+
defineDataProperty(obj, 'key', 'value');
|
24
|
+
defineDataProperty(
|
25
|
+
obj,
|
26
|
+
'key2',
|
27
|
+
'value',
|
28
|
+
true, // nonEnumerable, optional
|
29
|
+
false, // nonWritable, optional
|
30
|
+
true, // nonConfigurable, optional
|
31
|
+
false // loose, optional
|
32
|
+
);
|
33
|
+
|
34
|
+
assert.deepEqual(
|
35
|
+
Object.getOwnPropertyDescriptors(obj),
|
36
|
+
{
|
37
|
+
key: {
|
38
|
+
configurable: true,
|
39
|
+
enumerable: true,
|
40
|
+
value: 'value',
|
41
|
+
writable: true,
|
42
|
+
},
|
43
|
+
key2: {
|
44
|
+
configurable: false,
|
45
|
+
enumerable: false,
|
46
|
+
value: 'value',
|
47
|
+
writable: true,
|
48
|
+
},
|
49
|
+
}
|
50
|
+
);
|
51
|
+
```
|
52
|
+
|
53
|
+
[package-url]: https://npmjs.org/package/define-data-property
|
54
|
+
[npm-version-svg]: https://versionbadg.es/ljharb/define-data-property.svg
|
55
|
+
[deps-svg]: https://david-dm.org/ljharb/define-data-property.svg
|
56
|
+
[deps-url]: https://david-dm.org/ljharb/define-data-property
|
57
|
+
[dev-deps-svg]: https://david-dm.org/ljharb/define-data-property/dev-status.svg
|
58
|
+
[dev-deps-url]: https://david-dm.org/ljharb/define-data-property#info=devDependencies
|
59
|
+
[npm-badge-png]: https://nodei.co/npm/define-data-property.png?downloads=true&stars=true
|
60
|
+
[license-image]: https://img.shields.io/npm/l/define-data-property.svg
|
61
|
+
[license-url]: LICENSE
|
62
|
+
[downloads-image]: https://img.shields.io/npm/dm/define-data-property.svg
|
63
|
+
[downloads-url]: https://npm-stat.com/charts.html?package=define-data-property
|
64
|
+
[codecov-image]: https://codecov.io/gh/ljharb/define-data-property/branch/main/graphs/badge.svg
|
65
|
+
[codecov-url]: https://app.codecov.io/gh/ljharb/define-data-property/
|
66
|
+
[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/ljharb/define-data-property
|
67
|
+
[actions-url]: https://github.com/ljharb/define-data-property/actions
|
@@ -0,0 +1,3 @@
|
|
1
|
+
declare const _exports: (obj: Record<PropertyKey, unknown>, property: PropertyKey, value: unknown, nonEnumerable?: boolean | null, nonWritable?: boolean | null, nonConfigurable?: boolean | null, loose?: boolean) => void;
|
2
|
+
export = _exports;
|
3
|
+
//# sourceMappingURL=index.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.js"],"names":[],"mappings":"8BAqBiB,OAAO,WAAW,EAAE,OAAO,CAAC,YAAY,WAAW,SAAS,OAAO,kBAAkB,OAAO,GAAG,IAAI,gBAAgB,OAAO,GAAG,IAAI,oBAAoB,OAAO,GAAG,IAAI,UAAU,OAAO,KAAK,IAAI"}
|
@@ -0,0 +1,68 @@
|
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
var hasPropertyDescriptors = require('has-property-descriptors')();
|
4
|
+
|
5
|
+
var GetIntrinsic = require('get-intrinsic');
|
6
|
+
|
7
|
+
var $defineProperty = hasPropertyDescriptors && GetIntrinsic('%Object.defineProperty%', true);
|
8
|
+
if ($defineProperty) {
|
9
|
+
try {
|
10
|
+
$defineProperty({}, 'a', { value: 1 });
|
11
|
+
} catch (e) {
|
12
|
+
// IE 8 has a broken defineProperty
|
13
|
+
$defineProperty = false;
|
14
|
+
}
|
15
|
+
}
|
16
|
+
|
17
|
+
var $SyntaxError = GetIntrinsic('%SyntaxError%');
|
18
|
+
var $TypeError = GetIntrinsic('%TypeError%');
|
19
|
+
|
20
|
+
var gopd = require('gopd');
|
21
|
+
|
22
|
+
/** @type {(obj: Record<PropertyKey, unknown>, property: PropertyKey, value: unknown, nonEnumerable?: boolean | null, nonWritable?: boolean | null, nonConfigurable?: boolean | null, loose?: boolean) => void} */
|
23
|
+
module.exports = function defineDataProperty(
|
24
|
+
obj,
|
25
|
+
property,
|
26
|
+
value
|
27
|
+
) {
|
28
|
+
if (!obj || (typeof obj !== 'object' && typeof obj !== 'function')) {
|
29
|
+
throw new $TypeError('`obj` must be an object or a function`');
|
30
|
+
}
|
31
|
+
if (typeof property !== 'string' && typeof property !== 'symbol') {
|
32
|
+
throw new $TypeError('`property` must be a string or a symbol`');
|
33
|
+
}
|
34
|
+
if (arguments.length > 3 && typeof arguments[3] !== 'boolean' && arguments[3] !== null) {
|
35
|
+
throw new $TypeError('`nonEnumerable`, if provided, must be a boolean or null');
|
36
|
+
}
|
37
|
+
if (arguments.length > 4 && typeof arguments[4] !== 'boolean' && arguments[4] !== null) {
|
38
|
+
throw new $TypeError('`nonWritable`, if provided, must be a boolean or null');
|
39
|
+
}
|
40
|
+
if (arguments.length > 5 && typeof arguments[5] !== 'boolean' && arguments[5] !== null) {
|
41
|
+
throw new $TypeError('`nonConfigurable`, if provided, must be a boolean or null');
|
42
|
+
}
|
43
|
+
if (arguments.length > 6 && typeof arguments[6] !== 'boolean') {
|
44
|
+
throw new $TypeError('`loose`, if provided, must be a boolean');
|
45
|
+
}
|
46
|
+
|
47
|
+
var nonEnumerable = arguments.length > 3 ? arguments[3] : null;
|
48
|
+
var nonWritable = arguments.length > 4 ? arguments[4] : null;
|
49
|
+
var nonConfigurable = arguments.length > 5 ? arguments[5] : null;
|
50
|
+
var loose = arguments.length > 6 ? arguments[6] : false;
|
51
|
+
|
52
|
+
/* @type {false | TypedPropertyDescriptor<unknown>} */
|
53
|
+
var desc = !!gopd && gopd(obj, property);
|
54
|
+
|
55
|
+
if ($defineProperty) {
|
56
|
+
$defineProperty(obj, property, {
|
57
|
+
configurable: nonConfigurable === null && desc ? desc.configurable : !nonConfigurable,
|
58
|
+
enumerable: nonEnumerable === null && desc ? desc.enumerable : !nonEnumerable,
|
59
|
+
value: value,
|
60
|
+
writable: nonWritable === null && desc ? desc.writable : !nonWritable
|
61
|
+
});
|
62
|
+
} else if (loose || (!nonEnumerable && !nonWritable && !nonConfigurable)) {
|
63
|
+
// must fall back to [[Set]], and was not explicitly asked to make non-enumerable, non-writable, or non-configurable
|
64
|
+
obj[property] = value; // eslint-disable-line no-param-reassign
|
65
|
+
} else {
|
66
|
+
throw new $SyntaxError('This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.');
|
67
|
+
}
|
68
|
+
};
|