node-red-contrib-web-worldmap 4.6.2 → 4.6.3

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 (174) hide show
  1. package/CHANGELOG.md +1 -0
  2. package/README.md +2 -0
  3. package/node_modules/body-parser/HISTORY.md +8 -0
  4. package/node_modules/body-parser/README.md +11 -10
  5. package/node_modules/body-parser/lib/types/json.js +15 -4
  6. package/node_modules/body-parser/package.json +8 -8
  7. package/node_modules/call-bind/.eslintrc +0 -1
  8. package/node_modules/call-bind/.nycrc +0 -4
  9. package/node_modules/call-bind/CHANGELOG.md +51 -0
  10. package/node_modules/call-bind/README.md +63 -1
  11. package/node_modules/call-bind/index.js +11 -23
  12. package/node_modules/call-bind/package.json +38 -23
  13. package/node_modules/call-bind/test/callBound.js +0 -1
  14. package/node_modules/call-bind/test/index.js +18 -4
  15. package/node_modules/content-type/HISTORY.md +5 -0
  16. package/node_modules/content-type/README.md +21 -19
  17. package/node_modules/content-type/index.js +12 -9
  18. package/node_modules/content-type/package.json +13 -11
  19. package/node_modules/define-data-property/.eslintrc +24 -0
  20. package/node_modules/define-data-property/.github/FUNDING.yml +12 -0
  21. package/node_modules/define-data-property/.nycrc +13 -0
  22. package/node_modules/define-data-property/CHANGELOG.md +70 -0
  23. package/node_modules/define-data-property/LICENSE +21 -0
  24. package/node_modules/define-data-property/README.md +67 -0
  25. package/node_modules/define-data-property/index.d.ts +12 -0
  26. package/node_modules/define-data-property/index.js +56 -0
  27. package/node_modules/define-data-property/package.json +106 -0
  28. package/node_modules/define-data-property/test/index.js +392 -0
  29. package/node_modules/define-data-property/tsconfig.json +59 -0
  30. package/node_modules/es-define-property/.eslintrc +13 -0
  31. package/node_modules/es-define-property/.github/FUNDING.yml +12 -0
  32. package/node_modules/es-define-property/.nycrc +9 -0
  33. package/node_modules/es-define-property/CHANGELOG.md +15 -0
  34. package/node_modules/es-define-property/LICENSE +21 -0
  35. package/node_modules/es-define-property/README.md +49 -0
  36. package/node_modules/es-define-property/index.d.ts +3 -0
  37. package/node_modules/es-define-property/index.js +16 -0
  38. package/node_modules/es-define-property/package.json +81 -0
  39. package/node_modules/es-define-property/test/index.js +55 -0
  40. package/node_modules/es-define-property/tsconfig.json +50 -0
  41. package/node_modules/es-errors/.eslintrc +5 -0
  42. package/node_modules/es-errors/.github/FUNDING.yml +12 -0
  43. package/node_modules/es-errors/CHANGELOG.md +40 -0
  44. package/node_modules/es-errors/LICENSE +21 -0
  45. package/node_modules/es-errors/README.md +55 -0
  46. package/node_modules/es-errors/eval.d.ts +3 -0
  47. package/node_modules/es-errors/eval.js +4 -0
  48. package/node_modules/es-errors/index.d.ts +3 -0
  49. package/node_modules/es-errors/index.js +4 -0
  50. package/node_modules/es-errors/package.json +80 -0
  51. package/node_modules/es-errors/range.d.ts +3 -0
  52. package/node_modules/es-errors/range.js +4 -0
  53. package/node_modules/es-errors/ref.d.ts +3 -0
  54. package/node_modules/es-errors/ref.js +4 -0
  55. package/node_modules/es-errors/syntax.d.ts +3 -0
  56. package/node_modules/es-errors/syntax.js +4 -0
  57. package/node_modules/es-errors/test/index.js +19 -0
  58. package/node_modules/es-errors/tsconfig.json +49 -0
  59. package/node_modules/es-errors/type.d.ts +3 -0
  60. package/node_modules/es-errors/type.js +4 -0
  61. package/node_modules/es-errors/uri.d.ts +3 -0
  62. package/node_modules/es-errors/uri.js +4 -0
  63. package/node_modules/express/History.md +14 -5
  64. package/node_modules/express/Readme.md +1 -1
  65. package/node_modules/express/lib/router/index.js +1 -1
  66. package/node_modules/express/lib/router/route.js +7 -2
  67. package/node_modules/express/lib/utils.js +3 -4
  68. package/node_modules/express/package.json +5 -6
  69. package/node_modules/function-bind/.eslintrc +11 -5
  70. package/node_modules/function-bind/.github/FUNDING.yml +12 -0
  71. package/node_modules/function-bind/.github/SECURITY.md +3 -0
  72. package/node_modules/function-bind/.nycrc +13 -0
  73. package/node_modules/function-bind/CHANGELOG.md +136 -0
  74. package/node_modules/function-bind/README.md +25 -27
  75. package/node_modules/function-bind/implementation.js +44 -12
  76. package/node_modules/function-bind/package.json +38 -14
  77. package/node_modules/get-intrinsic/.eslintrc +1 -0
  78. package/node_modules/get-intrinsic/CHANGELOG.md +45 -0
  79. package/node_modules/get-intrinsic/index.js +41 -16
  80. package/node_modules/get-intrinsic/package.json +20 -18
  81. package/node_modules/get-intrinsic/test/GetIntrinsic.js +1 -1
  82. package/node_modules/gopd/.eslintrc +16 -0
  83. package/node_modules/gopd/.github/FUNDING.yml +12 -0
  84. package/node_modules/gopd/CHANGELOG.md +25 -0
  85. package/node_modules/gopd/LICENSE +21 -0
  86. package/node_modules/gopd/README.md +40 -0
  87. package/node_modules/gopd/index.js +16 -0
  88. package/node_modules/gopd/package.json +71 -0
  89. package/node_modules/gopd/test/index.js +35 -0
  90. package/node_modules/has-property-descriptors/.eslintrc +13 -0
  91. package/node_modules/has-property-descriptors/.github/FUNDING.yml +12 -0
  92. package/node_modules/has-property-descriptors/.nycrc +9 -0
  93. package/node_modules/has-property-descriptors/CHANGELOG.md +35 -0
  94. package/node_modules/has-property-descriptors/LICENSE +21 -0
  95. package/node_modules/has-property-descriptors/README.md +43 -0
  96. package/node_modules/has-property-descriptors/index.js +22 -0
  97. package/node_modules/has-property-descriptors/package.json +77 -0
  98. package/node_modules/has-property-descriptors/test/index.js +57 -0
  99. package/node_modules/has-proto/.eslintrc +5 -0
  100. package/node_modules/has-proto/.github/FUNDING.yml +12 -0
  101. package/node_modules/has-proto/CHANGELOG.md +38 -0
  102. package/node_modules/has-proto/LICENSE +21 -0
  103. package/node_modules/has-proto/README.md +38 -0
  104. package/node_modules/has-proto/index.d.ts +3 -0
  105. package/node_modules/has-proto/index.js +15 -0
  106. package/node_modules/has-proto/package.json +78 -0
  107. package/node_modules/has-proto/test/index.js +19 -0
  108. package/node_modules/has-proto/tsconfig.json +49 -0
  109. package/node_modules/hasown/.eslintrc +5 -0
  110. package/node_modules/hasown/.github/FUNDING.yml +12 -0
  111. package/node_modules/hasown/.nycrc +13 -0
  112. package/node_modules/hasown/CHANGELOG.md +28 -0
  113. package/node_modules/hasown/LICENSE +21 -0
  114. package/node_modules/hasown/README.md +40 -0
  115. package/node_modules/hasown/index.d.ts +3 -0
  116. package/node_modules/hasown/index.js +8 -0
  117. package/node_modules/hasown/package.json +89 -0
  118. package/node_modules/hasown/tsconfig.json +49 -0
  119. package/node_modules/http-parser-js/README.md +43 -0
  120. package/node_modules/http-parser-js/http-parser.d.ts +175 -0
  121. package/node_modules/{websocket-driver/node_modules/http-parser-js → http-parser-js}/http-parser.js +12 -7
  122. package/node_modules/{websocket-driver/node_modules/http-parser-js → http-parser-js}/package.json +4 -2
  123. package/node_modules/object-inspect/CHANGELOG.md +29 -0
  124. package/node_modules/object-inspect/index.js +18 -6
  125. package/node_modules/object-inspect/package.json +13 -8
  126. package/node_modules/object-inspect/test/global.js +17 -0
  127. package/node_modules/raw-body/HISTORY.md +5 -0
  128. package/node_modules/raw-body/README.md +1 -1
  129. package/node_modules/raw-body/index.js +7 -0
  130. package/node_modules/raw-body/package.json +7 -7
  131. package/node_modules/set-function-length/.eslintrc +27 -0
  132. package/node_modules/set-function-length/.github/FUNDING.yml +12 -0
  133. package/node_modules/set-function-length/.nycrc +13 -0
  134. package/node_modules/set-function-length/CHANGELOG.md +59 -0
  135. package/node_modules/set-function-length/LICENSE +21 -0
  136. package/node_modules/set-function-length/README.md +56 -0
  137. package/node_modules/set-function-length/env.d.ts +6 -0
  138. package/node_modules/set-function-length/env.d.ts.map +1 -0
  139. package/node_modules/set-function-length/env.js +24 -0
  140. package/node_modules/set-function-length/index.d.ts +7 -0
  141. package/node_modules/set-function-length/index.d.ts.map +1 -0
  142. package/node_modules/set-function-length/index.js +44 -0
  143. package/node_modules/set-function-length/package.json +104 -0
  144. package/node_modules/set-function-length/tsconfig.json +59 -0
  145. package/node_modules/{function-bind → side-channel}/.editorconfig +3 -14
  146. package/node_modules/side-channel/.eslintrc +1 -1
  147. package/node_modules/side-channel/CHANGELOG.md +30 -0
  148. package/node_modules/side-channel/index.d.ts +27 -0
  149. package/node_modules/side-channel/index.js +25 -20
  150. package/node_modules/side-channel/package.json +36 -19
  151. package/node_modules/side-channel/test/index.js +6 -1
  152. package/node_modules/side-channel/tsconfig.json +50 -0
  153. package/package.json +1 -1
  154. package/worldmap/index.html +2 -2
  155. package/worldmap/leaflet/milsymbol.js +6 -6
  156. package/worldmap.js +2 -2
  157. package/node_modules/function-bind/.jscs.json +0 -176
  158. package/node_modules/function-bind/.npmignore +0 -22
  159. package/node_modules/function-bind/.travis.yml +0 -168
  160. package/node_modules/has/LICENSE-MIT +0 -22
  161. package/node_modules/has/README.md +0 -18
  162. package/node_modules/has/package.json +0 -48
  163. package/node_modules/has/src/index.js +0 -5
  164. package/node_modules/has/test/index.js +0 -10
  165. package/node_modules/side-channel/.eslintignore +0 -1
  166. package/node_modules/websocket-driver/node_modules/http-parser-js/CHANGELOG.md +0 -14
  167. package/node_modules/websocket-driver/node_modules/http-parser-js/README.md +0 -31
  168. package/worldmap/ml3d.html +0 -3377
  169. /package/node_modules/{compression/node_modules/bytes → bytes}/History.md +0 -0
  170. /package/node_modules/{compression/node_modules/bytes → bytes}/LICENSE +0 -0
  171. /package/node_modules/{compression/node_modules/bytes → bytes}/Readme.md +0 -0
  172. /package/node_modules/{compression/node_modules/bytes → bytes}/index.js +0 -0
  173. /package/node_modules/{compression/node_modules/bytes → bytes}/package.json +0 -0
  174. /package/node_modules/{websocket-driver/node_modules/http-parser-js → http-parser-js}/LICENSE.md +0 -0
@@ -0,0 +1,59 @@
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/set-function-length/compare/v1.2.0...v1.2.1) - 2024-02-06
9
+
10
+ ### Commits
11
+
12
+ - [Dev Deps] update `call-bind`, `tape`, `typescript` [`d9a4601`](https://github.com/ljharb/set-function-length/commit/d9a460199c4c1fa37da9ebe055e2c884128f0738)
13
+ - [Deps] update `define-data-property`, `get-intrinsic` [`38d39ae`](https://github.com/ljharb/set-function-length/commit/38d39aed13a757ed36211d5b0437b88485090c6b)
14
+ - [Refactor] use `es-errors`, so things that only need those do not need `get-intrinsic` [`b4bfe5a`](https://github.com/ljharb/set-function-length/commit/b4bfe5ae0953b906d55b85f867eca5e7f673ebf4)
15
+
16
+ ## [v1.2.0](https://github.com/ljharb/set-function-length/compare/v1.1.1...v1.2.0) - 2024-01-14
17
+
18
+ ### Commits
19
+
20
+ - [New] add types [`f6d9088`](https://github.com/ljharb/set-function-length/commit/f6d9088b9283a3112b21c6776e8bef6d1f30558a)
21
+ - [Fix] ensure `env` properties are always booleans [`0c42f84`](https://github.com/ljharb/set-function-length/commit/0c42f84979086389b3229e1b4272697fd352275a)
22
+ - [Dev Deps] update `aud`, `call-bind`, `npmignore`, `tape` [`2b75f75`](https://github.com/ljharb/set-function-length/commit/2b75f75468093a4bb8ce8ca989b2edd2e80d95d1)
23
+ - [Deps] update `get-intrinsic`, `has-property-descriptors` [`19bf0fc`](https://github.com/ljharb/set-function-length/commit/19bf0fc4ffaa5ad425acbfa150516be9f3b6263a)
24
+ - [meta] add `sideEffects` flag [`8bb9b78`](https://github.com/ljharb/set-function-length/commit/8bb9b78c11c621123f725c9470222f43466c01d0)
25
+
26
+ ## [v1.1.1](https://github.com/ljharb/set-function-length/compare/v1.1.0...v1.1.1) - 2023-10-19
27
+
28
+ ### Fixed
29
+
30
+ - [Fix] move `define-data-property` to runtime deps [`#2`](https://github.com/ljharb/set-function-length/issues/2)
31
+
32
+ ### Commits
33
+
34
+ - [Dev Deps] update `object-inspect`; add missing `call-bind` [`5aecf79`](https://github.com/ljharb/set-function-length/commit/5aecf79e7d6400957a5d9bd9ac20d4528908ca18)
35
+
36
+ ## [v1.1.0](https://github.com/ljharb/set-function-length/compare/v1.0.1...v1.1.0) - 2023-10-13
37
+
38
+ ### Commits
39
+
40
+ - [New] add `env` entry point [`475c87a`](https://github.com/ljharb/set-function-length/commit/475c87aa2f59b700aaed589d980624ec596acdcb)
41
+ - [Tests] add coverage with `nyc` [`14f0bf8`](https://github.com/ljharb/set-function-length/commit/14f0bf8c145ae60bf14a026420a06bb7be132c36)
42
+ - [eslint] fix linting failure [`fb516f9`](https://github.com/ljharb/set-function-length/commit/fb516f93c664057138c53559ef63c8622a093335)
43
+ - [Deps] update `define-data-property` [`d727e7c`](https://github.com/ljharb/set-function-length/commit/d727e7c6c9a40d7bf26797694e500ea68741feea)
44
+
45
+ ## [v1.0.1](https://github.com/ljharb/set-function-length/compare/v1.0.0...v1.0.1) - 2023-10-12
46
+
47
+ ### Commits
48
+
49
+ - [Refactor] use `get-intrinsic`, since it‘s in the dep graph anyways [`278a954`](https://github.com/ljharb/set-function-length/commit/278a954a06cd849051c569ff7aee56df6798933e)
50
+ - [meta] add `exports` [`72acfe5`](https://github.com/ljharb/set-function-length/commit/72acfe5a0310071fb205a72caba5ecbab24336a0)
51
+
52
+ ## v1.0.0 - 2023-10-12
53
+
54
+ ### Commits
55
+
56
+ - Initial implementation, tests, readme [`fce14e1`](https://github.com/ljharb/set-function-length/commit/fce14e17586460e4f294405173be72b6ffdf7e5f)
57
+ - Initial commit [`ca7ba85`](https://github.com/ljharb/set-function-length/commit/ca7ba857c7c283f9d26e21f14e71cd388f2cb722)
58
+ - npm init [`6a7e493`](https://github.com/ljharb/set-function-length/commit/6a7e493927736cebcaf5c1a84e69b8e6b7b744d8)
59
+ - Only apps should have lockfiles [`d2bf6c4`](https://github.com/ljharb/set-function-length/commit/d2bf6c43de8a51b02a0aa53e8d62cb50c4a2b0da)
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) Jordan Harband and contributors
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,56 @@
1
+ # set-function-length <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
+ Set a function’s length.
11
+
12
+ Arguments:
13
+ - `fn`: the function
14
+ - `length`: the new length. Must be an integer between 0 and 2**32.
15
+ - `loose`: Optional. If true, and the length fails to be set, do not throw. Default false.
16
+
17
+ Returns `fn`.
18
+
19
+ ## Usage
20
+
21
+ ```javascript
22
+ var setFunctionLength = require('set-function-length');
23
+ var assert = require('assert');
24
+
25
+ function zero() {}
26
+ function one(_) {}
27
+ function two(_, __) {}
28
+
29
+ assert.equal(zero.length, 0);
30
+ assert.equal(one.length, 1);
31
+ assert.equal(two.length, 2);
32
+
33
+ assert.equal(setFunctionLength(zero, 10), zero);
34
+ assert.equal(setFunctionLength(one, 11), one);
35
+ assert.equal(setFunctionLength(two, 12), two);
36
+
37
+ assert.equal(zero.length, 10);
38
+ assert.equal(one.length, 11);
39
+ assert.equal(two.length, 12);
40
+ ```
41
+
42
+ [package-url]: https://npmjs.org/package/set-function-length
43
+ [npm-version-svg]: https://versionbadg.es/ljharb/set-function-length.svg
44
+ [deps-svg]: https://david-dm.org/ljharb/set-function-length.svg
45
+ [deps-url]: https://david-dm.org/ljharb/set-function-length
46
+ [dev-deps-svg]: https://david-dm.org/ljharb/set-function-length/dev-status.svg
47
+ [dev-deps-url]: https://david-dm.org/ljharb/set-function-length#info=devDependencies
48
+ [npm-badge-png]: https://nodei.co/npm/set-function-length.png?downloads=true&stars=true
49
+ [license-image]: https://img.shields.io/npm/l/set-function-length.svg
50
+ [license-url]: LICENSE
51
+ [downloads-image]: https://img.shields.io/npm/dm/set-function-length.svg
52
+ [downloads-url]: https://npm-stat.com/charts.html?package=set-function-length
53
+ [codecov-image]: https://codecov.io/gh/ljharb/set-function-length/branch/main/graphs/badge.svg
54
+ [codecov-url]: https://app.codecov.io/gh/ljharb/set-function-length/
55
+ [actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/ljharb/set-function-length
56
+ [actions-url]: https://github.com/ljharb/set-function-length/actions
@@ -0,0 +1,6 @@
1
+ export var boundFnsHaveConfigurableLengths: boolean;
2
+ export var boundFnsHaveWritableLengths: boolean;
3
+ export var functionsHaveConfigurableLengths: boolean;
4
+ export var functionsHaveWritableLengths: boolean;
5
+ export declare let __proto__: null;
6
+ //# sourceMappingURL=env.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"env.d.ts","sourceRoot":"","sources":["env.js"],"names":[],"mappings":"AAaA,oDAAsE;AAEtE,gDAA8D;AAN9D,qDAA2E;AAE3E,iDAAmE"}
@@ -0,0 +1,24 @@
1
+ 'use strict';
2
+
3
+ var gOPD = require('gopd');
4
+ var bind = require('function-bind');
5
+
6
+ var unbound = gOPD && gOPD(function () {}, 'length');
7
+ // @ts-expect-error ts(2555) TS is overly strict with .call
8
+ var bound = gOPD && gOPD(bind.call(function () {}), 'length');
9
+
10
+ var functionsHaveConfigurableLengths = !!(unbound && unbound.configurable);
11
+
12
+ var functionsHaveWritableLengths = !!(unbound && unbound.writable);
13
+
14
+ var boundFnsHaveConfigurableLengths = !!(bound && bound.configurable);
15
+
16
+ var boundFnsHaveWritableLengths = !!(bound && bound.writable);
17
+
18
+ module.exports = {
19
+ __proto__: null,
20
+ boundFnsHaveConfigurableLengths: boundFnsHaveConfigurableLengths,
21
+ boundFnsHaveWritableLengths: boundFnsHaveWritableLengths,
22
+ functionsHaveConfigurableLengths: functionsHaveConfigurableLengths,
23
+ functionsHaveWritableLengths: functionsHaveWritableLengths
24
+ };
@@ -0,0 +1,7 @@
1
+ declare namespace _exports {
2
+ export { Func };
3
+ }
4
+ declare const _exports: <T extends Func = Func>(fn: T, length: number, loose?: boolean) => T;
5
+ export = _exports;
6
+ type Func = (...args: unknown[]) => unknown;
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.js"],"names":[],"mappings":";;;+DAYkD,MAAM,UAAU,OAAO;;sBAFjD,OAAO,EAAE,KAAK,OAAO"}
@@ -0,0 +1,44 @@
1
+ 'use strict';
2
+
3
+ var GetIntrinsic = require('get-intrinsic');
4
+ var define = require('define-data-property');
5
+ var hasDescriptors = require('has-property-descriptors')();
6
+ var gOPD = require('gopd');
7
+
8
+ var $TypeError = require('es-errors/type');
9
+ var $floor = GetIntrinsic('%Math.floor%');
10
+
11
+ /** @typedef {(...args: unknown[]) => unknown} Func */
12
+
13
+ /** @type {<T extends Func = Func>(fn: T, length: number, loose?: boolean) => T} */
14
+ module.exports = function setFunctionLength(fn, length) {
15
+ if (typeof fn !== 'function') {
16
+ throw new $TypeError('`fn` is not a function');
17
+ }
18
+ if (typeof length !== 'number' || length < 0 || length > 0xFFFFFFFF || $floor(length) !== length) {
19
+ throw new $TypeError('`length` must be a positive 32-bit integer');
20
+ }
21
+
22
+ var loose = arguments.length > 2 && !!arguments[2];
23
+
24
+ var functionLengthIsConfigurable = true;
25
+ var functionLengthIsWritable = true;
26
+ if ('length' in fn && gOPD) {
27
+ var desc = gOPD(fn, 'length');
28
+ if (desc && !desc.configurable) {
29
+ functionLengthIsConfigurable = false;
30
+ }
31
+ if (desc && !desc.writable) {
32
+ functionLengthIsWritable = false;
33
+ }
34
+ }
35
+
36
+ if (functionLengthIsConfigurable || functionLengthIsWritable || !loose) {
37
+ if (hasDescriptors) {
38
+ define(/** @type {Parameters<define>[0]} */ (fn), 'length', length, true, true);
39
+ } else {
40
+ define(/** @type {Parameters<define>[0]} */ (fn), 'length', length);
41
+ }
42
+ }
43
+ return fn;
44
+ };
@@ -0,0 +1,104 @@
1
+ {
2
+ "name": "set-function-length",
3
+ "version": "1.2.1",
4
+ "description": "Set a function's length property",
5
+ "main": "index.js",
6
+ "exports": {
7
+ ".": "./index.js",
8
+ "./env": "./env.js",
9
+ "./package.json": "./package.json"
10
+ },
11
+ "sideEffects": false,
12
+ "directories": {
13
+ "test": "test"
14
+ },
15
+ "scripts": {
16
+ "prepack": "npmignore --auto --commentLines=autogenerated && npm run emit",
17
+ "prepublish": "not-in-publish || npm run prepublishOnly",
18
+ "prepublishOnly": "safe-publish-latest",
19
+ "tsc": "tsc -p .",
20
+ "preemit": "rm -f *.ts *.ts.map test/*.ts test/*.ts.map",
21
+ "emit": "npm run tsc -- --noEmit false --emitDeclarationOnly",
22
+ "postemit": "rm test/*.ts test/*.ts.map",
23
+ "prelint": "evalmd README.md",
24
+ "lint": "eslint --ext=js,mjs .",
25
+ "postlint": "npm run tsc",
26
+ "pretest": "npm run lint",
27
+ "tests-only": "nyc tape 'test/**/*.js'",
28
+ "test": "npm run tests-only",
29
+ "posttest": "aud --production",
30
+ "version": "auto-changelog && git add CHANGELOG.md",
31
+ "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\""
32
+ },
33
+ "repository": {
34
+ "type": "git",
35
+ "url": "git+https://github.com/ljharb/set-function-length.git"
36
+ },
37
+ "keywords": [
38
+ "javascript",
39
+ "ecmascript",
40
+ "set",
41
+ "function",
42
+ "length",
43
+ "function.length"
44
+ ],
45
+ "author": "Jordan Harband <ljharb@gmail.com>",
46
+ "license": "MIT",
47
+ "bugs": {
48
+ "url": "https://github.com/ljharb/set-function-length/issues"
49
+ },
50
+ "homepage": "https://github.com/ljharb/set-function-length#readme",
51
+ "dependencies": {
52
+ "define-data-property": "^1.1.2",
53
+ "es-errors": "^1.3.0",
54
+ "function-bind": "^1.1.2",
55
+ "get-intrinsic": "^1.2.3",
56
+ "gopd": "^1.0.1",
57
+ "has-property-descriptors": "^1.0.1"
58
+ },
59
+ "devDependencies": {
60
+ "@ljharb/eslint-config": "^21.1.0",
61
+ "@types/call-bind": "^1.0.5",
62
+ "@types/define-properties": "^1.1.5",
63
+ "@types/es-value-fixtures": "^1.4.4",
64
+ "@types/for-each": "^0.3.3",
65
+ "@types/function-bind": "^1.1.10",
66
+ "@types/gopd": "^1.0.3",
67
+ "@types/has-property-descriptors": "^1.0.3",
68
+ "@types/object-inspect": "^1.8.4",
69
+ "@types/tape": "^5.6.4",
70
+ "aud": "^2.0.4",
71
+ "auto-changelog": "^2.4.0",
72
+ "call-bind": "^1.0.6",
73
+ "es-value-fixtures": "^1.4.2",
74
+ "eslint": "=8.8.0",
75
+ "evalmd": "^0.0.19",
76
+ "for-each": "^0.3.3",
77
+ "in-publish": "^2.0.1",
78
+ "npmignore": "^0.3.1",
79
+ "nyc": "^10.3.2",
80
+ "object-inspect": "^1.13.1",
81
+ "safe-publish-latest": "^2.0.0",
82
+ "tape": "^5.7.4",
83
+ "typescript": "next"
84
+ },
85
+ "engines": {
86
+ "node": ">= 0.4"
87
+ },
88
+ "auto-changelog": {
89
+ "output": "CHANGELOG.md",
90
+ "template": "keepachangelog",
91
+ "unreleased": false,
92
+ "commitLimit": false,
93
+ "backfillLimit": false,
94
+ "hideCredit": true
95
+ },
96
+ "publishConfig": {
97
+ "ignore": [
98
+ ".github/workflows",
99
+ "test",
100
+ "!*.d.ts",
101
+ "!*.d.ts.map"
102
+ ]
103
+ }
104
+ }
@@ -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
+ }
@@ -1,20 +1,9 @@
1
1
  root = true
2
2
 
3
3
  [*]
4
- indent_style = tab
5
- indent_size = 4
6
- end_of_line = lf
7
4
  charset = utf-8
8
- trim_trailing_whitespace = true
5
+ end_of_line = lf
9
6
  insert_final_newline = true
10
- max_line_length = 120
11
-
12
- [CHANGELOG.md]
13
- indent_style = space
7
+ indent_style = tab
14
8
  indent_size = 2
15
-
16
- [*.json]
17
- max_line_length = off
18
-
19
- [Makefile]
20
- max_line_length = off
9
+ trim_trailing_whitespace = true
@@ -5,7 +5,7 @@
5
5
 
6
6
  "rules": {
7
7
  "max-lines-per-function": 0,
8
- "max-params": 0,
8
+ "multiline-comment-style": 1,
9
9
  "new-cap": [2, { "capIsNewExceptions": ["GetIntrinsic"] }],
10
10
  },
11
11
  }
@@ -5,6 +5,36 @@ 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.6](https://github.com/ljharb/side-channel/compare/v1.0.5...v1.0.6) - 2024-02-29
9
+
10
+ ### Commits
11
+
12
+ - add types [`9beef66`](https://github.com/ljharb/side-channel/commit/9beef6643e6d717ea57bedabf86448123a7dd9e9)
13
+ - [meta] simplify `exports` [`4334cf9`](https://github.com/ljharb/side-channel/commit/4334cf9df654151504c383b62a2f9ebdc8d9d5ac)
14
+ - [Deps] update `call-bind` [`d6043c4`](https://github.com/ljharb/side-channel/commit/d6043c4d8f4d7be9037dd0f0419c7a2e0e39ec6a)
15
+ - [Dev Deps] update `tape` [`6aca376`](https://github.com/ljharb/side-channel/commit/6aca3761868dc8cd5ff7fd9799bf6b95e09a6eb0)
16
+
17
+ ## [v1.0.5](https://github.com/ljharb/side-channel/compare/v1.0.4...v1.0.5) - 2024-02-06
18
+
19
+ ### Commits
20
+
21
+ - [actions] reuse common workflows [`3d2e1ff`](https://github.com/ljharb/side-channel/commit/3d2e1ffd16dd6eaaf3e40ff57951f840d2d63c04)
22
+ - [meta] use `npmignore` to autogenerate an npmignore file [`04296ea`](https://github.com/ljharb/side-channel/commit/04296ea17d1544b0a5d20fd5bfb31aa4f6513eb9)
23
+ - [meta] add `.editorconfig`; add `eclint` [`130f0a6`](https://github.com/ljharb/side-channel/commit/130f0a6adbc04d385c7456a601d38344dce3d6a9)
24
+ - [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `auto-changelog`, `safe-publish-latest`, `tape` [`d480c2f`](https://github.com/ljharb/side-channel/commit/d480c2fbe757489ae9b4275491ffbcc3ac4725e9)
25
+ - [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `auto-changelog`, `tape` [`ecbe70e`](https://github.com/ljharb/side-channel/commit/ecbe70e53a418234081a77971fec1fdfae20c841)
26
+ - [actions] update rebase action [`75240b9`](https://github.com/ljharb/side-channel/commit/75240b9963b816e8846400d2287cb68f88c7fba7)
27
+ - [Dev Deps] update `@ljharb/eslint-config`, `aud`, `npmignore`, `tape` [`ae8d281`](https://github.com/ljharb/side-channel/commit/ae8d281572430099109870fd9430d2ca3f320b8d)
28
+ - [Dev Deps] update `@ljharb/eslint-config`, `aud`, `tape` [`7125b88`](https://github.com/ljharb/side-channel/commit/7125b885fd0eacad4fee9b073b72d14065ece278)
29
+ - [Deps] update `call-bind`, `get-intrinsic`, `object-inspect` [`82577c9`](https://github.com/ljharb/side-channel/commit/82577c9796304519139a570f82a317211b5f3b86)
30
+ - [Deps] update `call-bind`, `get-intrinsic`, `object-inspect` [`550aadf`](https://github.com/ljharb/side-channel/commit/550aadf20475a6081fd70304cc54f77259a5c8a8)
31
+ - [Tests] increase coverage [`5130877`](https://github.com/ljharb/side-channel/commit/5130877a7b27c862e64e6d1c12a178b28808859d)
32
+ - [Deps] update `get-intrinsic`, `object-inspect` [`ba0194c`](https://github.com/ljharb/side-channel/commit/ba0194c505b1a8a0427be14cadd5b8a46d4d01b8)
33
+ - [meta] add missing `engines.node` [`985fd24`](https://github.com/ljharb/side-channel/commit/985fd249663cb06617a693a94fe08cad12f5cb70)
34
+ - [Refactor] use `es-errors`, so things that only need those do not need `get-intrinsic` [`40227a8`](https://github.com/ljharb/side-channel/commit/40227a87b01709ad2c0eebf87eb4223a800099b9)
35
+ - [Deps] update `get-intrinsic` [`a989b40`](https://github.com/ljharb/side-channel/commit/a989b4024958737ae7be9fbffdeff2078f33a0fd)
36
+ - [Deps] update `object-inspect` [`aec42d2`](https://github.com/ljharb/side-channel/commit/aec42d2ec541a31aaa02475692c87d489237d9a3)
37
+
8
38
  ## [v1.0.4](https://github.com/ljharb/side-channel/compare/v1.0.3...v1.0.4) - 2020-12-29
9
39
 
10
40
  ### Commits
@@ -0,0 +1,27 @@
1
+ declare namespace getSideChannel {
2
+ type Key = unknown;
3
+ type ListNode<T> = {
4
+ key: Key;
5
+ next: ListNode<T>;
6
+ value: T;
7
+ };
8
+ type RootNode<T> = {
9
+ key: object;
10
+ next: null | ListNode<T>;
11
+ };
12
+ function listGetNode<T>(list: RootNode<T>, key: ListNode<T>['key']): ListNode<T> | void;
13
+ function listGet<T>(objects: RootNode<T>, key: ListNode<T>['key']): T | void;
14
+ function listSet<T>(objects: RootNode<T>, key: ListNode<T>['key'], value: T): void;
15
+ function listHas<T>(objects: RootNode<T>, key: ListNode<T>['key']): boolean;
16
+
17
+ type Channel = {
18
+ assert: (key: Key) => void;
19
+ has: (key: Key) => boolean;
20
+ get: <T>(key: Key) => T;
21
+ set: <T>(key: Key, value: T) => void;
22
+ }
23
+ }
24
+
25
+ declare function getSideChannel(): getSideChannel.Channel;
26
+
27
+ export = getSideChannel;
@@ -4,7 +4,7 @@ var GetIntrinsic = require('get-intrinsic');
4
4
  var callBound = require('call-bind/callBound');
5
5
  var inspect = require('object-inspect');
6
6
 
7
- var $TypeError = GetIntrinsic('%TypeError%');
7
+ var $TypeError = require('es-errors/type');
8
8
  var $WeakMap = GetIntrinsic('%WeakMap%', true);
9
9
  var $Map = GetIntrinsic('%Map%', true);
10
10
 
@@ -16,49 +16,58 @@ var $mapSet = callBound('Map.prototype.set', true);
16
16
  var $mapHas = callBound('Map.prototype.has', true);
17
17
 
18
18
  /*
19
- * This function traverses the list returning the node corresponding to the
20
- * given key.
21
- *
22
- * That node is also moved to the head of the list, so that if it's accessed
23
- * again we don't need to traverse the whole list. By doing so, all the recently
24
- * used nodes can be accessed relatively quickly.
25
- */
19
+ * This function traverses the list returning the node corresponding to the given key.
20
+ *
21
+ * That node is also moved to the head of the list, so that if it's accessed again we don't need to traverse the whole list. By doing so, all the recently used nodes can be accessed relatively quickly.
22
+ */
23
+ /** @type {import('.').listGetNode} */
26
24
  var listGetNode = function (list, key) { // eslint-disable-line consistent-return
27
- for (var prev = list, curr; (curr = prev.next) !== null; prev = curr) {
25
+ /** @type {typeof list | NonNullable<(typeof list)['next']>} */
26
+ var prev = list;
27
+ /** @type {(typeof list)['next']} */
28
+ var curr;
29
+ for (; (curr = prev.next) !== null; prev = curr) {
28
30
  if (curr.key === key) {
29
31
  prev.next = curr.next;
30
- curr.next = list.next;
32
+ // eslint-disable-next-line no-extra-parens
33
+ curr.next = /** @type {NonNullable<typeof list.next>} */ (list.next);
31
34
  list.next = curr; // eslint-disable-line no-param-reassign
32
35
  return curr;
33
36
  }
34
37
  }
35
38
  };
36
39
 
40
+ /** @type {import('.').listGet} */
37
41
  var listGet = function (objects, key) {
38
42
  var node = listGetNode(objects, key);
39
43
  return node && node.value;
40
44
  };
45
+ /** @type {import('.').listSet} */
41
46
  var listSet = function (objects, key, value) {
42
47
  var node = listGetNode(objects, key);
43
48
  if (node) {
44
49
  node.value = value;
45
50
  } else {
46
51
  // Prepend the new node to the beginning of the list
47
- objects.next = { // eslint-disable-line no-param-reassign
52
+ objects.next = /** @type {import('.').ListNode<typeof value>} */ ({ // eslint-disable-line no-param-reassign, no-extra-parens
48
53
  key: key,
49
54
  next: objects.next,
50
55
  value: value
51
- };
56
+ });
52
57
  }
53
58
  };
59
+ /** @type {import('.').listHas} */
54
60
  var listHas = function (objects, key) {
55
61
  return !!listGetNode(objects, key);
56
62
  };
57
63
 
64
+ /** @type {import('.')} */
58
65
  module.exports = function getSideChannel() {
59
- var $wm;
60
- var $m;
61
- var $o;
66
+ /** @type {WeakMap<object, unknown>} */ var $wm;
67
+ /** @type {Map<object, unknown>} */ var $m;
68
+ /** @type {import('.').RootNode<unknown>} */ var $o;
69
+
70
+ /** @type {import('.').Channel} */
62
71
  var channel = {
63
72
  assert: function (key) {
64
73
  if (!channel.has(key)) {
@@ -109,11 +118,7 @@ module.exports = function getSideChannel() {
109
118
  $mapSet($m, key, value);
110
119
  } else {
111
120
  if (!$o) {
112
- /*
113
- * Initialize the linked list as an empty node, so that we don't have
114
- * to special-case handling of the first node: we can always refer to
115
- * it as (previous node).next, instead of something like (list).head
116
- */
121
+ // Initialize the linked list as an empty node, so that we don't have to special-case handling of the first node: we can always refer to it as (previous node).next, instead of something like (list).head
117
122
  $o = { key: {}, next: null };
118
123
  }
119
124
  listSet($o, key, value);