styled-map-package 4.0.1 → 4.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (189) hide show
  1. package/bin/smp-download.js +1 -1
  2. package/bin/smp-view.js +32 -23
  3. package/dist/download.d.cts +1 -1
  4. package/dist/download.d.ts +1 -1
  5. package/dist/index.d.cts +2 -2
  6. package/dist/index.d.ts +2 -2
  7. package/dist/reader-watch.d.cts +1 -1
  8. package/dist/reader-watch.d.ts +1 -1
  9. package/dist/reader.cjs +2 -1
  10. package/dist/reader.d.cts +1 -1
  11. package/dist/reader.d.ts +1 -1
  12. package/dist/reader.js +2 -1
  13. package/dist/server.d.cts +1 -1
  14. package/dist/server.d.ts +1 -1
  15. package/dist/style-downloader.cjs +2 -2
  16. package/dist/style-downloader.d.cts +1 -1
  17. package/dist/style-downloader.d.ts +1 -1
  18. package/dist/style-downloader.js +2 -2
  19. package/dist/tile-downloader.cjs +2 -2
  20. package/dist/tile-downloader.d.cts +1 -1
  21. package/dist/tile-downloader.d.ts +1 -1
  22. package/dist/tile-downloader.js +2 -2
  23. package/dist/{types-B4Xn1F9K.d.cts → types-yLQy3AKR.d.cts} +6 -3
  24. package/dist/{types-B4Xn1F9K.d.ts → types-yLQy3AKR.d.ts} +6 -3
  25. package/dist/utils/file-formats.d.cts +1 -1
  26. package/dist/utils/file-formats.d.ts +1 -1
  27. package/dist/utils/style.cjs +2 -2
  28. package/dist/utils/style.d.cts +1 -1
  29. package/dist/utils/style.d.ts +1 -1
  30. package/dist/utils/style.js +2 -2
  31. package/dist/utils/templates.cjs +4 -0
  32. package/dist/utils/templates.d.cts +4 -2
  33. package/dist/utils/templates.d.ts +4 -2
  34. package/dist/utils/templates.js +2 -0
  35. package/dist/writer.cjs +51 -3
  36. package/dist/writer.d.cts +1 -1
  37. package/dist/writer.d.ts +1 -1
  38. package/dist/writer.js +53 -3
  39. package/node_modules/@node-rs/crc32/LICENSE +21 -0
  40. package/node_modules/@node-rs/crc32/README.md +61 -0
  41. package/node_modules/@node-rs/crc32/browser.js +1 -0
  42. package/node_modules/@node-rs/crc32/index.d.ts +5 -0
  43. package/node_modules/@node-rs/crc32/index.js +368 -0
  44. package/node_modules/@node-rs/crc32/package.json +97 -0
  45. package/node_modules/@node-rs/crc32-linux-x64-gnu/README.md +3 -0
  46. package/node_modules/@node-rs/crc32-linux-x64-gnu/crc32.linux-x64-gnu.node +0 -0
  47. package/node_modules/@node-rs/crc32-linux-x64-gnu/package.json +43 -0
  48. package/node_modules/@node-rs/crc32-linux-x64-musl/README.md +3 -0
  49. package/node_modules/@node-rs/crc32-linux-x64-musl/crc32.linux-x64-musl.node +0 -0
  50. package/node_modules/@node-rs/crc32-linux-x64-musl/package.json +43 -0
  51. package/node_modules/define-data-property/.eslintrc +24 -0
  52. package/node_modules/define-data-property/.github/FUNDING.yml +12 -0
  53. package/node_modules/define-data-property/.nycrc +13 -0
  54. package/node_modules/define-data-property/CHANGELOG.md +70 -0
  55. package/node_modules/define-data-property/LICENSE +21 -0
  56. package/node_modules/define-data-property/README.md +67 -0
  57. package/node_modules/define-data-property/index.d.ts +12 -0
  58. package/node_modules/define-data-property/index.js +56 -0
  59. package/node_modules/define-data-property/package.json +106 -0
  60. package/node_modules/define-data-property/test/index.js +392 -0
  61. package/node_modules/define-data-property/tsconfig.json +59 -0
  62. package/node_modules/define-properties/.editorconfig +13 -0
  63. package/node_modules/define-properties/.eslintrc +19 -0
  64. package/node_modules/define-properties/.github/FUNDING.yml +12 -0
  65. package/node_modules/define-properties/.nycrc +9 -0
  66. package/node_modules/define-properties/CHANGELOG.md +91 -0
  67. package/node_modules/define-properties/LICENSE +21 -0
  68. package/node_modules/define-properties/README.md +84 -0
  69. package/node_modules/define-properties/index.js +47 -0
  70. package/node_modules/define-properties/package.json +88 -0
  71. package/node_modules/es-define-property/.eslintrc +13 -0
  72. package/node_modules/es-define-property/.github/FUNDING.yml +12 -0
  73. package/node_modules/es-define-property/.nycrc +9 -0
  74. package/node_modules/es-define-property/CHANGELOG.md +29 -0
  75. package/node_modules/es-define-property/LICENSE +21 -0
  76. package/node_modules/es-define-property/README.md +49 -0
  77. package/node_modules/es-define-property/index.d.ts +3 -0
  78. package/node_modules/es-define-property/index.js +14 -0
  79. package/node_modules/es-define-property/package.json +81 -0
  80. package/node_modules/es-define-property/test/index.js +56 -0
  81. package/node_modules/es-define-property/tsconfig.json +10 -0
  82. package/node_modules/es-errors/.eslintrc +5 -0
  83. package/node_modules/es-errors/.github/FUNDING.yml +12 -0
  84. package/node_modules/es-errors/CHANGELOG.md +40 -0
  85. package/node_modules/es-errors/LICENSE +21 -0
  86. package/node_modules/es-errors/README.md +55 -0
  87. package/node_modules/es-errors/eval.d.ts +3 -0
  88. package/node_modules/es-errors/eval.js +4 -0
  89. package/node_modules/es-errors/index.d.ts +3 -0
  90. package/node_modules/es-errors/index.js +4 -0
  91. package/node_modules/es-errors/package.json +80 -0
  92. package/node_modules/es-errors/range.d.ts +3 -0
  93. package/node_modules/es-errors/range.js +4 -0
  94. package/node_modules/es-errors/ref.d.ts +3 -0
  95. package/node_modules/es-errors/ref.js +4 -0
  96. package/node_modules/es-errors/syntax.d.ts +3 -0
  97. package/node_modules/es-errors/syntax.js +4 -0
  98. package/node_modules/es-errors/test/index.js +19 -0
  99. package/node_modules/es-errors/tsconfig.json +49 -0
  100. package/node_modules/es-errors/type.d.ts +3 -0
  101. package/node_modules/es-errors/type.js +4 -0
  102. package/node_modules/es-errors/uri.d.ts +3 -0
  103. package/node_modules/es-errors/uri.js +4 -0
  104. package/node_modules/globalthis/.eslintrc +18 -0
  105. package/node_modules/globalthis/.nycrc +10 -0
  106. package/node_modules/globalthis/CHANGELOG.md +109 -0
  107. package/node_modules/globalthis/LICENSE +21 -0
  108. package/node_modules/globalthis/README.md +70 -0
  109. package/node_modules/globalthis/auto.js +3 -0
  110. package/node_modules/globalthis/implementation.browser.js +11 -0
  111. package/node_modules/globalthis/implementation.js +3 -0
  112. package/node_modules/globalthis/index.js +19 -0
  113. package/node_modules/globalthis/package.json +99 -0
  114. package/node_modules/globalthis/polyfill.js +10 -0
  115. package/node_modules/globalthis/shim.js +29 -0
  116. package/node_modules/globalthis/test/implementation.js +11 -0
  117. package/node_modules/globalthis/test/index.js +11 -0
  118. package/node_modules/globalthis/test/native.js +26 -0
  119. package/node_modules/globalthis/test/shimmed.js +29 -0
  120. package/node_modules/globalthis/test/tests.js +36 -0
  121. package/node_modules/gopd/.eslintrc +16 -0
  122. package/node_modules/gopd/.github/FUNDING.yml +12 -0
  123. package/node_modules/gopd/CHANGELOG.md +45 -0
  124. package/node_modules/gopd/LICENSE +21 -0
  125. package/node_modules/gopd/README.md +40 -0
  126. package/node_modules/gopd/gOPD.d.ts +1 -0
  127. package/node_modules/gopd/gOPD.js +4 -0
  128. package/node_modules/gopd/index.d.ts +5 -0
  129. package/node_modules/gopd/index.js +15 -0
  130. package/node_modules/gopd/package.json +77 -0
  131. package/node_modules/gopd/test/index.js +36 -0
  132. package/node_modules/gopd/tsconfig.json +9 -0
  133. package/node_modules/has-property-descriptors/.eslintrc +13 -0
  134. package/node_modules/has-property-descriptors/.github/FUNDING.yml +12 -0
  135. package/node_modules/has-property-descriptors/.nycrc +9 -0
  136. package/node_modules/has-property-descriptors/CHANGELOG.md +35 -0
  137. package/node_modules/has-property-descriptors/LICENSE +21 -0
  138. package/node_modules/has-property-descriptors/README.md +43 -0
  139. package/node_modules/has-property-descriptors/index.js +22 -0
  140. package/node_modules/has-property-descriptors/package.json +77 -0
  141. package/node_modules/has-property-descriptors/test/index.js +57 -0
  142. package/node_modules/is-it-type/License +19 -0
  143. package/node_modules/is-it-type/README.md +102 -0
  144. package/node_modules/is-it-type/changelog.md +239 -0
  145. package/node_modules/is-it-type/dist/cjs/is-it-type.js +173 -0
  146. package/node_modules/is-it-type/dist/cjs/is-it-type.js.map +1 -0
  147. package/node_modules/is-it-type/dist/cjs/is-it-type.min.js +2 -0
  148. package/node_modules/is-it-type/dist/cjs/is-it-type.min.js.map +1 -0
  149. package/node_modules/is-it-type/dist/esm/is-it-type.js +143 -0
  150. package/node_modules/is-it-type/dist/esm/is-it-type.js.map +1 -0
  151. package/node_modules/is-it-type/dist/esm/is-it-type.min.js +2 -0
  152. package/node_modules/is-it-type/dist/esm/is-it-type.min.js.map +1 -0
  153. package/node_modules/is-it-type/dist/esm/package.json +3 -0
  154. package/node_modules/is-it-type/dist/umd/is-it-type.js +450 -0
  155. package/node_modules/is-it-type/dist/umd/is-it-type.js.map +1 -0
  156. package/node_modules/is-it-type/dist/umd/is-it-type.min.js +2 -0
  157. package/node_modules/is-it-type/dist/umd/is-it-type.min.js.map +1 -0
  158. package/node_modules/is-it-type/es/index.js +8 -0
  159. package/node_modules/is-it-type/es/package.json +3 -0
  160. package/node_modules/is-it-type/index.js +10 -0
  161. package/node_modules/is-it-type/package.json +87 -0
  162. package/node_modules/is-it-type/src/index.js +169 -0
  163. package/node_modules/object-keys/.editorconfig +13 -0
  164. package/node_modules/object-keys/.eslintrc +17 -0
  165. package/node_modules/object-keys/.travis.yml +277 -0
  166. package/node_modules/object-keys/CHANGELOG.md +232 -0
  167. package/node_modules/object-keys/LICENSE +21 -0
  168. package/node_modules/object-keys/README.md +76 -0
  169. package/node_modules/object-keys/implementation.js +122 -0
  170. package/node_modules/object-keys/index.js +32 -0
  171. package/node_modules/object-keys/isArguments.js +17 -0
  172. package/node_modules/object-keys/package.json +88 -0
  173. package/node_modules/object-keys/test/index.js +5 -0
  174. package/node_modules/simple-invariant/License +19 -0
  175. package/node_modules/simple-invariant/README.md +64 -0
  176. package/node_modules/simple-invariant/changelog.md +31 -0
  177. package/node_modules/simple-invariant/index.js +19 -0
  178. package/node_modules/simple-invariant/package.json +50 -0
  179. package/node_modules/yauzl-promise/License +19 -0
  180. package/node_modules/yauzl-promise/README.md +440 -0
  181. package/node_modules/yauzl-promise/index.js +10 -0
  182. package/node_modules/yauzl-promise/lib/entry.js +312 -0
  183. package/node_modules/yauzl-promise/lib/index.js +160 -0
  184. package/node_modules/yauzl-promise/lib/reader.js +289 -0
  185. package/node_modules/yauzl-promise/lib/shared.js +20 -0
  186. package/node_modules/yauzl-promise/lib/utils.js +105 -0
  187. package/node_modules/yauzl-promise/lib/zip.js +1224 -0
  188. package/node_modules/yauzl-promise/package.json +56 -0
  189. package/package.json +9 -11
@@ -0,0 +1,29 @@
1
+ 'use strict';
2
+
3
+ var define = require('define-properties');
4
+ var gOPD = require('gopd');
5
+ var getPolyfill = require('./polyfill');
6
+
7
+ module.exports = function shimGlobal() {
8
+ var polyfill = getPolyfill();
9
+ if (define.supportsDescriptors) {
10
+ var descriptor = gOPD(polyfill, 'globalThis');
11
+ if (
12
+ !descriptor
13
+ || (
14
+ descriptor.configurable
15
+ && (descriptor.enumerable || !descriptor.writable || globalThis !== polyfill)
16
+ )
17
+ ) {
18
+ Object.defineProperty(polyfill, 'globalThis', {
19
+ configurable: true,
20
+ enumerable: false,
21
+ value: polyfill,
22
+ writable: true
23
+ });
24
+ }
25
+ } else if (typeof globalThis !== 'object' || globalThis !== polyfill) {
26
+ polyfill.globalThis = polyfill;
27
+ }
28
+ return polyfill;
29
+ };
@@ -0,0 +1,11 @@
1
+ 'use strict';
2
+
3
+ var implementation = require('../implementation');
4
+ var test = require('tape');
5
+ var runTests = require('./tests');
6
+
7
+ test('implementation', function (t) {
8
+ runTests(implementation, t);
9
+
10
+ t.end();
11
+ });
@@ -0,0 +1,11 @@
1
+ 'use strict';
2
+
3
+ var systemGlobal = require('../');
4
+ var test = require('tape');
5
+ var runTests = require('./tests');
6
+
7
+ test('as a function', function (t) {
8
+ runTests(systemGlobal(), t);
9
+
10
+ t.end();
11
+ });
@@ -0,0 +1,26 @@
1
+ 'use strict';
2
+
3
+ var test = require('tape');
4
+ var defineProperties = require('define-properties');
5
+ var isEnumerable = Object.prototype.propertyIsEnumerable;
6
+
7
+ var missing = {};
8
+ var theGlobal = typeof globalThis === 'object' ? globalThis : missing;
9
+
10
+ var runTests = require('./tests');
11
+
12
+ test('native', { todo: theGlobal === missing }, function (t) {
13
+ if (theGlobal !== missing) {
14
+ t.equal(typeof theGlobal, 'object', 'globalThis is an object');
15
+ t.equal('globalThis' in theGlobal, true, 'globalThis is in globalThis');
16
+
17
+ t.test('enumerability', { skip: !defineProperties.supportsDescriptors }, function (et) {
18
+ et.equal(false, isEnumerable.call(theGlobal, 'globalThis'), 'globalThis is not enumerable');
19
+ et.end();
20
+ });
21
+
22
+ runTests(theGlobal, t);
23
+ }
24
+
25
+ t.end();
26
+ });
@@ -0,0 +1,29 @@
1
+ 'use strict';
2
+
3
+ require('../auto');
4
+
5
+ var test = require('tape');
6
+ var defineProperties = require('define-properties');
7
+ var isEnumerable = Object.prototype.propertyIsEnumerable;
8
+
9
+ var runTests = require('./tests');
10
+
11
+ test('shimmed', function (t) {
12
+ t.equal(typeof globalThis, 'object', 'globalThis is an object');
13
+ t.equal('globalThis' in globalThis, true, 'globalThis is in globalThis');
14
+
15
+ t.test('enumerability', { skip: !defineProperties.supportsDescriptors }, function (et) {
16
+ et.equal(false, isEnumerable.call(globalThis, 'globalThis'), 'globalThis.globalThis is not enumerable');
17
+ et.end();
18
+ });
19
+
20
+ t.test('writability', { skip: !defineProperties.supportsDescriptors }, function (wt) {
21
+ var desc = Object.getOwnPropertyDescriptor(globalThis, 'globalThis');
22
+ wt.equal(desc.writable, true, 'globalThis.globalThis is writable');
23
+ wt.end();
24
+ });
25
+
26
+ runTests(globalThis.globalThis, t);
27
+
28
+ t.end();
29
+ });
@@ -0,0 +1,36 @@
1
+ /* jscs:disable requireUseStrict */
2
+ /* eslint strict: 0, max-statements: 0 */
3
+
4
+ module.exports = function (theGlobal, t) {
5
+ t.equal(typeof theGlobal, 'object', 'is an object');
6
+
7
+ t.test('built-in globals', function (st) {
8
+ st.equal(theGlobal.Math, Math, 'Math is on the global');
9
+ st.equal(theGlobal.JSON, JSON, 'JSON is on the global');
10
+ st.equal(theGlobal.String, String, 'String is on the global');
11
+ st.equal(theGlobal.Array, Array, 'Array is on the global');
12
+ st.equal(theGlobal.Number, Number, 'Number is on the global');
13
+ st.equal(theGlobal.Boolean, Boolean, 'Boolean is on the global');
14
+ st.equal(theGlobal.Object, Object, 'Object is on the global');
15
+ st.equal(theGlobal.Function, Function, 'Function is on the global');
16
+ st.equal(theGlobal.Date, Date, 'Date is on the global');
17
+ st.equal(theGlobal.RegExp, RegExp, 'RegExp is on the global');
18
+
19
+ if (typeof Symbol === 'undefined') {
20
+ st.comment('# SKIP Symbol is not supported');
21
+ } else {
22
+ st.equal(theGlobal.Symbol, Symbol, 'Symbol is on the global');
23
+ }
24
+ st.end();
25
+ });
26
+
27
+ t.test('custom property', function (st) {
28
+ var key = 'random_custom_key_' + new Date().getTime();
29
+ var semaphore = {};
30
+ /* eslint no-eval: 1 */
31
+ eval(key + ' = semaphore;');
32
+ st.equal(theGlobal[key], semaphore, 'global variable ends up on the global object');
33
+ delete theGlobal[key]; // eslint-disable-line no-param-reassign
34
+ st.end();
35
+ });
36
+ };
@@ -0,0 +1,16 @@
1
+ {
2
+ "root": true,
3
+
4
+ "extends": "@ljharb",
5
+
6
+ "rules": {
7
+ "func-style": [2, "declaration"],
8
+ "id-length": 0,
9
+ "multiline-comment-style": 0,
10
+ "new-cap": [2, {
11
+ "capIsNewExceptions": [
12
+ "GetIntrinsic",
13
+ ],
14
+ }],
15
+ },
16
+ }
@@ -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/gopd
8
+ community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
9
+ liberapay: # Replace with a single Liberapay username
10
+ issuehunt: # Replace with a single IssueHunt username
11
+ otechie: # Replace with a single Otechie username
12
+ custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
@@ -0,0 +1,45 @@
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.0](https://github.com/ljharb/gopd/compare/v1.1.0...v1.2.0) - 2024-12-03
9
+
10
+ ### Commits
11
+
12
+ - [New] add `gOPD` entry point; remove `get-intrinsic` [`5b61232`](https://github.com/ljharb/gopd/commit/5b61232dedea4591a314bcf16101b1961cee024e)
13
+
14
+ ## [v1.1.0](https://github.com/ljharb/gopd/compare/v1.0.1...v1.1.0) - 2024-11-29
15
+
16
+ ### Commits
17
+
18
+ - [New] add types [`f585e39`](https://github.com/ljharb/gopd/commit/f585e397886d270e4ba84e53d226e4f9ca2eb0e6)
19
+ - [Dev Deps] update `@ljharb/eslint-config`, `auto-changelog`, `tape` [`0b8e4fd`](https://github.com/ljharb/gopd/commit/0b8e4fded64397a7726a9daa144a6cc9a5e2edfa)
20
+ - [Dev Deps] update `aud`, `npmignore`, `tape` [`48378b2`](https://github.com/ljharb/gopd/commit/48378b2443f09a4f7efbd0fb6c3ee845a6cabcf3)
21
+ - [Dev Deps] update `@ljharb/eslint-config`, `aud`, `tape` [`78099ee`](https://github.com/ljharb/gopd/commit/78099eeed41bfdc134c912280483689cc8861c31)
22
+ - [Tests] replace `aud` with `npm audit` [`4e0d0ac`](https://github.com/ljharb/gopd/commit/4e0d0ac47619d24a75318a8e1f543ee04b2a2632)
23
+ - [meta] add missing `engines.node` [`1443316`](https://github.com/ljharb/gopd/commit/14433165d07835c680155b3dfd62d9217d735eca)
24
+ - [Deps] update `get-intrinsic` [`eee5f51`](https://github.com/ljharb/gopd/commit/eee5f51769f3dbaf578b70e2a3199116b01aa670)
25
+ - [Deps] update `get-intrinsic` [`550c378`](https://github.com/ljharb/gopd/commit/550c3780e3a9c77b62565712a001b4ed64ea61f5)
26
+ - [Dev Deps] add missing peer dep [`8c2ecf8`](https://github.com/ljharb/gopd/commit/8c2ecf848122e4e30abfc5b5086fb48b390dce75)
27
+
28
+ ## [v1.0.1](https://github.com/ljharb/gopd/compare/v1.0.0...v1.0.1) - 2022-11-01
29
+
30
+ ### Commits
31
+
32
+ - [Fix] actually export gOPD instead of dP [`4b624bf`](https://github.com/ljharb/gopd/commit/4b624bfbeff788c5e3ff16d9443a83627847234f)
33
+
34
+ ## v1.0.0 - 2022-11-01
35
+
36
+ ### Commits
37
+
38
+ - Initial implementation, tests, readme [`0911e01`](https://github.com/ljharb/gopd/commit/0911e012cd642092bd88b732c161c58bf4f20bea)
39
+ - Initial commit [`b84e33f`](https://github.com/ljharb/gopd/commit/b84e33f5808a805ac57ff88d4247ad935569acbe)
40
+ - [actions] add reusable workflows [`12ae28a`](https://github.com/ljharb/gopd/commit/12ae28ae5f50f86e750215b6e2188901646d0119)
41
+ - npm init [`280118b`](https://github.com/ljharb/gopd/commit/280118badb45c80b4483836b5cb5315bddf6e582)
42
+ - [meta] add `auto-changelog` [`bb78de5`](https://github.com/ljharb/gopd/commit/bb78de5639a180747fb290c28912beaaf1615709)
43
+ - [meta] create FUNDING.yml; add `funding` in package.json [`11c22e6`](https://github.com/ljharb/gopd/commit/11c22e6355bb01f24e7fac4c9bb3055eb5b25002)
44
+ - [meta] use `npmignore` to autogenerate an npmignore file [`4f4537a`](https://github.com/ljharb/gopd/commit/4f4537a843b39f698c52f072845092e6fca345bb)
45
+ - Only apps should have lockfiles [`c567022`](https://github.com/ljharb/gopd/commit/c567022a18573aa7951cf5399445d9840e23e98b)
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2022 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,40 @@
1
+ # gopd <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.getOwnPropertyDescriptor`, but accounts for IE's broken implementation.
11
+
12
+ ## Usage
13
+
14
+ ```javascript
15
+ var gOPD = require('gopd');
16
+ var assert = require('assert');
17
+
18
+ if (gOPD) {
19
+ assert.equal(typeof gOPD, 'function', 'descriptors supported');
20
+ // use gOPD like Object.getOwnPropertyDescriptor here
21
+ } else {
22
+ assert.ok(!gOPD, 'descriptors not supported');
23
+ }
24
+ ```
25
+
26
+ [package-url]: https://npmjs.org/package/gopd
27
+ [npm-version-svg]: https://versionbadg.es/ljharb/gopd.svg
28
+ [deps-svg]: https://david-dm.org/ljharb/gopd.svg
29
+ [deps-url]: https://david-dm.org/ljharb/gopd
30
+ [dev-deps-svg]: https://david-dm.org/ljharb/gopd/dev-status.svg
31
+ [dev-deps-url]: https://david-dm.org/ljharb/gopd#info=devDependencies
32
+ [npm-badge-png]: https://nodei.co/npm/gopd.png?downloads=true&stars=true
33
+ [license-image]: https://img.shields.io/npm/l/gopd.svg
34
+ [license-url]: LICENSE
35
+ [downloads-image]: https://img.shields.io/npm/dm/gopd.svg
36
+ [downloads-url]: https://npm-stat.com/charts.html?package=gopd
37
+ [codecov-image]: https://codecov.io/gh/ljharb/gopd/branch/main/graphs/badge.svg
38
+ [codecov-url]: https://app.codecov.io/gh/ljharb/gopd/
39
+ [actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/ljharb/gopd
40
+ [actions-url]: https://github.com/ljharb/gopd/actions
@@ -0,0 +1 @@
1
+ export = Object.getOwnPropertyDescriptor;
@@ -0,0 +1,4 @@
1
+ 'use strict';
2
+
3
+ /** @type {import('./gOPD')} */
4
+ module.exports = Object.getOwnPropertyDescriptor;
@@ -0,0 +1,5 @@
1
+ declare function gOPD<O extends object, K extends keyof O>(obj: O, prop: K): PropertyDescriptor | undefined;
2
+
3
+ declare const fn: typeof gOPD | undefined | null;
4
+
5
+ export = fn;
@@ -0,0 +1,15 @@
1
+ 'use strict';
2
+
3
+ /** @type {import('.')} */
4
+ var $gOPD = require('./gOPD');
5
+
6
+ if ($gOPD) {
7
+ try {
8
+ $gOPD([], 'length');
9
+ } catch (e) {
10
+ // IE 8 has a broken gOPD
11
+ $gOPD = null;
12
+ }
13
+ }
14
+
15
+ module.exports = $gOPD;
@@ -0,0 +1,77 @@
1
+ {
2
+ "name": "gopd",
3
+ "version": "1.2.0",
4
+ "description": "`Object.getOwnPropertyDescriptor`, but accounts for IE's broken implementation.",
5
+ "main": "index.js",
6
+ "exports": {
7
+ ".": "./index.js",
8
+ "./gOPD": "./gOPD.js",
9
+ "./package.json": "./package.json"
10
+ },
11
+ "sideEffects": false,
12
+ "scripts": {
13
+ "prepack": "npmignore --auto --commentLines=autogenerated",
14
+ "prepublishOnly": "safe-publish-latest",
15
+ "prepublish": "not-in-publish || npm run prepublishOnly",
16
+ "prelint": "tsc -p . && attw -P",
17
+ "lint": "eslint --ext=js,mjs .",
18
+ "postlint": "evalmd README.md",
19
+ "pretest": "npm run lint",
20
+ "tests-only": "tape 'test/**/*.js'",
21
+ "test": "npm run tests-only",
22
+ "posttest": "npx npm@'>=10.2' audit --production",
23
+ "version": "auto-changelog && git add CHANGELOG.md",
24
+ "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\""
25
+ },
26
+ "repository": {
27
+ "type": "git",
28
+ "url": "git+https://github.com/ljharb/gopd.git"
29
+ },
30
+ "keywords": [
31
+ "ecmascript",
32
+ "javascript",
33
+ "getownpropertydescriptor",
34
+ "property",
35
+ "descriptor"
36
+ ],
37
+ "author": "Jordan Harband <ljharb@gmail.com>",
38
+ "funding": {
39
+ "url": "https://github.com/sponsors/ljharb"
40
+ },
41
+ "license": "MIT",
42
+ "bugs": {
43
+ "url": "https://github.com/ljharb/gopd/issues"
44
+ },
45
+ "homepage": "https://github.com/ljharb/gopd#readme",
46
+ "devDependencies": {
47
+ "@arethetypeswrong/cli": "^0.17.0",
48
+ "@ljharb/eslint-config": "^21.1.1",
49
+ "@ljharb/tsconfig": "^0.2.0",
50
+ "@types/tape": "^5.6.5",
51
+ "auto-changelog": "^2.5.0",
52
+ "encoding": "^0.1.13",
53
+ "eslint": "=8.8.0",
54
+ "evalmd": "^0.0.19",
55
+ "in-publish": "^2.0.1",
56
+ "npmignore": "^0.3.1",
57
+ "safe-publish-latest": "^2.0.0",
58
+ "tape": "^5.9.0",
59
+ "typescript": "next"
60
+ },
61
+ "auto-changelog": {
62
+ "output": "CHANGELOG.md",
63
+ "template": "keepachangelog",
64
+ "unreleased": false,
65
+ "commitLimit": false,
66
+ "backfillLimit": false,
67
+ "hideCredit": true
68
+ },
69
+ "publishConfig": {
70
+ "ignore": [
71
+ ".github/workflows"
72
+ ]
73
+ },
74
+ "engines": {
75
+ "node": ">= 0.4"
76
+ }
77
+ }
@@ -0,0 +1,36 @@
1
+ 'use strict';
2
+
3
+ var test = require('tape');
4
+ var gOPD = require('../');
5
+
6
+ test('gOPD', function (t) {
7
+ t.test('supported', { skip: !gOPD }, function (st) {
8
+ st.equal(typeof gOPD, 'function', 'is a function');
9
+
10
+ var obj = { x: 1 };
11
+ st.ok('x' in obj, 'property exists');
12
+
13
+ // @ts-expect-error TS can't figure out narrowing from `skip`
14
+ var desc = gOPD(obj, 'x');
15
+ st.deepEqual(
16
+ desc,
17
+ {
18
+ configurable: true,
19
+ enumerable: true,
20
+ value: 1,
21
+ writable: true
22
+ },
23
+ 'descriptor is as expected'
24
+ );
25
+
26
+ st.end();
27
+ });
28
+
29
+ t.test('not supported', { skip: !!gOPD }, function (st) {
30
+ st.notOk(gOPD, 'is falsy');
31
+
32
+ st.end();
33
+ });
34
+
35
+ t.end();
36
+ });
@@ -0,0 +1,9 @@
1
+ {
2
+ "extends": "@ljharb/tsconfig",
3
+ "compilerOptions": {
4
+ "target": "es2021",
5
+ },
6
+ "exclude": [
7
+ "coverage",
8
+ ],
9
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "root": true,
3
+
4
+ "extends": "@ljharb",
5
+
6
+ "rules": {
7
+ "func-name-matching": 0,
8
+ "id-length": 0,
9
+ "new-cap": [2, {
10
+ "capIsNewExceptions": ["GetIntrinsic"],
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/has-property-descriptors
8
+ community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
9
+ liberapay: # Replace with a single Liberapay username
10
+ issuehunt: # Replace with a single IssueHunt username
11
+ otechie: # Replace with a single Otechie username
12
+ custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
@@ -0,0 +1,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,35 @@
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.2](https://github.com/inspect-js/has-property-descriptors/compare/v1.0.1...v1.0.2) - 2024-02-12
9
+
10
+ ### Commits
11
+
12
+ - [Refactor] use `es-define-property` [`f93a8c8`](https://github.com/inspect-js/has-property-descriptors/commit/f93a8c85eba70cbceab500f2619fb5cce73a1805)
13
+ - [Dev Deps] update `aud`, `npmignore`, `tape` [`42b0c9d`](https://github.com/inspect-js/has-property-descriptors/commit/42b0c9d1c23e747755f0f2924923c418ea34a9ee)
14
+ - [Deps] update `get-intrinsic` [`35e9b46`](https://github.com/inspect-js/has-property-descriptors/commit/35e9b46a7f14331bf0de98b644dd803676746037)
15
+
16
+ ## [v1.0.1](https://github.com/inspect-js/has-property-descriptors/compare/v1.0.0...v1.0.1) - 2023-10-20
17
+
18
+ ### Commits
19
+
20
+ - [meta] use `npmignore` to autogenerate an npmignore file [`5bbf4da`](https://github.com/inspect-js/has-property-descriptors/commit/5bbf4dae1b58950d87bb3af508bee7513e640868)
21
+ - [actions] update rebase action to use reusable workflow [`3a5585b`](https://github.com/inspect-js/has-property-descriptors/commit/3a5585bf74988f71a8f59e67a07d594e62c51fd8)
22
+ - [Dev Deps] update `@ljharb/eslint-config`, `aud`, `tape` [`e5c1212`](https://github.com/inspect-js/has-property-descriptors/commit/e5c1212048a8fda549794c47863724ca60b89cae)
23
+ - [Dev Deps] update `aud`, `tape` [`e942917`](https://github.com/inspect-js/has-property-descriptors/commit/e942917b6c2f7c090d5623048989cf20d0834ebf)
24
+ - [Deps] update `get-intrinsic` [`f4a44ec`](https://github.com/inspect-js/has-property-descriptors/commit/f4a44ec6d94146fa6c550d3c15c31a2062c83ef4)
25
+ - [Deps] update `get-intrinsic` [`eeb275b`](https://github.com/inspect-js/has-property-descriptors/commit/eeb275b473e5d72ca843b61ca25cfcb06a5d4300)
26
+
27
+ ## v1.0.0 - 2022-04-14
28
+
29
+ ### Commits
30
+
31
+ - Initial implementation, tests [`303559f`](https://github.com/inspect-js/has-property-descriptors/commit/303559f2a72dfe7111573a1aec475ed4a184c35a)
32
+ - Initial commit [`3a7ca2d`](https://github.com/inspect-js/has-property-descriptors/commit/3a7ca2dc49f1fff0279a28bb16265e7615e14749)
33
+ - read me [`dd73dce`](https://github.com/inspect-js/has-property-descriptors/commit/dd73dce09d89d0f7a4a6e3b1e562a506f979a767)
34
+ - npm init [`c1e6557`](https://github.com/inspect-js/has-property-descriptors/commit/c1e655779de632d68cb944c50da6b71bcb7b8c85)
35
+ - Only apps should have lockfiles [`e72f7c6`](https://github.com/inspect-js/has-property-descriptors/commit/e72f7c68de534b2d273ee665f8b18d4ecc7f70b0)
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2022 Inspect JS
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,43 @@
1
+ # has-property-descriptors <sup>[![Version Badge][npm-version-svg]][package-url]</sup>
2
+
3
+ [![github actions][actions-image]][actions-url]
4
+ [![coverage][codecov-image]][codecov-url]
5
+ [![dependency status][deps-svg]][deps-url]
6
+ [![dev dependency status][dev-deps-svg]][dev-deps-url]
7
+ [![License][license-image]][license-url]
8
+ [![Downloads][downloads-image]][downloads-url]
9
+
10
+ [![npm badge][npm-badge-png]][package-url]
11
+
12
+ Does the environment have full property descriptor support? Handles IE 8's broken defineProperty/gOPD.
13
+
14
+ ## Example
15
+
16
+ ```js
17
+ var hasPropertyDescriptors = require('has-property-descriptors');
18
+ var assert = require('assert');
19
+
20
+ assert.equal(hasPropertyDescriptors(), true); // will be `false` in IE 6-8, and ES5 engines
21
+
22
+ // Arrays can not have their length `[[Defined]]` in some engines
23
+ assert.equal(hasPropertyDescriptors.hasArrayLengthDefineBug(), false); // will be `true` in Firefox 4-22, and node v0.6
24
+ ```
25
+
26
+ ## Tests
27
+ Simply clone the repo, `npm install`, and run `npm test`
28
+
29
+ [package-url]: https://npmjs.org/package/has-property-descriptors
30
+ [npm-version-svg]: https://versionbadg.es/inspect-js/has-property-descriptors.svg
31
+ [deps-svg]: https://david-dm.org/inspect-js/has-property-descriptors.svg
32
+ [deps-url]: https://david-dm.org/inspect-js/has-property-descriptors
33
+ [dev-deps-svg]: https://david-dm.org/inspect-js/has-property-descriptors/dev-status.svg
34
+ [dev-deps-url]: https://david-dm.org/inspect-js/has-property-descriptors#info=devDependencies
35
+ [npm-badge-png]: https://nodei.co/npm/has-property-descriptors.png?downloads=true&stars=true
36
+ [license-image]: https://img.shields.io/npm/l/has-property-descriptors.svg
37
+ [license-url]: LICENSE
38
+ [downloads-image]: https://img.shields.io/npm/dm/has-property-descriptors.svg
39
+ [downloads-url]: https://npm-stat.com/charts.html?package=has-property-descriptors
40
+ [codecov-image]: https://codecov.io/gh/inspect-js/has-property-descriptors/branch/main/graphs/badge.svg
41
+ [codecov-url]: https://app.codecov.io/gh/inspect-js/has-property-descriptors/
42
+ [actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/inspect-js/has-property-descriptors
43
+ [actions-url]: https://github.com/inspect-js/has-property-descriptors/actions
@@ -0,0 +1,22 @@
1
+ 'use strict';
2
+
3
+ var $defineProperty = require('es-define-property');
4
+
5
+ var hasPropertyDescriptors = function hasPropertyDescriptors() {
6
+ return !!$defineProperty;
7
+ };
8
+
9
+ hasPropertyDescriptors.hasArrayLengthDefineBug = function hasArrayLengthDefineBug() {
10
+ // node v0.6 has a bug where array lengths can be Set but not Defined
11
+ if (!$defineProperty) {
12
+ return null;
13
+ }
14
+ try {
15
+ return $defineProperty([], 'length', { value: 1 }).length !== 1;
16
+ } catch (e) {
17
+ // In Firefox 4-22, defining length on an array throws an exception.
18
+ return true;
19
+ }
20
+ };
21
+
22
+ module.exports = hasPropertyDescriptors;