projen-pipelines 0.2.2 → 0.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.jsii +10 -10
- package/API.md +8 -8
- package/lib/awscdk/base.js +20 -8
- package/lib/awscdk/bash.js +1 -1
- package/lib/awscdk/github.js +1 -1
- package/lib/awscdk/gitlab.js +1 -1
- package/lib/steps/artifact-steps.js +2 -2
- package/lib/steps/aws-assume-role.step.js +1 -1
- package/lib/steps/registries.js +2 -2
- package/lib/steps/step.js +4 -4
- package/node_modules/@babel/code-frame/lib/index.js +97 -37
- package/node_modules/@babel/code-frame/lib/index.js.map +1 -1
- package/node_modules/@babel/code-frame/package.json +3 -2
- package/node_modules/@babel/helper-validator-identifier/lib/identifier.js +4 -4
- package/node_modules/@babel/helper-validator-identifier/lib/identifier.js.map +1 -1
- package/node_modules/@babel/helper-validator-identifier/package.json +2 -2
- package/node_modules/ansi-styles/index.js +69 -67
- package/node_modules/ansi-styles/package.json +11 -11
- package/node_modules/ansi-styles/readme.md +14 -19
- package/node_modules/color-convert/conversions.js +310 -281
- package/node_modules/color-convert/index.js +24 -27
- package/node_modules/color-convert/package.json +5 -7
- package/node_modules/color-convert/route.js +22 -22
- package/node_modules/color-name/package.json +25 -28
- package/node_modules/escalade/index.d.mts +11 -0
- package/node_modules/escalade/index.d.ts +14 -2
- package/node_modules/escalade/package.json +18 -7
- package/node_modules/escalade/sync/index.d.mts +9 -0
- package/node_modules/escalade/sync/index.d.ts +13 -2
- package/node_modules/is-core-module/CHANGELOG.md +13 -0
- package/node_modules/is-core-module/core.json +1 -0
- package/node_modules/is-core-module/package.json +3 -3
- package/node_modules/is-core-module/test/index.js +3 -0
- package/node_modules/picocolors/LICENSE +1 -1
- package/node_modules/picocolors/package.json +2 -2
- package/node_modules/picocolors/picocolors.browser.js +1 -1
- package/node_modules/picocolors/picocolors.js +53 -43
- package/node_modules/picocolors/{types.ts → types.d.ts} +21 -0
- package/node_modules/resolve/lib/core.json +4 -0
- package/node_modules/resolve/package.json +12 -9
- package/node_modules/{get-pkg-repo → standard-version}/node_modules/through2/README.md +27 -21
- package/node_modules/standard-version/node_modules/through2/package.json +38 -0
- package/node_modules/standard-version/node_modules/through2/through2.js +83 -0
- package/node_modules/through2/README.md +21 -27
- package/node_modules/through2/package.json +11 -16
- package/node_modules/through2/through2.js +51 -38
- package/node_modules/uglify-js/lib/compress.js +23 -13
- package/node_modules/uglify-js/package.json +1 -1
- package/node_modules/wrap-ansi/node_modules/ansi-styles/index.js +163 -0
- package/node_modules/{@babel/highlight → wrap-ansi}/node_modules/ansi-styles/package.json +11 -11
- package/node_modules/{@babel/highlight → wrap-ansi}/node_modules/ansi-styles/readme.md +19 -14
- package/node_modules/{@babel/highlight → wrap-ansi}/node_modules/color-convert/conversions.js +281 -310
- package/node_modules/wrap-ansi/node_modules/color-convert/index.js +81 -0
- package/node_modules/{standard-version → wrap-ansi}/node_modules/color-convert/package.json +7 -5
- package/node_modules/{standard-version → wrap-ansi}/node_modules/color-convert/route.js +22 -22
- package/node_modules/{@babel/highlight → wrap-ansi}/node_modules/color-name/package.json +28 -25
- package/package.json +7 -7
- package/node_modules/@babel/helper-validator-identifier/scripts/generate-identifier-regex.js +0 -73
- package/node_modules/@babel/highlight/LICENSE +0 -22
- package/node_modules/@babel/highlight/README.md +0 -19
- package/node_modules/@babel/highlight/lib/index.js +0 -119
- package/node_modules/@babel/highlight/lib/index.js.map +0 -1
- package/node_modules/@babel/highlight/node_modules/ansi-styles/index.js +0 -165
- package/node_modules/@babel/highlight/node_modules/color-convert/index.js +0 -78
- package/node_modules/@babel/highlight/node_modules/color-convert/package.json +0 -46
- package/node_modules/@babel/highlight/node_modules/color-convert/route.js +0 -97
- package/node_modules/@babel/highlight/package.json +0 -30
- package/node_modules/figures/node_modules/escape-string-regexp/index.js +0 -11
- package/node_modules/figures/node_modules/escape-string-regexp/license +0 -21
- package/node_modules/figures/node_modules/escape-string-regexp/package.json +0 -41
- package/node_modules/figures/node_modules/escape-string-regexp/readme.md +0 -27
- package/node_modules/get-pkg-repo/node_modules/through2/package.json +0 -33
- package/node_modules/get-pkg-repo/node_modules/through2/through2.js +0 -96
- package/node_modules/standard-version/node_modules/ansi-styles/index.js +0 -165
- package/node_modules/standard-version/node_modules/ansi-styles/package.json +0 -56
- package/node_modules/standard-version/node_modules/ansi-styles/readme.md +0 -147
- package/node_modules/standard-version/node_modules/chalk/index.js +0 -228
- package/node_modules/standard-version/node_modules/chalk/index.js.flow +0 -93
- package/node_modules/standard-version/node_modules/chalk/license +0 -9
- package/node_modules/standard-version/node_modules/chalk/package.json +0 -71
- package/node_modules/standard-version/node_modules/chalk/readme.md +0 -314
- package/node_modules/standard-version/node_modules/chalk/templates.js +0 -128
- package/node_modules/standard-version/node_modules/chalk/types/index.d.ts +0 -97
- package/node_modules/standard-version/node_modules/color-convert/CHANGELOG.md +0 -54
- package/node_modules/standard-version/node_modules/color-convert/LICENSE +0 -21
- package/node_modules/standard-version/node_modules/color-convert/README.md +0 -68
- package/node_modules/standard-version/node_modules/color-convert/conversions.js +0 -868
- package/node_modules/standard-version/node_modules/color-convert/index.js +0 -78
- package/node_modules/standard-version/node_modules/color-name/.eslintrc.json +0 -43
- package/node_modules/standard-version/node_modules/color-name/.npmignore +0 -107
- package/node_modules/standard-version/node_modules/color-name/LICENSE +0 -8
- package/node_modules/standard-version/node_modules/color-name/README.md +0 -11
- package/node_modules/standard-version/node_modules/color-name/index.js +0 -152
- package/node_modules/standard-version/node_modules/color-name/package.json +0 -25
- package/node_modules/standard-version/node_modules/color-name/test.js +0 -7
- package/node_modules/standard-version/node_modules/detect-indent/license +0 -9
- package/node_modules/standard-version/node_modules/escape-string-regexp/index.js +0 -11
- package/node_modules/standard-version/node_modules/escape-string-regexp/license +0 -21
- package/node_modules/standard-version/node_modules/escape-string-regexp/package.json +0 -41
- package/node_modules/standard-version/node_modules/escape-string-regexp/readme.md +0 -27
- package/node_modules/standard-version/node_modules/has-flag/index.js +0 -8
- package/node_modules/standard-version/node_modules/has-flag/license +0 -9
- package/node_modules/standard-version/node_modules/has-flag/package.json +0 -44
- package/node_modules/standard-version/node_modules/has-flag/readme.md +0 -70
- package/node_modules/standard-version/node_modules/supports-color/browser.js +0 -5
- package/node_modules/standard-version/node_modules/supports-color/index.js +0 -131
- package/node_modules/standard-version/node_modules/supports-color/license +0 -9
- package/node_modules/standard-version/node_modules/supports-color/package.json +0 -53
- package/node_modules/standard-version/node_modules/supports-color/readme.md +0 -66
- /package/node_modules/{@babel/highlight/node_modules/chalk → chalk}/index.js +0 -0
- /package/node_modules/{@babel/highlight/node_modules/chalk → chalk}/index.js.flow +0 -0
- /package/node_modules/{@babel/highlight/node_modules/ansi-styles → chalk}/license +0 -0
- /package/node_modules/{@babel/highlight/node_modules/chalk → chalk}/package.json +0 -0
- /package/node_modules/{@babel/highlight/node_modules/chalk → chalk}/readme.md +0 -0
- /package/node_modules/{@babel/highlight/node_modules/chalk → chalk}/templates.js +0 -0
- /package/node_modules/{@babel/highlight/node_modules/chalk → chalk}/types/index.d.ts +0 -0
- /package/node_modules/{@babel/highlight/node_modules/color-name → color-name}/.eslintrc.json +0 -0
- /package/node_modules/{@babel/highlight/node_modules/color-name → color-name}/.npmignore +0 -0
- /package/node_modules/{@babel/highlight/node_modules/color-name → color-name}/test.js +0 -0
- /package/node_modules/{standard-version/node_modules/detect-indent → detect-indent}/index.d.ts +0 -0
- /package/node_modules/{standard-version/node_modules/detect-indent → detect-indent}/index.js +0 -0
- /package/node_modules/{@babel/highlight/node_modules/chalk → detect-indent}/license +0 -0
- /package/node_modules/{standard-version/node_modules/detect-indent → detect-indent}/package.json +0 -0
- /package/node_modules/{standard-version/node_modules/detect-indent → detect-indent}/readme.md +0 -0
- /package/node_modules/{@babel/highlight/node_modules/escape-string-regexp → escape-string-regexp}/index.js +0 -0
- /package/node_modules/{@babel/highlight/node_modules/escape-string-regexp → escape-string-regexp}/license +0 -0
- /package/node_modules/{@babel/highlight/node_modules/escape-string-regexp → escape-string-regexp}/package.json +0 -0
- /package/node_modules/{@babel/highlight/node_modules/escape-string-regexp → escape-string-regexp}/readme.md +0 -0
- /package/node_modules/{@babel/highlight/node_modules/has-flag → has-flag}/index.js +0 -0
- /package/node_modules/{@babel/highlight/node_modules/has-flag → has-flag}/license +0 -0
- /package/node_modules/{@babel/highlight/node_modules/has-flag → has-flag}/package.json +0 -0
- /package/node_modules/{@babel/highlight/node_modules/has-flag → has-flag}/readme.md +0 -0
- /package/node_modules/{conventional-changelog-writer/node_modules/semver → lru-cache}/LICENSE +0 -0
- /package/node_modules/{hosted-git-info/node_modules/lru-cache → lru-cache}/README.md +0 -0
- /package/node_modules/{hosted-git-info/node_modules/lru-cache → lru-cache}/index.js +0 -0
- /package/node_modules/{hosted-git-info/node_modules/lru-cache → lru-cache}/package.json +0 -0
- /package/node_modules/{conventional-changelog → standard-version/node_modules/conventional-changelog}/CHANGELOG.md +0 -0
- /package/node_modules/{conventional-changelog → standard-version/node_modules/conventional-changelog}/LICENSE.md +0 -0
- /package/node_modules/{conventional-changelog → standard-version/node_modules/conventional-changelog}/README.md +0 -0
- /package/node_modules/{conventional-changelog → standard-version/node_modules/conventional-changelog}/index.js +0 -0
- /package/node_modules/{conventional-changelog → standard-version/node_modules/conventional-changelog}/package.json +0 -0
- /package/node_modules/{conventional-changelog-angular → standard-version/node_modules/conventional-changelog-angular}/CHANGELOG.md +0 -0
- /package/node_modules/{conventional-changelog-angular → standard-version/node_modules/conventional-changelog-angular}/LICENSE.md +0 -0
- /package/node_modules/{conventional-changelog-angular → standard-version/node_modules/conventional-changelog-angular}/README.md +0 -0
- /package/node_modules/{conventional-changelog-angular → standard-version/node_modules/conventional-changelog-angular}/conventional-changelog.js +0 -0
- /package/node_modules/{conventional-changelog-angular → standard-version/node_modules/conventional-changelog-angular}/conventional-recommended-bump.js +0 -0
- /package/node_modules/{conventional-changelog-angular → standard-version/node_modules/conventional-changelog-angular}/index.js +0 -0
- /package/node_modules/{conventional-changelog-angular → standard-version/node_modules/conventional-changelog-angular}/package.json +0 -0
- /package/node_modules/{conventional-changelog-angular → standard-version/node_modules/conventional-changelog-angular}/parser-opts.js +0 -0
- /package/node_modules/{conventional-changelog-angular → standard-version/node_modules/conventional-changelog-angular}/templates/commit.hbs +0 -0
- /package/node_modules/{conventional-changelog-angular → standard-version/node_modules/conventional-changelog-angular}/templates/footer.hbs +0 -0
- /package/node_modules/{conventional-changelog-angular → standard-version/node_modules/conventional-changelog-angular}/templates/header.hbs +0 -0
- /package/node_modules/{conventional-changelog-angular → standard-version/node_modules/conventional-changelog-angular}/templates/template.hbs +0 -0
- /package/node_modules/{conventional-changelog-angular → standard-version/node_modules/conventional-changelog-angular}/writer-opts.js +0 -0
- /package/node_modules/{conventional-changelog-atom → standard-version/node_modules/conventional-changelog-atom}/CHANGELOG.md +0 -0
- /package/node_modules/{conventional-changelog-atom → standard-version/node_modules/conventional-changelog-atom}/LICENSE.md +0 -0
- /package/node_modules/{conventional-changelog-atom → standard-version/node_modules/conventional-changelog-atom}/README.md +0 -0
- /package/node_modules/{conventional-changelog-atom → standard-version/node_modules/conventional-changelog-atom}/conventional-changelog.js +0 -0
- /package/node_modules/{conventional-changelog-atom → standard-version/node_modules/conventional-changelog-atom}/conventional-recommended-bump.js +0 -0
- /package/node_modules/{conventional-changelog-atom → standard-version/node_modules/conventional-changelog-atom}/index.js +0 -0
- /package/node_modules/{conventional-changelog-atom → standard-version/node_modules/conventional-changelog-atom}/package.json +0 -0
- /package/node_modules/{conventional-changelog-atom → standard-version/node_modules/conventional-changelog-atom}/parser-opts.js +0 -0
- /package/node_modules/{conventional-changelog-atom → standard-version/node_modules/conventional-changelog-atom}/templates/commit.hbs +0 -0
- /package/node_modules/{conventional-changelog-atom → standard-version/node_modules/conventional-changelog-atom}/templates/header.hbs +0 -0
- /package/node_modules/{conventional-changelog-atom → standard-version/node_modules/conventional-changelog-atom}/templates/template.hbs +0 -0
- /package/node_modules/{conventional-changelog-atom → standard-version/node_modules/conventional-changelog-atom}/writer-opts.js +0 -0
- /package/node_modules/{conventional-changelog-codemirror → standard-version/node_modules/conventional-changelog-codemirror}/CHANGELOG.md +0 -0
- /package/node_modules/{conventional-changelog-codemirror → standard-version/node_modules/conventional-changelog-codemirror}/LICENSE.md +0 -0
- /package/node_modules/{conventional-changelog-codemirror → standard-version/node_modules/conventional-changelog-codemirror}/README.md +0 -0
- /package/node_modules/{conventional-changelog-codemirror → standard-version/node_modules/conventional-changelog-codemirror}/conventional-changelog.js +0 -0
- /package/node_modules/{conventional-changelog-codemirror → standard-version/node_modules/conventional-changelog-codemirror}/conventional-recommended-bump.js +0 -0
- /package/node_modules/{conventional-changelog-codemirror → standard-version/node_modules/conventional-changelog-codemirror}/index.js +0 -0
- /package/node_modules/{conventional-changelog-codemirror → standard-version/node_modules/conventional-changelog-codemirror}/package.json +0 -0
- /package/node_modules/{conventional-changelog-codemirror → standard-version/node_modules/conventional-changelog-codemirror}/parser-opts.js +0 -0
- /package/node_modules/{conventional-changelog-codemirror → standard-version/node_modules/conventional-changelog-codemirror}/templates/commit.hbs +0 -0
- /package/node_modules/{conventional-changelog-codemirror → standard-version/node_modules/conventional-changelog-codemirror}/templates/header.hbs +0 -0
- /package/node_modules/{conventional-changelog-codemirror → standard-version/node_modules/conventional-changelog-codemirror}/templates/template.hbs +0 -0
- /package/node_modules/{conventional-changelog-codemirror → standard-version/node_modules/conventional-changelog-codemirror}/writer-opts.js +0 -0
- /package/node_modules/{conventional-changelog-conventionalcommits → standard-version/node_modules/conventional-changelog-conventionalcommits}/CHANGELOG.md +0 -0
- /package/node_modules/{conventional-changelog-conventionalcommits → standard-version/node_modules/conventional-changelog-conventionalcommits}/LICENSE.md +0 -0
- /package/node_modules/{conventional-changelog-conventionalcommits → standard-version/node_modules/conventional-changelog-conventionalcommits}/README.md +0 -0
- /package/node_modules/{conventional-changelog-conventionalcommits → standard-version/node_modules/conventional-changelog-conventionalcommits}/add-bang-notes.js +0 -0
- /package/node_modules/{conventional-changelog-conventionalcommits → standard-version/node_modules/conventional-changelog-conventionalcommits}/conventional-changelog.js +0 -0
- /package/node_modules/{conventional-changelog-conventionalcommits → standard-version/node_modules/conventional-changelog-conventionalcommits}/conventional-recommended-bump.js +0 -0
- /package/node_modules/{conventional-changelog-conventionalcommits → standard-version/node_modules/conventional-changelog-conventionalcommits}/index.js +0 -0
- /package/node_modules/{conventional-changelog-conventionalcommits → standard-version/node_modules/conventional-changelog-conventionalcommits}/package.json +0 -0
- /package/node_modules/{conventional-changelog-conventionalcommits → standard-version/node_modules/conventional-changelog-conventionalcommits}/parser-opts.js +0 -0
- /package/node_modules/{conventional-changelog-conventionalcommits → standard-version/node_modules/conventional-changelog-conventionalcommits}/templates/commit.hbs +0 -0
- /package/node_modules/{conventional-changelog-conventionalcommits → standard-version/node_modules/conventional-changelog-conventionalcommits}/templates/footer.hbs +0 -0
- /package/node_modules/{conventional-changelog-conventionalcommits → standard-version/node_modules/conventional-changelog-conventionalcommits}/templates/header.hbs +0 -0
- /package/node_modules/{conventional-changelog-conventionalcommits → standard-version/node_modules/conventional-changelog-conventionalcommits}/templates/template.hbs +0 -0
- /package/node_modules/{conventional-changelog-conventionalcommits → standard-version/node_modules/conventional-changelog-conventionalcommits}/writer-opts.js +0 -0
- /package/node_modules/{conventional-changelog-core → standard-version/node_modules/conventional-changelog-core}/CHANGELOG.md +0 -0
- /package/node_modules/{conventional-changelog-core → standard-version/node_modules/conventional-changelog-core}/LICENSE.md +0 -0
- /package/node_modules/{conventional-changelog-core → standard-version/node_modules/conventional-changelog-core}/README.md +0 -0
- /package/node_modules/{conventional-changelog-core → standard-version/node_modules/conventional-changelog-core}/hosts/bitbucket.json +0 -0
- /package/node_modules/{conventional-changelog-core → standard-version/node_modules/conventional-changelog-core}/hosts/github.json +0 -0
- /package/node_modules/{conventional-changelog-core → standard-version/node_modules/conventional-changelog-core}/hosts/gitlab.json +0 -0
- /package/node_modules/{conventional-changelog-core → standard-version/node_modules/conventional-changelog-core}/index.js +0 -0
- /package/node_modules/{conventional-changelog-core → standard-version/node_modules/conventional-changelog-core}/lib/merge-config.js +0 -0
- /package/node_modules/{conventional-changelog-core → standard-version/node_modules/conventional-changelog-core}/package.json +0 -0
- /package/node_modules/{conventional-changelog-ember → standard-version/node_modules/conventional-changelog-ember}/CHANGELOG.md +0 -0
- /package/node_modules/{conventional-changelog-ember → standard-version/node_modules/conventional-changelog-ember}/LICENSE.md +0 -0
- /package/node_modules/{conventional-changelog-ember → standard-version/node_modules/conventional-changelog-ember}/README.md +0 -0
- /package/node_modules/{conventional-changelog-ember → standard-version/node_modules/conventional-changelog-ember}/conventional-changelog.js +0 -0
- /package/node_modules/{conventional-changelog-ember → standard-version/node_modules/conventional-changelog-ember}/conventional-recommended-bump.js +0 -0
- /package/node_modules/{conventional-changelog-ember → standard-version/node_modules/conventional-changelog-ember}/index.js +0 -0
- /package/node_modules/{conventional-changelog-ember → standard-version/node_modules/conventional-changelog-ember}/package.json +0 -0
- /package/node_modules/{conventional-changelog-ember → standard-version/node_modules/conventional-changelog-ember}/parser-opts.js +0 -0
- /package/node_modules/{conventional-changelog-ember → standard-version/node_modules/conventional-changelog-ember}/templates/commit.hbs +0 -0
- /package/node_modules/{conventional-changelog-ember → standard-version/node_modules/conventional-changelog-ember}/templates/header.hbs +0 -0
- /package/node_modules/{conventional-changelog-ember → standard-version/node_modules/conventional-changelog-ember}/templates/template.hbs +0 -0
- /package/node_modules/{conventional-changelog-ember → standard-version/node_modules/conventional-changelog-ember}/writer-opts.js +0 -0
- /package/node_modules/{conventional-changelog-eslint → standard-version/node_modules/conventional-changelog-eslint}/CHANGELOG.md +0 -0
- /package/node_modules/{conventional-changelog-eslint → standard-version/node_modules/conventional-changelog-eslint}/LICENSE.md +0 -0
- /package/node_modules/{conventional-changelog-eslint → standard-version/node_modules/conventional-changelog-eslint}/README.md +0 -0
- /package/node_modules/{conventional-changelog-eslint → standard-version/node_modules/conventional-changelog-eslint}/conventional-changelog.js +0 -0
- /package/node_modules/{conventional-changelog-eslint → standard-version/node_modules/conventional-changelog-eslint}/conventional-recommended-bump.js +0 -0
- /package/node_modules/{conventional-changelog-eslint → standard-version/node_modules/conventional-changelog-eslint}/index.js +0 -0
- /package/node_modules/{conventional-changelog-eslint → standard-version/node_modules/conventional-changelog-eslint}/package.json +0 -0
- /package/node_modules/{conventional-changelog-eslint → standard-version/node_modules/conventional-changelog-eslint}/parser-opts.js +0 -0
- /package/node_modules/{conventional-changelog-eslint → standard-version/node_modules/conventional-changelog-eslint}/templates/commit.hbs +0 -0
- /package/node_modules/{conventional-changelog-eslint → standard-version/node_modules/conventional-changelog-eslint}/templates/header.hbs +0 -0
- /package/node_modules/{conventional-changelog-eslint → standard-version/node_modules/conventional-changelog-eslint}/templates/template.hbs +0 -0
- /package/node_modules/{conventional-changelog-eslint → standard-version/node_modules/conventional-changelog-eslint}/writer-opts.js +0 -0
- /package/node_modules/{conventional-changelog-express → standard-version/node_modules/conventional-changelog-express}/CHANGELOG.md +0 -0
- /package/node_modules/{conventional-changelog-express → standard-version/node_modules/conventional-changelog-express}/LICENSE.md +0 -0
- /package/node_modules/{conventional-changelog-express → standard-version/node_modules/conventional-changelog-express}/README.md +0 -0
- /package/node_modules/{conventional-changelog-express → standard-version/node_modules/conventional-changelog-express}/conventional-changelog.js +0 -0
- /package/node_modules/{conventional-changelog-express → standard-version/node_modules/conventional-changelog-express}/conventional-recommended-bump.js +0 -0
- /package/node_modules/{conventional-changelog-express → standard-version/node_modules/conventional-changelog-express}/index.js +0 -0
- /package/node_modules/{conventional-changelog-express → standard-version/node_modules/conventional-changelog-express}/package.json +0 -0
- /package/node_modules/{conventional-changelog-express → standard-version/node_modules/conventional-changelog-express}/parser-opts.js +0 -0
- /package/node_modules/{conventional-changelog-express → standard-version/node_modules/conventional-changelog-express}/templates/commit.hbs +0 -0
- /package/node_modules/{conventional-changelog-express → standard-version/node_modules/conventional-changelog-express}/templates/header.hbs +0 -0
- /package/node_modules/{conventional-changelog-express → standard-version/node_modules/conventional-changelog-express}/templates/template.hbs +0 -0
- /package/node_modules/{conventional-changelog-express → standard-version/node_modules/conventional-changelog-express}/writer-opts.js +0 -0
- /package/node_modules/{conventional-changelog-jquery → standard-version/node_modules/conventional-changelog-jquery}/CHANGELOG.md +0 -0
- /package/node_modules/{conventional-changelog-jquery → standard-version/node_modules/conventional-changelog-jquery}/LICENSE.md +0 -0
- /package/node_modules/{conventional-changelog-jquery → standard-version/node_modules/conventional-changelog-jquery}/README.md +0 -0
- /package/node_modules/{conventional-changelog-jquery → standard-version/node_modules/conventional-changelog-jquery}/conventional-changelog.js +0 -0
- /package/node_modules/{conventional-changelog-jquery → standard-version/node_modules/conventional-changelog-jquery}/conventional-recommended-bump.js +0 -0
- /package/node_modules/{conventional-changelog-jquery → standard-version/node_modules/conventional-changelog-jquery}/index.js +0 -0
- /package/node_modules/{conventional-changelog-jquery → standard-version/node_modules/conventional-changelog-jquery}/package.json +0 -0
- /package/node_modules/{conventional-changelog-jquery → standard-version/node_modules/conventional-changelog-jquery}/parser-opts.js +0 -0
- /package/node_modules/{conventional-changelog-jquery → standard-version/node_modules/conventional-changelog-jquery}/templates/commit.hbs +0 -0
- /package/node_modules/{conventional-changelog-jquery → standard-version/node_modules/conventional-changelog-jquery}/templates/header.hbs +0 -0
- /package/node_modules/{conventional-changelog-jquery → standard-version/node_modules/conventional-changelog-jquery}/templates/template.hbs +0 -0
- /package/node_modules/{conventional-changelog-jquery → standard-version/node_modules/conventional-changelog-jquery}/writer-opts.js +0 -0
- /package/node_modules/{conventional-changelog-jshint → standard-version/node_modules/conventional-changelog-jshint}/CHANGELOG.md +0 -0
- /package/node_modules/{conventional-changelog-jshint → standard-version/node_modules/conventional-changelog-jshint}/LICENSE.md +0 -0
- /package/node_modules/{conventional-changelog-jshint → standard-version/node_modules/conventional-changelog-jshint}/README.md +0 -0
- /package/node_modules/{conventional-changelog-jshint → standard-version/node_modules/conventional-changelog-jshint}/conventional-changelog.js +0 -0
- /package/node_modules/{conventional-changelog-jshint → standard-version/node_modules/conventional-changelog-jshint}/conventional-recommended-bump.js +0 -0
- /package/node_modules/{conventional-changelog-jshint → standard-version/node_modules/conventional-changelog-jshint}/index.js +0 -0
- /package/node_modules/{conventional-changelog-jshint → standard-version/node_modules/conventional-changelog-jshint}/package.json +0 -0
- /package/node_modules/{conventional-changelog-jshint → standard-version/node_modules/conventional-changelog-jshint}/parser-opts.js +0 -0
- /package/node_modules/{conventional-changelog-jshint → standard-version/node_modules/conventional-changelog-jshint}/templates/commit.hbs +0 -0
- /package/node_modules/{conventional-changelog-jshint → standard-version/node_modules/conventional-changelog-jshint}/templates/footer.hbs +0 -0
- /package/node_modules/{conventional-changelog-jshint → standard-version/node_modules/conventional-changelog-jshint}/templates/header.hbs +0 -0
- /package/node_modules/{conventional-changelog-jshint → standard-version/node_modules/conventional-changelog-jshint}/templates/template.hbs +0 -0
- /package/node_modules/{conventional-changelog-jshint → standard-version/node_modules/conventional-changelog-jshint}/writer-opts.js +0 -0
- /package/node_modules/{conventional-changelog-preset-loader → standard-version/node_modules/conventional-changelog-preset-loader}/CHANGELOG.md +0 -0
- /package/node_modules/{conventional-changelog-preset-loader → standard-version/node_modules/conventional-changelog-preset-loader}/LICENSE.md +0 -0
- /package/node_modules/{conventional-changelog-preset-loader → standard-version/node_modules/conventional-changelog-preset-loader}/README.md +0 -0
- /package/node_modules/{conventional-changelog-preset-loader → standard-version/node_modules/conventional-changelog-preset-loader}/index.js +0 -0
- /package/node_modules/{conventional-changelog-preset-loader → standard-version/node_modules/conventional-changelog-preset-loader}/package.json +0 -0
- /package/node_modules/{conventional-changelog-writer → standard-version/node_modules/conventional-changelog-writer}/CHANGELOG.md +0 -0
- /package/node_modules/{conventional-changelog-writer → standard-version/node_modules/conventional-changelog-writer}/LICENSE.md +0 -0
- /package/node_modules/{conventional-changelog-writer → standard-version/node_modules/conventional-changelog-writer}/README.md +0 -0
- /package/node_modules/{conventional-changelog-writer → standard-version/node_modules/conventional-changelog-writer}/cli.js +0 -0
- /package/node_modules/{conventional-changelog-writer → standard-version/node_modules/conventional-changelog-writer}/index.js +0 -0
- /package/node_modules/{conventional-changelog-writer → standard-version/node_modules/conventional-changelog-writer}/lib/util.js +0 -0
- /package/node_modules/{git-semver-tags → standard-version/node_modules/conventional-changelog-writer}/node_modules/semver/LICENSE +0 -0
- /package/node_modules/{conventional-changelog-writer → standard-version/node_modules/conventional-changelog-writer}/node_modules/semver/README.md +0 -0
- /package/node_modules/{conventional-changelog-writer → standard-version/node_modules/conventional-changelog-writer}/node_modules/semver/bin/semver.js +0 -0
- /package/node_modules/{conventional-changelog-writer → standard-version/node_modules/conventional-changelog-writer}/node_modules/semver/package.json +0 -0
- /package/node_modules/{conventional-changelog-writer → standard-version/node_modules/conventional-changelog-writer}/node_modules/semver/range.bnf +0 -0
- /package/node_modules/{conventional-changelog-writer → standard-version/node_modules/conventional-changelog-writer}/node_modules/semver/semver.js +0 -0
- /package/node_modules/{conventional-changelog-writer → standard-version/node_modules/conventional-changelog-writer}/package.json +0 -0
- /package/node_modules/{conventional-changelog-writer → standard-version/node_modules/conventional-changelog-writer}/templates/commit.hbs +0 -0
- /package/node_modules/{conventional-changelog-writer → standard-version/node_modules/conventional-changelog-writer}/templates/footer.hbs +0 -0
- /package/node_modules/{conventional-changelog-writer → standard-version/node_modules/conventional-changelog-writer}/templates/header.hbs +0 -0
- /package/node_modules/{conventional-changelog-writer → standard-version/node_modules/conventional-changelog-writer}/templates/template.hbs +0 -0
- /package/node_modules/{conventional-commits-filter → standard-version/node_modules/conventional-commits-filter}/CHANGELOG.md +0 -0
- /package/node_modules/{conventional-commits-filter → standard-version/node_modules/conventional-commits-filter}/LICENSE +0 -0
- /package/node_modules/{conventional-commits-filter → standard-version/node_modules/conventional-commits-filter}/README.md +0 -0
- /package/node_modules/{conventional-commits-filter → standard-version/node_modules/conventional-commits-filter}/index.js +0 -0
- /package/node_modules/{conventional-commits-filter → standard-version/node_modules/conventional-commits-filter}/package.json +0 -0
- /package/node_modules/{conventional-commits-parser → standard-version/node_modules/conventional-commits-parser}/CHANGELOG.md +0 -0
- /package/node_modules/{conventional-commits-parser → standard-version/node_modules/conventional-commits-parser}/LICENSE.md +0 -0
- /package/node_modules/{conventional-commits-parser → standard-version/node_modules/conventional-commits-parser}/README.md +0 -0
- /package/node_modules/{conventional-commits-parser → standard-version/node_modules/conventional-commits-parser}/cli.js +0 -0
- /package/node_modules/{conventional-commits-parser → standard-version/node_modules/conventional-commits-parser}/index.js +0 -0
- /package/node_modules/{conventional-commits-parser → standard-version/node_modules/conventional-commits-parser}/lib/parser.js +0 -0
- /package/node_modules/{conventional-commits-parser → standard-version/node_modules/conventional-commits-parser}/lib/regex.js +0 -0
- /package/node_modules/{conventional-commits-parser → standard-version/node_modules/conventional-commits-parser}/package.json +0 -0
- /package/node_modules/{conventional-recommended-bump → standard-version/node_modules/conventional-recommended-bump}/CHANGELOG.md +0 -0
- /package/node_modules/{conventional-recommended-bump → standard-version/node_modules/conventional-recommended-bump}/LICENSE.md +0 -0
- /package/node_modules/{conventional-recommended-bump → standard-version/node_modules/conventional-recommended-bump}/README.md +0 -0
- /package/node_modules/{conventional-recommended-bump → standard-version/node_modules/conventional-recommended-bump}/cli.js +0 -0
- /package/node_modules/{conventional-recommended-bump → standard-version/node_modules/conventional-recommended-bump}/index.js +0 -0
- /package/node_modules/{conventional-recommended-bump → standard-version/node_modules/conventional-recommended-bump}/package.json +0 -0
- /package/node_modules/{conventional-recommended-bump → standard-version/node_modules/conventional-recommended-bump}/preset-resolver.js +0 -0
- /package/node_modules/{git-raw-commits → standard-version/node_modules/git-raw-commits}/CHANGELOG.md +0 -0
- /package/node_modules/{git-raw-commits → standard-version/node_modules/git-raw-commits}/LICENSE.md +0 -0
- /package/node_modules/{git-raw-commits → standard-version/node_modules/git-raw-commits}/README.md +0 -0
- /package/node_modules/{git-raw-commits → standard-version/node_modules/git-raw-commits}/cli.js +0 -0
- /package/node_modules/{git-raw-commits → standard-version/node_modules/git-raw-commits}/index.js +0 -0
- /package/node_modules/{git-raw-commits → standard-version/node_modules/git-raw-commits}/package.json +0 -0
- /package/node_modules/{git-semver-tags → standard-version/node_modules/git-semver-tags}/CHANGELOG.md +0 -0
- /package/node_modules/{git-semver-tags → standard-version/node_modules/git-semver-tags}/LICENSE.md +0 -0
- /package/node_modules/{git-semver-tags → standard-version/node_modules/git-semver-tags}/README.md +0 -0
- /package/node_modules/{git-semver-tags → standard-version/node_modules/git-semver-tags}/cli.js +0 -0
- /package/node_modules/{git-semver-tags → standard-version/node_modules/git-semver-tags}/index.js +0 -0
- /package/node_modules/{hosted-git-info/node_modules/lru-cache → standard-version/node_modules/git-semver-tags/node_modules/semver}/LICENSE +0 -0
- /package/node_modules/{git-semver-tags → standard-version/node_modules/git-semver-tags}/node_modules/semver/README.md +0 -0
- /package/node_modules/{git-semver-tags → standard-version/node_modules/git-semver-tags}/node_modules/semver/bin/semver.js +0 -0
- /package/node_modules/{git-semver-tags → standard-version/node_modules/git-semver-tags}/node_modules/semver/package.json +0 -0
- /package/node_modules/{git-semver-tags → standard-version/node_modules/git-semver-tags}/node_modules/semver/range.bnf +0 -0
- /package/node_modules/{git-semver-tags → standard-version/node_modules/git-semver-tags}/node_modules/semver/semver.js +0 -0
- /package/node_modules/{git-semver-tags → standard-version/node_modules/git-semver-tags}/package.json +0 -0
- /package/node_modules/{get-pkg-repo → standard-version}/node_modules/through2/LICENSE.md +0 -0
- /package/node_modules/{@babel/highlight/node_modules/supports-color → supports-color}/browser.js +0 -0
- /package/node_modules/{@babel/highlight/node_modules/supports-color → supports-color}/index.js +0 -0
- /package/node_modules/{@babel/highlight/node_modules/supports-color → supports-color}/license +0 -0
- /package/node_modules/{@babel/highlight/node_modules/supports-color → supports-color}/package.json +0 -0
- /package/node_modules/{@babel/highlight/node_modules/supports-color → supports-color}/readme.md +0 -0
- /package/node_modules/{get-pkg-repo → through2}/node_modules/isarray/.npmignore +0 -0
- /package/node_modules/{get-pkg-repo → through2}/node_modules/isarray/.travis.yml +0 -0
- /package/node_modules/{get-pkg-repo → through2}/node_modules/isarray/Makefile +0 -0
- /package/node_modules/{get-pkg-repo → through2}/node_modules/isarray/README.md +0 -0
- /package/node_modules/{get-pkg-repo → through2}/node_modules/isarray/component.json +0 -0
- /package/node_modules/{get-pkg-repo → through2}/node_modules/isarray/index.js +0 -0
- /package/node_modules/{get-pkg-repo → through2}/node_modules/isarray/package.json +0 -0
- /package/node_modules/{get-pkg-repo → through2}/node_modules/isarray/test.js +0 -0
- /package/node_modules/{get-pkg-repo → through2}/node_modules/readable-stream/.travis.yml +0 -0
- /package/node_modules/{get-pkg-repo → through2}/node_modules/readable-stream/CONTRIBUTING.md +0 -0
- /package/node_modules/{get-pkg-repo → through2}/node_modules/readable-stream/GOVERNANCE.md +0 -0
- /package/node_modules/{get-pkg-repo → through2}/node_modules/readable-stream/LICENSE +0 -0
- /package/node_modules/{get-pkg-repo → through2}/node_modules/readable-stream/README.md +0 -0
- /package/node_modules/{get-pkg-repo → through2}/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md +0 -0
- /package/node_modules/{get-pkg-repo → through2}/node_modules/readable-stream/duplex-browser.js +0 -0
- /package/node_modules/{get-pkg-repo → through2}/node_modules/readable-stream/duplex.js +0 -0
- /package/node_modules/{get-pkg-repo → through2}/node_modules/readable-stream/lib/_stream_duplex.js +0 -0
- /package/node_modules/{get-pkg-repo → through2}/node_modules/readable-stream/lib/_stream_passthrough.js +0 -0
- /package/node_modules/{get-pkg-repo → through2}/node_modules/readable-stream/lib/_stream_readable.js +0 -0
- /package/node_modules/{get-pkg-repo → through2}/node_modules/readable-stream/lib/_stream_transform.js +0 -0
- /package/node_modules/{get-pkg-repo → through2}/node_modules/readable-stream/lib/_stream_writable.js +0 -0
- /package/node_modules/{get-pkg-repo → through2}/node_modules/readable-stream/lib/internal/streams/BufferList.js +0 -0
- /package/node_modules/{get-pkg-repo → through2}/node_modules/readable-stream/lib/internal/streams/destroy.js +0 -0
- /package/node_modules/{get-pkg-repo → through2}/node_modules/readable-stream/lib/internal/streams/stream-browser.js +0 -0
- /package/node_modules/{get-pkg-repo → through2}/node_modules/readable-stream/lib/internal/streams/stream.js +0 -0
- /package/node_modules/{get-pkg-repo → through2}/node_modules/readable-stream/package.json +0 -0
- /package/node_modules/{get-pkg-repo → through2}/node_modules/readable-stream/passthrough.js +0 -0
- /package/node_modules/{get-pkg-repo → through2}/node_modules/readable-stream/readable-browser.js +0 -0
- /package/node_modules/{get-pkg-repo → through2}/node_modules/readable-stream/readable.js +0 -0
- /package/node_modules/{get-pkg-repo → through2}/node_modules/readable-stream/transform.js +0 -0
- /package/node_modules/{get-pkg-repo → through2}/node_modules/readable-stream/writable-browser.js +0 -0
- /package/node_modules/{get-pkg-repo → through2}/node_modules/readable-stream/writable.js +0 -0
- /package/node_modules/{get-pkg-repo → through2}/node_modules/safe-buffer/LICENSE +0 -0
- /package/node_modules/{get-pkg-repo → through2}/node_modules/safe-buffer/README.md +0 -0
- /package/node_modules/{get-pkg-repo → through2}/node_modules/safe-buffer/index.d.ts +0 -0
- /package/node_modules/{get-pkg-repo → through2}/node_modules/safe-buffer/index.js +0 -0
- /package/node_modules/{get-pkg-repo → through2}/node_modules/safe-buffer/package.json +0 -0
- /package/node_modules/{get-pkg-repo → through2}/node_modules/string_decoder/.travis.yml +0 -0
- /package/node_modules/{get-pkg-repo → through2}/node_modules/string_decoder/LICENSE +0 -0
- /package/node_modules/{get-pkg-repo → through2}/node_modules/string_decoder/README.md +0 -0
- /package/node_modules/{get-pkg-repo → through2}/node_modules/string_decoder/lib/string_decoder.js +0 -0
- /package/node_modules/{get-pkg-repo → through2}/node_modules/string_decoder/package.json +0 -0
- /package/node_modules/{ansi-styles → wrap-ansi/node_modules/ansi-styles}/index.d.ts +0 -0
- /package/node_modules/{standard-version → wrap-ansi}/node_modules/ansi-styles/license +0 -0
- /package/node_modules/{@babel/highlight → wrap-ansi}/node_modules/color-convert/CHANGELOG.md +0 -0
- /package/node_modules/{@babel/highlight → wrap-ansi}/node_modules/color-convert/LICENSE +0 -0
- /package/node_modules/{@babel/highlight → wrap-ansi}/node_modules/color-convert/README.md +0 -0
- /package/node_modules/{@babel/highlight → wrap-ansi}/node_modules/color-name/LICENSE +0 -0
- /package/node_modules/{@babel/highlight → wrap-ansi}/node_modules/color-name/README.md +0 -0
- /package/node_modules/{@babel/highlight → wrap-ansi}/node_modules/color-name/index.js +0 -0
- /package/node_modules/{hosted-git-info/node_modules/yallist → yallist}/LICENSE +0 -0
- /package/node_modules/{hosted-git-info/node_modules/yallist → yallist}/README.md +0 -0
- /package/node_modules/{hosted-git-info/node_modules/yallist → yallist}/iterator.js +0 -0
- /package/node_modules/{hosted-git-info/node_modules/yallist → yallist}/package.json +0 -0
- /package/node_modules/{hosted-git-info/node_modules/yallist → yallist}/yallist.js +0 -0
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
const conversions = require('./conversions');
|
|
2
|
+
const route = require('./route');
|
|
3
|
+
|
|
4
|
+
const convert = {};
|
|
5
|
+
|
|
6
|
+
const models = Object.keys(conversions);
|
|
7
|
+
|
|
8
|
+
function wrapRaw(fn) {
|
|
9
|
+
const wrappedFn = function (...args) {
|
|
10
|
+
const arg0 = args[0];
|
|
11
|
+
if (arg0 === undefined || arg0 === null) {
|
|
12
|
+
return arg0;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
if (arg0.length > 1) {
|
|
16
|
+
args = arg0;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
return fn(args);
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
// Preserve .conversion property if there is one
|
|
23
|
+
if ('conversion' in fn) {
|
|
24
|
+
wrappedFn.conversion = fn.conversion;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
return wrappedFn;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function wrapRounded(fn) {
|
|
31
|
+
const wrappedFn = function (...args) {
|
|
32
|
+
const arg0 = args[0];
|
|
33
|
+
|
|
34
|
+
if (arg0 === undefined || arg0 === null) {
|
|
35
|
+
return arg0;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
if (arg0.length > 1) {
|
|
39
|
+
args = arg0;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const result = fn(args);
|
|
43
|
+
|
|
44
|
+
// We're assuming the result is an array here.
|
|
45
|
+
// see notice in conversions.js; don't use box types
|
|
46
|
+
// in conversion functions.
|
|
47
|
+
if (typeof result === 'object') {
|
|
48
|
+
for (let len = result.length, i = 0; i < len; i++) {
|
|
49
|
+
result[i] = Math.round(result[i]);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
return result;
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
// Preserve .conversion property if there is one
|
|
57
|
+
if ('conversion' in fn) {
|
|
58
|
+
wrappedFn.conversion = fn.conversion;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
return wrappedFn;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
models.forEach(fromModel => {
|
|
65
|
+
convert[fromModel] = {};
|
|
66
|
+
|
|
67
|
+
Object.defineProperty(convert[fromModel], 'channels', {value: conversions[fromModel].channels});
|
|
68
|
+
Object.defineProperty(convert[fromModel], 'labels', {value: conversions[fromModel].labels});
|
|
69
|
+
|
|
70
|
+
const routes = route(fromModel);
|
|
71
|
+
const routeModels = Object.keys(routes);
|
|
72
|
+
|
|
73
|
+
routeModels.forEach(toModel => {
|
|
74
|
+
const fn = routes[toModel];
|
|
75
|
+
|
|
76
|
+
convert[fromModel][toModel] = wrapRounded(fn);
|
|
77
|
+
convert[fromModel][toModel].raw = wrapRaw(fn);
|
|
78
|
+
});
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
module.exports = convert;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "color-convert",
|
|
3
3
|
"description": "Plain color conversion functions",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "2.0.1",
|
|
5
5
|
"author": "Heather Arthur <fayearthur@gmail.com>",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"repository": "Qix-/color-convert",
|
|
@@ -9,6 +9,9 @@
|
|
|
9
9
|
"pretest": "xo",
|
|
10
10
|
"test": "node test/basic.js"
|
|
11
11
|
},
|
|
12
|
+
"engines": {
|
|
13
|
+
"node": ">=7.0.0"
|
|
14
|
+
},
|
|
12
15
|
"keywords": [
|
|
13
16
|
"color",
|
|
14
17
|
"colour",
|
|
@@ -26,7 +29,6 @@
|
|
|
26
29
|
"files": [
|
|
27
30
|
"index.js",
|
|
28
31
|
"conversions.js",
|
|
29
|
-
"css-keywords.js",
|
|
30
32
|
"route.js"
|
|
31
33
|
],
|
|
32
34
|
"xo": {
|
|
@@ -37,10 +39,10 @@
|
|
|
37
39
|
}
|
|
38
40
|
},
|
|
39
41
|
"devDependencies": {
|
|
40
|
-
"chalk": "
|
|
41
|
-
"xo": "0.
|
|
42
|
+
"chalk": "^2.4.2",
|
|
43
|
+
"xo": "^0.24.0"
|
|
42
44
|
},
|
|
43
45
|
"dependencies": {
|
|
44
|
-
"color-name": "1.1.
|
|
46
|
+
"color-name": "~1.1.4"
|
|
45
47
|
}
|
|
46
48
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
const conversions = require('./conversions');
|
|
2
2
|
|
|
3
3
|
/*
|
|
4
|
-
|
|
4
|
+
This function routes a model to all other models.
|
|
5
5
|
|
|
6
6
|
all functions that are routed have a property `.conversion` attached
|
|
7
7
|
to the returned synthetic function. This property is an array
|
|
@@ -12,11 +12,11 @@ var conversions = require('./conversions');
|
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
14
|
function buildGraph() {
|
|
15
|
-
|
|
15
|
+
const graph = {};
|
|
16
16
|
// https://jsperf.com/object-keys-vs-for-in-with-closure/3
|
|
17
|
-
|
|
17
|
+
const models = Object.keys(conversions);
|
|
18
18
|
|
|
19
|
-
for (
|
|
19
|
+
for (let len = models.length, i = 0; i < len; i++) {
|
|
20
20
|
graph[models[i]] = {
|
|
21
21
|
// http://jsperf.com/1-vs-infinity
|
|
22
22
|
// micro-opt, but this is simple.
|
|
@@ -30,18 +30,18 @@ function buildGraph() {
|
|
|
30
30
|
|
|
31
31
|
// https://en.wikipedia.org/wiki/Breadth-first_search
|
|
32
32
|
function deriveBFS(fromModel) {
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
const graph = buildGraph();
|
|
34
|
+
const queue = [fromModel]; // Unshift -> queue -> pop
|
|
35
35
|
|
|
36
36
|
graph[fromModel].distance = 0;
|
|
37
37
|
|
|
38
38
|
while (queue.length) {
|
|
39
|
-
|
|
40
|
-
|
|
39
|
+
const current = queue.pop();
|
|
40
|
+
const adjacents = Object.keys(conversions[current]);
|
|
41
41
|
|
|
42
|
-
for (
|
|
43
|
-
|
|
44
|
-
|
|
42
|
+
for (let len = adjacents.length, i = 0; i < len; i++) {
|
|
43
|
+
const adjacent = adjacents[i];
|
|
44
|
+
const node = graph[adjacent];
|
|
45
45
|
|
|
46
46
|
if (node.distance === -1) {
|
|
47
47
|
node.distance = graph[current].distance + 1;
|
|
@@ -61,10 +61,10 @@ function link(from, to) {
|
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
function wrapConversion(toModel, graph) {
|
|
64
|
-
|
|
65
|
-
|
|
64
|
+
const path = [graph[toModel].parent, toModel];
|
|
65
|
+
let fn = conversions[graph[toModel].parent][toModel];
|
|
66
66
|
|
|
67
|
-
|
|
67
|
+
let cur = graph[toModel].parent;
|
|
68
68
|
while (graph[cur].parent) {
|
|
69
69
|
path.unshift(graph[cur].parent);
|
|
70
70
|
fn = link(conversions[graph[cur].parent][cur], fn);
|
|
@@ -76,16 +76,16 @@ function wrapConversion(toModel, graph) {
|
|
|
76
76
|
}
|
|
77
77
|
|
|
78
78
|
module.exports = function (fromModel) {
|
|
79
|
-
|
|
80
|
-
|
|
79
|
+
const graph = deriveBFS(fromModel);
|
|
80
|
+
const conversion = {};
|
|
81
81
|
|
|
82
|
-
|
|
83
|
-
for (
|
|
84
|
-
|
|
85
|
-
|
|
82
|
+
const models = Object.keys(graph);
|
|
83
|
+
for (let len = models.length, i = 0; i < len; i++) {
|
|
84
|
+
const toModel = models[i];
|
|
85
|
+
const node = graph[toModel];
|
|
86
86
|
|
|
87
87
|
if (node.parent === null) {
|
|
88
|
-
//
|
|
88
|
+
// No possible conversion, or this node is the source model.
|
|
89
89
|
continue;
|
|
90
90
|
}
|
|
91
91
|
|
|
@@ -1,25 +1,28 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "color-name",
|
|
3
|
-
"version": "1.1.
|
|
4
|
-
"description": "A list of color names and its values",
|
|
5
|
-
"main": "index.js",
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
|
|
9
|
-
"
|
|
10
|
-
"
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
"color-name"
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
"
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
"
|
|
25
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "color-name",
|
|
3
|
+
"version": "1.1.4",
|
|
4
|
+
"description": "A list of color names and its values",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"files": [
|
|
7
|
+
"index.js"
|
|
8
|
+
],
|
|
9
|
+
"scripts": {
|
|
10
|
+
"test": "node test.js"
|
|
11
|
+
},
|
|
12
|
+
"repository": {
|
|
13
|
+
"type": "git",
|
|
14
|
+
"url": "git@github.com:colorjs/color-name.git"
|
|
15
|
+
},
|
|
16
|
+
"keywords": [
|
|
17
|
+
"color-name",
|
|
18
|
+
"color",
|
|
19
|
+
"color-keyword",
|
|
20
|
+
"keyword"
|
|
21
|
+
],
|
|
22
|
+
"author": "DY <dfcreative@gmail.com>",
|
|
23
|
+
"license": "MIT",
|
|
24
|
+
"bugs": {
|
|
25
|
+
"url": "https://github.com/colorjs/color-name/issues"
|
|
26
|
+
},
|
|
27
|
+
"homepage": "https://github.com/colorjs/color-name"
|
|
28
|
+
}
|
package/package.json
CHANGED
|
@@ -45,25 +45,25 @@
|
|
|
45
45
|
"@typescript-eslint/eslint-plugin": "^7",
|
|
46
46
|
"@typescript-eslint/parser": "^7",
|
|
47
47
|
"commit-and-tag-version": "^12",
|
|
48
|
-
"constructs": "10.
|
|
48
|
+
"constructs": "10.4.2",
|
|
49
49
|
"eslint": "^8",
|
|
50
|
-
"eslint-import-resolver-typescript": "^3.
|
|
50
|
+
"eslint-import-resolver-typescript": "^3.7.0",
|
|
51
51
|
"eslint-plugin-import": "^2.31.0",
|
|
52
52
|
"fs-extra": "^11.2.0",
|
|
53
53
|
"jest": "^29.7.0",
|
|
54
54
|
"jest-junit": "^15",
|
|
55
55
|
"jsii": "~5.4",
|
|
56
|
-
"jsii-diff": "^1.
|
|
56
|
+
"jsii-diff": "^1.106.0",
|
|
57
57
|
"jsii-docgen": "^10.5.0",
|
|
58
|
-
"jsii-pacmak": "^1.
|
|
58
|
+
"jsii-pacmak": "^1.106.0",
|
|
59
59
|
"jsii-rosetta": "~5.4",
|
|
60
60
|
"projen": "0.86.7",
|
|
61
61
|
"ts-jest": "^29.2.5",
|
|
62
62
|
"ts-node": "^10.9.2",
|
|
63
|
-
"typescript": "^5.
|
|
63
|
+
"typescript": "^5.7.3"
|
|
64
64
|
},
|
|
65
65
|
"peerDependencies": {
|
|
66
|
-
"constructs": "^10.
|
|
66
|
+
"constructs": "^10.4.2",
|
|
67
67
|
"projen": ">=0.86.7 <1.0.0"
|
|
68
68
|
},
|
|
69
69
|
"dependencies": {
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
"publishConfig": {
|
|
83
83
|
"access": "public"
|
|
84
84
|
},
|
|
85
|
-
"version": "0.2.
|
|
85
|
+
"version": "0.2.3",
|
|
86
86
|
"jest": {
|
|
87
87
|
"coverageProvider": "v8",
|
|
88
88
|
"testMatch": [
|
package/node_modules/@babel/helper-validator-identifier/scripts/generate-identifier-regex.js
DELETED
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
// Always use the latest available version of Unicode!
|
|
4
|
-
// https://tc39.github.io/ecma262/#sec-conformance
|
|
5
|
-
const version = "15.1.0";
|
|
6
|
-
|
|
7
|
-
const start = require(
|
|
8
|
-
"@unicode/unicode-" + version + "/Binary_Property/ID_Start/code-points.js"
|
|
9
|
-
).filter(function (ch) {
|
|
10
|
-
return ch > 0x7f;
|
|
11
|
-
});
|
|
12
|
-
let last = -1;
|
|
13
|
-
const cont = require(
|
|
14
|
-
"@unicode/unicode-" + version + "/Binary_Property/ID_Continue/code-points.js"
|
|
15
|
-
).filter(function (ch) {
|
|
16
|
-
return ch > 0x7f && search(start, ch, last + 1) === -1;
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
function search(arr, ch, starting) {
|
|
20
|
-
for (let i = starting; arr[i] <= ch && i < arr.length; last = i++) {
|
|
21
|
-
if (arr[i] === ch) return i;
|
|
22
|
-
}
|
|
23
|
-
return -1;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
function pad(str, width) {
|
|
27
|
-
while (str.length < width) str = "0" + str;
|
|
28
|
-
return str;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
function esc(code) {
|
|
32
|
-
const hex = code.toString(16);
|
|
33
|
-
if (hex.length <= 2) return "\\x" + pad(hex, 2);
|
|
34
|
-
else return "\\u" + pad(hex, 4);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
function generate(chars) {
|
|
38
|
-
const astral = [];
|
|
39
|
-
let re = "";
|
|
40
|
-
for (let i = 0, at = 0x10000; i < chars.length; i++) {
|
|
41
|
-
const from = chars[i];
|
|
42
|
-
let to = from;
|
|
43
|
-
while (i < chars.length - 1 && chars[i + 1] === to + 1) {
|
|
44
|
-
i++;
|
|
45
|
-
to++;
|
|
46
|
-
}
|
|
47
|
-
if (to <= 0xffff) {
|
|
48
|
-
if (from === to) re += esc(from);
|
|
49
|
-
else if (from + 1 === to) re += esc(from) + esc(to);
|
|
50
|
-
else re += esc(from) + "-" + esc(to);
|
|
51
|
-
} else {
|
|
52
|
-
astral.push(from - at, to - from);
|
|
53
|
-
at = to;
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
return { nonASCII: re, astral: astral };
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
const startData = generate(start);
|
|
60
|
-
const contData = generate(cont);
|
|
61
|
-
|
|
62
|
-
console.log("/* prettier-ignore */");
|
|
63
|
-
console.log('let nonASCIIidentifierStartChars = "' + startData.nonASCII + '";');
|
|
64
|
-
console.log("/* prettier-ignore */");
|
|
65
|
-
console.log('let nonASCIIidentifierChars = "' + contData.nonASCII + '";');
|
|
66
|
-
console.log("/* prettier-ignore */");
|
|
67
|
-
console.log(
|
|
68
|
-
"const astralIdentifierStartCodes = " + JSON.stringify(startData.astral) + ";"
|
|
69
|
-
);
|
|
70
|
-
console.log("/* prettier-ignore */");
|
|
71
|
-
console.log(
|
|
72
|
-
"const astralIdentifierCodes = " + JSON.stringify(contData.astral) + ";"
|
|
73
|
-
);
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2014-present Sebastian McKenzie and other contributors
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
|
6
|
-
a copy of this software and associated documentation files (the
|
|
7
|
-
"Software"), to deal in the Software without restriction, including
|
|
8
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
|
9
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
|
10
|
-
permit persons to whom the Software is furnished to do so, subject to
|
|
11
|
-
the following conditions:
|
|
12
|
-
|
|
13
|
-
The above copyright notice and this permission notice shall be
|
|
14
|
-
included in all copies or substantial portions of the Software.
|
|
15
|
-
|
|
16
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
17
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
18
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
19
|
-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
20
|
-
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
21
|
-
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
22
|
-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
# @babel/highlight
|
|
2
|
-
|
|
3
|
-
> Syntax highlight JavaScript strings for output in terminals.
|
|
4
|
-
|
|
5
|
-
See our website [@babel/highlight](https://babeljs.io/docs/babel-highlight) for more information.
|
|
6
|
-
|
|
7
|
-
## Install
|
|
8
|
-
|
|
9
|
-
Using npm:
|
|
10
|
-
|
|
11
|
-
```sh
|
|
12
|
-
npm install --save-dev @babel/highlight
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
or using yarn:
|
|
16
|
-
|
|
17
|
-
```sh
|
|
18
|
-
yarn add @babel/highlight --dev
|
|
19
|
-
```
|
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = highlight;
|
|
7
|
-
exports.shouldHighlight = shouldHighlight;
|
|
8
|
-
var _jsTokens = require("js-tokens");
|
|
9
|
-
var _helperValidatorIdentifier = require("@babel/helper-validator-identifier");
|
|
10
|
-
var _picocolors = _interopRequireWildcard(require("picocolors"), true);
|
|
11
|
-
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
12
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
13
|
-
const colors = typeof process === "object" && (process.env.FORCE_COLOR === "0" || process.env.FORCE_COLOR === "false") ? (0, _picocolors.createColors)(false) : _picocolors.default;
|
|
14
|
-
const compose = (f, g) => v => f(g(v));
|
|
15
|
-
const sometimesKeywords = new Set(["as", "async", "from", "get", "of", "set"]);
|
|
16
|
-
function getDefs(colors) {
|
|
17
|
-
return {
|
|
18
|
-
keyword: colors.cyan,
|
|
19
|
-
capitalized: colors.yellow,
|
|
20
|
-
jsxIdentifier: colors.yellow,
|
|
21
|
-
punctuator: colors.yellow,
|
|
22
|
-
number: colors.magenta,
|
|
23
|
-
string: colors.green,
|
|
24
|
-
regex: colors.magenta,
|
|
25
|
-
comment: colors.gray,
|
|
26
|
-
invalid: compose(compose(colors.white, colors.bgRed), colors.bold)
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
const NEWLINE = /\r\n|[\n\r\u2028\u2029]/;
|
|
30
|
-
const BRACKET = /^[()[\]{}]$/;
|
|
31
|
-
let tokenize;
|
|
32
|
-
{
|
|
33
|
-
const JSX_TAG = /^[a-z][\w-]*$/i;
|
|
34
|
-
const getTokenType = function (token, offset, text) {
|
|
35
|
-
if (token.type === "name") {
|
|
36
|
-
if ((0, _helperValidatorIdentifier.isKeyword)(token.value) || (0, _helperValidatorIdentifier.isStrictReservedWord)(token.value, true) || sometimesKeywords.has(token.value)) {
|
|
37
|
-
return "keyword";
|
|
38
|
-
}
|
|
39
|
-
if (JSX_TAG.test(token.value) && (text[offset - 1] === "<" || text.slice(offset - 2, offset) === "</")) {
|
|
40
|
-
return "jsxIdentifier";
|
|
41
|
-
}
|
|
42
|
-
if (token.value[0] !== token.value[0].toLowerCase()) {
|
|
43
|
-
return "capitalized";
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
if (token.type === "punctuator" && BRACKET.test(token.value)) {
|
|
47
|
-
return "bracket";
|
|
48
|
-
}
|
|
49
|
-
if (token.type === "invalid" && (token.value === "@" || token.value === "#")) {
|
|
50
|
-
return "punctuator";
|
|
51
|
-
}
|
|
52
|
-
return token.type;
|
|
53
|
-
};
|
|
54
|
-
tokenize = function* (text) {
|
|
55
|
-
let match;
|
|
56
|
-
while (match = _jsTokens.default.exec(text)) {
|
|
57
|
-
const token = _jsTokens.matchToToken(match);
|
|
58
|
-
yield {
|
|
59
|
-
type: getTokenType(token, match.index, text),
|
|
60
|
-
value: token.value
|
|
61
|
-
};
|
|
62
|
-
}
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
function highlightTokens(defs, text) {
|
|
66
|
-
let highlighted = "";
|
|
67
|
-
for (const {
|
|
68
|
-
type,
|
|
69
|
-
value
|
|
70
|
-
} of tokenize(text)) {
|
|
71
|
-
const colorize = defs[type];
|
|
72
|
-
if (colorize) {
|
|
73
|
-
highlighted += value.split(NEWLINE).map(str => colorize(str)).join("\n");
|
|
74
|
-
} else {
|
|
75
|
-
highlighted += value;
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
return highlighted;
|
|
79
|
-
}
|
|
80
|
-
function shouldHighlight(options) {
|
|
81
|
-
return colors.isColorSupported || options.forceColor;
|
|
82
|
-
}
|
|
83
|
-
let pcWithForcedColor = undefined;
|
|
84
|
-
function getColors(forceColor) {
|
|
85
|
-
if (forceColor) {
|
|
86
|
-
var _pcWithForcedColor;
|
|
87
|
-
(_pcWithForcedColor = pcWithForcedColor) != null ? _pcWithForcedColor : pcWithForcedColor = (0, _picocolors.createColors)(true);
|
|
88
|
-
return pcWithForcedColor;
|
|
89
|
-
}
|
|
90
|
-
return colors;
|
|
91
|
-
}
|
|
92
|
-
function highlight(code, options = {}) {
|
|
93
|
-
if (code !== "" && shouldHighlight(options)) {
|
|
94
|
-
const defs = getDefs(getColors(options.forceColor));
|
|
95
|
-
return highlightTokens(defs, code);
|
|
96
|
-
} else {
|
|
97
|
-
return code;
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
{
|
|
101
|
-
let chalk, chalkWithForcedColor;
|
|
102
|
-
exports.getChalk = ({
|
|
103
|
-
forceColor
|
|
104
|
-
}) => {
|
|
105
|
-
var _chalk;
|
|
106
|
-
(_chalk = chalk) != null ? _chalk : chalk = require("chalk");
|
|
107
|
-
if (forceColor) {
|
|
108
|
-
var _chalkWithForcedColor;
|
|
109
|
-
(_chalkWithForcedColor = chalkWithForcedColor) != null ? _chalkWithForcedColor : chalkWithForcedColor = new chalk.constructor({
|
|
110
|
-
enabled: true,
|
|
111
|
-
level: 1
|
|
112
|
-
});
|
|
113
|
-
return chalkWithForcedColor;
|
|
114
|
-
}
|
|
115
|
-
return chalk;
|
|
116
|
-
};
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_jsTokens","require","_helperValidatorIdentifier","_picocolors","_interopRequireWildcard","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","colors","process","env","FORCE_COLOR","createColors","_colors","compose","f","g","v","sometimesKeywords","Set","getDefs","keyword","cyan","capitalized","yellow","jsxIdentifier","punctuator","number","magenta","string","green","regex","comment","gray","invalid","white","bgRed","bold","NEWLINE","BRACKET","tokenize","JSX_TAG","getTokenType","token","offset","text","type","isKeyword","value","isStrictReservedWord","test","slice","toLowerCase","match","jsTokens","exec","matchToToken","index","highlightTokens","defs","highlighted","colorize","split","map","str","join","shouldHighlight","options","isColorSupported","forceColor","pcWithForcedColor","undefined","getColors","_pcWithForcedColor","highlight","code","chalk","chalkWithForcedColor","exports","getChalk","_chalk","_chalkWithForcedColor","constructor","enabled","level"],"sources":["../src/index.ts"],"sourcesContent":["import type { Token as JSToken, JSXToken } from \"js-tokens\";\nimport jsTokens from \"js-tokens\";\n\nimport {\n isStrictReservedWord,\n isKeyword,\n} from \"@babel/helper-validator-identifier\";\n\nimport _colors, { createColors } from \"picocolors\";\nimport type { Colors, Formatter } from \"picocolors/types\";\n// See https://github.com/alexeyraspopov/picocolors/issues/62\nconst colors =\n typeof process === \"object\" &&\n (process.env.FORCE_COLOR === \"0\" || process.env.FORCE_COLOR === \"false\")\n ? createColors(false)\n : _colors;\n\nconst compose: <T, U, V>(f: (gv: U) => V, g: (v: T) => U) => (v: T) => V =\n (f, g) => v =>\n f(g(v));\n\n/**\n * Names that are always allowed as identifiers, but also appear as keywords\n * within certain syntactic productions.\n *\n * https://tc39.es/ecma262/#sec-keywords-and-reserved-words\n *\n * `target` has been omitted since it is very likely going to be a false\n * positive.\n */\nconst sometimesKeywords = new Set([\"as\", \"async\", \"from\", \"get\", \"of\", \"set\"]);\n\ntype InternalTokenType =\n | \"keyword\"\n | \"capitalized\"\n | \"jsxIdentifier\"\n | \"punctuator\"\n | \"number\"\n | \"string\"\n | \"regex\"\n | \"comment\"\n | \"invalid\";\n\ntype Token = {\n type: InternalTokenType | \"uncolored\";\n value: string;\n};\n/**\n * Styles for token types.\n */\nfunction getDefs(colors: Colors): Record<InternalTokenType, Formatter> {\n return {\n keyword: colors.cyan,\n capitalized: colors.yellow,\n jsxIdentifier: colors.yellow,\n punctuator: colors.yellow,\n number: colors.magenta,\n string: colors.green,\n regex: colors.magenta,\n comment: colors.gray,\n invalid: compose(compose(colors.white, colors.bgRed), colors.bold),\n };\n}\n\n/**\n * RegExp to test for newlines in terminal.\n */\nconst NEWLINE = /\\r\\n|[\\n\\r\\u2028\\u2029]/;\n\n/**\n * RegExp to test for the three types of brackets.\n */\nconst BRACKET = /^[()[\\]{}]$/;\n\nlet tokenize: (\n text: string,\n) => Generator<{ type: InternalTokenType | \"uncolored\"; value: string }>;\n\nif (process.env.BABEL_8_BREAKING) {\n /**\n * Get the type of token, specifying punctuator type.\n */\n const getTokenType = function (\n token: JSToken | JSXToken,\n ): InternalTokenType | \"uncolored\" {\n if (token.type === \"IdentifierName\") {\n if (\n isKeyword(token.value) ||\n isStrictReservedWord(token.value, true) ||\n sometimesKeywords.has(token.value)\n ) {\n return \"keyword\";\n }\n\n if (token.value[0] !== token.value[0].toLowerCase()) {\n return \"capitalized\";\n }\n }\n\n if (token.type === \"Punctuator\" && BRACKET.test(token.value)) {\n return \"uncolored\";\n }\n\n if (token.type === \"Invalid\" && token.value === \"@\") {\n return \"punctuator\";\n }\n\n switch (token.type) {\n case \"NumericLiteral\":\n return \"number\";\n\n case \"StringLiteral\":\n case \"JSXString\":\n case \"NoSubstitutionTemplate\":\n return \"string\";\n\n case \"RegularExpressionLiteral\":\n return \"regex\";\n\n case \"Punctuator\":\n case \"JSXPunctuator\":\n return \"punctuator\";\n\n case \"MultiLineComment\":\n case \"SingleLineComment\":\n return \"comment\";\n\n case \"Invalid\":\n case \"JSXInvalid\":\n return \"invalid\";\n\n case \"JSXIdentifier\":\n return \"jsxIdentifier\";\n\n default:\n return \"uncolored\";\n }\n };\n\n /**\n * Turn a string of JS into an array of objects.\n */\n tokenize = function* (text: string): Generator<Token> {\n for (const token of jsTokens(text, { jsx: true })) {\n switch (token.type) {\n case \"TemplateHead\":\n yield { type: \"string\", value: token.value.slice(0, -2) };\n yield { type: \"punctuator\", value: \"${\" };\n break;\n\n case \"TemplateMiddle\":\n yield { type: \"punctuator\", value: \"}\" };\n yield { type: \"string\", value: token.value.slice(1, -2) };\n yield { type: \"punctuator\", value: \"${\" };\n break;\n\n case \"TemplateTail\":\n yield { type: \"punctuator\", value: \"}\" };\n yield { type: \"string\", value: token.value.slice(1) };\n break;\n\n default:\n yield {\n type: getTokenType(token),\n value: token.value,\n };\n }\n }\n };\n} else {\n /**\n * RegExp to test for what seems to be a JSX tag name.\n */\n const JSX_TAG = /^[a-z][\\w-]*$/i;\n\n // The token here is defined in js-tokens@4. However we don't bother\n // typing it since the whole block will be removed in Babel 8\n const getTokenType = function (token: any, offset: number, text: string) {\n if (token.type === \"name\") {\n if (\n isKeyword(token.value) ||\n isStrictReservedWord(token.value, true) ||\n sometimesKeywords.has(token.value)\n ) {\n return \"keyword\";\n }\n\n if (\n JSX_TAG.test(token.value) &&\n (text[offset - 1] === \"<\" || text.slice(offset - 2, offset) === \"</\")\n ) {\n return \"jsxIdentifier\";\n }\n\n if (token.value[0] !== token.value[0].toLowerCase()) {\n return \"capitalized\";\n }\n }\n\n if (token.type === \"punctuator\" && BRACKET.test(token.value)) {\n return \"bracket\";\n }\n\n if (\n token.type === \"invalid\" &&\n (token.value === \"@\" || token.value === \"#\")\n ) {\n return \"punctuator\";\n }\n\n return token.type;\n };\n\n tokenize = function* (text: string) {\n let match;\n while ((match = (jsTokens as any).default.exec(text))) {\n const token = (jsTokens as any).matchToToken(match);\n\n yield {\n type: getTokenType(token, match.index, text),\n value: token.value,\n };\n }\n };\n}\n\n/**\n * Highlight `text` using the token definitions in `defs`.\n */\nfunction highlightTokens(defs: Record<string, Formatter>, text: string) {\n let highlighted = \"\";\n\n for (const { type, value } of tokenize(text)) {\n const colorize = defs[type];\n if (colorize) {\n highlighted += value\n .split(NEWLINE)\n .map(str => colorize(str))\n .join(\"\\n\");\n } else {\n highlighted += value;\n }\n }\n\n return highlighted;\n}\n\n/**\n * Highlight `text` using the token definitions in `defs`.\n */\n\ntype Options = {\n forceColor?: boolean;\n};\n\n/**\n * Whether the code should be highlighted given the passed options.\n */\nexport function shouldHighlight(options: Options): boolean {\n return colors.isColorSupported || options.forceColor;\n}\n\nlet pcWithForcedColor: Colors = undefined;\nfunction getColors(forceColor: boolean) {\n if (forceColor) {\n pcWithForcedColor ??= createColors(true);\n return pcWithForcedColor;\n }\n return colors;\n}\n\n/**\n * Highlight `code`.\n */\nexport default function highlight(code: string, options: Options = {}): string {\n if (code !== \"\" && shouldHighlight(options)) {\n const defs = getDefs(getColors(options.forceColor));\n return highlightTokens(defs, code);\n } else {\n return code;\n }\n}\n\nif (!process.env.BABEL_8_BREAKING && !USE_ESM && !IS_STANDALONE) {\n let chalk: any, chalkWithForcedColor: any;\n // eslint-disable-next-line no-restricted-globals\n exports.getChalk = ({ forceColor }: Options) => {\n // eslint-disable-next-line no-restricted-globals\n chalk ??= require(\"chalk\");\n if (forceColor) {\n chalkWithForcedColor ??= new chalk.constructor({\n enabled: true,\n level: 1,\n });\n return chalkWithForcedColor;\n }\n return chalk;\n };\n}\n"],"mappings":";;;;;;;AACA,IAAAA,SAAA,GAAAC,OAAA;AAEA,IAAAC,0BAAA,GAAAD,OAAA;AAKA,IAAAE,WAAA,GAAAC,uBAAA,CAAAH,OAAA;AAAmD,SAAAI,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAF,wBAAAE,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA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