aurix-ai 2.7.3 → 2.7.4
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/dist/agent/AgentLoop.d.ts.map +1 -1
- package/dist/agent/AgentLoop.js +1 -52
- package/dist/agent/AgentLoop.js.map +1 -1
- package/dist/cli/App.d.ts.map +1 -1
- package/dist/cli/App.js +6 -0
- package/dist/cli/App.js.map +1 -1
- package/dist/cli/commands.d.ts.map +1 -1
- package/dist/cli/commands.js +7 -0
- package/dist/cli/commands.js.map +1 -1
- package/dist/tools/Browser.d.ts.map +1 -1
- package/dist/tools/Browser.js +44 -615
- package/dist/tools/Browser.js.map +1 -1
- package/dist/tools/captcha/CaptchaRouter.d.ts +6 -0
- package/dist/tools/captcha/CaptchaRouter.d.ts.map +1 -0
- package/dist/tools/captcha/CaptchaRouter.js +371 -0
- package/dist/tools/captcha/CaptchaRouter.js.map +1 -0
- package/dist/tools/captcha/RecaptchaSolver.d.ts +2 -0
- package/dist/tools/captcha/RecaptchaSolver.d.ts.map +1 -0
- package/dist/tools/captcha/RecaptchaSolver.js +1114 -0
- package/dist/tools/captcha/RecaptchaSolver.js.map +1 -0
- package/dist/tools/captcha/common.d.ts +35 -0
- package/dist/tools/captcha/common.d.ts.map +1 -0
- package/dist/tools/captcha/common.js +445 -0
- package/dist/tools/captcha/common.js.map +1 -0
- package/dist/tools/captcha/index.d.ts +5 -0
- package/dist/tools/captcha/index.d.ts.map +1 -0
- package/dist/tools/captcha/index.js +4 -0
- package/dist/tools/captcha/index.js.map +1 -0
- package/package.json +1 -2
- package/scripts/build.cjs +0 -15
- package/scripts/run-task.mjs +86 -0
- package/native/token-counter/index.d.ts +0 -7
- package/native/token-counter/index.js +0 -316
- package/native/token-counter/node_modules/.package-lock.json +0 -568
- package/native/token-counter/node_modules/2/array.js +0 -25
- package/native/token-counter/node_modules/2/index.js +0 -12
- package/native/token-counter/node_modules/2/iterator.js +0 -13
- package/native/token-counter/node_modules/2/license.txt +0 -21
- package/native/token-counter/node_modules/2/map.js +0 -27
- package/native/token-counter/node_modules/2/number.js +0 -109
- package/native/token-counter/node_modules/2/object.js +0 -23
- package/native/token-counter/node_modules/2/package.json +0 -60
- package/native/token-counter/node_modules/2/readme.md +0 -246
- package/native/token-counter/node_modules/2/string.js +0 -11
- package/native/token-counter/node_modules/2/test.js +0 -520
- package/native/token-counter/node_modules/@lamansky/every/index.js +0 -16
- package/native/token-counter/node_modules/@lamansky/every/license.txt +0 -21
- package/native/token-counter/node_modules/@lamansky/every/package.json +0 -38
- package/native/token-counter/node_modules/@lamansky/every/readme.md +0 -46
- package/native/token-counter/node_modules/@lamansky/flatten/index.js +0 -5
- package/native/token-counter/node_modules/@lamansky/flatten/license.txt +0 -21
- package/native/token-counter/node_modules/@lamansky/flatten/package.json +0 -35
- package/native/token-counter/node_modules/@lamansky/flatten/readme.md +0 -41
- package/native/token-counter/node_modules/@napi-rs/cli/LICENSE +0 -21
- package/native/token-counter/node_modules/@napi-rs/cli/README.md +0 -96
- package/native/token-counter/node_modules/@napi-rs/cli/package.json +0 -65
- package/native/token-counter/node_modules/@napi-rs/cli/scripts/index.js +0 -51371
- package/native/token-counter/node_modules/add-counter/index.js +0 -3
- package/native/token-counter/node_modules/add-counter/license.txt +0 -21
- package/native/token-counter/node_modules/add-counter/package.json +0 -34
- package/native/token-counter/node_modules/add-counter/readme.md +0 -36
- package/native/token-counter/node_modules/array-pad/LICENSE +0 -22
- package/native/token-counter/node_modules/array-pad/README.md +0 -80
- package/native/token-counter/node_modules/array-pad/index.js +0 -30
- package/native/token-counter/node_modules/array-pad/package.json +0 -28
- package/native/token-counter/node_modules/arrify/index.js +0 -8
- package/native/token-counter/node_modules/arrify/license +0 -21
- package/native/token-counter/node_modules/arrify/package.json +0 -33
- package/native/token-counter/node_modules/arrify/readme.md +0 -36
- package/native/token-counter/node_modules/case-insensitive/index.js +0 -72
- package/native/token-counter/node_modules/case-insensitive/license.txt +0 -21
- package/native/token-counter/node_modules/case-insensitive/package.json +0 -39
- package/native/token-counter/node_modules/case-insensitive/readme.md +0 -39
- package/native/token-counter/node_modules/case-insensitive/test.js +0 -114
- package/native/token-counter/node_modules/class-chain/index.js +0 -32
- package/native/token-counter/node_modules/class-chain/license.txt +0 -21
- package/native/token-counter/node_modules/class-chain/package.json +0 -39
- package/native/token-counter/node_modules/class-chain/readme.md +0 -23
- package/native/token-counter/node_modules/class-chain/test.js +0 -77
- package/native/token-counter/node_modules/copy-own/index.js +0 -10
- package/native/token-counter/node_modules/copy-own/license.txt +0 -21
- package/native/token-counter/node_modules/copy-own/package.json +0 -37
- package/native/token-counter/node_modules/copy-own/readme.md +0 -67
- package/native/token-counter/node_modules/def-props/index.js +0 -43
- package/native/token-counter/node_modules/def-props/license.txt +0 -21
- package/native/token-counter/node_modules/def-props/node_modules/is-obj/index.d.ts +0 -22
- package/native/token-counter/node_modules/def-props/node_modules/is-obj/index.js +0 -6
- package/native/token-counter/node_modules/def-props/node_modules/is-obj/license +0 -9
- package/native/token-counter/node_modules/def-props/node_modules/is-obj/package.json +0 -34
- package/native/token-counter/node_modules/def-props/node_modules/is-obj/readme.md +0 -39
- package/native/token-counter/node_modules/def-props/package.json +0 -51
- package/native/token-counter/node_modules/def-props/readme.md +0 -117
- package/native/token-counter/node_modules/empty-iterator/index.js +0 -3
- package/native/token-counter/node_modules/empty-iterator/license.txt +0 -21
- package/native/token-counter/node_modules/empty-iterator/package.json +0 -33
- package/native/token-counter/node_modules/empty-iterator/readme.md +0 -23
- package/native/token-counter/node_modules/enforce-range/index.js +0 -15
- package/native/token-counter/node_modules/enforce-range/license.txt +0 -21
- package/native/token-counter/node_modules/enforce-range/node_modules/2/array.js +0 -43
- package/native/token-counter/node_modules/enforce-range/node_modules/2/index.js +0 -10
- package/native/token-counter/node_modules/enforce-range/node_modules/2/iterator.js +0 -26
- package/native/token-counter/node_modules/enforce-range/node_modules/2/license.txt +0 -21
- package/native/token-counter/node_modules/enforce-range/node_modules/2/map.js +0 -47
- package/native/token-counter/node_modules/enforce-range/node_modules/2/number.js +0 -33
- package/native/token-counter/node_modules/enforce-range/node_modules/2/object.js +0 -61
- package/native/token-counter/node_modules/enforce-range/node_modules/2/package.json +0 -41
- package/native/token-counter/node_modules/enforce-range/node_modules/2/readme.md +0 -210
- package/native/token-counter/node_modules/enforce-range/node_modules/2/string.js +0 -37
- package/native/token-counter/node_modules/enforce-range/node_modules/2/test.js +0 -413
- package/native/token-counter/node_modules/enforce-range/package.json +0 -36
- package/native/token-counter/node_modules/enforce-range/readme.md +0 -53
- package/native/token-counter/node_modules/english-list/.travis.yml +0 -6
- package/native/token-counter/node_modules/english-list/LICENSE +0 -22
- package/native/token-counter/node_modules/english-list/README.md +0 -44
- package/native/token-counter/node_modules/english-list/index.js +0 -34
- package/native/token-counter/node_modules/english-list/package.json +0 -31
- package/native/token-counter/node_modules/english-list/test.log +0 -6
- package/native/token-counter/node_modules/errate/index.js +0 -19
- package/native/token-counter/node_modules/errate/license.txt +0 -21
- package/native/token-counter/node_modules/errate/package.json +0 -39
- package/native/token-counter/node_modules/errate/readme.md +0 -79
- package/native/token-counter/node_modules/ffn/index.js +0 -9
- package/native/token-counter/node_modules/ffn/license.txt +0 -21
- package/native/token-counter/node_modules/ffn/package.json +0 -34
- package/native/token-counter/node_modules/ffn/readme.md +0 -51
- package/native/token-counter/node_modules/get-own-property/index.js +0 -5
- package/native/token-counter/node_modules/get-own-property/license.txt +0 -21
- package/native/token-counter/node_modules/get-own-property/package.json +0 -31
- package/native/token-counter/node_modules/get-own-property/readme.md +0 -22
- package/native/token-counter/node_modules/has-duplicates/index.js +0 -11
- package/native/token-counter/node_modules/has-duplicates/license.txt +0 -21
- package/native/token-counter/node_modules/has-duplicates/package.json +0 -32
- package/native/token-counter/node_modules/has-duplicates/readme.md +0 -23
- package/native/token-counter/node_modules/has-duplicates/test.js +0 -30
- package/native/token-counter/node_modules/if-else-throw/index.js +0 -8
- package/native/token-counter/node_modules/if-else-throw/license.txt +0 -21
- package/native/token-counter/node_modules/if-else-throw/package.json +0 -37
- package/native/token-counter/node_modules/if-else-throw/readme.md +0 -32
- package/native/token-counter/node_modules/is-array-of-length/index.js +0 -7
- package/native/token-counter/node_modules/is-array-of-length/license.txt +0 -21
- package/native/token-counter/node_modules/is-array-of-length/package.json +0 -42
- package/native/token-counter/node_modules/is-array-of-length/readme.md +0 -41
- package/native/token-counter/node_modules/is-class-of/index.js +0 -7
- package/native/token-counter/node_modules/is-class-of/license.txt +0 -21
- package/native/token-counter/node_modules/is-class-of/package.json +0 -35
- package/native/token-counter/node_modules/is-class-of/readme.md +0 -57
- package/native/token-counter/node_modules/is-global-object/index.js +0 -6
- package/native/token-counter/node_modules/is-global-object/license.txt +0 -21
- package/native/token-counter/node_modules/is-global-object/package.json +0 -34
- package/native/token-counter/node_modules/is-global-object/readme.md +0 -22
- package/native/token-counter/node_modules/is-instance-of/index.js +0 -28
- package/native/token-counter/node_modules/is-instance-of/license.txt +0 -21
- package/native/token-counter/node_modules/is-instance-of/package.json +0 -44
- package/native/token-counter/node_modules/is-instance-of/readme.md +0 -55
- package/native/token-counter/node_modules/is-iterable/index.js +0 -5
- package/native/token-counter/node_modules/is-iterable/license +0 -21
- package/native/token-counter/node_modules/is-iterable/package.json +0 -30
- package/native/token-counter/node_modules/is-iterable/readme.md +0 -23
- package/native/token-counter/node_modules/is-nil/LICENSE +0 -21
- package/native/token-counter/node_modules/is-nil/README.md +0 -47
- package/native/token-counter/node_modules/is-nil/index.js +0 -6
- package/native/token-counter/node_modules/is-nil/package.json +0 -46
- package/native/token-counter/node_modules/is-obj/index.js +0 -5
- package/native/token-counter/node_modules/is-obj/license +0 -21
- package/native/token-counter/node_modules/is-obj/package.json +0 -33
- package/native/token-counter/node_modules/is-obj/readme.md +0 -34
- package/native/token-counter/node_modules/is-object/.eslintignore +0 -1
- package/native/token-counter/node_modules/is-object/.eslintrc +0 -5
- package/native/token-counter/node_modules/is-object/.nycrc +0 -13
- package/native/token-counter/node_modules/is-object/.testem.json +0 -14
- package/native/token-counter/node_modules/is-object/CHANGELOG.md +0 -121
- package/native/token-counter/node_modules/is-object/LICENSE +0 -19
- package/native/token-counter/node_modules/is-object/README.md +0 -48
- package/native/token-counter/node_modules/is-object/index.js +0 -5
- package/native/token-counter/node_modules/is-object/package.json +0 -78
- package/native/token-counter/node_modules/is-object/test/index.js +0 -44
- package/native/token-counter/node_modules/is-plain-object/LICENSE +0 -21
- package/native/token-counter/node_modules/is-plain-object/README.md +0 -104
- package/native/token-counter/node_modules/is-plain-object/index.d.ts +0 -5
- package/native/token-counter/node_modules/is-plain-object/index.js +0 -37
- package/native/token-counter/node_modules/is-plain-object/package.json +0 -79
- package/native/token-counter/node_modules/isobject/LICENSE +0 -21
- package/native/token-counter/node_modules/isobject/README.md +0 -122
- package/native/token-counter/node_modules/isobject/index.d.ts +0 -5
- package/native/token-counter/node_modules/isobject/index.js +0 -12
- package/native/token-counter/node_modules/isobject/package.json +0 -74
- package/native/token-counter/node_modules/lodash.set/LICENSE +0 -47
- package/native/token-counter/node_modules/lodash.set/README.md +0 -18
- package/native/token-counter/node_modules/lodash.set/index.js +0 -990
- package/native/token-counter/node_modules/lodash.set/package.json +0 -17
- package/native/token-counter/node_modules/longest-first/index.js +0 -3
- package/native/token-counter/node_modules/longest-first/license.txt +0 -21
- package/native/token-counter/node_modules/longest-first/package.json +0 -36
- package/native/token-counter/node_modules/longest-first/readme.md +0 -29
- package/native/token-counter/node_modules/m-o/index.js +0 -27
- package/native/token-counter/node_modules/m-o/license.txt +0 -21
- package/native/token-counter/node_modules/m-o/node_modules/new-object/index.js +0 -23
- package/native/token-counter/node_modules/m-o/node_modules/new-object/license.txt +0 -21
- package/native/token-counter/node_modules/m-o/node_modules/new-object/package.json +0 -40
- package/native/token-counter/node_modules/m-o/node_modules/new-object/readme.md +0 -55
- package/native/token-counter/node_modules/m-o/package.json +0 -45
- package/native/token-counter/node_modules/m-o/readme.md +0 -87
- package/native/token-counter/node_modules/map-iter/index.js +0 -6
- package/native/token-counter/node_modules/map-iter/license.txt +0 -21
- package/native/token-counter/node_modules/map-iter/package.json +0 -40
- package/native/token-counter/node_modules/map-iter/readme.md +0 -46
- package/native/token-counter/node_modules/new-object/index.js +0 -5
- package/native/token-counter/node_modules/new-object/license.txt +0 -21
- package/native/token-counter/node_modules/new-object/package.json +0 -49
- package/native/token-counter/node_modules/new-object/readme.md +0 -145
- package/native/token-counter/node_modules/ofn/index.js +0 -22
- package/native/token-counter/node_modules/ofn/license.txt +0 -21
- package/native/token-counter/node_modules/ofn/package.json +0 -40
- package/native/token-counter/node_modules/ofn/readme.md +0 -63
- package/native/token-counter/node_modules/otherwise/index.js +0 -11
- package/native/token-counter/node_modules/otherwise/license.txt +0 -21
- package/native/token-counter/node_modules/otherwise/package.json +0 -38
- package/native/token-counter/node_modules/otherwise/readme.md +0 -29
- package/native/token-counter/node_modules/parser-factory/index.js +0 -138
- package/native/token-counter/node_modules/parser-factory/license.txt +0 -21
- package/native/token-counter/node_modules/parser-factory/node_modules/arrify/index.d.ts +0 -38
- package/native/token-counter/node_modules/parser-factory/node_modules/arrify/index.js +0 -23
- package/native/token-counter/node_modules/parser-factory/node_modules/arrify/license +0 -9
- package/native/token-counter/node_modules/parser-factory/node_modules/arrify/package.json +0 -35
- package/native/token-counter/node_modules/parser-factory/node_modules/arrify/readme.md +0 -39
- package/native/token-counter/node_modules/parser-factory/package.json +0 -38
- package/native/token-counter/node_modules/parser-factory/readme.md +0 -15
- package/native/token-counter/node_modules/pfn/index.js +0 -5
- package/native/token-counter/node_modules/pfn/license.txt +0 -21
- package/native/token-counter/node_modules/pfn/package.json +0 -41
- package/native/token-counter/node_modules/pfn/readme.md +0 -111
- package/native/token-counter/node_modules/pfn/strict.js +0 -8
- package/native/token-counter/node_modules/plainify/index.js +0 -5
- package/native/token-counter/node_modules/plainify/license.txt +0 -21
- package/native/token-counter/node_modules/plainify/package.json +0 -36
- package/native/token-counter/node_modules/plainify/readme.md +0 -47
- package/native/token-counter/node_modules/possible-function/changelog.md +0 -7
- package/native/token-counter/node_modules/possible-function/index.js +0 -43
- package/native/token-counter/node_modules/possible-function/license.txt +0 -21
- package/native/token-counter/node_modules/possible-function/package.json +0 -34
- package/native/token-counter/node_modules/possible-function/readme.md +0 -77
- package/native/token-counter/node_modules/possible-function/test.js +0 -32
- package/native/token-counter/node_modules/qfn/index.js +0 -11
- package/native/token-counter/node_modules/qfn/license.txt +0 -21
- package/native/token-counter/node_modules/qfn/package.json +0 -40
- package/native/token-counter/node_modules/qfn/readme.md +0 -45
- package/native/token-counter/node_modules/roadblock/index.js +0 -3
- package/native/token-counter/node_modules/roadblock/license.txt +0 -21
- package/native/token-counter/node_modules/roadblock/package.json +0 -40
- package/native/token-counter/node_modules/roadblock/readme.md +0 -59
- package/native/token-counter/node_modules/round-to/index.d.ts +0 -56
- package/native/token-counter/node_modules/round-to/index.js +0 -37
- package/native/token-counter/node_modules/round-to/license +0 -9
- package/native/token-counter/node_modules/round-to/package.json +0 -38
- package/native/token-counter/node_modules/round-to/readme.md +0 -71
- package/native/token-counter/node_modules/rtrim-array/index.js +0 -10
- package/native/token-counter/node_modules/rtrim-array/license.txt +0 -21
- package/native/token-counter/node_modules/rtrim-array/package.json +0 -41
- package/native/token-counter/node_modules/rtrim-array/readme.md +0 -75
- package/native/token-counter/node_modules/sbo/index.js +0 -25
- package/native/token-counter/node_modules/sbo/license.txt +0 -21
- package/native/token-counter/node_modules/sbo/package.json +0 -50
- package/native/token-counter/node_modules/sbo/readme.md +0 -105
- package/native/token-counter/node_modules/sorp/index.js +0 -3
- package/native/token-counter/node_modules/sorp/license.txt +0 -21
- package/native/token-counter/node_modules/sorp/package.json +0 -34
- package/native/token-counter/node_modules/sorp/readme.md +0 -25
- package/native/token-counter/node_modules/trim-call/index.js +0 -6
- package/native/token-counter/node_modules/trim-call/license.txt +0 -21
- package/native/token-counter/node_modules/trim-call/package.json +0 -40
- package/native/token-counter/node_modules/trim-call/readme.md +0 -80
- package/native/token-counter/node_modules/type-error/LICENSE +0 -21
- package/native/token-counter/node_modules/type-error/README.md +0 -24
- package/native/token-counter/node_modules/type-error/index.js +0 -35
- package/native/token-counter/node_modules/type-error/package.json +0 -11
- package/native/token-counter/node_modules/vfn/index.js +0 -21
- package/native/token-counter/node_modules/vfn/license.txt +0 -21
- package/native/token-counter/node_modules/vfn/package.json +0 -40
- package/native/token-counter/node_modules/vfn/readme.md +0 -81
- package/native/token-counter/node_modules/wfn/index.js +0 -43
- package/native/token-counter/node_modules/wfn/license.txt +0 -21
- package/native/token-counter/node_modules/wfn/package.json +0 -38
- package/native/token-counter/node_modules/wfn/readme.md +0 -81
- package/native/token-counter/package-lock.json +0 -578
- package/native/token-counter/package.json +0 -21
- package/native/token-counter/token-counter.linux-x64-gnu.node +0 -0
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright ©2018–2019 Fr. John Lamansky
|
|
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.
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "errate",
|
|
3
|
-
"version": "1.3.0",
|
|
4
|
-
"description": "Converts a value into an Error of the specified type.",
|
|
5
|
-
"keywords": [
|
|
6
|
-
"convert",
|
|
7
|
-
"error"
|
|
8
|
-
],
|
|
9
|
-
"author": {
|
|
10
|
-
"name": "Fr. John Lamansky",
|
|
11
|
-
"url": "lamansky.com"
|
|
12
|
-
},
|
|
13
|
-
"license": "MIT",
|
|
14
|
-
"repository": "lamansky/errate",
|
|
15
|
-
"main": "index.js",
|
|
16
|
-
"files": [],
|
|
17
|
-
"engines": {
|
|
18
|
-
"node": ">=6.0.0"
|
|
19
|
-
},
|
|
20
|
-
"dependencies": {
|
|
21
|
-
"copy-own": "^1.2.0",
|
|
22
|
-
"is-class-of": "^1.0.1",
|
|
23
|
-
"is-instance-of": "^1.0.2",
|
|
24
|
-
"trim-call": "^1.1.0"
|
|
25
|
-
},
|
|
26
|
-
"devDependencies": {
|
|
27
|
-
"eslint-config-lamansky": "^2.0.0",
|
|
28
|
-
"mocha": "^6.2.1"
|
|
29
|
-
},
|
|
30
|
-
"scripts": {
|
|
31
|
-
"test": "mocha"
|
|
32
|
-
},
|
|
33
|
-
"eslintConfig": {
|
|
34
|
-
"extends": "lamansky",
|
|
35
|
-
"env": {
|
|
36
|
-
"mocha": true
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
}
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
# errate
|
|
2
|
-
|
|
3
|
-
Converts a value into an Error of the specified type.
|
|
4
|
-
|
|
5
|
-
## Installation
|
|
6
|
-
|
|
7
|
-
Requires [Node.js](https://nodejs.org/) 6.0.0 or above.
|
|
8
|
-
|
|
9
|
-
```bash
|
|
10
|
-
npm i errate
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
## API
|
|
14
|
-
|
|
15
|
-
The module exports a single function.
|
|
16
|
-
|
|
17
|
-
### Parameters
|
|
18
|
-
|
|
19
|
-
1. Optional: `e` (string, Error object, boolean, or null): The error message, or an existing Error object. If `null` or a boolean, the returned Error will have no message.
|
|
20
|
-
2. Optional: `Cls` (Error class): The desired class of the returned Error (such as `TypeError` or `RangeError`). Defaults to `Error`.
|
|
21
|
-
3. Optional: Object argument:
|
|
22
|
-
* `defaultMessage` (string): The first argument that will be provided to the constructor if an Error object is being created (i.e. if `e` is `true` or “falsey”).
|
|
23
|
-
* `forceClass` (boolean): If set to `true`, instances of other `Error` classes will be converted to instances of `Cls`. If set to `false`, `Cls` will only be used to wrap string errors. Defaults to `true`.
|
|
24
|
-
|
|
25
|
-
### Return Value
|
|
26
|
-
|
|
27
|
-
An Error of the specified class.
|
|
28
|
-
|
|
29
|
-
## Examples
|
|
30
|
-
|
|
31
|
-
### Default Class With Message
|
|
32
|
-
|
|
33
|
-
```javascript
|
|
34
|
-
const errate = require('errate')
|
|
35
|
-
|
|
36
|
-
const err = errate('Message')
|
|
37
|
-
err instanceof Error // true
|
|
38
|
-
err.message // 'Message'
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
### Default Class Without Message
|
|
42
|
-
|
|
43
|
-
```javascript
|
|
44
|
-
const errate = require('errate')
|
|
45
|
-
|
|
46
|
-
const err = errate()
|
|
47
|
-
err instanceof Error // true
|
|
48
|
-
err.message // ''
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
### Error Subclass With Message
|
|
52
|
-
|
|
53
|
-
```javascript
|
|
54
|
-
const errate = require('errate')
|
|
55
|
-
|
|
56
|
-
const err = errate('Message', TypeError)
|
|
57
|
-
err instanceof TypeError // true
|
|
58
|
-
err.message // 'Message'
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
### Error Subclass Without Message
|
|
62
|
-
|
|
63
|
-
```javascript
|
|
64
|
-
const errate = require('errate')
|
|
65
|
-
|
|
66
|
-
const err = errate(TypeError)
|
|
67
|
-
err instanceof TypeError // true
|
|
68
|
-
err.message // ''
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
### Error Class Conversion
|
|
72
|
-
|
|
73
|
-
```javascript
|
|
74
|
-
const errate = require('errate')
|
|
75
|
-
|
|
76
|
-
const err = errate(new TypeError('Message'), RangeError)
|
|
77
|
-
err instanceof RangeError // true
|
|
78
|
-
err.message // 'Message'
|
|
79
|
-
```
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
module.exports = function ffn (f, {blacklist} = {}) {
|
|
4
|
-
const type = typeof f
|
|
5
|
-
if (type === 'function') return f
|
|
6
|
-
if (type === 'undefined') return blacklist ? x => !x : x => !!x
|
|
7
|
-
if (Array.isArray(f)) return x => f.includes(x)
|
|
8
|
-
return x => x === f
|
|
9
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright ©2018 John Lamansky
|
|
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.
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "ffn",
|
|
3
|
-
"version": "2.1.0",
|
|
4
|
-
"description": "Turns arrays and values into Filtering Functions.",
|
|
5
|
-
"keywords": [
|
|
6
|
-
"filter",
|
|
7
|
-
"comparison",
|
|
8
|
-
"test",
|
|
9
|
-
"function"
|
|
10
|
-
],
|
|
11
|
-
"author": "John Lamansky",
|
|
12
|
-
"license": "MIT",
|
|
13
|
-
"homepage": "https://github.com/lamansky/ffn",
|
|
14
|
-
"repository": "lamansky/ffn",
|
|
15
|
-
"main": "index.js",
|
|
16
|
-
"files": [],
|
|
17
|
-
"engines": {
|
|
18
|
-
"node": ">=6.0.0"
|
|
19
|
-
},
|
|
20
|
-
"dependencies": {},
|
|
21
|
-
"devDependencies": {
|
|
22
|
-
"eslint-config-lamansky": "^1.0.0",
|
|
23
|
-
"mocha": "^5.1.0"
|
|
24
|
-
},
|
|
25
|
-
"scripts": {
|
|
26
|
-
"test": "mocha"
|
|
27
|
-
},
|
|
28
|
-
"eslintConfig": {
|
|
29
|
-
"extends": "lamansky",
|
|
30
|
-
"env": {
|
|
31
|
-
"mocha": true
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
# ffn
|
|
2
|
-
|
|
3
|
-
Turns arrays and values into Filtering Functions.
|
|
4
|
-
|
|
5
|
-
Many projects use callbacks to filter values. Sometimes this filtering involves complex conditions that need a function. Other times one just wants to test if the value equals another, or if the value appears in an array of acceptable values. Instead of making your project’s end-users write filters like `x => x === 'value'` or `x => ['ok', 'also ok'].includes(x)`, let them provide the value or the array directly, and `ffn` will turn it into a filtering function.
|
|
6
|
-
|
|
7
|
-
## Installation
|
|
8
|
-
|
|
9
|
-
Requires [Node.js](https://nodejs.org/) 6.0.0 or above.
|
|
10
|
-
|
|
11
|
-
```bash
|
|
12
|
-
npm i ffn
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
## API
|
|
16
|
-
|
|
17
|
-
The module exports a single function.
|
|
18
|
-
|
|
19
|
-
### Parameters
|
|
20
|
-
|
|
21
|
-
1. `f` (any): A Function, an Array, or some other value.
|
|
22
|
-
2. Object argument:
|
|
23
|
-
* Optional: `blacklist` (bool): Set to `true` if `ffn` is being used to create a blacklist. This will make falsey values test true when `f` is undefined. Defaults to `false`.
|
|
24
|
-
|
|
25
|
-
### Return Values
|
|
26
|
-
|
|
27
|
-
* If `f` is a Function: returns `f`
|
|
28
|
-
* If `f` is omitted or otherwise undefined: returns a function that tests whether its argument is truthy (unless `blacklist` is `true`)
|
|
29
|
-
* If `f` is an Array: returns a function that tests whether its argument is included in `f`
|
|
30
|
-
* Otherwise: returns a function that tests whether its argument is strictly equal to `f`
|
|
31
|
-
|
|
32
|
-
## Example
|
|
33
|
-
|
|
34
|
-
```javascript
|
|
35
|
-
const ffn = require('ffn')
|
|
36
|
-
|
|
37
|
-
const arr = [1, 2, 3, 4, 5]
|
|
38
|
-
|
|
39
|
-
// ffn returns functions as-is
|
|
40
|
-
arr.find(ffn(x => x % 2 === 0)) // 2
|
|
41
|
-
|
|
42
|
-
// ffn creates a function which checks for inclusion in the array
|
|
43
|
-
arr.find(ffn([4, 5])) // 4
|
|
44
|
-
|
|
45
|
-
// ffn creates a function which checks for equality with the value
|
|
46
|
-
arr.find(ffn(3)) // 3
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
## Related
|
|
50
|
-
|
|
51
|
-
For more projects like this, check out the [xfn](https://github.com/lamansky/xfn) family of modules.
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright ©2017 John Lamansky
|
|
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.
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "get-own-property",
|
|
3
|
-
"version": "1.0.0",
|
|
4
|
-
"description": "Retrieves a property only if hasOwnProperty() is true.",
|
|
5
|
-
"keywords": [
|
|
6
|
-
"get",
|
|
7
|
-
"object",
|
|
8
|
-
"own",
|
|
9
|
-
"property",
|
|
10
|
-
"hasOwnProperty"
|
|
11
|
-
],
|
|
12
|
-
"author": "John Lamansky",
|
|
13
|
-
"license": "MIT",
|
|
14
|
-
"homepage": "https://github.com/lamansky/get-own-property",
|
|
15
|
-
"repository": "lamansky/get-own-property",
|
|
16
|
-
"main": "index.js",
|
|
17
|
-
"files": [],
|
|
18
|
-
"devDependencies": {
|
|
19
|
-
"eslint-config-lamansky": "^1.0.0",
|
|
20
|
-
"mocha": "^3.2.0"
|
|
21
|
-
},
|
|
22
|
-
"scripts": {
|
|
23
|
-
"test": "mocha"
|
|
24
|
-
},
|
|
25
|
-
"eslintConfig": {
|
|
26
|
-
"extends": "lamansky",
|
|
27
|
-
"env": {
|
|
28
|
-
"mocha": true
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
# getOwnProperty
|
|
2
|
-
|
|
3
|
-
Retrieves a property only if [`hasOwnProperty()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/hasOwnProperty) is true.
|
|
4
|
-
|
|
5
|
-
## Installation
|
|
6
|
-
|
|
7
|
-
```bash
|
|
8
|
-
npm install get-own-property --save
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
## Usage
|
|
12
|
-
|
|
13
|
-
```javascript
|
|
14
|
-
const getOwnProperty = require('get-own-property')
|
|
15
|
-
|
|
16
|
-
const obj = {hello: 'world'}
|
|
17
|
-
|
|
18
|
-
getOwnProperty(obj, 'hello') // 'world'
|
|
19
|
-
|
|
20
|
-
typeof obj.toString // 'function'
|
|
21
|
-
getOwnProperty(obj, 'toString') // undefined
|
|
22
|
-
```
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Returns true if the array has duplicate elements or the string has
|
|
5
|
-
* duplicate characters.
|
|
6
|
-
* @param {array|string} thing
|
|
7
|
-
* @return {bool}
|
|
8
|
-
*/
|
|
9
|
-
module.exports = function hasDuplicates (thing) {
|
|
10
|
-
return (new Set(thing)).size < thing.length
|
|
11
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright ©2017 John Lamansky
|
|
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.
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "has-duplicates",
|
|
3
|
-
"version": "1.0.0",
|
|
4
|
-
"description": "Returns true if an array has duplicate elements or a string has duplicate characters.",
|
|
5
|
-
"keywords": [
|
|
6
|
-
"array",
|
|
7
|
-
"duplicates",
|
|
8
|
-
"unique",
|
|
9
|
-
"check"
|
|
10
|
-
],
|
|
11
|
-
"author": "John Lamansky",
|
|
12
|
-
"license": "MIT",
|
|
13
|
-
"homepage": "https://github.com/lamansky/has-duplicates",
|
|
14
|
-
"repository": "lamansky/has-duplicates",
|
|
15
|
-
"main": "index.js",
|
|
16
|
-
"engines": {
|
|
17
|
-
"node": ">=0.12.0"
|
|
18
|
-
},
|
|
19
|
-
"devDependencies": {
|
|
20
|
-
"eslint-config-lamansky": "^1.0.0",
|
|
21
|
-
"mocha": "^3.2.0"
|
|
22
|
-
},
|
|
23
|
-
"scripts": {
|
|
24
|
-
"test": "mocha"
|
|
25
|
-
},
|
|
26
|
-
"eslintConfig": {
|
|
27
|
-
"extends": "lamansky",
|
|
28
|
-
"env": {
|
|
29
|
-
"mocha": true
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
# has-duplicates
|
|
2
|
-
|
|
3
|
-
A [Node.js](https://nodejs.org/) module that checks an array for duplicate elements or a string for duplicate characters.
|
|
4
|
-
|
|
5
|
-
## Installation
|
|
6
|
-
|
|
7
|
-
```bash
|
|
8
|
-
npm install has-duplicates --save
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
## Usage
|
|
12
|
-
|
|
13
|
-
```javascript
|
|
14
|
-
const hasDuplicates = require('has-duplicates')
|
|
15
|
-
|
|
16
|
-
// Arrays
|
|
17
|
-
hasDuplicates([1, 1]) // true
|
|
18
|
-
hasDuplicates([1, 2]) // false
|
|
19
|
-
|
|
20
|
-
// Strings
|
|
21
|
-
hasDuplicates('aa') // true
|
|
22
|
-
hasDuplicates('ab') // false
|
|
23
|
-
```
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
const assert = require('assert')
|
|
4
|
-
const hasDuplicates = require('.')
|
|
5
|
-
|
|
6
|
-
describe('hasDuplicates()', function () {
|
|
7
|
-
it('should return true if there are duplicates in an array', function () {
|
|
8
|
-
assert(hasDuplicates([1, 1]))
|
|
9
|
-
})
|
|
10
|
-
|
|
11
|
-
it('should return false if there are no duplicates in an array', function () {
|
|
12
|
-
assert(!hasDuplicates([1, 2]))
|
|
13
|
-
})
|
|
14
|
-
|
|
15
|
-
it('should return false if the array is empty', function () {
|
|
16
|
-
assert(!hasDuplicates([]))
|
|
17
|
-
})
|
|
18
|
-
|
|
19
|
-
it('should return true if there are duplicate characters in a string', function () {
|
|
20
|
-
assert(hasDuplicates('aa'))
|
|
21
|
-
})
|
|
22
|
-
|
|
23
|
-
it('should return false if there are no duplicate characters in a string', function () {
|
|
24
|
-
assert(!hasDuplicates('ab'))
|
|
25
|
-
})
|
|
26
|
-
|
|
27
|
-
it('should return false if the string is empty', function () {
|
|
28
|
-
assert(!hasDuplicates(''))
|
|
29
|
-
})
|
|
30
|
-
})
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright ©2017 John Lamansky
|
|
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.
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "if-else-throw",
|
|
3
|
-
"version": "1.0.0",
|
|
4
|
-
"description": "If X, return Y, else throw Z.",
|
|
5
|
-
"keywords": [
|
|
6
|
-
"error",
|
|
7
|
-
"throw",
|
|
8
|
-
"test",
|
|
9
|
-
"check",
|
|
10
|
-
"passthrough"
|
|
11
|
-
],
|
|
12
|
-
"author": "John Lamansky",
|
|
13
|
-
"license": "MIT",
|
|
14
|
-
"homepage": "https://github.com/lamansky/if-else-throw",
|
|
15
|
-
"repository": "lamansky/if-else-throw",
|
|
16
|
-
"main": "index.js",
|
|
17
|
-
"files": [],
|
|
18
|
-
"engines": {
|
|
19
|
-
"node": ">=5.0.0"
|
|
20
|
-
},
|
|
21
|
-
"dependencies": {
|
|
22
|
-
"possible-function": "^1.0.1"
|
|
23
|
-
},
|
|
24
|
-
"devDependencies": {
|
|
25
|
-
"eslint-config-lamansky": "^1.0.0",
|
|
26
|
-
"mocha": "^3.2.0"
|
|
27
|
-
},
|
|
28
|
-
"scripts": {
|
|
29
|
-
"test": "mocha"
|
|
30
|
-
},
|
|
31
|
-
"eslintConfig": {
|
|
32
|
-
"extends": "lamansky",
|
|
33
|
-
"env": {
|
|
34
|
-
"mocha": true
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
# if-else-throw
|
|
2
|
-
|
|
3
|
-
If X, return Y, else throw Z.
|
|
4
|
-
|
|
5
|
-
X can be a boolean or a function.
|
|
6
|
-
|
|
7
|
-
## Installation
|
|
8
|
-
|
|
9
|
-
```bash
|
|
10
|
-
npm install if-else-throw --save
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
## Usage
|
|
14
|
-
|
|
15
|
-
```javascript
|
|
16
|
-
const ifElseThrow = require('if-else-throw')
|
|
17
|
-
let value
|
|
18
|
-
|
|
19
|
-
value = []
|
|
20
|
-
value = ifElseThrow(
|
|
21
|
-
Array.isArray(value), // The boolean condition (in this case, true)
|
|
22
|
-
value, // The value returned if true
|
|
23
|
-
new TypeError('Not an array') // The error thrown if false
|
|
24
|
-
) // []
|
|
25
|
-
|
|
26
|
-
let value = 'totally not an array'
|
|
27
|
-
value = ifElseThrow(
|
|
28
|
-
val => Array.isArray(val), // Instead of a boolean, can use a function
|
|
29
|
-
value,
|
|
30
|
-
new TypeError('Not an array')
|
|
31
|
-
) // Uncaught TypeError
|
|
32
|
-
```
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright ©2018–2019 Fr. John Lamansky
|
|
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.
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "is-array-of-length",
|
|
3
|
-
"version": "1.1.0",
|
|
4
|
-
"description": "Returns true if a value is an array containing the specified number of elements.",
|
|
5
|
-
"keywords": [
|
|
6
|
-
"test",
|
|
7
|
-
"array",
|
|
8
|
-
"elements",
|
|
9
|
-
"length",
|
|
10
|
-
"bind operator"
|
|
11
|
-
],
|
|
12
|
-
"author": {
|
|
13
|
-
"name": "Fr. John Lamansky",
|
|
14
|
-
"url": "lamansky.com"
|
|
15
|
-
},
|
|
16
|
-
"license": "MIT",
|
|
17
|
-
"homepage": "https://github.com/lamansky/is-array-of-length",
|
|
18
|
-
"repository": "lamansky/is-array-of-length",
|
|
19
|
-
"main": "index.js",
|
|
20
|
-
"files": [],
|
|
21
|
-
"engines": {
|
|
22
|
-
"node": ">=6"
|
|
23
|
-
},
|
|
24
|
-
"dependencies": {
|
|
25
|
-
"arrify": "^1.0.1",
|
|
26
|
-
"is-instance-of": "^1.0.2",
|
|
27
|
-
"sbo": "^1.1.0"
|
|
28
|
-
},
|
|
29
|
-
"devDependencies": {
|
|
30
|
-
"eslint-config-lamansky": "^2.0.0",
|
|
31
|
-
"mocha": "^6.2.0"
|
|
32
|
-
},
|
|
33
|
-
"scripts": {
|
|
34
|
-
"test": "mocha"
|
|
35
|
-
},
|
|
36
|
-
"eslintConfig": {
|
|
37
|
-
"extends": "lamansky",
|
|
38
|
-
"env": {
|
|
39
|
-
"mocha": true
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
}
|