@rslib/core 0.0.12 → 0.0.14

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.
@@ -2,7 +2,7 @@ type Formatter = (input: string | number | null | undefined) => string
2
2
 
3
3
  interface Colors {
4
4
  isColorSupported: boolean
5
-
5
+
6
6
  reset: Formatter
7
7
  bold: Formatter
8
8
  dim: Formatter
@@ -11,7 +11,7 @@ interface Colors {
11
11
  inverse: Formatter
12
12
  hidden: Formatter
13
13
  strikethrough: Formatter
14
-
14
+
15
15
  black: Formatter
16
16
  red: Formatter
17
17
  green: Formatter
@@ -21,7 +21,7 @@ interface Colors {
21
21
  cyan: Formatter
22
22
  white: Formatter
23
23
  gray: Formatter
24
-
24
+
25
25
  bgBlack: Formatter
26
26
  bgRed: Formatter
27
27
  bgGreen: Formatter
@@ -32,23 +32,22 @@ interface Colors {
32
32
  bgWhite: Formatter
33
33
 
34
34
  blackBright: Formatter
35
- redBright: Formatter
36
- greenBright: Formatter
37
- yellowBright: Formatter
38
- blueBright: Formatter
39
- magentaBright: Formatter
40
- cyanBright: Formatter
41
- whiteBright: Formatter
35
+ redBright: Formatter
36
+ greenBright: Formatter
37
+ yellowBright: Formatter
38
+ blueBright: Formatter
39
+ magentaBright: Formatter
40
+ cyanBright: Formatter
41
+ whiteBright: Formatter
42
42
 
43
43
  bgBlackBright: Formatter
44
- bgRedBright: Formatter
45
- bgGreenBright: Formatter
46
- bgYellowBright: Formatter
47
- bgBlueBright: Formatter
48
- bgMagentaBright: Formatter
49
- bgCyanBright: Formatter
50
- bgWhiteBright: Formatter
51
-
44
+ bgRedBright: Formatter
45
+ bgGreenBright: Formatter
46
+ bgYellowBright: Formatter
47
+ bgBlueBright: Formatter
48
+ bgMagentaBright: Formatter
49
+ bgCyanBright: Formatter
50
+ bgWhiteBright: Formatter
52
51
  }
53
52
 
54
53
  declare const picocolors: Colors & { createColors: (enabled?: boolean) => Colors }
@@ -1,32 +1,22 @@
1
1
  /******/ (() => { // webpackBootstrap
2
2
  /******/ var __webpack_modules__ = ({
3
3
 
4
- /***/ 78:
5
- /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
4
+ /***/ 209:
5
+ /***/ ((module) => {
6
6
 
7
- let argv = process.argv || [],
8
- env = process.env
7
+ let p = process || {}, argv = p.argv || [], env = p.env || {}
9
8
  let isColorSupported =
10
- !("NO_COLOR" in env || argv.includes("--no-color")) &&
11
- ("FORCE_COLOR" in env ||
12
- argv.includes("--color") ||
13
- process.platform === "win32" ||
14
- (require != null && (__nccwpck_require__(224).isatty)(1) && env.TERM !== "dumb") ||
15
- "CI" in env)
9
+ !(!!env.NO_COLOR || argv.includes("--no-color")) &&
10
+ (!!env.FORCE_COLOR || argv.includes("--color") || p.platform === "win32" || ((p.stdout || {}).isTTY && env.TERM !== "dumb") || !!env.CI)
16
11
 
17
- let formatter =
18
- (open, close, replace = open) =>
12
+ let formatter = (open, close, replace = open) =>
19
13
  input => {
20
- let string = "" + input
21
- let index = string.indexOf(close, open.length)
22
- return ~index
23
- ? open + replaceClose(string, close, replace, index) + close
24
- : open + string + close
14
+ let string = "" + input, index = string.indexOf(close, open.length)
15
+ return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close
25
16
  }
26
17
 
27
18
  let replaceClose = (string, close, replace, index) => {
28
- let result = ""
29
- let cursor = 0
19
+ let result = "", cursor = 0
30
20
  do {
31
21
  result += string.substring(cursor, index) + replace
32
22
  cursor = index + close.length
@@ -36,54 +26,54 @@ let replaceClose = (string, close, replace, index) => {
36
26
  }
37
27
 
38
28
  let createColors = (enabled = isColorSupported) => {
39
- let init = enabled ? formatter : () => String
29
+ let f = enabled ? formatter : () => String
40
30
  return {
41
31
  isColorSupported: enabled,
42
- reset: init("\x1b[0m", "\x1b[0m"),
43
- bold: init("\x1b[1m", "\x1b[22m", "\x1b[22m\x1b[1m"),
44
- dim: init("\x1b[2m", "\x1b[22m", "\x1b[22m\x1b[2m"),
45
- italic: init("\x1b[3m", "\x1b[23m"),
46
- underline: init("\x1b[4m", "\x1b[24m"),
47
- inverse: init("\x1b[7m", "\x1b[27m"),
48
- hidden: init("\x1b[8m", "\x1b[28m"),
49
- strikethrough: init("\x1b[9m", "\x1b[29m"),
50
-
51
- black: init("\x1b[30m", "\x1b[39m"),
52
- red: init("\x1b[31m", "\x1b[39m"),
53
- green: init("\x1b[32m", "\x1b[39m"),
54
- yellow: init("\x1b[33m", "\x1b[39m"),
55
- blue: init("\x1b[34m", "\x1b[39m"),
56
- magenta: init("\x1b[35m", "\x1b[39m"),
57
- cyan: init("\x1b[36m", "\x1b[39m"),
58
- white: init("\x1b[37m", "\x1b[39m"),
59
- gray: init("\x1b[90m", "\x1b[39m"),
60
-
61
- bgBlack: init("\x1b[40m", "\x1b[49m"),
62
- bgRed: init("\x1b[41m", "\x1b[49m"),
63
- bgGreen: init("\x1b[42m", "\x1b[49m"),
64
- bgYellow: init("\x1b[43m", "\x1b[49m"),
65
- bgBlue: init("\x1b[44m", "\x1b[49m"),
66
- bgMagenta: init("\x1b[45m", "\x1b[49m"),
67
- bgCyan: init("\x1b[46m", "\x1b[49m"),
68
- bgWhite: init("\x1b[47m", "\x1b[49m"),
69
-
70
- blackBright: init("\x1b[90m", "\x1b[39m"),
71
- redBright: init("\x1b[91m", "\x1b[39m"),
72
- greenBright: init("\x1b[92m", "\x1b[39m"),
73
- yellowBright: init("\x1b[93m", "\x1b[39m"),
74
- blueBright: init("\x1b[94m", "\x1b[39m"),
75
- magentaBright: init("\x1b[95m", "\x1b[39m"),
76
- cyanBright: init("\x1b[96m", "\x1b[39m"),
77
- whiteBright: init("\x1b[97m", "\x1b[39m"),
78
-
79
- bgBlackBright: init("\x1b[100m","\x1b[49m"),
80
- bgRedBright: init("\x1b[101m","\x1b[49m"),
81
- bgGreenBright: init("\x1b[102m","\x1b[49m"),
82
- bgYellowBright: init("\x1b[103m","\x1b[49m"),
83
- bgBlueBright: init("\x1b[104m","\x1b[49m"),
84
- bgMagentaBright: init("\x1b[105m","\x1b[49m"),
85
- bgCyanBright: init("\x1b[106m","\x1b[49m"),
86
- bgWhiteBright: init("\x1b[107m","\x1b[49m"),
32
+ reset: f("\x1b[0m", "\x1b[0m"),
33
+ bold: f("\x1b[1m", "\x1b[22m", "\x1b[22m\x1b[1m"),
34
+ dim: f("\x1b[2m", "\x1b[22m", "\x1b[22m\x1b[2m"),
35
+ italic: f("\x1b[3m", "\x1b[23m"),
36
+ underline: f("\x1b[4m", "\x1b[24m"),
37
+ inverse: f("\x1b[7m", "\x1b[27m"),
38
+ hidden: f("\x1b[8m", "\x1b[28m"),
39
+ strikethrough: f("\x1b[9m", "\x1b[29m"),
40
+
41
+ black: f("\x1b[30m", "\x1b[39m"),
42
+ red: f("\x1b[31m", "\x1b[39m"),
43
+ green: f("\x1b[32m", "\x1b[39m"),
44
+ yellow: f("\x1b[33m", "\x1b[39m"),
45
+ blue: f("\x1b[34m", "\x1b[39m"),
46
+ magenta: f("\x1b[35m", "\x1b[39m"),
47
+ cyan: f("\x1b[36m", "\x1b[39m"),
48
+ white: f("\x1b[37m", "\x1b[39m"),
49
+ gray: f("\x1b[90m", "\x1b[39m"),
50
+
51
+ bgBlack: f("\x1b[40m", "\x1b[49m"),
52
+ bgRed: f("\x1b[41m", "\x1b[49m"),
53
+ bgGreen: f("\x1b[42m", "\x1b[49m"),
54
+ bgYellow: f("\x1b[43m", "\x1b[49m"),
55
+ bgBlue: f("\x1b[44m", "\x1b[49m"),
56
+ bgMagenta: f("\x1b[45m", "\x1b[49m"),
57
+ bgCyan: f("\x1b[46m", "\x1b[49m"),
58
+ bgWhite: f("\x1b[47m", "\x1b[49m"),
59
+
60
+ blackBright: f("\x1b[90m", "\x1b[39m"),
61
+ redBright: f("\x1b[91m", "\x1b[39m"),
62
+ greenBright: f("\x1b[92m", "\x1b[39m"),
63
+ yellowBright: f("\x1b[93m", "\x1b[39m"),
64
+ blueBright: f("\x1b[94m", "\x1b[39m"),
65
+ magentaBright: f("\x1b[95m", "\x1b[39m"),
66
+ cyanBright: f("\x1b[96m", "\x1b[39m"),
67
+ whiteBright: f("\x1b[97m", "\x1b[39m"),
68
+
69
+ bgBlackBright: f("\x1b[100m", "\x1b[49m"),
70
+ bgRedBright: f("\x1b[101m", "\x1b[49m"),
71
+ bgGreenBright: f("\x1b[102m", "\x1b[49m"),
72
+ bgYellowBright: f("\x1b[103m", "\x1b[49m"),
73
+ bgBlueBright: f("\x1b[104m", "\x1b[49m"),
74
+ bgMagentaBright: f("\x1b[105m", "\x1b[49m"),
75
+ bgCyanBright: f("\x1b[106m", "\x1b[49m"),
76
+ bgWhiteBright: f("\x1b[107m", "\x1b[49m"),
87
77
  }
88
78
  }
89
79
 
@@ -91,14 +81,6 @@ module.exports = createColors()
91
81
  module.exports.createColors = createColors
92
82
 
93
83
 
94
- /***/ }),
95
-
96
- /***/ 224:
97
- /***/ ((module) => {
98
-
99
- "use strict";
100
- module.exports = require("tty");
101
-
102
84
  /***/ })
103
85
 
104
86
  /******/ });
@@ -143,7 +125,7 @@ module.exports = require("tty");
143
125
  /******/ // startup
144
126
  /******/ // Load entry module and return exports
145
127
  /******/ // This entry module is referenced by other modules so it can't be inlined
146
- /******/ var __webpack_exports__ = __nccwpck_require__(78);
128
+ /******/ var __webpack_exports__ = __nccwpck_require__(209);
147
129
  /******/ module.exports = __webpack_exports__;
148
130
  /******/
149
131
  /******/ })()
@@ -1 +1 @@
1
- {"name":"picocolors","author":"Alexey Raspopov","version":"1.1.0","license":"ISC","types":"index.d.ts","type":"commonjs"}
1
+ {"name":"picocolors","author":"Alexey Raspopov","version":"1.1.1","license":"ISC","types":"index.d.ts","type":"commonjs"}