jass 0.9.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE +47 -0
- data/README.md +45 -0
- data/lib/jass.rb +55 -0
- data/lib/jass/base.rb +141 -0
- data/lib/jass/bundle_processor.rb +28 -0
- data/lib/jass/compiler.rb +112 -0
- data/lib/jass/dependency.rb +14 -0
- data/lib/jass/errors.rb +29 -0
- data/lib/jass/es6_processor.rb +17 -0
- data/lib/jass/function.rb +13 -0
- data/lib/jass/global_directive_processor.rb +12 -0
- data/lib/jass/plugin.rb +13 -0
- data/lib/jass/railtie.rb +12 -0
- data/lib/jass/version.rb +3 -0
- data/vendor/node_modules/@types/acorn/index.d.ts +256 -0
- data/vendor/node_modules/@types/acorn/package.json +29 -0
- data/vendor/node_modules/@types/estree/index.d.ts +546 -0
- data/vendor/node_modules/@types/estree/package.json +22 -0
- data/vendor/node_modules/acorn-dynamic-import/lib/index.js +17 -0
- data/vendor/node_modules/acorn-dynamic-import/lib/inject.js +72 -0
- data/vendor/node_modules/acorn-dynamic-import/lib/walk.js +22 -0
- data/vendor/node_modules/acorn-dynamic-import/package.json +45 -0
- data/vendor/node_modules/acorn-dynamic-import/src/index.js +4 -0
- data/vendor/node_modules/acorn-dynamic-import/src/inject.js +52 -0
- data/vendor/node_modules/acorn-dynamic-import/src/walk.js +12 -0
- data/vendor/node_modules/acorn-es7-plugin/acorn-es7-plugin.js +17 -0
- data/vendor/node_modules/acorn-es7-plugin/acorn-v3.js +333 -0
- data/vendor/node_modules/acorn-es7-plugin/acorn-v4.js +194 -0
- data/vendor/node_modules/acorn-es7-plugin/package.json +29 -0
- data/vendor/node_modules/acorn-jsx/index.js +3 -0
- data/vendor/node_modules/acorn-jsx/inject.js +449 -0
- data/vendor/node_modules/acorn-jsx/package.json +28 -0
- data/vendor/node_modules/acorn-jsx/xhtml.js +255 -0
- data/vendor/node_modules/acorn/bin/_acorn.js +69 -0
- data/vendor/node_modules/acorn/bin/acorn +4 -0
- data/vendor/node_modules/acorn/bin/run_test262.js +22 -0
- data/vendor/node_modules/acorn/bin/test262.whitelist +409 -0
- data/vendor/node_modules/acorn/dist/acorn.es.js +5305 -0
- data/vendor/node_modules/acorn/dist/acorn.js +5336 -0
- data/vendor/node_modules/acorn/dist/acorn_loose.es.js +1412 -0
- data/vendor/node_modules/acorn/dist/acorn_loose.js +1422 -0
- data/vendor/node_modules/acorn/dist/walk.es.js +419 -0
- data/vendor/node_modules/acorn/dist/walk.js +439 -0
- data/vendor/node_modules/acorn/package.json +56 -0
- data/vendor/node_modules/ansi-styles/index.js +165 -0
- data/vendor/node_modules/ansi-styles/package.json +56 -0
- data/vendor/node_modules/arr-diff/index.js +58 -0
- data/vendor/node_modules/arr-diff/package.json +49 -0
- data/vendor/node_modules/arr-flatten/index.js +22 -0
- data/vendor/node_modules/arr-flatten/package.json +76 -0
- data/vendor/node_modules/array-unique/index.js +28 -0
- data/vendor/node_modules/array-unique/package.json +37 -0
- data/vendor/node_modules/braces/index.js +399 -0
- data/vendor/node_modules/braces/package.json +83 -0
- data/vendor/node_modules/buble/bin/buble +24 -0
- data/vendor/node_modules/buble/bin/handleError.js +58 -0
- data/vendor/node_modules/buble/bin/runBuble.js +150 -0
- data/vendor/node_modules/buble/bin/showHelp.js +16 -0
- data/vendor/node_modules/buble/dist/buble-browser-deps.umd.js +14857 -0
- data/vendor/node_modules/buble/dist/buble-browser.cjs.js +9941 -0
- data/vendor/node_modules/buble/dist/buble-browser.es.js +9933 -0
- data/vendor/node_modules/buble/dist/buble.cjs.js +9433 -0
- data/vendor/node_modules/buble/dist/buble.es.js +9425 -0
- data/vendor/node_modules/buble/package.json +74 -0
- data/vendor/node_modules/buble/register.js +90 -0
- data/vendor/node_modules/buble/src/index.js +98 -0
- data/vendor/node_modules/buble/src/program/BlockStatement.js +373 -0
- data/vendor/node_modules/buble/src/program/Node.js +112 -0
- data/vendor/node_modules/buble/src/program/Program.js +74 -0
- data/vendor/node_modules/buble/src/program/Scope.js +116 -0
- data/vendor/node_modules/buble/src/program/extractNames.js +35 -0
- data/vendor/node_modules/buble/src/program/keys.js +4 -0
- data/vendor/node_modules/buble/src/program/types/ArrayExpression.js +70 -0
- data/vendor/node_modules/buble/src/program/types/ArrowFunctionExpression.js +52 -0
- data/vendor/node_modules/buble/src/program/types/AssignmentExpression.js +185 -0
- data/vendor/node_modules/buble/src/program/types/BinaryExpression.js +12 -0
- data/vendor/node_modules/buble/src/program/types/BreakStatement.js +26 -0
- data/vendor/node_modules/buble/src/program/types/CallExpression.js +104 -0
- data/vendor/node_modules/buble/src/program/types/ClassBody.js +237 -0
- data/vendor/node_modules/buble/src/program/types/ClassDeclaration.js +79 -0
- data/vendor/node_modules/buble/src/program/types/ClassExpression.js +51 -0
- data/vendor/node_modules/buble/src/program/types/ContinueStatement.js +17 -0
- data/vendor/node_modules/buble/src/program/types/ExportDefaultDeclaration.js +10 -0
- data/vendor/node_modules/buble/src/program/types/ExportNamedDeclaration.js +10 -0
- data/vendor/node_modules/buble/src/program/types/ForInStatement.js +76 -0
- data/vendor/node_modules/buble/src/program/types/ForOfStatement.js +89 -0
- data/vendor/node_modules/buble/src/program/types/ForStatement.js +54 -0
- data/vendor/node_modules/buble/src/program/types/FunctionDeclaration.js +25 -0
- data/vendor/node_modules/buble/src/program/types/FunctionExpression.js +74 -0
- data/vendor/node_modules/buble/src/program/types/Identifier.js +54 -0
- data/vendor/node_modules/buble/src/program/types/IfStatement.js +29 -0
- data/vendor/node_modules/buble/src/program/types/ImportDeclaration.js +10 -0
- data/vendor/node_modules/buble/src/program/types/ImportDefaultSpecifier.js +8 -0
- data/vendor/node_modules/buble/src/program/types/ImportSpecifier.js +8 -0
- data/vendor/node_modules/buble/src/program/types/JSXAttribute.js +20 -0
- data/vendor/node_modules/buble/src/program/types/JSXClosingElement.js +27 -0
- data/vendor/node_modules/buble/src/program/types/JSXClosingFragment.js +22 -0
- data/vendor/node_modules/buble/src/program/types/JSXElement.js +57 -0
- data/vendor/node_modules/buble/src/program/types/JSXExpressionContainer.js +10 -0
- data/vendor/node_modules/buble/src/program/types/JSXFragment.js +4 -0
- data/vendor/node_modules/buble/src/program/types/JSXOpeningElement.js +93 -0
- data/vendor/node_modules/buble/src/program/types/JSXOpeningFragment.js +7 -0
- data/vendor/node_modules/buble/src/program/types/JSXSpreadAttribute.js +10 -0
- data/vendor/node_modules/buble/src/program/types/Literal.js +43 -0
- data/vendor/node_modules/buble/src/program/types/MemberExpression.js +13 -0
- data/vendor/node_modules/buble/src/program/types/NewExpression.js +55 -0
- data/vendor/node_modules/buble/src/program/types/ObjectExpression.js +250 -0
- data/vendor/node_modules/buble/src/program/types/Property.js +52 -0
- data/vendor/node_modules/buble/src/program/types/ReturnStatement.js +32 -0
- data/vendor/node_modules/buble/src/program/types/SpreadElement.js +12 -0
- data/vendor/node_modules/buble/src/program/types/Super.js +88 -0
- data/vendor/node_modules/buble/src/program/types/TaggedTemplateExpression.js +63 -0
- data/vendor/node_modules/buble/src/program/types/TemplateElement.js +7 -0
- data/vendor/node_modules/buble/src/program/types/TemplateLiteral.js +80 -0
- data/vendor/node_modules/buble/src/program/types/ThisExpression.js +31 -0
- data/vendor/node_modules/buble/src/program/types/UpdateExpression.js +32 -0
- data/vendor/node_modules/buble/src/program/types/VariableDeclaration.js +101 -0
- data/vendor/node_modules/buble/src/program/types/VariableDeclarator.js +43 -0
- data/vendor/node_modules/buble/src/program/types/index.js +98 -0
- data/vendor/node_modules/buble/src/program/types/shared/LoopStatement.js +105 -0
- data/vendor/node_modules/buble/src/program/types/shared/ModuleDeclaration.js +10 -0
- data/vendor/node_modules/buble/src/program/wrap.js +68 -0
- data/vendor/node_modules/buble/src/support.js +97 -0
- data/vendor/node_modules/buble/src/utils/CompileError.js +30 -0
- data/vendor/node_modules/buble/src/utils/array.js +11 -0
- data/vendor/node_modules/buble/src/utils/checkConst.js +8 -0
- data/vendor/node_modules/buble/src/utils/deindent.js +30 -0
- data/vendor/node_modules/buble/src/utils/destructure.js +377 -0
- data/vendor/node_modules/buble/src/utils/getSnippet.js +30 -0
- data/vendor/node_modules/buble/src/utils/isReference.js +41 -0
- data/vendor/node_modules/buble/src/utils/locate.js +20 -0
- data/vendor/node_modules/buble/src/utils/patterns.js +1 -0
- data/vendor/node_modules/buble/src/utils/removeTrailingComma.js +13 -0
- data/vendor/node_modules/buble/src/utils/reserved.js +6 -0
- data/vendor/node_modules/buble/src/utils/spread.js +70 -0
- data/vendor/node_modules/builtin-modules/builtin-modules.json +39 -0
- data/vendor/node_modules/builtin-modules/index.js +10 -0
- data/vendor/node_modules/builtin-modules/package.json +40 -0
- data/vendor/node_modules/builtin-modules/static.js +2 -0
- data/vendor/node_modules/chalk/index.js +228 -0
- data/vendor/node_modules/chalk/package.json +66 -0
- data/vendor/node_modules/chalk/templates.js +128 -0
- data/vendor/node_modules/chalk/types/index.d.ts +97 -0
- data/vendor/node_modules/color-convert/conversions.js +861 -0
- data/vendor/node_modules/color-convert/index.js +78 -0
- data/vendor/node_modules/color-convert/package.json +46 -0
- data/vendor/node_modules/color-convert/route.js +97 -0
- data/vendor/node_modules/color-name/index.js +152 -0
- data/vendor/node_modules/color-name/package.json +25 -0
- data/vendor/node_modules/color-name/test.js +7 -0
- data/vendor/node_modules/date-time/index.js +33 -0
- data/vendor/node_modules/date-time/package.json +39 -0
- data/vendor/node_modules/escape-string-regexp/index.js +11 -0
- data/vendor/node_modules/escape-string-regexp/package.json +41 -0
- data/vendor/node_modules/estree-walker/dist/estree-walker.es.js +57 -0
- data/vendor/node_modules/estree-walker/dist/estree-walker.umd.js +68 -0
- data/vendor/node_modules/estree-walker/package.json +34 -0
- data/vendor/node_modules/estree-walker/src/estree-walker.js +51 -0
- data/vendor/node_modules/expand-brackets/index.js +163 -0
- data/vendor/node_modules/expand-brackets/package.json +62 -0
- data/vendor/node_modules/expand-range/index.js +43 -0
- data/vendor/node_modules/expand-range/package.json +73 -0
- data/vendor/node_modules/extglob/index.js +178 -0
- data/vendor/node_modules/extglob/package.json +60 -0
- data/vendor/node_modules/filename-regex/index.js +10 -0
- data/vendor/node_modules/filename-regex/package.json +50 -0
- data/vendor/node_modules/fill-range/index.js +408 -0
- data/vendor/node_modules/fill-range/package.json +61 -0
- data/vendor/node_modules/for-in/index.js +16 -0
- data/vendor/node_modules/for-in/package.json +68 -0
- data/vendor/node_modules/for-own/index.js +19 -0
- data/vendor/node_modules/for-own/package.json +70 -0
- data/vendor/node_modules/glob-base/index.js +51 -0
- data/vendor/node_modules/glob-base/package.json +52 -0
- data/vendor/node_modules/glob-parent/index.js +10 -0
- data/vendor/node_modules/glob-parent/package.json +35 -0
- data/vendor/node_modules/glob-parent/test.js +28 -0
- data/vendor/node_modules/has-flag/index.js +8 -0
- data/vendor/node_modules/has-flag/package.json +44 -0
- data/vendor/node_modules/irregular-plurals/irregular-plurals.json +146 -0
- data/vendor/node_modules/irregular-plurals/package.json +39 -0
- data/vendor/node_modules/is-buffer/index.js +21 -0
- data/vendor/node_modules/is-buffer/package.json +51 -0
- data/vendor/node_modules/is-dotfile/index.js +14 -0
- data/vendor/node_modules/is-dotfile/package.json +69 -0
- data/vendor/node_modules/is-equal-shallow/index.js +27 -0
- data/vendor/node_modules/is-equal-shallow/package.json +54 -0
- data/vendor/node_modules/is-extendable/index.js +13 -0
- data/vendor/node_modules/is-extendable/package.json +51 -0
- data/vendor/node_modules/is-extglob/index.js +11 -0
- data/vendor/node_modules/is-extglob/package.json +48 -0
- data/vendor/node_modules/is-glob/index.js +14 -0
- data/vendor/node_modules/is-glob/package.json +60 -0
- data/vendor/node_modules/is-module/index.js +11 -0
- data/vendor/node_modules/is-module/package.json +20 -0
- data/vendor/node_modules/is-number/index.js +19 -0
- data/vendor/node_modules/is-number/package.json +59 -0
- data/vendor/node_modules/is-posix-bracket/index.js +10 -0
- data/vendor/node_modules/is-posix-bracket/package.json +64 -0
- data/vendor/node_modules/is-primitive/index.js +13 -0
- data/vendor/node_modules/is-primitive/package.json +46 -0
- data/vendor/node_modules/is-reference/dist/is-reference.es.js +26 -0
- data/vendor/node_modules/is-reference/dist/is-reference.js +34 -0
- data/vendor/node_modules/is-reference/dist/types/index.d.ts +2 -0
- data/vendor/node_modules/is-reference/package.json +47 -0
- data/vendor/node_modules/isarray/index.js +5 -0
- data/vendor/node_modules/isarray/package.json +45 -0
- data/vendor/node_modules/isarray/test.js +20 -0
- data/vendor/node_modules/isobject/index.js +14 -0
- data/vendor/node_modules/isobject/package.json +67 -0
- data/vendor/node_modules/kind-of/index.js +116 -0
- data/vendor/node_modules/kind-of/package.json +90 -0
- data/vendor/node_modules/locate-character/dist/locate-character.es.js +43 -0
- data/vendor/node_modules/locate-character/dist/locate-character.umd.js +54 -0
- data/vendor/node_modules/locate-character/dist/types/index.d.ts +17 -0
- data/vendor/node_modules/locate-character/package.json +41 -0
- data/vendor/node_modules/magic-string/dist/magic-string.cjs.js +1300 -0
- data/vendor/node_modules/magic-string/dist/magic-string.es.js +1296 -0
- data/vendor/node_modules/magic-string/dist/magic-string.umd.js +1352 -0
- data/vendor/node_modules/magic-string/index.d.ts +83 -0
- data/vendor/node_modules/magic-string/node_modules/vlq/dist/vlq.js +91 -0
- data/vendor/node_modules/magic-string/node_modules/vlq/package.json +27 -0
- data/vendor/node_modules/magic-string/node_modules/vlq/src/vlq.js +78 -0
- data/vendor/node_modules/magic-string/package.json +55 -0
- data/vendor/node_modules/micromatch/index.js +431 -0
- data/vendor/node_modules/micromatch/lib/chars.js +67 -0
- data/vendor/node_modules/micromatch/lib/expand.js +304 -0
- data/vendor/node_modules/micromatch/lib/glob.js +193 -0
- data/vendor/node_modules/micromatch/lib/utils.js +149 -0
- data/vendor/node_modules/micromatch/package.json +114 -0
- data/vendor/node_modules/minimist/index.js +236 -0
- data/vendor/node_modules/minimist/package.json +45 -0
- data/vendor/node_modules/nodent-compiler/compiler.js +171 -0
- data/vendor/node_modules/nodent-compiler/lib/arboriculture.js +2694 -0
- data/vendor/node_modules/nodent-compiler/lib/output.js +934 -0
- data/vendor/node_modules/nodent-compiler/lib/parser.js +291 -0
- data/vendor/node_modules/nodent-compiler/package.json +37 -0
- data/vendor/node_modules/normalize-path/index.js +19 -0
- data/vendor/node_modules/normalize-path/package.json +78 -0
- data/vendor/node_modules/object.omit/index.js +40 -0
- data/vendor/node_modules/object.omit/package.json +67 -0
- data/vendor/node_modules/os-homedir/index.js +24 -0
- data/vendor/node_modules/os-homedir/package.json +41 -0
- data/vendor/node_modules/parse-glob/index.js +156 -0
- data/vendor/node_modules/parse-glob/package.json +62 -0
- data/vendor/node_modules/parse-ms/index.js +16 -0
- data/vendor/node_modules/parse-ms/package.json +34 -0
- data/vendor/node_modules/path-parse/index.js +93 -0
- data/vendor/node_modules/path-parse/index.min.js +1 -0
- data/vendor/node_modules/path-parse/package.json +33 -0
- data/vendor/node_modules/path-parse/test.js +77 -0
- data/vendor/node_modules/path-parse/test.min.js +1 -0
- data/vendor/node_modules/plur/index.js +20 -0
- data/vendor/node_modules/plur/package.json +42 -0
- data/vendor/node_modules/preserve/index.js +54 -0
- data/vendor/node_modules/preserve/package.json +48 -0
- data/vendor/node_modules/preserve/test.js +48 -0
- data/vendor/node_modules/pretty-ms/index.js +48 -0
- data/vendor/node_modules/pretty-ms/package.json +48 -0
- data/vendor/node_modules/randomatic/index.js +82 -0
- data/vendor/node_modules/randomatic/node_modules/is-number/index.js +22 -0
- data/vendor/node_modules/randomatic/node_modules/is-number/node_modules/kind-of/index.js +116 -0
- data/vendor/node_modules/randomatic/node_modules/is-number/node_modules/kind-of/package.json +90 -0
- data/vendor/node_modules/randomatic/node_modules/is-number/package.json +83 -0
- data/vendor/node_modules/randomatic/node_modules/kind-of/index.js +119 -0
- data/vendor/node_modules/randomatic/node_modules/kind-of/package.json +90 -0
- data/vendor/node_modules/randomatic/package.json +78 -0
- data/vendor/node_modules/regex-cache/index.js +68 -0
- data/vendor/node_modules/regex-cache/package.json +64 -0
- data/vendor/node_modules/remove-trailing-separator/index.js +17 -0
- data/vendor/node_modules/remove-trailing-separator/package.json +37 -0
- data/vendor/node_modules/repeat-element/index.js +18 -0
- data/vendor/node_modules/repeat-element/package.json +44 -0
- data/vendor/node_modules/repeat-string/index.js +70 -0
- data/vendor/node_modules/repeat-string/package.json +77 -0
- data/vendor/node_modules/require-relative/index.js +33 -0
- data/vendor/node_modules/require-relative/package.json +22 -0
- data/vendor/node_modules/resolve/index.js +8 -0
- data/vendor/node_modules/resolve/lib/async.js +203 -0
- data/vendor/node_modules/resolve/lib/caller.js +8 -0
- data/vendor/node_modules/resolve/lib/core.js +53 -0
- data/vendor/node_modules/resolve/lib/core.json +69 -0
- data/vendor/node_modules/resolve/lib/node-modules-paths.js +45 -0
- data/vendor/node_modules/resolve/lib/sync.js +93 -0
- data/vendor/node_modules/resolve/package.json +40 -0
- data/vendor/node_modules/rollup-plugin-commonjs/dist/rollup-plugin-commonjs.cjs.js +804 -0
- data/vendor/node_modules/rollup-plugin-commonjs/dist/rollup-plugin-commonjs.es.js +800 -0
- data/vendor/node_modules/rollup-plugin-commonjs/package.json +52 -0
- data/vendor/node_modules/rollup-plugin-commonjs/src/ast-utils.js +104 -0
- data/vendor/node_modules/rollup-plugin-commonjs/src/defaultResolver.js +39 -0
- data/vendor/node_modules/rollup-plugin-commonjs/src/helpers.js +19 -0
- data/vendor/node_modules/rollup-plugin-commonjs/src/index.js +198 -0
- data/vendor/node_modules/rollup-plugin-commonjs/src/transform.js +431 -0
- data/vendor/node_modules/rollup-plugin-commonjs/src/utils.js +13 -0
- data/vendor/node_modules/rollup-plugin-node-resolve/dist/rollup-plugin-node-resolve.cjs.js +218 -0
- data/vendor/node_modules/rollup-plugin-node-resolve/dist/rollup-plugin-node-resolve.es.js +214 -0
- data/vendor/node_modules/rollup-plugin-node-resolve/package.json +51 -0
- data/vendor/node_modules/rollup-plugin-node-resolve/src/empty.js +1 -0
- data/vendor/node_modules/rollup-plugin-node-resolve/src/index.js +205 -0
- data/vendor/node_modules/rollup-pluginutils/dist/pluginutils.cjs.js +223 -0
- data/vendor/node_modules/rollup-pluginutils/dist/pluginutils.es.js +214 -0
- data/vendor/node_modules/rollup-pluginutils/dist/pluginutils.es6.js +217 -0
- data/vendor/node_modules/rollup-pluginutils/node_modules/estree-walker/dist/estree-walker.es.js +55 -0
- data/vendor/node_modules/rollup-pluginutils/node_modules/estree-walker/dist/estree-walker.es6.js +59 -0
- data/vendor/node_modules/rollup-pluginutils/node_modules/estree-walker/dist/estree-walker.umd.js +65 -0
- data/vendor/node_modules/rollup-pluginutils/node_modules/estree-walker/package.json +33 -0
- data/vendor/node_modules/rollup-pluginutils/node_modules/estree-walker/src/estree-walker.js +49 -0
- data/vendor/node_modules/rollup-pluginutils/package.json +40 -0
- data/vendor/node_modules/rollup-pluginutils/src/addExtension.js +6 -0
- data/vendor/node_modules/rollup-pluginutils/src/attachScopes.js +147 -0
- data/vendor/node_modules/rollup-pluginutils/src/createFilter.js +33 -0
- data/vendor/node_modules/rollup-pluginutils/src/index.js +4 -0
- data/vendor/node_modules/rollup-pluginutils/src/makeLegalIdentifier.js +15 -0
- data/vendor/node_modules/rollup-pluginutils/src/utils/ensureArray.js +5 -0
- data/vendor/node_modules/rollup/bin/rollup +4085 -0
- data/vendor/node_modules/rollup/dist/rollup.browser.js +19829 -0
- data/vendor/node_modules/rollup/dist/rollup.es.js +23586 -0
- data/vendor/node_modules/rollup/dist/rollup.js +23597 -0
- data/vendor/node_modules/rollup/dist/typings/Chunk.d.ts +85 -0
- data/vendor/node_modules/rollup/dist/typings/ExternalModule.d.ts +30 -0
- data/vendor/node_modules/rollup/dist/typings/Graph.d.ts +47 -0
- data/vendor/node_modules/rollup/dist/typings/Module.d.ts +130 -0
- data/vendor/node_modules/rollup/dist/typings/ast/CallOptions.d.ts +20 -0
- data/vendor/node_modules/rollup/dist/typings/ast/Entity.d.ts +16 -0
- data/vendor/node_modules/rollup/dist/typings/ast/ExecutionPathOptions.d.ts +57 -0
- data/vendor/node_modules/rollup/dist/typings/ast/clone.d.ts +1 -0
- data/vendor/node_modules/rollup/dist/typings/ast/enhance.d.ts +3 -0
- data/vendor/node_modules/rollup/dist/typings/ast/keys.d.ts +4 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/ArrayExpression.d.ts +14 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/ArrayPattern.d.ts +14 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/ArrowFunctionExpression.d.ts +25 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/AssignmentExpression.d.ts +13 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/AssignmentPattern.d.ts +16 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/AssignmentProperty.d.ts +10 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/AwaitExpression.d.ts +8 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/BinaryExpression.d.ts +13 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/BlockStatement.d.ts +19 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/BreakStatement.d.ts +9 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/CallExpression.d.ts +22 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/CatchClause.d.ts +14 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/ClassBody.d.ts +13 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/ClassDeclaration.d.ts +14 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/ClassExpression.d.ts +10 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/ConditionalExpression.d.ts +28 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/DoWhileStatement.d.ts +9 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/EmptyStatement.d.ts +8 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/ExportAllDeclaration.d.ts +12 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/ExportDefaultDeclaration.d.ts +21 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/ExportNamedDeclaration.d.ts +21 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/ExportSpecifier.d.ts +8 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/ExpressionStatement.d.ts +10 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/ForInStatement.d.ts +20 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/ForOfStatement.d.ts +21 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/ForStatement.d.ts +19 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/FunctionDeclaration.d.ts +9 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/FunctionExpression.d.ts +6 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/Identifier.d.ts +29 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/IfStatement.d.ts +17 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/Import.d.ts +14 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/ImportDeclaration.d.ts +17 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/ImportDefaultSpecifier.d.ts +7 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/ImportNamespaceSpecifier.d.ts +7 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/ImportSpecifier.d.ts +8 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/LabeledStatement.d.ts +10 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/Literal.d.ts +22 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/LogicalExpression.d.ts +23 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/MemberExpression.d.ts +34 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/MethodDefinition.d.ts +16 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/NewExpression.d.ts +14 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/NodeType.d.ts +64 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/ObjectExpression.d.ts +22 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/ObjectPattern.d.ts +15 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/Program.d.ts +9 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/Property.d.ts +30 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/RestElement.d.ts +14 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/ReturnStatement.d.ts +9 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/SequenceExpression.d.ts +13 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/SpreadElement.d.ts +6 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/SwitchCase.d.ts +11 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/SwitchStatement.d.ts +12 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/TaggedTemplateExpression.d.ts +13 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/TemplateElement.d.ts +12 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/TemplateLiteral.d.ts +12 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/ThisExpression.d.ts +17 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/ThrowStatement.d.ts +8 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/UnaryExpression.d.ts +16 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/UnknownNode.d.ts +5 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/UpdateExpression.d.ts +13 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/VariableDeclaration.d.ts +21 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/VariableDeclarator.d.ts +13 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/WhileStatement.d.ts +9 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/YieldExpression.d.ts +9 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/index.d.ts +6 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/shared/ClassNode.d.ts +17 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/shared/Expression.d.ts +21 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/shared/FunctionNode.d.ts +25 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/shared/Node.d.ts +133 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/shared/Pattern.d.ts +4 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/shared/pureFunctions.d.ts +4 -0
- data/vendor/node_modules/rollup/dist/typings/ast/scopes/BlockScope.d.ts +9 -0
- data/vendor/node_modules/rollup/dist/typings/ast/scopes/CatchScope.d.ts +10 -0
- data/vendor/node_modules/rollup/dist/typings/ast/scopes/FunctionScope.d.ts +20 -0
- data/vendor/node_modules/rollup/dist/typings/ast/scopes/GlobalScope.d.ts +7 -0
- data/vendor/node_modules/rollup/dist/typings/ast/scopes/ModuleScope.d.ts +11 -0
- data/vendor/node_modules/rollup/dist/typings/ast/scopes/ParameterScope.d.ts +16 -0
- data/vendor/node_modules/rollup/dist/typings/ast/scopes/ReturnValueScope.d.ts +11 -0
- data/vendor/node_modules/rollup/dist/typings/ast/scopes/Scope.d.ts +42 -0
- data/vendor/node_modules/rollup/dist/typings/ast/utils/extractNames.d.ts +2 -0
- data/vendor/node_modules/rollup/dist/typings/ast/values.d.ts +31 -0
- data/vendor/node_modules/rollup/dist/typings/ast/variables/ArgumentsVariable.d.ts +15 -0
- data/vendor/node_modules/rollup/dist/typings/ast/variables/ExportDefaultVariable.d.ts +16 -0
- data/vendor/node_modules/rollup/dist/typings/ast/variables/ExternalVariable.d.ts +12 -0
- data/vendor/node_modules/rollup/dist/typings/ast/variables/GlobalVariable.d.ts +11 -0
- data/vendor/node_modules/rollup/dist/typings/ast/variables/LocalVariable.d.ts +21 -0
- data/vendor/node_modules/rollup/dist/typings/ast/variables/NamespaceVariable.d.ts +20 -0
- data/vendor/node_modules/rollup/dist/typings/ast/variables/ParameterVariable.d.ts +5 -0
- data/vendor/node_modules/rollup/dist/typings/ast/variables/ReplaceableInitializationVariable.d.ts +14 -0
- data/vendor/node_modules/rollup/dist/typings/ast/variables/ThisVariable.d.ts +4 -0
- data/vendor/node_modules/rollup/dist/typings/ast/variables/Variable.d.ts +43 -0
- data/vendor/node_modules/rollup/dist/typings/ast/variables/VariableReassignmentTracker.d.ts +11 -0
- data/vendor/node_modules/rollup/dist/typings/finalisers/amd.d.ts +11 -0
- data/vendor/node_modules/rollup/dist/typings/finalisers/cjs.d.ts +10 -0
- data/vendor/node_modules/rollup/dist/typings/finalisers/es.d.ts +9 -0
- data/vendor/node_modules/rollup/dist/typings/finalisers/iife.d.ts +10 -0
- data/vendor/node_modules/rollup/dist/typings/finalisers/index.d.ts +15 -0
- data/vendor/node_modules/rollup/dist/typings/finalisers/shared/esModuleExport.d.ts +2 -0
- data/vendor/node_modules/rollup/dist/typings/finalisers/shared/getExportBlock.d.ts +2 -0
- data/vendor/node_modules/rollup/dist/typings/finalisers/shared/getGlobalNameMaker.d.ts +4 -0
- data/vendor/node_modules/rollup/dist/typings/finalisers/shared/getInteropBlock.d.ts +3 -0
- data/vendor/node_modules/rollup/dist/typings/finalisers/shared/sanitize.d.ts +2 -0
- data/vendor/node_modules/rollup/dist/typings/finalisers/shared/setupNamespace.d.ts +2 -0
- data/vendor/node_modules/rollup/dist/typings/finalisers/shared/trimEmptyImports.d.ts +2 -0
- data/vendor/node_modules/rollup/dist/typings/finalisers/shared/warnOnBuiltins.d.ts +2 -0
- data/vendor/node_modules/rollup/dist/typings/finalisers/system.d.ts +8 -0
- data/vendor/node_modules/rollup/dist/typings/finalisers/umd.d.ts +10 -0
- data/vendor/node_modules/rollup/dist/typings/node-entry.d.ts +6 -0
- data/vendor/node_modules/rollup/dist/typings/rollup/index.d.ts +167 -0
- data/vendor/node_modules/rollup/dist/typings/utils/callIfFunction.d.ts +1 -0
- data/vendor/node_modules/rollup/dist/typings/utils/collapseSourcemaps.d.ts +5 -0
- data/vendor/node_modules/rollup/dist/typings/utils/commondir.d.ts +1 -0
- data/vendor/node_modules/rollup/dist/typings/utils/defaults.d.ts +6 -0
- data/vendor/node_modules/rollup/dist/typings/utils/deprecateOptions.d.ts +6 -0
- data/vendor/node_modules/rollup/dist/typings/utils/ensureArray.d.ts +2 -0
- data/vendor/node_modules/rollup/dist/typings/utils/entryHashing.d.ts +3 -0
- data/vendor/node_modules/rollup/dist/typings/utils/error.d.ts +18 -0
- data/vendor/node_modules/rollup/dist/typings/utils/first-sync.d.ts +1 -0
- data/vendor/node_modules/rollup/dist/typings/utils/first.d.ts +1 -0
- data/vendor/node_modules/rollup/dist/typings/utils/flushTime.d.ts +5 -0
- data/vendor/node_modules/rollup/dist/typings/utils/fs.d.ts +3 -0
- data/vendor/node_modules/rollup/dist/typings/utils/getCodeFrame.d.ts +1 -0
- data/vendor/node_modules/rollup/dist/typings/utils/getExportMode.d.ts +3 -0
- data/vendor/node_modules/rollup/dist/typings/utils/getIndentString.d.ts +4 -0
- data/vendor/node_modules/rollup/dist/typings/utils/identifierHelpers.d.ts +3 -0
- data/vendor/node_modules/rollup/dist/typings/utils/mergeOptions.d.ts +19 -0
- data/vendor/node_modules/rollup/dist/typings/utils/object.d.ts +7 -0
- data/vendor/node_modules/rollup/dist/typings/utils/path.d.ts +6 -0
- data/vendor/node_modules/rollup/dist/typings/utils/promise.d.ts +2 -0
- data/vendor/node_modules/rollup/dist/typings/utils/relativeId.d.ts +1 -0
- data/vendor/node_modules/rollup/dist/typings/utils/renderHelpers.d.ts +26 -0
- data/vendor/node_modules/rollup/dist/typings/utils/sourceMappingURL.d.ts +3 -0
- data/vendor/node_modules/rollup/dist/typings/utils/timers.d.ts +7 -0
- data/vendor/node_modules/rollup/dist/typings/utils/transform.d.ts +25 -0
- data/vendor/node_modules/rollup/dist/typings/utils/transformBundle.d.ts +3 -0
- data/vendor/node_modules/rollup/dist/typings/watch/chokidar.d.ts +3 -0
- data/vendor/node_modules/rollup/dist/typings/watch/fileWatchers.d.ts +14 -0
- data/vendor/node_modules/rollup/dist/typings/watch/index.d.ts +47 -0
- data/vendor/node_modules/rollup/package.json +122 -0
- data/vendor/node_modules/rollup/typings/package.json.d.ts +3 -0
- data/vendor/node_modules/signal-exit/index.js +157 -0
- data/vendor/node_modules/signal-exit/package.json +38 -0
- data/vendor/node_modules/signal-exit/signals.js +53 -0
- data/vendor/node_modules/source-map/dist/source-map.debug.js +3091 -0
- data/vendor/node_modules/source-map/dist/source-map.js +3090 -0
- data/vendor/node_modules/source-map/dist/source-map.min.js +2 -0
- data/vendor/node_modules/source-map/lib/array-set.js +121 -0
- data/vendor/node_modules/source-map/lib/base64-vlq.js +140 -0
- data/vendor/node_modules/source-map/lib/base64.js +67 -0
- data/vendor/node_modules/source-map/lib/binary-search.js +111 -0
- data/vendor/node_modules/source-map/lib/mapping-list.js +79 -0
- data/vendor/node_modules/source-map/lib/quick-sort.js +114 -0
- data/vendor/node_modules/source-map/lib/source-map-consumer.js +1082 -0
- data/vendor/node_modules/source-map/lib/source-map-generator.js +416 -0
- data/vendor/node_modules/source-map/lib/source-node.js +413 -0
- data/vendor/node_modules/source-map/lib/util.js +417 -0
- data/vendor/node_modules/source-map/package.json +72 -0
- data/vendor/node_modules/source-map/source-map.js +8 -0
- data/vendor/node_modules/sourcemap-codec/dist/sourcemap-codec.es.js +129 -0
- data/vendor/node_modules/sourcemap-codec/dist/sourcemap-codec.umd.js +140 -0
- data/vendor/node_modules/sourcemap-codec/dist/types/sourcemap-codec.d.ts +5 -0
- data/vendor/node_modules/sourcemap-codec/package.json +52 -0
- data/vendor/node_modules/supports-color/browser.js +5 -0
- data/vendor/node_modules/supports-color/index.js +135 -0
- data/vendor/node_modules/supports-color/package.json +53 -0
- data/vendor/node_modules/time-zone/index.js +10 -0
- data/vendor/node_modules/time-zone/package.json +35 -0
- data/vendor/node_modules/vlq/dist/types/vlq.d.ts +2 -0
- data/vendor/node_modules/vlq/dist/vlq.es.js +64 -0
- data/vendor/node_modules/vlq/dist/vlq.js +75 -0
- data/vendor/node_modules/vlq/package.json +30 -0
- data/vendor/package.json +15 -0
- data/vendor/yarn.lock +453 -0
- metadata +641 -0
@@ -0,0 +1,30 @@
|
|
1
|
+
function pad(num, len) {
|
2
|
+
let result = String(num);
|
3
|
+
return result + repeat(' ', len - result.length);
|
4
|
+
}
|
5
|
+
|
6
|
+
function repeat(str, times) {
|
7
|
+
let result = '';
|
8
|
+
while (times--) result += str;
|
9
|
+
return result;
|
10
|
+
}
|
11
|
+
|
12
|
+
export default function getSnippet(source, loc, length = 1) {
|
13
|
+
const first = Math.max(loc.line - 5, 0);
|
14
|
+
const last = loc.line;
|
15
|
+
|
16
|
+
const numDigits = String(last).length;
|
17
|
+
|
18
|
+
const lines = source.split('\n').slice(first, last);
|
19
|
+
|
20
|
+
const lastLine = lines[lines.length - 1];
|
21
|
+
const offset = lastLine.slice(0, loc.column).replace(/\t/g, ' ').length;
|
22
|
+
|
23
|
+
let snippet = lines
|
24
|
+
.map((line, i) => `${pad(i + first + 1, numDigits)} : ${line.replace(/\t/g, ' ')}`)
|
25
|
+
.join('\n');
|
26
|
+
|
27
|
+
snippet += '\n' + repeat(' ', numDigits + 3 + offset) + repeat('^', length);
|
28
|
+
|
29
|
+
return snippet;
|
30
|
+
}
|
@@ -0,0 +1,41 @@
|
|
1
|
+
export default function isReference(node, parent) {
|
2
|
+
if (node.type === 'MemberExpression') {
|
3
|
+
return !node.computed && isReference(node.object, node);
|
4
|
+
}
|
5
|
+
|
6
|
+
if (node.type === 'Identifier') {
|
7
|
+
// the only time we could have an identifier node without a parent is
|
8
|
+
// if it's the entire body of a function without a block statement –
|
9
|
+
// i.e. an arrow function expression like `a => a`
|
10
|
+
if (!parent) return true;
|
11
|
+
|
12
|
+
if (/(Function|Class)Expression/.test(parent.type)) return false;
|
13
|
+
|
14
|
+
if (parent.type === 'VariableDeclarator') return node === parent.init;
|
15
|
+
|
16
|
+
// TODO is this right?
|
17
|
+
if (
|
18
|
+
parent.type === 'MemberExpression' ||
|
19
|
+
parent.type === 'MethodDefinition'
|
20
|
+
) {
|
21
|
+
return parent.computed || node === parent.object;
|
22
|
+
}
|
23
|
+
|
24
|
+
if (parent.type === 'ArrayPattern') return false;
|
25
|
+
|
26
|
+
// disregard the `bar` in `{ bar: foo }`, but keep it in `{ [bar]: foo }`
|
27
|
+
if (parent.type === 'Property') {
|
28
|
+
if (parent.parent.type === 'ObjectPattern') return false;
|
29
|
+
return parent.computed || node === parent.value;
|
30
|
+
}
|
31
|
+
|
32
|
+
// disregard the `bar` in `class Foo { bar () {...} }`
|
33
|
+
if (parent.type === 'MethodDefinition') return false;
|
34
|
+
|
35
|
+
// disregard the `bar` in `export { foo as bar }`
|
36
|
+
if (parent.type === 'ExportSpecifier' && node !== parent.local)
|
37
|
+
return false;
|
38
|
+
|
39
|
+
return true;
|
40
|
+
}
|
41
|
+
}
|
@@ -0,0 +1,20 @@
|
|
1
|
+
export default function locate(source, index) {
|
2
|
+
var lines = source.split('\n');
|
3
|
+
var len = lines.length;
|
4
|
+
|
5
|
+
var lineStart = 0;
|
6
|
+
var i;
|
7
|
+
|
8
|
+
for (i = 0; i < len; i += 1) {
|
9
|
+
var line = lines[i];
|
10
|
+
var lineEnd = lineStart + line.length + 1; // +1 for newline
|
11
|
+
|
12
|
+
if (lineEnd > index) {
|
13
|
+
return { line: i + 1, column: index - lineStart, char: i };
|
14
|
+
}
|
15
|
+
|
16
|
+
lineStart = lineEnd;
|
17
|
+
}
|
18
|
+
|
19
|
+
throw new Error('Could not determine location of character');
|
20
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
export const loopStatement = /(?:For(?:In|Of)?|While)Statement/;
|
@@ -0,0 +1,13 @@
|
|
1
|
+
export default function removeTrailingComma(code, c) {
|
2
|
+
while (code.original[c] !== ')') {
|
3
|
+
if (code.original[c] === ',') {
|
4
|
+
code.remove(c, c + 1);
|
5
|
+
return;
|
6
|
+
}
|
7
|
+
|
8
|
+
if (code.original[c] === '/') {
|
9
|
+
c = code.original.indexOf(code.original[c + 1] === '/' ? '\n' : '*/', c) + 1;
|
10
|
+
}
|
11
|
+
c += 1;
|
12
|
+
}
|
13
|
+
}
|
@@ -0,0 +1,6 @@
|
|
1
|
+
let reserved = Object.create(null);
|
2
|
+
'do if in for let new try var case else enum eval null this true void with await break catch class const false super throw while yield delete export import public return static switch typeof default extends finally package private continue debugger function arguments interface protected implements instanceof'
|
3
|
+
.split(' ')
|
4
|
+
.forEach(word => (reserved[word] = true));
|
5
|
+
|
6
|
+
export default reserved;
|
@@ -0,0 +1,70 @@
|
|
1
|
+
export function isArguments(node) {
|
2
|
+
return node.type === 'Identifier' && node.name === 'arguments';
|
3
|
+
}
|
4
|
+
|
5
|
+
export default function spread(
|
6
|
+
code,
|
7
|
+
elements,
|
8
|
+
start,
|
9
|
+
argumentsArrayAlias,
|
10
|
+
isNew
|
11
|
+
) {
|
12
|
+
let i = elements.length;
|
13
|
+
let firstSpreadIndex = -1;
|
14
|
+
|
15
|
+
while (i--) {
|
16
|
+
const element = elements[i];
|
17
|
+
if (element && element.type === 'SpreadElement') {
|
18
|
+
if (isArguments(element.argument)) {
|
19
|
+
code.overwrite(
|
20
|
+
element.argument.start,
|
21
|
+
element.argument.end,
|
22
|
+
argumentsArrayAlias
|
23
|
+
);
|
24
|
+
}
|
25
|
+
|
26
|
+
firstSpreadIndex = i;
|
27
|
+
}
|
28
|
+
}
|
29
|
+
|
30
|
+
if (firstSpreadIndex === -1) return false; // false indicates no spread elements
|
31
|
+
|
32
|
+
if (isNew) {
|
33
|
+
for (i = 0; i < elements.length; i += 1) {
|
34
|
+
let element = elements[i];
|
35
|
+
if (element.type === 'SpreadElement') {
|
36
|
+
code.remove(element.start, element.argument.start);
|
37
|
+
} else {
|
38
|
+
code.prependRight(element.start, '[');
|
39
|
+
code.prependRight(element.end, ']');
|
40
|
+
}
|
41
|
+
}
|
42
|
+
|
43
|
+
return true; // true indicates some spread elements
|
44
|
+
}
|
45
|
+
|
46
|
+
let element = elements[firstSpreadIndex];
|
47
|
+
const previousElement = elements[firstSpreadIndex - 1];
|
48
|
+
|
49
|
+
if (!previousElement) {
|
50
|
+
code.remove(start, element.start);
|
51
|
+
code.overwrite(element.end, elements[1].start, '.concat( ');
|
52
|
+
} else {
|
53
|
+
code.overwrite(previousElement.end, element.start, ' ].concat( ');
|
54
|
+
}
|
55
|
+
|
56
|
+
for (i = firstSpreadIndex; i < elements.length; i += 1) {
|
57
|
+
element = elements[i];
|
58
|
+
|
59
|
+
if (element) {
|
60
|
+
if (element.type === 'SpreadElement') {
|
61
|
+
code.remove(element.start, element.argument.start);
|
62
|
+
} else {
|
63
|
+
code.appendLeft(element.start, '[');
|
64
|
+
code.appendLeft(element.end, ']');
|
65
|
+
}
|
66
|
+
}
|
67
|
+
}
|
68
|
+
|
69
|
+
return true; // true indicates some spread elements
|
70
|
+
}
|
@@ -0,0 +1,39 @@
|
|
1
|
+
[
|
2
|
+
"assert",
|
3
|
+
"async_hooks",
|
4
|
+
"buffer",
|
5
|
+
"child_process",
|
6
|
+
"cluster",
|
7
|
+
"console",
|
8
|
+
"constants",
|
9
|
+
"crypto",
|
10
|
+
"dgram",
|
11
|
+
"dns",
|
12
|
+
"domain",
|
13
|
+
"events",
|
14
|
+
"fs",
|
15
|
+
"http",
|
16
|
+
"http2",
|
17
|
+
"https",
|
18
|
+
"inspector",
|
19
|
+
"module",
|
20
|
+
"net",
|
21
|
+
"os",
|
22
|
+
"path",
|
23
|
+
"perf_hooks",
|
24
|
+
"process",
|
25
|
+
"punycode",
|
26
|
+
"querystring",
|
27
|
+
"readline",
|
28
|
+
"repl",
|
29
|
+
"stream",
|
30
|
+
"string_decoder",
|
31
|
+
"timers",
|
32
|
+
"tls",
|
33
|
+
"tty",
|
34
|
+
"url",
|
35
|
+
"util",
|
36
|
+
"v8",
|
37
|
+
"vm",
|
38
|
+
"zlib"
|
39
|
+
]
|
@@ -0,0 +1,40 @@
|
|
1
|
+
{
|
2
|
+
"name": "builtin-modules",
|
3
|
+
"version": "2.0.0",
|
4
|
+
"description": "List of the Node.js builtin modules",
|
5
|
+
"license": "MIT",
|
6
|
+
"repository": "sindresorhus/builtin-modules",
|
7
|
+
"author": {
|
8
|
+
"name": "Sindre Sorhus",
|
9
|
+
"email": "sindresorhus@gmail.com",
|
10
|
+
"url": "sindresorhus.com"
|
11
|
+
},
|
12
|
+
"engines": {
|
13
|
+
"node": ">=4"
|
14
|
+
},
|
15
|
+
"scripts": {
|
16
|
+
"test": "xo && ava",
|
17
|
+
"make": "node make.js"
|
18
|
+
},
|
19
|
+
"files": [
|
20
|
+
"index.js",
|
21
|
+
"static.js",
|
22
|
+
"builtin-modules.json"
|
23
|
+
],
|
24
|
+
"keywords": [
|
25
|
+
"builtin",
|
26
|
+
"built-in",
|
27
|
+
"builtins",
|
28
|
+
"node",
|
29
|
+
"modules",
|
30
|
+
"core",
|
31
|
+
"bundled",
|
32
|
+
"list",
|
33
|
+
"array",
|
34
|
+
"names"
|
35
|
+
],
|
36
|
+
"devDependencies": {
|
37
|
+
"ava": "*",
|
38
|
+
"xo": "*"
|
39
|
+
}
|
40
|
+
}
|
@@ -0,0 +1,228 @@
|
|
1
|
+
'use strict';
|
2
|
+
const escapeStringRegexp = require('escape-string-regexp');
|
3
|
+
const ansiStyles = require('ansi-styles');
|
4
|
+
const stdoutColor = require('supports-color').stdout;
|
5
|
+
|
6
|
+
const template = require('./templates.js');
|
7
|
+
|
8
|
+
const isSimpleWindowsTerm = process.platform === 'win32' && !(process.env.TERM || '').toLowerCase().startsWith('xterm');
|
9
|
+
|
10
|
+
// `supportsColor.level` → `ansiStyles.color[name]` mapping
|
11
|
+
const levelMapping = ['ansi', 'ansi', 'ansi256', 'ansi16m'];
|
12
|
+
|
13
|
+
// `color-convert` models to exclude from the Chalk API due to conflicts and such
|
14
|
+
const skipModels = new Set(['gray']);
|
15
|
+
|
16
|
+
const styles = Object.create(null);
|
17
|
+
|
18
|
+
function applyOptions(obj, options) {
|
19
|
+
options = options || {};
|
20
|
+
|
21
|
+
// Detect level if not set manually
|
22
|
+
const scLevel = stdoutColor ? stdoutColor.level : 0;
|
23
|
+
obj.level = options.level === undefined ? scLevel : options.level;
|
24
|
+
obj.enabled = 'enabled' in options ? options.enabled : obj.level > 0;
|
25
|
+
}
|
26
|
+
|
27
|
+
function Chalk(options) {
|
28
|
+
// We check for this.template here since calling `chalk.constructor()`
|
29
|
+
// by itself will have a `this` of a previously constructed chalk object
|
30
|
+
if (!this || !(this instanceof Chalk) || this.template) {
|
31
|
+
const chalk = {};
|
32
|
+
applyOptions(chalk, options);
|
33
|
+
|
34
|
+
chalk.template = function () {
|
35
|
+
const args = [].slice.call(arguments);
|
36
|
+
return chalkTag.apply(null, [chalk.template].concat(args));
|
37
|
+
};
|
38
|
+
|
39
|
+
Object.setPrototypeOf(chalk, Chalk.prototype);
|
40
|
+
Object.setPrototypeOf(chalk.template, chalk);
|
41
|
+
|
42
|
+
chalk.template.constructor = Chalk;
|
43
|
+
|
44
|
+
return chalk.template;
|
45
|
+
}
|
46
|
+
|
47
|
+
applyOptions(this, options);
|
48
|
+
}
|
49
|
+
|
50
|
+
// Use bright blue on Windows as the normal blue color is illegible
|
51
|
+
if (isSimpleWindowsTerm) {
|
52
|
+
ansiStyles.blue.open = '\u001B[94m';
|
53
|
+
}
|
54
|
+
|
55
|
+
for (const key of Object.keys(ansiStyles)) {
|
56
|
+
ansiStyles[key].closeRe = new RegExp(escapeStringRegexp(ansiStyles[key].close), 'g');
|
57
|
+
|
58
|
+
styles[key] = {
|
59
|
+
get() {
|
60
|
+
const codes = ansiStyles[key];
|
61
|
+
return build.call(this, this._styles ? this._styles.concat(codes) : [codes], this._empty, key);
|
62
|
+
}
|
63
|
+
};
|
64
|
+
}
|
65
|
+
|
66
|
+
styles.visible = {
|
67
|
+
get() {
|
68
|
+
return build.call(this, this._styles || [], true, 'visible');
|
69
|
+
}
|
70
|
+
};
|
71
|
+
|
72
|
+
ansiStyles.color.closeRe = new RegExp(escapeStringRegexp(ansiStyles.color.close), 'g');
|
73
|
+
for (const model of Object.keys(ansiStyles.color.ansi)) {
|
74
|
+
if (skipModels.has(model)) {
|
75
|
+
continue;
|
76
|
+
}
|
77
|
+
|
78
|
+
styles[model] = {
|
79
|
+
get() {
|
80
|
+
const level = this.level;
|
81
|
+
return function () {
|
82
|
+
const open = ansiStyles.color[levelMapping[level]][model].apply(null, arguments);
|
83
|
+
const codes = {
|
84
|
+
open,
|
85
|
+
close: ansiStyles.color.close,
|
86
|
+
closeRe: ansiStyles.color.closeRe
|
87
|
+
};
|
88
|
+
return build.call(this, this._styles ? this._styles.concat(codes) : [codes], this._empty, model);
|
89
|
+
};
|
90
|
+
}
|
91
|
+
};
|
92
|
+
}
|
93
|
+
|
94
|
+
ansiStyles.bgColor.closeRe = new RegExp(escapeStringRegexp(ansiStyles.bgColor.close), 'g');
|
95
|
+
for (const model of Object.keys(ansiStyles.bgColor.ansi)) {
|
96
|
+
if (skipModels.has(model)) {
|
97
|
+
continue;
|
98
|
+
}
|
99
|
+
|
100
|
+
const bgModel = 'bg' + model[0].toUpperCase() + model.slice(1);
|
101
|
+
styles[bgModel] = {
|
102
|
+
get() {
|
103
|
+
const level = this.level;
|
104
|
+
return function () {
|
105
|
+
const open = ansiStyles.bgColor[levelMapping[level]][model].apply(null, arguments);
|
106
|
+
const codes = {
|
107
|
+
open,
|
108
|
+
close: ansiStyles.bgColor.close,
|
109
|
+
closeRe: ansiStyles.bgColor.closeRe
|
110
|
+
};
|
111
|
+
return build.call(this, this._styles ? this._styles.concat(codes) : [codes], this._empty, model);
|
112
|
+
};
|
113
|
+
}
|
114
|
+
};
|
115
|
+
}
|
116
|
+
|
117
|
+
const proto = Object.defineProperties(() => {}, styles);
|
118
|
+
|
119
|
+
function build(_styles, _empty, key) {
|
120
|
+
const builder = function () {
|
121
|
+
return applyStyle.apply(builder, arguments);
|
122
|
+
};
|
123
|
+
|
124
|
+
builder._styles = _styles;
|
125
|
+
builder._empty = _empty;
|
126
|
+
|
127
|
+
const self = this;
|
128
|
+
|
129
|
+
Object.defineProperty(builder, 'level', {
|
130
|
+
enumerable: true,
|
131
|
+
get() {
|
132
|
+
return self.level;
|
133
|
+
},
|
134
|
+
set(level) {
|
135
|
+
self.level = level;
|
136
|
+
}
|
137
|
+
});
|
138
|
+
|
139
|
+
Object.defineProperty(builder, 'enabled', {
|
140
|
+
enumerable: true,
|
141
|
+
get() {
|
142
|
+
return self.enabled;
|
143
|
+
},
|
144
|
+
set(enabled) {
|
145
|
+
self.enabled = enabled;
|
146
|
+
}
|
147
|
+
});
|
148
|
+
|
149
|
+
// See below for fix regarding invisible grey/dim combination on Windows
|
150
|
+
builder.hasGrey = this.hasGrey || key === 'gray' || key === 'grey';
|
151
|
+
|
152
|
+
// `__proto__` is used because we must return a function, but there is
|
153
|
+
// no way to create a function with a different prototype
|
154
|
+
builder.__proto__ = proto; // eslint-disable-line no-proto
|
155
|
+
|
156
|
+
return builder;
|
157
|
+
}
|
158
|
+
|
159
|
+
function applyStyle() {
|
160
|
+
// Support varags, but simply cast to string in case there's only one arg
|
161
|
+
const args = arguments;
|
162
|
+
const argsLen = args.length;
|
163
|
+
let str = String(arguments[0]);
|
164
|
+
|
165
|
+
if (argsLen === 0) {
|
166
|
+
return '';
|
167
|
+
}
|
168
|
+
|
169
|
+
if (argsLen > 1) {
|
170
|
+
// Don't slice `arguments`, it prevents V8 optimizations
|
171
|
+
for (let a = 1; a < argsLen; a++) {
|
172
|
+
str += ' ' + args[a];
|
173
|
+
}
|
174
|
+
}
|
175
|
+
|
176
|
+
if (!this.enabled || this.level <= 0 || !str) {
|
177
|
+
return this._empty ? '' : str;
|
178
|
+
}
|
179
|
+
|
180
|
+
// Turns out that on Windows dimmed gray text becomes invisible in cmd.exe,
|
181
|
+
// see https://github.com/chalk/chalk/issues/58
|
182
|
+
// If we're on Windows and we're dealing with a gray color, temporarily make 'dim' a noop.
|
183
|
+
const originalDim = ansiStyles.dim.open;
|
184
|
+
if (isSimpleWindowsTerm && this.hasGrey) {
|
185
|
+
ansiStyles.dim.open = '';
|
186
|
+
}
|
187
|
+
|
188
|
+
for (const code of this._styles.slice().reverse()) {
|
189
|
+
// Replace any instances already present with a re-opening code
|
190
|
+
// otherwise only the part of the string until said closing code
|
191
|
+
// will be colored, and the rest will simply be 'plain'.
|
192
|
+
str = code.open + str.replace(code.closeRe, code.open) + code.close;
|
193
|
+
|
194
|
+
// Close the styling before a linebreak and reopen
|
195
|
+
// after next line to fix a bleed issue on macOS
|
196
|
+
// https://github.com/chalk/chalk/pull/92
|
197
|
+
str = str.replace(/\r?\n/g, `${code.close}$&${code.open}`);
|
198
|
+
}
|
199
|
+
|
200
|
+
// Reset the original `dim` if we changed it to work around the Windows dimmed gray issue
|
201
|
+
ansiStyles.dim.open = originalDim;
|
202
|
+
|
203
|
+
return str;
|
204
|
+
}
|
205
|
+
|
206
|
+
function chalkTag(chalk, strings) {
|
207
|
+
if (!Array.isArray(strings)) {
|
208
|
+
// If chalk() was called by itself or with a string,
|
209
|
+
// return the string itself as a string.
|
210
|
+
return [].slice.call(arguments, 1).join(' ');
|
211
|
+
}
|
212
|
+
|
213
|
+
const args = [].slice.call(arguments, 2);
|
214
|
+
const parts = [strings.raw[0]];
|
215
|
+
|
216
|
+
for (let i = 1; i < strings.length; i++) {
|
217
|
+
parts.push(String(args[i - 1]).replace(/[{}\\]/g, '\\$&'));
|
218
|
+
parts.push(String(strings.raw[i]));
|
219
|
+
}
|
220
|
+
|
221
|
+
return template(chalk, parts.join(''));
|
222
|
+
}
|
223
|
+
|
224
|
+
Object.defineProperties(Chalk.prototype, styles);
|
225
|
+
|
226
|
+
module.exports = Chalk(); // eslint-disable-line new-cap
|
227
|
+
module.exports.supportsColor = stdoutColor;
|
228
|
+
module.exports.default = module.exports; // For TypeScript
|