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,149 @@
|
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
var win32 = process && process.platform === 'win32';
|
4
|
+
var path = require('path');
|
5
|
+
var fileRe = require('filename-regex');
|
6
|
+
var utils = module.exports;
|
7
|
+
|
8
|
+
/**
|
9
|
+
* Module dependencies
|
10
|
+
*/
|
11
|
+
|
12
|
+
utils.diff = require('arr-diff');
|
13
|
+
utils.unique = require('array-unique');
|
14
|
+
utils.braces = require('braces');
|
15
|
+
utils.brackets = require('expand-brackets');
|
16
|
+
utils.extglob = require('extglob');
|
17
|
+
utils.isExtglob = require('is-extglob');
|
18
|
+
utils.isGlob = require('is-glob');
|
19
|
+
utils.typeOf = require('kind-of');
|
20
|
+
utils.normalize = require('normalize-path');
|
21
|
+
utils.omit = require('object.omit');
|
22
|
+
utils.parseGlob = require('parse-glob');
|
23
|
+
utils.cache = require('regex-cache');
|
24
|
+
|
25
|
+
/**
|
26
|
+
* Get the filename of a filepath
|
27
|
+
*
|
28
|
+
* @param {String} `string`
|
29
|
+
* @return {String}
|
30
|
+
*/
|
31
|
+
|
32
|
+
utils.filename = function filename(fp) {
|
33
|
+
var seg = fp.match(fileRe());
|
34
|
+
return seg && seg[0];
|
35
|
+
};
|
36
|
+
|
37
|
+
/**
|
38
|
+
* Returns a function that returns true if the given
|
39
|
+
* pattern is the same as a given `filepath`
|
40
|
+
*
|
41
|
+
* @param {String} `pattern`
|
42
|
+
* @return {Function}
|
43
|
+
*/
|
44
|
+
|
45
|
+
utils.isPath = function isPath(pattern, opts) {
|
46
|
+
opts = opts || {};
|
47
|
+
return function(fp) {
|
48
|
+
var unixified = utils.unixify(fp, opts);
|
49
|
+
if(opts.nocase){
|
50
|
+
return pattern.toLowerCase() === unixified.toLowerCase();
|
51
|
+
}
|
52
|
+
return pattern === unixified;
|
53
|
+
};
|
54
|
+
};
|
55
|
+
|
56
|
+
/**
|
57
|
+
* Returns a function that returns true if the given
|
58
|
+
* pattern contains a `filepath`
|
59
|
+
*
|
60
|
+
* @param {String} `pattern`
|
61
|
+
* @return {Function}
|
62
|
+
*/
|
63
|
+
|
64
|
+
utils.hasPath = function hasPath(pattern, opts) {
|
65
|
+
return function(fp) {
|
66
|
+
return utils.unixify(pattern, opts).indexOf(fp) !== -1;
|
67
|
+
};
|
68
|
+
};
|
69
|
+
|
70
|
+
/**
|
71
|
+
* Returns a function that returns true if the given
|
72
|
+
* pattern matches or contains a `filepath`
|
73
|
+
*
|
74
|
+
* @param {String} `pattern`
|
75
|
+
* @return {Function}
|
76
|
+
*/
|
77
|
+
|
78
|
+
utils.matchPath = function matchPath(pattern, opts) {
|
79
|
+
var fn = (opts && opts.contains)
|
80
|
+
? utils.hasPath(pattern, opts)
|
81
|
+
: utils.isPath(pattern, opts);
|
82
|
+
return fn;
|
83
|
+
};
|
84
|
+
|
85
|
+
/**
|
86
|
+
* Returns a function that returns true if the given
|
87
|
+
* regex matches the `filename` of a file path.
|
88
|
+
*
|
89
|
+
* @param {RegExp} `re`
|
90
|
+
* @return {Boolean}
|
91
|
+
*/
|
92
|
+
|
93
|
+
utils.hasFilename = function hasFilename(re) {
|
94
|
+
return function(fp) {
|
95
|
+
var name = utils.filename(fp);
|
96
|
+
return name && re.test(name);
|
97
|
+
};
|
98
|
+
};
|
99
|
+
|
100
|
+
/**
|
101
|
+
* Coerce `val` to an array
|
102
|
+
*
|
103
|
+
* @param {*} val
|
104
|
+
* @return {Array}
|
105
|
+
*/
|
106
|
+
|
107
|
+
utils.arrayify = function arrayify(val) {
|
108
|
+
return !Array.isArray(val)
|
109
|
+
? [val]
|
110
|
+
: val;
|
111
|
+
};
|
112
|
+
|
113
|
+
/**
|
114
|
+
* Normalize all slashes in a file path or glob pattern to
|
115
|
+
* forward slashes.
|
116
|
+
*/
|
117
|
+
|
118
|
+
utils.unixify = function unixify(fp, opts) {
|
119
|
+
if (opts && opts.unixify === false) return fp;
|
120
|
+
if (opts && opts.unixify === true || win32 || path.sep === '\\') {
|
121
|
+
return utils.normalize(fp, false);
|
122
|
+
}
|
123
|
+
if (opts && opts.unescape === true) {
|
124
|
+
return fp ? fp.toString().replace(/\\(\w)/g, '$1') : '';
|
125
|
+
}
|
126
|
+
return fp;
|
127
|
+
};
|
128
|
+
|
129
|
+
/**
|
130
|
+
* Escape/unescape utils
|
131
|
+
*/
|
132
|
+
|
133
|
+
utils.escapePath = function escapePath(fp) {
|
134
|
+
return fp.replace(/[\\.]/g, '\\$&');
|
135
|
+
};
|
136
|
+
|
137
|
+
utils.unescapeGlob = function unescapeGlob(fp) {
|
138
|
+
return fp.replace(/[\\"']/g, '');
|
139
|
+
};
|
140
|
+
|
141
|
+
utils.escapeRe = function escapeRe(str) {
|
142
|
+
return str.replace(/[-[\\$*+?.#^\s{}(|)\]]/g, '\\$&');
|
143
|
+
};
|
144
|
+
|
145
|
+
/**
|
146
|
+
* Expose `utils`
|
147
|
+
*/
|
148
|
+
|
149
|
+
module.exports = utils;
|
@@ -0,0 +1,114 @@
|
|
1
|
+
{
|
2
|
+
"name": "micromatch",
|
3
|
+
"description": "Glob matching for javascript/node.js. A drop-in replacement and faster alternative to minimatch and multimatch.",
|
4
|
+
"version": "2.3.11",
|
5
|
+
"homepage": "https://github.com/jonschlinkert/micromatch",
|
6
|
+
"author": "Jon Schlinkert (https://github.com/jonschlinkert)",
|
7
|
+
"repository": "jonschlinkert/micromatch",
|
8
|
+
"bugs": {
|
9
|
+
"url": "https://github.com/jonschlinkert/micromatch/issues"
|
10
|
+
},
|
11
|
+
"license": "MIT",
|
12
|
+
"files": [
|
13
|
+
"index.js",
|
14
|
+
"lib"
|
15
|
+
],
|
16
|
+
"main": "index.js",
|
17
|
+
"engines": {
|
18
|
+
"node": ">=0.10.0"
|
19
|
+
},
|
20
|
+
"scripts": {
|
21
|
+
"test": "mocha"
|
22
|
+
},
|
23
|
+
"dependencies": {
|
24
|
+
"arr-diff": "^2.0.0",
|
25
|
+
"array-unique": "^0.2.1",
|
26
|
+
"braces": "^1.8.2",
|
27
|
+
"expand-brackets": "^0.1.4",
|
28
|
+
"extglob": "^0.3.1",
|
29
|
+
"filename-regex": "^2.0.0",
|
30
|
+
"is-extglob": "^1.0.0",
|
31
|
+
"is-glob": "^2.0.1",
|
32
|
+
"kind-of": "^3.0.2",
|
33
|
+
"normalize-path": "^2.0.1",
|
34
|
+
"object.omit": "^2.0.0",
|
35
|
+
"parse-glob": "^3.0.4",
|
36
|
+
"regex-cache": "^0.4.2"
|
37
|
+
},
|
38
|
+
"devDependencies": {
|
39
|
+
"benchmarked": "^0.1.4",
|
40
|
+
"chalk": "^1.1.1",
|
41
|
+
"gulp": "^3.9.0",
|
42
|
+
"gulp-eslint": "^1.1.1",
|
43
|
+
"gulp-format-md": "^0.1.8",
|
44
|
+
"gulp-istanbul": "^0.10.1",
|
45
|
+
"gulp-mocha": "^2.1.3",
|
46
|
+
"minimatch": "^3.0.0",
|
47
|
+
"minimist": "^1.2.0",
|
48
|
+
"mocha": "^2",
|
49
|
+
"multimatch": "^2.0.0",
|
50
|
+
"should": "^8",
|
51
|
+
"write": "^0.2.1"
|
52
|
+
},
|
53
|
+
"keywords": [
|
54
|
+
"bash",
|
55
|
+
"expand",
|
56
|
+
"expansion",
|
57
|
+
"expression",
|
58
|
+
"file",
|
59
|
+
"files",
|
60
|
+
"filter",
|
61
|
+
"find",
|
62
|
+
"glob",
|
63
|
+
"globbing",
|
64
|
+
"globs",
|
65
|
+
"globstar",
|
66
|
+
"match",
|
67
|
+
"matcher",
|
68
|
+
"matches",
|
69
|
+
"matching",
|
70
|
+
"minimatch",
|
71
|
+
"multimatch",
|
72
|
+
"path",
|
73
|
+
"pattern",
|
74
|
+
"patterns",
|
75
|
+
"regex",
|
76
|
+
"regexp",
|
77
|
+
"regular",
|
78
|
+
"shell",
|
79
|
+
"wildcard"
|
80
|
+
],
|
81
|
+
"verb": {
|
82
|
+
"related": {
|
83
|
+
"list": [
|
84
|
+
"braces",
|
85
|
+
"expand-brackets",
|
86
|
+
"expand-range",
|
87
|
+
"extglob",
|
88
|
+
"fill-range",
|
89
|
+
"gulp-micromatch",
|
90
|
+
"is-glob",
|
91
|
+
"parse-glob"
|
92
|
+
]
|
93
|
+
},
|
94
|
+
"reflinks": [
|
95
|
+
"braces",
|
96
|
+
"expand-brackets",
|
97
|
+
"extglob",
|
98
|
+
"minimatch",
|
99
|
+
"multimatch",
|
100
|
+
"verb"
|
101
|
+
],
|
102
|
+
"toc": false,
|
103
|
+
"layout": false,
|
104
|
+
"tasks": [
|
105
|
+
"readme"
|
106
|
+
],
|
107
|
+
"plugins": [
|
108
|
+
"gulp-format-md"
|
109
|
+
],
|
110
|
+
"lint": {
|
111
|
+
"reflinks": true
|
112
|
+
}
|
113
|
+
}
|
114
|
+
}
|
@@ -0,0 +1,236 @@
|
|
1
|
+
module.exports = function (args, opts) {
|
2
|
+
if (!opts) opts = {};
|
3
|
+
|
4
|
+
var flags = { bools : {}, strings : {}, unknownFn: null };
|
5
|
+
|
6
|
+
if (typeof opts['unknown'] === 'function') {
|
7
|
+
flags.unknownFn = opts['unknown'];
|
8
|
+
}
|
9
|
+
|
10
|
+
if (typeof opts['boolean'] === 'boolean' && opts['boolean']) {
|
11
|
+
flags.allBools = true;
|
12
|
+
} else {
|
13
|
+
[].concat(opts['boolean']).filter(Boolean).forEach(function (key) {
|
14
|
+
flags.bools[key] = true;
|
15
|
+
});
|
16
|
+
}
|
17
|
+
|
18
|
+
var aliases = {};
|
19
|
+
Object.keys(opts.alias || {}).forEach(function (key) {
|
20
|
+
aliases[key] = [].concat(opts.alias[key]);
|
21
|
+
aliases[key].forEach(function (x) {
|
22
|
+
aliases[x] = [key].concat(aliases[key].filter(function (y) {
|
23
|
+
return x !== y;
|
24
|
+
}));
|
25
|
+
});
|
26
|
+
});
|
27
|
+
|
28
|
+
[].concat(opts.string).filter(Boolean).forEach(function (key) {
|
29
|
+
flags.strings[key] = true;
|
30
|
+
if (aliases[key]) {
|
31
|
+
flags.strings[aliases[key]] = true;
|
32
|
+
}
|
33
|
+
});
|
34
|
+
|
35
|
+
var defaults = opts['default'] || {};
|
36
|
+
|
37
|
+
var argv = { _ : [] };
|
38
|
+
Object.keys(flags.bools).forEach(function (key) {
|
39
|
+
setArg(key, defaults[key] === undefined ? false : defaults[key]);
|
40
|
+
});
|
41
|
+
|
42
|
+
var notFlags = [];
|
43
|
+
|
44
|
+
if (args.indexOf('--') !== -1) {
|
45
|
+
notFlags = args.slice(args.indexOf('--')+1);
|
46
|
+
args = args.slice(0, args.indexOf('--'));
|
47
|
+
}
|
48
|
+
|
49
|
+
function argDefined(key, arg) {
|
50
|
+
return (flags.allBools && /^--[^=]+$/.test(arg)) ||
|
51
|
+
flags.strings[key] || flags.bools[key] || aliases[key];
|
52
|
+
}
|
53
|
+
|
54
|
+
function setArg (key, val, arg) {
|
55
|
+
if (arg && flags.unknownFn && !argDefined(key, arg)) {
|
56
|
+
if (flags.unknownFn(arg) === false) return;
|
57
|
+
}
|
58
|
+
|
59
|
+
var value = !flags.strings[key] && isNumber(val)
|
60
|
+
? Number(val) : val
|
61
|
+
;
|
62
|
+
setKey(argv, key.split('.'), value);
|
63
|
+
|
64
|
+
(aliases[key] || []).forEach(function (x) {
|
65
|
+
setKey(argv, x.split('.'), value);
|
66
|
+
});
|
67
|
+
}
|
68
|
+
|
69
|
+
function setKey (obj, keys, value) {
|
70
|
+
var o = obj;
|
71
|
+
keys.slice(0,-1).forEach(function (key) {
|
72
|
+
if (o[key] === undefined) o[key] = {};
|
73
|
+
o = o[key];
|
74
|
+
});
|
75
|
+
|
76
|
+
var key = keys[keys.length - 1];
|
77
|
+
if (o[key] === undefined || flags.bools[key] || typeof o[key] === 'boolean') {
|
78
|
+
o[key] = value;
|
79
|
+
}
|
80
|
+
else if (Array.isArray(o[key])) {
|
81
|
+
o[key].push(value);
|
82
|
+
}
|
83
|
+
else {
|
84
|
+
o[key] = [ o[key], value ];
|
85
|
+
}
|
86
|
+
}
|
87
|
+
|
88
|
+
function aliasIsBoolean(key) {
|
89
|
+
return aliases[key].some(function (x) {
|
90
|
+
return flags.bools[x];
|
91
|
+
});
|
92
|
+
}
|
93
|
+
|
94
|
+
for (var i = 0; i < args.length; i++) {
|
95
|
+
var arg = args[i];
|
96
|
+
|
97
|
+
if (/^--.+=/.test(arg)) {
|
98
|
+
// Using [\s\S] instead of . because js doesn't support the
|
99
|
+
// 'dotall' regex modifier. See:
|
100
|
+
// http://stackoverflow.com/a/1068308/13216
|
101
|
+
var m = arg.match(/^--([^=]+)=([\s\S]*)$/);
|
102
|
+
var key = m[1];
|
103
|
+
var value = m[2];
|
104
|
+
if (flags.bools[key]) {
|
105
|
+
value = value !== 'false';
|
106
|
+
}
|
107
|
+
setArg(key, value, arg);
|
108
|
+
}
|
109
|
+
else if (/^--no-.+/.test(arg)) {
|
110
|
+
var key = arg.match(/^--no-(.+)/)[1];
|
111
|
+
setArg(key, false, arg);
|
112
|
+
}
|
113
|
+
else if (/^--.+/.test(arg)) {
|
114
|
+
var key = arg.match(/^--(.+)/)[1];
|
115
|
+
var next = args[i + 1];
|
116
|
+
if (next !== undefined && !/^-/.test(next)
|
117
|
+
&& !flags.bools[key]
|
118
|
+
&& !flags.allBools
|
119
|
+
&& (aliases[key] ? !aliasIsBoolean(key) : true)) {
|
120
|
+
setArg(key, next, arg);
|
121
|
+
i++;
|
122
|
+
}
|
123
|
+
else if (/^(true|false)$/.test(next)) {
|
124
|
+
setArg(key, next === 'true', arg);
|
125
|
+
i++;
|
126
|
+
}
|
127
|
+
else {
|
128
|
+
setArg(key, flags.strings[key] ? '' : true, arg);
|
129
|
+
}
|
130
|
+
}
|
131
|
+
else if (/^-[^-]+/.test(arg)) {
|
132
|
+
var letters = arg.slice(1,-1).split('');
|
133
|
+
|
134
|
+
var broken = false;
|
135
|
+
for (var j = 0; j < letters.length; j++) {
|
136
|
+
var next = arg.slice(j+2);
|
137
|
+
|
138
|
+
if (next === '-') {
|
139
|
+
setArg(letters[j], next, arg)
|
140
|
+
continue;
|
141
|
+
}
|
142
|
+
|
143
|
+
if (/[A-Za-z]/.test(letters[j]) && /=/.test(next)) {
|
144
|
+
setArg(letters[j], next.split('=')[1], arg);
|
145
|
+
broken = true;
|
146
|
+
break;
|
147
|
+
}
|
148
|
+
|
149
|
+
if (/[A-Za-z]/.test(letters[j])
|
150
|
+
&& /-?\d+(\.\d*)?(e-?\d+)?$/.test(next)) {
|
151
|
+
setArg(letters[j], next, arg);
|
152
|
+
broken = true;
|
153
|
+
break;
|
154
|
+
}
|
155
|
+
|
156
|
+
if (letters[j+1] && letters[j+1].match(/\W/)) {
|
157
|
+
setArg(letters[j], arg.slice(j+2), arg);
|
158
|
+
broken = true;
|
159
|
+
break;
|
160
|
+
}
|
161
|
+
else {
|
162
|
+
setArg(letters[j], flags.strings[letters[j]] ? '' : true, arg);
|
163
|
+
}
|
164
|
+
}
|
165
|
+
|
166
|
+
var key = arg.slice(-1)[0];
|
167
|
+
if (!broken && key !== '-') {
|
168
|
+
if (args[i+1] && !/^(-|--)[^-]/.test(args[i+1])
|
169
|
+
&& !flags.bools[key]
|
170
|
+
&& (aliases[key] ? !aliasIsBoolean(key) : true)) {
|
171
|
+
setArg(key, args[i+1], arg);
|
172
|
+
i++;
|
173
|
+
}
|
174
|
+
else if (args[i+1] && /true|false/.test(args[i+1])) {
|
175
|
+
setArg(key, args[i+1] === 'true', arg);
|
176
|
+
i++;
|
177
|
+
}
|
178
|
+
else {
|
179
|
+
setArg(key, flags.strings[key] ? '' : true, arg);
|
180
|
+
}
|
181
|
+
}
|
182
|
+
}
|
183
|
+
else {
|
184
|
+
if (!flags.unknownFn || flags.unknownFn(arg) !== false) {
|
185
|
+
argv._.push(
|
186
|
+
flags.strings['_'] || !isNumber(arg) ? arg : Number(arg)
|
187
|
+
);
|
188
|
+
}
|
189
|
+
if (opts.stopEarly) {
|
190
|
+
argv._.push.apply(argv._, args.slice(i + 1));
|
191
|
+
break;
|
192
|
+
}
|
193
|
+
}
|
194
|
+
}
|
195
|
+
|
196
|
+
Object.keys(defaults).forEach(function (key) {
|
197
|
+
if (!hasKey(argv, key.split('.'))) {
|
198
|
+
setKey(argv, key.split('.'), defaults[key]);
|
199
|
+
|
200
|
+
(aliases[key] || []).forEach(function (x) {
|
201
|
+
setKey(argv, x.split('.'), defaults[key]);
|
202
|
+
});
|
203
|
+
}
|
204
|
+
});
|
205
|
+
|
206
|
+
if (opts['--']) {
|
207
|
+
argv['--'] = new Array();
|
208
|
+
notFlags.forEach(function(key) {
|
209
|
+
argv['--'].push(key);
|
210
|
+
});
|
211
|
+
}
|
212
|
+
else {
|
213
|
+
notFlags.forEach(function(key) {
|
214
|
+
argv._.push(key);
|
215
|
+
});
|
216
|
+
}
|
217
|
+
|
218
|
+
return argv;
|
219
|
+
};
|
220
|
+
|
221
|
+
function hasKey (obj, keys) {
|
222
|
+
var o = obj;
|
223
|
+
keys.slice(0,-1).forEach(function (key) {
|
224
|
+
o = (o[key] || {});
|
225
|
+
});
|
226
|
+
|
227
|
+
var key = keys[keys.length - 1];
|
228
|
+
return key in o;
|
229
|
+
}
|
230
|
+
|
231
|
+
function isNumber (x) {
|
232
|
+
if (typeof x === 'number') return true;
|
233
|
+
if (/^0x[0-9a-f]+$/i.test(x)) return true;
|
234
|
+
return /^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(x);
|
235
|
+
}
|
236
|
+
|