styled-map-package 4.1.0 → 5.0.0-pre.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +47 -7
- package/bin/smp-download.js +27 -151
- package/bin/smp-mbtiles.js +12 -7
- package/bin/smp-view.js +32 -54
- package/lib/commands/download.js +188 -0
- package/lib/commands/mbtiles.js +21 -0
- package/lib/commands/view.js +57 -0
- package/lib/reporters.js +92 -0
- package/package.json +9 -181
- package/LICENSE.md +0 -7
- package/dist/download.cjs +0 -101
- package/dist/download.d.cts +0 -65
- package/dist/download.d.ts +0 -65
- package/dist/download.js +0 -77
- package/dist/from-mbtiles.cjs +0 -91
- package/dist/from-mbtiles.d.cts +0 -17
- package/dist/from-mbtiles.d.ts +0 -17
- package/dist/from-mbtiles.js +0 -57
- package/dist/index.cjs +0 -49
- package/dist/index.d.cts +0 -27
- package/dist/index.d.ts +0 -27
- package/dist/index.js +0 -18
- package/dist/reader-watch.cjs +0 -135
- package/dist/reader-watch.d.cts +0 -24
- package/dist/reader-watch.d.ts +0 -24
- package/dist/reader-watch.js +0 -101
- package/dist/reader.cjs +0 -168
- package/dist/reader.d.cts +0 -62
- package/dist/reader.d.ts +0 -62
- package/dist/reader.js +0 -139
- package/dist/reporters.cjs +0 -122
- package/dist/reporters.d.cts +0 -10
- package/dist/reporters.d.ts +0 -10
- package/dist/reporters.js +0 -88
- package/dist/server.cjs +0 -78
- package/dist/server.d.cts +0 -48
- package/dist/server.d.ts +0 -48
- package/dist/server.js +0 -54
- package/dist/style-downloader.cjs +0 -312
- package/dist/style-downloader.d.cts +0 -120
- package/dist/style-downloader.d.ts +0 -120
- package/dist/style-downloader.js +0 -288
- package/dist/tile-downloader.cjs +0 -158
- package/dist/tile-downloader.d.cts +0 -84
- package/dist/tile-downloader.d.ts +0 -84
- package/dist/tile-downloader.js +0 -126
- package/dist/types-yLQy3AKR.d.cts +0 -192
- package/dist/types-yLQy3AKR.d.ts +0 -192
- package/dist/utils/errors.cjs +0 -41
- package/dist/utils/errors.d.cts +0 -18
- package/dist/utils/errors.d.ts +0 -18
- package/dist/utils/errors.js +0 -16
- package/dist/utils/fetch.cjs +0 -96
- package/dist/utils/fetch.d.cts +0 -51
- package/dist/utils/fetch.d.ts +0 -51
- package/dist/utils/fetch.js +0 -62
- package/dist/utils/file-formats.cjs +0 -98
- package/dist/utils/file-formats.d.cts +0 -35
- package/dist/utils/file-formats.d.ts +0 -35
- package/dist/utils/file-formats.js +0 -62
- package/dist/utils/geo.cjs +0 -84
- package/dist/utils/geo.d.cts +0 -46
- package/dist/utils/geo.d.ts +0 -46
- package/dist/utils/geo.js +0 -56
- package/dist/utils/mapbox.cjs +0 -121
- package/dist/utils/mapbox.d.cts +0 -43
- package/dist/utils/mapbox.d.ts +0 -43
- package/dist/utils/mapbox.js +0 -91
- package/dist/utils/misc.cjs +0 -39
- package/dist/utils/misc.d.cts +0 -22
- package/dist/utils/misc.d.ts +0 -22
- package/dist/utils/misc.js +0 -13
- package/dist/utils/streams.cjs +0 -130
- package/dist/utils/streams.d.cts +0 -73
- package/dist/utils/streams.d.ts +0 -73
- package/dist/utils/streams.js +0 -103
- package/dist/utils/style.cjs +0 -126
- package/dist/utils/style.d.cts +0 -69
- package/dist/utils/style.d.ts +0 -69
- package/dist/utils/style.js +0 -98
- package/dist/utils/templates.cjs +0 -118
- package/dist/utils/templates.d.cts +0 -80
- package/dist/utils/templates.d.ts +0 -80
- package/dist/utils/templates.js +0 -81
- package/dist/writer.cjs +0 -449
- package/dist/writer.d.cts +0 -7
- package/dist/writer.d.ts +0 -7
- package/dist/writer.js +0 -424
- package/node_modules/@node-rs/crc32/LICENSE +0 -21
- package/node_modules/@node-rs/crc32/README.md +0 -61
- package/node_modules/@node-rs/crc32/browser.js +0 -1
- package/node_modules/@node-rs/crc32/index.d.ts +0 -5
- package/node_modules/@node-rs/crc32/index.js +0 -368
- package/node_modules/@node-rs/crc32/package.json +0 -97
- package/node_modules/@node-rs/crc32-linux-x64-gnu/README.md +0 -3
- package/node_modules/@node-rs/crc32-linux-x64-gnu/crc32.linux-x64-gnu.node +0 -0
- package/node_modules/@node-rs/crc32-linux-x64-gnu/package.json +0 -43
- package/node_modules/@node-rs/crc32-linux-x64-musl/README.md +0 -3
- package/node_modules/@node-rs/crc32-linux-x64-musl/crc32.linux-x64-musl.node +0 -0
- package/node_modules/@node-rs/crc32-linux-x64-musl/package.json +0 -43
- package/node_modules/define-data-property/.eslintrc +0 -24
- package/node_modules/define-data-property/.github/FUNDING.yml +0 -12
- package/node_modules/define-data-property/.nycrc +0 -13
- package/node_modules/define-data-property/CHANGELOG.md +0 -70
- package/node_modules/define-data-property/LICENSE +0 -21
- package/node_modules/define-data-property/README.md +0 -67
- package/node_modules/define-data-property/index.d.ts +0 -12
- package/node_modules/define-data-property/index.js +0 -56
- package/node_modules/define-data-property/package.json +0 -106
- package/node_modules/define-data-property/test/index.js +0 -392
- package/node_modules/define-data-property/tsconfig.json +0 -59
- package/node_modules/define-properties/.editorconfig +0 -13
- package/node_modules/define-properties/.eslintrc +0 -19
- package/node_modules/define-properties/.github/FUNDING.yml +0 -12
- package/node_modules/define-properties/.nycrc +0 -9
- package/node_modules/define-properties/CHANGELOG.md +0 -91
- package/node_modules/define-properties/LICENSE +0 -21
- package/node_modules/define-properties/README.md +0 -84
- package/node_modules/define-properties/index.js +0 -47
- package/node_modules/define-properties/package.json +0 -88
- package/node_modules/es-define-property/.eslintrc +0 -13
- package/node_modules/es-define-property/.github/FUNDING.yml +0 -12
- package/node_modules/es-define-property/.nycrc +0 -9
- package/node_modules/es-define-property/CHANGELOG.md +0 -29
- package/node_modules/es-define-property/LICENSE +0 -21
- package/node_modules/es-define-property/README.md +0 -49
- package/node_modules/es-define-property/index.d.ts +0 -3
- package/node_modules/es-define-property/index.js +0 -14
- package/node_modules/es-define-property/package.json +0 -81
- package/node_modules/es-define-property/test/index.js +0 -56
- package/node_modules/es-define-property/tsconfig.json +0 -10
- package/node_modules/es-errors/.eslintrc +0 -5
- package/node_modules/es-errors/.github/FUNDING.yml +0 -12
- package/node_modules/es-errors/CHANGELOG.md +0 -40
- package/node_modules/es-errors/LICENSE +0 -21
- package/node_modules/es-errors/README.md +0 -55
- package/node_modules/es-errors/eval.d.ts +0 -3
- package/node_modules/es-errors/eval.js +0 -4
- package/node_modules/es-errors/index.d.ts +0 -3
- package/node_modules/es-errors/index.js +0 -4
- package/node_modules/es-errors/package.json +0 -80
- package/node_modules/es-errors/range.d.ts +0 -3
- package/node_modules/es-errors/range.js +0 -4
- package/node_modules/es-errors/ref.d.ts +0 -3
- package/node_modules/es-errors/ref.js +0 -4
- package/node_modules/es-errors/syntax.d.ts +0 -3
- package/node_modules/es-errors/syntax.js +0 -4
- package/node_modules/es-errors/test/index.js +0 -19
- package/node_modules/es-errors/tsconfig.json +0 -49
- package/node_modules/es-errors/type.d.ts +0 -3
- package/node_modules/es-errors/type.js +0 -4
- package/node_modules/es-errors/uri.d.ts +0 -3
- package/node_modules/es-errors/uri.js +0 -4
- package/node_modules/globalthis/.eslintrc +0 -18
- package/node_modules/globalthis/.nycrc +0 -10
- package/node_modules/globalthis/CHANGELOG.md +0 -109
- package/node_modules/globalthis/LICENSE +0 -21
- package/node_modules/globalthis/README.md +0 -70
- package/node_modules/globalthis/auto.js +0 -3
- package/node_modules/globalthis/implementation.browser.js +0 -11
- package/node_modules/globalthis/implementation.js +0 -3
- package/node_modules/globalthis/index.js +0 -19
- package/node_modules/globalthis/package.json +0 -99
- package/node_modules/globalthis/polyfill.js +0 -10
- package/node_modules/globalthis/shim.js +0 -29
- package/node_modules/globalthis/test/implementation.js +0 -11
- package/node_modules/globalthis/test/index.js +0 -11
- package/node_modules/globalthis/test/native.js +0 -26
- package/node_modules/globalthis/test/shimmed.js +0 -29
- package/node_modules/globalthis/test/tests.js +0 -36
- package/node_modules/gopd/.eslintrc +0 -16
- package/node_modules/gopd/.github/FUNDING.yml +0 -12
- package/node_modules/gopd/CHANGELOG.md +0 -45
- package/node_modules/gopd/LICENSE +0 -21
- package/node_modules/gopd/README.md +0 -40
- package/node_modules/gopd/gOPD.d.ts +0 -1
- package/node_modules/gopd/gOPD.js +0 -4
- package/node_modules/gopd/index.d.ts +0 -5
- package/node_modules/gopd/index.js +0 -15
- package/node_modules/gopd/package.json +0 -77
- package/node_modules/gopd/test/index.js +0 -36
- package/node_modules/gopd/tsconfig.json +0 -9
- package/node_modules/has-property-descriptors/.eslintrc +0 -13
- package/node_modules/has-property-descriptors/.github/FUNDING.yml +0 -12
- package/node_modules/has-property-descriptors/.nycrc +0 -9
- package/node_modules/has-property-descriptors/CHANGELOG.md +0 -35
- package/node_modules/has-property-descriptors/LICENSE +0 -21
- package/node_modules/has-property-descriptors/README.md +0 -43
- package/node_modules/has-property-descriptors/index.js +0 -22
- package/node_modules/has-property-descriptors/package.json +0 -77
- package/node_modules/has-property-descriptors/test/index.js +0 -57
- package/node_modules/is-it-type/License +0 -19
- package/node_modules/is-it-type/README.md +0 -102
- package/node_modules/is-it-type/changelog.md +0 -239
- package/node_modules/is-it-type/dist/cjs/is-it-type.js +0 -173
- package/node_modules/is-it-type/dist/cjs/is-it-type.js.map +0 -1
- package/node_modules/is-it-type/dist/cjs/is-it-type.min.js +0 -2
- package/node_modules/is-it-type/dist/cjs/is-it-type.min.js.map +0 -1
- package/node_modules/is-it-type/dist/esm/is-it-type.js +0 -143
- package/node_modules/is-it-type/dist/esm/is-it-type.js.map +0 -1
- package/node_modules/is-it-type/dist/esm/is-it-type.min.js +0 -2
- package/node_modules/is-it-type/dist/esm/is-it-type.min.js.map +0 -1
- package/node_modules/is-it-type/dist/esm/package.json +0 -3
- package/node_modules/is-it-type/dist/umd/is-it-type.js +0 -450
- package/node_modules/is-it-type/dist/umd/is-it-type.js.map +0 -1
- package/node_modules/is-it-type/dist/umd/is-it-type.min.js +0 -2
- package/node_modules/is-it-type/dist/umd/is-it-type.min.js.map +0 -1
- package/node_modules/is-it-type/es/index.js +0 -8
- package/node_modules/is-it-type/es/package.json +0 -3
- package/node_modules/is-it-type/index.js +0 -10
- package/node_modules/is-it-type/package.json +0 -87
- package/node_modules/is-it-type/src/index.js +0 -169
- package/node_modules/object-keys/.editorconfig +0 -13
- package/node_modules/object-keys/.eslintrc +0 -17
- package/node_modules/object-keys/.travis.yml +0 -277
- package/node_modules/object-keys/CHANGELOG.md +0 -232
- package/node_modules/object-keys/LICENSE +0 -21
- package/node_modules/object-keys/README.md +0 -76
- package/node_modules/object-keys/implementation.js +0 -122
- package/node_modules/object-keys/index.js +0 -32
- package/node_modules/object-keys/isArguments.js +0 -17
- package/node_modules/object-keys/package.json +0 -88
- package/node_modules/object-keys/test/index.js +0 -5
- package/node_modules/simple-invariant/License +0 -19
- package/node_modules/simple-invariant/README.md +0 -64
- package/node_modules/simple-invariant/changelog.md +0 -31
- package/node_modules/simple-invariant/index.js +0 -19
- package/node_modules/simple-invariant/package.json +0 -50
- package/node_modules/yauzl-promise/License +0 -19
- package/node_modules/yauzl-promise/README.md +0 -440
- package/node_modules/yauzl-promise/index.js +0 -10
- package/node_modules/yauzl-promise/lib/entry.js +0 -312
- package/node_modules/yauzl-promise/lib/index.js +0 -160
- package/node_modules/yauzl-promise/lib/reader.js +0 -289
- package/node_modules/yauzl-promise/lib/shared.js +0 -20
- package/node_modules/yauzl-promise/lib/utils.js +0 -105
- package/node_modules/yauzl-promise/lib/zip.js +0 -1224
- package/node_modules/yauzl-promise/package.json +0 -56
|
@@ -1,232 +0,0 @@
|
|
|
1
|
-
1.1.1 / 2019-04-06
|
|
2
|
-
=================
|
|
3
|
-
* [Fix] exclude deprecated Firefox keys (#53)
|
|
4
|
-
|
|
5
|
-
1.1.0 / 2019-02-10
|
|
6
|
-
=================
|
|
7
|
-
* [New] [Refactor] move full implementation to `implementation` entry point
|
|
8
|
-
* [Refactor] only evaluate the implementation if `Object.keys` is not present
|
|
9
|
-
* [Tests] up to `node` `v11.8`, `v10.15`, `v8.15`, `v6.16`
|
|
10
|
-
* [Tests] remove jscs
|
|
11
|
-
* [Tests] switch to `npm audit` from `nsp`
|
|
12
|
-
|
|
13
|
-
1.0.12 / 2018-06-18
|
|
14
|
-
=================
|
|
15
|
-
* [Fix] avoid accessing `window.applicationCache`, to avoid issues with latest Chrome on HTTP (#46)
|
|
16
|
-
|
|
17
|
-
1.0.11 / 2016-07-05
|
|
18
|
-
=================
|
|
19
|
-
* [Fix] exclude keys regarding the style (eg. `pageYOffset`) on `window` to avoid reflow (#32)
|
|
20
|
-
|
|
21
|
-
1.0.10 / 2016-07-04
|
|
22
|
-
=================
|
|
23
|
-
* [Fix] exclude `height` and `width` keys on `window` to avoid reflow (#31)
|
|
24
|
-
* [Fix] In IE 6, `window.external` makes `Object.keys` throw
|
|
25
|
-
* [Tests] up to `node` `v6.2`, `v5.10`, `v4.4`
|
|
26
|
-
* [Tests] use pretest/posttest for linting/security
|
|
27
|
-
* [Dev Deps] update `tape`, `jscs`, `nsp`, `eslint`, `@ljharb/eslint-config`
|
|
28
|
-
* [Dev Deps] remove unused eccheck script + dep
|
|
29
|
-
|
|
30
|
-
1.0.9 / 2015-10-19
|
|
31
|
-
=================
|
|
32
|
-
* [Fix] Blacklist 'frame' property on window (#16, #17)
|
|
33
|
-
* [Dev Deps] update `jscs`, `eslint`, `@ljharb/eslint-config`
|
|
34
|
-
|
|
35
|
-
1.0.8 / 2015-10-14
|
|
36
|
-
=================
|
|
37
|
-
* [Fix] wrap automation equality bug checking in try/catch, per [es5-shim#327](https://github.com/es-shims/es5-shim/issues/327)
|
|
38
|
-
* [Fix] Blacklist 'window.frameElement' per [es5-shim#322](https://github.com/es-shims/es5-shim/issues/322)
|
|
39
|
-
* [Docs] Switch from vb.teelaun.ch to versionbadg.es for the npm version badge SVG
|
|
40
|
-
* [Tests] up to `io.js` `v3.3`, `node` `v4.2`
|
|
41
|
-
* [Dev Deps] update `eslint`, `tape`, `@ljharb/eslint-config`, `jscs`
|
|
42
|
-
|
|
43
|
-
1.0.7 / 2015-07-18
|
|
44
|
-
=================
|
|
45
|
-
* [Fix] A proper fix for 176f03335e90d5c8d0d8125a99f27819c9b9cdad / https://github.com/es-shims/es5-shim/issues/275 that doesn't break dontEnum/constructor fixes in IE 8.
|
|
46
|
-
* [Fix] Remove deprecation message in Chrome by touching deprecated window properties (#15)
|
|
47
|
-
* [Tests] Improve test output for automation equality bugfix
|
|
48
|
-
* [Tests] Test on `io.js` `v2.4`
|
|
49
|
-
|
|
50
|
-
1.0.6 / 2015-07-09
|
|
51
|
-
=================
|
|
52
|
-
* [Fix] Use an object lookup rather than ES5's `indexOf` (#14)
|
|
53
|
-
* [Tests] ES3 browsers don't have `Array.isArray`
|
|
54
|
-
* [Tests] Fix `no-shadow` rule, as well as an IE 8 bug caused by engine NFE shadowing bugs.
|
|
55
|
-
|
|
56
|
-
1.0.5 / 2015-07-03
|
|
57
|
-
=================
|
|
58
|
-
* [Fix] Fix a flabbergasting IE 8 bug where `localStorage.constructor.prototype === localStorage` throws
|
|
59
|
-
* [Tests] Test up to `io.js` `v2.3`
|
|
60
|
-
* [Dev Deps] Update `nsp`, `eslint`
|
|
61
|
-
|
|
62
|
-
1.0.4 / 2015-05-23
|
|
63
|
-
=================
|
|
64
|
-
* Fix a Safari 5.0 bug with `Object.keys` not working with `arguments`
|
|
65
|
-
* Test on latest `node` and `io.js`
|
|
66
|
-
* Update `jscs`, `tape`, `eslint`, `nsp`, `is`, `editorconfig-tools`, `covert`
|
|
67
|
-
|
|
68
|
-
1.0.3 / 2015-01-06
|
|
69
|
-
=================
|
|
70
|
-
* Revert "Make `object-keys` more robust against later environment tampering" to maintain ES3 compliance
|
|
71
|
-
|
|
72
|
-
1.0.2 / 2014-12-28
|
|
73
|
-
=================
|
|
74
|
-
* Update lots of dev dependencies
|
|
75
|
-
* Tweaks to README
|
|
76
|
-
* Make `object-keys` more robust against later environment tampering
|
|
77
|
-
|
|
78
|
-
1.0.1 / 2014-09-03
|
|
79
|
-
=================
|
|
80
|
-
* Update URLs and badges in README
|
|
81
|
-
|
|
82
|
-
1.0.0 / 2014-08-26
|
|
83
|
-
=================
|
|
84
|
-
* v1.0.0
|
|
85
|
-
|
|
86
|
-
0.6.1 / 2014-08-25
|
|
87
|
-
=================
|
|
88
|
-
* v0.6.1
|
|
89
|
-
* Updating dependencies (tape, covert, is)
|
|
90
|
-
* Update badges in readme
|
|
91
|
-
* Use separate var statements
|
|
92
|
-
|
|
93
|
-
0.6.0 / 2014-04-23
|
|
94
|
-
=================
|
|
95
|
-
* v0.6.0
|
|
96
|
-
* Updating dependencies (tape, covert)
|
|
97
|
-
* Make sure boxed primitives, and arguments objects, work properly in ES3 browsers
|
|
98
|
-
* Improve test matrix: test all node versions, but only latest two stables are a failure
|
|
99
|
-
* Remove internal foreach shim.
|
|
100
|
-
|
|
101
|
-
0.5.1 / 2014-03-09
|
|
102
|
-
=================
|
|
103
|
-
* 0.5.1
|
|
104
|
-
* Updating dependencies (tape, covert, is)
|
|
105
|
-
* Removing forEach from the module (but keeping it in tests)
|
|
106
|
-
|
|
107
|
-
0.5.0 / 2014-01-30
|
|
108
|
-
=================
|
|
109
|
-
* 0.5.0
|
|
110
|
-
* Explicitly returning the shim, instead of returning native Object.keys when present
|
|
111
|
-
* Adding a changelog.
|
|
112
|
-
* Cleaning up IIFE wrapping
|
|
113
|
-
* Testing on node 0.4 through 0.11
|
|
114
|
-
|
|
115
|
-
0.4.0 / 2013-08-14
|
|
116
|
-
==================
|
|
117
|
-
|
|
118
|
-
* v0.4.0
|
|
119
|
-
* In Chrome 4-10 and Safari 4, typeof (new RegExp) === 'function'
|
|
120
|
-
* If it's a string, make sure to use charAt instead of brackets.
|
|
121
|
-
* Only use Function#call if necessary.
|
|
122
|
-
* Making sure the context tests actually run.
|
|
123
|
-
* Better function detection
|
|
124
|
-
* Adding the android browser
|
|
125
|
-
* Fixing testling files
|
|
126
|
-
* Updating tape
|
|
127
|
-
* Removing the "is" dependency.
|
|
128
|
-
* Making an isArguments shim.
|
|
129
|
-
* Adding a local forEach shim and tests.
|
|
130
|
-
* Updating paths.
|
|
131
|
-
* Moving the shim test.
|
|
132
|
-
* v0.3.0
|
|
133
|
-
|
|
134
|
-
0.3.0 / 2013-05-18
|
|
135
|
-
==================
|
|
136
|
-
|
|
137
|
-
* README tweak.
|
|
138
|
-
* Fixing constructor enum issue. Fixes [#5](https://github.com/ljharb/object-keys/issues/5).
|
|
139
|
-
* Adding a test for [#5](https://github.com/ljharb/object-keys/issues/5)
|
|
140
|
-
* Updating readme.
|
|
141
|
-
* Updating dependencies.
|
|
142
|
-
* Giving credit to lodash.
|
|
143
|
-
* Make sure that a prototype's constructor property is not enumerable. Fixes [#3](https://github.com/ljharb/object-keys/issues/3).
|
|
144
|
-
* Adding additional tests to handle arguments objects, and to skip "prototype" in functions. Fixes [#2](https://github.com/ljharb/object-keys/issues/2).
|
|
145
|
-
* Fixing a typo on this test for [#3](https://github.com/ljharb/object-keys/issues/3).
|
|
146
|
-
* Adding node 0.10 to travis.
|
|
147
|
-
* Adding an IE < 9 test per [#3](https://github.com/ljharb/object-keys/issues/3)
|
|
148
|
-
* Adding an iOS 5 mobile Safari test per [#2](https://github.com/ljharb/object-keys/issues/2)
|
|
149
|
-
* Moving "indexof" and "is" to be dev dependencies.
|
|
150
|
-
* Making sure the shim works with functions.
|
|
151
|
-
* Flattening the tests.
|
|
152
|
-
|
|
153
|
-
0.2.0 / 2013-05-10
|
|
154
|
-
==================
|
|
155
|
-
|
|
156
|
-
* v0.2.0
|
|
157
|
-
* Object.keys should work with arrays.
|
|
158
|
-
|
|
159
|
-
0.1.8 / 2013-05-10
|
|
160
|
-
==================
|
|
161
|
-
|
|
162
|
-
* v0.1.8
|
|
163
|
-
* Upgrading dependencies.
|
|
164
|
-
* Using a simpler check.
|
|
165
|
-
* Fixing a bug in hasDontEnumBug browsers.
|
|
166
|
-
* Using the newest tape!
|
|
167
|
-
* Fixing this error test.
|
|
168
|
-
* "undefined" is probably a reserved word in ES3.
|
|
169
|
-
* Better test message.
|
|
170
|
-
|
|
171
|
-
0.1.7 / 2013-04-17
|
|
172
|
-
==================
|
|
173
|
-
|
|
174
|
-
* Upgrading "is" once more.
|
|
175
|
-
* The key "null" is breaking some browsers.
|
|
176
|
-
|
|
177
|
-
0.1.6 / 2013-04-17
|
|
178
|
-
==================
|
|
179
|
-
|
|
180
|
-
* v0.1.6
|
|
181
|
-
* Upgrading "is"
|
|
182
|
-
|
|
183
|
-
0.1.5 / 2013-04-14
|
|
184
|
-
==================
|
|
185
|
-
|
|
186
|
-
* Bumping version.
|
|
187
|
-
* Adding more testling browsers.
|
|
188
|
-
* Updating "is"
|
|
189
|
-
|
|
190
|
-
0.1.4 / 2013-04-08
|
|
191
|
-
==================
|
|
192
|
-
|
|
193
|
-
* Using "is" instead of "is-extended".
|
|
194
|
-
|
|
195
|
-
0.1.3 / 2013-04-07
|
|
196
|
-
==================
|
|
197
|
-
|
|
198
|
-
* Using "foreach" instead of my own shim.
|
|
199
|
-
* Removing "tap"; I'll just wait for "tape" to fix its node 0.10 bug.
|
|
200
|
-
|
|
201
|
-
0.1.2 / 2013-04-03
|
|
202
|
-
==================
|
|
203
|
-
|
|
204
|
-
* Adding dependency status; moving links to an index at the bottom.
|
|
205
|
-
* Upgrading is-extended; version 0.1.2
|
|
206
|
-
* Adding an npm version badge.
|
|
207
|
-
|
|
208
|
-
0.1.1 / 2013-04-01
|
|
209
|
-
==================
|
|
210
|
-
|
|
211
|
-
* Adding Travis CI.
|
|
212
|
-
* Bumping the version.
|
|
213
|
-
* Adding indexOf since IE sucks.
|
|
214
|
-
* Adding a forEach shim since older browsers don't have Array#forEach.
|
|
215
|
-
* Upgrading tape - 0.3.2 uses Array#map
|
|
216
|
-
* Using explicit end instead of plan.
|
|
217
|
-
* Can't test with Array.isArray in older browsers.
|
|
218
|
-
* Using is-extended.
|
|
219
|
-
* Fixing testling files.
|
|
220
|
-
* JSHint/JSLint-ing.
|
|
221
|
-
* Removing an unused object.
|
|
222
|
-
* Using strict mode.
|
|
223
|
-
|
|
224
|
-
0.1.0 / 2013-03-30
|
|
225
|
-
==================
|
|
226
|
-
|
|
227
|
-
* Changing the exports should have meant a higher version bump.
|
|
228
|
-
* Oops, fixing the repo URL.
|
|
229
|
-
* Adding more tests.
|
|
230
|
-
* 0.0.2
|
|
231
|
-
* Merge branch 'export_one_thing'; closes [#1](https://github.com/ljharb/object-keys/issues/1)
|
|
232
|
-
* Move shim export to a separate file.
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
The MIT License (MIT)
|
|
2
|
-
|
|
3
|
-
Copyright (C) 2013 Jordan Harband
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in
|
|
13
|
-
all copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
-
THE SOFTWARE.
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
#object-keys <sup>[![Version Badge][npm-version-svg]][package-url]</sup>
|
|
2
|
-
|
|
3
|
-
[![Build Status][travis-svg]][travis-url]
|
|
4
|
-
[![dependency status][deps-svg]][deps-url]
|
|
5
|
-
[![dev dependency status][dev-deps-svg]][dev-deps-url]
|
|
6
|
-
[![License][license-image]][license-url]
|
|
7
|
-
[![Downloads][downloads-image]][downloads-url]
|
|
8
|
-
|
|
9
|
-
[![npm badge][npm-badge-png]][package-url]
|
|
10
|
-
|
|
11
|
-
[![browser support][testling-svg]][testling-url]
|
|
12
|
-
|
|
13
|
-
An Object.keys shim. Invoke its "shim" method to shim Object.keys if it is unavailable.
|
|
14
|
-
|
|
15
|
-
Most common usage:
|
|
16
|
-
```js
|
|
17
|
-
var keys = Object.keys || require('object-keys');
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
## Example
|
|
21
|
-
|
|
22
|
-
```js
|
|
23
|
-
var keys = require('object-keys');
|
|
24
|
-
var assert = require('assert');
|
|
25
|
-
var obj = {
|
|
26
|
-
a: true,
|
|
27
|
-
b: true,
|
|
28
|
-
c: true
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
assert.deepEqual(keys(obj), ['a', 'b', 'c']);
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
```js
|
|
35
|
-
var keys = require('object-keys');
|
|
36
|
-
var assert = require('assert');
|
|
37
|
-
/* when Object.keys is not present */
|
|
38
|
-
delete Object.keys;
|
|
39
|
-
var shimmedKeys = keys.shim();
|
|
40
|
-
assert.equal(shimmedKeys, keys);
|
|
41
|
-
assert.deepEqual(Object.keys(obj), keys(obj));
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
```js
|
|
45
|
-
var keys = require('object-keys');
|
|
46
|
-
var assert = require('assert');
|
|
47
|
-
/* when Object.keys is present */
|
|
48
|
-
var shimmedKeys = keys.shim();
|
|
49
|
-
assert.equal(shimmedKeys, Object.keys);
|
|
50
|
-
assert.deepEqual(Object.keys(obj), keys(obj));
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
## Source
|
|
54
|
-
Implementation taken directly from [es5-shim][es5-shim-url], with modifications, including from [lodash][lodash-url].
|
|
55
|
-
|
|
56
|
-
## Tests
|
|
57
|
-
Simply clone the repo, `npm install`, and run `npm test`
|
|
58
|
-
|
|
59
|
-
[package-url]: https://npmjs.org/package/object-keys
|
|
60
|
-
[npm-version-svg]: http://versionbadg.es/ljharb/object-keys.svg
|
|
61
|
-
[travis-svg]: https://travis-ci.org/ljharb/object-keys.svg
|
|
62
|
-
[travis-url]: https://travis-ci.org/ljharb/object-keys
|
|
63
|
-
[deps-svg]: https://david-dm.org/ljharb/object-keys.svg
|
|
64
|
-
[deps-url]: https://david-dm.org/ljharb/object-keys
|
|
65
|
-
[dev-deps-svg]: https://david-dm.org/ljharb/object-keys/dev-status.svg
|
|
66
|
-
[dev-deps-url]: https://david-dm.org/ljharb/object-keys#info=devDependencies
|
|
67
|
-
[testling-svg]: https://ci.testling.com/ljharb/object-keys.png
|
|
68
|
-
[testling-url]: https://ci.testling.com/ljharb/object-keys
|
|
69
|
-
[es5-shim-url]: https://github.com/es-shims/es5-shim/blob/master/es5-shim.js#L542-589
|
|
70
|
-
[lodash-url]: https://github.com/lodash/lodash
|
|
71
|
-
[npm-badge-png]: https://nodei.co/npm/object-keys.png?downloads=true&stars=true
|
|
72
|
-
[license-image]: http://img.shields.io/npm/l/object-keys.svg
|
|
73
|
-
[license-url]: LICENSE
|
|
74
|
-
[downloads-image]: http://img.shields.io/npm/dm/object-keys.svg
|
|
75
|
-
[downloads-url]: http://npm-stat.com/charts.html?package=object-keys
|
|
76
|
-
|
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var keysShim;
|
|
4
|
-
if (!Object.keys) {
|
|
5
|
-
// modified from https://github.com/es-shims/es5-shim
|
|
6
|
-
var has = Object.prototype.hasOwnProperty;
|
|
7
|
-
var toStr = Object.prototype.toString;
|
|
8
|
-
var isArgs = require('./isArguments'); // eslint-disable-line global-require
|
|
9
|
-
var isEnumerable = Object.prototype.propertyIsEnumerable;
|
|
10
|
-
var hasDontEnumBug = !isEnumerable.call({ toString: null }, 'toString');
|
|
11
|
-
var hasProtoEnumBug = isEnumerable.call(function () {}, 'prototype');
|
|
12
|
-
var dontEnums = [
|
|
13
|
-
'toString',
|
|
14
|
-
'toLocaleString',
|
|
15
|
-
'valueOf',
|
|
16
|
-
'hasOwnProperty',
|
|
17
|
-
'isPrototypeOf',
|
|
18
|
-
'propertyIsEnumerable',
|
|
19
|
-
'constructor'
|
|
20
|
-
];
|
|
21
|
-
var equalsConstructorPrototype = function (o) {
|
|
22
|
-
var ctor = o.constructor;
|
|
23
|
-
return ctor && ctor.prototype === o;
|
|
24
|
-
};
|
|
25
|
-
var excludedKeys = {
|
|
26
|
-
$applicationCache: true,
|
|
27
|
-
$console: true,
|
|
28
|
-
$external: true,
|
|
29
|
-
$frame: true,
|
|
30
|
-
$frameElement: true,
|
|
31
|
-
$frames: true,
|
|
32
|
-
$innerHeight: true,
|
|
33
|
-
$innerWidth: true,
|
|
34
|
-
$onmozfullscreenchange: true,
|
|
35
|
-
$onmozfullscreenerror: true,
|
|
36
|
-
$outerHeight: true,
|
|
37
|
-
$outerWidth: true,
|
|
38
|
-
$pageXOffset: true,
|
|
39
|
-
$pageYOffset: true,
|
|
40
|
-
$parent: true,
|
|
41
|
-
$scrollLeft: true,
|
|
42
|
-
$scrollTop: true,
|
|
43
|
-
$scrollX: true,
|
|
44
|
-
$scrollY: true,
|
|
45
|
-
$self: true,
|
|
46
|
-
$webkitIndexedDB: true,
|
|
47
|
-
$webkitStorageInfo: true,
|
|
48
|
-
$window: true
|
|
49
|
-
};
|
|
50
|
-
var hasAutomationEqualityBug = (function () {
|
|
51
|
-
/* global window */
|
|
52
|
-
if (typeof window === 'undefined') { return false; }
|
|
53
|
-
for (var k in window) {
|
|
54
|
-
try {
|
|
55
|
-
if (!excludedKeys['$' + k] && has.call(window, k) && window[k] !== null && typeof window[k] === 'object') {
|
|
56
|
-
try {
|
|
57
|
-
equalsConstructorPrototype(window[k]);
|
|
58
|
-
} catch (e) {
|
|
59
|
-
return true;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
} catch (e) {
|
|
63
|
-
return true;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
return false;
|
|
67
|
-
}());
|
|
68
|
-
var equalsConstructorPrototypeIfNotBuggy = function (o) {
|
|
69
|
-
/* global window */
|
|
70
|
-
if (typeof window === 'undefined' || !hasAutomationEqualityBug) {
|
|
71
|
-
return equalsConstructorPrototype(o);
|
|
72
|
-
}
|
|
73
|
-
try {
|
|
74
|
-
return equalsConstructorPrototype(o);
|
|
75
|
-
} catch (e) {
|
|
76
|
-
return false;
|
|
77
|
-
}
|
|
78
|
-
};
|
|
79
|
-
|
|
80
|
-
keysShim = function keys(object) {
|
|
81
|
-
var isObject = object !== null && typeof object === 'object';
|
|
82
|
-
var isFunction = toStr.call(object) === '[object Function]';
|
|
83
|
-
var isArguments = isArgs(object);
|
|
84
|
-
var isString = isObject && toStr.call(object) === '[object String]';
|
|
85
|
-
var theKeys = [];
|
|
86
|
-
|
|
87
|
-
if (!isObject && !isFunction && !isArguments) {
|
|
88
|
-
throw new TypeError('Object.keys called on a non-object');
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
var skipProto = hasProtoEnumBug && isFunction;
|
|
92
|
-
if (isString && object.length > 0 && !has.call(object, 0)) {
|
|
93
|
-
for (var i = 0; i < object.length; ++i) {
|
|
94
|
-
theKeys.push(String(i));
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
if (isArguments && object.length > 0) {
|
|
99
|
-
for (var j = 0; j < object.length; ++j) {
|
|
100
|
-
theKeys.push(String(j));
|
|
101
|
-
}
|
|
102
|
-
} else {
|
|
103
|
-
for (var name in object) {
|
|
104
|
-
if (!(skipProto && name === 'prototype') && has.call(object, name)) {
|
|
105
|
-
theKeys.push(String(name));
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
if (hasDontEnumBug) {
|
|
111
|
-
var skipConstructor = equalsConstructorPrototypeIfNotBuggy(object);
|
|
112
|
-
|
|
113
|
-
for (var k = 0; k < dontEnums.length; ++k) {
|
|
114
|
-
if (!(skipConstructor && dontEnums[k] === 'constructor') && has.call(object, dontEnums[k])) {
|
|
115
|
-
theKeys.push(dontEnums[k]);
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
return theKeys;
|
|
120
|
-
};
|
|
121
|
-
}
|
|
122
|
-
module.exports = keysShim;
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var slice = Array.prototype.slice;
|
|
4
|
-
var isArgs = require('./isArguments');
|
|
5
|
-
|
|
6
|
-
var origKeys = Object.keys;
|
|
7
|
-
var keysShim = origKeys ? function keys(o) { return origKeys(o); } : require('./implementation');
|
|
8
|
-
|
|
9
|
-
var originalKeys = Object.keys;
|
|
10
|
-
|
|
11
|
-
keysShim.shim = function shimObjectKeys() {
|
|
12
|
-
if (Object.keys) {
|
|
13
|
-
var keysWorksWithArguments = (function () {
|
|
14
|
-
// Safari 5.0 bug
|
|
15
|
-
var args = Object.keys(arguments);
|
|
16
|
-
return args && args.length === arguments.length;
|
|
17
|
-
}(1, 2));
|
|
18
|
-
if (!keysWorksWithArguments) {
|
|
19
|
-
Object.keys = function keys(object) { // eslint-disable-line func-name-matching
|
|
20
|
-
if (isArgs(object)) {
|
|
21
|
-
return originalKeys(slice.call(object));
|
|
22
|
-
}
|
|
23
|
-
return originalKeys(object);
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
} else {
|
|
27
|
-
Object.keys = keysShim;
|
|
28
|
-
}
|
|
29
|
-
return Object.keys || keysShim;
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
module.exports = keysShim;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var toStr = Object.prototype.toString;
|
|
4
|
-
|
|
5
|
-
module.exports = function isArguments(value) {
|
|
6
|
-
var str = toStr.call(value);
|
|
7
|
-
var isArgs = str === '[object Arguments]';
|
|
8
|
-
if (!isArgs) {
|
|
9
|
-
isArgs = str !== '[object Array]' &&
|
|
10
|
-
value !== null &&
|
|
11
|
-
typeof value === 'object' &&
|
|
12
|
-
typeof value.length === 'number' &&
|
|
13
|
-
value.length >= 0 &&
|
|
14
|
-
toStr.call(value.callee) === '[object Function]';
|
|
15
|
-
}
|
|
16
|
-
return isArgs;
|
|
17
|
-
};
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "object-keys",
|
|
3
|
-
"version": "1.1.1",
|
|
4
|
-
"author": {
|
|
5
|
-
"name": "Jordan Harband",
|
|
6
|
-
"email": "ljharb@gmail.com",
|
|
7
|
-
"url": "http://ljharb.codes"
|
|
8
|
-
},
|
|
9
|
-
"contributors": [
|
|
10
|
-
{
|
|
11
|
-
"name": "Jordan Harband",
|
|
12
|
-
"email": "ljharb@gmail.com",
|
|
13
|
-
"url": "http://ljharb.codes"
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
"name": "Raynos",
|
|
17
|
-
"email": "raynos2@gmail.com"
|
|
18
|
-
},
|
|
19
|
-
{
|
|
20
|
-
"name": "Nathan Rajlich",
|
|
21
|
-
"email": "nathan@tootallnate.net"
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
"name": "Ivan Starkov",
|
|
25
|
-
"email": "istarkov@gmail.com"
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
"name": "Gary Katsevman",
|
|
29
|
-
"email": "git@gkatsev.com"
|
|
30
|
-
}
|
|
31
|
-
],
|
|
32
|
-
"description": "An Object.keys replacement, in case Object.keys is not available. From https://github.com/es-shims/es5-shim",
|
|
33
|
-
"license": "MIT",
|
|
34
|
-
"main": "index.js",
|
|
35
|
-
"scripts": {
|
|
36
|
-
"pretest": "npm run --silent lint",
|
|
37
|
-
"test": "npm run --silent tests-only",
|
|
38
|
-
"posttest": "npm run --silent audit",
|
|
39
|
-
"tests-only": "node test/index.js",
|
|
40
|
-
"coverage": "covert test/*.js",
|
|
41
|
-
"coverage-quiet": "covert test/*.js --quiet",
|
|
42
|
-
"lint": "eslint .",
|
|
43
|
-
"preaudit": "npm install --package-lock --package-lock-only",
|
|
44
|
-
"audit": "npm audit",
|
|
45
|
-
"postaudit": "rm package-lock.json"
|
|
46
|
-
},
|
|
47
|
-
"repository": {
|
|
48
|
-
"type": "git",
|
|
49
|
-
"url": "git://github.com/ljharb/object-keys.git"
|
|
50
|
-
},
|
|
51
|
-
"keywords": [
|
|
52
|
-
"Object.keys",
|
|
53
|
-
"keys",
|
|
54
|
-
"ES5",
|
|
55
|
-
"shim"
|
|
56
|
-
],
|
|
57
|
-
"dependencies": {},
|
|
58
|
-
"devDependencies": {
|
|
59
|
-
"@ljharb/eslint-config": "^13.1.1",
|
|
60
|
-
"covert": "^1.1.1",
|
|
61
|
-
"eslint": "^5.13.0",
|
|
62
|
-
"foreach": "^2.0.5",
|
|
63
|
-
"indexof": "^0.0.1",
|
|
64
|
-
"is": "^3.3.0",
|
|
65
|
-
"tape": "^4.9.2"
|
|
66
|
-
},
|
|
67
|
-
"testling": {
|
|
68
|
-
"files": "test/index.js",
|
|
69
|
-
"browsers": [
|
|
70
|
-
"iexplore/6.0..latest",
|
|
71
|
-
"firefox/3.0..6.0",
|
|
72
|
-
"firefox/15.0..latest",
|
|
73
|
-
"firefox/nightly",
|
|
74
|
-
"chrome/4.0..10.0",
|
|
75
|
-
"chrome/20.0..latest",
|
|
76
|
-
"chrome/canary",
|
|
77
|
-
"opera/10.0..latest",
|
|
78
|
-
"opera/next",
|
|
79
|
-
"safari/4.0..latest",
|
|
80
|
-
"ipad/6.0..latest",
|
|
81
|
-
"iphone/6.0..latest",
|
|
82
|
-
"android-browser/4.2"
|
|
83
|
-
]
|
|
84
|
-
},
|
|
85
|
-
"engines": {
|
|
86
|
-
"node": ">= 0.4"
|
|
87
|
-
}
|
|
88
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
Copyright (c) 2021 Overlook Motel (theoverlookmotel@gmail.com)
|
|
2
|
-
|
|
3
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
4
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
5
|
-
in the Software without restriction, including without limitation the rights
|
|
6
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
7
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
8
|
-
furnished to do so, subject to the following conditions:
|
|
9
|
-
|
|
10
|
-
The above copyright notice and this permission notice shall be included in
|
|
11
|
-
all copies or substantial portions of the Software.
|
|
12
|
-
|
|
13
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
14
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
15
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
16
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
17
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
18
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
19
|
-
THE SOFTWARE.
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
[](https://www.npmjs.com/package/simple-invariant)
|
|
2
|
-
[](https://github.com/overlookmotel/simple-invariant/actions)
|
|
3
|
-
[](https://david-dm.org/overlookmotel/simple-invariant)
|
|
4
|
-
[](https://david-dm.org/overlookmotel/simple-invariant)
|
|
5
|
-
[](https://coveralls.io/r/overlookmotel/simple-invariant)
|
|
6
|
-
|
|
7
|
-
# Super-simple invariant function
|
|
8
|
-
|
|
9
|
-
## Usage
|
|
10
|
-
|
|
11
|
-
### What is this package?
|
|
12
|
-
|
|
13
|
-
It's the simplest possible invariant/assert function. The code is:
|
|
14
|
-
|
|
15
|
-
```js
|
|
16
|
-
function invariant( condition, message ) {
|
|
17
|
-
if ( !condition ) {
|
|
18
|
-
throw new Error( message || 'Invariant failed' );
|
|
19
|
-
}
|
|
20
|
-
};
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
So, this code:
|
|
24
|
-
|
|
25
|
-
```js
|
|
26
|
-
if ( !foo ) throw new Error( 'foo must be truthy' );
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
...can be replaced with the shorter:
|
|
30
|
-
|
|
31
|
-
```js
|
|
32
|
-
invariant( foo, 'foo must be truthy' );
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
### Isn't this the same as tiny-invariant?
|
|
36
|
-
|
|
37
|
-
Pretty much. The only difference is that the error thrown will *always* have the full error message, regardless of whether `process.env.NODE_ENV === 'production'` or not.
|
|
38
|
-
|
|
39
|
-
## Versioning
|
|
40
|
-
|
|
41
|
-
This module follows [semver](https://semver.org/). Breaking changes will only be made in major version updates.
|
|
42
|
-
|
|
43
|
-
All active NodeJS release lines are supported (v10+ at time of writing). After a release line of NodeJS reaches end of life according to [Node's LTS schedule](https://nodejs.org/en/about/releases/), support for that version of Node may be dropped at any time, and this will not be considered a breaking change. Dropping support for a Node version will be made in a minor version update (e.g. 1.2.0 to 1.3.0). If you are using a Node version which is approaching end of life, pin your dependency of this module to patch updates only using tilde (`~`) e.g. `~1.2.3` to avoid breakages.
|
|
44
|
-
|
|
45
|
-
## Tests
|
|
46
|
-
|
|
47
|
-
Use `npm test` to run the tests. Use `npm run cover` to check coverage.
|
|
48
|
-
|
|
49
|
-
## Changelog
|
|
50
|
-
|
|
51
|
-
See [changelog.md](https://github.com/overlookmotel/simple-invariant/blob/master/changelog.md)
|
|
52
|
-
|
|
53
|
-
## Issues
|
|
54
|
-
|
|
55
|
-
If you discover a bug, please raise an issue on Github. https://github.com/overlookmotel/simple-invariant/issues
|
|
56
|
-
|
|
57
|
-
## Contribution
|
|
58
|
-
|
|
59
|
-
Pull requests are very welcome. Please:
|
|
60
|
-
|
|
61
|
-
* ensure all tests pass before submitting PR
|
|
62
|
-
* add tests for new features
|
|
63
|
-
* document new functionality/API additions in README
|
|
64
|
-
* do not add an entry to Changelog (Changelog is created when cutting releases)
|