styled-map-package 4.0.1 → 4.1.0

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.
Files changed (189) hide show
  1. package/bin/smp-download.js +1 -1
  2. package/bin/smp-view.js +32 -23
  3. package/dist/download.d.cts +1 -1
  4. package/dist/download.d.ts +1 -1
  5. package/dist/index.d.cts +2 -2
  6. package/dist/index.d.ts +2 -2
  7. package/dist/reader-watch.d.cts +1 -1
  8. package/dist/reader-watch.d.ts +1 -1
  9. package/dist/reader.cjs +2 -1
  10. package/dist/reader.d.cts +1 -1
  11. package/dist/reader.d.ts +1 -1
  12. package/dist/reader.js +2 -1
  13. package/dist/server.d.cts +1 -1
  14. package/dist/server.d.ts +1 -1
  15. package/dist/style-downloader.cjs +2 -2
  16. package/dist/style-downloader.d.cts +1 -1
  17. package/dist/style-downloader.d.ts +1 -1
  18. package/dist/style-downloader.js +2 -2
  19. package/dist/tile-downloader.cjs +2 -2
  20. package/dist/tile-downloader.d.cts +1 -1
  21. package/dist/tile-downloader.d.ts +1 -1
  22. package/dist/tile-downloader.js +2 -2
  23. package/dist/{types-B4Xn1F9K.d.cts → types-yLQy3AKR.d.cts} +6 -3
  24. package/dist/{types-B4Xn1F9K.d.ts → types-yLQy3AKR.d.ts} +6 -3
  25. package/dist/utils/file-formats.d.cts +1 -1
  26. package/dist/utils/file-formats.d.ts +1 -1
  27. package/dist/utils/style.cjs +2 -2
  28. package/dist/utils/style.d.cts +1 -1
  29. package/dist/utils/style.d.ts +1 -1
  30. package/dist/utils/style.js +2 -2
  31. package/dist/utils/templates.cjs +4 -0
  32. package/dist/utils/templates.d.cts +4 -2
  33. package/dist/utils/templates.d.ts +4 -2
  34. package/dist/utils/templates.js +2 -0
  35. package/dist/writer.cjs +51 -3
  36. package/dist/writer.d.cts +1 -1
  37. package/dist/writer.d.ts +1 -1
  38. package/dist/writer.js +53 -3
  39. package/node_modules/@node-rs/crc32/LICENSE +21 -0
  40. package/node_modules/@node-rs/crc32/README.md +61 -0
  41. package/node_modules/@node-rs/crc32/browser.js +1 -0
  42. package/node_modules/@node-rs/crc32/index.d.ts +5 -0
  43. package/node_modules/@node-rs/crc32/index.js +368 -0
  44. package/node_modules/@node-rs/crc32/package.json +97 -0
  45. package/node_modules/@node-rs/crc32-linux-x64-gnu/README.md +3 -0
  46. package/node_modules/@node-rs/crc32-linux-x64-gnu/crc32.linux-x64-gnu.node +0 -0
  47. package/node_modules/@node-rs/crc32-linux-x64-gnu/package.json +43 -0
  48. package/node_modules/@node-rs/crc32-linux-x64-musl/README.md +3 -0
  49. package/node_modules/@node-rs/crc32-linux-x64-musl/crc32.linux-x64-musl.node +0 -0
  50. package/node_modules/@node-rs/crc32-linux-x64-musl/package.json +43 -0
  51. package/node_modules/define-data-property/.eslintrc +24 -0
  52. package/node_modules/define-data-property/.github/FUNDING.yml +12 -0
  53. package/node_modules/define-data-property/.nycrc +13 -0
  54. package/node_modules/define-data-property/CHANGELOG.md +70 -0
  55. package/node_modules/define-data-property/LICENSE +21 -0
  56. package/node_modules/define-data-property/README.md +67 -0
  57. package/node_modules/define-data-property/index.d.ts +12 -0
  58. package/node_modules/define-data-property/index.js +56 -0
  59. package/node_modules/define-data-property/package.json +106 -0
  60. package/node_modules/define-data-property/test/index.js +392 -0
  61. package/node_modules/define-data-property/tsconfig.json +59 -0
  62. package/node_modules/define-properties/.editorconfig +13 -0
  63. package/node_modules/define-properties/.eslintrc +19 -0
  64. package/node_modules/define-properties/.github/FUNDING.yml +12 -0
  65. package/node_modules/define-properties/.nycrc +9 -0
  66. package/node_modules/define-properties/CHANGELOG.md +91 -0
  67. package/node_modules/define-properties/LICENSE +21 -0
  68. package/node_modules/define-properties/README.md +84 -0
  69. package/node_modules/define-properties/index.js +47 -0
  70. package/node_modules/define-properties/package.json +88 -0
  71. package/node_modules/es-define-property/.eslintrc +13 -0
  72. package/node_modules/es-define-property/.github/FUNDING.yml +12 -0
  73. package/node_modules/es-define-property/.nycrc +9 -0
  74. package/node_modules/es-define-property/CHANGELOG.md +29 -0
  75. package/node_modules/es-define-property/LICENSE +21 -0
  76. package/node_modules/es-define-property/README.md +49 -0
  77. package/node_modules/es-define-property/index.d.ts +3 -0
  78. package/node_modules/es-define-property/index.js +14 -0
  79. package/node_modules/es-define-property/package.json +81 -0
  80. package/node_modules/es-define-property/test/index.js +56 -0
  81. package/node_modules/es-define-property/tsconfig.json +10 -0
  82. package/node_modules/es-errors/.eslintrc +5 -0
  83. package/node_modules/es-errors/.github/FUNDING.yml +12 -0
  84. package/node_modules/es-errors/CHANGELOG.md +40 -0
  85. package/node_modules/es-errors/LICENSE +21 -0
  86. package/node_modules/es-errors/README.md +55 -0
  87. package/node_modules/es-errors/eval.d.ts +3 -0
  88. package/node_modules/es-errors/eval.js +4 -0
  89. package/node_modules/es-errors/index.d.ts +3 -0
  90. package/node_modules/es-errors/index.js +4 -0
  91. package/node_modules/es-errors/package.json +80 -0
  92. package/node_modules/es-errors/range.d.ts +3 -0
  93. package/node_modules/es-errors/range.js +4 -0
  94. package/node_modules/es-errors/ref.d.ts +3 -0
  95. package/node_modules/es-errors/ref.js +4 -0
  96. package/node_modules/es-errors/syntax.d.ts +3 -0
  97. package/node_modules/es-errors/syntax.js +4 -0
  98. package/node_modules/es-errors/test/index.js +19 -0
  99. package/node_modules/es-errors/tsconfig.json +49 -0
  100. package/node_modules/es-errors/type.d.ts +3 -0
  101. package/node_modules/es-errors/type.js +4 -0
  102. package/node_modules/es-errors/uri.d.ts +3 -0
  103. package/node_modules/es-errors/uri.js +4 -0
  104. package/node_modules/globalthis/.eslintrc +18 -0
  105. package/node_modules/globalthis/.nycrc +10 -0
  106. package/node_modules/globalthis/CHANGELOG.md +109 -0
  107. package/node_modules/globalthis/LICENSE +21 -0
  108. package/node_modules/globalthis/README.md +70 -0
  109. package/node_modules/globalthis/auto.js +3 -0
  110. package/node_modules/globalthis/implementation.browser.js +11 -0
  111. package/node_modules/globalthis/implementation.js +3 -0
  112. package/node_modules/globalthis/index.js +19 -0
  113. package/node_modules/globalthis/package.json +99 -0
  114. package/node_modules/globalthis/polyfill.js +10 -0
  115. package/node_modules/globalthis/shim.js +29 -0
  116. package/node_modules/globalthis/test/implementation.js +11 -0
  117. package/node_modules/globalthis/test/index.js +11 -0
  118. package/node_modules/globalthis/test/native.js +26 -0
  119. package/node_modules/globalthis/test/shimmed.js +29 -0
  120. package/node_modules/globalthis/test/tests.js +36 -0
  121. package/node_modules/gopd/.eslintrc +16 -0
  122. package/node_modules/gopd/.github/FUNDING.yml +12 -0
  123. package/node_modules/gopd/CHANGELOG.md +45 -0
  124. package/node_modules/gopd/LICENSE +21 -0
  125. package/node_modules/gopd/README.md +40 -0
  126. package/node_modules/gopd/gOPD.d.ts +1 -0
  127. package/node_modules/gopd/gOPD.js +4 -0
  128. package/node_modules/gopd/index.d.ts +5 -0
  129. package/node_modules/gopd/index.js +15 -0
  130. package/node_modules/gopd/package.json +77 -0
  131. package/node_modules/gopd/test/index.js +36 -0
  132. package/node_modules/gopd/tsconfig.json +9 -0
  133. package/node_modules/has-property-descriptors/.eslintrc +13 -0
  134. package/node_modules/has-property-descriptors/.github/FUNDING.yml +12 -0
  135. package/node_modules/has-property-descriptors/.nycrc +9 -0
  136. package/node_modules/has-property-descriptors/CHANGELOG.md +35 -0
  137. package/node_modules/has-property-descriptors/LICENSE +21 -0
  138. package/node_modules/has-property-descriptors/README.md +43 -0
  139. package/node_modules/has-property-descriptors/index.js +22 -0
  140. package/node_modules/has-property-descriptors/package.json +77 -0
  141. package/node_modules/has-property-descriptors/test/index.js +57 -0
  142. package/node_modules/is-it-type/License +19 -0
  143. package/node_modules/is-it-type/README.md +102 -0
  144. package/node_modules/is-it-type/changelog.md +239 -0
  145. package/node_modules/is-it-type/dist/cjs/is-it-type.js +173 -0
  146. package/node_modules/is-it-type/dist/cjs/is-it-type.js.map +1 -0
  147. package/node_modules/is-it-type/dist/cjs/is-it-type.min.js +2 -0
  148. package/node_modules/is-it-type/dist/cjs/is-it-type.min.js.map +1 -0
  149. package/node_modules/is-it-type/dist/esm/is-it-type.js +143 -0
  150. package/node_modules/is-it-type/dist/esm/is-it-type.js.map +1 -0
  151. package/node_modules/is-it-type/dist/esm/is-it-type.min.js +2 -0
  152. package/node_modules/is-it-type/dist/esm/is-it-type.min.js.map +1 -0
  153. package/node_modules/is-it-type/dist/esm/package.json +3 -0
  154. package/node_modules/is-it-type/dist/umd/is-it-type.js +450 -0
  155. package/node_modules/is-it-type/dist/umd/is-it-type.js.map +1 -0
  156. package/node_modules/is-it-type/dist/umd/is-it-type.min.js +2 -0
  157. package/node_modules/is-it-type/dist/umd/is-it-type.min.js.map +1 -0
  158. package/node_modules/is-it-type/es/index.js +8 -0
  159. package/node_modules/is-it-type/es/package.json +3 -0
  160. package/node_modules/is-it-type/index.js +10 -0
  161. package/node_modules/is-it-type/package.json +87 -0
  162. package/node_modules/is-it-type/src/index.js +169 -0
  163. package/node_modules/object-keys/.editorconfig +13 -0
  164. package/node_modules/object-keys/.eslintrc +17 -0
  165. package/node_modules/object-keys/.travis.yml +277 -0
  166. package/node_modules/object-keys/CHANGELOG.md +232 -0
  167. package/node_modules/object-keys/LICENSE +21 -0
  168. package/node_modules/object-keys/README.md +76 -0
  169. package/node_modules/object-keys/implementation.js +122 -0
  170. package/node_modules/object-keys/index.js +32 -0
  171. package/node_modules/object-keys/isArguments.js +17 -0
  172. package/node_modules/object-keys/package.json +88 -0
  173. package/node_modules/object-keys/test/index.js +5 -0
  174. package/node_modules/simple-invariant/License +19 -0
  175. package/node_modules/simple-invariant/README.md +64 -0
  176. package/node_modules/simple-invariant/changelog.md +31 -0
  177. package/node_modules/simple-invariant/index.js +19 -0
  178. package/node_modules/simple-invariant/package.json +50 -0
  179. package/node_modules/yauzl-promise/License +19 -0
  180. package/node_modules/yauzl-promise/README.md +440 -0
  181. package/node_modules/yauzl-promise/index.js +10 -0
  182. package/node_modules/yauzl-promise/lib/entry.js +312 -0
  183. package/node_modules/yauzl-promise/lib/index.js +160 -0
  184. package/node_modules/yauzl-promise/lib/reader.js +289 -0
  185. package/node_modules/yauzl-promise/lib/shared.js +20 -0
  186. package/node_modules/yauzl-promise/lib/utils.js +105 -0
  187. package/node_modules/yauzl-promise/lib/zip.js +1224 -0
  188. package/node_modules/yauzl-promise/package.json +56 -0
  189. package/package.json +9 -11
@@ -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 hasOwn = require('hasown');
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(hasOwn(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(hasOwn(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(hasOwn(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(hasOwn(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(hasOwn(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(hasOwn(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,13 @@
1
+ root = true
2
+
3
+ [*]
4
+ indent_style = tab;
5
+ insert_final_newline = true;
6
+ quote_type = auto;
7
+ space_after_anonymous_functions = true;
8
+ space_after_control_statements = true;
9
+ spaces_around_operators = true;
10
+ trim_trailing_whitespace = true;
11
+ spaces_in_brackets = false;
12
+ end_of_line = lf;
13
+
@@ -0,0 +1,19 @@
1
+ {
2
+ "root": true,
3
+
4
+ "extends": "@ljharb",
5
+
6
+ "rules": {
7
+ "id-length": [2, { "min": 1, "max": 35 }],
8
+ "max-params": [2, 4],
9
+ },
10
+
11
+ "overrides": [
12
+ {
13
+ "files": "test/**",
14
+ "rules": {
15
+ "max-lines-per-function": 0,
16
+ },
17
+ },
18
+ ],
19
+ }
@@ -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-properties
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,9 @@
1
+ {
2
+ "all": true,
3
+ "check-coverage": false,
4
+ "reporter": ["text-summary", "text", "html", "json"],
5
+ "exclude": [
6
+ "coverage",
7
+ "test"
8
+ ]
9
+ }
@@ -0,0 +1,91 @@
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.1](https://github.com/ljharb/define-properties/compare/v1.2.0...v1.2.1) - 2023-09-12
9
+
10
+ ### Commits
11
+
12
+ - [Refactor] use `define-data-property` [`e7782a7`](https://github.com/ljharb/define-properties/commit/e7782a7480a62f8b6e141b49371e6de4df176c97)
13
+ - [actions] use reusable rebase action [`cd249c3`](https://github.com/ljharb/define-properties/commit/cd249c3920607bc8eeb7c0cd5b672b810983cac5)
14
+ - [Dev Deps] update `@ljharb/eslint-config`, `aud`, `tape` [`8205f97`](https://github.com/ljharb/define-properties/commit/8205f9734a4da8ee5b3b29798788567a09b330e8)
15
+
16
+ ## [v1.2.0](https://github.com/ljharb/define-properties/compare/v1.1.4...v1.2.0) - 2023-02-10
17
+
18
+ ### Commits
19
+
20
+ - [New] if the predicate is boolean `true`, it compares the existing value with `===` as the predicate [`d8dd6fc`](https://github.com/ljharb/define-properties/commit/d8dd6fca40d7c5878a4b643b91e66ae5a513a194)
21
+ - [meta] add `auto-changelog` [`7ebe2b0`](https://github.com/ljharb/define-properties/commit/7ebe2b0a0f90e62b842942cd45e86864fe75d9f6)
22
+ - [meta] use `npmignore` to autogenerate an npmignore file [`647478a`](https://github.com/ljharb/define-properties/commit/647478a8401fbf053fb633c0a3a7c982da6bad74)
23
+ - [Dev Deps] update `@ljharb/eslint-config`, `aud`, `tape` [`e620d70`](https://github.com/ljharb/define-properties/commit/e620d707d2e1118a38796f22a862200eb0a53fff)
24
+ - [Dev Deps] update `aud`, `tape` [`f1e5072`](https://github.com/ljharb/define-properties/commit/f1e507225c2551a99ed4fe40d3fe71b0f44acf88)
25
+ - [actions] update checkout action [`628b3af`](https://github.com/ljharb/define-properties/commit/628b3af5c74b8f0963296d811a8f6fa657baf964)
26
+
27
+ <!-- auto-changelog-above -->
28
+
29
+ 1.1.4 / 2022-04-14
30
+ =================
31
+ * [Refactor] use `has-property-descriptors`
32
+ * [readme] add github actions/codecov badges
33
+ * [Docs] fix header parsing; remove testling
34
+ * [Deps] update `object-keys`
35
+ * [meta] use `prepublishOnly` script for npm 7+
36
+ * [meta] add `funding` field; create FUNDING.yml
37
+ * [actions] add "Allow Edits" workflow; automatic rebasing / merge commit blocking
38
+ * [actions] reuse common workflows
39
+ * [actions] update codecov uploader
40
+ * [actions] use `node/install` instead of `node/run`; use `codecov` action
41
+ * [Tests] migrate tests to Github Actions
42
+ * [Tests] run `nyc` on all tests; use `tape` runner
43
+ * [Tests] use shared travis-ci config
44
+ * [Tests] use `npx aud` instead of `nsp` or `npm audit` with hoops
45
+ * [Tests] remove `jscs`
46
+ * [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `safe-publish-latest`, `tape`; add `aud`, `safe-publish-latest`
47
+
48
+ 1.1.3 / 2018-08-14
49
+ =================
50
+ * [Refactor] use a for loop instead of `foreach` to make for smaller bundle sizes
51
+ * [Robustness] cache `Array.prototype.concat` and `Object.defineProperty`
52
+ * [Deps] update `object-keys`
53
+ * [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `nsp`, `tape`, `jscs`; remove unused eccheck script + dep
54
+ * [Tests] use pretest/posttest for linting/security
55
+ * [Tests] fix npm upgrades on older nodes
56
+
57
+ 1.1.2 / 2015-10-14
58
+ =================
59
+ * [Docs] Switch from vb.teelaun.ch to versionbadg.es for the npm version badge SVG
60
+ * [Deps] Update `object-keys`
61
+ * [Dev Deps] update `jscs`, `tape`, `eslint`, `@ljharb/eslint-config`, `nsp`
62
+ * [Tests] up to `io.js` `v3.3`, `node` `v4.2`
63
+
64
+ 1.1.1 / 2015-07-21
65
+ =================
66
+ * [Deps] Update `object-keys`
67
+ * [Dev Deps] Update `tape`, `eslint`
68
+ * [Tests] Test on `io.js` `v2.4`
69
+
70
+ 1.1.0 / 2015-07-01
71
+ =================
72
+ * [New] Add support for symbol-valued properties.
73
+ * [Dev Deps] Update `nsp`, `eslint`
74
+ * [Tests] Test up to `io.js` `v2.3`
75
+
76
+ 1.0.3 / 2015-05-30
77
+ =================
78
+ * Using a more reliable check for supported property descriptors.
79
+
80
+ 1.0.2 / 2015-05-23
81
+ =================
82
+ * Test up to `io.js` `v2.0`
83
+ * Update `tape`, `jscs`, `nsp`, `eslint`, `object-keys`, `editorconfig-tools`, `covert`
84
+
85
+ 1.0.1 / 2015-01-06
86
+ =================
87
+ * Update `object-keys` to fix ES3 support
88
+
89
+ 1.0.0 / 2015-01-04
90
+ =================
91
+ * v1.0.0
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (C) 2015 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
13
+ all 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
21
+ THE SOFTWARE.