cdk-lambda-subminute 2.0.272 → 2.0.274
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 +18 -1
- package/node_modules/aws-sdk/README.md +1 -1
- package/node_modules/aws-sdk/apis/appintegrations-2020-07-29.min.json +1 -2
- package/node_modules/aws-sdk/apis/connect-2017-08-08.min.json +28 -6
- package/node_modules/aws-sdk/apis/discovery-2015-11-01.min.json +167 -35
- package/node_modules/aws-sdk/apis/discovery-2015-11-01.paginators.json +34 -2
- 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/ssm-2014-11-06.min.json +188 -173
- 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/appintegrations.d.ts +1 -1
- package/node_modules/aws-sdk/clients/connect.d.ts +53 -31
- package/node_modules/aws-sdk/clients/discovery.d.ts +170 -0
- package/node_modules/aws-sdk/clients/ec2.d.ts +1 -1
- package/node_modules/aws-sdk/clients/managedblockchainquery.d.ts +1 -1
- package/node_modules/aws-sdk/clients/medicalimaging.d.ts +10 -10
- 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/secretsmanager.d.ts +7 -7
- package/node_modules/aws-sdk/clients/servicecatalog.d.ts +9 -9
- package/node_modules/aws-sdk/clients/ssm.d.ts +19 -3
- 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 +246 -86
- package/node_modules/aws-sdk/dist/aws-sdk-react-native.js +1974 -1691
- package/node_modules/aws-sdk/dist/aws-sdk.js +219 -185
- package/node_modules/aws-sdk/dist/aws-sdk.min.js +78 -78
- 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/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 +35 -0
- package/node_modules/call-bind/README.md +63 -1
- package/node_modules/call-bind/index.js +10 -13
- package/node_modules/call-bind/package.json +33 -23
- package/node_modules/call-bind/test/callBound.js +0 -1
- package/node_modules/call-bind/test/index.js +18 -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
@@ -0,0 +1,113 @@
|
|
1
|
+
{
|
2
|
+
"name": "define-data-property",
|
3
|
+
"version": "1.1.1",
|
4
|
+
"description": "Define a data property on an object. Will fall back to assignment in an engine without descriptors.",
|
5
|
+
"main": "index.js",
|
6
|
+
"exports": {
|
7
|
+
".": [
|
8
|
+
{
|
9
|
+
"types": "./index.d.ts",
|
10
|
+
"default": "./index.js"
|
11
|
+
},
|
12
|
+
"./index.js"
|
13
|
+
],
|
14
|
+
"./package.json": "./package.json"
|
15
|
+
},
|
16
|
+
"sideEffects": false,
|
17
|
+
"types": "./index.d.ts",
|
18
|
+
"scripts": {
|
19
|
+
"prepack": "npmignore --auto --commentLines=autogenerated && npm run emit-types",
|
20
|
+
"prepublish": "not-in-publish || npm run prepublishOnly",
|
21
|
+
"prepublishOnly": "safe-publish-latest",
|
22
|
+
"tsc": "tsc -p .",
|
23
|
+
"preemit-types": "rm -f *.ts *.ts.map test/*.ts test/*.ts.map",
|
24
|
+
"emit-types": "npm run tsc -- --noEmit false --emitDeclarationOnly",
|
25
|
+
"postemit-types": "rm test/*.ts test/*.ts.map",
|
26
|
+
"prelint": "evalmd README.md",
|
27
|
+
"lint": "eslint --ext=js,mjs .",
|
28
|
+
"postlint": "npm run tsc",
|
29
|
+
"pretest": "npm run lint",
|
30
|
+
"tests-only": "nyc tape 'test/**/*.js'",
|
31
|
+
"test": "npm run tests-only",
|
32
|
+
"posttest": "aud --production",
|
33
|
+
"version": "auto-changelog && git add CHANGELOG.md",
|
34
|
+
"postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\""
|
35
|
+
},
|
36
|
+
"repository": {
|
37
|
+
"type": "git",
|
38
|
+
"url": "git+https://github.com/ljharb/define-data-property.git"
|
39
|
+
},
|
40
|
+
"keywords": [
|
41
|
+
"define",
|
42
|
+
"data",
|
43
|
+
"property",
|
44
|
+
"object",
|
45
|
+
"accessor",
|
46
|
+
"javascript",
|
47
|
+
"ecmascript",
|
48
|
+
"enumerable",
|
49
|
+
"configurable",
|
50
|
+
"writable"
|
51
|
+
],
|
52
|
+
"author": "Jordan Harband <ljharb@gmail.com>",
|
53
|
+
"license": "MIT",
|
54
|
+
"bugs": {
|
55
|
+
"url": "https://github.com/ljharb/define-data-property/issues"
|
56
|
+
},
|
57
|
+
"homepage": "https://github.com/ljharb/define-data-property#readme",
|
58
|
+
"dependencies": {
|
59
|
+
"get-intrinsic": "^1.2.1",
|
60
|
+
"gopd": "^1.0.1",
|
61
|
+
"has-property-descriptors": "^1.0.0"
|
62
|
+
},
|
63
|
+
"devDependencies": {
|
64
|
+
"@ljharb/eslint-config": "^21.1.0",
|
65
|
+
"@types/es-value-fixtures": "^1.4.1",
|
66
|
+
"@types/for-each": "^0.3.1",
|
67
|
+
"@types/get-intrinsic": "^1.2.0",
|
68
|
+
"@types/gopd": "^1.0.1",
|
69
|
+
"@types/has": "^1.0.0",
|
70
|
+
"@types/has-property-descriptors": "^1.0.1",
|
71
|
+
"@types/object-inspect": "^1.8.2",
|
72
|
+
"@types/object.getownpropertydescriptors": "^2.1.2",
|
73
|
+
"@types/tape": "^5.6.1",
|
74
|
+
"aud": "^2.0.3",
|
75
|
+
"auto-changelog": "^2.4.0",
|
76
|
+
"es-value-fixtures": "^1.4.2",
|
77
|
+
"eslint": "=8.8.0",
|
78
|
+
"evalmd": "^0.0.19",
|
79
|
+
"for-each": "^0.3.3",
|
80
|
+
"has": "^1.0.3",
|
81
|
+
"in-publish": "^2.0.1",
|
82
|
+
"npmignore": "^0.3.0",
|
83
|
+
"nyc": "^10.3.2",
|
84
|
+
"object-inspect": "^1.12.3",
|
85
|
+
"object.getownpropertydescriptors": "^2.1.7",
|
86
|
+
"reflect.ownkeys": "^1.1.4",
|
87
|
+
"safe-publish-latest": "^2.0.0",
|
88
|
+
"tape": "^5.7.1",
|
89
|
+
"typescript": "^5.3.0-dev.20231012"
|
90
|
+
},
|
91
|
+
"engines": {
|
92
|
+
"node": ">= 0.4"
|
93
|
+
},
|
94
|
+
"testling": {
|
95
|
+
"files": "test/index.js"
|
96
|
+
},
|
97
|
+
"auto-changelog": {
|
98
|
+
"output": "CHANGELOG.md",
|
99
|
+
"template": "keepachangelog",
|
100
|
+
"unreleased": false,
|
101
|
+
"commitLimit": false,
|
102
|
+
"backfillLimit": false,
|
103
|
+
"hideCredit": true
|
104
|
+
},
|
105
|
+
"publishConfig": {
|
106
|
+
"ignore": [
|
107
|
+
".github/workflows",
|
108
|
+
"!*.ts",
|
109
|
+
"!*.ts.map",
|
110
|
+
"types/reflect.ownkeys"
|
111
|
+
]
|
112
|
+
}
|
113
|
+
}
|
@@ -0,0 +1,392 @@
|
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
var test = require('tape');
|
4
|
+
var v = require('es-value-fixtures');
|
5
|
+
var forEach = require('for-each');
|
6
|
+
var inspect = require('object-inspect');
|
7
|
+
var has = require('has');
|
8
|
+
var hasPropertyDescriptors = require('has-property-descriptors')();
|
9
|
+
var getOwnPropertyDescriptors = require('object.getownpropertydescriptors');
|
10
|
+
var ownKeys = require('reflect.ownkeys');
|
11
|
+
|
12
|
+
var defineDataProperty = require('../');
|
13
|
+
|
14
|
+
test('defineDataProperty', function (t) {
|
15
|
+
t.test('argument validation', function (st) {
|
16
|
+
forEach(v.primitives, function (nonObject) {
|
17
|
+
st['throws'](
|
18
|
+
// @ts-expect-error
|
19
|
+
function () { defineDataProperty(nonObject, 'key', 'value'); },
|
20
|
+
TypeError,
|
21
|
+
'throws on non-object input: ' + inspect(nonObject)
|
22
|
+
);
|
23
|
+
});
|
24
|
+
|
25
|
+
forEach(v.nonPropertyKeys, function (nonPropertyKey) {
|
26
|
+
st['throws'](
|
27
|
+
// @ts-expect-error
|
28
|
+
function () { defineDataProperty({}, nonPropertyKey, 'value'); },
|
29
|
+
TypeError,
|
30
|
+
'throws on non-PropertyKey input: ' + inspect(nonPropertyKey)
|
31
|
+
);
|
32
|
+
});
|
33
|
+
|
34
|
+
forEach(v.nonBooleans, function (nonBoolean) {
|
35
|
+
if (nonBoolean !== null) {
|
36
|
+
st['throws'](
|
37
|
+
// @ts-expect-error
|
38
|
+
function () { defineDataProperty({}, 'key', 'value', nonBoolean); },
|
39
|
+
TypeError,
|
40
|
+
'throws on non-boolean nonEnumerable: ' + inspect(nonBoolean)
|
41
|
+
);
|
42
|
+
|
43
|
+
st['throws'](
|
44
|
+
// @ts-expect-error
|
45
|
+
function () { defineDataProperty({}, 'key', 'value', false, nonBoolean); },
|
46
|
+
TypeError,
|
47
|
+
'throws on non-boolean nonWritable: ' + inspect(nonBoolean)
|
48
|
+
);
|
49
|
+
|
50
|
+
st['throws'](
|
51
|
+
// @ts-expect-error
|
52
|
+
function () { defineDataProperty({}, 'key', 'value', false, false, nonBoolean); },
|
53
|
+
TypeError,
|
54
|
+
'throws on non-boolean nonConfigurable: ' + inspect(nonBoolean)
|
55
|
+
);
|
56
|
+
}
|
57
|
+
});
|
58
|
+
|
59
|
+
st.end();
|
60
|
+
});
|
61
|
+
|
62
|
+
t.test('normal data property', function (st) {
|
63
|
+
/** @type {Record<PropertyKey, string>} */
|
64
|
+
var obj = { existing: 'existing property' };
|
65
|
+
st.ok(has(obj, 'existing'), 'has initial own property');
|
66
|
+
st.equal(obj.existing, 'existing property', 'has expected initial value');
|
67
|
+
|
68
|
+
var res = defineDataProperty(obj, 'added', 'added property');
|
69
|
+
st.equal(res, void undefined, 'returns `undefined`');
|
70
|
+
st.ok(has(obj, 'added'), 'has expected own property');
|
71
|
+
st.equal(obj.added, 'added property', 'has expected value');
|
72
|
+
|
73
|
+
defineDataProperty(obj, 'existing', 'new value');
|
74
|
+
st.ok(has(obj, 'existing'), 'still has expected own property');
|
75
|
+
st.equal(obj.existing, 'new value', 'has new expected value');
|
76
|
+
|
77
|
+
defineDataProperty(obj, 'explicit1', 'new value', false);
|
78
|
+
st.ok(has(obj, 'explicit1'), 'has expected own property (explicit enumerable)');
|
79
|
+
st.equal(obj.explicit1, 'new value', 'has new expected value (explicit enumerable)');
|
80
|
+
|
81
|
+
defineDataProperty(obj, 'explicit2', 'new value', false, false);
|
82
|
+
st.ok(has(obj, 'explicit2'), 'has expected own property (explicit writable)');
|
83
|
+
st.equal(obj.explicit2, 'new value', 'has new expected value (explicit writable)');
|
84
|
+
|
85
|
+
defineDataProperty(obj, 'explicit3', 'new value', false, false, false);
|
86
|
+
st.ok(has(obj, 'explicit3'), 'has expected own property (explicit configurable)');
|
87
|
+
st.equal(obj.explicit3, 'new value', 'has new expected value (explicit configurable)');
|
88
|
+
|
89
|
+
st.end();
|
90
|
+
});
|
91
|
+
|
92
|
+
t.test('loose mode', { skip: !hasPropertyDescriptors }, function (st) {
|
93
|
+
var obj = { existing: 'existing property' };
|
94
|
+
|
95
|
+
defineDataProperty(obj, 'added', 'added value 1', true, null, null, true);
|
96
|
+
st.deepEqual(
|
97
|
+
getOwnPropertyDescriptors(obj),
|
98
|
+
{
|
99
|
+
existing: {
|
100
|
+
configurable: true,
|
101
|
+
enumerable: true,
|
102
|
+
value: 'existing property',
|
103
|
+
writable: true
|
104
|
+
},
|
105
|
+
added: {
|
106
|
+
configurable: true,
|
107
|
+
enumerable: !hasPropertyDescriptors,
|
108
|
+
value: 'added value 1',
|
109
|
+
writable: true
|
110
|
+
}
|
111
|
+
},
|
112
|
+
'in loose mode, obj still adds property 1'
|
113
|
+
);
|
114
|
+
|
115
|
+
defineDataProperty(obj, 'added', 'added value 2', false, true, null, true);
|
116
|
+
st.deepEqual(
|
117
|
+
getOwnPropertyDescriptors(obj),
|
118
|
+
{
|
119
|
+
existing: {
|
120
|
+
configurable: true,
|
121
|
+
enumerable: true,
|
122
|
+
value: 'existing property',
|
123
|
+
writable: true
|
124
|
+
},
|
125
|
+
added: {
|
126
|
+
configurable: true,
|
127
|
+
enumerable: true,
|
128
|
+
value: 'added value 2',
|
129
|
+
writable: !hasPropertyDescriptors
|
130
|
+
}
|
131
|
+
},
|
132
|
+
'in loose mode, obj still adds property 2'
|
133
|
+
);
|
134
|
+
|
135
|
+
defineDataProperty(obj, 'added', 'added value 3', false, false, true, true);
|
136
|
+
st.deepEqual(
|
137
|
+
getOwnPropertyDescriptors(obj),
|
138
|
+
{
|
139
|
+
existing: {
|
140
|
+
configurable: true,
|
141
|
+
enumerable: true,
|
142
|
+
value: 'existing property',
|
143
|
+
writable: true
|
144
|
+
},
|
145
|
+
added: {
|
146
|
+
configurable: !hasPropertyDescriptors,
|
147
|
+
enumerable: true,
|
148
|
+
value: 'added value 3',
|
149
|
+
writable: true
|
150
|
+
}
|
151
|
+
},
|
152
|
+
'in loose mode, obj still adds property 3'
|
153
|
+
);
|
154
|
+
|
155
|
+
st.end();
|
156
|
+
});
|
157
|
+
|
158
|
+
t.test('non-normal data property, ES3', { skip: hasPropertyDescriptors }, function (st) {
|
159
|
+
/** @type {Record<PropertyKey, string>} */
|
160
|
+
var obj = { existing: 'existing property' };
|
161
|
+
|
162
|
+
st['throws'](
|
163
|
+
function () { defineDataProperty(obj, 'added', 'added value', true); },
|
164
|
+
SyntaxError,
|
165
|
+
'nonEnumerable throws a Syntax Error'
|
166
|
+
);
|
167
|
+
|
168
|
+
st['throws'](
|
169
|
+
function () { defineDataProperty(obj, 'added', 'added value', false, true); },
|
170
|
+
SyntaxError,
|
171
|
+
'nonWritable throws a Syntax Error'
|
172
|
+
);
|
173
|
+
|
174
|
+
st['throws'](
|
175
|
+
function () { defineDataProperty(obj, 'added', 'added value', false, false, true); },
|
176
|
+
SyntaxError,
|
177
|
+
'nonWritable throws a Syntax Error'
|
178
|
+
);
|
179
|
+
|
180
|
+
st.deepEqual(
|
181
|
+
ownKeys(obj),
|
182
|
+
['existing'],
|
183
|
+
'obj still has expected keys'
|
184
|
+
);
|
185
|
+
st.equal(obj.existing, 'existing property', 'obj still has expected values');
|
186
|
+
|
187
|
+
st.end();
|
188
|
+
});
|
189
|
+
|
190
|
+
t.test('new non-normal data property, ES5+', { skip: !hasPropertyDescriptors }, function (st) {
|
191
|
+
/** @type {Record<PropertyKey, string>} */
|
192
|
+
var obj = { existing: 'existing property' };
|
193
|
+
|
194
|
+
defineDataProperty(obj, 'nonEnum', null, true);
|
195
|
+
defineDataProperty(obj, 'nonWrit', null, false, true);
|
196
|
+
defineDataProperty(obj, 'nonConf', null, false, false, true);
|
197
|
+
|
198
|
+
st.deepEqual(
|
199
|
+
getOwnPropertyDescriptors(obj),
|
200
|
+
{
|
201
|
+
existing: {
|
202
|
+
configurable: true,
|
203
|
+
enumerable: true,
|
204
|
+
value: 'existing property',
|
205
|
+
writable: true
|
206
|
+
},
|
207
|
+
nonEnum: {
|
208
|
+
configurable: true,
|
209
|
+
enumerable: false,
|
210
|
+
value: null,
|
211
|
+
writable: true
|
212
|
+
},
|
213
|
+
nonWrit: {
|
214
|
+
configurable: true,
|
215
|
+
enumerable: true,
|
216
|
+
value: null,
|
217
|
+
writable: false
|
218
|
+
},
|
219
|
+
nonConf: {
|
220
|
+
configurable: false,
|
221
|
+
enumerable: true,
|
222
|
+
value: null,
|
223
|
+
writable: true
|
224
|
+
}
|
225
|
+
},
|
226
|
+
'obj has expected property descriptors'
|
227
|
+
);
|
228
|
+
|
229
|
+
st.end();
|
230
|
+
});
|
231
|
+
|
232
|
+
t.test('existing non-normal data property, ES5+', { skip: !hasPropertyDescriptors }, function (st) {
|
233
|
+
// test case changing an existing non-normal property
|
234
|
+
|
235
|
+
/** @type {Record<string, null | string>} */
|
236
|
+
var obj = {};
|
237
|
+
Object.defineProperty(obj, 'nonEnum', { configurable: true, enumerable: false, value: null, writable: true });
|
238
|
+
Object.defineProperty(obj, 'nonWrit', { configurable: true, enumerable: true, value: null, writable: false });
|
239
|
+
Object.defineProperty(obj, 'nonConf', { configurable: false, enumerable: true, value: null, writable: true });
|
240
|
+
|
241
|
+
st.deepEqual(
|
242
|
+
getOwnPropertyDescriptors(obj),
|
243
|
+
{
|
244
|
+
nonEnum: {
|
245
|
+
configurable: true,
|
246
|
+
enumerable: false,
|
247
|
+
value: null,
|
248
|
+
writable: true
|
249
|
+
},
|
250
|
+
nonWrit: {
|
251
|
+
configurable: true,
|
252
|
+
enumerable: true,
|
253
|
+
value: null,
|
254
|
+
writable: false
|
255
|
+
},
|
256
|
+
nonConf: {
|
257
|
+
configurable: false,
|
258
|
+
enumerable: true,
|
259
|
+
value: null,
|
260
|
+
writable: true
|
261
|
+
}
|
262
|
+
},
|
263
|
+
'obj initially has expected property descriptors'
|
264
|
+
);
|
265
|
+
|
266
|
+
defineDataProperty(obj, 'nonEnum', 'new value', false);
|
267
|
+
defineDataProperty(obj, 'nonWrit', 'new value', false, false);
|
268
|
+
st['throws'](
|
269
|
+
function () { defineDataProperty(obj, 'nonConf', 'new value', false, false, false); },
|
270
|
+
TypeError,
|
271
|
+
'can not alter a nonconfigurable property'
|
272
|
+
);
|
273
|
+
|
274
|
+
st.deepEqual(
|
275
|
+
getOwnPropertyDescriptors(obj),
|
276
|
+
{
|
277
|
+
nonEnum: {
|
278
|
+
configurable: true,
|
279
|
+
enumerable: true,
|
280
|
+
value: 'new value',
|
281
|
+
writable: true
|
282
|
+
},
|
283
|
+
nonWrit: {
|
284
|
+
configurable: true,
|
285
|
+
enumerable: true,
|
286
|
+
value: 'new value',
|
287
|
+
writable: true
|
288
|
+
},
|
289
|
+
nonConf: {
|
290
|
+
configurable: false,
|
291
|
+
enumerable: true,
|
292
|
+
value: null,
|
293
|
+
writable: true
|
294
|
+
}
|
295
|
+
},
|
296
|
+
'obj ends up with expected property descriptors'
|
297
|
+
);
|
298
|
+
|
299
|
+
st.end();
|
300
|
+
});
|
301
|
+
|
302
|
+
t.test('frozen object, ES5+', { skip: !hasPropertyDescriptors }, function (st) {
|
303
|
+
var frozen = Object.freeze({ existing: true });
|
304
|
+
|
305
|
+
st['throws'](
|
306
|
+
function () { defineDataProperty(frozen, 'existing', 'new value'); },
|
307
|
+
TypeError,
|
308
|
+
'frozen object can not modify an existing property'
|
309
|
+
);
|
310
|
+
|
311
|
+
st['throws'](
|
312
|
+
function () { defineDataProperty(frozen, 'new', 'new property'); },
|
313
|
+
TypeError,
|
314
|
+
'frozen object can not add a new property'
|
315
|
+
);
|
316
|
+
|
317
|
+
st.end();
|
318
|
+
});
|
319
|
+
|
320
|
+
t.test('sealed object, ES5+', { skip: !hasPropertyDescriptors }, function (st) {
|
321
|
+
var sealed = Object.seal({ existing: true });
|
322
|
+
st.deepEqual(
|
323
|
+
Object.getOwnPropertyDescriptor(sealed, 'existing'),
|
324
|
+
{
|
325
|
+
configurable: false,
|
326
|
+
enumerable: true,
|
327
|
+
value: true,
|
328
|
+
writable: true
|
329
|
+
},
|
330
|
+
'existing value on sealed object has expected descriptor'
|
331
|
+
);
|
332
|
+
|
333
|
+
defineDataProperty(sealed, 'existing', 'new value');
|
334
|
+
|
335
|
+
st.deepEqual(
|
336
|
+
Object.getOwnPropertyDescriptor(sealed, 'existing'),
|
337
|
+
{
|
338
|
+
configurable: false,
|
339
|
+
enumerable: true,
|
340
|
+
value: 'new value',
|
341
|
+
writable: true
|
342
|
+
},
|
343
|
+
'existing value on sealed object has changed descriptor'
|
344
|
+
);
|
345
|
+
|
346
|
+
st['throws'](
|
347
|
+
function () { defineDataProperty(sealed, 'new', 'new property'); },
|
348
|
+
TypeError,
|
349
|
+
'sealed object can not add a new property'
|
350
|
+
);
|
351
|
+
|
352
|
+
st.end();
|
353
|
+
});
|
354
|
+
|
355
|
+
t.test('nonextensible object, ES5+', { skip: !hasPropertyDescriptors }, function (st) {
|
356
|
+
var nonExt = Object.preventExtensions({ existing: true });
|
357
|
+
|
358
|
+
st.deepEqual(
|
359
|
+
Object.getOwnPropertyDescriptor(nonExt, 'existing'),
|
360
|
+
{
|
361
|
+
configurable: true,
|
362
|
+
enumerable: true,
|
363
|
+
value: true,
|
364
|
+
writable: true
|
365
|
+
},
|
366
|
+
'existing value on non-extensible object has expected descriptor'
|
367
|
+
);
|
368
|
+
|
369
|
+
defineDataProperty(nonExt, 'existing', 'new value', true);
|
370
|
+
|
371
|
+
st.deepEqual(
|
372
|
+
Object.getOwnPropertyDescriptor(nonExt, 'existing'),
|
373
|
+
{
|
374
|
+
configurable: true,
|
375
|
+
enumerable: false,
|
376
|
+
value: 'new value',
|
377
|
+
writable: true
|
378
|
+
},
|
379
|
+
'existing value on non-extensible object has changed descriptor'
|
380
|
+
);
|
381
|
+
|
382
|
+
st['throws'](
|
383
|
+
function () { defineDataProperty(nonExt, 'new', 'new property'); },
|
384
|
+
TypeError,
|
385
|
+
'non-extensible object can not add a new property'
|
386
|
+
);
|
387
|
+
|
388
|
+
st.end();
|
389
|
+
});
|
390
|
+
|
391
|
+
t.end();
|
392
|
+
});
|
@@ -0,0 +1,59 @@
|
|
1
|
+
{
|
2
|
+
"compilerOptions": {
|
3
|
+
/* Visit https://aka.ms/tsconfig to read more about this file */
|
4
|
+
|
5
|
+
/* Projects */
|
6
|
+
|
7
|
+
/* Language and Environment */
|
8
|
+
"target": "es2022", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
|
9
|
+
// "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
|
10
|
+
// "noLib": true, /* Disable including any library files, including the default lib.d.ts. */
|
11
|
+
"useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */
|
12
|
+
// "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */
|
13
|
+
|
14
|
+
/* Modules */
|
15
|
+
"module": "commonjs", /* Specify what module code is generated. */
|
16
|
+
// "rootDir": "./", /* Specify the root folder within your source files. */
|
17
|
+
// "moduleResolution": "node10", /* Specify how TypeScript looks up a file from a given module specifier. */
|
18
|
+
// "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
|
19
|
+
// "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
|
20
|
+
// "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
|
21
|
+
"typeRoots": ["types"], /* Specify multiple folders that act like './node_modules/@types'. */
|
22
|
+
"resolveJsonModule": true, /* Enable importing .json files. */
|
23
|
+
|
24
|
+
/* JavaScript Support */
|
25
|
+
"allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */
|
26
|
+
"checkJs": true, /* Enable error reporting in type-checked JavaScript files. */
|
27
|
+
"maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */
|
28
|
+
|
29
|
+
/* Emit */
|
30
|
+
"declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
|
31
|
+
"declarationMap": true, /* Create sourcemaps for d.ts files. */
|
32
|
+
// "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
|
33
|
+
"noEmit": true, /* Disable emitting files from a compilation. */
|
34
|
+
|
35
|
+
/* Interop Constraints */
|
36
|
+
"allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */
|
37
|
+
"esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */
|
38
|
+
"forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */
|
39
|
+
|
40
|
+
/* Type Checking */
|
41
|
+
"strict": true, /* Enable all strict type-checking options. */
|
42
|
+
"noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */
|
43
|
+
"noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */
|
44
|
+
"useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */
|
45
|
+
"noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */
|
46
|
+
"noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */
|
47
|
+
"noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */
|
48
|
+
"noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */
|
49
|
+
"noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */
|
50
|
+
"noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */
|
51
|
+
// "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */
|
52
|
+
|
53
|
+
/* Completeness */
|
54
|
+
// "skipLibCheck": true /* Skip type checking all .d.ts files. */
|
55
|
+
},
|
56
|
+
"exclude": [
|
57
|
+
"coverage"
|
58
|
+
]
|
59
|
+
}
|
@@ -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/has-property-descriptors
|
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,16 @@
|
|
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.0.0 - 2022-04-14
|
9
|
+
|
10
|
+
### Commits
|
11
|
+
|
12
|
+
- Initial implementation, tests [`303559f`](https://github.com/inspect-js/has-property-descriptors/commit/303559f2a72dfe7111573a1aec475ed4a184c35a)
|
13
|
+
- Initial commit [`3a7ca2d`](https://github.com/inspect-js/has-property-descriptors/commit/3a7ca2dc49f1fff0279a28bb16265e7615e14749)
|
14
|
+
- read me [`dd73dce`](https://github.com/inspect-js/has-property-descriptors/commit/dd73dce09d89d0f7a4a6e3b1e562a506f979a767)
|
15
|
+
- npm init [`c1e6557`](https://github.com/inspect-js/has-property-descriptors/commit/c1e655779de632d68cb944c50da6b71bcb7b8c85)
|
16
|
+
- Only apps should have lockfiles [`e72f7c6`](https://github.com/inspect-js/has-property-descriptors/commit/e72f7c68de534b2d273ee665f8b18d4ecc7f70b0)
|
@@ -0,0 +1,21 @@
|
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2022 Inspect JS
|
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,43 @@
|
|
1
|
+
# has-property-descriptors <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
|
+
|
12
|
+
Does the environment have full property descriptor support? Handles IE 8's broken defineProperty/gOPD.
|
13
|
+
|
14
|
+
## Example
|
15
|
+
|
16
|
+
```js
|
17
|
+
var hasPropertyDescriptors = require('has-property-descriptors');
|
18
|
+
var assert = require('assert');
|
19
|
+
|
20
|
+
assert.equal(hasPropertyDescriptors(), true); // will be `false` in IE 6-8, and ES5 engines
|
21
|
+
|
22
|
+
// Arrays can not have their length `[[Defined]]` in some engines
|
23
|
+
assert.equal(hasPropertyDescriptors.hasArrayLengthDefineBug(), false); // will be `true` in Firefox 4-22, and node v0.6
|
24
|
+
```
|
25
|
+
|
26
|
+
## Tests
|
27
|
+
Simply clone the repo, `npm install`, and run `npm test`
|
28
|
+
|
29
|
+
[package-url]: https://npmjs.org/package/has-property-descriptors
|
30
|
+
[npm-version-svg]: https://versionbadg.es/inspect-js/has-property-descriptors.svg
|
31
|
+
[deps-svg]: https://david-dm.org/inspect-js/has-property-descriptors.svg
|
32
|
+
[deps-url]: https://david-dm.org/inspect-js/has-property-descriptors
|
33
|
+
[dev-deps-svg]: https://david-dm.org/inspect-js/has-property-descriptors/dev-status.svg
|
34
|
+
[dev-deps-url]: https://david-dm.org/inspect-js/has-property-descriptors#info=devDependencies
|
35
|
+
[npm-badge-png]: https://nodei.co/npm/has-property-descriptors.png?downloads=true&stars=true
|
36
|
+
[license-image]: https://img.shields.io/npm/l/has-property-descriptors.svg
|
37
|
+
[license-url]: LICENSE
|
38
|
+
[downloads-image]: https://img.shields.io/npm/dm/has-property-descriptors.svg
|
39
|
+
[downloads-url]: https://npm-stat.com/charts.html?package=has-property-descriptors
|
40
|
+
[codecov-image]: https://codecov.io/gh/inspect-js/has-property-descriptors/branch/main/graphs/badge.svg
|
41
|
+
[codecov-url]: https://app.codecov.io/gh/inspect-js/has-property-descriptors/
|
42
|
+
[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/inspect-js/has-property-descriptors
|
43
|
+
[actions-url]: https://github.com/inspect-js/has-property-descriptors/actions
|