node-red-contrib-tak-registration 0.11.5 → 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.
Files changed (202) hide show
  1. package/node_modules/@types/node/README.md +1 -1
  2. package/node_modules/@types/node/buffer.d.ts +8 -7
  3. package/node_modules/@types/node/crypto.d.ts +38 -7
  4. package/node_modules/@types/node/dgram.d.ts +10 -0
  5. package/node_modules/@types/node/diagnostics_channel.d.ts +355 -1
  6. package/node_modules/@types/node/fs.d.ts +28 -8
  7. package/node_modules/@types/node/globals.d.ts +26 -0
  8. package/node_modules/@types/node/http.d.ts +6 -7
  9. package/node_modules/@types/node/module.d.ts +14 -0
  10. package/node_modules/@types/node/net.d.ts +8 -3
  11. package/node_modules/@types/node/package.json +3 -4
  12. package/node_modules/@types/node/perf_hooks.d.ts +12 -6
  13. package/node_modules/@types/node/process.d.ts +25 -3
  14. package/node_modules/@types/node/querystring.d.ts +3 -3
  15. package/node_modules/@types/node/stream/web.d.ts +17 -1
  16. package/node_modules/@types/node/string_decoder.d.ts +2 -2
  17. package/node_modules/@types/node/test.d.ts +98 -15
  18. package/node_modules/@types/node/tls.d.ts +1 -1
  19. package/node_modules/@types/node/ts4.8/buffer.d.ts +8 -7
  20. package/node_modules/@types/node/ts4.8/crypto.d.ts +41 -9
  21. package/node_modules/@types/node/ts4.8/dgram.d.ts +10 -0
  22. package/node_modules/@types/node/ts4.8/diagnostics_channel.d.ts +355 -1
  23. package/node_modules/@types/node/ts4.8/fs.d.ts +28 -8
  24. package/node_modules/@types/node/ts4.8/globals.d.ts +26 -0
  25. package/node_modules/@types/node/ts4.8/http.d.ts +6 -7
  26. package/node_modules/@types/node/ts4.8/module.d.ts +14 -0
  27. package/node_modules/@types/node/ts4.8/net.d.ts +8 -3
  28. package/node_modules/@types/node/ts4.8/perf_hooks.d.ts +13 -7
  29. package/node_modules/@types/node/ts4.8/process.d.ts +25 -3
  30. package/node_modules/@types/node/ts4.8/querystring.d.ts +3 -3
  31. package/node_modules/@types/node/ts4.8/stream/web.d.ts +17 -1
  32. package/node_modules/@types/node/ts4.8/string_decoder.d.ts +2 -2
  33. package/node_modules/@types/node/ts4.8/test.d.ts +98 -15
  34. package/node_modules/@types/node/ts4.8/tls.d.ts +1 -1
  35. package/node_modules/@types/node/ts4.8/url.d.ts +59 -42
  36. package/node_modules/@types/node/ts4.8/util.d.ts +1 -1
  37. package/node_modules/@types/node/ts4.8/v8.d.ts +134 -5
  38. package/node_modules/@types/node/ts4.8/wasi.d.ts +26 -5
  39. package/node_modules/@types/node/url.d.ts +59 -42
  40. package/node_modules/@types/node/v8.d.ts +134 -5
  41. package/node_modules/@types/node/wasi.d.ts +26 -5
  42. package/node_modules/axios/CHANGELOG.md +53 -0
  43. package/node_modules/axios/README.md +47 -5
  44. package/node_modules/axios/dist/axios.js +368 -4
  45. package/node_modules/axios/dist/axios.js.map +1 -1
  46. package/node_modules/axios/dist/axios.min.js +1 -1
  47. package/node_modules/axios/dist/axios.min.js.map +1 -1
  48. package/node_modules/axios/dist/browser/axios.cjs +28 -4
  49. package/node_modules/axios/dist/browser/axios.cjs.map +1 -1
  50. package/node_modules/axios/dist/esm/axios.js +28 -4
  51. package/node_modules/axios/dist/esm/axios.js.map +1 -1
  52. package/node_modules/axios/dist/esm/axios.min.js +1 -1
  53. package/node_modules/axios/dist/esm/axios.min.js.map +1 -1
  54. package/node_modules/axios/dist/node/axios.cjs +34 -6
  55. package/node_modules/axios/dist/node/axios.cjs.map +1 -1
  56. package/node_modules/axios/index.d.cts +1 -1
  57. package/node_modules/axios/index.d.ts +1 -1
  58. package/node_modules/axios/lib/adapters/http.js +6 -2
  59. package/node_modules/axios/lib/core/Axios.js +22 -1
  60. package/node_modules/axios/lib/env/data.js +1 -1
  61. package/node_modules/axios/lib/helpers/combineURLs.js +1 -1
  62. package/node_modules/axios/lib/helpers/formDataToJSON.js +3 -0
  63. package/node_modules/axios/package.json +2 -2
  64. package/node_modules/call-bind/CHANGELOG.md +16 -0
  65. package/node_modules/call-bind/index.js +2 -11
  66. package/node_modules/call-bind/package.json +11 -6
  67. package/node_modules/define-data-property/CHANGELOG.md +29 -0
  68. package/node_modules/define-data-property/index.d.ts +12 -3
  69. package/node_modules/define-data-property/index.js +4 -16
  70. package/node_modules/define-data-property/package.json +26 -33
  71. package/node_modules/define-data-property/test/index.js +10 -10
  72. package/node_modules/es-define-property/.eslintrc +13 -0
  73. package/node_modules/es-define-property/.github/FUNDING.yml +12 -0
  74. package/node_modules/es-define-property/.nycrc +9 -0
  75. package/node_modules/es-define-property/CHANGELOG.md +15 -0
  76. package/node_modules/es-define-property/LICENSE +21 -0
  77. package/node_modules/es-define-property/README.md +49 -0
  78. package/node_modules/es-define-property/index.d.ts +3 -0
  79. package/node_modules/es-define-property/index.js +16 -0
  80. package/node_modules/es-define-property/package.json +81 -0
  81. package/node_modules/es-define-property/test/index.js +55 -0
  82. package/node_modules/es-define-property/tsconfig.json +50 -0
  83. package/node_modules/es-errors/.eslintrc +5 -0
  84. package/node_modules/es-errors/.github/FUNDING.yml +12 -0
  85. package/node_modules/es-errors/CHANGELOG.md +40 -0
  86. package/node_modules/es-errors/LICENSE +21 -0
  87. package/node_modules/es-errors/README.md +55 -0
  88. package/node_modules/es-errors/eval.d.ts +3 -0
  89. package/node_modules/es-errors/eval.js +4 -0
  90. package/node_modules/es-errors/index.d.ts +3 -0
  91. package/node_modules/es-errors/index.js +4 -0
  92. package/node_modules/es-errors/package.json +80 -0
  93. package/node_modules/es-errors/range.d.ts +3 -0
  94. package/node_modules/es-errors/range.js +4 -0
  95. package/node_modules/es-errors/ref.d.ts +3 -0
  96. package/node_modules/es-errors/ref.js +4 -0
  97. package/node_modules/es-errors/syntax.d.ts +3 -0
  98. package/node_modules/es-errors/syntax.js +4 -0
  99. package/node_modules/es-errors/test/index.js +19 -0
  100. package/node_modules/es-errors/tsconfig.json +49 -0
  101. package/node_modules/es-errors/type.d.ts +3 -0
  102. package/node_modules/es-errors/type.js +4 -0
  103. package/node_modules/es-errors/uri.d.ts +3 -0
  104. package/node_modules/es-errors/uri.js +4 -0
  105. package/node_modules/fast-xml-parser/CHANGELOG.md +3 -0
  106. package/node_modules/fast-xml-parser/README.md +2 -1
  107. package/node_modules/fast-xml-parser/package.json +4 -1
  108. package/node_modules/fast-xml-parser/src/fxp.d.ts +363 -69
  109. package/node_modules/fast-xml-parser/src/xmlparser/OrderedObjParser.js +5 -5
  110. package/node_modules/follow-redirects/index.js +114 -75
  111. package/node_modules/follow-redirects/package.json +1 -1
  112. package/node_modules/get-intrinsic/CHANGELOG.md +18 -0
  113. package/node_modules/get-intrinsic/index.js +15 -7
  114. package/node_modules/get-intrinsic/package.json +12 -12
  115. package/node_modules/has-property-descriptors/CHANGELOG.md +8 -0
  116. package/node_modules/has-property-descriptors/index.js +3 -14
  117. package/node_modules/has-property-descriptors/package.json +5 -5
  118. package/node_modules/has-proto/CHANGELOG.md +15 -0
  119. package/node_modules/has-proto/index.d.ts +3 -0
  120. package/node_modules/has-proto/index.js +5 -1
  121. package/node_modules/has-proto/package.json +9 -5
  122. package/node_modules/has-proto/tsconfig.json +49 -0
  123. package/node_modules/has-tostringtag/.eslintrc +0 -6
  124. package/node_modules/has-tostringtag/.nycrc +13 -0
  125. package/node_modules/has-tostringtag/CHANGELOG.md +22 -0
  126. package/node_modules/has-tostringtag/index.d.ts +3 -0
  127. package/node_modules/has-tostringtag/index.js +1 -0
  128. package/node_modules/has-tostringtag/package.json +37 -13
  129. package/node_modules/has-tostringtag/shams.d.ts +3 -0
  130. package/node_modules/has-tostringtag/shams.js +1 -0
  131. package/node_modules/has-tostringtag/test/shams/core-js.js +3 -0
  132. package/node_modules/has-tostringtag/test/shams/get-own-property-symbols.js +2 -0
  133. package/node_modules/has-tostringtag/test/tests.js +2 -1
  134. package/node_modules/has-tostringtag/tsconfig.json +49 -0
  135. package/node_modules/hasown/CHANGELOG.md +8 -0
  136. package/node_modules/hasown/index.d.ts +3 -3
  137. package/node_modules/hasown/index.js +1 -1
  138. package/node_modules/hasown/package.json +13 -15
  139. package/node_modules/polygon-clipping/README.md +29 -26
  140. package/node_modules/polygon-clipping/dist/polygon-clipping.cjs.js +1398 -1421
  141. package/node_modules/polygon-clipping/dist/polygon-clipping.d.ts +13 -10
  142. package/node_modules/polygon-clipping/dist/polygon-clipping.esm.js +1139 -1427
  143. package/node_modules/polygon-clipping/dist/polygon-clipping.umd.js +1770 -1831
  144. package/node_modules/polygon-clipping/dist/polygon-clipping.umd.min.js +22 -8
  145. package/node_modules/polygon-clipping/dist/polygon-clipping.umd.min.js.map +1 -1
  146. package/node_modules/polygon-clipping/node_modules/robust-predicates/LICENSE +24 -0
  147. package/node_modules/polygon-clipping/node_modules/robust-predicates/README.md +82 -0
  148. package/node_modules/polygon-clipping/node_modules/robust-predicates/esm/incircle.js +765 -0
  149. package/node_modules/polygon-clipping/node_modules/robust-predicates/esm/insphere.js +766 -0
  150. package/node_modules/polygon-clipping/node_modules/robust-predicates/esm/orient2d.js +184 -0
  151. package/node_modules/polygon-clipping/node_modules/robust-predicates/esm/orient3d.js +462 -0
  152. package/node_modules/polygon-clipping/node_modules/robust-predicates/esm/util.js +138 -0
  153. package/node_modules/polygon-clipping/node_modules/robust-predicates/index.d.ts +49 -0
  154. package/node_modules/polygon-clipping/node_modules/robust-predicates/index.js +5 -0
  155. package/node_modules/polygon-clipping/node_modules/robust-predicates/package.json +75 -0
  156. package/node_modules/polygon-clipping/node_modules/robust-predicates/umd/incircle.js +908 -0
  157. package/node_modules/polygon-clipping/node_modules/robust-predicates/umd/incircle.min.js +1 -0
  158. package/node_modules/polygon-clipping/node_modules/robust-predicates/umd/insphere.js +914 -0
  159. package/node_modules/polygon-clipping/node_modules/robust-predicates/umd/insphere.min.js +1 -0
  160. package/node_modules/polygon-clipping/node_modules/robust-predicates/umd/orient2d.js +280 -0
  161. package/node_modules/polygon-clipping/node_modules/robust-predicates/umd/orient2d.min.js +1 -0
  162. package/node_modules/polygon-clipping/node_modules/robust-predicates/umd/orient3d.js +601 -0
  163. package/node_modules/polygon-clipping/node_modules/robust-predicates/umd/orient3d.min.js +1 -0
  164. package/node_modules/polygon-clipping/node_modules/robust-predicates/umd/predicates.js +2328 -0
  165. package/node_modules/polygon-clipping/node_modules/robust-predicates/umd/predicates.min.js +1 -0
  166. package/node_modules/polygon-clipping/package.json +30 -25
  167. package/node_modules/protobufjs/dist/light/protobuf.js +4 -4
  168. package/node_modules/protobufjs/dist/light/protobuf.js.map +1 -1
  169. package/node_modules/protobufjs/dist/light/protobuf.min.js +3 -3
  170. package/node_modules/protobufjs/dist/light/protobuf.min.js.map +1 -1
  171. package/node_modules/protobufjs/dist/minimal/protobuf.js +2 -2
  172. package/node_modules/protobufjs/dist/minimal/protobuf.min.js +2 -2
  173. package/node_modules/protobufjs/dist/protobuf.js +4 -4
  174. package/node_modules/protobufjs/dist/protobuf.js.map +1 -1
  175. package/node_modules/protobufjs/dist/protobuf.min.js +3 -3
  176. package/node_modules/protobufjs/dist/protobuf.min.js.map +1 -1
  177. package/node_modules/protobufjs/package.json +1 -1
  178. package/node_modules/protobufjs/src/root.js +2 -2
  179. package/node_modules/regexp.prototype.flags/CHANGELOG.md +13 -0
  180. package/node_modules/regexp.prototype.flags/implementation.js +2 -2
  181. package/node_modules/regexp.prototype.flags/package.json +11 -10
  182. package/node_modules/regexp.prototype.flags/test/tests.js +13 -13
  183. package/node_modules/set-function-length/CHANGELOG.md +18 -0
  184. package/node_modules/set-function-length/env.d.ts +6 -0
  185. package/node_modules/set-function-length/env.d.ts.map +1 -0
  186. package/node_modules/set-function-length/env.js +9 -4
  187. package/node_modules/set-function-length/index.d.ts +7 -0
  188. package/node_modules/set-function-length/index.d.ts.map +1 -0
  189. package/node_modules/set-function-length/index.js +6 -3
  190. package/node_modules/set-function-length/package.json +33 -13
  191. package/node_modules/set-function-length/tsconfig.json +59 -0
  192. package/node_modules/set-function-name/.eslintrc +1 -0
  193. package/node_modules/set-function-name/CHANGELOG.md +9 -0
  194. package/node_modules/set-function-name/index.d.ts +5 -0
  195. package/node_modules/set-function-name/index.js +4 -3
  196. package/node_modules/set-function-name/package.json +28 -9
  197. package/node_modules/set-function-name/tsconfig.json +59 -0
  198. package/package.json +4 -4
  199. package/tak-ingest.js +4 -0
  200. package/node_modules/define-data-property/index.d.ts.map +0 -1
  201. package/node_modules/hasown/index.d.ts.map +0 -1
  202. 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>}) => void;
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: { headers: Record<string, string> }) => void;
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.2";
1
+ export const VERSION = "1.6.6";
@@ -10,6 +10,6 @@
10
10
  */
11
11
  export default function combineURLs(baseURL, relativeURL) {
12
12
  return relativeURL
13
- ? baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, '')
13
+ ? baseURL.replace(/\/?\/$/, '') + '/' + relativeURL.replace(/^\/+/, '')
14
14
  : baseURL;
15
15
  }
@@ -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.2",
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.0",
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 = GetIntrinsic('%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 = GetIntrinsic('%Object.defineProperty%', true);
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.5",
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.3",
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.0",
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.1"
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.1",
72
- "set-function-length": "^1.1.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
- declare const _exports: (obj: Record<PropertyKey, unknown>, property: PropertyKey, value: unknown, nonEnumerable?: boolean | null, nonWritable?: boolean | null, nonConfigurable?: boolean | null, loose?: boolean) => void;
2
- export = _exports;
3
- //# sourceMappingURL=index.d.ts.map
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 hasPropertyDescriptors = require('has-property-descriptors')();
3
+ var $defineProperty = require('es-define-property');
4
4
 
5
- var GetIntrinsic = require('get-intrinsic');
6
-
7
- var $defineProperty = hasPropertyDescriptors && GetIntrinsic('%Object.defineProperty%', true);
8
- if ($defineProperty) {
9
- try {
10
- $defineProperty({}, 'a', { value: 1 });
11
- } catch (e) {
12
- // IE 8 has a broken defineProperty
13
- $defineProperty = false;
14
- }
15
- }
16
-
17
- var $SyntaxError = GetIntrinsic('%SyntaxError%');
18
- var $TypeError = GetIntrinsic('%TypeError%');
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 {(obj: Record<PropertyKey, unknown>, property: PropertyKey, value: unknown, nonEnumerable?: boolean | null, nonWritable?: boolean | null, nonConfigurable?: boolean | null, loose?: boolean) => void} */
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.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 && npm run emit-types",
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
- "get-intrinsic": "^1.2.1",
60
- "gopd": "^1.0.1",
61
- "has-property-descriptors": "^1.0.0"
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/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",
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
- "has": "^1.0.3",
75
+ "hasown": "^2.0.1",
81
76
  "in-publish": "^2.0.1",
82
- "npmignore": "^0.3.0",
77
+ "npmignore": "^0.3.1",
83
78
  "nyc": "^10.3.2",
84
- "object-inspect": "^1.12.3",
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.1",
89
- "typescript": "^5.3.0-dev.20231012"
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 has = require('has');
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
- // @ts-expect-error
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
- // @ts-expect-error
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
- // @ts-expect-error
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(has(obj, 'existing'), 'has initial own property');
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(has(obj, 'added'), 'has expected own property');
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(has(obj, 'existing'), 'still has expected own property');
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(has(obj, 'explicit1'), 'has expected own property (explicit enumerable)');
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(has(obj, 'explicit2'), 'has expected own property (explicit writable)');
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(has(obj, 'explicit3'), 'has expected own property (explicit configurable)');
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,13 @@
1
+ {
2
+ "root": true,
3
+
4
+ "extends": "@ljharb",
5
+
6
+ "rules": {
7
+ "new-cap": ["error", {
8
+ "capIsNewExceptions": [
9
+ "GetIntrinsic",
10
+ ],
11
+ }],
12
+ },
13
+ }
@@ -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,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,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,3 @@
1
+ declare const defineProperty: false | typeof Object.defineProperty;
2
+
3
+ export = defineProperty;
@@ -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;