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,78 @@
|
|
1
|
+
var conversions = require('./conversions');
|
2
|
+
var route = require('./route');
|
3
|
+
|
4
|
+
var convert = {};
|
5
|
+
|
6
|
+
var models = Object.keys(conversions);
|
7
|
+
|
8
|
+
function wrapRaw(fn) {
|
9
|
+
var wrappedFn = function (args) {
|
10
|
+
if (args === undefined || args === null) {
|
11
|
+
return args;
|
12
|
+
}
|
13
|
+
|
14
|
+
if (arguments.length > 1) {
|
15
|
+
args = Array.prototype.slice.call(arguments);
|
16
|
+
}
|
17
|
+
|
18
|
+
return fn(args);
|
19
|
+
};
|
20
|
+
|
21
|
+
// preserve .conversion property if there is one
|
22
|
+
if ('conversion' in fn) {
|
23
|
+
wrappedFn.conversion = fn.conversion;
|
24
|
+
}
|
25
|
+
|
26
|
+
return wrappedFn;
|
27
|
+
}
|
28
|
+
|
29
|
+
function wrapRounded(fn) {
|
30
|
+
var wrappedFn = function (args) {
|
31
|
+
if (args === undefined || args === null) {
|
32
|
+
return args;
|
33
|
+
}
|
34
|
+
|
35
|
+
if (arguments.length > 1) {
|
36
|
+
args = Array.prototype.slice.call(arguments);
|
37
|
+
}
|
38
|
+
|
39
|
+
var result = fn(args);
|
40
|
+
|
41
|
+
// we're assuming the result is an array here.
|
42
|
+
// see notice in conversions.js; don't use box types
|
43
|
+
// in conversion functions.
|
44
|
+
if (typeof result === 'object') {
|
45
|
+
for (var len = result.length, i = 0; i < len; i++) {
|
46
|
+
result[i] = Math.round(result[i]);
|
47
|
+
}
|
48
|
+
}
|
49
|
+
|
50
|
+
return result;
|
51
|
+
};
|
52
|
+
|
53
|
+
// preserve .conversion property if there is one
|
54
|
+
if ('conversion' in fn) {
|
55
|
+
wrappedFn.conversion = fn.conversion;
|
56
|
+
}
|
57
|
+
|
58
|
+
return wrappedFn;
|
59
|
+
}
|
60
|
+
|
61
|
+
models.forEach(function (fromModel) {
|
62
|
+
convert[fromModel] = {};
|
63
|
+
|
64
|
+
Object.defineProperty(convert[fromModel], 'channels', {value: conversions[fromModel].channels});
|
65
|
+
Object.defineProperty(convert[fromModel], 'labels', {value: conversions[fromModel].labels});
|
66
|
+
|
67
|
+
var routes = route(fromModel);
|
68
|
+
var routeModels = Object.keys(routes);
|
69
|
+
|
70
|
+
routeModels.forEach(function (toModel) {
|
71
|
+
var fn = routes[toModel];
|
72
|
+
|
73
|
+
convert[fromModel][toModel] = wrapRounded(fn);
|
74
|
+
convert[fromModel][toModel].raw = wrapRaw(fn);
|
75
|
+
});
|
76
|
+
});
|
77
|
+
|
78
|
+
module.exports = convert;
|
@@ -0,0 +1,46 @@
|
|
1
|
+
{
|
2
|
+
"name": "color-convert",
|
3
|
+
"description": "Plain color conversion functions",
|
4
|
+
"version": "1.9.1",
|
5
|
+
"author": "Heather Arthur <fayearthur@gmail.com>",
|
6
|
+
"license": "MIT",
|
7
|
+
"repository": "Qix-/color-convert",
|
8
|
+
"scripts": {
|
9
|
+
"pretest": "xo",
|
10
|
+
"test": "node test/basic.js"
|
11
|
+
},
|
12
|
+
"keywords": [
|
13
|
+
"color",
|
14
|
+
"colour",
|
15
|
+
"convert",
|
16
|
+
"converter",
|
17
|
+
"conversion",
|
18
|
+
"rgb",
|
19
|
+
"hsl",
|
20
|
+
"hsv",
|
21
|
+
"hwb",
|
22
|
+
"cmyk",
|
23
|
+
"ansi",
|
24
|
+
"ansi16"
|
25
|
+
],
|
26
|
+
"files": [
|
27
|
+
"index.js",
|
28
|
+
"conversions.js",
|
29
|
+
"css-keywords.js",
|
30
|
+
"route.js"
|
31
|
+
],
|
32
|
+
"xo": {
|
33
|
+
"rules": {
|
34
|
+
"default-case": 0,
|
35
|
+
"no-inline-comments": 0,
|
36
|
+
"operator-linebreak": 0
|
37
|
+
}
|
38
|
+
},
|
39
|
+
"devDependencies": {
|
40
|
+
"chalk": "^1.1.1",
|
41
|
+
"xo": "^0.11.2"
|
42
|
+
},
|
43
|
+
"dependencies": {
|
44
|
+
"color-name": "^1.1.1"
|
45
|
+
}
|
46
|
+
}
|
@@ -0,0 +1,97 @@
|
|
1
|
+
var conversions = require('./conversions');
|
2
|
+
|
3
|
+
/*
|
4
|
+
this function routes a model to all other models.
|
5
|
+
|
6
|
+
all functions that are routed have a property `.conversion` attached
|
7
|
+
to the returned synthetic function. This property is an array
|
8
|
+
of strings, each with the steps in between the 'from' and 'to'
|
9
|
+
color models (inclusive).
|
10
|
+
|
11
|
+
conversions that are not possible simply are not included.
|
12
|
+
*/
|
13
|
+
|
14
|
+
function buildGraph() {
|
15
|
+
var graph = {};
|
16
|
+
// https://jsperf.com/object-keys-vs-for-in-with-closure/3
|
17
|
+
var models = Object.keys(conversions);
|
18
|
+
|
19
|
+
for (var len = models.length, i = 0; i < len; i++) {
|
20
|
+
graph[models[i]] = {
|
21
|
+
// http://jsperf.com/1-vs-infinity
|
22
|
+
// micro-opt, but this is simple.
|
23
|
+
distance: -1,
|
24
|
+
parent: null
|
25
|
+
};
|
26
|
+
}
|
27
|
+
|
28
|
+
return graph;
|
29
|
+
}
|
30
|
+
|
31
|
+
// https://en.wikipedia.org/wiki/Breadth-first_search
|
32
|
+
function deriveBFS(fromModel) {
|
33
|
+
var graph = buildGraph();
|
34
|
+
var queue = [fromModel]; // unshift -> queue -> pop
|
35
|
+
|
36
|
+
graph[fromModel].distance = 0;
|
37
|
+
|
38
|
+
while (queue.length) {
|
39
|
+
var current = queue.pop();
|
40
|
+
var adjacents = Object.keys(conversions[current]);
|
41
|
+
|
42
|
+
for (var len = adjacents.length, i = 0; i < len; i++) {
|
43
|
+
var adjacent = adjacents[i];
|
44
|
+
var node = graph[adjacent];
|
45
|
+
|
46
|
+
if (node.distance === -1) {
|
47
|
+
node.distance = graph[current].distance + 1;
|
48
|
+
node.parent = current;
|
49
|
+
queue.unshift(adjacent);
|
50
|
+
}
|
51
|
+
}
|
52
|
+
}
|
53
|
+
|
54
|
+
return graph;
|
55
|
+
}
|
56
|
+
|
57
|
+
function link(from, to) {
|
58
|
+
return function (args) {
|
59
|
+
return to(from(args));
|
60
|
+
};
|
61
|
+
}
|
62
|
+
|
63
|
+
function wrapConversion(toModel, graph) {
|
64
|
+
var path = [graph[toModel].parent, toModel];
|
65
|
+
var fn = conversions[graph[toModel].parent][toModel];
|
66
|
+
|
67
|
+
var cur = graph[toModel].parent;
|
68
|
+
while (graph[cur].parent) {
|
69
|
+
path.unshift(graph[cur].parent);
|
70
|
+
fn = link(conversions[graph[cur].parent][cur], fn);
|
71
|
+
cur = graph[cur].parent;
|
72
|
+
}
|
73
|
+
|
74
|
+
fn.conversion = path;
|
75
|
+
return fn;
|
76
|
+
}
|
77
|
+
|
78
|
+
module.exports = function (fromModel) {
|
79
|
+
var graph = deriveBFS(fromModel);
|
80
|
+
var conversion = {};
|
81
|
+
|
82
|
+
var models = Object.keys(graph);
|
83
|
+
for (var len = models.length, i = 0; i < len; i++) {
|
84
|
+
var toModel = models[i];
|
85
|
+
var node = graph[toModel];
|
86
|
+
|
87
|
+
if (node.parent === null) {
|
88
|
+
// no possible conversion, or this node is the source model.
|
89
|
+
continue;
|
90
|
+
}
|
91
|
+
|
92
|
+
conversion[toModel] = wrapConversion(toModel, graph);
|
93
|
+
}
|
94
|
+
|
95
|
+
return conversion;
|
96
|
+
};
|
97
|
+
|
@@ -0,0 +1,152 @@
|
|
1
|
+
'use strict'
|
2
|
+
|
3
|
+
module.exports = {
|
4
|
+
"aliceblue": [240, 248, 255],
|
5
|
+
"antiquewhite": [250, 235, 215],
|
6
|
+
"aqua": [0, 255, 255],
|
7
|
+
"aquamarine": [127, 255, 212],
|
8
|
+
"azure": [240, 255, 255],
|
9
|
+
"beige": [245, 245, 220],
|
10
|
+
"bisque": [255, 228, 196],
|
11
|
+
"black": [0, 0, 0],
|
12
|
+
"blanchedalmond": [255, 235, 205],
|
13
|
+
"blue": [0, 0, 255],
|
14
|
+
"blueviolet": [138, 43, 226],
|
15
|
+
"brown": [165, 42, 42],
|
16
|
+
"burlywood": [222, 184, 135],
|
17
|
+
"cadetblue": [95, 158, 160],
|
18
|
+
"chartreuse": [127, 255, 0],
|
19
|
+
"chocolate": [210, 105, 30],
|
20
|
+
"coral": [255, 127, 80],
|
21
|
+
"cornflowerblue": [100, 149, 237],
|
22
|
+
"cornsilk": [255, 248, 220],
|
23
|
+
"crimson": [220, 20, 60],
|
24
|
+
"cyan": [0, 255, 255],
|
25
|
+
"darkblue": [0, 0, 139],
|
26
|
+
"darkcyan": [0, 139, 139],
|
27
|
+
"darkgoldenrod": [184, 134, 11],
|
28
|
+
"darkgray": [169, 169, 169],
|
29
|
+
"darkgreen": [0, 100, 0],
|
30
|
+
"darkgrey": [169, 169, 169],
|
31
|
+
"darkkhaki": [189, 183, 107],
|
32
|
+
"darkmagenta": [139, 0, 139],
|
33
|
+
"darkolivegreen": [85, 107, 47],
|
34
|
+
"darkorange": [255, 140, 0],
|
35
|
+
"darkorchid": [153, 50, 204],
|
36
|
+
"darkred": [139, 0, 0],
|
37
|
+
"darksalmon": [233, 150, 122],
|
38
|
+
"darkseagreen": [143, 188, 143],
|
39
|
+
"darkslateblue": [72, 61, 139],
|
40
|
+
"darkslategray": [47, 79, 79],
|
41
|
+
"darkslategrey": [47, 79, 79],
|
42
|
+
"darkturquoise": [0, 206, 209],
|
43
|
+
"darkviolet": [148, 0, 211],
|
44
|
+
"deeppink": [255, 20, 147],
|
45
|
+
"deepskyblue": [0, 191, 255],
|
46
|
+
"dimgray": [105, 105, 105],
|
47
|
+
"dimgrey": [105, 105, 105],
|
48
|
+
"dodgerblue": [30, 144, 255],
|
49
|
+
"firebrick": [178, 34, 34],
|
50
|
+
"floralwhite": [255, 250, 240],
|
51
|
+
"forestgreen": [34, 139, 34],
|
52
|
+
"fuchsia": [255, 0, 255],
|
53
|
+
"gainsboro": [220, 220, 220],
|
54
|
+
"ghostwhite": [248, 248, 255],
|
55
|
+
"gold": [255, 215, 0],
|
56
|
+
"goldenrod": [218, 165, 32],
|
57
|
+
"gray": [128, 128, 128],
|
58
|
+
"green": [0, 128, 0],
|
59
|
+
"greenyellow": [173, 255, 47],
|
60
|
+
"grey": [128, 128, 128],
|
61
|
+
"honeydew": [240, 255, 240],
|
62
|
+
"hotpink": [255, 105, 180],
|
63
|
+
"indianred": [205, 92, 92],
|
64
|
+
"indigo": [75, 0, 130],
|
65
|
+
"ivory": [255, 255, 240],
|
66
|
+
"khaki": [240, 230, 140],
|
67
|
+
"lavender": [230, 230, 250],
|
68
|
+
"lavenderblush": [255, 240, 245],
|
69
|
+
"lawngreen": [124, 252, 0],
|
70
|
+
"lemonchiffon": [255, 250, 205],
|
71
|
+
"lightblue": [173, 216, 230],
|
72
|
+
"lightcoral": [240, 128, 128],
|
73
|
+
"lightcyan": [224, 255, 255],
|
74
|
+
"lightgoldenrodyellow": [250, 250, 210],
|
75
|
+
"lightgray": [211, 211, 211],
|
76
|
+
"lightgreen": [144, 238, 144],
|
77
|
+
"lightgrey": [211, 211, 211],
|
78
|
+
"lightpink": [255, 182, 193],
|
79
|
+
"lightsalmon": [255, 160, 122],
|
80
|
+
"lightseagreen": [32, 178, 170],
|
81
|
+
"lightskyblue": [135, 206, 250],
|
82
|
+
"lightslategray": [119, 136, 153],
|
83
|
+
"lightslategrey": [119, 136, 153],
|
84
|
+
"lightsteelblue": [176, 196, 222],
|
85
|
+
"lightyellow": [255, 255, 224],
|
86
|
+
"lime": [0, 255, 0],
|
87
|
+
"limegreen": [50, 205, 50],
|
88
|
+
"linen": [250, 240, 230],
|
89
|
+
"magenta": [255, 0, 255],
|
90
|
+
"maroon": [128, 0, 0],
|
91
|
+
"mediumaquamarine": [102, 205, 170],
|
92
|
+
"mediumblue": [0, 0, 205],
|
93
|
+
"mediumorchid": [186, 85, 211],
|
94
|
+
"mediumpurple": [147, 112, 219],
|
95
|
+
"mediumseagreen": [60, 179, 113],
|
96
|
+
"mediumslateblue": [123, 104, 238],
|
97
|
+
"mediumspringgreen": [0, 250, 154],
|
98
|
+
"mediumturquoise": [72, 209, 204],
|
99
|
+
"mediumvioletred": [199, 21, 133],
|
100
|
+
"midnightblue": [25, 25, 112],
|
101
|
+
"mintcream": [245, 255, 250],
|
102
|
+
"mistyrose": [255, 228, 225],
|
103
|
+
"moccasin": [255, 228, 181],
|
104
|
+
"navajowhite": [255, 222, 173],
|
105
|
+
"navy": [0, 0, 128],
|
106
|
+
"oldlace": [253, 245, 230],
|
107
|
+
"olive": [128, 128, 0],
|
108
|
+
"olivedrab": [107, 142, 35],
|
109
|
+
"orange": [255, 165, 0],
|
110
|
+
"orangered": [255, 69, 0],
|
111
|
+
"orchid": [218, 112, 214],
|
112
|
+
"palegoldenrod": [238, 232, 170],
|
113
|
+
"palegreen": [152, 251, 152],
|
114
|
+
"paleturquoise": [175, 238, 238],
|
115
|
+
"palevioletred": [219, 112, 147],
|
116
|
+
"papayawhip": [255, 239, 213],
|
117
|
+
"peachpuff": [255, 218, 185],
|
118
|
+
"peru": [205, 133, 63],
|
119
|
+
"pink": [255, 192, 203],
|
120
|
+
"plum": [221, 160, 221],
|
121
|
+
"powderblue": [176, 224, 230],
|
122
|
+
"purple": [128, 0, 128],
|
123
|
+
"rebeccapurple": [102, 51, 153],
|
124
|
+
"red": [255, 0, 0],
|
125
|
+
"rosybrown": [188, 143, 143],
|
126
|
+
"royalblue": [65, 105, 225],
|
127
|
+
"saddlebrown": [139, 69, 19],
|
128
|
+
"salmon": [250, 128, 114],
|
129
|
+
"sandybrown": [244, 164, 96],
|
130
|
+
"seagreen": [46, 139, 87],
|
131
|
+
"seashell": [255, 245, 238],
|
132
|
+
"sienna": [160, 82, 45],
|
133
|
+
"silver": [192, 192, 192],
|
134
|
+
"skyblue": [135, 206, 235],
|
135
|
+
"slateblue": [106, 90, 205],
|
136
|
+
"slategray": [112, 128, 144],
|
137
|
+
"slategrey": [112, 128, 144],
|
138
|
+
"snow": [255, 250, 250],
|
139
|
+
"springgreen": [0, 255, 127],
|
140
|
+
"steelblue": [70, 130, 180],
|
141
|
+
"tan": [210, 180, 140],
|
142
|
+
"teal": [0, 128, 128],
|
143
|
+
"thistle": [216, 191, 216],
|
144
|
+
"tomato": [255, 99, 71],
|
145
|
+
"turquoise": [64, 224, 208],
|
146
|
+
"violet": [238, 130, 238],
|
147
|
+
"wheat": [245, 222, 179],
|
148
|
+
"white": [255, 255, 255],
|
149
|
+
"whitesmoke": [245, 245, 245],
|
150
|
+
"yellow": [255, 255, 0],
|
151
|
+
"yellowgreen": [154, 205, 50]
|
152
|
+
};
|
@@ -0,0 +1,25 @@
|
|
1
|
+
{
|
2
|
+
"name": "color-name",
|
3
|
+
"version": "1.1.3",
|
4
|
+
"description": "A list of color names and its values",
|
5
|
+
"main": "index.js",
|
6
|
+
"scripts": {
|
7
|
+
"test": "node test.js"
|
8
|
+
},
|
9
|
+
"repository": {
|
10
|
+
"type": "git",
|
11
|
+
"url": "git@github.com:dfcreative/color-name.git"
|
12
|
+
},
|
13
|
+
"keywords": [
|
14
|
+
"color-name",
|
15
|
+
"color",
|
16
|
+
"color-keyword",
|
17
|
+
"keyword"
|
18
|
+
],
|
19
|
+
"author": "DY <dfcreative@gmail.com>",
|
20
|
+
"license": "MIT",
|
21
|
+
"bugs": {
|
22
|
+
"url": "https://github.com/dfcreative/color-name/issues"
|
23
|
+
},
|
24
|
+
"homepage": "https://github.com/dfcreative/color-name"
|
25
|
+
}
|
@@ -0,0 +1,33 @@
|
|
1
|
+
'use strict';
|
2
|
+
const timeZone = require('time-zone');
|
3
|
+
|
4
|
+
module.exports = options => {
|
5
|
+
options = Object.assign({
|
6
|
+
date: new Date(),
|
7
|
+
local: true,
|
8
|
+
showTimeZone: false,
|
9
|
+
showMilliseconds: false
|
10
|
+
}, options);
|
11
|
+
|
12
|
+
let date = options.date;
|
13
|
+
|
14
|
+
if (options.local) {
|
15
|
+
// Offset the date so it will return the correct value when getting the ISO string
|
16
|
+
date = new Date(date.getTime() - (date.getTimezoneOffset() * 60000));
|
17
|
+
}
|
18
|
+
|
19
|
+
let end = '';
|
20
|
+
|
21
|
+
if (options.showTimeZone) {
|
22
|
+
end = ' UTC' + (options.local ? timeZone(date) : '');
|
23
|
+
}
|
24
|
+
|
25
|
+
if (options.showMilliseconds && date.getUTCMilliseconds() > 0) {
|
26
|
+
end = ` ${date.getUTCMilliseconds()}ms${end}`;
|
27
|
+
}
|
28
|
+
|
29
|
+
return date
|
30
|
+
.toISOString()
|
31
|
+
.replace(/T/, ' ')
|
32
|
+
.replace(/\..+/, end);
|
33
|
+
};
|
@@ -0,0 +1,39 @@
|
|
1
|
+
{
|
2
|
+
"name": "date-time",
|
3
|
+
"version": "2.1.0",
|
4
|
+
"description": "Pretty datetime: `2014-01-09 06:46:01`",
|
5
|
+
"license": "MIT",
|
6
|
+
"repository": "sindresorhus/date-time",
|
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
|
+
},
|
18
|
+
"files": [
|
19
|
+
"index.js"
|
20
|
+
],
|
21
|
+
"keywords": [
|
22
|
+
"datetime",
|
23
|
+
"date-time",
|
24
|
+
"date",
|
25
|
+
"time",
|
26
|
+
"utc",
|
27
|
+
"iso",
|
28
|
+
"timezone",
|
29
|
+
"zone",
|
30
|
+
"timestamp"
|
31
|
+
],
|
32
|
+
"dependencies": {
|
33
|
+
"time-zone": "^1.0.0"
|
34
|
+
},
|
35
|
+
"devDependencies": {
|
36
|
+
"ava": "*",
|
37
|
+
"xo": "*"
|
38
|
+
}
|
39
|
+
}
|