korext 0.7.0 → 0.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +102 -28
- package/bin/korext.js +251 -56
- package/package.json +21 -14
- package/CHANGELOG.md +0 -51
- package/dummy.pdf +0 -0
- package/korext.json +0 -11
- package/node_modules/ansi-regex/index.d.ts +0 -37
- package/node_modules/ansi-regex/index.js +0 -10
- package/node_modules/ansi-regex/license +0 -9
- package/node_modules/ansi-regex/package.json +0 -55
- package/node_modules/ansi-regex/readme.md +0 -78
- package/node_modules/ansi-styles/index.d.ts +0 -345
- package/node_modules/ansi-styles/index.js +0 -163
- package/node_modules/ansi-styles/license +0 -9
- package/node_modules/ansi-styles/package.json +0 -56
- package/node_modules/ansi-styles/readme.md +0 -152
- package/node_modules/balanced-match/LICENSE.md +0 -23
- package/node_modules/balanced-match/README.md +0 -57
- package/node_modules/balanced-match/dist/commonjs/index.d.ts +0 -9
- package/node_modules/balanced-match/dist/commonjs/index.d.ts.map +0 -1
- package/node_modules/balanced-match/dist/commonjs/index.js +0 -59
- package/node_modules/balanced-match/dist/commonjs/index.js.map +0 -1
- package/node_modules/balanced-match/dist/commonjs/package.json +0 -3
- package/node_modules/balanced-match/dist/esm/index.d.ts +0 -9
- package/node_modules/balanced-match/dist/esm/index.d.ts.map +0 -1
- package/node_modules/balanced-match/dist/esm/index.js +0 -54
- package/node_modules/balanced-match/dist/esm/index.js.map +0 -1
- package/node_modules/balanced-match/dist/esm/package.json +0 -3
- package/node_modules/balanced-match/package.json +0 -68
- package/node_modules/base64-js/LICENSE +0 -21
- package/node_modules/base64-js/README.md +0 -34
- package/node_modules/base64-js/base64js.min.js +0 -1
- package/node_modules/base64-js/index.d.ts +0 -3
- package/node_modules/base64-js/index.js +0 -150
- package/node_modules/base64-js/package.json +0 -47
- package/node_modules/bl/.travis.yml +0 -17
- package/node_modules/bl/BufferList.js +0 -396
- package/node_modules/bl/LICENSE.md +0 -13
- package/node_modules/bl/README.md +0 -247
- package/node_modules/bl/bl.js +0 -84
- package/node_modules/bl/package.json +0 -37
- package/node_modules/bl/test/convert.js +0 -21
- package/node_modules/bl/test/indexOf.js +0 -492
- package/node_modules/bl/test/isBufferList.js +0 -32
- package/node_modules/bl/test/test.js +0 -869
- package/node_modules/brace-expansion/LICENSE +0 -23
- package/node_modules/brace-expansion/README.md +0 -94
- package/node_modules/brace-expansion/dist/commonjs/index.d.ts +0 -6
- package/node_modules/brace-expansion/dist/commonjs/index.d.ts.map +0 -1
- package/node_modules/brace-expansion/dist/commonjs/index.js +0 -199
- package/node_modules/brace-expansion/dist/commonjs/index.js.map +0 -1
- package/node_modules/brace-expansion/dist/commonjs/package.json +0 -3
- package/node_modules/brace-expansion/dist/esm/index.d.ts +0 -6
- package/node_modules/brace-expansion/dist/esm/index.d.ts.map +0 -1
- package/node_modules/brace-expansion/dist/esm/index.js +0 -195
- package/node_modules/brace-expansion/dist/esm/index.js.map +0 -1
- package/node_modules/brace-expansion/dist/esm/package.json +0 -3
- package/node_modules/brace-expansion/package.json +0 -64
- package/node_modules/buffer/AUTHORS.md +0 -70
- package/node_modules/buffer/LICENSE +0 -21
- package/node_modules/buffer/README.md +0 -410
- package/node_modules/buffer/index.d.ts +0 -186
- package/node_modules/buffer/index.js +0 -1817
- package/node_modules/buffer/package.json +0 -96
- package/node_modules/chalk/index.d.ts +0 -415
- package/node_modules/chalk/license +0 -9
- package/node_modules/chalk/package.json +0 -68
- package/node_modules/chalk/readme.md +0 -341
- package/node_modules/chalk/source/index.js +0 -229
- package/node_modules/chalk/source/templates.js +0 -134
- package/node_modules/chalk/source/util.js +0 -39
- package/node_modules/cli-cursor/index.d.ts +0 -45
- package/node_modules/cli-cursor/index.js +0 -35
- package/node_modules/cli-cursor/license +0 -9
- package/node_modules/cli-cursor/package.json +0 -46
- package/node_modules/cli-cursor/readme.md +0 -55
- package/node_modules/cli-spinners/index.d.ts +0 -128
- package/node_modules/cli-spinners/index.js +0 -15
- package/node_modules/cli-spinners/license +0 -9
- package/node_modules/cli-spinners/package.json +0 -50
- package/node_modules/cli-spinners/readme.md +0 -54
- package/node_modules/cli-spinners/spinners.json +0 -1622
- package/node_modules/clone/.npmignore +0 -4
- package/node_modules/clone/LICENSE +0 -18
- package/node_modules/clone/README.md +0 -126
- package/node_modules/clone/clone.iml +0 -10
- package/node_modules/clone/clone.js +0 -166
- package/node_modules/clone/package.json +0 -51
- package/node_modules/color-convert/CHANGELOG.md +0 -54
- package/node_modules/color-convert/LICENSE +0 -21
- package/node_modules/color-convert/README.md +0 -68
- package/node_modules/color-convert/conversions.js +0 -839
- package/node_modules/color-convert/index.js +0 -81
- package/node_modules/color-convert/package.json +0 -48
- package/node_modules/color-convert/route.js +0 -97
- package/node_modules/color-name/LICENSE +0 -8
- package/node_modules/color-name/README.md +0 -11
- package/node_modules/color-name/index.js +0 -152
- package/node_modules/color-name/package.json +0 -28
- package/node_modules/commander/LICENSE +0 -22
- package/node_modules/commander/Readme.md +0 -1176
- package/node_modules/commander/esm.mjs +0 -16
- package/node_modules/commander/index.js +0 -24
- package/node_modules/commander/lib/argument.js +0 -150
- package/node_modules/commander/lib/command.js +0 -2777
- package/node_modules/commander/lib/error.js +0 -39
- package/node_modules/commander/lib/help.js +0 -747
- package/node_modules/commander/lib/option.js +0 -380
- package/node_modules/commander/lib/suggestSimilar.js +0 -101
- package/node_modules/commander/package-support.json +0 -19
- package/node_modules/commander/package.json +0 -82
- package/node_modules/commander/typings/esm.d.mts +0 -3
- package/node_modules/commander/typings/index.d.ts +0 -1113
- package/node_modules/data-uri-to-buffer/README.md +0 -88
- package/node_modules/data-uri-to-buffer/dist/index.d.ts +0 -15
- package/node_modules/data-uri-to-buffer/dist/index.js +0 -53
- package/node_modules/data-uri-to-buffer/dist/index.js.map +0 -1
- package/node_modules/data-uri-to-buffer/package.json +0 -62
- package/node_modules/data-uri-to-buffer/src/index.ts +0 -68
- package/node_modules/defaults/LICENSE +0 -22
- package/node_modules/defaults/README.md +0 -39
- package/node_modules/defaults/index.js +0 -13
- package/node_modules/defaults/package.json +0 -33
- package/node_modules/defaults/test.js +0 -34
- package/node_modules/fetch-blob/LICENSE +0 -21
- package/node_modules/fetch-blob/README.md +0 -106
- package/node_modules/fetch-blob/file.d.ts +0 -2
- package/node_modules/fetch-blob/file.js +0 -49
- package/node_modules/fetch-blob/from.d.ts +0 -26
- package/node_modules/fetch-blob/from.js +0 -100
- package/node_modules/fetch-blob/index.d.ts +0 -3
- package/node_modules/fetch-blob/index.js +0 -250
- package/node_modules/fetch-blob/package.json +0 -56
- package/node_modules/fetch-blob/streams.cjs +0 -51
- package/node_modules/formdata-polyfill/FormData.js +0 -441
- package/node_modules/formdata-polyfill/LICENSE +0 -21
- package/node_modules/formdata-polyfill/README.md +0 -145
- package/node_modules/formdata-polyfill/esm.min.d.ts +0 -5
- package/node_modules/formdata-polyfill/esm.min.js +0 -40
- package/node_modules/formdata-polyfill/formdata-to-blob.js +0 -39
- package/node_modules/formdata-polyfill/formdata.min.js +0 -21
- package/node_modules/formdata-polyfill/package.json +0 -50
- package/node_modules/glob/LICENSE.md +0 -63
- package/node_modules/glob/README.md +0 -1203
- package/node_modules/glob/dist/commonjs/glob.d.ts +0 -396
- package/node_modules/glob/dist/commonjs/glob.d.ts.map +0 -1
- package/node_modules/glob/dist/commonjs/glob.js +0 -248
- package/node_modules/glob/dist/commonjs/glob.js.map +0 -1
- package/node_modules/glob/dist/commonjs/has-magic.d.ts +0 -14
- package/node_modules/glob/dist/commonjs/has-magic.d.ts.map +0 -1
- package/node_modules/glob/dist/commonjs/has-magic.js +0 -27
- package/node_modules/glob/dist/commonjs/has-magic.js.map +0 -1
- package/node_modules/glob/dist/commonjs/ignore.d.ts +0 -24
- package/node_modules/glob/dist/commonjs/ignore.d.ts.map +0 -1
- package/node_modules/glob/dist/commonjs/ignore.js +0 -119
- package/node_modules/glob/dist/commonjs/ignore.js.map +0 -1
- package/node_modules/glob/dist/commonjs/index.d.ts +0 -97
- package/node_modules/glob/dist/commonjs/index.d.ts.map +0 -1
- package/node_modules/glob/dist/commonjs/index.js +0 -68
- package/node_modules/glob/dist/commonjs/index.js.map +0 -1
- package/node_modules/glob/dist/commonjs/index.min.js +0 -4
- package/node_modules/glob/dist/commonjs/index.min.js.map +0 -7
- package/node_modules/glob/dist/commonjs/package.json +0 -3
- package/node_modules/glob/dist/commonjs/pattern.d.ts +0 -79
- package/node_modules/glob/dist/commonjs/pattern.d.ts.map +0 -1
- package/node_modules/glob/dist/commonjs/pattern.js +0 -223
- package/node_modules/glob/dist/commonjs/pattern.js.map +0 -1
- package/node_modules/glob/dist/commonjs/processor.d.ts +0 -59
- package/node_modules/glob/dist/commonjs/processor.d.ts.map +0 -1
- package/node_modules/glob/dist/commonjs/processor.js +0 -301
- package/node_modules/glob/dist/commonjs/processor.js.map +0 -1
- package/node_modules/glob/dist/commonjs/walker.d.ts +0 -97
- package/node_modules/glob/dist/commonjs/walker.d.ts.map +0 -1
- package/node_modules/glob/dist/commonjs/walker.js +0 -387
- package/node_modules/glob/dist/commonjs/walker.js.map +0 -1
- package/node_modules/glob/dist/esm/glob.d.ts +0 -396
- package/node_modules/glob/dist/esm/glob.d.ts.map +0 -1
- package/node_modules/glob/dist/esm/glob.js +0 -244
- package/node_modules/glob/dist/esm/glob.js.map +0 -1
- package/node_modules/glob/dist/esm/has-magic.d.ts +0 -14
- package/node_modules/glob/dist/esm/has-magic.d.ts.map +0 -1
- package/node_modules/glob/dist/esm/has-magic.js +0 -23
- package/node_modules/glob/dist/esm/has-magic.js.map +0 -1
- package/node_modules/glob/dist/esm/ignore.d.ts +0 -24
- package/node_modules/glob/dist/esm/ignore.d.ts.map +0 -1
- package/node_modules/glob/dist/esm/ignore.js +0 -115
- package/node_modules/glob/dist/esm/ignore.js.map +0 -1
- package/node_modules/glob/dist/esm/index.d.ts +0 -97
- package/node_modules/glob/dist/esm/index.d.ts.map +0 -1
- package/node_modules/glob/dist/esm/index.js +0 -55
- package/node_modules/glob/dist/esm/index.js.map +0 -1
- package/node_modules/glob/dist/esm/index.min.js +0 -4
- package/node_modules/glob/dist/esm/index.min.js.map +0 -7
- package/node_modules/glob/dist/esm/package.json +0 -3
- package/node_modules/glob/dist/esm/pattern.d.ts +0 -79
- package/node_modules/glob/dist/esm/pattern.d.ts.map +0 -1
- package/node_modules/glob/dist/esm/pattern.js +0 -219
- package/node_modules/glob/dist/esm/pattern.js.map +0 -1
- package/node_modules/glob/dist/esm/processor.d.ts +0 -59
- package/node_modules/glob/dist/esm/processor.d.ts.map +0 -1
- package/node_modules/glob/dist/esm/processor.js +0 -294
- package/node_modules/glob/dist/esm/processor.js.map +0 -1
- package/node_modules/glob/dist/esm/walker.d.ts +0 -97
- package/node_modules/glob/dist/esm/walker.d.ts.map +0 -1
- package/node_modules/glob/dist/esm/walker.js +0 -381
- package/node_modules/glob/dist/esm/walker.js.map +0 -1
- package/node_modules/glob/package.json +0 -98
- package/node_modules/has-flag/index.d.ts +0 -39
- package/node_modules/has-flag/index.js +0 -8
- package/node_modules/has-flag/license +0 -9
- package/node_modules/has-flag/package.json +0 -46
- package/node_modules/has-flag/readme.md +0 -89
- package/node_modules/ieee754/LICENSE +0 -11
- package/node_modules/ieee754/README.md +0 -51
- package/node_modules/ieee754/index.d.ts +0 -10
- package/node_modules/ieee754/index.js +0 -85
- package/node_modules/ieee754/package.json +0 -52
- package/node_modules/inherits/LICENSE +0 -16
- package/node_modules/inherits/README.md +0 -42
- package/node_modules/inherits/inherits.js +0 -9
- package/node_modules/inherits/inherits_browser.js +0 -27
- package/node_modules/inherits/package.json +0 -29
- package/node_modules/is-interactive/index.d.ts +0 -31
- package/node_modules/is-interactive/index.js +0 -9
- package/node_modules/is-interactive/license +0 -9
- package/node_modules/is-interactive/package.json +0 -38
- package/node_modules/is-interactive/readme.md +0 -51
- package/node_modules/is-unicode-supported/index.d.ts +0 -14
- package/node_modules/is-unicode-supported/index.js +0 -13
- package/node_modules/is-unicode-supported/license +0 -9
- package/node_modules/is-unicode-supported/package.json +0 -41
- package/node_modules/is-unicode-supported/readme.md +0 -35
- package/node_modules/log-symbols/browser.js +0 -8
- package/node_modules/log-symbols/index.d.ts +0 -25
- package/node_modules/log-symbols/index.js +0 -19
- package/node_modules/log-symbols/license +0 -9
- package/node_modules/log-symbols/package.json +0 -52
- package/node_modules/log-symbols/readme.md +0 -51
- package/node_modules/lru-cache/LICENSE.md +0 -55
- package/node_modules/lru-cache/README.md +0 -383
- package/node_modules/lru-cache/dist/commonjs/index.d.ts +0 -1323
- package/node_modules/lru-cache/dist/commonjs/index.d.ts.map +0 -1
- package/node_modules/lru-cache/dist/commonjs/index.js +0 -1595
- package/node_modules/lru-cache/dist/commonjs/index.js.map +0 -1
- package/node_modules/lru-cache/dist/commonjs/index.min.js +0 -2
- package/node_modules/lru-cache/dist/commonjs/index.min.js.map +0 -7
- package/node_modules/lru-cache/dist/commonjs/package.json +0 -3
- package/node_modules/lru-cache/dist/esm/index.d.ts +0 -1323
- package/node_modules/lru-cache/dist/esm/index.d.ts.map +0 -1
- package/node_modules/lru-cache/dist/esm/index.js +0 -1591
- package/node_modules/lru-cache/dist/esm/index.js.map +0 -1
- package/node_modules/lru-cache/dist/esm/index.min.js +0 -2
- package/node_modules/lru-cache/dist/esm/index.min.js.map +0 -7
- package/node_modules/lru-cache/dist/esm/package.json +0 -3
- package/node_modules/lru-cache/package.json +0 -93
- package/node_modules/mimic-fn/index.d.ts +0 -54
- package/node_modules/mimic-fn/index.js +0 -13
- package/node_modules/mimic-fn/license +0 -9
- package/node_modules/mimic-fn/package.json +0 -42
- package/node_modules/mimic-fn/readme.md +0 -69
- package/node_modules/minimatch/LICENSE.md +0 -55
- package/node_modules/minimatch/README.md +0 -528
- package/node_modules/minimatch/dist/commonjs/assert-valid-pattern.d.ts +0 -2
- package/node_modules/minimatch/dist/commonjs/assert-valid-pattern.d.ts.map +0 -1
- package/node_modules/minimatch/dist/commonjs/assert-valid-pattern.js +0 -14
- package/node_modules/minimatch/dist/commonjs/assert-valid-pattern.js.map +0 -1
- package/node_modules/minimatch/dist/commonjs/ast.d.ts +0 -22
- package/node_modules/minimatch/dist/commonjs/ast.d.ts.map +0 -1
- package/node_modules/minimatch/dist/commonjs/ast.js +0 -846
- package/node_modules/minimatch/dist/commonjs/ast.js.map +0 -1
- package/node_modules/minimatch/dist/commonjs/brace-expressions.d.ts +0 -8
- package/node_modules/minimatch/dist/commonjs/brace-expressions.d.ts.map +0 -1
- package/node_modules/minimatch/dist/commonjs/brace-expressions.js +0 -150
- package/node_modules/minimatch/dist/commonjs/brace-expressions.js.map +0 -1
- package/node_modules/minimatch/dist/commonjs/escape.d.ts +0 -15
- package/node_modules/minimatch/dist/commonjs/escape.d.ts.map +0 -1
- package/node_modules/minimatch/dist/commonjs/escape.js +0 -30
- package/node_modules/minimatch/dist/commonjs/escape.js.map +0 -1
- package/node_modules/minimatch/dist/commonjs/index.d.ts +0 -174
- package/node_modules/minimatch/dist/commonjs/index.d.ts.map +0 -1
- package/node_modules/minimatch/dist/commonjs/index.js +0 -1121
- package/node_modules/minimatch/dist/commonjs/index.js.map +0 -1
- package/node_modules/minimatch/dist/commonjs/package.json +0 -3
- package/node_modules/minimatch/dist/commonjs/unescape.d.ts +0 -22
- package/node_modules/minimatch/dist/commonjs/unescape.d.ts.map +0 -1
- package/node_modules/minimatch/dist/commonjs/unescape.js +0 -38
- package/node_modules/minimatch/dist/commonjs/unescape.js.map +0 -1
- package/node_modules/minimatch/dist/esm/assert-valid-pattern.d.ts +0 -2
- package/node_modules/minimatch/dist/esm/assert-valid-pattern.d.ts.map +0 -1
- package/node_modules/minimatch/dist/esm/assert-valid-pattern.js +0 -10
- package/node_modules/minimatch/dist/esm/assert-valid-pattern.js.map +0 -1
- package/node_modules/minimatch/dist/esm/ast.d.ts +0 -22
- package/node_modules/minimatch/dist/esm/ast.d.ts.map +0 -1
- package/node_modules/minimatch/dist/esm/ast.js +0 -842
- package/node_modules/minimatch/dist/esm/ast.js.map +0 -1
- package/node_modules/minimatch/dist/esm/brace-expressions.d.ts +0 -8
- package/node_modules/minimatch/dist/esm/brace-expressions.d.ts.map +0 -1
- package/node_modules/minimatch/dist/esm/brace-expressions.js +0 -146
- package/node_modules/minimatch/dist/esm/brace-expressions.js.map +0 -1
- package/node_modules/minimatch/dist/esm/escape.d.ts +0 -15
- package/node_modules/minimatch/dist/esm/escape.d.ts.map +0 -1
- package/node_modules/minimatch/dist/esm/escape.js +0 -26
- package/node_modules/minimatch/dist/esm/escape.js.map +0 -1
- package/node_modules/minimatch/dist/esm/index.d.ts +0 -174
- package/node_modules/minimatch/dist/esm/index.d.ts.map +0 -1
- package/node_modules/minimatch/dist/esm/index.js +0 -1108
- package/node_modules/minimatch/dist/esm/index.js.map +0 -1
- package/node_modules/minimatch/dist/esm/package.json +0 -3
- package/node_modules/minimatch/dist/esm/unescape.d.ts +0 -22
- package/node_modules/minimatch/dist/esm/unescape.d.ts.map +0 -1
- package/node_modules/minimatch/dist/esm/unescape.js +0 -34
- package/node_modules/minimatch/dist/esm/unescape.js.map +0 -1
- package/node_modules/minimatch/package.json +0 -67
- package/node_modules/minipass/LICENSE.md +0 -55
- package/node_modules/minipass/README.md +0 -825
- package/node_modules/minipass/dist/commonjs/index.d.ts +0 -545
- package/node_modules/minipass/dist/commonjs/index.d.ts.map +0 -1
- package/node_modules/minipass/dist/commonjs/index.js +0 -1038
- package/node_modules/minipass/dist/commonjs/index.js.map +0 -1
- package/node_modules/minipass/dist/commonjs/package.json +0 -3
- package/node_modules/minipass/dist/esm/index.d.ts +0 -545
- package/node_modules/minipass/dist/esm/index.d.ts.map +0 -1
- package/node_modules/minipass/dist/esm/index.js +0 -1020
- package/node_modules/minipass/dist/esm/index.js.map +0 -1
- package/node_modules/minipass/dist/esm/package.json +0 -3
- package/node_modules/minipass/package.json +0 -77
- package/node_modules/node-domexception/.history/README_20210527203617.md +0 -2
- package/node_modules/node-domexception/.history/README_20210527212714.md +0 -41
- package/node_modules/node-domexception/.history/README_20210527213345.md +0 -36
- package/node_modules/node-domexception/.history/README_20210527213411.md +0 -36
- package/node_modules/node-domexception/.history/README_20210527213803.md +0 -36
- package/node_modules/node-domexception/.history/README_20210527214323.md +0 -38
- package/node_modules/node-domexception/.history/README_20210527214408.md +0 -38
- package/node_modules/node-domexception/.history/index_20210527203842.js +0 -0
- package/node_modules/node-domexception/.history/index_20210527203947.js +0 -8
- package/node_modules/node-domexception/.history/index_20210527204259.js +0 -9
- package/node_modules/node-domexception/.history/index_20210527204418.js +0 -9
- package/node_modules/node-domexception/.history/index_20210527204756.js +0 -11
- package/node_modules/node-domexception/.history/index_20210527204833.js +0 -11
- package/node_modules/node-domexception/.history/index_20210527211208.js +0 -15
- package/node_modules/node-domexception/.history/index_20210527211248.js +0 -15
- package/node_modules/node-domexception/.history/index_20210527212722.js +0 -23
- package/node_modules/node-domexception/.history/index_20210527212731.js +0 -23
- package/node_modules/node-domexception/.history/index_20210527212746.js +0 -15
- package/node_modules/node-domexception/.history/index_20210527212900.js +0 -16
- package/node_modules/node-domexception/.history/index_20210527213022.js +0 -16
- package/node_modules/node-domexception/.history/index_20210527213822.js +0 -16
- package/node_modules/node-domexception/.history/index_20210527213843.js +0 -17
- package/node_modules/node-domexception/.history/index_20210527213852.js +0 -17
- package/node_modules/node-domexception/.history/index_20210527213910.js +0 -16
- package/node_modules/node-domexception/.history/index_20210527214034.js +0 -16
- package/node_modules/node-domexception/.history/index_20210527214643.js +0 -41
- package/node_modules/node-domexception/.history/index_20210527214654.js +0 -41
- package/node_modules/node-domexception/.history/index_20210527214700.js +0 -16
- package/node_modules/node-domexception/.history/package_20210527203733.json +0 -19
- package/node_modules/node-domexception/.history/package_20210527203825.json +0 -16
- package/node_modules/node-domexception/.history/package_20210527204621.json +0 -19
- package/node_modules/node-domexception/.history/package_20210527204913.json +0 -25
- package/node_modules/node-domexception/.history/package_20210527204925.json +0 -25
- package/node_modules/node-domexception/.history/package_20210527205145.json +0 -29
- package/node_modules/node-domexception/.history/package_20210527205156.json +0 -29
- package/node_modules/node-domexception/.history/test_20210527205603.js +0 -0
- package/node_modules/node-domexception/.history/test_20210527205957.js +0 -3
- package/node_modules/node-domexception/.history/test_20210527210021.js +0 -3
- package/node_modules/node-domexception/LICENSE +0 -21
- package/node_modules/node-domexception/README.md +0 -46
- package/node_modules/node-domexception/index.js +0 -16
- package/node_modules/node-domexception/package.json +0 -29
- package/node_modules/node-fetch/@types/index.d.ts +0 -219
- package/node_modules/node-fetch/LICENSE.md +0 -22
- package/node_modules/node-fetch/README.md +0 -872
- package/node_modules/node-fetch/package.json +0 -131
- package/node_modules/node-fetch/src/body.js +0 -397
- package/node_modules/node-fetch/src/errors/abort-error.js +0 -10
- package/node_modules/node-fetch/src/errors/base.js +0 -17
- package/node_modules/node-fetch/src/errors/fetch-error.js +0 -26
- package/node_modules/node-fetch/src/headers.js +0 -267
- package/node_modules/node-fetch/src/index.js +0 -417
- package/node_modules/node-fetch/src/request.js +0 -313
- package/node_modules/node-fetch/src/response.js +0 -160
- package/node_modules/node-fetch/src/utils/get-search.js +0 -9
- package/node_modules/node-fetch/src/utils/is-redirect.js +0 -11
- package/node_modules/node-fetch/src/utils/is.js +0 -87
- package/node_modules/node-fetch/src/utils/multipart-parser.js +0 -432
- package/node_modules/node-fetch/src/utils/referrer.js +0 -340
- package/node_modules/onetime/index.d.ts +0 -64
- package/node_modules/onetime/index.js +0 -44
- package/node_modules/onetime/license +0 -9
- package/node_modules/onetime/package.json +0 -43
- package/node_modules/onetime/readme.md +0 -94
- package/node_modules/ora/index.d.ts +0 -277
- package/node_modules/ora/index.js +0 -407
- package/node_modules/ora/license +0 -9
- package/node_modules/ora/package.json +0 -57
- package/node_modules/ora/readme.md +0 -264
- package/node_modules/path-scurry/LICENSE.md +0 -55
- package/node_modules/path-scurry/README.md +0 -636
- package/node_modules/path-scurry/dist/commonjs/index.d.ts +0 -1115
- package/node_modules/path-scurry/dist/commonjs/index.d.ts.map +0 -1
- package/node_modules/path-scurry/dist/commonjs/index.js +0 -2018
- package/node_modules/path-scurry/dist/commonjs/index.js.map +0 -1
- package/node_modules/path-scurry/dist/commonjs/package.json +0 -3
- package/node_modules/path-scurry/dist/esm/index.d.ts +0 -1115
- package/node_modules/path-scurry/dist/esm/index.d.ts.map +0 -1
- package/node_modules/path-scurry/dist/esm/index.js +0 -1983
- package/node_modules/path-scurry/dist/esm/index.js.map +0 -1
- package/node_modules/path-scurry/dist/esm/package.json +0 -3
- package/node_modules/path-scurry/package.json +0 -72
- package/node_modules/readable-stream/CONTRIBUTING.md +0 -38
- package/node_modules/readable-stream/GOVERNANCE.md +0 -136
- package/node_modules/readable-stream/LICENSE +0 -47
- package/node_modules/readable-stream/README.md +0 -106
- package/node_modules/readable-stream/errors-browser.js +0 -127
- package/node_modules/readable-stream/errors.js +0 -116
- package/node_modules/readable-stream/experimentalWarning.js +0 -17
- package/node_modules/readable-stream/lib/_stream_duplex.js +0 -126
- package/node_modules/readable-stream/lib/_stream_passthrough.js +0 -37
- package/node_modules/readable-stream/lib/_stream_readable.js +0 -1027
- package/node_modules/readable-stream/lib/_stream_transform.js +0 -190
- package/node_modules/readable-stream/lib/_stream_writable.js +0 -641
- package/node_modules/readable-stream/lib/internal/streams/async_iterator.js +0 -180
- package/node_modules/readable-stream/lib/internal/streams/buffer_list.js +0 -183
- package/node_modules/readable-stream/lib/internal/streams/destroy.js +0 -96
- package/node_modules/readable-stream/lib/internal/streams/end-of-stream.js +0 -86
- package/node_modules/readable-stream/lib/internal/streams/from-browser.js +0 -3
- package/node_modules/readable-stream/lib/internal/streams/from.js +0 -52
- package/node_modules/readable-stream/lib/internal/streams/pipeline.js +0 -86
- package/node_modules/readable-stream/lib/internal/streams/state.js +0 -22
- package/node_modules/readable-stream/lib/internal/streams/stream-browser.js +0 -1
- package/node_modules/readable-stream/lib/internal/streams/stream.js +0 -1
- package/node_modules/readable-stream/package.json +0 -68
- package/node_modules/readable-stream/readable-browser.js +0 -9
- package/node_modules/readable-stream/readable.js +0 -16
- package/node_modules/restore-cursor/index.d.ts +0 -13
- package/node_modules/restore-cursor/index.js +0 -9
- package/node_modules/restore-cursor/license +0 -9
- package/node_modules/restore-cursor/package.json +0 -52
- package/node_modules/restore-cursor/readme.md +0 -26
- package/node_modules/safe-buffer/LICENSE +0 -21
- package/node_modules/safe-buffer/README.md +0 -584
- package/node_modules/safe-buffer/index.d.ts +0 -187
- package/node_modules/safe-buffer/index.js +0 -65
- package/node_modules/safe-buffer/package.json +0 -51
- package/node_modules/signal-exit/LICENSE.txt +0 -16
- package/node_modules/signal-exit/README.md +0 -39
- package/node_modules/signal-exit/index.js +0 -202
- package/node_modules/signal-exit/package.json +0 -38
- package/node_modules/signal-exit/signals.js +0 -53
- package/node_modules/string_decoder/LICENSE +0 -48
- package/node_modules/string_decoder/README.md +0 -47
- package/node_modules/string_decoder/lib/string_decoder.js +0 -296
- package/node_modules/string_decoder/package.json +0 -34
- package/node_modules/strip-ansi/index.d.ts +0 -17
- package/node_modules/strip-ansi/index.js +0 -4
- package/node_modules/strip-ansi/license +0 -9
- package/node_modules/strip-ansi/package.json +0 -54
- package/node_modules/strip-ansi/readme.md +0 -46
- package/node_modules/supports-color/browser.js +0 -5
- package/node_modules/supports-color/index.js +0 -135
- package/node_modules/supports-color/license +0 -9
- package/node_modules/supports-color/package.json +0 -53
- package/node_modules/supports-color/readme.md +0 -76
- package/node_modules/util-deprecate/History.md +0 -16
- package/node_modules/util-deprecate/LICENSE +0 -24
- package/node_modules/util-deprecate/README.md +0 -53
- package/node_modules/util-deprecate/browser.js +0 -67
- package/node_modules/util-deprecate/node.js +0 -6
- package/node_modules/util-deprecate/package.json +0 -27
- package/node_modules/wcwidth/.npmignore +0 -1
- package/node_modules/wcwidth/LICENSE +0 -30
- package/node_modules/wcwidth/Readme.md +0 -33
- package/node_modules/wcwidth/combining.js +0 -50
- package/node_modules/wcwidth/docs/index.md +0 -65
- package/node_modules/wcwidth/index.js +0 -99
- package/node_modules/wcwidth/package.json +0 -42
- package/node_modules/wcwidth/test/index.js +0 -64
- package/node_modules/web-streams-polyfill/LICENSE +0 -22
- package/node_modules/web-streams-polyfill/README.md +0 -110
- package/node_modules/web-streams-polyfill/dist/polyfill.es2018.js +0 -4765
- package/node_modules/web-streams-polyfill/dist/polyfill.es2018.js.map +0 -1
- package/node_modules/web-streams-polyfill/dist/polyfill.es2018.min.js +0 -9
- package/node_modules/web-streams-polyfill/dist/polyfill.es2018.min.js.map +0 -1
- package/node_modules/web-streams-polyfill/dist/polyfill.es2018.mjs +0 -4745
- package/node_modules/web-streams-polyfill/dist/polyfill.es2018.mjs.map +0 -1
- package/node_modules/web-streams-polyfill/dist/polyfill.es6.js +0 -4838
- package/node_modules/web-streams-polyfill/dist/polyfill.es6.js.map +0 -1
- package/node_modules/web-streams-polyfill/dist/polyfill.es6.min.js +0 -9
- package/node_modules/web-streams-polyfill/dist/polyfill.es6.min.js.map +0 -1
- package/node_modules/web-streams-polyfill/dist/polyfill.es6.mjs +0 -4818
- package/node_modules/web-streams-polyfill/dist/polyfill.es6.mjs.map +0 -1
- package/node_modules/web-streams-polyfill/dist/polyfill.js +0 -5011
- package/node_modules/web-streams-polyfill/dist/polyfill.js.map +0 -1
- package/node_modules/web-streams-polyfill/dist/polyfill.min.js +0 -9
- package/node_modules/web-streams-polyfill/dist/polyfill.min.js.map +0 -1
- package/node_modules/web-streams-polyfill/dist/polyfill.mjs +0 -4991
- package/node_modules/web-streams-polyfill/dist/polyfill.mjs.map +0 -1
- package/node_modules/web-streams-polyfill/dist/ponyfill.es2018.js +0 -4737
- package/node_modules/web-streams-polyfill/dist/ponyfill.es2018.js.map +0 -1
- package/node_modules/web-streams-polyfill/dist/ponyfill.es2018.mjs +0 -4717
- package/node_modules/web-streams-polyfill/dist/ponyfill.es2018.mjs.map +0 -1
- package/node_modules/web-streams-polyfill/dist/ponyfill.es6.js +0 -4810
- package/node_modules/web-streams-polyfill/dist/ponyfill.es6.js.map +0 -1
- package/node_modules/web-streams-polyfill/dist/ponyfill.es6.mjs +0 -4790
- package/node_modules/web-streams-polyfill/dist/ponyfill.es6.mjs.map +0 -1
- package/node_modules/web-streams-polyfill/dist/ponyfill.js +0 -4983
- package/node_modules/web-streams-polyfill/dist/ponyfill.js.map +0 -1
- package/node_modules/web-streams-polyfill/dist/ponyfill.mjs +0 -4963
- package/node_modules/web-streams-polyfill/dist/ponyfill.mjs.map +0 -1
- package/node_modules/web-streams-polyfill/dist/types/polyfill.d.ts +0 -24
- package/node_modules/web-streams-polyfill/dist/types/ponyfill.d.ts +0 -780
- package/node_modules/web-streams-polyfill/dist/types/ts3.6/polyfill.d.ts +0 -28
- package/node_modules/web-streams-polyfill/dist/types/ts3.6/ponyfill.d.ts +0 -821
- package/node_modules/web-streams-polyfill/dist/types/tsdoc-metadata.json +0 -11
- package/node_modules/web-streams-polyfill/es2018/package.json +0 -14
- package/node_modules/web-streams-polyfill/es6/package.json +0 -14
- package/node_modules/web-streams-polyfill/package.json +0 -83
- package/node_modules/web-streams-polyfill/ponyfill/es2018/package.json +0 -13
- package/node_modules/web-streams-polyfill/ponyfill/es6/package.json +0 -13
- package/node_modules/web-streams-polyfill/ponyfill/package.json +0 -13
- package/src/commands/policy.ts +0 -146
- package/test-policy.md +0 -55
- package/test_cli.ts +0 -16
- package/version.json +0 -18
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "ansi-styles",
|
|
3
|
-
"version": "4.3.0",
|
|
4
|
-
"description": "ANSI escape codes for styling strings in the terminal",
|
|
5
|
-
"license": "MIT",
|
|
6
|
-
"repository": "chalk/ansi-styles",
|
|
7
|
-
"funding": "https://github.com/chalk/ansi-styles?sponsor=1",
|
|
8
|
-
"author": {
|
|
9
|
-
"name": "Sindre Sorhus",
|
|
10
|
-
"email": "sindresorhus@gmail.com",
|
|
11
|
-
"url": "sindresorhus.com"
|
|
12
|
-
},
|
|
13
|
-
"engines": {
|
|
14
|
-
"node": ">=8"
|
|
15
|
-
},
|
|
16
|
-
"scripts": {
|
|
17
|
-
"test": "xo && ava && tsd",
|
|
18
|
-
"screenshot": "svg-term --command='node screenshot' --out=screenshot.svg --padding=3 --width=55 --height=3 --at=1000 --no-cursor"
|
|
19
|
-
},
|
|
20
|
-
"files": [
|
|
21
|
-
"index.js",
|
|
22
|
-
"index.d.ts"
|
|
23
|
-
],
|
|
24
|
-
"keywords": [
|
|
25
|
-
"ansi",
|
|
26
|
-
"styles",
|
|
27
|
-
"color",
|
|
28
|
-
"colour",
|
|
29
|
-
"colors",
|
|
30
|
-
"terminal",
|
|
31
|
-
"console",
|
|
32
|
-
"cli",
|
|
33
|
-
"string",
|
|
34
|
-
"tty",
|
|
35
|
-
"escape",
|
|
36
|
-
"formatting",
|
|
37
|
-
"rgb",
|
|
38
|
-
"256",
|
|
39
|
-
"shell",
|
|
40
|
-
"xterm",
|
|
41
|
-
"log",
|
|
42
|
-
"logging",
|
|
43
|
-
"command-line",
|
|
44
|
-
"text"
|
|
45
|
-
],
|
|
46
|
-
"dependencies": {
|
|
47
|
-
"color-convert": "^2.0.1"
|
|
48
|
-
},
|
|
49
|
-
"devDependencies": {
|
|
50
|
-
"@types/color-convert": "^1.9.0",
|
|
51
|
-
"ava": "^2.3.0",
|
|
52
|
-
"svg-term-cli": "^2.1.1",
|
|
53
|
-
"tsd": "^0.11.0",
|
|
54
|
-
"xo": "^0.25.3"
|
|
55
|
-
}
|
|
56
|
-
}
|
|
@@ -1,152 +0,0 @@
|
|
|
1
|
-
# ansi-styles [](https://travis-ci.org/chalk/ansi-styles)
|
|
2
|
-
|
|
3
|
-
> [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code#Colors_and_Styles) for styling strings in the terminal
|
|
4
|
-
|
|
5
|
-
You probably want the higher-level [chalk](https://github.com/chalk/chalk) module for styling your strings.
|
|
6
|
-
|
|
7
|
-
<img src="screenshot.svg" width="900">
|
|
8
|
-
|
|
9
|
-
## Install
|
|
10
|
-
|
|
11
|
-
```
|
|
12
|
-
$ npm install ansi-styles
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
## Usage
|
|
16
|
-
|
|
17
|
-
```js
|
|
18
|
-
const style = require('ansi-styles');
|
|
19
|
-
|
|
20
|
-
console.log(`${style.green.open}Hello world!${style.green.close}`);
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
// Color conversion between 16/256/truecolor
|
|
24
|
-
// NOTE: If conversion goes to 16 colors or 256 colors, the original color
|
|
25
|
-
// may be degraded to fit that color palette. This means terminals
|
|
26
|
-
// that do not support 16 million colors will best-match the
|
|
27
|
-
// original color.
|
|
28
|
-
console.log(style.bgColor.ansi.hsl(120, 80, 72) + 'Hello world!' + style.bgColor.close);
|
|
29
|
-
console.log(style.color.ansi256.rgb(199, 20, 250) + 'Hello world!' + style.color.close);
|
|
30
|
-
console.log(style.color.ansi16m.hex('#abcdef') + 'Hello world!' + style.color.close);
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
## API
|
|
34
|
-
|
|
35
|
-
Each style has an `open` and `close` property.
|
|
36
|
-
|
|
37
|
-
## Styles
|
|
38
|
-
|
|
39
|
-
### Modifiers
|
|
40
|
-
|
|
41
|
-
- `reset`
|
|
42
|
-
- `bold`
|
|
43
|
-
- `dim`
|
|
44
|
-
- `italic` *(Not widely supported)*
|
|
45
|
-
- `underline`
|
|
46
|
-
- `inverse`
|
|
47
|
-
- `hidden`
|
|
48
|
-
- `strikethrough` *(Not widely supported)*
|
|
49
|
-
|
|
50
|
-
### Colors
|
|
51
|
-
|
|
52
|
-
- `black`
|
|
53
|
-
- `red`
|
|
54
|
-
- `green`
|
|
55
|
-
- `yellow`
|
|
56
|
-
- `blue`
|
|
57
|
-
- `magenta`
|
|
58
|
-
- `cyan`
|
|
59
|
-
- `white`
|
|
60
|
-
- `blackBright` (alias: `gray`, `grey`)
|
|
61
|
-
- `redBright`
|
|
62
|
-
- `greenBright`
|
|
63
|
-
- `yellowBright`
|
|
64
|
-
- `blueBright`
|
|
65
|
-
- `magentaBright`
|
|
66
|
-
- `cyanBright`
|
|
67
|
-
- `whiteBright`
|
|
68
|
-
|
|
69
|
-
### Background colors
|
|
70
|
-
|
|
71
|
-
- `bgBlack`
|
|
72
|
-
- `bgRed`
|
|
73
|
-
- `bgGreen`
|
|
74
|
-
- `bgYellow`
|
|
75
|
-
- `bgBlue`
|
|
76
|
-
- `bgMagenta`
|
|
77
|
-
- `bgCyan`
|
|
78
|
-
- `bgWhite`
|
|
79
|
-
- `bgBlackBright` (alias: `bgGray`, `bgGrey`)
|
|
80
|
-
- `bgRedBright`
|
|
81
|
-
- `bgGreenBright`
|
|
82
|
-
- `bgYellowBright`
|
|
83
|
-
- `bgBlueBright`
|
|
84
|
-
- `bgMagentaBright`
|
|
85
|
-
- `bgCyanBright`
|
|
86
|
-
- `bgWhiteBright`
|
|
87
|
-
|
|
88
|
-
## Advanced usage
|
|
89
|
-
|
|
90
|
-
By default, you get a map of styles, but the styles are also available as groups. They are non-enumerable so they don't show up unless you access them explicitly. This makes it easier to expose only a subset in a higher-level module.
|
|
91
|
-
|
|
92
|
-
- `style.modifier`
|
|
93
|
-
- `style.color`
|
|
94
|
-
- `style.bgColor`
|
|
95
|
-
|
|
96
|
-
###### Example
|
|
97
|
-
|
|
98
|
-
```js
|
|
99
|
-
console.log(style.color.green.open);
|
|
100
|
-
```
|
|
101
|
-
|
|
102
|
-
Raw escape codes (i.e. without the CSI escape prefix `\u001B[` and render mode postfix `m`) are available under `style.codes`, which returns a `Map` with the open codes as keys and close codes as values.
|
|
103
|
-
|
|
104
|
-
###### Example
|
|
105
|
-
|
|
106
|
-
```js
|
|
107
|
-
console.log(style.codes.get(36));
|
|
108
|
-
//=> 39
|
|
109
|
-
```
|
|
110
|
-
|
|
111
|
-
## [256 / 16 million (TrueColor) support](https://gist.github.com/XVilka/8346728)
|
|
112
|
-
|
|
113
|
-
`ansi-styles` uses the [`color-convert`](https://github.com/Qix-/color-convert) package to allow for converting between various colors and ANSI escapes, with support for 256 and 16 million colors.
|
|
114
|
-
|
|
115
|
-
The following color spaces from `color-convert` are supported:
|
|
116
|
-
|
|
117
|
-
- `rgb`
|
|
118
|
-
- `hex`
|
|
119
|
-
- `keyword`
|
|
120
|
-
- `hsl`
|
|
121
|
-
- `hsv`
|
|
122
|
-
- `hwb`
|
|
123
|
-
- `ansi`
|
|
124
|
-
- `ansi256`
|
|
125
|
-
|
|
126
|
-
To use these, call the associated conversion function with the intended output, for example:
|
|
127
|
-
|
|
128
|
-
```js
|
|
129
|
-
style.color.ansi.rgb(100, 200, 15); // RGB to 16 color ansi foreground code
|
|
130
|
-
style.bgColor.ansi.rgb(100, 200, 15); // RGB to 16 color ansi background code
|
|
131
|
-
|
|
132
|
-
style.color.ansi256.hsl(120, 100, 60); // HSL to 256 color ansi foreground code
|
|
133
|
-
style.bgColor.ansi256.hsl(120, 100, 60); // HSL to 256 color ansi foreground code
|
|
134
|
-
|
|
135
|
-
style.color.ansi16m.hex('#C0FFEE'); // Hex (RGB) to 16 million color foreground code
|
|
136
|
-
style.bgColor.ansi16m.hex('#C0FFEE'); // Hex (RGB) to 16 million color background code
|
|
137
|
-
```
|
|
138
|
-
|
|
139
|
-
## Related
|
|
140
|
-
|
|
141
|
-
- [ansi-escapes](https://github.com/sindresorhus/ansi-escapes) - ANSI escape codes for manipulating the terminal
|
|
142
|
-
|
|
143
|
-
## Maintainers
|
|
144
|
-
|
|
145
|
-
- [Sindre Sorhus](https://github.com/sindresorhus)
|
|
146
|
-
- [Josh Junon](https://github.com/qix-)
|
|
147
|
-
|
|
148
|
-
## For enterprise
|
|
149
|
-
|
|
150
|
-
Available as part of the Tidelift Subscription.
|
|
151
|
-
|
|
152
|
-
The maintainers of `ansi-styles` and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-ansi-styles?utm_source=npm-ansi-styles&utm_medium=referral&utm_campaign=enterprise&utm_term=repo)
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
(MIT)
|
|
2
|
-
|
|
3
|
-
Original code Copyright Julian Gruber <julian@juliangruber.com>
|
|
4
|
-
|
|
5
|
-
Port to TypeScript Copyright Isaac Z. Schlueter <i@izs.me>
|
|
6
|
-
|
|
7
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
8
|
-
this software and associated documentation files (the "Software"), to deal in
|
|
9
|
-
the Software without restriction, including without limitation the rights to
|
|
10
|
-
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
|
11
|
-
of the Software, and to permit persons to whom the Software is furnished to do
|
|
12
|
-
so, subject to the following conditions:
|
|
13
|
-
|
|
14
|
-
The above copyright notice and this permission notice shall be included in all
|
|
15
|
-
copies or substantial portions of the Software.
|
|
16
|
-
|
|
17
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
18
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
19
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
20
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
21
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
22
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
23
|
-
SOFTWARE.
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
# balanced-match
|
|
2
|
-
|
|
3
|
-
Match balanced string pairs, like `{` and `}` or `<b>` and
|
|
4
|
-
`</b>`. Supports regular expressions as well!
|
|
5
|
-
|
|
6
|
-
## Example
|
|
7
|
-
|
|
8
|
-
Get the first matching pair of braces:
|
|
9
|
-
|
|
10
|
-
```js
|
|
11
|
-
import { balanced } from 'balanced-match'
|
|
12
|
-
|
|
13
|
-
console.log(balanced('{', '}', 'pre{in{nested}}post'))
|
|
14
|
-
console.log(balanced('{', '}', 'pre{first}between{second}post'))
|
|
15
|
-
console.log(
|
|
16
|
-
balanced(/\s+\{\s+/, /\s+\}\s+/, 'pre { in{nest} } post'),
|
|
17
|
-
)
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
The matches are:
|
|
21
|
-
|
|
22
|
-
```bash
|
|
23
|
-
$ node example.js
|
|
24
|
-
{ start: 3, end: 14, pre: 'pre', body: 'in{nested}', post: 'post' }
|
|
25
|
-
{ start: 3,
|
|
26
|
-
end: 9,
|
|
27
|
-
pre: 'pre',
|
|
28
|
-
body: 'first',
|
|
29
|
-
post: 'between{second}post' }
|
|
30
|
-
{ start: 3, end: 17, pre: 'pre', body: 'in{nest}', post: 'post' }
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
## API
|
|
34
|
-
|
|
35
|
-
### const m = balanced(a, b, str)
|
|
36
|
-
|
|
37
|
-
For the first non-nested matching pair of `a` and `b` in `str`, return an
|
|
38
|
-
object with those keys:
|
|
39
|
-
|
|
40
|
-
- **start** the index of the first match of `a`
|
|
41
|
-
- **end** the index of the matching `b`
|
|
42
|
-
- **pre** the preamble, `a` and `b` not included
|
|
43
|
-
- **body** the match, `a` and `b` not included
|
|
44
|
-
- **post** the postscript, `a` and `b` not included
|
|
45
|
-
|
|
46
|
-
If there's no match, `undefined` will be returned.
|
|
47
|
-
|
|
48
|
-
If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `['{', 'a', '']` and `{a}}` will match `['', 'a', '}']`.
|
|
49
|
-
|
|
50
|
-
### const r = balanced.range(a, b, str)
|
|
51
|
-
|
|
52
|
-
For the first non-nested matching pair of `a` and `b` in `str`, return an
|
|
53
|
-
array with indexes: `[ <a index>, <b index> ]`.
|
|
54
|
-
|
|
55
|
-
If there's no match, `undefined` will be returned.
|
|
56
|
-
|
|
57
|
-
If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `[ 1, 3 ]` and `{a}}` will match `[0, 2]`.
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export declare const balanced: (a: string | RegExp, b: string | RegExp, str: string) => false | {
|
|
2
|
-
start: number;
|
|
3
|
-
end: number;
|
|
4
|
-
pre: string;
|
|
5
|
-
body: string;
|
|
6
|
-
post: string;
|
|
7
|
-
} | undefined;
|
|
8
|
-
export declare const range: (a: string, b: string, str: string) => undefined | [number, number];
|
|
9
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,QAAQ,GACnB,GAAG,MAAM,GAAG,MAAM,EAClB,GAAG,MAAM,GAAG,MAAM,EAClB,KAAK,MAAM;;;;;;aAgBZ,CAAA;AAOD,eAAO,MAAM,KAAK,GAChB,GAAG,MAAM,EACT,GAAG,MAAM,EACT,KAAK,MAAM,KACV,SAAS,GAAG,CAAC,MAAM,EAAE,MAAM,CA2C7B,CAAA"}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.range = exports.balanced = void 0;
|
|
4
|
-
const balanced = (a, b, str) => {
|
|
5
|
-
const ma = a instanceof RegExp ? maybeMatch(a, str) : a;
|
|
6
|
-
const mb = b instanceof RegExp ? maybeMatch(b, str) : b;
|
|
7
|
-
const r = ma !== null && mb != null && (0, exports.range)(ma, mb, str);
|
|
8
|
-
return (r && {
|
|
9
|
-
start: r[0],
|
|
10
|
-
end: r[1],
|
|
11
|
-
pre: str.slice(0, r[0]),
|
|
12
|
-
body: str.slice(r[0] + ma.length, r[1]),
|
|
13
|
-
post: str.slice(r[1] + mb.length),
|
|
14
|
-
});
|
|
15
|
-
};
|
|
16
|
-
exports.balanced = balanced;
|
|
17
|
-
const maybeMatch = (reg, str) => {
|
|
18
|
-
const m = str.match(reg);
|
|
19
|
-
return m ? m[0] : null;
|
|
20
|
-
};
|
|
21
|
-
const range = (a, b, str) => {
|
|
22
|
-
let begs, beg, left, right = undefined, result;
|
|
23
|
-
let ai = str.indexOf(a);
|
|
24
|
-
let bi = str.indexOf(b, ai + 1);
|
|
25
|
-
let i = ai;
|
|
26
|
-
if (ai >= 0 && bi > 0) {
|
|
27
|
-
if (a === b) {
|
|
28
|
-
return [ai, bi];
|
|
29
|
-
}
|
|
30
|
-
begs = [];
|
|
31
|
-
left = str.length;
|
|
32
|
-
while (i >= 0 && !result) {
|
|
33
|
-
if (i === ai) {
|
|
34
|
-
begs.push(i);
|
|
35
|
-
ai = str.indexOf(a, i + 1);
|
|
36
|
-
}
|
|
37
|
-
else if (begs.length === 1) {
|
|
38
|
-
const r = begs.pop();
|
|
39
|
-
if (r !== undefined)
|
|
40
|
-
result = [r, bi];
|
|
41
|
-
}
|
|
42
|
-
else {
|
|
43
|
-
beg = begs.pop();
|
|
44
|
-
if (beg !== undefined && beg < left) {
|
|
45
|
-
left = beg;
|
|
46
|
-
right = bi;
|
|
47
|
-
}
|
|
48
|
-
bi = str.indexOf(b, i + 1);
|
|
49
|
-
}
|
|
50
|
-
i = ai < bi && ai >= 0 ? ai : bi;
|
|
51
|
-
}
|
|
52
|
-
if (begs.length && right !== undefined) {
|
|
53
|
-
result = [left, right];
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
return result;
|
|
57
|
-
};
|
|
58
|
-
exports.range = range;
|
|
59
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAO,MAAM,QAAQ,GAAG,CACtB,CAAkB,EAClB,CAAkB,EAClB,GAAW,EACX,EAAE;IACF,MAAM,EAAE,GAAG,CAAC,YAAY,MAAM,CAA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,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAA;QAClC,CAAC;QAED,IAAI,IAAI,CAAC,MAAM,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACvC,MAAM,GAAG,CAAC,IAAI,EAAE,KAAK,CAAC,CAAA;QACxB,CAAC;IACH,CAAC;IAED,OAAO,MAAM,CAAA;AACf,CAAC,CAAA;AA/CY,QAAA,KAAK,SA+CjB","sourcesContent":["export const balanced = (\n a: string | RegExp,\n b: string | RegExp,\n str: string,\n) => {\n const ma = a instanceof RegExp ? maybeMatch(a, str) : a\n const mb = b instanceof RegExp ? maybeMatch(b, str) : b\n\n const r = ma !== null && mb != null && range(ma, mb, str)\n\n return (\n r && {\n start: r[0],\n end: r[1],\n pre: str.slice(0, r[0]),\n body: str.slice(r[0] + ma.length, r[1]),\n post: str.slice(r[1] + mb.length),\n }\n )\n}\n\nconst maybeMatch = (reg: RegExp, str: string) => {\n const m = str.match(reg)\n return m ? m[0] : null\n}\n\nexport const range = (\n a: string,\n b: string,\n str: string,\n): undefined | [number, number] => {\n let begs: number[],\n beg: number | undefined,\n left: number,\n right: number | undefined = undefined,\n result: undefined | [number, number]\n let ai = str.indexOf(a)\n let bi = str.indexOf(b, ai + 1)\n let i = ai\n\n if (ai >= 0 && bi > 0) {\n if (a === b) {\n return [ai, bi]\n }\n begs = []\n left = str.length\n\n while (i >= 0 && !result) {\n if (i === ai) {\n begs.push(i)\n ai = str.indexOf(a, i + 1)\n } else if (begs.length === 1) {\n const r = begs.pop()\n if (r !== undefined) result = [r, bi]\n } else {\n beg = begs.pop()\n if (beg !== undefined && beg < left) {\n left = beg\n right = bi\n }\n\n bi = str.indexOf(b, i + 1)\n }\n\n i = ai < bi && ai >= 0 ? ai : bi\n }\n\n if (begs.length && right !== undefined) {\n result = [left, right]\n }\n }\n\n return result\n}\n"]}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export declare const balanced: (a: string | RegExp, b: string | RegExp, str: string) => false | {
|
|
2
|
-
start: number;
|
|
3
|
-
end: number;
|
|
4
|
-
pre: string;
|
|
5
|
-
body: string;
|
|
6
|
-
post: string;
|
|
7
|
-
} | undefined;
|
|
8
|
-
export declare const range: (a: string, b: string, str: string) => undefined | [number, number];
|
|
9
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,QAAQ,GACnB,GAAG,MAAM,GAAG,MAAM,EAClB,GAAG,MAAM,GAAG,MAAM,EAClB,KAAK,MAAM;;;;;;aAgBZ,CAAA;AAOD,eAAO,MAAM,KAAK,GAChB,GAAG,MAAM,EACT,GAAG,MAAM,EACT,KAAK,MAAM,KACV,SAAS,GAAG,CAAC,MAAM,EAAE,MAAM,CA2C7B,CAAA"}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
export const balanced = (a, b, str) => {
|
|
2
|
-
const ma = a instanceof RegExp ? maybeMatch(a, str) : a;
|
|
3
|
-
const mb = b instanceof RegExp ? maybeMatch(b, str) : b;
|
|
4
|
-
const r = ma !== null && mb != null && range(ma, mb, str);
|
|
5
|
-
return (r && {
|
|
6
|
-
start: r[0],
|
|
7
|
-
end: r[1],
|
|
8
|
-
pre: str.slice(0, r[0]),
|
|
9
|
-
body: str.slice(r[0] + ma.length, r[1]),
|
|
10
|
-
post: str.slice(r[1] + mb.length),
|
|
11
|
-
});
|
|
12
|
-
};
|
|
13
|
-
const maybeMatch = (reg, str) => {
|
|
14
|
-
const m = str.match(reg);
|
|
15
|
-
return m ? m[0] : null;
|
|
16
|
-
};
|
|
17
|
-
export const range = (a, b, str) => {
|
|
18
|
-
let begs, beg, left, right = undefined, result;
|
|
19
|
-
let ai = str.indexOf(a);
|
|
20
|
-
let bi = str.indexOf(b, ai + 1);
|
|
21
|
-
let i = ai;
|
|
22
|
-
if (ai >= 0 && bi > 0) {
|
|
23
|
-
if (a === b) {
|
|
24
|
-
return [ai, bi];
|
|
25
|
-
}
|
|
26
|
-
begs = [];
|
|
27
|
-
left = str.length;
|
|
28
|
-
while (i >= 0 && !result) {
|
|
29
|
-
if (i === ai) {
|
|
30
|
-
begs.push(i);
|
|
31
|
-
ai = str.indexOf(a, i + 1);
|
|
32
|
-
}
|
|
33
|
-
else if (begs.length === 1) {
|
|
34
|
-
const r = begs.pop();
|
|
35
|
-
if (r !== undefined)
|
|
36
|
-
result = [r, bi];
|
|
37
|
-
}
|
|
38
|
-
else {
|
|
39
|
-
beg = begs.pop();
|
|
40
|
-
if (beg !== undefined && beg < left) {
|
|
41
|
-
left = beg;
|
|
42
|
-
right = bi;
|
|
43
|
-
}
|
|
44
|
-
bi = str.indexOf(b, i + 1);
|
|
45
|
-
}
|
|
46
|
-
i = ai < bi && ai >= 0 ? ai : bi;
|
|
47
|
-
}
|
|
48
|
-
if (begs.length && right !== undefined) {
|
|
49
|
-
result = [left, right];
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
return result;
|
|
53
|
-
};
|
|
54
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,QAAQ,GAAG,CACtB,CAAkB,EAClB,CAAkB,EAClB,GAAW,EACX,EAAE;IACF,MAAM,EAAE,GAAG,CAAC,YAAY,MAAM,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;IACvD,MAAM,EAAE,GAAG,CAAC,YAAY,MAAM,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;IAEvD,MAAM,CAAC,GAAG,EAAE,KAAK,IAAI,IAAI,EAAE,IAAI,IAAI,IAAI,KAAK,CAAC,EAAE,EAAE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maybeMatch(a, str) : a\n const mb = b instanceof RegExp ? maybeMatch(b, str) : b\n\n const r = ma !== null && mb != null && range(ma, mb, str)\n\n return (\n r && {\n start: r[0],\n end: r[1],\n pre: str.slice(0, r[0]),\n body: str.slice(r[0] + ma.length, r[1]),\n post: str.slice(r[1] + mb.length),\n }\n )\n}\n\nconst maybeMatch = (reg: RegExp, str: string) => {\n const m = str.match(reg)\n return m ? m[0] : null\n}\n\nexport const range = (\n a: string,\n b: string,\n str: string,\n): undefined | [number, number] => {\n let begs: number[],\n beg: number | undefined,\n left: number,\n right: number | undefined = undefined,\n result: undefined | [number, number]\n let ai = str.indexOf(a)\n let bi = str.indexOf(b, ai + 1)\n let i = ai\n\n if (ai >= 0 && bi > 0) {\n if (a === b) {\n return [ai, bi]\n }\n begs = []\n left = str.length\n\n while (i >= 0 && !result) {\n if (i === ai) {\n begs.push(i)\n ai = str.indexOf(a, i + 1)\n } else if (begs.length === 1) {\n const r = begs.pop()\n if (r !== undefined) result = [r, bi]\n } else {\n beg = begs.pop()\n if (beg !== undefined && beg < left) {\n left = beg\n right = bi\n }\n\n bi = str.indexOf(b, i + 1)\n }\n\n i = ai < bi && ai >= 0 ? ai : bi\n }\n\n if (begs.length && right !== undefined) {\n result = [left, right]\n }\n }\n\n return result\n}\n"]}
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "balanced-match",
|
|
3
|
-
"description": "Match balanced character pairs, like \"{\" and \"}\"",
|
|
4
|
-
"version": "4.0.4",
|
|
5
|
-
"files": [
|
|
6
|
-
"dist"
|
|
7
|
-
],
|
|
8
|
-
"repository": {
|
|
9
|
-
"type": "git",
|
|
10
|
-
"url": "git://github.com/juliangruber/balanced-match.git"
|
|
11
|
-
},
|
|
12
|
-
"exports": {
|
|
13
|
-
"./package.json": "./package.json",
|
|
14
|
-
".": {
|
|
15
|
-
"import": {
|
|
16
|
-
"types": "./dist/esm/index.d.ts",
|
|
17
|
-
"default": "./dist/esm/index.js"
|
|
18
|
-
},
|
|
19
|
-
"require": {
|
|
20
|
-
"types": "./dist/commonjs/index.d.ts",
|
|
21
|
-
"default": "./dist/commonjs/index.js"
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
},
|
|
25
|
-
"type": "module",
|
|
26
|
-
"scripts": {
|
|
27
|
-
"preversion": "npm test",
|
|
28
|
-
"postversion": "npm publish",
|
|
29
|
-
"prepublishOnly": "git push origin --follow-tags",
|
|
30
|
-
"prepare": "tshy",
|
|
31
|
-
"pretest": "npm run prepare",
|
|
32
|
-
"presnap": "npm run prepare",
|
|
33
|
-
"test": "tap",
|
|
34
|
-
"snap": "tap",
|
|
35
|
-
"format": "prettier --write .",
|
|
36
|
-
"benchmark": "node benchmark/index.js",
|
|
37
|
-
"typedoc": "typedoc --tsconfig .tshy/esm.json ./src/*.ts"
|
|
38
|
-
},
|
|
39
|
-
"devDependencies": {
|
|
40
|
-
"@types/brace-expansion": "^1.1.2",
|
|
41
|
-
"@types/node": "^25.2.1",
|
|
42
|
-
"mkdirp": "^3.0.1",
|
|
43
|
-
"prettier": "^3.3.2",
|
|
44
|
-
"tap": "^21.6.2",
|
|
45
|
-
"tshy": "^3.0.2",
|
|
46
|
-
"typedoc": "^0.28.5"
|
|
47
|
-
},
|
|
48
|
-
"keywords": [
|
|
49
|
-
"match",
|
|
50
|
-
"regexp",
|
|
51
|
-
"test",
|
|
52
|
-
"balanced",
|
|
53
|
-
"parse"
|
|
54
|
-
],
|
|
55
|
-
"license": "MIT",
|
|
56
|
-
"engines": {
|
|
57
|
-
"node": "18 || 20 || >=22"
|
|
58
|
-
},
|
|
59
|
-
"tshy": {
|
|
60
|
-
"exports": {
|
|
61
|
-
"./package.json": "./package.json",
|
|
62
|
-
".": "./src/index.ts"
|
|
63
|
-
}
|
|
64
|
-
},
|
|
65
|
-
"main": "./dist/commonjs/index.js",
|
|
66
|
-
"types": "./dist/commonjs/index.d.ts",
|
|
67
|
-
"module": "./dist/esm/index.js"
|
|
68
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
The MIT License (MIT)
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2014 Jameson Little
|
|
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,34 +0,0 @@
|
|
|
1
|
-
base64-js
|
|
2
|
-
=========
|
|
3
|
-
|
|
4
|
-
`base64-js` does basic base64 encoding/decoding in pure JS.
|
|
5
|
-
|
|
6
|
-
[](http://travis-ci.org/beatgammit/base64-js)
|
|
7
|
-
|
|
8
|
-
Many browsers already have base64 encoding/decoding functionality, but it is for text data, not all-purpose binary data.
|
|
9
|
-
|
|
10
|
-
Sometimes encoding/decoding binary data in the browser is useful, and that is what this module does.
|
|
11
|
-
|
|
12
|
-
## install
|
|
13
|
-
|
|
14
|
-
With [npm](https://npmjs.org) do:
|
|
15
|
-
|
|
16
|
-
`npm install base64-js` and `var base64js = require('base64-js')`
|
|
17
|
-
|
|
18
|
-
For use in web browsers do:
|
|
19
|
-
|
|
20
|
-
`<script src="base64js.min.js"></script>`
|
|
21
|
-
|
|
22
|
-
[Get supported base64-js with the Tidelift Subscription](https://tidelift.com/subscription/pkg/npm-base64-js?utm_source=npm-base64-js&utm_medium=referral&utm_campaign=readme)
|
|
23
|
-
|
|
24
|
-
## methods
|
|
25
|
-
|
|
26
|
-
`base64js` has three exposed functions, `byteLength`, `toByteArray` and `fromByteArray`, which both take a single argument.
|
|
27
|
-
|
|
28
|
-
* `byteLength` - Takes a base64 string and returns length of byte array
|
|
29
|
-
* `toByteArray` - Takes a base64 string and returns a byte array
|
|
30
|
-
* `fromByteArray` - Takes a byte array and returns a base64 string
|
|
31
|
-
|
|
32
|
-
## license
|
|
33
|
-
|
|
34
|
-
MIT
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(function(a){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=a();else if("function"==typeof define&&define.amd)define([],a);else{var b;b="undefined"==typeof window?"undefined"==typeof global?"undefined"==typeof self?this:self:global:window,b.base64js=a()}})(function(){return function(){function b(d,e,g){function a(j,i){if(!e[j]){if(!d[j]){var f="function"==typeof require&&require;if(!i&&f)return f(j,!0);if(h)return h(j,!0);var c=new Error("Cannot find module '"+j+"'");throw c.code="MODULE_NOT_FOUND",c}var k=e[j]={exports:{}};d[j][0].call(k.exports,function(b){var c=d[j][1][b];return a(c||b)},k,k.exports,b,d,e,g)}return e[j].exports}for(var h="function"==typeof require&&require,c=0;c<g.length;c++)a(g[c]);return a}return b}()({"/":[function(a,b,c){'use strict';function d(a){var b=a.length;if(0<b%4)throw new Error("Invalid string. Length must be a multiple of 4");var c=a.indexOf("=");-1===c&&(c=b);var d=c===b?0:4-c%4;return[c,d]}function e(a,b,c){return 3*(b+c)/4-c}function f(a){var b,c,f=d(a),g=f[0],h=f[1],j=new m(e(a,g,h)),k=0,n=0<h?g-4:g;for(c=0;c<n;c+=4)b=l[a.charCodeAt(c)]<<18|l[a.charCodeAt(c+1)]<<12|l[a.charCodeAt(c+2)]<<6|l[a.charCodeAt(c+3)],j[k++]=255&b>>16,j[k++]=255&b>>8,j[k++]=255&b;return 2===h&&(b=l[a.charCodeAt(c)]<<2|l[a.charCodeAt(c+1)]>>4,j[k++]=255&b),1===h&&(b=l[a.charCodeAt(c)]<<10|l[a.charCodeAt(c+1)]<<4|l[a.charCodeAt(c+2)]>>2,j[k++]=255&b>>8,j[k++]=255&b),j}function g(a){return k[63&a>>18]+k[63&a>>12]+k[63&a>>6]+k[63&a]}function h(a,b,c){for(var d,e=[],f=b;f<c;f+=3)d=(16711680&a[f]<<16)+(65280&a[f+1]<<8)+(255&a[f+2]),e.push(g(d));return e.join("")}function j(a){for(var b,c=a.length,d=c%3,e=[],f=16383,g=0,j=c-d;g<j;g+=f)e.push(h(a,g,g+f>j?j:g+f));return 1===d?(b=a[c-1],e.push(k[b>>2]+k[63&b<<4]+"==")):2===d&&(b=(a[c-2]<<8)+a[c-1],e.push(k[b>>10]+k[63&b>>4]+k[63&b<<2]+"=")),e.join("")}c.byteLength=function(a){var b=d(a),c=b[0],e=b[1];return 3*(c+e)/4-e},c.toByteArray=f,c.fromByteArray=j;for(var k=[],l=[],m="undefined"==typeof Uint8Array?Array:Uint8Array,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0,p=n.length;o<p;++o)k[o]=n[o],l[n.charCodeAt(o)]=o;l[45]=62,l[95]=63},{}]},{},[])("/")});
|