korext 0.1.0
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/bin/korext.js +278 -0
- package/korext-cli-0.1.0.tgz +0 -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/ansi-styles/index.d.ts +345 -0
- package/node_modules/ansi-styles/index.js +163 -0
- package/node_modules/ansi-styles/license +9 -0
- package/node_modules/ansi-styles/package.json +56 -0
- package/node_modules/ansi-styles/readme.md +152 -0
- package/node_modules/balanced-match/LICENSE.md +23 -0
- package/node_modules/balanced-match/README.md +57 -0
- package/node_modules/balanced-match/dist/commonjs/index.d.ts +9 -0
- package/node_modules/balanced-match/dist/commonjs/index.d.ts.map +1 -0
- package/node_modules/balanced-match/dist/commonjs/index.js +59 -0
- package/node_modules/balanced-match/dist/commonjs/index.js.map +1 -0
- package/node_modules/balanced-match/dist/commonjs/package.json +3 -0
- package/node_modules/balanced-match/dist/esm/index.d.ts +9 -0
- package/node_modules/balanced-match/dist/esm/index.d.ts.map +1 -0
- package/node_modules/balanced-match/dist/esm/index.js +54 -0
- package/node_modules/balanced-match/dist/esm/index.js.map +1 -0
- package/node_modules/balanced-match/dist/esm/package.json +3 -0
- package/node_modules/balanced-match/package.json +68 -0
- package/node_modules/base64-js/LICENSE +21 -0
- package/node_modules/base64-js/README.md +34 -0
- package/node_modules/base64-js/base64js.min.js +1 -0
- package/node_modules/base64-js/index.d.ts +3 -0
- package/node_modules/base64-js/index.js +150 -0
- package/node_modules/base64-js/package.json +47 -0
- package/node_modules/bl/.travis.yml +17 -0
- package/node_modules/bl/BufferList.js +396 -0
- package/node_modules/bl/LICENSE.md +13 -0
- package/node_modules/bl/README.md +247 -0
- package/node_modules/bl/bl.js +84 -0
- package/node_modules/bl/package.json +37 -0
- package/node_modules/bl/test/convert.js +21 -0
- package/node_modules/bl/test/indexOf.js +492 -0
- package/node_modules/bl/test/isBufferList.js +32 -0
- package/node_modules/bl/test/test.js +869 -0
- package/node_modules/brace-expansion/LICENSE +23 -0
- package/node_modules/brace-expansion/README.md +94 -0
- package/node_modules/brace-expansion/dist/commonjs/index.d.ts +6 -0
- package/node_modules/brace-expansion/dist/commonjs/index.d.ts.map +1 -0
- package/node_modules/brace-expansion/dist/commonjs/index.js +199 -0
- package/node_modules/brace-expansion/dist/commonjs/index.js.map +1 -0
- package/node_modules/brace-expansion/dist/commonjs/package.json +3 -0
- package/node_modules/brace-expansion/dist/esm/index.d.ts +6 -0
- package/node_modules/brace-expansion/dist/esm/index.d.ts.map +1 -0
- package/node_modules/brace-expansion/dist/esm/index.js +195 -0
- package/node_modules/brace-expansion/dist/esm/index.js.map +1 -0
- package/node_modules/brace-expansion/dist/esm/package.json +3 -0
- package/node_modules/brace-expansion/package.json +64 -0
- package/node_modules/buffer/AUTHORS.md +70 -0
- package/node_modules/buffer/LICENSE +21 -0
- package/node_modules/buffer/README.md +410 -0
- package/node_modules/buffer/index.d.ts +186 -0
- package/node_modules/buffer/index.js +1817 -0
- package/node_modules/buffer/package.json +96 -0
- package/node_modules/chalk/index.d.ts +415 -0
- package/node_modules/chalk/license +9 -0
- package/node_modules/chalk/package.json +68 -0
- package/node_modules/chalk/readme.md +341 -0
- package/node_modules/chalk/source/index.js +229 -0
- package/node_modules/chalk/source/templates.js +134 -0
- package/node_modules/chalk/source/util.js +39 -0
- package/node_modules/cli-cursor/index.d.ts +45 -0
- package/node_modules/cli-cursor/index.js +35 -0
- package/node_modules/cli-cursor/license +9 -0
- package/node_modules/cli-cursor/package.json +46 -0
- package/node_modules/cli-cursor/readme.md +55 -0
- package/node_modules/cli-spinners/index.d.ts +128 -0
- package/node_modules/cli-spinners/index.js +15 -0
- package/node_modules/cli-spinners/license +9 -0
- package/node_modules/cli-spinners/package.json +50 -0
- package/node_modules/cli-spinners/readme.md +54 -0
- package/node_modules/cli-spinners/spinners.json +1622 -0
- package/node_modules/clone/.npmignore +4 -0
- package/node_modules/clone/LICENSE +18 -0
- package/node_modules/clone/README.md +126 -0
- package/node_modules/clone/clone.iml +10 -0
- package/node_modules/clone/clone.js +166 -0
- package/node_modules/clone/package.json +51 -0
- package/node_modules/color-convert/CHANGELOG.md +54 -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 +1176 -0
- package/node_modules/commander/esm.mjs +16 -0
- package/node_modules/commander/index.js +24 -0
- package/node_modules/commander/lib/argument.js +150 -0
- package/node_modules/commander/lib/command.js +2777 -0
- package/node_modules/commander/lib/error.js +39 -0
- package/node_modules/commander/lib/help.js +747 -0
- package/node_modules/commander/lib/option.js +380 -0
- package/node_modules/commander/lib/suggestSimilar.js +101 -0
- package/node_modules/commander/package-support.json +19 -0
- package/node_modules/commander/package.json +82 -0
- package/node_modules/commander/typings/esm.d.mts +3 -0
- package/node_modules/commander/typings/index.d.ts +1113 -0
- package/node_modules/data-uri-to-buffer/README.md +88 -0
- package/node_modules/data-uri-to-buffer/dist/index.d.ts +15 -0
- package/node_modules/data-uri-to-buffer/dist/index.js +53 -0
- package/node_modules/data-uri-to-buffer/dist/index.js.map +1 -0
- package/node_modules/data-uri-to-buffer/package.json +62 -0
- package/node_modules/data-uri-to-buffer/src/index.ts +68 -0
- package/node_modules/defaults/LICENSE +22 -0
- package/node_modules/defaults/README.md +39 -0
- package/node_modules/defaults/index.js +13 -0
- package/node_modules/defaults/package.json +33 -0
- package/node_modules/defaults/test.js +34 -0
- package/node_modules/fetch-blob/LICENSE +21 -0
- package/node_modules/fetch-blob/README.md +106 -0
- package/node_modules/fetch-blob/file.d.ts +2 -0
- package/node_modules/fetch-blob/file.js +49 -0
- package/node_modules/fetch-blob/from.d.ts +26 -0
- package/node_modules/fetch-blob/from.js +100 -0
- package/node_modules/fetch-blob/index.d.ts +3 -0
- package/node_modules/fetch-blob/index.js +250 -0
- package/node_modules/fetch-blob/package.json +56 -0
- package/node_modules/fetch-blob/streams.cjs +51 -0
- package/node_modules/formdata-polyfill/FormData.js +441 -0
- package/node_modules/formdata-polyfill/LICENSE +21 -0
- package/node_modules/formdata-polyfill/README.md +145 -0
- package/node_modules/formdata-polyfill/esm.min.d.ts +5 -0
- package/node_modules/formdata-polyfill/esm.min.js +40 -0
- package/node_modules/formdata-polyfill/formdata-to-blob.js +39 -0
- package/node_modules/formdata-polyfill/formdata.min.js +21 -0
- package/node_modules/formdata-polyfill/package.json +50 -0
- package/node_modules/glob/LICENSE.md +63 -0
- package/node_modules/glob/README.md +1203 -0
- package/node_modules/glob/dist/commonjs/glob.d.ts +396 -0
- package/node_modules/glob/dist/commonjs/glob.d.ts.map +1 -0
- package/node_modules/glob/dist/commonjs/glob.js +248 -0
- package/node_modules/glob/dist/commonjs/glob.js.map +1 -0
- package/node_modules/glob/dist/commonjs/has-magic.d.ts +14 -0
- package/node_modules/glob/dist/commonjs/has-magic.d.ts.map +1 -0
- package/node_modules/glob/dist/commonjs/has-magic.js +27 -0
- package/node_modules/glob/dist/commonjs/has-magic.js.map +1 -0
- package/node_modules/glob/dist/commonjs/ignore.d.ts +24 -0
- package/node_modules/glob/dist/commonjs/ignore.d.ts.map +1 -0
- package/node_modules/glob/dist/commonjs/ignore.js +119 -0
- package/node_modules/glob/dist/commonjs/ignore.js.map +1 -0
- package/node_modules/glob/dist/commonjs/index.d.ts +97 -0
- package/node_modules/glob/dist/commonjs/index.d.ts.map +1 -0
- package/node_modules/glob/dist/commonjs/index.js +68 -0
- package/node_modules/glob/dist/commonjs/index.js.map +1 -0
- package/node_modules/glob/dist/commonjs/index.min.js +4 -0
- package/node_modules/glob/dist/commonjs/index.min.js.map +7 -0
- package/node_modules/glob/dist/commonjs/package.json +3 -0
- package/node_modules/glob/dist/commonjs/pattern.d.ts +79 -0
- package/node_modules/glob/dist/commonjs/pattern.d.ts.map +1 -0
- package/node_modules/glob/dist/commonjs/pattern.js +223 -0
- package/node_modules/glob/dist/commonjs/pattern.js.map +1 -0
- package/node_modules/glob/dist/commonjs/processor.d.ts +59 -0
- package/node_modules/glob/dist/commonjs/processor.d.ts.map +1 -0
- package/node_modules/glob/dist/commonjs/processor.js +301 -0
- package/node_modules/glob/dist/commonjs/processor.js.map +1 -0
- package/node_modules/glob/dist/commonjs/walker.d.ts +97 -0
- package/node_modules/glob/dist/commonjs/walker.d.ts.map +1 -0
- package/node_modules/glob/dist/commonjs/walker.js +387 -0
- package/node_modules/glob/dist/commonjs/walker.js.map +1 -0
- package/node_modules/glob/dist/esm/glob.d.ts +396 -0
- package/node_modules/glob/dist/esm/glob.d.ts.map +1 -0
- package/node_modules/glob/dist/esm/glob.js +244 -0
- package/node_modules/glob/dist/esm/glob.js.map +1 -0
- package/node_modules/glob/dist/esm/has-magic.d.ts +14 -0
- package/node_modules/glob/dist/esm/has-magic.d.ts.map +1 -0
- package/node_modules/glob/dist/esm/has-magic.js +23 -0
- package/node_modules/glob/dist/esm/has-magic.js.map +1 -0
- package/node_modules/glob/dist/esm/ignore.d.ts +24 -0
- package/node_modules/glob/dist/esm/ignore.d.ts.map +1 -0
- package/node_modules/glob/dist/esm/ignore.js +115 -0
- package/node_modules/glob/dist/esm/ignore.js.map +1 -0
- package/node_modules/glob/dist/esm/index.d.ts +97 -0
- package/node_modules/glob/dist/esm/index.d.ts.map +1 -0
- package/node_modules/glob/dist/esm/index.js +55 -0
- package/node_modules/glob/dist/esm/index.js.map +1 -0
- package/node_modules/glob/dist/esm/index.min.js +4 -0
- package/node_modules/glob/dist/esm/index.min.js.map +7 -0
- package/node_modules/glob/dist/esm/package.json +3 -0
- package/node_modules/glob/dist/esm/pattern.d.ts +79 -0
- package/node_modules/glob/dist/esm/pattern.d.ts.map +1 -0
- package/node_modules/glob/dist/esm/pattern.js +219 -0
- package/node_modules/glob/dist/esm/pattern.js.map +1 -0
- package/node_modules/glob/dist/esm/processor.d.ts +59 -0
- package/node_modules/glob/dist/esm/processor.d.ts.map +1 -0
- package/node_modules/glob/dist/esm/processor.js +294 -0
- package/node_modules/glob/dist/esm/processor.js.map +1 -0
- package/node_modules/glob/dist/esm/walker.d.ts +97 -0
- package/node_modules/glob/dist/esm/walker.d.ts.map +1 -0
- package/node_modules/glob/dist/esm/walker.js +381 -0
- package/node_modules/glob/dist/esm/walker.js.map +1 -0
- package/node_modules/glob/package.json +98 -0
- package/node_modules/has-flag/index.d.ts +39 -0
- package/node_modules/has-flag/index.js +8 -0
- package/node_modules/has-flag/license +9 -0
- package/node_modules/has-flag/package.json +46 -0
- package/node_modules/has-flag/readme.md +89 -0
- package/node_modules/ieee754/LICENSE +11 -0
- package/node_modules/ieee754/README.md +51 -0
- package/node_modules/ieee754/index.d.ts +10 -0
- package/node_modules/ieee754/index.js +85 -0
- package/node_modules/ieee754/package.json +52 -0
- package/node_modules/inherits/LICENSE +16 -0
- package/node_modules/inherits/README.md +42 -0
- package/node_modules/inherits/inherits.js +9 -0
- package/node_modules/inherits/inherits_browser.js +27 -0
- package/node_modules/inherits/package.json +29 -0
- package/node_modules/is-interactive/index.d.ts +31 -0
- package/node_modules/is-interactive/index.js +9 -0
- package/node_modules/is-interactive/license +9 -0
- package/node_modules/is-interactive/package.json +38 -0
- package/node_modules/is-interactive/readme.md +51 -0
- package/node_modules/is-unicode-supported/index.d.ts +14 -0
- package/node_modules/is-unicode-supported/index.js +13 -0
- package/node_modules/is-unicode-supported/license +9 -0
- package/node_modules/is-unicode-supported/package.json +41 -0
- package/node_modules/is-unicode-supported/readme.md +35 -0
- package/node_modules/log-symbols/browser.js +8 -0
- package/node_modules/log-symbols/index.d.ts +25 -0
- package/node_modules/log-symbols/index.js +19 -0
- package/node_modules/log-symbols/license +9 -0
- package/node_modules/log-symbols/package.json +52 -0
- package/node_modules/log-symbols/readme.md +51 -0
- package/node_modules/lru-cache/LICENSE.md +55 -0
- package/node_modules/lru-cache/README.md +383 -0
- package/node_modules/lru-cache/dist/commonjs/index.d.ts +1323 -0
- package/node_modules/lru-cache/dist/commonjs/index.d.ts.map +1 -0
- package/node_modules/lru-cache/dist/commonjs/index.js +1595 -0
- package/node_modules/lru-cache/dist/commonjs/index.js.map +1 -0
- package/node_modules/lru-cache/dist/commonjs/index.min.js +2 -0
- package/node_modules/lru-cache/dist/commonjs/index.min.js.map +7 -0
- package/node_modules/lru-cache/dist/commonjs/package.json +3 -0
- package/node_modules/lru-cache/dist/esm/index.d.ts +1323 -0
- package/node_modules/lru-cache/dist/esm/index.d.ts.map +1 -0
- package/node_modules/lru-cache/dist/esm/index.js +1591 -0
- package/node_modules/lru-cache/dist/esm/index.js.map +1 -0
- package/node_modules/lru-cache/dist/esm/index.min.js +2 -0
- package/node_modules/lru-cache/dist/esm/index.min.js.map +7 -0
- package/node_modules/lru-cache/dist/esm/package.json +3 -0
- package/node_modules/lru-cache/package.json +93 -0
- package/node_modules/mimic-fn/index.d.ts +54 -0
- package/node_modules/mimic-fn/index.js +13 -0
- package/node_modules/mimic-fn/license +9 -0
- package/node_modules/mimic-fn/package.json +42 -0
- package/node_modules/mimic-fn/readme.md +69 -0
- package/node_modules/minimatch/LICENSE.md +55 -0
- package/node_modules/minimatch/README.md +528 -0
- package/node_modules/minimatch/dist/commonjs/assert-valid-pattern.d.ts +2 -0
- package/node_modules/minimatch/dist/commonjs/assert-valid-pattern.d.ts.map +1 -0
- package/node_modules/minimatch/dist/commonjs/assert-valid-pattern.js +14 -0
- package/node_modules/minimatch/dist/commonjs/assert-valid-pattern.js.map +1 -0
- package/node_modules/minimatch/dist/commonjs/ast.d.ts +22 -0
- package/node_modules/minimatch/dist/commonjs/ast.d.ts.map +1 -0
- package/node_modules/minimatch/dist/commonjs/ast.js +846 -0
- package/node_modules/minimatch/dist/commonjs/ast.js.map +1 -0
- package/node_modules/minimatch/dist/commonjs/brace-expressions.d.ts +8 -0
- package/node_modules/minimatch/dist/commonjs/brace-expressions.d.ts.map +1 -0
- package/node_modules/minimatch/dist/commonjs/brace-expressions.js +150 -0
- package/node_modules/minimatch/dist/commonjs/brace-expressions.js.map +1 -0
- package/node_modules/minimatch/dist/commonjs/escape.d.ts +15 -0
- package/node_modules/minimatch/dist/commonjs/escape.d.ts.map +1 -0
- package/node_modules/minimatch/dist/commonjs/escape.js +30 -0
- package/node_modules/minimatch/dist/commonjs/escape.js.map +1 -0
- package/node_modules/minimatch/dist/commonjs/index.d.ts +174 -0
- package/node_modules/minimatch/dist/commonjs/index.d.ts.map +1 -0
- package/node_modules/minimatch/dist/commonjs/index.js +1121 -0
- package/node_modules/minimatch/dist/commonjs/index.js.map +1 -0
- package/node_modules/minimatch/dist/commonjs/package.json +3 -0
- package/node_modules/minimatch/dist/commonjs/unescape.d.ts +22 -0
- package/node_modules/minimatch/dist/commonjs/unescape.d.ts.map +1 -0
- package/node_modules/minimatch/dist/commonjs/unescape.js +38 -0
- package/node_modules/minimatch/dist/commonjs/unescape.js.map +1 -0
- package/node_modules/minimatch/dist/esm/assert-valid-pattern.d.ts +2 -0
- package/node_modules/minimatch/dist/esm/assert-valid-pattern.d.ts.map +1 -0
- package/node_modules/minimatch/dist/esm/assert-valid-pattern.js +10 -0
- package/node_modules/minimatch/dist/esm/assert-valid-pattern.js.map +1 -0
- package/node_modules/minimatch/dist/esm/ast.d.ts +22 -0
- package/node_modules/minimatch/dist/esm/ast.d.ts.map +1 -0
- package/node_modules/minimatch/dist/esm/ast.js +842 -0
- package/node_modules/minimatch/dist/esm/ast.js.map +1 -0
- package/node_modules/minimatch/dist/esm/brace-expressions.d.ts +8 -0
- package/node_modules/minimatch/dist/esm/brace-expressions.d.ts.map +1 -0
- package/node_modules/minimatch/dist/esm/brace-expressions.js +146 -0
- package/node_modules/minimatch/dist/esm/brace-expressions.js.map +1 -0
- package/node_modules/minimatch/dist/esm/escape.d.ts +15 -0
- package/node_modules/minimatch/dist/esm/escape.d.ts.map +1 -0
- package/node_modules/minimatch/dist/esm/escape.js +26 -0
- package/node_modules/minimatch/dist/esm/escape.js.map +1 -0
- package/node_modules/minimatch/dist/esm/index.d.ts +174 -0
- package/node_modules/minimatch/dist/esm/index.d.ts.map +1 -0
- package/node_modules/minimatch/dist/esm/index.js +1108 -0
- package/node_modules/minimatch/dist/esm/index.js.map +1 -0
- package/node_modules/minimatch/dist/esm/package.json +3 -0
- package/node_modules/minimatch/dist/esm/unescape.d.ts +22 -0
- package/node_modules/minimatch/dist/esm/unescape.d.ts.map +1 -0
- package/node_modules/minimatch/dist/esm/unescape.js +34 -0
- package/node_modules/minimatch/dist/esm/unescape.js.map +1 -0
- package/node_modules/minimatch/package.json +67 -0
- package/node_modules/minipass/LICENSE.md +55 -0
- package/node_modules/minipass/README.md +825 -0
- package/node_modules/minipass/dist/commonjs/index.d.ts +545 -0
- package/node_modules/minipass/dist/commonjs/index.d.ts.map +1 -0
- package/node_modules/minipass/dist/commonjs/index.js +1038 -0
- package/node_modules/minipass/dist/commonjs/index.js.map +1 -0
- package/node_modules/minipass/dist/commonjs/package.json +3 -0
- package/node_modules/minipass/dist/esm/index.d.ts +545 -0
- package/node_modules/minipass/dist/esm/index.d.ts.map +1 -0
- package/node_modules/minipass/dist/esm/index.js +1020 -0
- package/node_modules/minipass/dist/esm/index.js.map +1 -0
- package/node_modules/minipass/dist/esm/package.json +3 -0
- package/node_modules/minipass/package.json +77 -0
- package/node_modules/node-domexception/.history/README_20210527203617.md +2 -0
- package/node_modules/node-domexception/.history/README_20210527212714.md +41 -0
- package/node_modules/node-domexception/.history/README_20210527213345.md +36 -0
- package/node_modules/node-domexception/.history/README_20210527213411.md +36 -0
- package/node_modules/node-domexception/.history/README_20210527213803.md +36 -0
- package/node_modules/node-domexception/.history/README_20210527214323.md +38 -0
- package/node_modules/node-domexception/.history/README_20210527214408.md +38 -0
- package/node_modules/node-domexception/.history/index_20210527203842.js +0 -0
- package/node_modules/node-domexception/.history/index_20210527203947.js +8 -0
- package/node_modules/node-domexception/.history/index_20210527204259.js +9 -0
- package/node_modules/node-domexception/.history/index_20210527204418.js +9 -0
- package/node_modules/node-domexception/.history/index_20210527204756.js +11 -0
- package/node_modules/node-domexception/.history/index_20210527204833.js +11 -0
- package/node_modules/node-domexception/.history/index_20210527211208.js +15 -0
- package/node_modules/node-domexception/.history/index_20210527211248.js +15 -0
- package/node_modules/node-domexception/.history/index_20210527212722.js +23 -0
- package/node_modules/node-domexception/.history/index_20210527212731.js +23 -0
- package/node_modules/node-domexception/.history/index_20210527212746.js +15 -0
- package/node_modules/node-domexception/.history/index_20210527212900.js +16 -0
- package/node_modules/node-domexception/.history/index_20210527213022.js +16 -0
- package/node_modules/node-domexception/.history/index_20210527213822.js +16 -0
- package/node_modules/node-domexception/.history/index_20210527213843.js +17 -0
- package/node_modules/node-domexception/.history/index_20210527213852.js +17 -0
- package/node_modules/node-domexception/.history/index_20210527213910.js +16 -0
- package/node_modules/node-domexception/.history/index_20210527214034.js +16 -0
- package/node_modules/node-domexception/.history/index_20210527214643.js +41 -0
- package/node_modules/node-domexception/.history/index_20210527214654.js +41 -0
- package/node_modules/node-domexception/.history/index_20210527214700.js +16 -0
- package/node_modules/node-domexception/.history/package_20210527203733.json +19 -0
- package/node_modules/node-domexception/.history/package_20210527203825.json +16 -0
- package/node_modules/node-domexception/.history/package_20210527204621.json +19 -0
- package/node_modules/node-domexception/.history/package_20210527204913.json +25 -0
- package/node_modules/node-domexception/.history/package_20210527204925.json +25 -0
- package/node_modules/node-domexception/.history/package_20210527205145.json +29 -0
- package/node_modules/node-domexception/.history/package_20210527205156.json +29 -0
- package/node_modules/node-domexception/.history/test_20210527205603.js +0 -0
- package/node_modules/node-domexception/.history/test_20210527205957.js +3 -0
- package/node_modules/node-domexception/.history/test_20210527210021.js +3 -0
- package/node_modules/node-domexception/LICENSE +21 -0
- package/node_modules/node-domexception/README.md +46 -0
- package/node_modules/node-domexception/index.js +16 -0
- package/node_modules/node-domexception/package.json +29 -0
- package/node_modules/node-fetch/@types/index.d.ts +219 -0
- package/node_modules/node-fetch/LICENSE.md +22 -0
- package/node_modules/node-fetch/README.md +872 -0
- package/node_modules/node-fetch/package.json +131 -0
- package/node_modules/node-fetch/src/body.js +397 -0
- package/node_modules/node-fetch/src/errors/abort-error.js +10 -0
- package/node_modules/node-fetch/src/errors/base.js +17 -0
- package/node_modules/node-fetch/src/errors/fetch-error.js +26 -0
- package/node_modules/node-fetch/src/headers.js +267 -0
- package/node_modules/node-fetch/src/index.js +417 -0
- package/node_modules/node-fetch/src/request.js +313 -0
- package/node_modules/node-fetch/src/response.js +160 -0
- package/node_modules/node-fetch/src/utils/get-search.js +9 -0
- package/node_modules/node-fetch/src/utils/is-redirect.js +11 -0
- package/node_modules/node-fetch/src/utils/is.js +87 -0
- package/node_modules/node-fetch/src/utils/multipart-parser.js +432 -0
- package/node_modules/node-fetch/src/utils/referrer.js +340 -0
- package/node_modules/onetime/index.d.ts +64 -0
- package/node_modules/onetime/index.js +44 -0
- package/node_modules/onetime/license +9 -0
- package/node_modules/onetime/package.json +43 -0
- package/node_modules/onetime/readme.md +94 -0
- package/node_modules/ora/index.d.ts +277 -0
- package/node_modules/ora/index.js +407 -0
- package/node_modules/ora/license +9 -0
- package/node_modules/ora/package.json +57 -0
- package/node_modules/ora/readme.md +264 -0
- package/node_modules/path-scurry/LICENSE.md +55 -0
- package/node_modules/path-scurry/README.md +636 -0
- package/node_modules/path-scurry/dist/commonjs/index.d.ts +1115 -0
- package/node_modules/path-scurry/dist/commonjs/index.d.ts.map +1 -0
- package/node_modules/path-scurry/dist/commonjs/index.js +2018 -0
- package/node_modules/path-scurry/dist/commonjs/index.js.map +1 -0
- package/node_modules/path-scurry/dist/commonjs/package.json +3 -0
- package/node_modules/path-scurry/dist/esm/index.d.ts +1115 -0
- package/node_modules/path-scurry/dist/esm/index.d.ts.map +1 -0
- package/node_modules/path-scurry/dist/esm/index.js +1983 -0
- package/node_modules/path-scurry/dist/esm/index.js.map +1 -0
- package/node_modules/path-scurry/dist/esm/package.json +3 -0
- package/node_modules/path-scurry/package.json +72 -0
- package/node_modules/readable-stream/CONTRIBUTING.md +38 -0
- package/node_modules/readable-stream/GOVERNANCE.md +136 -0
- package/node_modules/readable-stream/LICENSE +47 -0
- package/node_modules/readable-stream/README.md +106 -0
- package/node_modules/readable-stream/errors-browser.js +127 -0
- package/node_modules/readable-stream/errors.js +116 -0
- package/node_modules/readable-stream/experimentalWarning.js +17 -0
- package/node_modules/readable-stream/lib/_stream_duplex.js +126 -0
- package/node_modules/readable-stream/lib/_stream_passthrough.js +37 -0
- package/node_modules/readable-stream/lib/_stream_readable.js +1027 -0
- package/node_modules/readable-stream/lib/_stream_transform.js +190 -0
- package/node_modules/readable-stream/lib/_stream_writable.js +641 -0
- package/node_modules/readable-stream/lib/internal/streams/async_iterator.js +180 -0
- package/node_modules/readable-stream/lib/internal/streams/buffer_list.js +183 -0
- package/node_modules/readable-stream/lib/internal/streams/destroy.js +96 -0
- package/node_modules/readable-stream/lib/internal/streams/end-of-stream.js +86 -0
- package/node_modules/readable-stream/lib/internal/streams/from-browser.js +3 -0
- package/node_modules/readable-stream/lib/internal/streams/from.js +52 -0
- package/node_modules/readable-stream/lib/internal/streams/pipeline.js +86 -0
- package/node_modules/readable-stream/lib/internal/streams/state.js +22 -0
- package/node_modules/readable-stream/lib/internal/streams/stream-browser.js +1 -0
- package/node_modules/readable-stream/lib/internal/streams/stream.js +1 -0
- package/node_modules/readable-stream/package.json +68 -0
- package/node_modules/readable-stream/readable-browser.js +9 -0
- package/node_modules/readable-stream/readable.js +16 -0
- package/node_modules/restore-cursor/index.d.ts +13 -0
- package/node_modules/restore-cursor/index.js +9 -0
- package/node_modules/restore-cursor/license +9 -0
- package/node_modules/restore-cursor/package.json +52 -0
- package/node_modules/restore-cursor/readme.md +26 -0
- package/node_modules/safe-buffer/LICENSE +21 -0
- package/node_modules/safe-buffer/README.md +584 -0
- package/node_modules/safe-buffer/index.d.ts +187 -0
- package/node_modules/safe-buffer/index.js +65 -0
- package/node_modules/safe-buffer/package.json +51 -0
- package/node_modules/signal-exit/LICENSE.txt +16 -0
- package/node_modules/signal-exit/README.md +39 -0
- package/node_modules/signal-exit/index.js +202 -0
- package/node_modules/signal-exit/package.json +38 -0
- package/node_modules/signal-exit/signals.js +53 -0
- package/node_modules/string_decoder/LICENSE +48 -0
- package/node_modules/string_decoder/README.md +47 -0
- package/node_modules/string_decoder/lib/string_decoder.js +296 -0
- package/node_modules/string_decoder/package.json +34 -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/supports-color/browser.js +5 -0
- package/node_modules/supports-color/index.js +135 -0
- package/node_modules/supports-color/license +9 -0
- package/node_modules/supports-color/package.json +53 -0
- package/node_modules/supports-color/readme.md +76 -0
- package/node_modules/util-deprecate/History.md +16 -0
- package/node_modules/util-deprecate/LICENSE +24 -0
- package/node_modules/util-deprecate/README.md +53 -0
- package/node_modules/util-deprecate/browser.js +67 -0
- package/node_modules/util-deprecate/node.js +6 -0
- package/node_modules/util-deprecate/package.json +27 -0
- package/node_modules/wcwidth/.npmignore +1 -0
- package/node_modules/wcwidth/LICENSE +30 -0
- package/node_modules/wcwidth/Readme.md +33 -0
- package/node_modules/wcwidth/combining.js +50 -0
- package/node_modules/wcwidth/docs/index.md +65 -0
- package/node_modules/wcwidth/index.js +99 -0
- package/node_modules/wcwidth/package.json +42 -0
- package/node_modules/wcwidth/test/index.js +64 -0
- package/node_modules/web-streams-polyfill/LICENSE +22 -0
- package/node_modules/web-streams-polyfill/README.md +110 -0
- package/node_modules/web-streams-polyfill/dist/polyfill.es2018.js +4765 -0
- package/node_modules/web-streams-polyfill/dist/polyfill.es2018.js.map +1 -0
- package/node_modules/web-streams-polyfill/dist/polyfill.es2018.min.js +9 -0
- package/node_modules/web-streams-polyfill/dist/polyfill.es2018.min.js.map +1 -0
- package/node_modules/web-streams-polyfill/dist/polyfill.es2018.mjs +4745 -0
- package/node_modules/web-streams-polyfill/dist/polyfill.es2018.mjs.map +1 -0
- package/node_modules/web-streams-polyfill/dist/polyfill.es6.js +4838 -0
- package/node_modules/web-streams-polyfill/dist/polyfill.es6.js.map +1 -0
- package/node_modules/web-streams-polyfill/dist/polyfill.es6.min.js +9 -0
- package/node_modules/web-streams-polyfill/dist/polyfill.es6.min.js.map +1 -0
- package/node_modules/web-streams-polyfill/dist/polyfill.es6.mjs +4818 -0
- package/node_modules/web-streams-polyfill/dist/polyfill.es6.mjs.map +1 -0
- package/node_modules/web-streams-polyfill/dist/polyfill.js +5011 -0
- package/node_modules/web-streams-polyfill/dist/polyfill.js.map +1 -0
- package/node_modules/web-streams-polyfill/dist/polyfill.min.js +9 -0
- package/node_modules/web-streams-polyfill/dist/polyfill.min.js.map +1 -0
- package/node_modules/web-streams-polyfill/dist/polyfill.mjs +4991 -0
- package/node_modules/web-streams-polyfill/dist/polyfill.mjs.map +1 -0
- package/node_modules/web-streams-polyfill/dist/ponyfill.es2018.js +4737 -0
- package/node_modules/web-streams-polyfill/dist/ponyfill.es2018.js.map +1 -0
- package/node_modules/web-streams-polyfill/dist/ponyfill.es2018.mjs +4717 -0
- package/node_modules/web-streams-polyfill/dist/ponyfill.es2018.mjs.map +1 -0
- package/node_modules/web-streams-polyfill/dist/ponyfill.es6.js +4810 -0
- package/node_modules/web-streams-polyfill/dist/ponyfill.es6.js.map +1 -0
- package/node_modules/web-streams-polyfill/dist/ponyfill.es6.mjs +4790 -0
- package/node_modules/web-streams-polyfill/dist/ponyfill.es6.mjs.map +1 -0
- package/node_modules/web-streams-polyfill/dist/ponyfill.js +4983 -0
- package/node_modules/web-streams-polyfill/dist/ponyfill.js.map +1 -0
- package/node_modules/web-streams-polyfill/dist/ponyfill.mjs +4963 -0
- package/node_modules/web-streams-polyfill/dist/ponyfill.mjs.map +1 -0
- package/node_modules/web-streams-polyfill/dist/types/polyfill.d.ts +24 -0
- package/node_modules/web-streams-polyfill/dist/types/ponyfill.d.ts +780 -0
- package/node_modules/web-streams-polyfill/dist/types/ts3.6/polyfill.d.ts +28 -0
- package/node_modules/web-streams-polyfill/dist/types/ts3.6/ponyfill.d.ts +821 -0
- package/node_modules/web-streams-polyfill/dist/types/tsdoc-metadata.json +11 -0
- package/node_modules/web-streams-polyfill/es2018/package.json +14 -0
- package/node_modules/web-streams-polyfill/es6/package.json +14 -0
- package/node_modules/web-streams-polyfill/package.json +83 -0
- package/node_modules/web-streams-polyfill/ponyfill/es2018/package.json +13 -0
- package/node_modules/web-streams-polyfill/ponyfill/es6/package.json +13 -0
- package/node_modules/web-streams-polyfill/ponyfill/package.json +13 -0
- package/package.json +26 -0
- package/version.json +18 -0
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
data-uri-to-buffer
|
|
2
|
+
==================
|
|
3
|
+
### Generate a Buffer instance from a [Data URI][rfc] string
|
|
4
|
+
[](https://travis-ci.org/TooTallNate/node-data-uri-to-buffer)
|
|
5
|
+
|
|
6
|
+
This module accepts a ["data" URI][rfc] String of data, and returns a
|
|
7
|
+
node.js `Buffer` instance with the decoded data.
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
Installation
|
|
11
|
+
------------
|
|
12
|
+
|
|
13
|
+
Install with `npm`:
|
|
14
|
+
|
|
15
|
+
``` bash
|
|
16
|
+
$ npm install data-uri-to-buffer
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
Example
|
|
21
|
+
-------
|
|
22
|
+
|
|
23
|
+
``` js
|
|
24
|
+
import dataUriToBuffer from 'data-uri-to-buffer';
|
|
25
|
+
|
|
26
|
+
// plain-text data is supported
|
|
27
|
+
let uri = 'data:,Hello%2C%20World!';
|
|
28
|
+
let decoded = dataUriToBuffer(uri);
|
|
29
|
+
console.log(decoded.toString());
|
|
30
|
+
// 'Hello, World!'
|
|
31
|
+
|
|
32
|
+
// base64-encoded data is supported
|
|
33
|
+
uri = 'data:text/plain;base64,SGVsbG8sIFdvcmxkIQ%3D%3D';
|
|
34
|
+
decoded = dataUriToBuffer(uri);
|
|
35
|
+
console.log(decoded.toString());
|
|
36
|
+
// 'Hello, World!'
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
API
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
### dataUriToBuffer(String uri) → Buffer
|
|
44
|
+
|
|
45
|
+
The `type` property on the Buffer instance gets set to the main type portion of
|
|
46
|
+
the "mediatype" portion of the "data" URI, or defaults to `"text/plain"` if not
|
|
47
|
+
specified.
|
|
48
|
+
|
|
49
|
+
The `typeFull` property on the Buffer instance gets set to the entire
|
|
50
|
+
"mediatype" portion of the "data" URI (including all parameters), or defaults
|
|
51
|
+
to `"text/plain;charset=US-ASCII"` if not specified.
|
|
52
|
+
|
|
53
|
+
The `charset` property on the Buffer instance gets set to the Charset portion of
|
|
54
|
+
the "mediatype" portion of the "data" URI, or defaults to `"US-ASCII"` if the
|
|
55
|
+
entire type is not specified, or defaults to `""` otherwise.
|
|
56
|
+
|
|
57
|
+
*Note*: If the only the main type is specified but not the charset, e.g.
|
|
58
|
+
`"data:text/plain,abc"`, the charset is set to the empty string. The spec only
|
|
59
|
+
defaults to US-ASCII as charset if the entire type is not specified.
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
License
|
|
63
|
+
-------
|
|
64
|
+
|
|
65
|
+
(The MIT License)
|
|
66
|
+
|
|
67
|
+
Copyright (c) 2014 Nathan Rajlich <nathan@tootallnate.net>
|
|
68
|
+
|
|
69
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
70
|
+
a copy of this software and associated documentation files (the
|
|
71
|
+
'Software'), to deal in the Software without restriction, including
|
|
72
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
|
73
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
|
74
|
+
permit persons to whom the Software is furnished to do so, subject to
|
|
75
|
+
the following conditions:
|
|
76
|
+
|
|
77
|
+
The above copyright notice and this permission notice shall be
|
|
78
|
+
included in all copies or substantial portions of the Software.
|
|
79
|
+
|
|
80
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
|
81
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
82
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
83
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
|
84
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
85
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
86
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
87
|
+
|
|
88
|
+
[rfc]: http://tools.ietf.org/html/rfc2397
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
export interface MimeBuffer extends Buffer {
|
|
3
|
+
type: string;
|
|
4
|
+
typeFull: string;
|
|
5
|
+
charset: string;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Returns a `Buffer` instance from the given data URI `uri`.
|
|
9
|
+
*
|
|
10
|
+
* @param {String} uri Data URI to turn into a Buffer instance
|
|
11
|
+
* @returns {Buffer} Buffer instance from Data URI
|
|
12
|
+
* @api public
|
|
13
|
+
*/
|
|
14
|
+
export declare function dataUriToBuffer(uri: string): MimeBuffer;
|
|
15
|
+
export default dataUriToBuffer;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns a `Buffer` instance from the given data URI `uri`.
|
|
3
|
+
*
|
|
4
|
+
* @param {String} uri Data URI to turn into a Buffer instance
|
|
5
|
+
* @returns {Buffer} Buffer instance from Data URI
|
|
6
|
+
* @api public
|
|
7
|
+
*/
|
|
8
|
+
export function dataUriToBuffer(uri) {
|
|
9
|
+
if (!/^data:/i.test(uri)) {
|
|
10
|
+
throw new TypeError('`uri` does not appear to be a Data URI (must begin with "data:")');
|
|
11
|
+
}
|
|
12
|
+
// strip newlines
|
|
13
|
+
uri = uri.replace(/\r?\n/g, '');
|
|
14
|
+
// split the URI up into the "metadata" and the "data" portions
|
|
15
|
+
const firstComma = uri.indexOf(',');
|
|
16
|
+
if (firstComma === -1 || firstComma <= 4) {
|
|
17
|
+
throw new TypeError('malformed data: URI');
|
|
18
|
+
}
|
|
19
|
+
// remove the "data:" scheme and parse the metadata
|
|
20
|
+
const meta = uri.substring(5, firstComma).split(';');
|
|
21
|
+
let charset = '';
|
|
22
|
+
let base64 = false;
|
|
23
|
+
const type = meta[0] || 'text/plain';
|
|
24
|
+
let typeFull = type;
|
|
25
|
+
for (let i = 1; i < meta.length; i++) {
|
|
26
|
+
if (meta[i] === 'base64') {
|
|
27
|
+
base64 = true;
|
|
28
|
+
}
|
|
29
|
+
else if (meta[i]) {
|
|
30
|
+
typeFull += `;${meta[i]}`;
|
|
31
|
+
if (meta[i].indexOf('charset=') === 0) {
|
|
32
|
+
charset = meta[i].substring(8);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
// defaults to US-ASCII only if type is not provided
|
|
37
|
+
if (!meta[0] && !charset.length) {
|
|
38
|
+
typeFull += ';charset=US-ASCII';
|
|
39
|
+
charset = 'US-ASCII';
|
|
40
|
+
}
|
|
41
|
+
// get the encoded data portion and decode URI-encoded chars
|
|
42
|
+
const encoding = base64 ? 'base64' : 'ascii';
|
|
43
|
+
const data = unescape(uri.substring(firstComma + 1));
|
|
44
|
+
const buffer = Buffer.from(data, encoding);
|
|
45
|
+
// set `.type` and `.typeFull` properties to MIME type
|
|
46
|
+
buffer.type = type;
|
|
47
|
+
buffer.typeFull = typeFull;
|
|
48
|
+
// set the `.charset` property
|
|
49
|
+
buffer.charset = charset;
|
|
50
|
+
return buffer;
|
|
51
|
+
}
|
|
52
|
+
export default dataUriToBuffer;
|
|
53
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAMA;;;;;;GAMG;AACH,MAAM,UAAU,eAAe,CAAC,GAAW;IAC1C,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE;QACzB,MAAM,IAAI,SAAS,CAClB,kEAAkE,CAClE,CAAC;KACF;IAED,iBAAiB;IACjB,GAAG,GAAG,GAAG,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;IAEhC,+DAA+D;IAC/D,MAAM,UAAU,GAAG,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACpC,IAAI,UAAU,KAAK,CAAC,CAAC,IAAI,UAAU,IAAI,CAAC,EAAE;QACzC,MAAM,IAAI,SAAS,CAAC,qBAAqB,CAAC,CAAC;KAC3C;IAED,mDAAmD;IACnD,MAAM,IAAI,GAAG,GAAG,CAAC,SAAS,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAErD,IAAI,OAAO,GAAG,EAAE,CAAC;IACjB,IAAI,MAAM,GAAG,KAAK,CAAC;IACnB,MAAM,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,YAAY,CAAC;IACrC,IAAI,QAAQ,GAAG,IAAI,CAAC;IACpB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACrC,IAAI,IAAI,CAAC,CAAC,CAAC,KAAK,QAAQ,EAAE;YACzB,MAAM,GAAG,IAAI,CAAC;SACd;aAAM,IAAG,IAAI,CAAC,CAAC,CAAC,EAAE;YAClB,QAAQ,IAAI,IAAM,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;YAC5B,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE;gBACtC,OAAO,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;aAC/B;SACD;KACD;IACD,oDAAoD;IACpD,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE;QAChC,QAAQ,IAAI,mBAAmB,CAAC;QAChC,OAAO,GAAG,UAAU,CAAC;KACrB;IAED,4DAA4D;IAC5D,MAAM,QAAQ,GAAG,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC;IAC7C,MAAM,IAAI,GAAG,QAAQ,CAAC,GAAG,CAAC,SAAS,CAAC,UAAU,GAAG,CAAC,CAAC,CAAC,CAAC;IACrD,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAe,CAAC;IAEzD,sDAAsD;IACtD,MAAM,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,MAAM,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAE3B,8BAA8B;IAC9B,MAAM,CAAC,OAAO,GAAG,OAAO,CAAC;IAEzB,OAAO,MAAM,CAAC;AACf,CAAC;AAED,eAAe,eAAe,CAAC"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "data-uri-to-buffer",
|
|
3
|
+
"version": "4.0.1",
|
|
4
|
+
"description": "Generate a Buffer instance from a Data URI string",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"exports": "./dist/index.js",
|
|
7
|
+
"main": "./dist/index.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"files": [
|
|
10
|
+
"dist",
|
|
11
|
+
"src"
|
|
12
|
+
],
|
|
13
|
+
"scripts": {
|
|
14
|
+
"build": "tsc",
|
|
15
|
+
"test": "jest",
|
|
16
|
+
"prepublishOnly": "npm run build"
|
|
17
|
+
},
|
|
18
|
+
"repository": {
|
|
19
|
+
"type": "git",
|
|
20
|
+
"url": "git://github.com/TooTallNate/node-data-uri-to-buffer.git"
|
|
21
|
+
},
|
|
22
|
+
"engines": {
|
|
23
|
+
"node": ">= 12"
|
|
24
|
+
},
|
|
25
|
+
"keywords": [
|
|
26
|
+
"data",
|
|
27
|
+
"uri",
|
|
28
|
+
"datauri",
|
|
29
|
+
"data-uri",
|
|
30
|
+
"buffer",
|
|
31
|
+
"convert",
|
|
32
|
+
"rfc2397",
|
|
33
|
+
"2397"
|
|
34
|
+
],
|
|
35
|
+
"author": "Nathan Rajlich <nathan@tootallnate.net> (http://n8.io/)",
|
|
36
|
+
"license": "MIT",
|
|
37
|
+
"bugs": {
|
|
38
|
+
"url": "https://github.com/TooTallNate/node-data-uri-to-buffer/issues"
|
|
39
|
+
},
|
|
40
|
+
"homepage": "https://github.com/TooTallNate/node-data-uri-to-buffer",
|
|
41
|
+
"devDependencies": {
|
|
42
|
+
"@types/jest": "^27.0.2",
|
|
43
|
+
"@types/node": "^12.20.36",
|
|
44
|
+
"jest": "^27.3.1",
|
|
45
|
+
"ts-jest": "^27.0.7",
|
|
46
|
+
"typescript": "^4.4.4"
|
|
47
|
+
},
|
|
48
|
+
"jest": {
|
|
49
|
+
"preset": "ts-jest",
|
|
50
|
+
"globals": {
|
|
51
|
+
"ts-jest": {
|
|
52
|
+
"diagnostics": false,
|
|
53
|
+
"isolatedModules": true
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
"verbose": false,
|
|
57
|
+
"testEnvironment": "node",
|
|
58
|
+
"testMatch": [
|
|
59
|
+
"<rootDir>/test/**/*.test.ts"
|
|
60
|
+
]
|
|
61
|
+
}
|
|
62
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
export interface MimeBuffer extends Buffer {
|
|
2
|
+
type: string;
|
|
3
|
+
typeFull: string;
|
|
4
|
+
charset: string;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Returns a `Buffer` instance from the given data URI `uri`.
|
|
9
|
+
*
|
|
10
|
+
* @param {String} uri Data URI to turn into a Buffer instance
|
|
11
|
+
* @returns {Buffer} Buffer instance from Data URI
|
|
12
|
+
* @api public
|
|
13
|
+
*/
|
|
14
|
+
export function dataUriToBuffer(uri: string): MimeBuffer {
|
|
15
|
+
if (!/^data:/i.test(uri)) {
|
|
16
|
+
throw new TypeError(
|
|
17
|
+
'`uri` does not appear to be a Data URI (must begin with "data:")'
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
// strip newlines
|
|
22
|
+
uri = uri.replace(/\r?\n/g, '');
|
|
23
|
+
|
|
24
|
+
// split the URI up into the "metadata" and the "data" portions
|
|
25
|
+
const firstComma = uri.indexOf(',');
|
|
26
|
+
if (firstComma === -1 || firstComma <= 4) {
|
|
27
|
+
throw new TypeError('malformed data: URI');
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// remove the "data:" scheme and parse the metadata
|
|
31
|
+
const meta = uri.substring(5, firstComma).split(';');
|
|
32
|
+
|
|
33
|
+
let charset = '';
|
|
34
|
+
let base64 = false;
|
|
35
|
+
const type = meta[0] || 'text/plain';
|
|
36
|
+
let typeFull = type;
|
|
37
|
+
for (let i = 1; i < meta.length; i++) {
|
|
38
|
+
if (meta[i] === 'base64') {
|
|
39
|
+
base64 = true;
|
|
40
|
+
} else if(meta[i]) {
|
|
41
|
+
typeFull += `;${ meta[i]}`;
|
|
42
|
+
if (meta[i].indexOf('charset=') === 0) {
|
|
43
|
+
charset = meta[i].substring(8);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
// defaults to US-ASCII only if type is not provided
|
|
48
|
+
if (!meta[0] && !charset.length) {
|
|
49
|
+
typeFull += ';charset=US-ASCII';
|
|
50
|
+
charset = 'US-ASCII';
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
// get the encoded data portion and decode URI-encoded chars
|
|
54
|
+
const encoding = base64 ? 'base64' : 'ascii';
|
|
55
|
+
const data = unescape(uri.substring(firstComma + 1));
|
|
56
|
+
const buffer = Buffer.from(data, encoding) as MimeBuffer;
|
|
57
|
+
|
|
58
|
+
// set `.type` and `.typeFull` properties to MIME type
|
|
59
|
+
buffer.type = type;
|
|
60
|
+
buffer.typeFull = typeFull;
|
|
61
|
+
|
|
62
|
+
// set the `.charset` property
|
|
63
|
+
buffer.charset = charset;
|
|
64
|
+
|
|
65
|
+
return buffer;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export default dataUriToBuffer;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2022 Sindre Sorhus
|
|
4
|
+
Copyright (c) 2015 Elijah Insua
|
|
5
|
+
|
|
6
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
in the Software without restriction, including without limitation the rights
|
|
9
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
furnished to do so, subject to the following conditions:
|
|
12
|
+
|
|
13
|
+
The above copyright notice and this permission notice shall be included in
|
|
14
|
+
all copies or substantial portions of the Software.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
22
|
+
THE SOFTWARE.
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# defaults
|
|
2
|
+
|
|
3
|
+
> A simple one level options merge utility
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
npm install defaults
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
```js
|
|
14
|
+
const defaults = require('defaults');
|
|
15
|
+
|
|
16
|
+
const handle = (options, fn) => {
|
|
17
|
+
options = defaults(options, {
|
|
18
|
+
timeout: 100
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
setTimeout(() => {
|
|
22
|
+
fn(options);
|
|
23
|
+
}, options.timeout);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
handle({timeout: 1000}, () => {
|
|
27
|
+
// We're here 1000 ms later
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
handle({timeout: 10000}, () => {
|
|
31
|
+
// We're here 10s later
|
|
32
|
+
});
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Summary
|
|
36
|
+
|
|
37
|
+
this module exports a function that takes 2 arguments: `options` and `defaults`. When called, it overrides all of `undefined` properties in `options` with the clones of properties defined in `defaults`
|
|
38
|
+
|
|
39
|
+
Sidecases: if called with a falsy `options` value, options will be initialized to a new object before being merged onto.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
var clone = require('clone');
|
|
2
|
+
|
|
3
|
+
module.exports = function(options, defaults) {
|
|
4
|
+
options = options || {};
|
|
5
|
+
|
|
6
|
+
Object.keys(defaults).forEach(function(key) {
|
|
7
|
+
if (typeof options[key] === 'undefined') {
|
|
8
|
+
options[key] = clone(defaults[key]);
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
return options;
|
|
13
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "defaults",
|
|
3
|
+
"version": "1.0.4",
|
|
4
|
+
"description": "merge single level defaults over a config object",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"funding": "https://github.com/sponsors/sindresorhus",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"test": "node test.js"
|
|
9
|
+
},
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "git://github.com/sindresorhus/node-defaults.git"
|
|
13
|
+
},
|
|
14
|
+
"keywords": [
|
|
15
|
+
"config",
|
|
16
|
+
"defaults",
|
|
17
|
+
"options",
|
|
18
|
+
"object",
|
|
19
|
+
"merge",
|
|
20
|
+
"assign",
|
|
21
|
+
"properties",
|
|
22
|
+
"deep"
|
|
23
|
+
],
|
|
24
|
+
"author": "Elijah Insua <tmpvar@gmail.com>",
|
|
25
|
+
"license": "MIT",
|
|
26
|
+
"readmeFilename": "README.md",
|
|
27
|
+
"dependencies": {
|
|
28
|
+
"clone": "^1.0.2"
|
|
29
|
+
},
|
|
30
|
+
"devDependencies": {
|
|
31
|
+
"tap": "^2.0.0"
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
var defaults = require('./'),
|
|
2
|
+
test = require('tap').test;
|
|
3
|
+
|
|
4
|
+
test("ensure options is an object", function(t) {
|
|
5
|
+
var options = defaults(false, { a : true });
|
|
6
|
+
t.ok(options.a);
|
|
7
|
+
t.end()
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
test("ensure defaults override keys", function(t) {
|
|
11
|
+
var result = defaults({}, { a: false, b: true });
|
|
12
|
+
t.ok(result.b, 'b merges over undefined');
|
|
13
|
+
t.equal(result.a, false, 'a merges over undefined');
|
|
14
|
+
t.end();
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
test("ensure defined keys are not overwritten", function(t) {
|
|
18
|
+
var result = defaults({ b: false }, { a: false, b: true });
|
|
19
|
+
t.equal(result.b, false, 'b not merged');
|
|
20
|
+
t.equal(result.a, false, 'a merges over undefined');
|
|
21
|
+
t.end();
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
test("ensure defaults clone nested objects", function(t) {
|
|
25
|
+
var d = { a: [1,2,3], b: { hello : 'world' } };
|
|
26
|
+
var result = defaults({}, d);
|
|
27
|
+
t.equal(result.a.length, 3, 'objects should be clones');
|
|
28
|
+
t.ok(result.a !== d.a, 'objects should be clones');
|
|
29
|
+
|
|
30
|
+
t.equal(Object.keys(result.b).length, 1, 'objects should be clones');
|
|
31
|
+
t.ok(result.b !== d.b, 'objects should be clones');
|
|
32
|
+
t.end();
|
|
33
|
+
});
|
|
34
|
+
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2019 David Frank
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
# fetch-blob
|
|
2
|
+
|
|
3
|
+
[![npm version][npm-image]][npm-url]
|
|
4
|
+
[![build status][ci-image]][ci-url]
|
|
5
|
+
[![coverage status][codecov-image]][codecov-url]
|
|
6
|
+
[![install size][install-size-image]][install-size-url]
|
|
7
|
+
|
|
8
|
+
A Blob implementation in Node.js, originally from [node-fetch](https://github.com/node-fetch/node-fetch).
|
|
9
|
+
|
|
10
|
+
## Installation
|
|
11
|
+
|
|
12
|
+
```sh
|
|
13
|
+
npm install fetch-blob
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
<details>
|
|
17
|
+
<summary>Upgrading from 2x to 3x</summary>
|
|
18
|
+
|
|
19
|
+
Updating from 2 to 3 should be a breeze since there is not many changes to the blob specification.
|
|
20
|
+
The major cause of a major release is coding standards.
|
|
21
|
+
- internal WeakMaps was replaced with private fields
|
|
22
|
+
- internal Buffer.from was replaced with TextEncoder/Decoder
|
|
23
|
+
- internal buffers was replaced with Uint8Arrays
|
|
24
|
+
- CommonJS was replaced with ESM
|
|
25
|
+
- The node stream returned by calling `blob.stream()` was replaced with whatwg streams
|
|
26
|
+
- (Read "Differences from other blobs" for more info.)
|
|
27
|
+
|
|
28
|
+
</details>
|
|
29
|
+
|
|
30
|
+
<details>
|
|
31
|
+
<summary>Differences from other Blobs</summary>
|
|
32
|
+
|
|
33
|
+
- Unlike NodeJS `buffer.Blob` (Added in: v15.7.0) and browser native Blob this polyfilled version can't be sent via PostMessage
|
|
34
|
+
- This blob version is more arbitrary, it can be constructed with blob parts that isn't a instance of itself
|
|
35
|
+
it has to look and behave as a blob to be accepted as a blob part.
|
|
36
|
+
- The benefit of this is that you can create other types of blobs that don't contain any internal data that has to be read in other ways, such as the `BlobDataItem` created in `from.js` that wraps a file path into a blob-like item and read lazily (nodejs plans to [implement this][fs-blobs] as well)
|
|
37
|
+
- The `blob.stream()` is the most noticeable differences. It returns a WHATWG stream now. to keep it as a node stream you would have to do:
|
|
38
|
+
|
|
39
|
+
```js
|
|
40
|
+
import {Readable} from 'stream'
|
|
41
|
+
const stream = Readable.from(blob.stream())
|
|
42
|
+
```
|
|
43
|
+
</details>
|
|
44
|
+
|
|
45
|
+
## Usage
|
|
46
|
+
|
|
47
|
+
```js
|
|
48
|
+
// Ways to import
|
|
49
|
+
// (PS it's dependency free ESM package so regular http-import from CDN works too)
|
|
50
|
+
import Blob from 'fetch-blob'
|
|
51
|
+
import File from 'fetch-blob/file.js'
|
|
52
|
+
|
|
53
|
+
import {Blob} from 'fetch-blob'
|
|
54
|
+
import {File} from 'fetch-blob/file.js'
|
|
55
|
+
|
|
56
|
+
const {Blob} = await import('fetch-blob')
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
// Ways to read the blob:
|
|
60
|
+
const blob = new Blob(['hello, world'])
|
|
61
|
+
|
|
62
|
+
await blob.text()
|
|
63
|
+
await blob.arrayBuffer()
|
|
64
|
+
for await (let chunk of blob.stream()) { ... }
|
|
65
|
+
blob.stream().getReader().read()
|
|
66
|
+
blob.stream().getReader({mode: 'byob'}).read(view)
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### Blob part backed up by filesystem
|
|
70
|
+
|
|
71
|
+
`fetch-blob/from.js` comes packed with tools to convert any filepath into either a Blob or a File
|
|
72
|
+
It will not read the content into memory. It will only stat the file for last modified date and file size.
|
|
73
|
+
|
|
74
|
+
```js
|
|
75
|
+
// The default export is sync and use fs.stat to retrieve size & last modified as a blob
|
|
76
|
+
import blobFromSync from 'fetch-blob/from.js'
|
|
77
|
+
import {File, Blob, blobFrom, blobFromSync, fileFrom, fileFromSync} from 'fetch-blob/from.js'
|
|
78
|
+
|
|
79
|
+
const fsFile = fileFromSync('./2-GiB-file.bin', 'application/octet-stream')
|
|
80
|
+
const fsBlob = await blobFrom('./2-GiB-file.mp4')
|
|
81
|
+
|
|
82
|
+
// Not a 4 GiB memory snapshot, just holds references
|
|
83
|
+
// points to where data is located on the disk
|
|
84
|
+
const blob = new Blob([fsFile, fsBlob, 'memory', new Uint8Array(10)])
|
|
85
|
+
console.log(blob.size) // ~4 GiB
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
`blobFrom|blobFromSync|fileFrom|fileFromSync(path, [mimetype])`
|
|
89
|
+
|
|
90
|
+
### Creating Blobs backed up by other async sources
|
|
91
|
+
Our Blob & File class are more generic then any other polyfills in the way that it can accept any blob look-a-like item
|
|
92
|
+
An example of this is that our blob implementation can be constructed with parts coming from [BlobDataItem](https://github.com/node-fetch/fetch-blob/blob/8ef89adad40d255a3bbd55cf38b88597c1cd5480/from.js#L32) (aka a filepath) or from [buffer.Blob](https://nodejs.org/api/buffer.html#buffer_new_buffer_blob_sources_options), It dose not have to implement all the methods - just enough that it can be read/understood by our Blob implementation. The minium requirements is that it has `Symbol.toStringTag`, `size`, `slice()` and either a `stream()` or a `arrayBuffer()` method. If you then wrap it in our Blob or File `new Blob([blobDataItem])` then you get all of the other methods that should be implemented in a blob or file
|
|
93
|
+
|
|
94
|
+
An example of this could be to create a file or blob like item coming from a remote HTTP request. Or from a DataBase
|
|
95
|
+
|
|
96
|
+
See the [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/API/Blob) and [tests](https://github.com/node-fetch/fetch-blob/blob/master/test.js) for more details of how to use the Blob.
|
|
97
|
+
|
|
98
|
+
[npm-image]: https://flat.badgen.net/npm/v/fetch-blob
|
|
99
|
+
[npm-url]: https://www.npmjs.com/package/fetch-blob
|
|
100
|
+
[ci-image]: https://github.com/node-fetch/fetch-blob/workflows/CI/badge.svg
|
|
101
|
+
[ci-url]: https://github.com/node-fetch/fetch-blob/actions
|
|
102
|
+
[codecov-image]: https://flat.badgen.net/codecov/c/github/node-fetch/fetch-blob/master
|
|
103
|
+
[codecov-url]: https://codecov.io/gh/node-fetch/fetch-blob
|
|
104
|
+
[install-size-image]: https://flat.badgen.net/packagephobia/install/fetch-blob
|
|
105
|
+
[install-size-url]: https://packagephobia.now.sh/result?p=fetch-blob
|
|
106
|
+
[fs-blobs]: https://github.com/nodejs/node/issues/37340
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import Blob from './index.js'
|
|
2
|
+
|
|
3
|
+
const _File = class File extends Blob {
|
|
4
|
+
#lastModified = 0
|
|
5
|
+
#name = ''
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @param {*[]} fileBits
|
|
9
|
+
* @param {string} fileName
|
|
10
|
+
* @param {{lastModified?: number, type?: string}} options
|
|
11
|
+
*/// @ts-ignore
|
|
12
|
+
constructor (fileBits, fileName, options = {}) {
|
|
13
|
+
if (arguments.length < 2) {
|
|
14
|
+
throw new TypeError(`Failed to construct 'File': 2 arguments required, but only ${arguments.length} present.`)
|
|
15
|
+
}
|
|
16
|
+
super(fileBits, options)
|
|
17
|
+
|
|
18
|
+
if (options === null) options = {}
|
|
19
|
+
|
|
20
|
+
// Simulate WebIDL type casting for NaN value in lastModified option.
|
|
21
|
+
const lastModified = options.lastModified === undefined ? Date.now() : Number(options.lastModified)
|
|
22
|
+
if (!Number.isNaN(lastModified)) {
|
|
23
|
+
this.#lastModified = lastModified
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
this.#name = String(fileName)
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
get name () {
|
|
30
|
+
return this.#name
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
get lastModified () {
|
|
34
|
+
return this.#lastModified
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
get [Symbol.toStringTag] () {
|
|
38
|
+
return 'File'
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
static [Symbol.hasInstance] (object) {
|
|
42
|
+
return !!object && object instanceof Blob &&
|
|
43
|
+
/^(File)$/.test(object[Symbol.toStringTag])
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/** @type {typeof globalThis.File} */// @ts-ignore
|
|
48
|
+
export const File = _File
|
|
49
|
+
export default File
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export default blobFromSync;
|
|
2
|
+
/**
|
|
3
|
+
* @param {string} path filepath on the disk
|
|
4
|
+
* @param {string} [type] mimetype to use
|
|
5
|
+
*/
|
|
6
|
+
export function blobFromSync(path: string, type?: string): Blob;
|
|
7
|
+
import File from "./file.js";
|
|
8
|
+
import Blob from "./index.js";
|
|
9
|
+
/**
|
|
10
|
+
* @param {string} path filepath on the disk
|
|
11
|
+
* @param {string} [type] mimetype to use
|
|
12
|
+
* @returns {Promise<Blob>}
|
|
13
|
+
*/
|
|
14
|
+
export function blobFrom(path: string, type?: string): Promise<Blob>;
|
|
15
|
+
/**
|
|
16
|
+
* @param {string} path filepath on the disk
|
|
17
|
+
* @param {string} [type] mimetype to use
|
|
18
|
+
* @returns {Promise<File>}
|
|
19
|
+
*/
|
|
20
|
+
export function fileFrom(path: string, type?: string): Promise<File>;
|
|
21
|
+
/**
|
|
22
|
+
* @param {string} path filepath on the disk
|
|
23
|
+
* @param {string} [type] mimetype to use
|
|
24
|
+
*/
|
|
25
|
+
export function fileFromSync(path: string, type?: string): File;
|
|
26
|
+
export { File, Blob };
|