node-red-contrib-tak-registration 0.11.4 → 0.11.6
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/node_modules/@types/node/README.md +1 -1
- package/node_modules/@types/node/buffer.d.ts +8 -7
- package/node_modules/@types/node/crypto.d.ts +38 -7
- package/node_modules/@types/node/dgram.d.ts +10 -0
- package/node_modules/@types/node/diagnostics_channel.d.ts +355 -1
- package/node_modules/@types/node/fs.d.ts +28 -8
- package/node_modules/@types/node/globals.d.ts +26 -0
- package/node_modules/@types/node/http.d.ts +6 -7
- package/node_modules/@types/node/module.d.ts +14 -0
- package/node_modules/@types/node/net.d.ts +8 -3
- package/node_modules/@types/node/package.json +3 -4
- package/node_modules/@types/node/perf_hooks.d.ts +12 -6
- package/node_modules/@types/node/process.d.ts +25 -3
- package/node_modules/@types/node/querystring.d.ts +3 -3
- package/node_modules/@types/node/stream/web.d.ts +17 -1
- package/node_modules/@types/node/string_decoder.d.ts +2 -2
- package/node_modules/@types/node/test.d.ts +98 -15
- package/node_modules/@types/node/tls.d.ts +1 -1
- package/node_modules/@types/node/ts4.8/buffer.d.ts +8 -7
- package/node_modules/@types/node/ts4.8/crypto.d.ts +41 -9
- package/node_modules/@types/node/ts4.8/dgram.d.ts +10 -0
- package/node_modules/@types/node/ts4.8/diagnostics_channel.d.ts +355 -1
- package/node_modules/@types/node/ts4.8/fs.d.ts +28 -8
- package/node_modules/@types/node/ts4.8/globals.d.ts +26 -0
- package/node_modules/@types/node/ts4.8/http.d.ts +6 -7
- package/node_modules/@types/node/ts4.8/module.d.ts +14 -0
- package/node_modules/@types/node/ts4.8/net.d.ts +8 -3
- package/node_modules/@types/node/ts4.8/perf_hooks.d.ts +13 -7
- package/node_modules/@types/node/ts4.8/process.d.ts +25 -3
- package/node_modules/@types/node/ts4.8/querystring.d.ts +3 -3
- package/node_modules/@types/node/ts4.8/stream/web.d.ts +17 -1
- package/node_modules/@types/node/ts4.8/string_decoder.d.ts +2 -2
- package/node_modules/@types/node/ts4.8/test.d.ts +98 -15
- package/node_modules/@types/node/ts4.8/tls.d.ts +1 -1
- package/node_modules/@types/node/ts4.8/url.d.ts +59 -42
- package/node_modules/@types/node/ts4.8/util.d.ts +1 -1
- package/node_modules/@types/node/ts4.8/v8.d.ts +134 -5
- package/node_modules/@types/node/ts4.8/wasi.d.ts +26 -5
- package/node_modules/@types/node/url.d.ts +59 -42
- package/node_modules/@types/node/v8.d.ts +134 -5
- package/node_modules/@types/node/wasi.d.ts +26 -5
- package/node_modules/axios/CHANGELOG.md +53 -0
- package/node_modules/axios/README.md +47 -5
- package/node_modules/axios/dist/axios.js +368 -4
- package/node_modules/axios/dist/axios.js.map +1 -1
- package/node_modules/axios/dist/axios.min.js +1 -1
- package/node_modules/axios/dist/axios.min.js.map +1 -1
- package/node_modules/axios/dist/browser/axios.cjs +28 -4
- package/node_modules/axios/dist/browser/axios.cjs.map +1 -1
- package/node_modules/axios/dist/esm/axios.js +28 -4
- package/node_modules/axios/dist/esm/axios.js.map +1 -1
- package/node_modules/axios/dist/esm/axios.min.js +1 -1
- package/node_modules/axios/dist/esm/axios.min.js.map +1 -1
- package/node_modules/axios/dist/node/axios.cjs +34 -6
- package/node_modules/axios/dist/node/axios.cjs.map +1 -1
- package/node_modules/axios/index.d.cts +1 -1
- package/node_modules/axios/index.d.ts +1 -1
- package/node_modules/axios/lib/adapters/http.js +6 -2
- package/node_modules/axios/lib/core/Axios.js +22 -1
- package/node_modules/axios/lib/env/data.js +1 -1
- package/node_modules/axios/lib/helpers/combineURLs.js +1 -1
- package/node_modules/axios/lib/helpers/formDataToJSON.js +3 -0
- package/node_modules/axios/package.json +2 -2
- package/node_modules/call-bind/CHANGELOG.md +16 -0
- package/node_modules/call-bind/index.js +2 -11
- package/node_modules/call-bind/package.json +11 -6
- package/node_modules/define-data-property/CHANGELOG.md +29 -0
- package/node_modules/define-data-property/index.d.ts +12 -3
- package/node_modules/define-data-property/index.js +4 -16
- package/node_modules/define-data-property/package.json +26 -33
- package/node_modules/define-data-property/test/index.js +10 -10
- package/node_modules/es-define-property/.eslintrc +13 -0
- package/node_modules/es-define-property/.github/FUNDING.yml +12 -0
- package/node_modules/es-define-property/.nycrc +9 -0
- package/node_modules/es-define-property/CHANGELOG.md +15 -0
- package/node_modules/es-define-property/LICENSE +21 -0
- package/node_modules/es-define-property/README.md +49 -0
- package/node_modules/es-define-property/index.d.ts +3 -0
- package/node_modules/es-define-property/index.js +16 -0
- package/node_modules/es-define-property/package.json +81 -0
- package/node_modules/es-define-property/test/index.js +55 -0
- package/node_modules/es-define-property/tsconfig.json +50 -0
- package/node_modules/es-errors/.eslintrc +5 -0
- package/node_modules/es-errors/.github/FUNDING.yml +12 -0
- package/node_modules/es-errors/CHANGELOG.md +40 -0
- package/node_modules/es-errors/LICENSE +21 -0
- package/node_modules/es-errors/README.md +55 -0
- package/node_modules/es-errors/eval.d.ts +3 -0
- package/node_modules/es-errors/eval.js +4 -0
- package/node_modules/es-errors/index.d.ts +3 -0
- package/node_modules/es-errors/index.js +4 -0
- package/node_modules/es-errors/package.json +80 -0
- package/node_modules/es-errors/range.d.ts +3 -0
- package/node_modules/es-errors/range.js +4 -0
- package/node_modules/es-errors/ref.d.ts +3 -0
- package/node_modules/es-errors/ref.js +4 -0
- package/node_modules/es-errors/syntax.d.ts +3 -0
- package/node_modules/es-errors/syntax.js +4 -0
- package/node_modules/es-errors/test/index.js +19 -0
- package/node_modules/es-errors/tsconfig.json +49 -0
- package/node_modules/es-errors/type.d.ts +3 -0
- package/node_modules/es-errors/type.js +4 -0
- package/node_modules/es-errors/uri.d.ts +3 -0
- package/node_modules/es-errors/uri.js +4 -0
- package/node_modules/fast-xml-parser/CHANGELOG.md +3 -0
- package/node_modules/fast-xml-parser/README.md +2 -1
- package/node_modules/fast-xml-parser/package.json +4 -1
- package/node_modules/fast-xml-parser/src/fxp.d.ts +363 -69
- package/node_modules/fast-xml-parser/src/xmlparser/OrderedObjParser.js +5 -5
- package/node_modules/follow-redirects/index.js +114 -75
- package/node_modules/follow-redirects/package.json +1 -1
- package/node_modules/get-intrinsic/CHANGELOG.md +18 -0
- package/node_modules/get-intrinsic/index.js +15 -7
- package/node_modules/get-intrinsic/package.json +12 -12
- package/node_modules/has-property-descriptors/CHANGELOG.md +8 -0
- package/node_modules/has-property-descriptors/index.js +3 -14
- package/node_modules/has-property-descriptors/package.json +5 -5
- package/node_modules/has-proto/CHANGELOG.md +15 -0
- package/node_modules/has-proto/index.d.ts +3 -0
- package/node_modules/has-proto/index.js +5 -1
- package/node_modules/has-proto/package.json +9 -5
- package/node_modules/has-proto/tsconfig.json +49 -0
- package/node_modules/has-tostringtag/.eslintrc +0 -6
- package/node_modules/has-tostringtag/.nycrc +13 -0
- package/node_modules/has-tostringtag/CHANGELOG.md +22 -0
- package/node_modules/has-tostringtag/index.d.ts +3 -0
- package/node_modules/has-tostringtag/index.js +1 -0
- package/node_modules/has-tostringtag/package.json +37 -13
- package/node_modules/has-tostringtag/shams.d.ts +3 -0
- package/node_modules/has-tostringtag/shams.js +1 -0
- package/node_modules/has-tostringtag/test/shams/core-js.js +3 -0
- package/node_modules/has-tostringtag/test/shams/get-own-property-symbols.js +2 -0
- package/node_modules/has-tostringtag/test/tests.js +2 -1
- package/node_modules/has-tostringtag/tsconfig.json +49 -0
- package/node_modules/hasown/CHANGELOG.md +8 -0
- package/node_modules/hasown/index.d.ts +3 -3
- package/node_modules/hasown/index.js +1 -1
- package/node_modules/hasown/package.json +13 -15
- package/node_modules/polygon-clipping/README.md +29 -26
- package/node_modules/polygon-clipping/dist/polygon-clipping.cjs.js +1398 -1421
- package/node_modules/polygon-clipping/dist/polygon-clipping.d.ts +13 -10
- package/node_modules/polygon-clipping/dist/polygon-clipping.esm.js +1139 -1427
- package/node_modules/polygon-clipping/dist/polygon-clipping.umd.js +1770 -1831
- package/node_modules/polygon-clipping/dist/polygon-clipping.umd.min.js +22 -8
- package/node_modules/polygon-clipping/dist/polygon-clipping.umd.min.js.map +1 -1
- package/node_modules/polygon-clipping/node_modules/robust-predicates/LICENSE +24 -0
- package/node_modules/polygon-clipping/node_modules/robust-predicates/README.md +82 -0
- package/node_modules/polygon-clipping/node_modules/robust-predicates/esm/incircle.js +765 -0
- package/node_modules/polygon-clipping/node_modules/robust-predicates/esm/insphere.js +766 -0
- package/node_modules/polygon-clipping/node_modules/robust-predicates/esm/orient2d.js +184 -0
- package/node_modules/polygon-clipping/node_modules/robust-predicates/esm/orient3d.js +462 -0
- package/node_modules/polygon-clipping/node_modules/robust-predicates/esm/util.js +138 -0
- package/node_modules/polygon-clipping/node_modules/robust-predicates/index.d.ts +49 -0
- package/node_modules/polygon-clipping/node_modules/robust-predicates/index.js +5 -0
- package/node_modules/polygon-clipping/node_modules/robust-predicates/package.json +75 -0
- package/node_modules/polygon-clipping/node_modules/robust-predicates/umd/incircle.js +908 -0
- package/node_modules/polygon-clipping/node_modules/robust-predicates/umd/incircle.min.js +1 -0
- package/node_modules/polygon-clipping/node_modules/robust-predicates/umd/insphere.js +914 -0
- package/node_modules/polygon-clipping/node_modules/robust-predicates/umd/insphere.min.js +1 -0
- package/node_modules/polygon-clipping/node_modules/robust-predicates/umd/orient2d.js +280 -0
- package/node_modules/polygon-clipping/node_modules/robust-predicates/umd/orient2d.min.js +1 -0
- package/node_modules/polygon-clipping/node_modules/robust-predicates/umd/orient3d.js +601 -0
- package/node_modules/polygon-clipping/node_modules/robust-predicates/umd/orient3d.min.js +1 -0
- package/node_modules/polygon-clipping/node_modules/robust-predicates/umd/predicates.js +2328 -0
- package/node_modules/polygon-clipping/node_modules/robust-predicates/umd/predicates.min.js +1 -0
- package/node_modules/polygon-clipping/package.json +30 -25
- package/node_modules/protobufjs/dist/light/protobuf.js +4 -4
- package/node_modules/protobufjs/dist/light/protobuf.js.map +1 -1
- package/node_modules/protobufjs/dist/light/protobuf.min.js +3 -3
- package/node_modules/protobufjs/dist/light/protobuf.min.js.map +1 -1
- package/node_modules/protobufjs/dist/minimal/protobuf.js +2 -2
- package/node_modules/protobufjs/dist/minimal/protobuf.min.js +2 -2
- package/node_modules/protobufjs/dist/protobuf.js +4 -4
- package/node_modules/protobufjs/dist/protobuf.js.map +1 -1
- package/node_modules/protobufjs/dist/protobuf.min.js +3 -3
- package/node_modules/protobufjs/dist/protobuf.min.js.map +1 -1
- package/node_modules/protobufjs/package.json +1 -1
- package/node_modules/protobufjs/src/root.js +2 -2
- package/node_modules/regexp.prototype.flags/CHANGELOG.md +13 -0
- package/node_modules/regexp.prototype.flags/implementation.js +2 -2
- package/node_modules/regexp.prototype.flags/package.json +11 -10
- package/node_modules/regexp.prototype.flags/test/tests.js +13 -13
- package/node_modules/set-function-length/CHANGELOG.md +18 -0
- package/node_modules/set-function-length/env.d.ts +6 -0
- package/node_modules/set-function-length/env.d.ts.map +1 -0
- package/node_modules/set-function-length/env.js +9 -4
- package/node_modules/set-function-length/index.d.ts +7 -0
- package/node_modules/set-function-length/index.d.ts.map +1 -0
- package/node_modules/set-function-length/index.js +6 -3
- package/node_modules/set-function-length/package.json +33 -13
- package/node_modules/set-function-length/tsconfig.json +59 -0
- package/node_modules/set-function-name/.eslintrc +1 -0
- package/node_modules/set-function-name/CHANGELOG.md +9 -0
- package/node_modules/set-function-name/index.d.ts +5 -0
- package/node_modules/set-function-name/index.js +4 -3
- package/node_modules/set-function-name/package.json +28 -9
- package/node_modules/set-function-name/tsconfig.json +59 -0
- package/package.json +4 -4
- package/tak-ingest.js +15 -7
- package/node_modules/define-data-property/index.d.ts.map +0 -1
- package/node_modules/hasown/index.d.ts.map +0 -1
- package/node_modules/polygon-clipping/CHANGELOG.md +0 -129
|
@@ -396,7 +396,7 @@ declare namespace axios {
|
|
|
396
396
|
maxBodyLength?: number;
|
|
397
397
|
maxRedirects?: number;
|
|
398
398
|
maxRate?: number | [MaxUploadRate, MaxDownloadRate];
|
|
399
|
-
beforeRedirect?: (options: Record<string, any>, responseDetails: {headers: Record<string, string
|
|
399
|
+
beforeRedirect?: (options: Record<string, any>, responseDetails: {headers: Record<string, string>, statusCode: HttpStatusCode}) => void;
|
|
400
400
|
socketPath?: string | null;
|
|
401
401
|
transport?: any;
|
|
402
402
|
httpAgent?: any;
|
|
@@ -337,7 +337,7 @@ export interface AxiosRequestConfig<D = any> {
|
|
|
337
337
|
maxBodyLength?: number;
|
|
338
338
|
maxRedirects?: number;
|
|
339
339
|
maxRate?: number | [MaxUploadRate, MaxDownloadRate];
|
|
340
|
-
beforeRedirect?: (options: Record<string, any>, responseDetails: {
|
|
340
|
+
beforeRedirect?: (options: Record<string, any>, responseDetails: {headers: Record<string, string>, statusCode: HttpStatusCode}) => void;
|
|
341
341
|
socketPath?: string | null;
|
|
342
342
|
transport?: any;
|
|
343
343
|
httpAgent?: any;
|
|
@@ -53,12 +53,12 @@ const supportedProtocols = platform.protocols.map(protocol => {
|
|
|
53
53
|
*
|
|
54
54
|
* @returns {Object<string, any>}
|
|
55
55
|
*/
|
|
56
|
-
function dispatchBeforeRedirect(options) {
|
|
56
|
+
function dispatchBeforeRedirect(options, responseDetails) {
|
|
57
57
|
if (options.beforeRedirects.proxy) {
|
|
58
58
|
options.beforeRedirects.proxy(options);
|
|
59
59
|
}
|
|
60
60
|
if (options.beforeRedirects.config) {
|
|
61
|
-
options.beforeRedirects.config(options);
|
|
61
|
+
options.beforeRedirects.config(options, responseDetails);
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
64
|
|
|
@@ -171,6 +171,10 @@ export default isHttpAdapterSupported && function httpAdapter(config) {
|
|
|
171
171
|
// hotfix to support opt.all option which is required for node 20.x
|
|
172
172
|
lookup = (hostname, opt, cb) => {
|
|
173
173
|
_lookup(hostname, opt, (err, arg0, arg1) => {
|
|
174
|
+
if (err) {
|
|
175
|
+
return cb(err);
|
|
176
|
+
}
|
|
177
|
+
|
|
174
178
|
const addresses = utils.isArray(arg0) ? arg0.map(addr => buildAddressEntry(addr)) : [buildAddressEntry(arg0, arg1)];
|
|
175
179
|
|
|
176
180
|
opt.all ? cb(err, addresses) : cb(err, addresses[0].address, addresses[0].family);
|
|
@@ -35,7 +35,28 @@ class Axios {
|
|
|
35
35
|
*
|
|
36
36
|
* @returns {Promise} The Promise to be fulfilled
|
|
37
37
|
*/
|
|
38
|
-
request(configOrUrl, config) {
|
|
38
|
+
async request(configOrUrl, config) {
|
|
39
|
+
try {
|
|
40
|
+
return await this._request(configOrUrl, config);
|
|
41
|
+
} catch (err) {
|
|
42
|
+
const dummy = {}
|
|
43
|
+
if (Error.captureStackTrace) {
|
|
44
|
+
Error.captureStackTrace(dummy)
|
|
45
|
+
} else {
|
|
46
|
+
dummy.stack = new Error().stack;
|
|
47
|
+
}
|
|
48
|
+
// slice off the Error: ... line
|
|
49
|
+
dummy.stack = dummy.stack.replace(/^.+\n/, '');
|
|
50
|
+
// match without the 2 top stack lines
|
|
51
|
+
if (!err.stack.endsWith(dummy.stack.replace(/^.+\n.+\n/, ''))) {
|
|
52
|
+
err.stack += '\n' + dummy.stack
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
throw err;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
_request(configOrUrl, config) {
|
|
39
60
|
/*eslint no-param-reassign:0*/
|
|
40
61
|
// Allow for axios('example/url'[, config]) a la fetch API
|
|
41
62
|
if (typeof configOrUrl === 'string') {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = "1.6.
|
|
1
|
+
export const VERSION = "1.6.6";
|
|
@@ -49,6 +49,9 @@ function arrayToObject(arr) {
|
|
|
49
49
|
function formDataToJSON(formData) {
|
|
50
50
|
function buildPath(path, value, target, index) {
|
|
51
51
|
let name = path[index++];
|
|
52
|
+
|
|
53
|
+
if (name === '__proto__') return true;
|
|
54
|
+
|
|
52
55
|
const isNumericKey = Number.isFinite(+name);
|
|
53
56
|
const isLast = index >= path.length;
|
|
54
57
|
name = !name && utils.isArray(target) ? target.length : name;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "axios",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.6",
|
|
4
4
|
"description": "Promise based HTTP client for the browser and node.js",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"exports": {
|
|
@@ -146,7 +146,7 @@
|
|
|
146
146
|
"unpkg": "dist/axios.min.js",
|
|
147
147
|
"typings": "./index.d.ts",
|
|
148
148
|
"dependencies": {
|
|
149
|
-
"follow-redirects": "^1.15.
|
|
149
|
+
"follow-redirects": "^1.15.4",
|
|
150
150
|
"form-data": "^4.0.0",
|
|
151
151
|
"proxy-from-env": "^1.1.0"
|
|
152
152
|
},
|
|
@@ -5,6 +5,22 @@ 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.7](https://github.com/ljharb/call-bind/compare/v1.0.6...v1.0.7) - 2024-02-12
|
|
9
|
+
|
|
10
|
+
### Commits
|
|
11
|
+
|
|
12
|
+
- [Refactor] use `es-define-property` [`09b76a0`](https://github.com/ljharb/call-bind/commit/09b76a01634440461d44a80c9924ec4b500f3b03)
|
|
13
|
+
- [Deps] update `get-intrinsic`, `set-function-length` [`ad5136d`](https://github.com/ljharb/call-bind/commit/ad5136ddda2a45c590959829ad3dce0c9f4e3590)
|
|
14
|
+
|
|
15
|
+
## [v1.0.6](https://github.com/ljharb/call-bind/compare/v1.0.5...v1.0.6) - 2024-02-05
|
|
16
|
+
|
|
17
|
+
### Commits
|
|
18
|
+
|
|
19
|
+
- [Dev Deps] update `aud`, `npmignore`, `tape` [`d564d5c`](https://github.com/ljharb/call-bind/commit/d564d5ce3e06a19df4d499c77f8d1a9da44e77aa)
|
|
20
|
+
- [Deps] update `get-intrinsic`, `set-function-length` [`cfc2bdc`](https://github.com/ljharb/call-bind/commit/cfc2bdca7b633df0e0e689e6b637f668f1c6792e)
|
|
21
|
+
- [Refactor] use `es-errors`, so things that only need those do not need `get-intrinsic` [`64cd289`](https://github.com/ljharb/call-bind/commit/64cd289ae5862c250a4ca80aa8d461047c166af5)
|
|
22
|
+
- [meta] add missing `engines.node` [`32a4038`](https://github.com/ljharb/call-bind/commit/32a4038857b62179f7f9b7b3df2c5260036be582)
|
|
23
|
+
|
|
8
24
|
## [v1.0.5](https://github.com/ljharb/call-bind/compare/v1.0.4...v1.0.5) - 2023-10-19
|
|
9
25
|
|
|
10
26
|
### Commits
|
|
@@ -4,23 +4,14 @@ var bind = require('function-bind');
|
|
|
4
4
|
var GetIntrinsic = require('get-intrinsic');
|
|
5
5
|
var setFunctionLength = require('set-function-length');
|
|
6
6
|
|
|
7
|
-
var $TypeError =
|
|
7
|
+
var $TypeError = require('es-errors/type');
|
|
8
8
|
var $apply = GetIntrinsic('%Function.prototype.apply%');
|
|
9
9
|
var $call = GetIntrinsic('%Function.prototype.call%');
|
|
10
10
|
var $reflectApply = GetIntrinsic('%Reflect.apply%', true) || bind.call($call, $apply);
|
|
11
11
|
|
|
12
|
-
var $defineProperty =
|
|
12
|
+
var $defineProperty = require('es-define-property');
|
|
13
13
|
var $max = GetIntrinsic('%Math.max%');
|
|
14
14
|
|
|
15
|
-
if ($defineProperty) {
|
|
16
|
-
try {
|
|
17
|
-
$defineProperty({}, 'a', { value: 1 });
|
|
18
|
-
} catch (e) {
|
|
19
|
-
// IE 8 has a broken defineProperty
|
|
20
|
-
$defineProperty = null;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
|
|
24
15
|
module.exports = function callBind(originalFunction) {
|
|
25
16
|
if (typeof originalFunction !== 'function') {
|
|
26
17
|
throw new $TypeError('a function is required');
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "call-bind",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.7",
|
|
4
4
|
"description": "Robustly `.call.bind()` a function",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"exports": {
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"homepage": "https://github.com/ljharb/call-bind#readme",
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"@ljharb/eslint-config": "^21.1.0",
|
|
54
|
-
"aud": "^2.0.
|
|
54
|
+
"aud": "^2.0.4",
|
|
55
55
|
"auto-changelog": "^2.4.0",
|
|
56
56
|
"es-value-fixtures": "^1.4.2",
|
|
57
57
|
"eslint": "=8.8.0",
|
|
@@ -60,16 +60,18 @@
|
|
|
60
60
|
"gopd": "^1.0.1",
|
|
61
61
|
"has-strict-mode": "^1.0.1",
|
|
62
62
|
"in-publish": "^2.0.1",
|
|
63
|
-
"npmignore": "^0.3.
|
|
63
|
+
"npmignore": "^0.3.1",
|
|
64
64
|
"nyc": "^10.3.2",
|
|
65
65
|
"object-inspect": "^1.13.1",
|
|
66
66
|
"safe-publish-latest": "^2.0.0",
|
|
67
|
-
"tape": "^5.7.
|
|
67
|
+
"tape": "^5.7.4"
|
|
68
68
|
},
|
|
69
69
|
"dependencies": {
|
|
70
|
+
"es-define-property": "^1.0.0",
|
|
71
|
+
"es-errors": "^1.3.0",
|
|
70
72
|
"function-bind": "^1.1.2",
|
|
71
|
-
"get-intrinsic": "^1.2.
|
|
72
|
-
"set-function-length": "^1.
|
|
73
|
+
"get-intrinsic": "^1.2.4",
|
|
74
|
+
"set-function-length": "^1.2.1"
|
|
73
75
|
},
|
|
74
76
|
"testling": {
|
|
75
77
|
"files": "test/index.js"
|
|
@@ -86,5 +88,8 @@
|
|
|
86
88
|
"ignore": [
|
|
87
89
|
".github/workflows"
|
|
88
90
|
]
|
|
91
|
+
},
|
|
92
|
+
"engines": {
|
|
93
|
+
"node": ">= 0.4"
|
|
89
94
|
}
|
|
90
95
|
}
|
|
@@ -5,6 +5,35 @@ 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.1.4](https://github.com/ljharb/define-data-property/compare/v1.1.3...v1.1.4) - 2024-02-13
|
|
9
|
+
|
|
10
|
+
### Commits
|
|
11
|
+
|
|
12
|
+
- [Refactor] use `es-define-property` [`90f2f4c`](https://github.com/ljharb/define-data-property/commit/90f2f4cc20298401e71c28e1e08888db12021453)
|
|
13
|
+
- [Dev Deps] update `@types/object.getownpropertydescriptors` [`cd929d9`](https://github.com/ljharb/define-data-property/commit/cd929d9a04f5f2fdcfa9d5be140940b91a083153)
|
|
14
|
+
|
|
15
|
+
## [v1.1.3](https://github.com/ljharb/define-data-property/compare/v1.1.2...v1.1.3) - 2024-02-12
|
|
16
|
+
|
|
17
|
+
### Commits
|
|
18
|
+
|
|
19
|
+
- [types] hand-write d.ts instead of emitting it [`0cbc988`](https://github.com/ljharb/define-data-property/commit/0cbc988203c105f2d97948327c7167ebd33bd318)
|
|
20
|
+
- [meta] simplify `exports` [`690781e`](https://github.com/ljharb/define-data-property/commit/690781eed28bbf2d6766237efda0ba6dd591609e)
|
|
21
|
+
- [Dev Deps] update `hasown`; clean up DT packages [`6cdfd1c`](https://github.com/ljharb/define-data-property/commit/6cdfd1cb2d91d791bfd18cda5d5cab232fd5d8fc)
|
|
22
|
+
- [actions] cleanup [`3142bc6`](https://github.com/ljharb/define-data-property/commit/3142bc6a4bc406a51f5b04f31e98562a27f35ffd)
|
|
23
|
+
- [meta] add `funding` [`8474423`](https://github.com/ljharb/define-data-property/commit/847442391a79779af3e0f1bf0b5bb923552b7804)
|
|
24
|
+
- [Deps] update `get-intrinsic` [`3e9be00`](https://github.com/ljharb/define-data-property/commit/3e9be00e07784ba34e7c77d8bc0fdbc832ad61de)
|
|
25
|
+
|
|
26
|
+
## [v1.1.2](https://github.com/ljharb/define-data-property/compare/v1.1.1...v1.1.2) - 2024-02-05
|
|
27
|
+
|
|
28
|
+
### Commits
|
|
29
|
+
|
|
30
|
+
- [Dev Deps] update @types packages, `object-inspect`, `tape`, `typescript` [`df41bf8`](https://github.com/ljharb/define-data-property/commit/df41bf84ca3456be6226055caab44e38e3a7fd2f)
|
|
31
|
+
- [Dev Deps] update DT packages, `aud`, `npmignore`, `tape`, typescript` [`fab0e4e`](https://github.com/ljharb/define-data-property/commit/fab0e4ec709ee02b79f42d6db3ee5f26e0a34b8a)
|
|
32
|
+
- [Dev Deps] use `hasown` instead of `has` [`aa51ef9`](https://github.com/ljharb/define-data-property/commit/aa51ef93f6403d49d9bb72a807bcdb6e418978c0)
|
|
33
|
+
- [Refactor] use `es-errors`, so things that only need those do not need `get-intrinsic` [`d89be50`](https://github.com/ljharb/define-data-property/commit/d89be50571175888d391238605122679f7e65ffc)
|
|
34
|
+
- [Deps] update `has-property-descriptors` [`7af887c`](https://github.com/ljharb/define-data-property/commit/7af887c9083b59b195b0079e04815cfed9fcee2b)
|
|
35
|
+
- [Deps] update `get-intrinsic` [`bb8728e`](https://github.com/ljharb/define-data-property/commit/bb8728ec42cd998505a7157ae24853a560c20646)
|
|
36
|
+
|
|
8
37
|
## [v1.1.1](https://github.com/ljharb/define-data-property/compare/v1.1.0...v1.1.1) - 2023-10-12
|
|
9
38
|
|
|
10
39
|
### Commits
|
|
@@ -1,3 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
|
|
2
|
+
declare function defineDataProperty(
|
|
3
|
+
obj: Record<PropertyKey, unknown>,
|
|
4
|
+
property: keyof typeof obj,
|
|
5
|
+
value: typeof obj[typeof property],
|
|
6
|
+
nonEnumerable?: boolean | null,
|
|
7
|
+
nonWritable?: boolean | null,
|
|
8
|
+
nonConfigurable?: boolean | null,
|
|
9
|
+
loose?: boolean
|
|
10
|
+
): void;
|
|
11
|
+
|
|
12
|
+
export = defineDataProperty;
|
|
@@ -1,25 +1,13 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var $defineProperty = require('es-define-property');
|
|
4
4
|
|
|
5
|
-
var
|
|
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%');
|
|
5
|
+
var $SyntaxError = require('es-errors/syntax');
|
|
6
|
+
var $TypeError = require('es-errors/type');
|
|
19
7
|
|
|
20
8
|
var gopd = require('gopd');
|
|
21
9
|
|
|
22
|
-
/** @type {(
|
|
10
|
+
/** @type {import('.')} */
|
|
23
11
|
module.exports = function defineDataProperty(
|
|
24
12
|
obj,
|
|
25
13
|
property,
|
|
@@ -1,28 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "define-data-property",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.4",
|
|
4
4
|
"description": "Define a data property on an object. Will fall back to assignment in an engine without descriptors.",
|
|
5
5
|
"main": "index.js",
|
|
6
|
+
"types": "./index.d.ts",
|
|
6
7
|
"exports": {
|
|
7
|
-
".":
|
|
8
|
-
{
|
|
9
|
-
"types": "./index.d.ts",
|
|
10
|
-
"default": "./index.js"
|
|
11
|
-
},
|
|
12
|
-
"./index.js"
|
|
13
|
-
],
|
|
8
|
+
".": "./index.js",
|
|
14
9
|
"./package.json": "./package.json"
|
|
15
10
|
},
|
|
16
11
|
"sideEffects": false,
|
|
17
|
-
"types": "./index.d.ts",
|
|
18
12
|
"scripts": {
|
|
19
|
-
"prepack": "npmignore --auto --commentLines=autogenerated
|
|
13
|
+
"prepack": "npmignore --auto --commentLines=autogenerated",
|
|
20
14
|
"prepublish": "not-in-publish || npm run prepublishOnly",
|
|
21
15
|
"prepublishOnly": "safe-publish-latest",
|
|
22
16
|
"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
17
|
"prelint": "evalmd README.md",
|
|
27
18
|
"lint": "eslint --ext=js,mjs .",
|
|
28
19
|
"postlint": "npm run tsc",
|
|
@@ -50,43 +41,47 @@
|
|
|
50
41
|
"writable"
|
|
51
42
|
],
|
|
52
43
|
"author": "Jordan Harband <ljharb@gmail.com>",
|
|
44
|
+
"funding": {
|
|
45
|
+
"url": "https://github.com/sponsors/ljharb"
|
|
46
|
+
},
|
|
53
47
|
"license": "MIT",
|
|
54
48
|
"bugs": {
|
|
55
49
|
"url": "https://github.com/ljharb/define-data-property/issues"
|
|
56
50
|
},
|
|
57
51
|
"homepage": "https://github.com/ljharb/define-data-property#readme",
|
|
58
52
|
"dependencies": {
|
|
59
|
-
"
|
|
60
|
-
"
|
|
61
|
-
"
|
|
53
|
+
"es-define-property": "^1.0.0",
|
|
54
|
+
"es-errors": "^1.3.0",
|
|
55
|
+
"gopd": "^1.0.1"
|
|
62
56
|
},
|
|
63
57
|
"devDependencies": {
|
|
64
58
|
"@ljharb/eslint-config": "^21.1.0",
|
|
65
|
-
"@types/
|
|
66
|
-
"@types/
|
|
67
|
-
"@types/
|
|
68
|
-
"@types/
|
|
69
|
-
"@types/
|
|
70
|
-
"@types/
|
|
71
|
-
"@types/
|
|
72
|
-
"@types/object
|
|
73
|
-
"@types/
|
|
74
|
-
"
|
|
59
|
+
"@types/call-bind": "^1.0.5",
|
|
60
|
+
"@types/define-properties": "^1.1.5",
|
|
61
|
+
"@types/es-value-fixtures": "^1.4.4",
|
|
62
|
+
"@types/for-each": "^0.3.3",
|
|
63
|
+
"@types/get-intrinsic": "^1.2.2",
|
|
64
|
+
"@types/gopd": "^1.0.3",
|
|
65
|
+
"@types/has-property-descriptors": "^1.0.3",
|
|
66
|
+
"@types/object-inspect": "^1.8.4",
|
|
67
|
+
"@types/object.getownpropertydescriptors": "^2.1.4",
|
|
68
|
+
"@types/tape": "^5.6.4",
|
|
69
|
+
"aud": "^2.0.4",
|
|
75
70
|
"auto-changelog": "^2.4.0",
|
|
76
71
|
"es-value-fixtures": "^1.4.2",
|
|
77
72
|
"eslint": "=8.8.0",
|
|
78
73
|
"evalmd": "^0.0.19",
|
|
79
74
|
"for-each": "^0.3.3",
|
|
80
|
-
"
|
|
75
|
+
"hasown": "^2.0.1",
|
|
81
76
|
"in-publish": "^2.0.1",
|
|
82
|
-
"npmignore": "^0.3.
|
|
77
|
+
"npmignore": "^0.3.1",
|
|
83
78
|
"nyc": "^10.3.2",
|
|
84
|
-
"object-inspect": "^1.
|
|
79
|
+
"object-inspect": "^1.13.1",
|
|
85
80
|
"object.getownpropertydescriptors": "^2.1.7",
|
|
86
81
|
"reflect.ownkeys": "^1.1.4",
|
|
87
82
|
"safe-publish-latest": "^2.0.0",
|
|
88
|
-
"tape": "^5.7.
|
|
89
|
-
"typescript": "
|
|
83
|
+
"tape": "^5.7.4",
|
|
84
|
+
"typescript": "next"
|
|
90
85
|
},
|
|
91
86
|
"engines": {
|
|
92
87
|
"node": ">= 0.4"
|
|
@@ -105,8 +100,6 @@
|
|
|
105
100
|
"publishConfig": {
|
|
106
101
|
"ignore": [
|
|
107
102
|
".github/workflows",
|
|
108
|
-
"!*.ts",
|
|
109
|
-
"!*.ts.map",
|
|
110
103
|
"types/reflect.ownkeys"
|
|
111
104
|
]
|
|
112
105
|
}
|
|
@@ -4,7 +4,7 @@ var test = require('tape');
|
|
|
4
4
|
var v = require('es-value-fixtures');
|
|
5
5
|
var forEach = require('for-each');
|
|
6
6
|
var inspect = require('object-inspect');
|
|
7
|
-
var
|
|
7
|
+
var hasOwn = require('hasown');
|
|
8
8
|
var hasPropertyDescriptors = require('has-property-descriptors')();
|
|
9
9
|
var getOwnPropertyDescriptors = require('object.getownpropertydescriptors');
|
|
10
10
|
var ownKeys = require('reflect.ownkeys');
|
|
@@ -34,21 +34,21 @@ test('defineDataProperty', function (t) {
|
|
|
34
34
|
forEach(v.nonBooleans, function (nonBoolean) {
|
|
35
35
|
if (nonBoolean !== null) {
|
|
36
36
|
st['throws'](
|
|
37
|
-
|
|
37
|
+
// @ts-expect-error
|
|
38
38
|
function () { defineDataProperty({}, 'key', 'value', nonBoolean); },
|
|
39
39
|
TypeError,
|
|
40
40
|
'throws on non-boolean nonEnumerable: ' + inspect(nonBoolean)
|
|
41
41
|
);
|
|
42
42
|
|
|
43
43
|
st['throws'](
|
|
44
|
-
|
|
44
|
+
// @ts-expect-error
|
|
45
45
|
function () { defineDataProperty({}, 'key', 'value', false, nonBoolean); },
|
|
46
46
|
TypeError,
|
|
47
47
|
'throws on non-boolean nonWritable: ' + inspect(nonBoolean)
|
|
48
48
|
);
|
|
49
49
|
|
|
50
50
|
st['throws'](
|
|
51
|
-
|
|
51
|
+
// @ts-expect-error
|
|
52
52
|
function () { defineDataProperty({}, 'key', 'value', false, false, nonBoolean); },
|
|
53
53
|
TypeError,
|
|
54
54
|
'throws on non-boolean nonConfigurable: ' + inspect(nonBoolean)
|
|
@@ -62,28 +62,28 @@ test('defineDataProperty', function (t) {
|
|
|
62
62
|
t.test('normal data property', function (st) {
|
|
63
63
|
/** @type {Record<PropertyKey, string>} */
|
|
64
64
|
var obj = { existing: 'existing property' };
|
|
65
|
-
st.ok(
|
|
65
|
+
st.ok(hasOwn(obj, 'existing'), 'has initial own property');
|
|
66
66
|
st.equal(obj.existing, 'existing property', 'has expected initial value');
|
|
67
67
|
|
|
68
68
|
var res = defineDataProperty(obj, 'added', 'added property');
|
|
69
69
|
st.equal(res, void undefined, 'returns `undefined`');
|
|
70
|
-
st.ok(
|
|
70
|
+
st.ok(hasOwn(obj, 'added'), 'has expected own property');
|
|
71
71
|
st.equal(obj.added, 'added property', 'has expected value');
|
|
72
72
|
|
|
73
73
|
defineDataProperty(obj, 'existing', 'new value');
|
|
74
|
-
st.ok(
|
|
74
|
+
st.ok(hasOwn(obj, 'existing'), 'still has expected own property');
|
|
75
75
|
st.equal(obj.existing, 'new value', 'has new expected value');
|
|
76
76
|
|
|
77
77
|
defineDataProperty(obj, 'explicit1', 'new value', false);
|
|
78
|
-
st.ok(
|
|
78
|
+
st.ok(hasOwn(obj, 'explicit1'), 'has expected own property (explicit enumerable)');
|
|
79
79
|
st.equal(obj.explicit1, 'new value', 'has new expected value (explicit enumerable)');
|
|
80
80
|
|
|
81
81
|
defineDataProperty(obj, 'explicit2', 'new value', false, false);
|
|
82
|
-
st.ok(
|
|
82
|
+
st.ok(hasOwn(obj, 'explicit2'), 'has expected own property (explicit writable)');
|
|
83
83
|
st.equal(obj.explicit2, 'new value', 'has new expected value (explicit writable)');
|
|
84
84
|
|
|
85
85
|
defineDataProperty(obj, 'explicit3', 'new value', false, false, false);
|
|
86
|
-
st.ok(
|
|
86
|
+
st.ok(hasOwn(obj, 'explicit3'), 'has expected own property (explicit configurable)');
|
|
87
87
|
st.equal(obj.explicit3, 'new value', 'has new expected value (explicit configurable)');
|
|
88
88
|
|
|
89
89
|
st.end();
|
|
@@ -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/es-define-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 a single custom sponsorship URL
|
|
@@ -0,0 +1,15 @@
|
|
|
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 - 2024-02-12
|
|
9
|
+
|
|
10
|
+
### Commits
|
|
11
|
+
|
|
12
|
+
- Initial implementation, tests, readme, types [`3e154e1`](https://github.com/ljharb/es-define-property/commit/3e154e11a2fee09127220f5e503bf2c0a31dd480)
|
|
13
|
+
- Initial commit [`07d98de`](https://github.com/ljharb/es-define-property/commit/07d98de34a4dc31ff5e83a37c0c3f49e0d85cd50)
|
|
14
|
+
- npm init [`c4eb634`](https://github.com/ljharb/es-define-property/commit/c4eb6348b0d3886aac36cef34ad2ee0665ea6f3e)
|
|
15
|
+
- Only apps should have lockfiles [`7af86ec`](https://github.com/ljharb/es-define-property/commit/7af86ec1d311ec0b17fdfe616a25f64276903856)
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 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,49 @@
|
|
|
1
|
+
# es-define-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
|
+
`Object.defineProperty`, but not IE 8's broken one.
|
|
11
|
+
|
|
12
|
+
## Example
|
|
13
|
+
|
|
14
|
+
```js
|
|
15
|
+
const assert = require('assert');
|
|
16
|
+
|
|
17
|
+
const $defineProperty = require('es-define-property');
|
|
18
|
+
|
|
19
|
+
if ($defineProperty) {
|
|
20
|
+
assert.equal($defineProperty, Object.defineProperty);
|
|
21
|
+
} else if (Object.defineProperty) {
|
|
22
|
+
assert.equal($defineProperty, false, 'this is IE 8');
|
|
23
|
+
} else {
|
|
24
|
+
assert.equal($defineProperty, false, 'this is an ES3 engine');
|
|
25
|
+
}
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Tests
|
|
29
|
+
Simply clone the repo, `npm install`, and run `npm test`
|
|
30
|
+
|
|
31
|
+
## Security
|
|
32
|
+
|
|
33
|
+
Please email [@ljharb](https://github.com/ljharb) or see https://tidelift.com/security if you have a potential security vulnerability to report.
|
|
34
|
+
|
|
35
|
+
[package-url]: https://npmjs.org/package/es-define-property
|
|
36
|
+
[npm-version-svg]: https://versionbadg.es/ljharb/es-define-property.svg
|
|
37
|
+
[deps-svg]: https://david-dm.org/ljharb/es-define-property.svg
|
|
38
|
+
[deps-url]: https://david-dm.org/ljharb/es-define-property
|
|
39
|
+
[dev-deps-svg]: https://david-dm.org/ljharb/es-define-property/dev-status.svg
|
|
40
|
+
[dev-deps-url]: https://david-dm.org/ljharb/es-define-property#info=devDependencies
|
|
41
|
+
[npm-badge-png]: https://nodei.co/npm/es-define-property.png?downloads=true&stars=true
|
|
42
|
+
[license-image]: https://img.shields.io/npm/l/es-define-property.svg
|
|
43
|
+
[license-url]: LICENSE
|
|
44
|
+
[downloads-image]: https://img.shields.io/npm/dm/es-define-property.svg
|
|
45
|
+
[downloads-url]: https://npm-stat.com/charts.html?package=es-define-property
|
|
46
|
+
[codecov-image]: https://codecov.io/gh/ljharb/es-define-property/branch/main/graphs/badge.svg
|
|
47
|
+
[codecov-url]: https://app.codecov.io/gh/ljharb/es-define-property/
|
|
48
|
+
[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/ljharb/es-define-property
|
|
49
|
+
[actions-url]: https://github.com/ljharb/es-define-property/actions
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var GetIntrinsic = require('get-intrinsic');
|
|
4
|
+
|
|
5
|
+
/** @type {import('.')} */
|
|
6
|
+
var $defineProperty = GetIntrinsic('%Object.defineProperty%', true) || false;
|
|
7
|
+
if ($defineProperty) {
|
|
8
|
+
try {
|
|
9
|
+
$defineProperty({}, 'a', { value: 1 });
|
|
10
|
+
} catch (e) {
|
|
11
|
+
// IE 8 has a broken defineProperty
|
|
12
|
+
$defineProperty = false;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
module.exports = $defineProperty;
|