@galadrim/galadmin 0.1.32 → 0.1.34
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/dist/api.js +1 -0
- package/dist/api.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/api.ts +1 -0
- package/src/front/build/asset-manifest.json +3 -3
- package/src/front/build/index.html +1 -1
- package/src/front/build/static/js/main.4ce5340d.chunk.js +2 -0
- package/src/front/build/static/js/main.4ce5340d.chunk.js.map +1 -0
- package/src/front/node_modules/.cache/.eslintcache +1 -1
- package/src/front/node_modules/.cache/babel-loader/{a442b07ccfc975b334314fdb76b50b42.json → 04b67a528af96a9bceeadf265dfb56d2.json} +1 -1
- package/src/front/node_modules/.cache/babel-loader/cdf89c046963294c4cbf7482c8706cbc.json +1 -0
- package/src/front/node_modules/.cache/terser-webpack-plugin/content-v2/sha512/c3/3e/f2b5b90044b7bdbb4cff67b2c09e24bb506274240d920de24bb4b678f3f00b80f7e9f0900cd1de883484031488d8603e97ea6b4e39a9c6ab5160353d3be9 +1 -0
- package/src/front/node_modules/.cache/terser-webpack-plugin/index-v5/6c/19/fe86ba5d7c4062f185480ad22dd3b9fae9b30149827224339f9a633a9a94 +1 -1
- package/src/front/node_modules/.cache/terser-webpack-plugin/index-v5/87/08/421190bfe6e50816e059da6c33526c9943732ef856ebd2752d0cbfb4a852 +1 -1
- package/src/front/node_modules/.cache/terser-webpack-plugin/index-v5/{b3/58/c0bc4ec69302d38ceac243da47ee7549ca88af7e0c89962c82ad9b304bbb → c2/e5/5451dd89bb0fd48f988bf27c7ee614c66eb91f7085c5b5c8cb33048d0c32} +1 -1
- package/src/front/node_modules/.package-lock.json +111 -78
- package/src/front/node_modules/@babel/code-frame/README.md +1 -1
- package/src/front/node_modules/@babel/code-frame/lib/index.js +15 -1
- package/src/front/node_modules/@babel/code-frame/lib/index.js.map +1 -1
- package/src/front/node_modules/@babel/code-frame/node_modules/ansi-styles/index.js +165 -0
- package/src/front/node_modules/@babel/code-frame/node_modules/ansi-styles/license +9 -0
- package/src/front/node_modules/@babel/code-frame/node_modules/ansi-styles/package.json +56 -0
- package/src/front/node_modules/@babel/code-frame/node_modules/ansi-styles/readme.md +147 -0
- package/src/front/node_modules/@babel/code-frame/node_modules/chalk/index.js +228 -0
- package/src/front/node_modules/@babel/code-frame/node_modules/chalk/index.js.flow +93 -0
- package/src/front/node_modules/@babel/code-frame/node_modules/chalk/license +9 -0
- package/src/front/node_modules/@babel/code-frame/node_modules/chalk/package.json +71 -0
- package/src/front/node_modules/@babel/code-frame/node_modules/chalk/readme.md +314 -0
- package/src/front/node_modules/@babel/code-frame/node_modules/chalk/templates.js +128 -0
- package/src/front/node_modules/@babel/code-frame/node_modules/chalk/types/index.d.ts +97 -0
- package/src/front/node_modules/@babel/code-frame/node_modules/supports-color/browser.js +5 -0
- package/src/front/node_modules/@babel/code-frame/node_modules/supports-color/index.js +131 -0
- package/src/front/node_modules/@babel/code-frame/node_modules/supports-color/license +9 -0
- package/src/front/node_modules/@babel/code-frame/node_modules/supports-color/package.json +53 -0
- package/src/front/node_modules/@babel/code-frame/node_modules/supports-color/readme.md +66 -0
- package/src/front/node_modules/@babel/code-frame/package.json +3 -2
- package/src/front/node_modules/@babel/compat-data/README.md +1 -1
- package/src/front/node_modules/@babel/compat-data/data/corejs2-built-ins.json +146 -0
- package/src/front/node_modules/@babel/compat-data/data/native-modules.json +1 -1
- package/src/front/node_modules/@babel/compat-data/data/plugin-bugfixes.json +17 -0
- package/src/front/node_modules/@babel/compat-data/data/plugins.json +76 -9
- package/src/front/node_modules/@babel/compat-data/package.json +4 -4
- package/src/front/node_modules/@babel/core/README.md +1 -1
- package/src/front/node_modules/@babel/core/cjs-proxy.cjs +3 -1
- package/src/front/node_modules/@babel/core/lib/config/config-chain.js +8 -7
- package/src/front/node_modules/@babel/core/lib/config/config-chain.js.map +1 -1
- package/src/front/node_modules/@babel/core/lib/config/config-descriptors.js +2 -1
- package/src/front/node_modules/@babel/core/lib/config/config-descriptors.js.map +1 -1
- package/src/front/node_modules/@babel/core/lib/config/full.js +2 -3
- package/src/front/node_modules/@babel/core/lib/config/full.js.map +1 -1
- package/src/front/node_modules/@babel/core/lib/config/index.js.map +1 -1
- package/src/front/node_modules/@babel/core/lib/config/item.js.map +1 -1
- package/src/front/node_modules/@babel/core/lib/config/printer.js.map +1 -1
- package/src/front/node_modules/@babel/core/lib/config/validation/option-assertions.js +1 -3
- package/src/front/node_modules/@babel/core/lib/config/validation/option-assertions.js.map +1 -1
- package/src/front/node_modules/@babel/core/lib/config/validation/options.js.map +1 -1
- package/src/front/node_modules/@babel/core/lib/config/validation/plugins.js +5 -2
- package/src/front/node_modules/@babel/core/lib/config/validation/plugins.js.map +1 -1
- package/src/front/node_modules/@babel/core/lib/errors/rewrite-stack-trace.js +2 -1
- package/src/front/node_modules/@babel/core/lib/errors/rewrite-stack-trace.js.map +1 -1
- package/src/front/node_modules/@babel/core/lib/index.js +2 -1
- package/src/front/node_modules/@babel/core/lib/index.js.map +1 -1
- package/src/front/node_modules/@babel/core/lib/transformation/file/generate.js.map +1 -1
- package/src/front/node_modules/@babel/core/lib/transformation/index.js +3 -1
- package/src/front/node_modules/@babel/core/lib/transformation/index.js.map +1 -1
- package/src/front/node_modules/@babel/core/lib/transformation/plugin-pass.js.map +1 -1
- package/src/front/node_modules/@babel/core/node_modules/semver/package.json +19 -9
- package/src/front/node_modules/@babel/core/node_modules/semver/semver.js +71 -24
- package/src/front/node_modules/@babel/core/package.json +12 -12
- package/src/front/node_modules/@babel/generator/README.md +1 -1
- package/src/front/node_modules/@babel/generator/lib/buffer.js +6 -6
- package/src/front/node_modules/@babel/generator/lib/buffer.js.map +1 -1
- package/src/front/node_modules/@babel/generator/lib/generators/classes.js +6 -6
- package/src/front/node_modules/@babel/generator/lib/generators/classes.js.map +1 -1
- package/src/front/node_modules/@babel/generator/lib/generators/methods.js.map +1 -1
- package/src/front/node_modules/@babel/generator/lib/generators/types.js +1 -1
- package/src/front/node_modules/@babel/generator/lib/generators/types.js.map +1 -1
- package/src/front/node_modules/@babel/generator/lib/index.js +2 -1
- package/src/front/node_modules/@babel/generator/lib/index.js.map +1 -1
- package/src/front/node_modules/@babel/generator/lib/printer.js +6 -6
- package/src/front/node_modules/@babel/generator/lib/printer.js.map +1 -1
- package/src/front/node_modules/@babel/generator/lib/source-map.js.map +1 -1
- package/src/front/node_modules/@babel/generator/package.json +5 -4
- package/src/front/node_modules/@babel/helper-compilation-targets/README.md +1 -1
- package/src/front/node_modules/@babel/helper-compilation-targets/lib/filter-items.js +2 -6
- package/src/front/node_modules/@babel/helper-compilation-targets/lib/filter-items.js.map +1 -1
- package/src/front/node_modules/@babel/helper-compilation-targets/lib/index.js +8 -4
- package/src/front/node_modules/@babel/helper-compilation-targets/lib/index.js.map +1 -1
- package/src/front/node_modules/@babel/helper-compilation-targets/lib/options.js +2 -1
- package/src/front/node_modules/@babel/helper-compilation-targets/lib/options.js.map +1 -1
- package/src/front/node_modules/@babel/helper-compilation-targets/lib/targets.js +1 -1
- package/src/front/node_modules/@babel/helper-compilation-targets/lib/targets.js.map +1 -1
- package/src/front/node_modules/@babel/helper-compilation-targets/node_modules/semver/package.json +19 -9
- package/src/front/node_modules/@babel/helper-compilation-targets/node_modules/semver/semver.js +71 -24
- package/src/front/node_modules/@babel/helper-compilation-targets/package.json +4 -8
- package/src/front/node_modules/@babel/helper-module-transforms/README.md +1 -1
- package/src/front/node_modules/@babel/helper-module-transforms/lib/dynamic-import.js +11 -12
- package/src/front/node_modules/@babel/helper-module-transforms/lib/dynamic-import.js.map +1 -1
- package/src/front/node_modules/@babel/helper-module-transforms/lib/index.js +15 -16
- package/src/front/node_modules/@babel/helper-module-transforms/lib/index.js.map +1 -1
- package/src/front/node_modules/@babel/helper-module-transforms/lib/rewrite-live-references.js +3 -4
- package/src/front/node_modules/@babel/helper-module-transforms/lib/rewrite-live-references.js.map +1 -1
- package/src/front/node_modules/@babel/helper-module-transforms/lib/rewrite-this.js +4 -5
- package/src/front/node_modules/@babel/helper-module-transforms/lib/rewrite-this.js.map +1 -1
- package/src/front/node_modules/@babel/helper-module-transforms/package.json +10 -6
- package/src/front/node_modules/@babel/helper-split-export-declaration/README.md +1 -1
- package/src/front/node_modules/@babel/helper-split-export-declaration/lib/index.js +5 -1
- package/src/front/node_modules/@babel/helper-split-export-declaration/lib/index.js.map +1 -1
- package/src/front/node_modules/@babel/helper-split-export-declaration/package.json +1 -1
- package/src/front/node_modules/@babel/helpers/README.md +1 -1
- package/src/front/node_modules/@babel/helpers/lib/helpers/dispose.js +9 -13
- package/src/front/node_modules/@babel/helpers/lib/helpers/dispose.js.map +1 -1
- package/src/front/node_modules/@babel/helpers/lib/helpers/regeneratorRuntime.js +2 -4
- package/src/front/node_modules/@babel/helpers/lib/helpers/regeneratorRuntime.js.map +1 -1
- package/src/front/node_modules/@babel/helpers/lib/helpers/using.js +1 -1
- package/src/front/node_modules/@babel/helpers/lib/helpers/using.js.map +1 -1
- package/src/front/node_modules/@babel/helpers/lib/helpers-generated.js +3 -3
- package/src/front/node_modules/@babel/helpers/lib/helpers-generated.js.map +1 -1
- package/src/front/node_modules/@babel/helpers/package.json +6 -6
- package/src/front/node_modules/@babel/highlight/README.md +1 -1
- package/src/front/node_modules/@babel/highlight/lib/index.js +20 -10
- package/src/front/node_modules/@babel/highlight/lib/index.js.map +1 -1
- package/src/front/node_modules/@babel/highlight/package.json +2 -3
- package/src/front/node_modules/@babel/parser/README.md +1 -1
- package/src/front/node_modules/@babel/parser/lib/index.js +116 -163
- package/src/front/node_modules/@babel/parser/lib/index.js.map +1 -1
- package/src/front/node_modules/@babel/parser/lib/options.js +6 -2
- package/src/front/node_modules/@babel/parser/lib/options.js.map +1 -1
- package/src/front/node_modules/@babel/parser/lib/parser/expression.js +4 -4
- package/src/front/node_modules/@babel/parser/lib/parser/expression.js.map +1 -1
- package/src/front/node_modules/@babel/parser/lib/parser/lval.js +6 -6
- package/src/front/node_modules/@babel/parser/lib/parser/lval.js.map +1 -1
- package/src/front/node_modules/@babel/parser/lib/parser/statement.js +21 -22
- package/src/front/node_modules/@babel/parser/lib/parser/statement.js.map +1 -1
- package/src/front/node_modules/@babel/parser/lib/parser/util.js +1 -1
- package/src/front/node_modules/@babel/parser/lib/parser/util.js.map +1 -1
- package/src/front/node_modules/@babel/parser/lib/plugins/flow/index.js +7 -7
- package/src/front/node_modules/@babel/parser/lib/plugins/flow/index.js.map +1 -1
- package/src/front/node_modules/@babel/parser/lib/plugins/flow/scope.js +2 -2
- package/src/front/node_modules/@babel/parser/lib/plugins/flow/scope.js.map +1 -1
- package/src/front/node_modules/@babel/parser/lib/plugins/placeholders.js +2 -1
- package/src/front/node_modules/@babel/parser/lib/plugins/placeholders.js.map +1 -1
- package/src/front/node_modules/@babel/parser/lib/plugins/typescript/index.js +16 -16
- package/src/front/node_modules/@babel/parser/lib/plugins/typescript/index.js.map +1 -1
- package/src/front/node_modules/@babel/parser/lib/plugins/typescript/scope.js +16 -14
- package/src/front/node_modules/@babel/parser/lib/plugins/typescript/scope.js.map +1 -1
- package/src/front/node_modules/@babel/parser/lib/util/class-scope.js +5 -5
- package/src/front/node_modules/@babel/parser/lib/util/class-scope.js.map +1 -1
- package/src/front/node_modules/@babel/parser/lib/util/expression-scope.js +7 -12
- package/src/front/node_modules/@babel/parser/lib/util/expression-scope.js.map +1 -1
- package/src/front/node_modules/@babel/parser/lib/util/scope.js +23 -23
- package/src/front/node_modules/@babel/parser/lib/util/scope.js.map +1 -1
- package/src/front/node_modules/@babel/parser/lib/util/scopeflags.js +60 -99
- package/src/front/node_modules/@babel/parser/lib/util/scopeflags.js.map +1 -1
- package/src/front/node_modules/@babel/parser/package.json +3 -3
- package/src/front/node_modules/@babel/traverse/README.md +1 -1
- package/src/front/node_modules/@babel/traverse/lib/cache.js +24 -3
- package/src/front/node_modules/@babel/traverse/lib/cache.js.map +1 -1
- package/src/front/node_modules/@babel/traverse/lib/index.js +5 -3
- package/src/front/node_modules/@babel/traverse/lib/index.js.map +1 -1
- package/src/front/node_modules/@babel/traverse/lib/path/context.js.map +1 -1
- package/src/front/node_modules/@babel/traverse/lib/path/conversion.js +1 -4
- package/src/front/node_modules/@babel/traverse/lib/path/conversion.js.map +1 -1
- package/src/front/node_modules/@babel/traverse/lib/path/index.js +2 -6
- package/src/front/node_modules/@babel/traverse/lib/path/index.js.map +1 -1
- package/src/front/node_modules/@babel/traverse/lib/path/lib/hoister.js.map +1 -1
- package/src/front/node_modules/@babel/traverse/lib/path/lib/virtual-types-validator.js +9 -7
- package/src/front/node_modules/@babel/traverse/lib/path/lib/virtual-types-validator.js.map +1 -1
- package/src/front/node_modules/@babel/traverse/lib/path/lib/virtual-types.js.map +1 -1
- package/src/front/node_modules/@babel/traverse/lib/path/modification.js +3 -2
- package/src/front/node_modules/@babel/traverse/lib/path/modification.js.map +1 -1
- package/src/front/node_modules/@babel/traverse/lib/path/removal.js +3 -1
- package/src/front/node_modules/@babel/traverse/lib/path/removal.js.map +1 -1
- package/src/front/node_modules/@babel/traverse/lib/path/replacement.js +4 -4
- package/src/front/node_modules/@babel/traverse/lib/path/replacement.js.map +1 -1
- package/src/front/node_modules/@babel/traverse/lib/scope/index.js +23 -10
- package/src/front/node_modules/@babel/traverse/lib/scope/index.js.map +1 -1
- package/src/front/node_modules/@babel/traverse/lib/traverse-node.js +6 -2
- package/src/front/node_modules/@babel/traverse/lib/traverse-node.js.map +1 -1
- package/src/front/node_modules/@babel/traverse/lib/types.js.map +1 -1
- package/src/front/node_modules/@babel/traverse/lib/visitors.js +22 -15
- package/src/front/node_modules/@babel/traverse/lib/visitors.js.map +1 -1
- package/src/front/node_modules/@babel/traverse/package.json +7 -6
- package/src/front/node_modules/@babel/types/README.md +1 -1
- package/src/front/node_modules/@babel/types/lib/ast-types/generated/index.js.map +1 -1
- package/src/front/node_modules/@babel/types/lib/converters/toStatement.js.map +1 -1
- package/src/front/node_modules/@babel/types/lib/definitions/core.js +8 -1
- package/src/front/node_modules/@babel/types/lib/definitions/core.js.map +1 -1
- package/src/front/node_modules/@babel/types/lib/index.d.ts +11 -10
- package/src/front/node_modules/@babel/types/lib/validators/generated/index.js.map +1 -1
- package/src/front/node_modules/@babel/types/lib/validators/isType.js +1 -0
- package/src/front/node_modules/@babel/types/lib/validators/isType.js.map +1 -1
- package/src/front/node_modules/@babel/types/package.json +3 -4
- package/src/front/node_modules/react-scripts/node_modules/@babel/core/node_modules/semver/package.json +19 -9
- package/src/front/node_modules/react-scripts/node_modules/@babel/core/node_modules/semver/semver.js +68 -26
- package/src/front/node_modules/typescript/lib/tsc.js +16 -19
- package/src/front/node_modules/typescript/lib/tsserver.js +22 -24
- package/src/front/node_modules/typescript/lib/tsserverlibrary.d.ts +0 -1
- package/src/front/node_modules/typescript/lib/tsserverlibrary.js +22 -24
- package/src/front/node_modules/typescript/lib/typescript.d.ts +0 -1
- package/src/front/node_modules/typescript/lib/typescript.js +22 -24
- package/src/front/node_modules/typescript/lib/typingsInstaller.js +1 -1
- package/src/front/node_modules/typescript/package.json +1 -1
- package/src/front/package-lock.json +212 -153
- package/src/front/src/components/Input.js +6 -0
- package/src/front/src/components/Sidebar.js +2 -2
- package/src/front/build/static/js/main.405f6f90.chunk.js +0 -2
- package/src/front/build/static/js/main.405f6f90.chunk.js.map +0 -1
- package/src/front/node_modules/.cache/babel-loader/964c56108bc43622244156806407d3d8.json +0 -1
- package/src/front/node_modules/.cache/terser-webpack-plugin/content-v2/sha512/00/35/f206f48274d030c7a1e2457996323f694ca72c9ec94bddb8ecc8f37aa4632918182acf152491e9b475b95f567493b47644434cdb77f795b23c0b8392aaf7 +0 -1
- package/src/front/node_modules/@babel/core/node_modules/semver/CHANGELOG.md +0 -70
- package/src/front/node_modules/@babel/helper-compilation-targets/node_modules/semver/CHANGELOG.md +0 -70
- package/src/front/node_modules/react-scripts/node_modules/@babel/core/node_modules/semver/CHANGELOG.md +0 -39
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
|
|
2
|
+
036b6111b1414d4795088a12917755a3a0253cbf {"key":"{\"terser\":\"5.7.1\",\"terser-webpack-plugin\":\"4.2.3\",\"terser-webpack-plugin-options\":{\"test\":new RegExp(\"\\\\.[cm]?js(\\\\?.*)?$\", \"i\"),\"extractComments\":true,\"sourceMap\":true,\"cache\":true,\"cacheKeys\":defaultCacheKeys => defaultCacheKeys,\"parallel\":true,\"include\":undefined,\"exclude\":undefined,\"minify\":undefined,\"terserOptions\":{\"parse\":{\"ecma\":8},\"compress\":{\"ecma\":5,\"warnings\":false,\"comparisons\":false,\"inline\":2},\"mangle\":{\"safari10\":true},\"keep_classnames\":false,\"keep_fnames\":false,\"output\":{\"ecma\":5,\"comments\":false,\"ascii_only\":true},\"ecma\":5}},\"name\":\"static\\u002Fjs\\u002F2.e31544be.chunk.js\",\"contentHash\":\"646996a701932e81a160\"}","integrity":"sha512-jy1aap86drB7QdtWBWKx3vac5au1zXiClhcIX5FujN+2+BuzJCUuGeRFJVAI+aKdcikmoLeDPMWGZOuaMiQE8Q==","time":1692290591787,"size":1900994}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
|
|
2
|
+
d85d60acba3dfb4cb416a6339b7cb3d469f85c7a {"key":"{\"terser\":\"5.7.1\",\"terser-webpack-plugin\":\"4.2.3\",\"terser-webpack-plugin-options\":{\"test\":new RegExp(\"\\\\.[cm]?js(\\\\?.*)?$\", \"i\"),\"extractComments\":true,\"sourceMap\":true,\"cache\":true,\"cacheKeys\":defaultCacheKeys => defaultCacheKeys,\"parallel\":true,\"include\":undefined,\"exclude\":undefined,\"minify\":undefined,\"terserOptions\":{\"parse\":{\"ecma\":8},\"compress\":{\"ecma\":5,\"warnings\":false,\"comparisons\":false,\"inline\":2},\"mangle\":{\"safari10\":true},\"keep_classnames\":false,\"keep_fnames\":false,\"output\":{\"ecma\":5,\"comments\":false,\"ascii_only\":true},\"ecma\":5}},\"name\":\"static\\u002Fjs\\u002Fruntime-main.2084140f.js\",\"contentHash\":\"21b0955fafaa36835c2c\"}","integrity":"sha512-EIHWkk+Hu8omZttNSZyf/dcQREufSs8WYrDS8rrnA4aKRWlIARB00JVPiR1DRsuEMh2l+YSkkh+tpa2nXovJ6g==","time":1692290587798,"size":17514}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
|
|
2
|
+
307c1030bb68d8186477e1cbe7983a59a83a307d {"key":"{\"terser\":\"5.7.1\",\"terser-webpack-plugin\":\"4.2.3\",\"terser-webpack-plugin-options\":{\"test\":new RegExp(\"\\\\.[cm]?js(\\\\?.*)?$\", \"i\"),\"extractComments\":true,\"sourceMap\":true,\"cache\":true,\"cacheKeys\":defaultCacheKeys => defaultCacheKeys,\"parallel\":true,\"include\":undefined,\"exclude\":undefined,\"minify\":undefined,\"terserOptions\":{\"parse\":{\"ecma\":8},\"compress\":{\"ecma\":5,\"warnings\":false,\"comparisons\":false,\"inline\":2},\"mangle\":{\"safari10\":true},\"keep_classnames\":false,\"keep_fnames\":false,\"output\":{\"ecma\":5,\"comments\":false,\"ascii_only\":true},\"ecma\":5}},\"name\":\"static\\u002Fjs\\u002Fmain.4ce5340d.chunk.js\",\"contentHash\":\"a92630b82e0b0db890d1\"}","integrity":"sha512-wz7ytbkARLe9u0z/Z7LAniS7UGJ0JA2SDeJLtLZ48/ALgPfp8JAM0d6INIQDFIjYYD6X6mtOOanGq1FgNT076Q==","time":1692290587752,"size":397956}
|
|
@@ -17,44 +17,80 @@
|
|
|
17
17
|
}
|
|
18
18
|
},
|
|
19
19
|
"node_modules/@babel/code-frame": {
|
|
20
|
-
"version": "7.22.
|
|
21
|
-
"resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.22.
|
|
22
|
-
"integrity": "sha512
|
|
20
|
+
"version": "7.22.10",
|
|
21
|
+
"resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.22.10.tgz",
|
|
22
|
+
"integrity": "sha512-/KKIMG4UEL35WmI9OlvMhurwtytjvXoFcGNrOvyG9zIzA8YmPjVtIZUf7b05+TPO7G7/GEmLHDaoCgACHl9hhA==",
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@babel/highlight": "^7.22.
|
|
24
|
+
"@babel/highlight": "^7.22.10",
|
|
25
|
+
"chalk": "^2.4.2"
|
|
25
26
|
},
|
|
26
27
|
"engines": {
|
|
27
28
|
"node": ">=6.9.0"
|
|
28
29
|
}
|
|
29
30
|
},
|
|
31
|
+
"node_modules/@babel/code-frame/node_modules/ansi-styles": {
|
|
32
|
+
"version": "3.2.1",
|
|
33
|
+
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",
|
|
34
|
+
"integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==",
|
|
35
|
+
"dependencies": {
|
|
36
|
+
"color-convert": "^1.9.0"
|
|
37
|
+
},
|
|
38
|
+
"engines": {
|
|
39
|
+
"node": ">=4"
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
"node_modules/@babel/code-frame/node_modules/chalk": {
|
|
43
|
+
"version": "2.4.2",
|
|
44
|
+
"resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz",
|
|
45
|
+
"integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==",
|
|
46
|
+
"dependencies": {
|
|
47
|
+
"ansi-styles": "^3.2.1",
|
|
48
|
+
"escape-string-regexp": "^1.0.5",
|
|
49
|
+
"supports-color": "^5.3.0"
|
|
50
|
+
},
|
|
51
|
+
"engines": {
|
|
52
|
+
"node": ">=4"
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
"node_modules/@babel/code-frame/node_modules/supports-color": {
|
|
56
|
+
"version": "5.5.0",
|
|
57
|
+
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz",
|
|
58
|
+
"integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==",
|
|
59
|
+
"dependencies": {
|
|
60
|
+
"has-flag": "^3.0.0"
|
|
61
|
+
},
|
|
62
|
+
"engines": {
|
|
63
|
+
"node": ">=4"
|
|
64
|
+
}
|
|
65
|
+
},
|
|
30
66
|
"node_modules/@babel/compat-data": {
|
|
31
|
-
"version": "7.22.
|
|
32
|
-
"resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.22.
|
|
33
|
-
"integrity": "sha512-
|
|
67
|
+
"version": "7.22.9",
|
|
68
|
+
"resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.22.9.tgz",
|
|
69
|
+
"integrity": "sha512-5UamI7xkUcJ3i9qVDS+KFDEK8/7oJ55/sJMB1Ge7IEapr7KfdfV/HErR+koZwOfd+SgtFKOKRhRakdg++DcJpQ==",
|
|
34
70
|
"engines": {
|
|
35
71
|
"node": ">=6.9.0"
|
|
36
72
|
}
|
|
37
73
|
},
|
|
38
74
|
"node_modules/@babel/core": {
|
|
39
|
-
"version": "7.22.
|
|
40
|
-
"resolved": "https://registry.npmjs.org/@babel/core/-/core-7.22.
|
|
41
|
-
"integrity": "sha512-
|
|
75
|
+
"version": "7.22.10",
|
|
76
|
+
"resolved": "https://registry.npmjs.org/@babel/core/-/core-7.22.10.tgz",
|
|
77
|
+
"integrity": "sha512-fTmqbbUBAwCcre6zPzNngvsI0aNrPZe77AeqvDxWM9Nm+04RrJ3CAmGHA9f7lJQY6ZMhRztNemy4uslDxTX4Qw==",
|
|
42
78
|
"dependencies": {
|
|
43
79
|
"@ampproject/remapping": "^2.2.0",
|
|
44
|
-
"@babel/code-frame": "^7.22.
|
|
45
|
-
"@babel/generator": "^7.22.
|
|
46
|
-
"@babel/helper-compilation-targets": "^7.22.
|
|
47
|
-
"@babel/helper-module-transforms": "^7.22.
|
|
48
|
-
"@babel/helpers": "^7.22.
|
|
49
|
-
"@babel/parser": "^7.22.
|
|
80
|
+
"@babel/code-frame": "^7.22.10",
|
|
81
|
+
"@babel/generator": "^7.22.10",
|
|
82
|
+
"@babel/helper-compilation-targets": "^7.22.10",
|
|
83
|
+
"@babel/helper-module-transforms": "^7.22.9",
|
|
84
|
+
"@babel/helpers": "^7.22.10",
|
|
85
|
+
"@babel/parser": "^7.22.10",
|
|
50
86
|
"@babel/template": "^7.22.5",
|
|
51
|
-
"@babel/traverse": "^7.22.
|
|
52
|
-
"@babel/types": "^7.22.
|
|
87
|
+
"@babel/traverse": "^7.22.10",
|
|
88
|
+
"@babel/types": "^7.22.10",
|
|
53
89
|
"convert-source-map": "^1.7.0",
|
|
54
90
|
"debug": "^4.1.0",
|
|
55
91
|
"gensync": "^1.0.0-beta.2",
|
|
56
92
|
"json5": "^2.2.2",
|
|
57
|
-
"semver": "^6.3.
|
|
93
|
+
"semver": "^6.3.1"
|
|
58
94
|
},
|
|
59
95
|
"engines": {
|
|
60
96
|
"node": ">=6.9.0"
|
|
@@ -65,19 +101,19 @@
|
|
|
65
101
|
}
|
|
66
102
|
},
|
|
67
103
|
"node_modules/@babel/core/node_modules/semver": {
|
|
68
|
-
"version": "6.3.
|
|
69
|
-
"resolved": "https://registry.npmjs.org/semver/-/semver-6.3.
|
|
70
|
-
"integrity": "sha512-
|
|
104
|
+
"version": "6.3.1",
|
|
105
|
+
"resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz",
|
|
106
|
+
"integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==",
|
|
71
107
|
"bin": {
|
|
72
108
|
"semver": "bin/semver.js"
|
|
73
109
|
}
|
|
74
110
|
},
|
|
75
111
|
"node_modules/@babel/generator": {
|
|
76
|
-
"version": "7.22.
|
|
77
|
-
"resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.22.
|
|
78
|
-
"integrity": "sha512
|
|
112
|
+
"version": "7.22.10",
|
|
113
|
+
"resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.22.10.tgz",
|
|
114
|
+
"integrity": "sha512-79KIf7YiWjjdZ81JnLujDRApWtl7BxTqWD88+FFdQEIOG8LJ0etDOM7CXuIgGJa55sGOwZVwuEsaLEm0PJ5/+A==",
|
|
79
115
|
"dependencies": {
|
|
80
|
-
"@babel/types": "^7.22.
|
|
116
|
+
"@babel/types": "^7.22.10",
|
|
81
117
|
"@jridgewell/gen-mapping": "^0.3.2",
|
|
82
118
|
"@jridgewell/trace-mapping": "^0.3.17",
|
|
83
119
|
"jsesc": "^2.5.1"
|
|
@@ -110,21 +146,18 @@
|
|
|
110
146
|
}
|
|
111
147
|
},
|
|
112
148
|
"node_modules/@babel/helper-compilation-targets": {
|
|
113
|
-
"version": "7.22.
|
|
114
|
-
"resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.22.
|
|
115
|
-
"integrity": "sha512-
|
|
149
|
+
"version": "7.22.10",
|
|
150
|
+
"resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.22.10.tgz",
|
|
151
|
+
"integrity": "sha512-JMSwHD4J7SLod0idLq5PKgI+6g/hLD/iuWBq08ZX49xE14VpVEojJ5rHWptpirV2j020MvypRLAXAO50igCJ5Q==",
|
|
116
152
|
"dependencies": {
|
|
117
|
-
"@babel/compat-data": "^7.22.
|
|
153
|
+
"@babel/compat-data": "^7.22.9",
|
|
118
154
|
"@babel/helper-validator-option": "^7.22.5",
|
|
119
|
-
"browserslist": "^4.21.
|
|
155
|
+
"browserslist": "^4.21.9",
|
|
120
156
|
"lru-cache": "^5.1.1",
|
|
121
|
-
"semver": "^6.3.
|
|
157
|
+
"semver": "^6.3.1"
|
|
122
158
|
},
|
|
123
159
|
"engines": {
|
|
124
160
|
"node": ">=6.9.0"
|
|
125
|
-
},
|
|
126
|
-
"peerDependencies": {
|
|
127
|
-
"@babel/core": "^7.0.0"
|
|
128
161
|
}
|
|
129
162
|
},
|
|
130
163
|
"node_modules/@babel/helper-compilation-targets/node_modules/lru-cache": {
|
|
@@ -136,9 +169,9 @@
|
|
|
136
169
|
}
|
|
137
170
|
},
|
|
138
171
|
"node_modules/@babel/helper-compilation-targets/node_modules/semver": {
|
|
139
|
-
"version": "6.3.
|
|
140
|
-
"resolved": "https://registry.npmjs.org/semver/-/semver-6.3.
|
|
141
|
-
"integrity": "sha512-
|
|
172
|
+
"version": "6.3.1",
|
|
173
|
+
"resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz",
|
|
174
|
+
"integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==",
|
|
142
175
|
"bin": {
|
|
143
176
|
"semver": "bin/semver.js"
|
|
144
177
|
}
|
|
@@ -273,21 +306,21 @@
|
|
|
273
306
|
}
|
|
274
307
|
},
|
|
275
308
|
"node_modules/@babel/helper-module-transforms": {
|
|
276
|
-
"version": "7.22.
|
|
277
|
-
"resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.22.
|
|
278
|
-
"integrity": "sha512
|
|
309
|
+
"version": "7.22.9",
|
|
310
|
+
"resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.22.9.tgz",
|
|
311
|
+
"integrity": "sha512-t+WA2Xn5K+rTeGtC8jCsdAH52bjggG5TKRuRrAGNM/mjIbO4GxvlLMFOEz9wXY5I2XQ60PMFsAG2WIcG82dQMQ==",
|
|
279
312
|
"dependencies": {
|
|
280
313
|
"@babel/helper-environment-visitor": "^7.22.5",
|
|
281
314
|
"@babel/helper-module-imports": "^7.22.5",
|
|
282
315
|
"@babel/helper-simple-access": "^7.22.5",
|
|
283
|
-
"@babel/helper-split-export-declaration": "^7.22.
|
|
284
|
-
"@babel/helper-validator-identifier": "^7.22.5"
|
|
285
|
-
"@babel/template": "^7.22.5",
|
|
286
|
-
"@babel/traverse": "^7.22.5",
|
|
287
|
-
"@babel/types": "^7.22.5"
|
|
316
|
+
"@babel/helper-split-export-declaration": "^7.22.6",
|
|
317
|
+
"@babel/helper-validator-identifier": "^7.22.5"
|
|
288
318
|
},
|
|
289
319
|
"engines": {
|
|
290
320
|
"node": ">=6.9.0"
|
|
321
|
+
},
|
|
322
|
+
"peerDependencies": {
|
|
323
|
+
"@babel/core": "^7.0.0"
|
|
291
324
|
}
|
|
292
325
|
},
|
|
293
326
|
"node_modules/@babel/helper-optimise-call-expression": {
|
|
@@ -359,9 +392,9 @@
|
|
|
359
392
|
}
|
|
360
393
|
},
|
|
361
394
|
"node_modules/@babel/helper-split-export-declaration": {
|
|
362
|
-
"version": "7.22.
|
|
363
|
-
"resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.22.
|
|
364
|
-
"integrity": "sha512-
|
|
395
|
+
"version": "7.22.6",
|
|
396
|
+
"resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.22.6.tgz",
|
|
397
|
+
"integrity": "sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g==",
|
|
365
398
|
"dependencies": {
|
|
366
399
|
"@babel/types": "^7.22.5"
|
|
367
400
|
},
|
|
@@ -408,25 +441,25 @@
|
|
|
408
441
|
}
|
|
409
442
|
},
|
|
410
443
|
"node_modules/@babel/helpers": {
|
|
411
|
-
"version": "7.22.
|
|
412
|
-
"resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.22.
|
|
413
|
-
"integrity": "sha512-
|
|
444
|
+
"version": "7.22.10",
|
|
445
|
+
"resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.22.10.tgz",
|
|
446
|
+
"integrity": "sha512-a41J4NW8HyZa1I1vAndrraTlPZ/eZoga2ZgS7fEr0tZJGVU4xqdE80CEm0CcNjha5EZ8fTBYLKHF0kqDUuAwQw==",
|
|
414
447
|
"dependencies": {
|
|
415
448
|
"@babel/template": "^7.22.5",
|
|
416
|
-
"@babel/traverse": "^7.22.
|
|
417
|
-
"@babel/types": "^7.22.
|
|
449
|
+
"@babel/traverse": "^7.22.10",
|
|
450
|
+
"@babel/types": "^7.22.10"
|
|
418
451
|
},
|
|
419
452
|
"engines": {
|
|
420
453
|
"node": ">=6.9.0"
|
|
421
454
|
}
|
|
422
455
|
},
|
|
423
456
|
"node_modules/@babel/highlight": {
|
|
424
|
-
"version": "7.22.
|
|
425
|
-
"resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.
|
|
426
|
-
"integrity": "sha512-
|
|
457
|
+
"version": "7.22.10",
|
|
458
|
+
"resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.10.tgz",
|
|
459
|
+
"integrity": "sha512-78aUtVcT7MUscr0K5mIEnkwxPE0MaxkR5RxRwuHaQ+JuU5AmTPhY+do2mdzVTnIJJpyBglql2pehuBIWHug+WQ==",
|
|
427
460
|
"dependencies": {
|
|
428
461
|
"@babel/helper-validator-identifier": "^7.22.5",
|
|
429
|
-
"chalk": "^2.
|
|
462
|
+
"chalk": "^2.4.2",
|
|
430
463
|
"js-tokens": "^4.0.0"
|
|
431
464
|
},
|
|
432
465
|
"engines": {
|
|
@@ -469,9 +502,9 @@
|
|
|
469
502
|
}
|
|
470
503
|
},
|
|
471
504
|
"node_modules/@babel/parser": {
|
|
472
|
-
"version": "7.22.
|
|
473
|
-
"resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.22.
|
|
474
|
-
"integrity": "sha512-
|
|
505
|
+
"version": "7.22.10",
|
|
506
|
+
"resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.22.10.tgz",
|
|
507
|
+
"integrity": "sha512-lNbdGsQb9ekfsnjFGhEiF4hfFqGgfOP3H3d27re3n+CGhNuTSUEQdfWk556sTLNTloczcdM5TYF2LhzmDQKyvQ==",
|
|
475
508
|
"bin": {
|
|
476
509
|
"parser": "bin/babel-parser.js"
|
|
477
510
|
},
|
|
@@ -1783,18 +1816,18 @@
|
|
|
1783
1816
|
}
|
|
1784
1817
|
},
|
|
1785
1818
|
"node_modules/@babel/traverse": {
|
|
1786
|
-
"version": "7.22.
|
|
1787
|
-
"resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.22.
|
|
1788
|
-
"integrity": "sha512-
|
|
1819
|
+
"version": "7.22.10",
|
|
1820
|
+
"resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.22.10.tgz",
|
|
1821
|
+
"integrity": "sha512-Q/urqV4pRByiNNpb/f5OSv28ZlGJiFiiTh+GAHktbIrkPhPbl90+uW6SmpoLyZqutrg9AEaEf3Q/ZBRHBXgxig==",
|
|
1789
1822
|
"dependencies": {
|
|
1790
|
-
"@babel/code-frame": "^7.22.
|
|
1791
|
-
"@babel/generator": "^7.22.
|
|
1823
|
+
"@babel/code-frame": "^7.22.10",
|
|
1824
|
+
"@babel/generator": "^7.22.10",
|
|
1792
1825
|
"@babel/helper-environment-visitor": "^7.22.5",
|
|
1793
1826
|
"@babel/helper-function-name": "^7.22.5",
|
|
1794
1827
|
"@babel/helper-hoist-variables": "^7.22.5",
|
|
1795
|
-
"@babel/helper-split-export-declaration": "^7.22.
|
|
1796
|
-
"@babel/parser": "^7.22.
|
|
1797
|
-
"@babel/types": "^7.22.
|
|
1828
|
+
"@babel/helper-split-export-declaration": "^7.22.6",
|
|
1829
|
+
"@babel/parser": "^7.22.10",
|
|
1830
|
+
"@babel/types": "^7.22.10",
|
|
1798
1831
|
"debug": "^4.1.0",
|
|
1799
1832
|
"globals": "^11.1.0"
|
|
1800
1833
|
},
|
|
@@ -1803,9 +1836,9 @@
|
|
|
1803
1836
|
}
|
|
1804
1837
|
},
|
|
1805
1838
|
"node_modules/@babel/types": {
|
|
1806
|
-
"version": "7.22.
|
|
1807
|
-
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.22.
|
|
1808
|
-
"integrity": "sha512-
|
|
1839
|
+
"version": "7.22.10",
|
|
1840
|
+
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.22.10.tgz",
|
|
1841
|
+
"integrity": "sha512-obaoigiLrlDZ7TUQln/8m4mSqIW2QFeOrCQc9r+xsaHGNoplVNYlRVpsfE8Vj35GEm2ZH4ZhrNYogs/3fj85kg==",
|
|
1809
1842
|
"dependencies": {
|
|
1810
1843
|
"@babel/helper-string-parser": "^7.22.5",
|
|
1811
1844
|
"@babel/helper-validator-identifier": "^7.22.5",
|
|
@@ -14834,9 +14867,9 @@
|
|
|
14834
14867
|
}
|
|
14835
14868
|
},
|
|
14836
14869
|
"node_modules/react-scripts/node_modules/@babel/core/node_modules/semver": {
|
|
14837
|
-
"version": "5.7.
|
|
14838
|
-
"resolved": "https://registry.npmjs.org/semver/-/semver-5.7.
|
|
14839
|
-
"integrity": "sha512-
|
|
14870
|
+
"version": "5.7.2",
|
|
14871
|
+
"resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz",
|
|
14872
|
+
"integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==",
|
|
14840
14873
|
"bin": {
|
|
14841
14874
|
"semver": "bin/semver"
|
|
14842
14875
|
}
|
|
@@ -17595,9 +17628,9 @@
|
|
|
17595
17628
|
}
|
|
17596
17629
|
},
|
|
17597
17630
|
"node_modules/typescript": {
|
|
17598
|
-
"version": "5.1.
|
|
17599
|
-
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.1.
|
|
17600
|
-
"integrity": "sha512-
|
|
17631
|
+
"version": "5.1.6",
|
|
17632
|
+
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.1.6.tgz",
|
|
17633
|
+
"integrity": "sha512-zaWCozRZ6DLEWAWFrVDz1H6FVXzUSfTy5FUMWsQlU8Ym5JP9eO4xkTIROFCQvhQf61z6O/G6ugw3SgAnvvm+HA==",
|
|
17601
17634
|
"peer": true,
|
|
17602
17635
|
"bin": {
|
|
17603
17636
|
"tsc": "bin/tsc",
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
> Generate errors that contain a code frame that point to source locations.
|
|
4
4
|
|
|
5
|
-
See our website [@babel/code-frame](https://babeljs.io/docs/
|
|
5
|
+
See our website [@babel/code-frame](https://babeljs.io/docs/babel-code-frame) for more information.
|
|
6
6
|
|
|
7
7
|
## Install
|
|
8
8
|
|
|
@@ -6,6 +6,20 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.codeFrameColumns = codeFrameColumns;
|
|
7
7
|
exports.default = _default;
|
|
8
8
|
var _highlight = require("@babel/highlight");
|
|
9
|
+
var _chalk2 = require("chalk");
|
|
10
|
+
const chalk = _chalk2;
|
|
11
|
+
let chalkWithForcedColor = undefined;
|
|
12
|
+
function getChalk(forceColor) {
|
|
13
|
+
if (forceColor) {
|
|
14
|
+
var _chalkWithForcedColor;
|
|
15
|
+
(_chalkWithForcedColor = chalkWithForcedColor) != null ? _chalkWithForcedColor : chalkWithForcedColor = new chalk.constructor({
|
|
16
|
+
enabled: true,
|
|
17
|
+
level: 1
|
|
18
|
+
});
|
|
19
|
+
return chalkWithForcedColor;
|
|
20
|
+
}
|
|
21
|
+
return chalk;
|
|
22
|
+
}
|
|
9
23
|
let deprecationWarningShown = false;
|
|
10
24
|
function getDefs(chalk) {
|
|
11
25
|
return {
|
|
@@ -73,7 +87,7 @@ function getMarkerLines(loc, source, opts) {
|
|
|
73
87
|
}
|
|
74
88
|
function codeFrameColumns(rawLines, loc, opts = {}) {
|
|
75
89
|
const highlighted = (opts.highlightCode || opts.forceColor) && (0, _highlight.shouldHighlight)(opts);
|
|
76
|
-
const chalk =
|
|
90
|
+
const chalk = getChalk(opts.forceColor);
|
|
77
91
|
const defs = getDefs(chalk);
|
|
78
92
|
const maybeHighlight = (chalkFn, string) => {
|
|
79
93
|
return highlighted ? chalkFn(string) : string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_highlight","require","deprecationWarningShown","getDefs","chalk","gutter","grey","marker","red","bold","message","NEWLINE","getMarkerLines","loc","source","opts","startLoc","Object","assign","column","line","start","endLoc","end","linesAbove","linesBelow","startLine","startColumn","endLine","endColumn","Math","max","min","length","lineDiff","markerLines","i","lineNumber","sourceLength","codeFrameColumns","rawLines","highlighted","highlightCode","forceColor","shouldHighlight","getChalk","defs","maybeHighlight","chalkFn","string","lines","split","hasColumns","numberMaxWidth","String","highlightedLines","highlight","frame","slice","map","index","number","paddedNumber","hasMarker","lastMarkerLine","markerLine","Array","isArray","markerSpacing","replace","numberOfMarkers","repeat","join","reset","_default","colNumber","process","emitWarning","deprecationError","Error","name","console","warn","location"],"sources":["../src/index.ts"],"sourcesContent":["import highlight, { shouldHighlight, getChalk } from \"@babel/highlight\";\n\ntype Chalk = ReturnType<typeof getChalk>;\n\nlet deprecationWarningShown = false;\n\ntype Location = {\n column: number;\n line: number;\n};\n\ntype NodeLocation = {\n end?: Location;\n start: Location;\n};\n\nexport interface Options {\n /** Syntax highlight the code as JavaScript for terminals. default: false */\n highlightCode?: boolean;\n /** The number of lines to show above the error. default: 2 */\n linesAbove?: number;\n /** The number of lines to show below the error. default: 3 */\n linesBelow?: number;\n /**\n * Forcibly syntax highlight the code as JavaScript (for non-terminals);\n * overrides highlightCode.\n * default: false\n */\n forceColor?: boolean;\n /**\n * Pass in a string to be displayed inline (if possible) next to the\n * highlighted location in the code. If it can't be positioned inline,\n * it will be placed above the code frame.\n * default: nothing\n */\n message?: string;\n}\n\n/**\n * Chalk styles for code frame token types.\n */\nfunction getDefs(chalk: Chalk) {\n return {\n gutter: chalk.grey,\n marker: chalk.red.bold,\n message: chalk.red.bold,\n };\n}\n\n/**\n * RegExp to test for newlines in terminal.\n */\n\nconst NEWLINE = /\\r\\n|[\\n\\r\\u2028\\u2029]/;\n\n/**\n * Extract what lines should be marked and highlighted.\n */\n\ntype MarkerLines = Record<number, true | [number, number]>;\n\nfunction getMarkerLines(\n loc: NodeLocation,\n source: Array<string>,\n opts: Options,\n): {\n start: number;\n end: number;\n markerLines: MarkerLines;\n} {\n const startLoc: Location = {\n column: 0,\n line: -1,\n ...loc.start,\n };\n const endLoc: Location = {\n ...startLoc,\n ...loc.end,\n };\n const { linesAbove = 2, linesBelow = 3 } = opts || {};\n const startLine = startLoc.line;\n const startColumn = startLoc.column;\n const endLine = endLoc.line;\n const endColumn = endLoc.column;\n\n let start = Math.max(startLine - (linesAbove + 1), 0);\n let end = Math.min(source.length, endLine + linesBelow);\n\n if (startLine === -1) {\n start = 0;\n }\n\n if (endLine === -1) {\n end = source.length;\n }\n\n const lineDiff = endLine - startLine;\n const markerLines: MarkerLines = {};\n\n if (lineDiff) {\n for (let i = 0; i <= lineDiff; i++) {\n const lineNumber = i + startLine;\n\n if (!startColumn) {\n markerLines[lineNumber] = true;\n } else if (i === 0) {\n const sourceLength = source[lineNumber - 1].length;\n\n markerLines[lineNumber] = [startColumn, sourceLength - startColumn + 1];\n } else if (i === lineDiff) {\n markerLines[lineNumber] = [0, endColumn];\n } else {\n const sourceLength = source[lineNumber - i].length;\n\n markerLines[lineNumber] = [0, sourceLength];\n }\n }\n } else {\n if (startColumn === endColumn) {\n if (startColumn) {\n markerLines[startLine] = [startColumn, 0];\n } else {\n markerLines[startLine] = true;\n }\n } else {\n markerLines[startLine] = [startColumn, endColumn - startColumn];\n }\n }\n\n return { start, end, markerLines };\n}\n\nexport function codeFrameColumns(\n rawLines: string,\n loc: NodeLocation,\n opts: Options = {},\n): string {\n const highlighted =\n (opts.highlightCode || opts.forceColor) && shouldHighlight(opts);\n const chalk = getChalk(opts);\n const defs = getDefs(chalk);\n const maybeHighlight = (chalkFn: Chalk, string: string) => {\n return highlighted ? chalkFn(string) : string;\n };\n const lines = rawLines.split(NEWLINE);\n const { start, end, markerLines } = getMarkerLines(loc, lines, opts);\n const hasColumns = loc.start && typeof loc.start.column === \"number\";\n\n const numberMaxWidth = String(end).length;\n\n const highlightedLines = highlighted ? highlight(rawLines, opts) : rawLines;\n\n let frame = highlightedLines\n .split(NEWLINE, end)\n .slice(start, end)\n .map((line, index) => {\n const number = start + 1 + index;\n const paddedNumber = ` ${number}`.slice(-numberMaxWidth);\n const gutter = ` ${paddedNumber} |`;\n const hasMarker = markerLines[number];\n const lastMarkerLine = !markerLines[number + 1];\n if (hasMarker) {\n let markerLine = \"\";\n if (Array.isArray(hasMarker)) {\n const markerSpacing = line\n .slice(0, Math.max(hasMarker[0] - 1, 0))\n .replace(/[^\\t]/g, \" \");\n const numberOfMarkers = hasMarker[1] || 1;\n\n markerLine = [\n \"\\n \",\n maybeHighlight(defs.gutter, gutter.replace(/\\d/g, \" \")),\n \" \",\n markerSpacing,\n maybeHighlight(defs.marker, \"^\").repeat(numberOfMarkers),\n ].join(\"\");\n\n if (lastMarkerLine && opts.message) {\n markerLine += \" \" + maybeHighlight(defs.message, opts.message);\n }\n }\n return [\n maybeHighlight(defs.marker, \">\"),\n maybeHighlight(defs.gutter, gutter),\n line.length > 0 ? ` ${line}` : \"\",\n markerLine,\n ].join(\"\");\n } else {\n return ` ${maybeHighlight(defs.gutter, gutter)}${\n line.length > 0 ? ` ${line}` : \"\"\n }`;\n }\n })\n .join(\"\\n\");\n\n if (opts.message && !hasColumns) {\n frame = `${\" \".repeat(numberMaxWidth + 1)}${opts.message}\\n${frame}`;\n }\n\n if (highlighted) {\n return chalk.reset(frame);\n } else {\n return frame;\n }\n}\n\n/**\n * Create a code frame, adding line numbers, code highlighting, and pointing to a given position.\n */\n\nexport default function (\n rawLines: string,\n lineNumber: number,\n colNumber?: number | null,\n opts: Options = {},\n): string {\n if (!deprecationWarningShown) {\n deprecationWarningShown = true;\n\n const message =\n \"Passing lineNumber and colNumber is deprecated to @babel/code-frame. Please use `codeFrameColumns`.\";\n\n if (process.emitWarning) {\n // A string is directly supplied to emitWarning, because when supplying an\n // Error object node throws in the tests because of different contexts\n process.emitWarning(message, \"DeprecationWarning\");\n } else {\n const deprecationError = new Error(message);\n deprecationError.name = \"DeprecationWarning\";\n console.warn(new Error(message));\n }\n }\n\n colNumber = Math.max(colNumber, 0);\n\n const location: NodeLocation = {\n start: { column: colNumber, line: lineNumber },\n };\n\n return codeFrameColumns(rawLines, location, opts);\n}\n"],"mappings":";;;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AAIA,IAAIC,uBAAuB,GAAG,KAAK;AAqCnC,SAASC,OAAOA,CAACC,KAAY,EAAE;EAC7B,OAAO;IACLC,MAAM,EAAED,KAAK,CAACE,IAAI;IAClBC,MAAM,EAAEH,KAAK,CAACI,GAAG,CAACC,IAAI;IACtBC,OAAO,EAAEN,KAAK,CAACI,GAAG,CAACC;EACrB,CAAC;AACH;AAMA,MAAME,OAAO,GAAG,yBAAyB;AAQzC,SAASC,cAAcA,CACrBC,GAAiB,EACjBC,MAAqB,EACrBC,IAAa,EAKb;EACA,MAAMC,QAAkB,GAAAC,MAAA,CAAAC,MAAA;IACtBC,MAAM,EAAE,CAAC;IACTC,IAAI,EAAE,CAAC;EAAC,GACLP,GAAG,CAACQ,KAAK,CACb;EACD,MAAMC,MAAgB,GAAAL,MAAA,CAAAC,MAAA,KACjBF,QAAQ,EACRH,GAAG,CAACU,GAAG,CACX;EACD,MAAM;IAAEC,UAAU,GAAG,CAAC;IAAEC,UAAU,GAAG;EAAE,CAAC,GAAGV,IAAI,IAAI,CAAC,CAAC;EACrD,MAAMW,SAAS,GAAGV,QAAQ,CAACI,IAAI;EAC/B,MAAMO,WAAW,GAAGX,QAAQ,CAACG,MAAM;EACnC,MAAMS,OAAO,GAAGN,MAAM,CAACF,IAAI;EAC3B,MAAMS,SAAS,GAAGP,MAAM,CAACH,MAAM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ACpD,CAAC,MAAM;MACL,MAAMoE,gBAAgB,GAAG,IAAIC,KAAK,CAACrE,OAAO,CAAC;MAC3CoE,gBAAgB,CAACE,IAAI,GAAG,oBAAoB;MAC5CC,OAAO,CAACC,IAAI,CAAC,IAAIH,KAAK,CAACrE,OAAO,CAAC,CAAC;IAClC;EACF;EAEAiE,SAAS,GAAG7C,IAAI,CAACC,GAAG,CAAC4C,SAAS,EAAE,CAAC,CAAC;EAElC,MAAMQ,QAAsB,GAAG;IAC7B9D,KAAK,EAAE;MAAEF,MAAM,EAAEwD,SAAS;MAAEvD,IAAI,EAAEiB;IAAW;EAC/C,CAAC;EAED,OAAOE,gBAAgB,CAACC,QAAQ,EAAE2C,QAAQ,EAAEpE,IAAI,CAAC;AACnD"}
|
|
1
|
+
{"version":3,"names":["_highlight","require","_chalk2","chalk","_chalk","chalkWithForcedColor","undefined","getChalk","forceColor","_chalkWithForcedColor","constructor","enabled","level","deprecationWarningShown","getDefs","gutter","grey","marker","red","bold","message","NEWLINE","getMarkerLines","loc","source","opts","startLoc","Object","assign","column","line","start","endLoc","end","linesAbove","linesBelow","startLine","startColumn","endLine","endColumn","Math","max","min","length","lineDiff","markerLines","i","lineNumber","sourceLength","codeFrameColumns","rawLines","highlighted","highlightCode","shouldHighlight","defs","maybeHighlight","chalkFn","string","lines","split","hasColumns","numberMaxWidth","String","highlightedLines","highlight","frame","slice","map","index","number","paddedNumber","hasMarker","lastMarkerLine","markerLine","Array","isArray","markerSpacing","replace","numberOfMarkers","repeat","join","reset","_default","colNumber","process","emitWarning","deprecationError","Error","name","console","warn","location"],"sources":["../src/index.ts"],"sourcesContent":["import highlight, { shouldHighlight } from \"@babel/highlight\";\n\nimport _chalk from \"chalk\";\nconst chalk = _chalk as unknown as typeof import(\"chalk-BABEL_8_BREAKING-true\");\ntype Chalk =\n typeof import(\"chalk-BABEL_8_BREAKING-true\").Instance extends new () => infer R\n ? R\n : never;\n\nlet chalkWithForcedColor: Chalk = undefined;\nfunction getChalk(forceColor: boolean) {\n if (forceColor) {\n chalkWithForcedColor ??= process.env.BABEL_8_BREAKING\n ? new chalk.Instance({ level: 1 })\n : // @ts-expect-error .Instance was .constructor in chalk 2\n new chalk.constructor({ enabled: true, level: 1 });\n return chalkWithForcedColor;\n }\n return chalk;\n}\n\nlet deprecationWarningShown = false;\n\ntype Location = {\n column: number;\n line: number;\n};\n\ntype NodeLocation = {\n end?: Location;\n start: Location;\n};\n\nexport interface Options {\n /** Syntax highlight the code as JavaScript for terminals. default: false */\n highlightCode?: boolean;\n /** The number of lines to show above the error. default: 2 */\n linesAbove?: number;\n /** The number of lines to show below the error. default: 3 */\n linesBelow?: number;\n /**\n * Forcibly syntax highlight the code as JavaScript (for non-terminals);\n * overrides highlightCode.\n * default: false\n */\n forceColor?: boolean;\n /**\n * Pass in a string to be displayed inline (if possible) next to the\n * highlighted location in the code. If it can't be positioned inline,\n * it will be placed above the code frame.\n * default: nothing\n */\n message?: string;\n}\n\n/**\n * Chalk styles for code frame token types.\n */\nfunction getDefs(chalk: Chalk) {\n return {\n gutter: chalk.grey,\n marker: chalk.red.bold,\n message: chalk.red.bold,\n };\n}\n\n/**\n * RegExp to test for newlines in terminal.\n */\n\nconst NEWLINE = /\\r\\n|[\\n\\r\\u2028\\u2029]/;\n\n/**\n * Extract what lines should be marked and highlighted.\n */\n\ntype MarkerLines = Record<number, true | [number, number]>;\n\nfunction getMarkerLines(\n loc: NodeLocation,\n source: Array<string>,\n opts: Options,\n): {\n start: number;\n end: number;\n markerLines: MarkerLines;\n} {\n const startLoc: Location = {\n column: 0,\n line: -1,\n ...loc.start,\n };\n const endLoc: Location = {\n ...startLoc,\n ...loc.end,\n };\n const { linesAbove = 2, linesBelow = 3 } = opts || {};\n const startLine = startLoc.line;\n const startColumn = startLoc.column;\n const endLine = endLoc.line;\n const endColumn = endLoc.column;\n\n let start = Math.max(startLine - (linesAbove + 1), 0);\n let end = Math.min(source.length, endLine + linesBelow);\n\n if (startLine === -1) {\n start = 0;\n }\n\n if (endLine === -1) {\n end = source.length;\n }\n\n const lineDiff = endLine - startLine;\n const markerLines: MarkerLines = {};\n\n if (lineDiff) {\n for (let i = 0; i <= lineDiff; i++) {\n const lineNumber = i + startLine;\n\n if (!startColumn) {\n markerLines[lineNumber] = true;\n } else if (i === 0) {\n const sourceLength = source[lineNumber - 1].length;\n\n markerLines[lineNumber] = [startColumn, sourceLength - startColumn + 1];\n } else if (i === lineDiff) {\n markerLines[lineNumber] = [0, endColumn];\n } else {\n const sourceLength = source[lineNumber - i].length;\n\n markerLines[lineNumber] = [0, sourceLength];\n }\n }\n } else {\n if (startColumn === endColumn) {\n if (startColumn) {\n markerLines[startLine] = [startColumn, 0];\n } else {\n markerLines[startLine] = true;\n }\n } else {\n markerLines[startLine] = [startColumn, endColumn - startColumn];\n }\n }\n\n return { start, end, markerLines };\n}\n\nexport function codeFrameColumns(\n rawLines: string,\n loc: NodeLocation,\n opts: Options = {},\n): string {\n const highlighted =\n (opts.highlightCode || opts.forceColor) && shouldHighlight(opts);\n const chalk = getChalk(opts.forceColor);\n const defs = getDefs(chalk);\n const maybeHighlight = (chalkFn: Chalk, string: string) => {\n return highlighted ? chalkFn(string) : string;\n };\n const lines = rawLines.split(NEWLINE);\n const { start, end, markerLines } = getMarkerLines(loc, lines, opts);\n const hasColumns = loc.start && typeof loc.start.column === \"number\";\n\n const numberMaxWidth = String(end).length;\n\n const highlightedLines = highlighted ? highlight(rawLines, opts) : rawLines;\n\n let frame = highlightedLines\n .split(NEWLINE, end)\n .slice(start, end)\n .map((line, index) => {\n const number = start + 1 + index;\n const paddedNumber = ` ${number}`.slice(-numberMaxWidth);\n const gutter = ` ${paddedNumber} |`;\n const hasMarker = markerLines[number];\n const lastMarkerLine = !markerLines[number + 1];\n if (hasMarker) {\n let markerLine = \"\";\n if (Array.isArray(hasMarker)) {\n const markerSpacing = line\n .slice(0, Math.max(hasMarker[0] - 1, 0))\n .replace(/[^\\t]/g, \" \");\n const numberOfMarkers = hasMarker[1] || 1;\n\n markerLine = [\n \"\\n \",\n maybeHighlight(defs.gutter, gutter.replace(/\\d/g, \" \")),\n \" \",\n markerSpacing,\n maybeHighlight(defs.marker, \"^\").repeat(numberOfMarkers),\n ].join(\"\");\n\n if (lastMarkerLine && opts.message) {\n markerLine += \" \" + maybeHighlight(defs.message, opts.message);\n }\n }\n return [\n maybeHighlight(defs.marker, \">\"),\n maybeHighlight(defs.gutter, gutter),\n line.length > 0 ? ` ${line}` : \"\",\n markerLine,\n ].join(\"\");\n } else {\n return ` ${maybeHighlight(defs.gutter, gutter)}${\n line.length > 0 ? ` ${line}` : \"\"\n }`;\n }\n })\n .join(\"\\n\");\n\n if (opts.message && !hasColumns) {\n frame = `${\" \".repeat(numberMaxWidth + 1)}${opts.message}\\n${frame}`;\n }\n\n if (highlighted) {\n return chalk.reset(frame);\n } else {\n return frame;\n }\n}\n\n/**\n * Create a code frame, adding line numbers, code highlighting, and pointing to a given position.\n */\n\nexport default function (\n rawLines: string,\n lineNumber: number,\n colNumber?: number | null,\n opts: Options = {},\n): string {\n if (!deprecationWarningShown) {\n deprecationWarningShown = true;\n\n const message =\n \"Passing lineNumber and colNumber is deprecated to @babel/code-frame. Please use `codeFrameColumns`.\";\n\n if (process.emitWarning) {\n // A string is directly supplied to emitWarning, because when supplying an\n // Error object node throws in the tests because of different contexts\n process.emitWarning(message, \"DeprecationWarning\");\n } else {\n const deprecationError = new Error(message);\n deprecationError.name = \"DeprecationWarning\";\n console.warn(new Error(message));\n }\n }\n\n colNumber = Math.max(colNumber, 0);\n\n const location: NodeLocation = {\n start: { column: colNumber, line: lineNumber },\n };\n\n return codeFrameColumns(rawLines, location, opts);\n}\n"],"mappings":";;;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AAEA,IAAAC,OAAA,GAAAD,OAAA;AACA,MAAME,KAAK,GAAGC,OAAiE;AAM/E,IAAIC,oBAA2B,GAAGC,SAAS;AAC3C,SAASC,QAAQA,CAACC,UAAmB,EAAE;EACrC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OAAO,CAACC,IAAI,CAAC,IAAIH,KAAK,CAACnE,OAAO,CAAC,CAAC;IAClC;EACF;EAEA+D,SAAS,GAAG3C,IAAI,CAACC,GAAG,CAAC0C,SAAS,EAAE,CAAC,CAAC;EAElC,MAAMQ,QAAsB,GAAG;IAC7B5D,KAAK,EAAE;MAAEF,MAAM,EAAEsD,SAAS;MAAErD,IAAI,EAAEiB;IAAW;EAC/C,CAAC;EAED,OAAOE,gBAAgB,CAACC,QAAQ,EAAEyC,QAAQ,EAAElE,IAAI,CAAC;AACnD"}
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
const colorConvert = require('color-convert');
|
|
3
|
+
|
|
4
|
+
const wrapAnsi16 = (fn, offset) => function () {
|
|
5
|
+
const code = fn.apply(colorConvert, arguments);
|
|
6
|
+
return `\u001B[${code + offset}m`;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
const wrapAnsi256 = (fn, offset) => function () {
|
|
10
|
+
const code = fn.apply(colorConvert, arguments);
|
|
11
|
+
return `\u001B[${38 + offset};5;${code}m`;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
const wrapAnsi16m = (fn, offset) => function () {
|
|
15
|
+
const rgb = fn.apply(colorConvert, arguments);
|
|
16
|
+
return `\u001B[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
function assembleStyles() {
|
|
20
|
+
const codes = new Map();
|
|
21
|
+
const styles = {
|
|
22
|
+
modifier: {
|
|
23
|
+
reset: [0, 0],
|
|
24
|
+
// 21 isn't widely supported and 22 does the same thing
|
|
25
|
+
bold: [1, 22],
|
|
26
|
+
dim: [2, 22],
|
|
27
|
+
italic: [3, 23],
|
|
28
|
+
underline: [4, 24],
|
|
29
|
+
inverse: [7, 27],
|
|
30
|
+
hidden: [8, 28],
|
|
31
|
+
strikethrough: [9, 29]
|
|
32
|
+
},
|
|
33
|
+
color: {
|
|
34
|
+
black: [30, 39],
|
|
35
|
+
red: [31, 39],
|
|
36
|
+
green: [32, 39],
|
|
37
|
+
yellow: [33, 39],
|
|
38
|
+
blue: [34, 39],
|
|
39
|
+
magenta: [35, 39],
|
|
40
|
+
cyan: [36, 39],
|
|
41
|
+
white: [37, 39],
|
|
42
|
+
gray: [90, 39],
|
|
43
|
+
|
|
44
|
+
// Bright color
|
|
45
|
+
redBright: [91, 39],
|
|
46
|
+
greenBright: [92, 39],
|
|
47
|
+
yellowBright: [93, 39],
|
|
48
|
+
blueBright: [94, 39],
|
|
49
|
+
magentaBright: [95, 39],
|
|
50
|
+
cyanBright: [96, 39],
|
|
51
|
+
whiteBright: [97, 39]
|
|
52
|
+
},
|
|
53
|
+
bgColor: {
|
|
54
|
+
bgBlack: [40, 49],
|
|
55
|
+
bgRed: [41, 49],
|
|
56
|
+
bgGreen: [42, 49],
|
|
57
|
+
bgYellow: [43, 49],
|
|
58
|
+
bgBlue: [44, 49],
|
|
59
|
+
bgMagenta: [45, 49],
|
|
60
|
+
bgCyan: [46, 49],
|
|
61
|
+
bgWhite: [47, 49],
|
|
62
|
+
|
|
63
|
+
// Bright color
|
|
64
|
+
bgBlackBright: [100, 49],
|
|
65
|
+
bgRedBright: [101, 49],
|
|
66
|
+
bgGreenBright: [102, 49],
|
|
67
|
+
bgYellowBright: [103, 49],
|
|
68
|
+
bgBlueBright: [104, 49],
|
|
69
|
+
bgMagentaBright: [105, 49],
|
|
70
|
+
bgCyanBright: [106, 49],
|
|
71
|
+
bgWhiteBright: [107, 49]
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
// Fix humans
|
|
76
|
+
styles.color.grey = styles.color.gray;
|
|
77
|
+
|
|
78
|
+
for (const groupName of Object.keys(styles)) {
|
|
79
|
+
const group = styles[groupName];
|
|
80
|
+
|
|
81
|
+
for (const styleName of Object.keys(group)) {
|
|
82
|
+
const style = group[styleName];
|
|
83
|
+
|
|
84
|
+
styles[styleName] = {
|
|
85
|
+
open: `\u001B[${style[0]}m`,
|
|
86
|
+
close: `\u001B[${style[1]}m`
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
group[styleName] = styles[styleName];
|
|
90
|
+
|
|
91
|
+
codes.set(style[0], style[1]);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
Object.defineProperty(styles, groupName, {
|
|
95
|
+
value: group,
|
|
96
|
+
enumerable: false
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
Object.defineProperty(styles, 'codes', {
|
|
100
|
+
value: codes,
|
|
101
|
+
enumerable: false
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
const ansi2ansi = n => n;
|
|
106
|
+
const rgb2rgb = (r, g, b) => [r, g, b];
|
|
107
|
+
|
|
108
|
+
styles.color.close = '\u001B[39m';
|
|
109
|
+
styles.bgColor.close = '\u001B[49m';
|
|
110
|
+
|
|
111
|
+
styles.color.ansi = {
|
|
112
|
+
ansi: wrapAnsi16(ansi2ansi, 0)
|
|
113
|
+
};
|
|
114
|
+
styles.color.ansi256 = {
|
|
115
|
+
ansi256: wrapAnsi256(ansi2ansi, 0)
|
|
116
|
+
};
|
|
117
|
+
styles.color.ansi16m = {
|
|
118
|
+
rgb: wrapAnsi16m(rgb2rgb, 0)
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
styles.bgColor.ansi = {
|
|
122
|
+
ansi: wrapAnsi16(ansi2ansi, 10)
|
|
123
|
+
};
|
|
124
|
+
styles.bgColor.ansi256 = {
|
|
125
|
+
ansi256: wrapAnsi256(ansi2ansi, 10)
|
|
126
|
+
};
|
|
127
|
+
styles.bgColor.ansi16m = {
|
|
128
|
+
rgb: wrapAnsi16m(rgb2rgb, 10)
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
for (let key of Object.keys(colorConvert)) {
|
|
132
|
+
if (typeof colorConvert[key] !== 'object') {
|
|
133
|
+
continue;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
const suite = colorConvert[key];
|
|
137
|
+
|
|
138
|
+
if (key === 'ansi16') {
|
|
139
|
+
key = 'ansi';
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
if ('ansi16' in suite) {
|
|
143
|
+
styles.color.ansi[key] = wrapAnsi16(suite.ansi16, 0);
|
|
144
|
+
styles.bgColor.ansi[key] = wrapAnsi16(suite.ansi16, 10);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
if ('ansi256' in suite) {
|
|
148
|
+
styles.color.ansi256[key] = wrapAnsi256(suite.ansi256, 0);
|
|
149
|
+
styles.bgColor.ansi256[key] = wrapAnsi256(suite.ansi256, 10);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
if ('rgb' in suite) {
|
|
153
|
+
styles.color.ansi16m[key] = wrapAnsi16m(suite.rgb, 0);
|
|
154
|
+
styles.bgColor.ansi16m[key] = wrapAnsi16m(suite.rgb, 10);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
return styles;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
// Make the export immutable
|
|
162
|
+
Object.defineProperty(module, 'exports', {
|
|
163
|
+
enumerable: true,
|
|
164
|
+
get: assembleStyles
|
|
165
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
6
|
+
|
|
7
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|