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 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": "add-counter",
|
|
3
|
-
"version": "1.0.0",
|
|
4
|
-
"description": "Adds a counter integer to iterated values.",
|
|
5
|
-
"keywords": [
|
|
6
|
-
"add",
|
|
7
|
-
"iterator",
|
|
8
|
-
"iteration",
|
|
9
|
-
"counter"
|
|
10
|
-
],
|
|
11
|
-
"author": "John Lamansky",
|
|
12
|
-
"license": "MIT",
|
|
13
|
-
"homepage": "https://github.com/lamansky/add-counter",
|
|
14
|
-
"repository": "lamansky/add-counter",
|
|
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.0.0"
|
|
24
|
-
},
|
|
25
|
-
"scripts": {
|
|
26
|
-
"test": "mocha"
|
|
27
|
-
},
|
|
28
|
-
"eslintConfig": {
|
|
29
|
-
"extends": "lamansky",
|
|
30
|
-
"env": {
|
|
31
|
-
"mocha": true
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
# add-counter
|
|
2
|
-
|
|
3
|
-
Adds a counter integer to iterated values.
|
|
4
|
-
|
|
5
|
-
## Installation
|
|
6
|
-
|
|
7
|
-
Requires [Node.js](https://nodejs.org/) 6.0.0 or above.
|
|
8
|
-
|
|
9
|
-
```bash
|
|
10
|
-
npm i add-counter
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
## API
|
|
14
|
-
|
|
15
|
-
The module exports a single function.
|
|
16
|
-
|
|
17
|
-
### Parameters
|
|
18
|
-
|
|
19
|
-
1. `iter` (iterable): The underlying iterable.
|
|
20
|
-
2. Optional: `i` (integer): The starting value of the counter. Normally this would be either `0` or `1`. Defaults to `0`.
|
|
21
|
-
|
|
22
|
-
### Return Value
|
|
23
|
-
|
|
24
|
-
A generator that, for each iterated value `x`, yields `[i++, x]`
|
|
25
|
-
|
|
26
|
-
## Example
|
|
27
|
-
|
|
28
|
-
```javascript
|
|
29
|
-
const addCounter = require('add-counter')
|
|
30
|
-
|
|
31
|
-
for (const [i, x] of addCounter(['a', 'b', 'c'])) {
|
|
32
|
-
// [0, 'a']
|
|
33
|
-
// [1, 'b']
|
|
34
|
-
// [2, 'c']
|
|
35
|
-
}
|
|
36
|
-
```
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
The MIT License (MIT)
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2015 Christopher Turner
|
|
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.
|
|
22
|
-
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
# array-pad
|
|
2
|
-
|
|
3
|
-
Module for returning arrays with a specific length by padding values.
|
|
4
|
-
|
|
5
|
-
[](https://travis-ci.org/tur-nr/node-array-pad)
|
|
6
|
-
|
|
7
|
-
### Example
|
|
8
|
-
|
|
9
|
-
```js
|
|
10
|
-
var pad = require('array-pad');
|
|
11
|
-
var arr = pad([], 3, null); // => [null, null, null]
|
|
12
|
-
arr = pad(arr, 5, 0); // => [null, null, null, 0, 0];
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
## Installation
|
|
16
|
-
|
|
17
|
-
### Node
|
|
18
|
-
|
|
19
|
-
To install `array-pad` in a Node application use npm.
|
|
20
|
-
|
|
21
|
-
```
|
|
22
|
-
$ npm install array-pad
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
### Browser
|
|
26
|
-
|
|
27
|
-
No tests available for the browser but you may try using it via [webpack](https://github.com/webpack/webpack).
|
|
28
|
-
|
|
29
|
-
```
|
|
30
|
-
$ webpack index.js array-pad.js
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
## Test
|
|
34
|
-
|
|
35
|
-
To run tests use npm.
|
|
36
|
-
|
|
37
|
-
```
|
|
38
|
-
$ npm install
|
|
39
|
-
$ npm test
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
## Documentation
|
|
43
|
-
|
|
44
|
-
### Basic Usage
|
|
45
|
-
|
|
46
|
-
Padding an `array` is simple as passing the desired `length` and an optional `value` to pad with. If no `value` is given, padded items will be set to `undefined` by default.
|
|
47
|
-
|
|
48
|
-
```js
|
|
49
|
-
var array = pad([], 2); // => [undefined, undefined]
|
|
50
|
-
pad(array, 4, null); // => [undefined, undefined, null, null]
|
|
51
|
-
pad(array, 1, false); // => [undefined, undefined, null, null]
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
### Pad Left
|
|
55
|
-
|
|
56
|
-
Pad, by default, pads `value`s to the right side of the `array` via the `.push()` method. To pad left, perform `.unshift()`, pass then `length` as a negative integer.
|
|
57
|
-
|
|
58
|
-
```js
|
|
59
|
-
pad([1,2,3], -5, 0); // => [0, 0, 1, 2, 3]
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
### Augmenting Array
|
|
63
|
-
|
|
64
|
-
Pad will always create a new instance of the `array` passed in. If augmentation to the original instance is required, pass the first parameter as `true`.
|
|
65
|
-
|
|
66
|
-
```js
|
|
67
|
-
var arr = [];
|
|
68
|
-
var res = pad(true, arr, 3);
|
|
69
|
-
res === arr; // => true
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
## API
|
|
73
|
-
|
|
74
|
-
#### pad(*[augment]*, *<array>*, *<length>*, *[value]*);
|
|
75
|
-
|
|
76
|
-
## License
|
|
77
|
-
|
|
78
|
-
[MIT](LICENSE)
|
|
79
|
-
|
|
80
|
-
Copyright (c) 2015 [Christopher Turner](https://github.com/tur-nr)
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
module.exports = function arrayPad(augment, array, length, value) {
|
|
2
|
-
var total
|
|
3
|
-
, method;
|
|
4
|
-
|
|
5
|
-
// augment is optional
|
|
6
|
-
if (typeof arguments[0] !== 'boolean') {
|
|
7
|
-
value = length;
|
|
8
|
-
length = array;
|
|
9
|
-
array = augment;
|
|
10
|
-
augment = false;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
if (!Array.isArray(array)) {
|
|
14
|
-
throw new TypeError('must be an array');
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
array = (augment) ? array : array.slice(0);
|
|
18
|
-
method = (length < 0) ? 'unshift' : 'push';
|
|
19
|
-
total = Math.abs(length);
|
|
20
|
-
|
|
21
|
-
if (typeof length !== 'number' || (total % 1) !== 0) {
|
|
22
|
-
throw new TypeError('length must be an integer');
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
while (array.length < total) {
|
|
26
|
-
array[method](value);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
return array;
|
|
30
|
-
};
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "array-pad",
|
|
3
|
-
"version": "0.0.1",
|
|
4
|
-
"description": "Module for returning arrays with a specific length by padding values.",
|
|
5
|
-
"main": "index.js",
|
|
6
|
-
"scripts": {
|
|
7
|
-
"test": "./node_modules/.bin/mocha"
|
|
8
|
-
},
|
|
9
|
-
"repository": {
|
|
10
|
-
"type": "git",
|
|
11
|
-
"url": "https://github.com/tur-nr/node-array-pad"
|
|
12
|
-
},
|
|
13
|
-
"keywords": [
|
|
14
|
-
"array",
|
|
15
|
-
"pad",
|
|
16
|
-
"utility",
|
|
17
|
-
"length"
|
|
18
|
-
],
|
|
19
|
-
"author": "Christopher Turner <turner296@gmail.com>",
|
|
20
|
-
"license": "MIT",
|
|
21
|
-
"bugs": {
|
|
22
|
-
"url": "https://github.com/tur-nr/node-array-pad/issues"
|
|
23
|
-
},
|
|
24
|
-
"homepage": "https://github.com/tur-nr/node-array-pad",
|
|
25
|
-
"devDependencies": {
|
|
26
|
-
"mocha": "^2.1.0"
|
|
27
|
-
}
|
|
28
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
The MIT License (MIT)
|
|
2
|
-
|
|
3
|
-
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
|
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,33 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "arrify",
|
|
3
|
-
"version": "1.0.1",
|
|
4
|
-
"description": "Convert a value to an array",
|
|
5
|
-
"license": "MIT",
|
|
6
|
-
"repository": "sindresorhus/arrify",
|
|
7
|
-
"author": {
|
|
8
|
-
"name": "Sindre Sorhus",
|
|
9
|
-
"email": "sindresorhus@gmail.com",
|
|
10
|
-
"url": "sindresorhus.com"
|
|
11
|
-
},
|
|
12
|
-
"engines": {
|
|
13
|
-
"node": ">=0.10.0"
|
|
14
|
-
},
|
|
15
|
-
"scripts": {
|
|
16
|
-
"test": "xo && ava"
|
|
17
|
-
},
|
|
18
|
-
"files": [
|
|
19
|
-
"index.js"
|
|
20
|
-
],
|
|
21
|
-
"keywords": [
|
|
22
|
-
"array",
|
|
23
|
-
"arr",
|
|
24
|
-
"arrify",
|
|
25
|
-
"arrayify",
|
|
26
|
-
"convert",
|
|
27
|
-
"value"
|
|
28
|
-
],
|
|
29
|
-
"devDependencies": {
|
|
30
|
-
"ava": "*",
|
|
31
|
-
"xo": "*"
|
|
32
|
-
}
|
|
33
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
# arrify [](https://travis-ci.org/sindresorhus/arrify)
|
|
2
|
-
|
|
3
|
-
> Convert a value to an array
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
## Install
|
|
7
|
-
|
|
8
|
-
```
|
|
9
|
-
$ npm install --save arrify
|
|
10
|
-
```
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
## Usage
|
|
14
|
-
|
|
15
|
-
```js
|
|
16
|
-
const arrify = require('arrify');
|
|
17
|
-
|
|
18
|
-
arrify('unicorn');
|
|
19
|
-
//=> ['unicorn']
|
|
20
|
-
|
|
21
|
-
arrify(['unicorn']);
|
|
22
|
-
//=> ['unicorn']
|
|
23
|
-
|
|
24
|
-
arrify(null);
|
|
25
|
-
//=> []
|
|
26
|
-
|
|
27
|
-
arrify(undefined);
|
|
28
|
-
//=> []
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
*Supplying `null` or `undefined` results in an empty array.*
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
## License
|
|
35
|
-
|
|
36
|
-
MIT © [Sindre Sorhus](http://sindresorhus.com)
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
const lowercaseValue = new WeakMap()
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Wraps around an array or string and transforms certain methods into case-insensitive versions.
|
|
7
|
-
* @param {array|string} thing
|
|
8
|
-
* @return {object} A set of methods that all operate case-insensitively.
|
|
9
|
-
*/
|
|
10
|
-
module.exports = function ci (thing) {
|
|
11
|
-
if (Array.isArray(thing)) {
|
|
12
|
-
return new CaseInsensitiveArray(thing)
|
|
13
|
-
} else if (typeof thing === 'string') {
|
|
14
|
-
return new CaseInsensitiveString(thing)
|
|
15
|
-
} else {
|
|
16
|
-
throw new TypeError('`ci()` expects its argument to be an array or string.')
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
function CaseInsensitiveArray (array) {
|
|
21
|
-
if (!Array.isArray(array)) return
|
|
22
|
-
this.original = array
|
|
23
|
-
lowercaseValue.set(this, lowercaseArray(array))
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
CaseInsensitiveArray.prototype = {
|
|
27
|
-
equals (needle) {
|
|
28
|
-
return JSON.stringify(lowercaseValue.get(this)) === JSON.stringify(lowercaseArray(needle))
|
|
29
|
-
},
|
|
30
|
-
includes (needle) {
|
|
31
|
-
return lowercaseValue.get(this).includes(lowercase(needle))
|
|
32
|
-
},
|
|
33
|
-
indexOf (needle) {
|
|
34
|
-
return lowercaseValue.get(this).indexOf(lowercase(needle))
|
|
35
|
-
},
|
|
36
|
-
lastIndexOf (needle) {
|
|
37
|
-
return lowercaseValue.get(this).lastIndexOf(lowercase(needle))
|
|
38
|
-
},
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
function CaseInsensitiveString (string) {
|
|
42
|
-
this.original = string
|
|
43
|
-
lowercaseValue.set(this, lowercase(string))
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
CaseInsensitiveString.prototype = Object.create(CaseInsensitiveArray.prototype)
|
|
47
|
-
|
|
48
|
-
CaseInsensitiveString.prototype.toString = function () {
|
|
49
|
-
return lowercaseValue.get(this)
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
CaseInsensitiveString.prototype.equals = function (needle) {
|
|
53
|
-
return lowercaseValue.get(this) === lowercase(needle)
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
CaseInsensitiveString.prototype.endsWith = function (needle) {
|
|
57
|
-
return lowercaseValue.get(this).endsWith(lowercase(needle))
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
CaseInsensitiveString.prototype.startsWith = function (needle) {
|
|
61
|
-
return lowercaseValue.get(this).startsWith(lowercase(needle))
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
function lowercase (str) {
|
|
65
|
-
return (str + '').toLowerCase()
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
function lowercaseArray (array) {
|
|
69
|
-
return array.map(
|
|
70
|
-
elem => typeof elem === 'string' ? lowercase(elem) : elem
|
|
71
|
-
)
|
|
72
|
-
}
|
|
@@ -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,39 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "case-insensitive",
|
|
3
|
-
"version": "1.0.0",
|
|
4
|
-
"description": "Wraps around an array or string and transforms certain methods into case-insensitive versions.",
|
|
5
|
-
"keywords": [
|
|
6
|
-
"case",
|
|
7
|
-
"case insensitive",
|
|
8
|
-
"lowercase",
|
|
9
|
-
"string",
|
|
10
|
-
"array",
|
|
11
|
-
"endsWith",
|
|
12
|
-
"includes",
|
|
13
|
-
"indexOf",
|
|
14
|
-
"lastIndexOf",
|
|
15
|
-
"startsWith",
|
|
16
|
-
"wrapper"
|
|
17
|
-
],
|
|
18
|
-
"author": "John Lamansky",
|
|
19
|
-
"license": "MIT",
|
|
20
|
-
"homepage": "https://github.com/lamansky/case-insensitive",
|
|
21
|
-
"repository": "lamansky/case-insensitive",
|
|
22
|
-
"main": "index.js",
|
|
23
|
-
"engines": {
|
|
24
|
-
"node": ">=6.0.0"
|
|
25
|
-
},
|
|
26
|
-
"devDependencies": {
|
|
27
|
-
"eslint-config-lamansky": "^1.0.0",
|
|
28
|
-
"mocha": "^3.2.0"
|
|
29
|
-
},
|
|
30
|
-
"scripts": {
|
|
31
|
-
"test": "mocha"
|
|
32
|
-
},
|
|
33
|
-
"eslintConfig": {
|
|
34
|
-
"extends": "lamansky",
|
|
35
|
-
"env": {
|
|
36
|
-
"mocha": true
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
# case-insensitive
|
|
2
|
-
|
|
3
|
-
A [Node.js](https://nodejs.org/) module that wraps around an array or string and transforms certain methods into case-insensitive versions.
|
|
4
|
-
|
|
5
|
-
## Installation
|
|
6
|
-
|
|
7
|
-
```bash
|
|
8
|
-
npm install case-insensitive --save
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
The module exposes a single function.
|
|
12
|
-
|
|
13
|
-
## Usage
|
|
14
|
-
|
|
15
|
-
```javascript
|
|
16
|
-
const ci = require('case-insensitive')
|
|
17
|
-
|
|
18
|
-
ci('String').equals('STRING') // true
|
|
19
|
-
ci('String').startsWith('s') // true
|
|
20
|
-
ci('String').endsWith('nG') // true
|
|
21
|
-
ci('STRING').indexOf('t') // 1
|
|
22
|
-
|
|
23
|
-
ci(['Test']).equals(['test']) // true
|
|
24
|
-
ci(['A', 'B']).includes('A') // true
|
|
25
|
-
ci(['A', 'B']).indexOf('B') // 1
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
## Methods
|
|
29
|
-
|
|
30
|
-
The `ci()` function returns an object, with methods depending on the type of input:
|
|
31
|
-
|
|
32
|
-
| Method | Arrays | Strings |
|
|
33
|
-
| ----------: | :----: | :-----: |
|
|
34
|
-
| endsWith | | ✔ |
|
|
35
|
-
| equals | ✔ | ✔ |
|
|
36
|
-
| includes | ✔ | ✔ |
|
|
37
|
-
| indexOf | ✔ | ✔ |
|
|
38
|
-
| lastIndexOf | ✔ | ✔ |
|
|
39
|
-
| startsWith | | ✔ |
|
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
const assert = require('assert')
|
|
4
|
-
const ci = require('.')
|
|
5
|
-
|
|
6
|
-
describe('ci()', function () {
|
|
7
|
-
it('should throw an error if input is not array or string', function () {
|
|
8
|
-
assert.throws(() => { ci(new Map()) })
|
|
9
|
-
})
|
|
10
|
-
})
|
|
11
|
-
|
|
12
|
-
describe('CaseInsensitiveArray', function () {
|
|
13
|
-
describe('#equals()', function () {
|
|
14
|
-
it('should return true if equal', function () {
|
|
15
|
-
assert(ci(['Test']).equals(['test']))
|
|
16
|
-
})
|
|
17
|
-
|
|
18
|
-
it('should return false if unequal', function () {
|
|
19
|
-
assert(!ci(['Test']).equals(['something else']))
|
|
20
|
-
})
|
|
21
|
-
})
|
|
22
|
-
|
|
23
|
-
describe('#includes()', function () {
|
|
24
|
-
it('should return true if element included', function () {
|
|
25
|
-
assert(ci(['Test']).includes('TEST'))
|
|
26
|
-
})
|
|
27
|
-
|
|
28
|
-
it('should return false if element not included', function () {
|
|
29
|
-
assert(!ci(['Test']).includes('testing'))
|
|
30
|
-
})
|
|
31
|
-
})
|
|
32
|
-
|
|
33
|
-
describe('#indexOf()', function () {
|
|
34
|
-
it('should return index of included element', function () {
|
|
35
|
-
assert.strictEqual(ci(['Test']).indexOf('TEST'), 0)
|
|
36
|
-
})
|
|
37
|
-
|
|
38
|
-
it('should return -1 if element not included', function () {
|
|
39
|
-
assert.strictEqual(ci(['Test']).indexOf('testing'), -1)
|
|
40
|
-
})
|
|
41
|
-
})
|
|
42
|
-
|
|
43
|
-
describe('#lastIndexOf()', function () {
|
|
44
|
-
it('should return last index of included element', function () {
|
|
45
|
-
assert.strictEqual(ci(['A', 'A']).lastIndexOf('a'), 1)
|
|
46
|
-
})
|
|
47
|
-
|
|
48
|
-
it('should return -1 if element not included', function () {
|
|
49
|
-
assert.strictEqual(ci(['A', 'A']).lastIndexOf('b'), -1)
|
|
50
|
-
})
|
|
51
|
-
})
|
|
52
|
-
})
|
|
53
|
-
|
|
54
|
-
describe('CaseInsensitiveString', function () {
|
|
55
|
-
describe('#endsWith()', function () {
|
|
56
|
-
it('should return true if ends with substring', function () {
|
|
57
|
-
assert(ci('test').endsWith('sT'))
|
|
58
|
-
})
|
|
59
|
-
|
|
60
|
-
it('should return false if does not end with substring', function () {
|
|
61
|
-
assert(!ci('test').endsWith('es'))
|
|
62
|
-
})
|
|
63
|
-
})
|
|
64
|
-
|
|
65
|
-
describe('#equals()', function () {
|
|
66
|
-
it('should return true if equal', function () {
|
|
67
|
-
assert(ci('test').equals('Test'))
|
|
68
|
-
})
|
|
69
|
-
|
|
70
|
-
it('should return false if unequal', function () {
|
|
71
|
-
assert(!ci('test').equals('something else'))
|
|
72
|
-
})
|
|
73
|
-
})
|
|
74
|
-
|
|
75
|
-
describe('#includes()', function () {
|
|
76
|
-
it('should return true if substring included', function () {
|
|
77
|
-
assert(ci('Test').includes('ES'))
|
|
78
|
-
})
|
|
79
|
-
|
|
80
|
-
it('should return false if substring not included', function () {
|
|
81
|
-
assert(!ci('Test').includes('ing'))
|
|
82
|
-
})
|
|
83
|
-
})
|
|
84
|
-
|
|
85
|
-
describe('#indexOf()', function () {
|
|
86
|
-
it('should return index of included substring', function () {
|
|
87
|
-
assert.strictEqual(ci('Test').indexOf('t'), 0)
|
|
88
|
-
})
|
|
89
|
-
|
|
90
|
-
it('should return -1 if substring not included', function () {
|
|
91
|
-
assert.strictEqual(ci('Test').indexOf('x'), -1)
|
|
92
|
-
})
|
|
93
|
-
})
|
|
94
|
-
|
|
95
|
-
describe('#lastIndexOf()', function () {
|
|
96
|
-
it('should return last index of included substring', function () {
|
|
97
|
-
assert.strictEqual(ci('Test').lastIndexOf('T'), 3)
|
|
98
|
-
})
|
|
99
|
-
|
|
100
|
-
it('should return -1 if substring not included', function () {
|
|
101
|
-
assert.strictEqual(ci('Test').lastIndexOf('x'), -1)
|
|
102
|
-
})
|
|
103
|
-
})
|
|
104
|
-
|
|
105
|
-
describe('#startsWith()', function () {
|
|
106
|
-
it('should return true if starts with substring', function () {
|
|
107
|
-
assert(ci('test').startsWith('T'))
|
|
108
|
-
})
|
|
109
|
-
|
|
110
|
-
it('should return false if does not start with substring', function () {
|
|
111
|
-
assert(!ci('test').startsWith('es'))
|
|
112
|
-
})
|
|
113
|
-
})
|
|
114
|
-
})
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
const isObject = require('is-object')
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Returns an object’s class and its ancestors.
|
|
7
|
-
* @param {object|function} obj The object or the first class in the chain.
|
|
8
|
-
* @return {array.<function>} The class and the chain of classes it extends.
|
|
9
|
-
*/
|
|
10
|
-
function getClassChain (obj) {
|
|
11
|
-
if (typeof obj === 'function') {
|
|
12
|
-
if (!obj.name || obj === Object) return []
|
|
13
|
-
return [obj].concat(getClassChain(Object.getPrototypeOf(obj)))
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
if (isObject(obj)) {
|
|
17
|
-
return getClassChain(obj.constructor)
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
return []
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* Returns the names of an object’s class and its ancestors.
|
|
25
|
-
* @param {object|function} obj The object or the first class in the chain.
|
|
26
|
-
* @return {array.<string>} The names of the classes in the chain.
|
|
27
|
-
*/
|
|
28
|
-
getClassChain.names = function (obj) {
|
|
29
|
-
return getClassChain(obj).map(cls => cls.name)
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
module.exports = getClassChain
|