@prismer/sdk 2.0.8 → 2.2.55
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 +13 -7
- package/dist/chunk-R7POPVJR.mjs +35 -0
- package/dist/cli.js +59653 -8452
- package/dist/index.d.mts +716 -229
- package/dist/index.d.ts +716 -229
- package/dist/index.js +307 -23
- package/dist/index.mjs +306 -23
- package/dist/katex-OIP2Q473.mjs +14515 -0
- package/dist/pkf-schema.json +35 -0
- package/dist/pkf.d.mts +1 -0
- package/dist/pkf.d.ts +1 -0
- package/dist/pkf.js +48370 -0
- package/dist/pkf.mjs +33683 -0
- package/node_modules/@clack/core/CHANGELOG.md +249 -0
- package/node_modules/@clack/core/LICENSE +9 -0
- package/node_modules/@clack/core/README.md +22 -0
- package/node_modules/@clack/core/dist/index.cjs +15 -0
- package/node_modules/@clack/core/dist/index.cjs.map +1 -0
- package/node_modules/@clack/core/dist/index.d.cts +209 -0
- package/node_modules/@clack/core/dist/index.d.mts +209 -0
- package/node_modules/@clack/core/dist/index.d.ts +209 -0
- package/node_modules/@clack/core/dist/index.mjs +15 -0
- package/node_modules/@clack/core/dist/index.mjs.map +1 -0
- package/node_modules/@clack/core/package.json +62 -0
- package/node_modules/@clack/prompts/CHANGELOG.md +374 -0
- package/node_modules/@clack/prompts/LICENSE +9 -0
- package/node_modules/@clack/prompts/README.md +191 -0
- package/node_modules/@clack/prompts/dist/index.cjs +80 -0
- package/node_modules/@clack/prompts/dist/index.cjs.map +1 -0
- package/node_modules/@clack/prompts/dist/index.d.cts +151 -0
- package/node_modules/@clack/prompts/dist/index.d.mts +151 -0
- package/node_modules/@clack/prompts/dist/index.d.ts +151 -0
- package/node_modules/@clack/prompts/dist/index.mjs +80 -0
- package/node_modules/@clack/prompts/dist/index.mjs.map +1 -0
- package/node_modules/@clack/prompts/package.json +61 -0
- package/node_modules/@iarna/toml/LICENSE +14 -0
- package/node_modules/@iarna/toml/README.md +301 -0
- package/node_modules/@iarna/toml/index.d.ts +57 -0
- package/node_modules/@iarna/toml/lib/create-date.js +23 -0
- package/node_modules/@iarna/toml/lib/create-datetime-float.js +24 -0
- package/node_modules/@iarna/toml/lib/create-datetime.js +10 -0
- package/node_modules/@iarna/toml/lib/create-time.js +22 -0
- package/node_modules/@iarna/toml/lib/format-num.js +6 -0
- package/node_modules/@iarna/toml/lib/parser-debug.js +60 -0
- package/node_modules/@iarna/toml/lib/parser.js +127 -0
- package/node_modules/@iarna/toml/lib/toml-parser.js +1379 -0
- package/node_modules/@iarna/toml/package.json +82 -0
- package/node_modules/@iarna/toml/parse-async.js +30 -0
- package/node_modules/@iarna/toml/parse-pretty-error.js +33 -0
- package/node_modules/@iarna/toml/parse-stream.js +80 -0
- package/node_modules/@iarna/toml/parse-string.js +18 -0
- package/node_modules/@iarna/toml/parse.js +5 -0
- package/node_modules/@iarna/toml/stringify.js +296 -0
- package/node_modules/@iarna/toml/toml.js +3 -0
- package/node_modules/@prismer/aip-sdk/README.md +36 -0
- package/node_modules/@prismer/aip-sdk/dist/cli/chunk-LIJDUCHB.js +104 -0
- package/node_modules/@prismer/aip-sdk/dist/cli/chunk-QUQXZ2LD.js +99 -0
- package/node_modules/@prismer/aip-sdk/dist/cli/credentials-5GGZEJFG.js +56 -0
- package/node_modules/@prismer/aip-sdk/dist/cli/delegation-3J35VGBZ.js +64 -0
- package/node_modules/@prismer/aip-sdk/dist/cli/identity-LXVWKSVB.js +7 -0
- package/node_modules/@prismer/aip-sdk/dist/cli/index.js +259 -0
- package/node_modules/@prismer/aip-sdk/dist/cli/resolver-TGOPKW52.js +26 -0
- package/node_modules/@prismer/aip-sdk/dist/index.cjs +368 -0
- package/node_modules/@prismer/aip-sdk/dist/index.d.cts +174 -0
- package/node_modules/@prismer/aip-sdk/dist/index.d.ts +174 -0
- package/node_modules/@prismer/aip-sdk/dist/index.js +322 -0
- package/node_modules/@prismer/aip-sdk/package.json +53 -0
- package/node_modules/ansi-regex/index.d.ts +37 -0
- package/node_modules/ansi-regex/index.js +10 -0
- package/node_modules/ansi-regex/license +9 -0
- package/node_modules/ansi-regex/package.json +55 -0
- package/node_modules/ansi-regex/readme.md +78 -0
- package/node_modules/camelcase/index.d.ts +63 -0
- package/node_modules/camelcase/index.js +76 -0
- package/node_modules/camelcase/license +9 -0
- package/node_modules/camelcase/package.json +43 -0
- package/node_modules/camelcase/readme.md +99 -0
- package/node_modules/cliui/LICENSE.txt +14 -0
- package/node_modules/cliui/README.md +115 -0
- package/node_modules/cliui/index.js +354 -0
- package/node_modules/cliui/package.json +65 -0
- package/node_modules/color-convert/LICENSE +21 -0
- package/node_modules/color-convert/README.md +68 -0
- package/node_modules/color-convert/conversions.js +839 -0
- package/node_modules/color-convert/index.js +81 -0
- package/node_modules/color-convert/package.json +48 -0
- package/node_modules/color-convert/route.js +97 -0
- package/node_modules/color-name/LICENSE +8 -0
- package/node_modules/color-name/README.md +11 -0
- package/node_modules/color-name/index.js +152 -0
- package/node_modules/color-name/package.json +28 -0
- package/node_modules/commander/LICENSE +22 -0
- package/node_modules/commander/Readme.md +1157 -0
- package/node_modules/commander/esm.mjs +16 -0
- package/node_modules/commander/index.js +24 -0
- package/node_modules/commander/lib/argument.js +149 -0
- package/node_modules/commander/lib/command.js +2509 -0
- package/node_modules/commander/lib/error.js +39 -0
- package/node_modules/commander/lib/help.js +520 -0
- package/node_modules/commander/lib/option.js +330 -0
- package/node_modules/commander/lib/suggestSimilar.js +101 -0
- package/node_modules/commander/package-support.json +16 -0
- package/node_modules/commander/package.json +84 -0
- package/node_modules/commander/typings/esm.d.mts +3 -0
- package/node_modules/commander/typings/index.d.ts +969 -0
- package/node_modules/decamelize/index.js +13 -0
- package/node_modules/decamelize/license +21 -0
- package/node_modules/decamelize/package.json +38 -0
- package/node_modules/decamelize/readme.md +48 -0
- package/node_modules/dijkstrajs/.travis.yml +4 -0
- package/node_modules/dijkstrajs/CONTRIBUTING.md +8 -0
- package/node_modules/dijkstrajs/LICENSE.md +19 -0
- package/node_modules/dijkstrajs/README.md +18 -0
- package/node_modules/dijkstrajs/dijkstra.js +165 -0
- package/node_modules/dijkstrajs/package.json +60 -0
- package/node_modules/dijkstrajs/test/dijkstra.test.js +96 -0
- package/node_modules/emoji-regex/LICENSE-MIT.txt +20 -0
- package/node_modules/emoji-regex/README.md +73 -0
- package/node_modules/emoji-regex/es2015/index.js +6 -0
- package/node_modules/emoji-regex/es2015/text.js +6 -0
- package/node_modules/emoji-regex/index.d.ts +23 -0
- package/node_modules/emoji-regex/index.js +6 -0
- package/node_modules/emoji-regex/package.json +50 -0
- package/node_modules/emoji-regex/text.js +6 -0
- package/node_modules/find-up/index.d.ts +137 -0
- package/node_modules/find-up/index.js +89 -0
- package/node_modules/find-up/license +9 -0
- package/node_modules/find-up/package.json +53 -0
- package/node_modules/find-up/readme.md +156 -0
- package/node_modules/get-caller-file/LICENSE.md +6 -0
- package/node_modules/get-caller-file/README.md +41 -0
- package/node_modules/get-caller-file/index.d.ts +2 -0
- package/node_modules/get-caller-file/index.js +22 -0
- package/node_modules/get-caller-file/index.js.map +1 -0
- package/node_modules/get-caller-file/package.json +42 -0
- package/node_modules/is-fullwidth-code-point/index.d.ts +17 -0
- package/node_modules/is-fullwidth-code-point/index.js +50 -0
- package/node_modules/is-fullwidth-code-point/license +9 -0
- package/node_modules/is-fullwidth-code-point/package.json +42 -0
- package/node_modules/is-fullwidth-code-point/readme.md +39 -0
- package/node_modules/locate-path/index.d.ts +83 -0
- package/node_modules/locate-path/index.js +65 -0
- package/node_modules/locate-path/license +9 -0
- package/node_modules/locate-path/package.json +45 -0
- package/node_modules/locate-path/readme.md +122 -0
- package/node_modules/p-locate/index.d.ts +64 -0
- package/node_modules/p-locate/index.js +52 -0
- package/node_modules/p-locate/license +9 -0
- package/node_modules/p-locate/node_modules/p-limit/index.d.ts +38 -0
- package/node_modules/p-locate/node_modules/p-limit/index.js +57 -0
- package/node_modules/p-locate/node_modules/p-limit/license +9 -0
- package/node_modules/p-locate/node_modules/p-limit/package.json +52 -0
- package/node_modules/p-locate/node_modules/p-limit/readme.md +101 -0
- package/node_modules/p-locate/package.json +53 -0
- package/node_modules/p-locate/readme.md +90 -0
- package/node_modules/p-try/index.d.ts +39 -0
- package/node_modules/p-try/index.js +9 -0
- package/node_modules/p-try/license +9 -0
- package/node_modules/p-try/package.json +42 -0
- package/node_modules/p-try/readme.md +58 -0
- package/node_modules/path-exists/index.d.ts +28 -0
- package/node_modules/path-exists/index.js +23 -0
- package/node_modules/path-exists/license +9 -0
- package/node_modules/path-exists/package.json +39 -0
- package/node_modules/path-exists/readme.md +52 -0
- package/node_modules/picocolors/LICENSE +15 -0
- package/node_modules/picocolors/README.md +21 -0
- package/node_modules/picocolors/package.json +25 -0
- package/node_modules/picocolors/picocolors.browser.js +4 -0
- package/node_modules/picocolors/picocolors.d.ts +5 -0
- package/node_modules/picocolors/picocolors.js +75 -0
- package/node_modules/picocolors/types.d.ts +51 -0
- package/node_modules/pngjs/.eslintignore +2 -0
- package/node_modules/pngjs/.eslintrc.json +19 -0
- package/node_modules/pngjs/.prettierignore +3 -0
- package/node_modules/pngjs/LICENSE +20 -0
- package/node_modules/pngjs/README.md +429 -0
- package/node_modules/pngjs/browser.js +16096 -0
- package/node_modules/pngjs/coverage/lcov-report/base.css +354 -0
- package/node_modules/pngjs/coverage/lcov-report/bitmapper.js.html +881 -0
- package/node_modules/pngjs/coverage/lcov-report/bitpacker.js.html +554 -0
- package/node_modules/pngjs/coverage/lcov-report/block-navigation.js +77 -0
- package/node_modules/pngjs/coverage/lcov-report/chunkstream.js.html +647 -0
- package/node_modules/pngjs/coverage/lcov-report/constants.js.html +176 -0
- package/node_modules/pngjs/coverage/lcov-report/crc.js.html +200 -0
- package/node_modules/pngjs/coverage/lcov-report/favicon.png +0 -0
- package/node_modules/pngjs/coverage/lcov-report/filter-pack.js.html +593 -0
- package/node_modules/pngjs/coverage/lcov-report/filter-parse-async.js.html +152 -0
- package/node_modules/pngjs/coverage/lcov-report/filter-parse-sync.js.html +143 -0
- package/node_modules/pngjs/coverage/lcov-report/filter-parse.js.html +611 -0
- package/node_modules/pngjs/coverage/lcov-report/format-normaliser.js.html +359 -0
- package/node_modules/pngjs/coverage/lcov-report/index.html +426 -0
- package/node_modules/pngjs/coverage/lcov-report/interlace.js.html +365 -0
- package/node_modules/pngjs/coverage/lcov-report/packer-async.js.html +230 -0
- package/node_modules/pngjs/coverage/lcov-report/packer-sync.js.html +248 -0
- package/node_modules/pngjs/coverage/lcov-report/packer.js.html +467 -0
- package/node_modules/pngjs/coverage/lcov-report/paeth-predictor.js.html +128 -0
- package/node_modules/pngjs/coverage/lcov-report/parser-async.js.html +575 -0
- package/node_modules/pngjs/coverage/lcov-report/parser-sync.js.html +404 -0
- package/node_modules/pngjs/coverage/lcov-report/parser.js.html +950 -0
- package/node_modules/pngjs/coverage/lcov-report/png-sync.js.html +116 -0
- package/node_modules/pngjs/coverage/lcov-report/png.js.html +662 -0
- package/node_modules/pngjs/coverage/lcov-report/prettify.css +101 -0
- package/node_modules/pngjs/coverage/lcov-report/prettify.js +1007 -0
- package/node_modules/pngjs/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/node_modules/pngjs/coverage/lcov-report/sorter.js +169 -0
- package/node_modules/pngjs/coverage/lcov-report/sync-inflate.js.html +584 -0
- package/node_modules/pngjs/coverage/lcov-report/sync-reader.js.html +215 -0
- package/node_modules/pngjs/coverage/lcov.info +2177 -0
- package/node_modules/pngjs/lib/bitmapper.js +267 -0
- package/node_modules/pngjs/lib/bitpacker.js +158 -0
- package/node_modules/pngjs/lib/chunkstream.js +189 -0
- package/node_modules/pngjs/lib/constants.js +32 -0
- package/node_modules/pngjs/lib/crc.js +40 -0
- package/node_modules/pngjs/lib/filter-pack.js +171 -0
- package/node_modules/pngjs/lib/filter-parse-async.js +24 -0
- package/node_modules/pngjs/lib/filter-parse-sync.js +21 -0
- package/node_modules/pngjs/lib/filter-parse.js +177 -0
- package/node_modules/pngjs/lib/format-normaliser.js +93 -0
- package/node_modules/pngjs/lib/interlace.js +95 -0
- package/node_modules/pngjs/lib/packer-async.js +50 -0
- package/node_modules/pngjs/lib/packer-sync.js +56 -0
- package/node_modules/pngjs/lib/packer.js +129 -0
- package/node_modules/pngjs/lib/paeth-predictor.js +16 -0
- package/node_modules/pngjs/lib/parser-async.js +165 -0
- package/node_modules/pngjs/lib/parser-sync.js +108 -0
- package/node_modules/pngjs/lib/parser.js +290 -0
- package/node_modules/pngjs/lib/png-sync.js +12 -0
- package/node_modules/pngjs/lib/png.js +194 -0
- package/node_modules/pngjs/lib/sync-inflate.js +168 -0
- package/node_modules/pngjs/lib/sync-reader.js +45 -0
- package/node_modules/pngjs/package.json +73 -0
- package/node_modules/qrcode/README.md +770 -0
- package/node_modules/qrcode/bin/qrcode +159 -0
- package/node_modules/qrcode/helper/to-sjis-browser.js +2 -0
- package/node_modules/qrcode/helper/to-sjis.js +105 -0
- package/node_modules/qrcode/lib/browser.js +76 -0
- package/node_modules/qrcode/lib/can-promise.js +7 -0
- package/node_modules/qrcode/lib/core/alignment-pattern.js +83 -0
- package/node_modules/qrcode/lib/core/alphanumeric-data.js +59 -0
- package/node_modules/qrcode/lib/core/bit-buffer.js +37 -0
- package/node_modules/qrcode/lib/core/bit-matrix.js +65 -0
- package/node_modules/qrcode/lib/core/byte-data.js +30 -0
- package/node_modules/qrcode/lib/core/error-correction-code.js +135 -0
- package/node_modules/qrcode/lib/core/error-correction-level.js +50 -0
- package/node_modules/qrcode/lib/core/finder-pattern.js +22 -0
- package/node_modules/qrcode/lib/core/format-info.js +29 -0
- package/node_modules/qrcode/lib/core/galois-field.js +69 -0
- package/node_modules/qrcode/lib/core/kanji-data.js +54 -0
- package/node_modules/qrcode/lib/core/mask-pattern.js +234 -0
- package/node_modules/qrcode/lib/core/mode.js +167 -0
- package/node_modules/qrcode/lib/core/numeric-data.js +43 -0
- package/node_modules/qrcode/lib/core/polynomial.js +62 -0
- package/node_modules/qrcode/lib/core/qrcode.js +495 -0
- package/node_modules/qrcode/lib/core/reed-solomon-encoder.js +56 -0
- package/node_modules/qrcode/lib/core/regex.js +31 -0
- package/node_modules/qrcode/lib/core/segments.js +330 -0
- package/node_modules/qrcode/lib/core/utils.js +63 -0
- package/node_modules/qrcode/lib/core/version-check.js +9 -0
- package/node_modules/qrcode/lib/core/version.js +163 -0
- package/node_modules/qrcode/lib/index.js +12 -0
- package/node_modules/qrcode/lib/renderer/canvas.js +63 -0
- package/node_modules/qrcode/lib/renderer/png.js +78 -0
- package/node_modules/qrcode/lib/renderer/svg-tag.js +81 -0
- package/node_modules/qrcode/lib/renderer/svg.js +19 -0
- package/node_modules/qrcode/lib/renderer/terminal/terminal-small.js +85 -0
- package/node_modules/qrcode/lib/renderer/terminal/terminal.js +49 -0
- package/node_modules/qrcode/lib/renderer/terminal.js +9 -0
- package/node_modules/qrcode/lib/renderer/utf8.js +71 -0
- package/node_modules/qrcode/lib/renderer/utils.js +99 -0
- package/node_modules/qrcode/lib/server.js +138 -0
- package/node_modules/qrcode/license +10 -0
- package/node_modules/qrcode/package.json +77 -0
- package/node_modules/require-directory/.jshintrc +67 -0
- package/node_modules/require-directory/.npmignore +1 -0
- package/node_modules/require-directory/.travis.yml +3 -0
- package/node_modules/require-directory/LICENSE +22 -0
- package/node_modules/require-directory/README.markdown +184 -0
- package/node_modules/require-directory/index.js +86 -0
- package/node_modules/require-directory/package.json +40 -0
- package/node_modules/require-main-filename/LICENSE.txt +14 -0
- package/node_modules/require-main-filename/README.md +26 -0
- package/node_modules/require-main-filename/index.js +18 -0
- package/node_modules/require-main-filename/package.json +35 -0
- package/node_modules/set-blocking/LICENSE.txt +14 -0
- package/node_modules/set-blocking/README.md +31 -0
- package/node_modules/set-blocking/index.js +7 -0
- package/node_modules/set-blocking/package.json +42 -0
- package/node_modules/sisteransi/license +21 -0
- package/node_modules/sisteransi/package.json +34 -0
- package/node_modules/sisteransi/readme.md +113 -0
- package/node_modules/sisteransi/src/index.js +58 -0
- package/node_modules/sisteransi/src/sisteransi.d.ts +35 -0
- package/node_modules/string-width/index.d.ts +29 -0
- package/node_modules/string-width/index.js +47 -0
- package/node_modules/string-width/license +9 -0
- package/node_modules/string-width/package.json +56 -0
- package/node_modules/string-width/readme.md +50 -0
- package/node_modules/strip-ansi/index.d.ts +17 -0
- package/node_modules/strip-ansi/index.js +4 -0
- package/node_modules/strip-ansi/license +9 -0
- package/node_modules/strip-ansi/package.json +54 -0
- package/node_modules/strip-ansi/readme.md +46 -0
- package/node_modules/which-module/LICENSE +13 -0
- package/node_modules/which-module/README.md +58 -0
- package/node_modules/which-module/index.js +9 -0
- package/node_modules/which-module/package.json +41 -0
- package/node_modules/wrap-ansi/index.js +186 -0
- package/node_modules/wrap-ansi/license +9 -0
- package/node_modules/wrap-ansi/node_modules/ansi-styles/index.d.ts +345 -0
- package/node_modules/wrap-ansi/node_modules/ansi-styles/index.js +163 -0
- package/node_modules/wrap-ansi/node_modules/ansi-styles/license +9 -0
- package/node_modules/wrap-ansi/node_modules/ansi-styles/package.json +56 -0
- package/node_modules/wrap-ansi/node_modules/ansi-styles/readme.md +152 -0
- package/node_modules/wrap-ansi/package.json +61 -0
- package/node_modules/wrap-ansi/readme.md +97 -0
- package/node_modules/y18n/LICENSE +13 -0
- package/node_modules/y18n/README.md +109 -0
- package/node_modules/y18n/index.js +188 -0
- package/node_modules/y18n/package.json +39 -0
- package/node_modules/yargs/LICENSE +21 -0
- package/node_modules/yargs/README.md +140 -0
- package/node_modules/yargs/build/lib/apply-extends.d.ts +2 -0
- package/node_modules/yargs/build/lib/apply-extends.js +65 -0
- package/node_modules/yargs/build/lib/argsert.d.ts +2 -0
- package/node_modules/yargs/build/lib/argsert.js +65 -0
- package/node_modules/yargs/build/lib/command.d.ts +64 -0
- package/node_modules/yargs/build/lib/command.js +416 -0
- package/node_modules/yargs/build/lib/common-types.d.ts +36 -0
- package/node_modules/yargs/build/lib/common-types.js +25 -0
- package/node_modules/yargs/build/lib/completion-templates.d.ts +2 -0
- package/node_modules/yargs/build/lib/completion-templates.js +50 -0
- package/node_modules/yargs/build/lib/completion.d.ts +21 -0
- package/node_modules/yargs/build/lib/completion.js +135 -0
- package/node_modules/yargs/build/lib/is-promise.d.ts +1 -0
- package/node_modules/yargs/build/lib/is-promise.js +9 -0
- package/node_modules/yargs/build/lib/levenshtein.d.ts +1 -0
- package/node_modules/yargs/build/lib/levenshtein.js +58 -0
- package/node_modules/yargs/build/lib/middleware.d.ts +10 -0
- package/node_modules/yargs/build/lib/middleware.js +57 -0
- package/node_modules/yargs/build/lib/obj-filter.d.ts +1 -0
- package/node_modules/yargs/build/lib/obj-filter.js +14 -0
- package/node_modules/yargs/build/lib/parse-command.d.ts +11 -0
- package/node_modules/yargs/build/lib/parse-command.js +36 -0
- package/node_modules/yargs/build/lib/process-argv.d.ts +2 -0
- package/node_modules/yargs/build/lib/process-argv.js +31 -0
- package/node_modules/yargs/build/lib/usage.d.ts +49 -0
- package/node_modules/yargs/build/lib/usage.js +540 -0
- package/node_modules/yargs/build/lib/validation.d.ts +34 -0
- package/node_modules/yargs/build/lib/validation.js +330 -0
- package/node_modules/yargs/build/lib/yargs.d.ts +274 -0
- package/node_modules/yargs/build/lib/yargs.js +1190 -0
- package/node_modules/yargs/build/lib/yerror.d.ts +4 -0
- package/node_modules/yargs/build/lib/yerror.js +11 -0
- package/node_modules/yargs/index.js +40 -0
- package/node_modules/yargs/locales/be.json +46 -0
- package/node_modules/yargs/locales/de.json +46 -0
- package/node_modules/yargs/locales/en.json +51 -0
- package/node_modules/yargs/locales/es.json +46 -0
- package/node_modules/yargs/locales/fi.json +49 -0
- package/node_modules/yargs/locales/fr.json +53 -0
- package/node_modules/yargs/locales/hi.json +49 -0
- package/node_modules/yargs/locales/hu.json +46 -0
- package/node_modules/yargs/locales/id.json +50 -0
- package/node_modules/yargs/locales/it.json +46 -0
- package/node_modules/yargs/locales/ja.json +51 -0
- package/node_modules/yargs/locales/ko.json +49 -0
- package/node_modules/yargs/locales/nb.json +44 -0
- package/node_modules/yargs/locales/nl.json +49 -0
- package/node_modules/yargs/locales/nn.json +44 -0
- package/node_modules/yargs/locales/pirate.json +13 -0
- package/node_modules/yargs/locales/pl.json +49 -0
- package/node_modules/yargs/locales/pt.json +45 -0
- package/node_modules/yargs/locales/pt_BR.json +48 -0
- package/node_modules/yargs/locales/ru.json +46 -0
- package/node_modules/yargs/locales/th.json +46 -0
- package/node_modules/yargs/locales/tr.json +48 -0
- package/node_modules/yargs/locales/zh_CN.json +48 -0
- package/node_modules/yargs/locales/zh_TW.json +47 -0
- package/node_modules/yargs/package.json +92 -0
- package/node_modules/yargs/yargs.js +14 -0
- package/node_modules/yargs-parser/LICENSE.txt +14 -0
- package/node_modules/yargs-parser/README.md +449 -0
- package/node_modules/yargs-parser/index.js +1032 -0
- package/node_modules/yargs-parser/lib/tokenize-arg-string.js +40 -0
- package/node_modules/yargs-parser/package.json +46 -0
- package/package.json +28 -5
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "get-caller-file",
|
|
3
|
+
"version": "2.0.5",
|
|
4
|
+
"description": "",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"directories": {
|
|
7
|
+
"test": "tests"
|
|
8
|
+
},
|
|
9
|
+
"files": [
|
|
10
|
+
"index.js",
|
|
11
|
+
"index.js.map",
|
|
12
|
+
"index.d.ts"
|
|
13
|
+
],
|
|
14
|
+
"scripts": {
|
|
15
|
+
"prepare": "tsc",
|
|
16
|
+
"test": "mocha test",
|
|
17
|
+
"test:debug": "mocha test"
|
|
18
|
+
},
|
|
19
|
+
"repository": {
|
|
20
|
+
"type": "git",
|
|
21
|
+
"url": "git+https://github.com/stefanpenner/get-caller-file.git"
|
|
22
|
+
},
|
|
23
|
+
"author": "Stefan Penner",
|
|
24
|
+
"license": "ISC",
|
|
25
|
+
"bugs": {
|
|
26
|
+
"url": "https://github.com/stefanpenner/get-caller-file/issues"
|
|
27
|
+
},
|
|
28
|
+
"homepage": "https://github.com/stefanpenner/get-caller-file#readme",
|
|
29
|
+
"devDependencies": {
|
|
30
|
+
"@types/chai": "^4.1.7",
|
|
31
|
+
"@types/ensure-posix-path": "^1.0.0",
|
|
32
|
+
"@types/mocha": "^5.2.6",
|
|
33
|
+
"@types/node": "^11.10.5",
|
|
34
|
+
"chai": "^4.1.2",
|
|
35
|
+
"ensure-posix-path": "^1.0.1",
|
|
36
|
+
"mocha": "^5.2.0",
|
|
37
|
+
"typescript": "^3.3.3333"
|
|
38
|
+
},
|
|
39
|
+
"engines": {
|
|
40
|
+
"node": "6.* || 8.* || >= 10.*"
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
Check if the character represented by a given [Unicode code point](https://en.wikipedia.org/wiki/Code_point) is [fullwidth](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms).
|
|
3
|
+
|
|
4
|
+
@param codePoint - The [code point](https://en.wikipedia.org/wiki/Code_point) of a character.
|
|
5
|
+
|
|
6
|
+
@example
|
|
7
|
+
```
|
|
8
|
+
import isFullwidthCodePoint from 'is-fullwidth-code-point';
|
|
9
|
+
|
|
10
|
+
isFullwidthCodePoint('谢'.codePointAt(0));
|
|
11
|
+
//=> true
|
|
12
|
+
|
|
13
|
+
isFullwidthCodePoint('a'.codePointAt(0));
|
|
14
|
+
//=> false
|
|
15
|
+
```
|
|
16
|
+
*/
|
|
17
|
+
export default function isFullwidthCodePoint(codePoint: number): boolean;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/* eslint-disable yoda */
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
const isFullwidthCodePoint = codePoint => {
|
|
5
|
+
if (Number.isNaN(codePoint)) {
|
|
6
|
+
return false;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
// Code points are derived from:
|
|
10
|
+
// http://www.unix.org/Public/UNIDATA/EastAsianWidth.txt
|
|
11
|
+
if (
|
|
12
|
+
codePoint >= 0x1100 && (
|
|
13
|
+
codePoint <= 0x115F || // Hangul Jamo
|
|
14
|
+
codePoint === 0x2329 || // LEFT-POINTING ANGLE BRACKET
|
|
15
|
+
codePoint === 0x232A || // RIGHT-POINTING ANGLE BRACKET
|
|
16
|
+
// CJK Radicals Supplement .. Enclosed CJK Letters and Months
|
|
17
|
+
(0x2E80 <= codePoint && codePoint <= 0x3247 && codePoint !== 0x303F) ||
|
|
18
|
+
// Enclosed CJK Letters and Months .. CJK Unified Ideographs Extension A
|
|
19
|
+
(0x3250 <= codePoint && codePoint <= 0x4DBF) ||
|
|
20
|
+
// CJK Unified Ideographs .. Yi Radicals
|
|
21
|
+
(0x4E00 <= codePoint && codePoint <= 0xA4C6) ||
|
|
22
|
+
// Hangul Jamo Extended-A
|
|
23
|
+
(0xA960 <= codePoint && codePoint <= 0xA97C) ||
|
|
24
|
+
// Hangul Syllables
|
|
25
|
+
(0xAC00 <= codePoint && codePoint <= 0xD7A3) ||
|
|
26
|
+
// CJK Compatibility Ideographs
|
|
27
|
+
(0xF900 <= codePoint && codePoint <= 0xFAFF) ||
|
|
28
|
+
// Vertical Forms
|
|
29
|
+
(0xFE10 <= codePoint && codePoint <= 0xFE19) ||
|
|
30
|
+
// CJK Compatibility Forms .. Small Form Variants
|
|
31
|
+
(0xFE30 <= codePoint && codePoint <= 0xFE6B) ||
|
|
32
|
+
// Halfwidth and Fullwidth Forms
|
|
33
|
+
(0xFF01 <= codePoint && codePoint <= 0xFF60) ||
|
|
34
|
+
(0xFFE0 <= codePoint && codePoint <= 0xFFE6) ||
|
|
35
|
+
// Kana Supplement
|
|
36
|
+
(0x1B000 <= codePoint && codePoint <= 0x1B001) ||
|
|
37
|
+
// Enclosed Ideographic Supplement
|
|
38
|
+
(0x1F200 <= codePoint && codePoint <= 0x1F251) ||
|
|
39
|
+
// CJK Unified Ideographs Extension B .. Tertiary Ideographic Plane
|
|
40
|
+
(0x20000 <= codePoint && codePoint <= 0x3FFFD)
|
|
41
|
+
)
|
|
42
|
+
) {
|
|
43
|
+
return true;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
return false;
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
module.exports = isFullwidthCodePoint;
|
|
50
|
+
module.exports.default = isFullwidthCodePoint;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
MIT License
|
|
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 of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
6
|
+
|
|
7
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "is-fullwidth-code-point",
|
|
3
|
+
"version": "3.0.0",
|
|
4
|
+
"description": "Check if the character represented by a given Unicode code point is fullwidth",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": "sindresorhus/is-fullwidth-code-point",
|
|
7
|
+
"author": {
|
|
8
|
+
"name": "Sindre Sorhus",
|
|
9
|
+
"email": "sindresorhus@gmail.com",
|
|
10
|
+
"url": "sindresorhus.com"
|
|
11
|
+
},
|
|
12
|
+
"engines": {
|
|
13
|
+
"node": ">=8"
|
|
14
|
+
},
|
|
15
|
+
"scripts": {
|
|
16
|
+
"test": "xo && ava && tsd-check"
|
|
17
|
+
},
|
|
18
|
+
"files": [
|
|
19
|
+
"index.js",
|
|
20
|
+
"index.d.ts"
|
|
21
|
+
],
|
|
22
|
+
"keywords": [
|
|
23
|
+
"fullwidth",
|
|
24
|
+
"full-width",
|
|
25
|
+
"full",
|
|
26
|
+
"width",
|
|
27
|
+
"unicode",
|
|
28
|
+
"character",
|
|
29
|
+
"string",
|
|
30
|
+
"codepoint",
|
|
31
|
+
"code",
|
|
32
|
+
"point",
|
|
33
|
+
"is",
|
|
34
|
+
"detect",
|
|
35
|
+
"check"
|
|
36
|
+
],
|
|
37
|
+
"devDependencies": {
|
|
38
|
+
"ava": "^1.3.1",
|
|
39
|
+
"tsd-check": "^0.5.0",
|
|
40
|
+
"xo": "^0.24.0"
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# is-fullwidth-code-point [](https://travis-ci.org/sindresorhus/is-fullwidth-code-point)
|
|
2
|
+
|
|
3
|
+
> Check if the character represented by a given [Unicode code point](https://en.wikipedia.org/wiki/Code_point) is [fullwidth](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
## Install
|
|
7
|
+
|
|
8
|
+
```
|
|
9
|
+
$ npm install is-fullwidth-code-point
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
```js
|
|
16
|
+
const isFullwidthCodePoint = require('is-fullwidth-code-point');
|
|
17
|
+
|
|
18
|
+
isFullwidthCodePoint('谢'.codePointAt(0));
|
|
19
|
+
//=> true
|
|
20
|
+
|
|
21
|
+
isFullwidthCodePoint('a'.codePointAt(0));
|
|
22
|
+
//=> false
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
## API
|
|
27
|
+
|
|
28
|
+
### isFullwidthCodePoint(codePoint)
|
|
29
|
+
|
|
30
|
+
#### codePoint
|
|
31
|
+
|
|
32
|
+
Type: `number`
|
|
33
|
+
|
|
34
|
+
The [code point](https://en.wikipedia.org/wiki/Code_point) of a character.
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
## License
|
|
38
|
+
|
|
39
|
+
MIT © [Sindre Sorhus](https://sindresorhus.com)
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
declare namespace locatePath {
|
|
2
|
+
interface Options {
|
|
3
|
+
/**
|
|
4
|
+
Current working directory.
|
|
5
|
+
|
|
6
|
+
@default process.cwd()
|
|
7
|
+
*/
|
|
8
|
+
readonly cwd?: string;
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
Type of path to match.
|
|
12
|
+
|
|
13
|
+
@default 'file'
|
|
14
|
+
*/
|
|
15
|
+
readonly type?: 'file' | 'directory';
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
Allow symbolic links to match if they point to the requested path type.
|
|
19
|
+
|
|
20
|
+
@default true
|
|
21
|
+
*/
|
|
22
|
+
readonly allowSymlinks?: boolean;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
interface AsyncOptions extends Options {
|
|
26
|
+
/**
|
|
27
|
+
Number of concurrently pending promises. Minimum: `1`.
|
|
28
|
+
|
|
29
|
+
@default Infinity
|
|
30
|
+
*/
|
|
31
|
+
readonly concurrency?: number;
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
Preserve `paths` order when searching.
|
|
35
|
+
|
|
36
|
+
Disable this to improve performance if you don't care about the order.
|
|
37
|
+
|
|
38
|
+
@default true
|
|
39
|
+
*/
|
|
40
|
+
readonly preserveOrder?: boolean;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
declare const locatePath: {
|
|
45
|
+
/**
|
|
46
|
+
Get the first path that exists on disk of multiple paths.
|
|
47
|
+
|
|
48
|
+
@param paths - Paths to check.
|
|
49
|
+
@returns The first path that exists or `undefined` if none exists.
|
|
50
|
+
|
|
51
|
+
@example
|
|
52
|
+
```
|
|
53
|
+
import locatePath = require('locate-path');
|
|
54
|
+
|
|
55
|
+
const files = [
|
|
56
|
+
'unicorn.png',
|
|
57
|
+
'rainbow.png', // Only this one actually exists on disk
|
|
58
|
+
'pony.png'
|
|
59
|
+
];
|
|
60
|
+
|
|
61
|
+
(async () => {
|
|
62
|
+
console(await locatePath(files));
|
|
63
|
+
//=> 'rainbow'
|
|
64
|
+
})();
|
|
65
|
+
```
|
|
66
|
+
*/
|
|
67
|
+
(paths: Iterable<string>, options?: locatePath.AsyncOptions): Promise<
|
|
68
|
+
string | undefined
|
|
69
|
+
>;
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
Synchronously get the first path that exists on disk of multiple paths.
|
|
73
|
+
|
|
74
|
+
@param paths - Paths to check.
|
|
75
|
+
@returns The first path that exists or `undefined` if none exists.
|
|
76
|
+
*/
|
|
77
|
+
sync(
|
|
78
|
+
paths: Iterable<string>,
|
|
79
|
+
options?: locatePath.Options
|
|
80
|
+
): string | undefined;
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
export = locatePath;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
const path = require('path');
|
|
3
|
+
const fs = require('fs');
|
|
4
|
+
const {promisify} = require('util');
|
|
5
|
+
const pLocate = require('p-locate');
|
|
6
|
+
|
|
7
|
+
const fsStat = promisify(fs.stat);
|
|
8
|
+
const fsLStat = promisify(fs.lstat);
|
|
9
|
+
|
|
10
|
+
const typeMappings = {
|
|
11
|
+
directory: 'isDirectory',
|
|
12
|
+
file: 'isFile'
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
function checkType({type}) {
|
|
16
|
+
if (type in typeMappings) {
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
throw new Error(`Invalid type specified: ${type}`);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const matchType = (type, stat) => type === undefined || stat[typeMappings[type]]();
|
|
24
|
+
|
|
25
|
+
module.exports = async (paths, options) => {
|
|
26
|
+
options = {
|
|
27
|
+
cwd: process.cwd(),
|
|
28
|
+
type: 'file',
|
|
29
|
+
allowSymlinks: true,
|
|
30
|
+
...options
|
|
31
|
+
};
|
|
32
|
+
checkType(options);
|
|
33
|
+
const statFn = options.allowSymlinks ? fsStat : fsLStat;
|
|
34
|
+
|
|
35
|
+
return pLocate(paths, async path_ => {
|
|
36
|
+
try {
|
|
37
|
+
const stat = await statFn(path.resolve(options.cwd, path_));
|
|
38
|
+
return matchType(options.type, stat);
|
|
39
|
+
} catch (_) {
|
|
40
|
+
return false;
|
|
41
|
+
}
|
|
42
|
+
}, options);
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
module.exports.sync = (paths, options) => {
|
|
46
|
+
options = {
|
|
47
|
+
cwd: process.cwd(),
|
|
48
|
+
allowSymlinks: true,
|
|
49
|
+
type: 'file',
|
|
50
|
+
...options
|
|
51
|
+
};
|
|
52
|
+
checkType(options);
|
|
53
|
+
const statFn = options.allowSymlinks ? fs.statSync : fs.lstatSync;
|
|
54
|
+
|
|
55
|
+
for (const path_ of paths) {
|
|
56
|
+
try {
|
|
57
|
+
const stat = statFn(path.resolve(options.cwd, path_));
|
|
58
|
+
|
|
59
|
+
if (matchType(options.type, stat)) {
|
|
60
|
+
return path_;
|
|
61
|
+
}
|
|
62
|
+
} catch (_) {
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
MIT License
|
|
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 of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
6
|
+
|
|
7
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "locate-path",
|
|
3
|
+
"version": "5.0.0",
|
|
4
|
+
"description": "Get the first path that exists on disk of multiple paths",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": "sindresorhus/locate-path",
|
|
7
|
+
"author": {
|
|
8
|
+
"name": "Sindre Sorhus",
|
|
9
|
+
"email": "sindresorhus@gmail.com",
|
|
10
|
+
"url": "sindresorhus.com"
|
|
11
|
+
},
|
|
12
|
+
"engines": {
|
|
13
|
+
"node": ">=8"
|
|
14
|
+
},
|
|
15
|
+
"scripts": {
|
|
16
|
+
"test": "xo && ava && tsd"
|
|
17
|
+
},
|
|
18
|
+
"files": [
|
|
19
|
+
"index.js",
|
|
20
|
+
"index.d.ts"
|
|
21
|
+
],
|
|
22
|
+
"keywords": [
|
|
23
|
+
"locate",
|
|
24
|
+
"path",
|
|
25
|
+
"paths",
|
|
26
|
+
"file",
|
|
27
|
+
"files",
|
|
28
|
+
"exists",
|
|
29
|
+
"find",
|
|
30
|
+
"finder",
|
|
31
|
+
"search",
|
|
32
|
+
"searcher",
|
|
33
|
+
"array",
|
|
34
|
+
"iterable",
|
|
35
|
+
"iterator"
|
|
36
|
+
],
|
|
37
|
+
"dependencies": {
|
|
38
|
+
"p-locate": "^4.1.0"
|
|
39
|
+
},
|
|
40
|
+
"devDependencies": {
|
|
41
|
+
"ava": "^1.4.1",
|
|
42
|
+
"tsd": "^0.7.2",
|
|
43
|
+
"xo": "^0.24.0"
|
|
44
|
+
}
|
|
45
|
+
}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
# locate-path [](https://travis-ci.org/sindresorhus/locate-path)
|
|
2
|
+
|
|
3
|
+
> Get the first path that exists on disk of multiple paths
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
## Install
|
|
7
|
+
|
|
8
|
+
```
|
|
9
|
+
$ npm install locate-path
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
Here we find the first file that exists on disk, in array order.
|
|
16
|
+
|
|
17
|
+
```js
|
|
18
|
+
const locatePath = require('locate-path');
|
|
19
|
+
|
|
20
|
+
const files = [
|
|
21
|
+
'unicorn.png',
|
|
22
|
+
'rainbow.png', // Only this one actually exists on disk
|
|
23
|
+
'pony.png'
|
|
24
|
+
];
|
|
25
|
+
|
|
26
|
+
(async () => {
|
|
27
|
+
console(await locatePath(files));
|
|
28
|
+
//=> 'rainbow'
|
|
29
|
+
})();
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
## API
|
|
34
|
+
|
|
35
|
+
### locatePath(paths, [options])
|
|
36
|
+
|
|
37
|
+
Returns a `Promise<string>` for the first path that exists or `undefined` if none exists.
|
|
38
|
+
|
|
39
|
+
#### paths
|
|
40
|
+
|
|
41
|
+
Type: `Iterable<string>`
|
|
42
|
+
|
|
43
|
+
Paths to check.
|
|
44
|
+
|
|
45
|
+
#### options
|
|
46
|
+
|
|
47
|
+
Type: `Object`
|
|
48
|
+
|
|
49
|
+
##### concurrency
|
|
50
|
+
|
|
51
|
+
Type: `number`<br>
|
|
52
|
+
Default: `Infinity`<br>
|
|
53
|
+
Minimum: `1`
|
|
54
|
+
|
|
55
|
+
Number of concurrently pending promises.
|
|
56
|
+
|
|
57
|
+
##### preserveOrder
|
|
58
|
+
|
|
59
|
+
Type: `boolean`<br>
|
|
60
|
+
Default: `true`
|
|
61
|
+
|
|
62
|
+
Preserve `paths` order when searching.
|
|
63
|
+
|
|
64
|
+
Disable this to improve performance if you don't care about the order.
|
|
65
|
+
|
|
66
|
+
##### cwd
|
|
67
|
+
|
|
68
|
+
Type: `string`<br>
|
|
69
|
+
Default: `process.cwd()`
|
|
70
|
+
|
|
71
|
+
Current working directory.
|
|
72
|
+
|
|
73
|
+
##### type
|
|
74
|
+
|
|
75
|
+
Type: `string`<br>
|
|
76
|
+
Default: `file`<br>
|
|
77
|
+
Values: `file` `directory`
|
|
78
|
+
|
|
79
|
+
The type of paths that can match.
|
|
80
|
+
|
|
81
|
+
##### allowSymlinks
|
|
82
|
+
|
|
83
|
+
Type: `boolean`<br>
|
|
84
|
+
Default: `true`
|
|
85
|
+
|
|
86
|
+
Allow symbolic links to match if they point to the chosen path type.
|
|
87
|
+
|
|
88
|
+
### locatePath.sync(paths, [options])
|
|
89
|
+
|
|
90
|
+
Returns the first path that exists or `undefined` if none exists.
|
|
91
|
+
|
|
92
|
+
#### paths
|
|
93
|
+
|
|
94
|
+
Type: `Iterable<string>`
|
|
95
|
+
|
|
96
|
+
Paths to check.
|
|
97
|
+
|
|
98
|
+
#### options
|
|
99
|
+
|
|
100
|
+
Type: `Object`
|
|
101
|
+
|
|
102
|
+
##### cwd
|
|
103
|
+
|
|
104
|
+
Same as above.
|
|
105
|
+
|
|
106
|
+
##### type
|
|
107
|
+
|
|
108
|
+
Same as above.
|
|
109
|
+
|
|
110
|
+
##### allowSymlinks
|
|
111
|
+
|
|
112
|
+
Same as above.
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
## Related
|
|
116
|
+
|
|
117
|
+
- [path-exists](https://github.com/sindresorhus/path-exists) - Check if a path exists
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
## License
|
|
121
|
+
|
|
122
|
+
MIT © [Sindre Sorhus](https://sindresorhus.com)
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
declare namespace pLocate {
|
|
2
|
+
interface Options {
|
|
3
|
+
/**
|
|
4
|
+
Number of concurrently pending promises returned by `tester`. Minimum: `1`.
|
|
5
|
+
|
|
6
|
+
@default Infinity
|
|
7
|
+
*/
|
|
8
|
+
readonly concurrency?: number;
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
Preserve `input` order when searching.
|
|
12
|
+
|
|
13
|
+
Disable this to improve performance if you don't care about the order.
|
|
14
|
+
|
|
15
|
+
@default true
|
|
16
|
+
*/
|
|
17
|
+
readonly preserveOrder?: boolean;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
declare const pLocate: {
|
|
22
|
+
/**
|
|
23
|
+
Get the first fulfilled promise that satisfies the provided testing function.
|
|
24
|
+
|
|
25
|
+
@param input - An iterable of promises/values to test.
|
|
26
|
+
@param tester - This function will receive resolved values from `input` and is expected to return a `Promise<boolean>` or `boolean`.
|
|
27
|
+
@returns A `Promise` that is fulfilled when `tester` resolves to `true` or the iterable is done, or rejects if any of the promises reject. The fulfilled value is the current iterable value or `undefined` if `tester` never resolved to `true`.
|
|
28
|
+
|
|
29
|
+
@example
|
|
30
|
+
```
|
|
31
|
+
import pathExists = require('path-exists');
|
|
32
|
+
import pLocate = require('p-locate');
|
|
33
|
+
|
|
34
|
+
const files = [
|
|
35
|
+
'unicorn.png',
|
|
36
|
+
'rainbow.png', // Only this one actually exists on disk
|
|
37
|
+
'pony.png'
|
|
38
|
+
];
|
|
39
|
+
|
|
40
|
+
(async () => {
|
|
41
|
+
const foundPath = await pLocate(files, file => pathExists(file));
|
|
42
|
+
|
|
43
|
+
console.log(foundPath);
|
|
44
|
+
//=> 'rainbow'
|
|
45
|
+
})();
|
|
46
|
+
```
|
|
47
|
+
*/
|
|
48
|
+
<ValueType>(
|
|
49
|
+
input: Iterable<PromiseLike<ValueType> | ValueType>,
|
|
50
|
+
tester: (element: ValueType) => PromiseLike<boolean> | boolean,
|
|
51
|
+
options?: pLocate.Options
|
|
52
|
+
): Promise<ValueType | undefined>;
|
|
53
|
+
|
|
54
|
+
// TODO: Remove this for the next major release, refactor the whole definition to:
|
|
55
|
+
// declare function pLocate<ValueType>(
|
|
56
|
+
// input: Iterable<PromiseLike<ValueType> | ValueType>,
|
|
57
|
+
// tester: (element: ValueType) => PromiseLike<boolean> | boolean,
|
|
58
|
+
// options?: pLocate.Options
|
|
59
|
+
// ): Promise<ValueType | undefined>;
|
|
60
|
+
// export = pLocate;
|
|
61
|
+
default: typeof pLocate;
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
export = pLocate;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
const pLimit = require('p-limit');
|
|
3
|
+
|
|
4
|
+
class EndError extends Error {
|
|
5
|
+
constructor(value) {
|
|
6
|
+
super();
|
|
7
|
+
this.value = value;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
// The input can also be a promise, so we await it
|
|
12
|
+
const testElement = async (element, tester) => tester(await element);
|
|
13
|
+
|
|
14
|
+
// The input can also be a promise, so we `Promise.all()` them both
|
|
15
|
+
const finder = async element => {
|
|
16
|
+
const values = await Promise.all(element);
|
|
17
|
+
if (values[1] === true) {
|
|
18
|
+
throw new EndError(values[0]);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
return false;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
const pLocate = async (iterable, tester, options) => {
|
|
25
|
+
options = {
|
|
26
|
+
concurrency: Infinity,
|
|
27
|
+
preserveOrder: true,
|
|
28
|
+
...options
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
const limit = pLimit(options.concurrency);
|
|
32
|
+
|
|
33
|
+
// Start all the promises concurrently with optional limit
|
|
34
|
+
const items = [...iterable].map(element => [element, limit(testElement, element, tester)]);
|
|
35
|
+
|
|
36
|
+
// Check the promises either serially or concurrently
|
|
37
|
+
const checkLimit = pLimit(options.preserveOrder ? 1 : Infinity);
|
|
38
|
+
|
|
39
|
+
try {
|
|
40
|
+
await Promise.all(items.map(element => checkLimit(finder, element)));
|
|
41
|
+
} catch (error) {
|
|
42
|
+
if (error instanceof EndError) {
|
|
43
|
+
return error.value;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
throw error;
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
module.exports = pLocate;
|
|
51
|
+
// TODO: Remove this for the next major release
|
|
52
|
+
module.exports.default = pLocate;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
MIT License
|
|
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 of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
6
|
+
|
|
7
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|