@nsshunt/stsutils 1.19.17 → 1.19.19
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/stsutils.mjs +374 -347
- package/dist/stsutils.mjs.map +1 -1
- package/dist/stsutils.umd.js +374 -347
- package/dist/stsutils.umd.js.map +1 -1
- package/package.json +6 -6
package/dist/stsutils.umd.js
CHANGED
|
@@ -24,7 +24,7 @@ var __privateWrapper = (obj, member, setter, getter) => ({
|
|
|
24
24
|
function getDefaultExportFromCjs(x) {
|
|
25
25
|
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
|
|
26
26
|
}
|
|
27
|
-
var ansiStyles
|
|
27
|
+
var ansiStyles = { exports: {} };
|
|
28
28
|
var colorName;
|
|
29
29
|
var hasRequiredColorName;
|
|
30
30
|
function requireColorName() {
|
|
@@ -987,181 +987,200 @@ var __privateWrapper = (obj, member, setter, getter) => ({
|
|
|
987
987
|
colorConvert = convert;
|
|
988
988
|
return colorConvert;
|
|
989
989
|
}
|
|
990
|
-
ansiStyles
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
const
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
const name = sourceSpace === "ansi16" ? "ansi" : sourceSpace;
|
|
1030
|
-
if (sourceSpace === targetSpace) {
|
|
1031
|
-
styles2[name] = wrap(identity, offset);
|
|
1032
|
-
} else if (typeof suite === "object") {
|
|
1033
|
-
styles2[name] = wrap(suite[targetSpace], offset);
|
|
990
|
+
ansiStyles.exports;
|
|
991
|
+
var hasRequiredAnsiStyles;
|
|
992
|
+
function requireAnsiStyles() {
|
|
993
|
+
if (hasRequiredAnsiStyles) return ansiStyles.exports;
|
|
994
|
+
hasRequiredAnsiStyles = 1;
|
|
995
|
+
(function(module2) {
|
|
996
|
+
const wrapAnsi16 = (fn, offset) => (...args) => {
|
|
997
|
+
const code = fn(...args);
|
|
998
|
+
return `\x1B[${code + offset}m`;
|
|
999
|
+
};
|
|
1000
|
+
const wrapAnsi256 = (fn, offset) => (...args) => {
|
|
1001
|
+
const code = fn(...args);
|
|
1002
|
+
return `\x1B[${38 + offset};5;${code}m`;
|
|
1003
|
+
};
|
|
1004
|
+
const wrapAnsi16m = (fn, offset) => (...args) => {
|
|
1005
|
+
const rgb = fn(...args);
|
|
1006
|
+
return `\x1B[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`;
|
|
1007
|
+
};
|
|
1008
|
+
const ansi2ansi = (n) => n;
|
|
1009
|
+
const rgb2rgb = (r, g, b) => [r, g, b];
|
|
1010
|
+
const setLazyProperty = (object, property, get) => {
|
|
1011
|
+
Object.defineProperty(object, property, {
|
|
1012
|
+
get: () => {
|
|
1013
|
+
const value = get();
|
|
1014
|
+
Object.defineProperty(object, property, {
|
|
1015
|
+
value,
|
|
1016
|
+
enumerable: true,
|
|
1017
|
+
configurable: true
|
|
1018
|
+
});
|
|
1019
|
+
return value;
|
|
1020
|
+
},
|
|
1021
|
+
enumerable: true,
|
|
1022
|
+
configurable: true
|
|
1023
|
+
});
|
|
1024
|
+
};
|
|
1025
|
+
let colorConvert2;
|
|
1026
|
+
const makeDynamicStyles = (wrap, targetSpace, identity, isBackground) => {
|
|
1027
|
+
if (colorConvert2 === void 0) {
|
|
1028
|
+
colorConvert2 = requireColorConvert();
|
|
1034
1029
|
}
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
bold: [1, 22],
|
|
1045
|
-
dim: [2, 22],
|
|
1046
|
-
italic: [3, 23],
|
|
1047
|
-
underline: [4, 24],
|
|
1048
|
-
inverse: [7, 27],
|
|
1049
|
-
hidden: [8, 28],
|
|
1050
|
-
strikethrough: [9, 29]
|
|
1051
|
-
},
|
|
1052
|
-
color: {
|
|
1053
|
-
black: [30, 39],
|
|
1054
|
-
red: [31, 39],
|
|
1055
|
-
green: [32, 39],
|
|
1056
|
-
yellow: [33, 39],
|
|
1057
|
-
blue: [34, 39],
|
|
1058
|
-
magenta: [35, 39],
|
|
1059
|
-
cyan: [36, 39],
|
|
1060
|
-
white: [37, 39],
|
|
1061
|
-
// Bright color
|
|
1062
|
-
blackBright: [90, 39],
|
|
1063
|
-
redBright: [91, 39],
|
|
1064
|
-
greenBright: [92, 39],
|
|
1065
|
-
yellowBright: [93, 39],
|
|
1066
|
-
blueBright: [94, 39],
|
|
1067
|
-
magentaBright: [95, 39],
|
|
1068
|
-
cyanBright: [96, 39],
|
|
1069
|
-
whiteBright: [97, 39]
|
|
1070
|
-
},
|
|
1071
|
-
bgColor: {
|
|
1072
|
-
bgBlack: [40, 49],
|
|
1073
|
-
bgRed: [41, 49],
|
|
1074
|
-
bgGreen: [42, 49],
|
|
1075
|
-
bgYellow: [43, 49],
|
|
1076
|
-
bgBlue: [44, 49],
|
|
1077
|
-
bgMagenta: [45, 49],
|
|
1078
|
-
bgCyan: [46, 49],
|
|
1079
|
-
bgWhite: [47, 49],
|
|
1080
|
-
// Bright color
|
|
1081
|
-
bgBlackBright: [100, 49],
|
|
1082
|
-
bgRedBright: [101, 49],
|
|
1083
|
-
bgGreenBright: [102, 49],
|
|
1084
|
-
bgYellowBright: [103, 49],
|
|
1085
|
-
bgBlueBright: [104, 49],
|
|
1086
|
-
bgMagentaBright: [105, 49],
|
|
1087
|
-
bgCyanBright: [106, 49],
|
|
1088
|
-
bgWhiteBright: [107, 49]
|
|
1030
|
+
const offset = isBackground ? 10 : 0;
|
|
1031
|
+
const styles = {};
|
|
1032
|
+
for (const [sourceSpace, suite] of Object.entries(colorConvert2)) {
|
|
1033
|
+
const name = sourceSpace === "ansi16" ? "ansi" : sourceSpace;
|
|
1034
|
+
if (sourceSpace === targetSpace) {
|
|
1035
|
+
styles[name] = wrap(identity, offset);
|
|
1036
|
+
} else if (typeof suite === "object") {
|
|
1037
|
+
styles[name] = wrap(suite[targetSpace], offset);
|
|
1038
|
+
}
|
|
1089
1039
|
}
|
|
1040
|
+
return styles;
|
|
1090
1041
|
};
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1042
|
+
function assembleStyles() {
|
|
1043
|
+
const codes = /* @__PURE__ */ new Map();
|
|
1044
|
+
const styles = {
|
|
1045
|
+
modifier: {
|
|
1046
|
+
reset: [0, 0],
|
|
1047
|
+
// 21 isn't widely supported and 22 does the same thing
|
|
1048
|
+
bold: [1, 22],
|
|
1049
|
+
dim: [2, 22],
|
|
1050
|
+
italic: [3, 23],
|
|
1051
|
+
underline: [4, 24],
|
|
1052
|
+
inverse: [7, 27],
|
|
1053
|
+
hidden: [8, 28],
|
|
1054
|
+
strikethrough: [9, 29]
|
|
1055
|
+
},
|
|
1056
|
+
color: {
|
|
1057
|
+
black: [30, 39],
|
|
1058
|
+
red: [31, 39],
|
|
1059
|
+
green: [32, 39],
|
|
1060
|
+
yellow: [33, 39],
|
|
1061
|
+
blue: [34, 39],
|
|
1062
|
+
magenta: [35, 39],
|
|
1063
|
+
cyan: [36, 39],
|
|
1064
|
+
white: [37, 39],
|
|
1065
|
+
// Bright color
|
|
1066
|
+
blackBright: [90, 39],
|
|
1067
|
+
redBright: [91, 39],
|
|
1068
|
+
greenBright: [92, 39],
|
|
1069
|
+
yellowBright: [93, 39],
|
|
1070
|
+
blueBright: [94, 39],
|
|
1071
|
+
magentaBright: [95, 39],
|
|
1072
|
+
cyanBright: [96, 39],
|
|
1073
|
+
whiteBright: [97, 39]
|
|
1074
|
+
},
|
|
1075
|
+
bgColor: {
|
|
1076
|
+
bgBlack: [40, 49],
|
|
1077
|
+
bgRed: [41, 49],
|
|
1078
|
+
bgGreen: [42, 49],
|
|
1079
|
+
bgYellow: [43, 49],
|
|
1080
|
+
bgBlue: [44, 49],
|
|
1081
|
+
bgMagenta: [45, 49],
|
|
1082
|
+
bgCyan: [46, 49],
|
|
1083
|
+
bgWhite: [47, 49],
|
|
1084
|
+
// Bright color
|
|
1085
|
+
bgBlackBright: [100, 49],
|
|
1086
|
+
bgRedBright: [101, 49],
|
|
1087
|
+
bgGreenBright: [102, 49],
|
|
1088
|
+
bgYellowBright: [103, 49],
|
|
1089
|
+
bgBlueBright: [104, 49],
|
|
1090
|
+
bgMagentaBright: [105, 49],
|
|
1091
|
+
bgCyanBright: [106, 49],
|
|
1092
|
+
bgWhiteBright: [107, 49]
|
|
1093
|
+
}
|
|
1094
|
+
};
|
|
1095
|
+
styles.color.gray = styles.color.blackBright;
|
|
1096
|
+
styles.bgColor.bgGray = styles.bgColor.bgBlackBright;
|
|
1097
|
+
styles.color.grey = styles.color.blackBright;
|
|
1098
|
+
styles.bgColor.bgGrey = styles.bgColor.bgBlackBright;
|
|
1099
|
+
for (const [groupName, group] of Object.entries(styles)) {
|
|
1100
|
+
for (const [styleName, style] of Object.entries(group)) {
|
|
1101
|
+
styles[styleName] = {
|
|
1102
|
+
open: `\x1B[${style[0]}m`,
|
|
1103
|
+
close: `\x1B[${style[1]}m`
|
|
1104
|
+
};
|
|
1105
|
+
group[styleName] = styles[styleName];
|
|
1106
|
+
codes.set(style[0], style[1]);
|
|
1107
|
+
}
|
|
1108
|
+
Object.defineProperty(styles, groupName, {
|
|
1109
|
+
value: group,
|
|
1110
|
+
enumerable: false
|
|
1111
|
+
});
|
|
1103
1112
|
}
|
|
1104
|
-
Object.defineProperty(
|
|
1105
|
-
value:
|
|
1113
|
+
Object.defineProperty(styles, "codes", {
|
|
1114
|
+
value: codes,
|
|
1106
1115
|
enumerable: false
|
|
1107
1116
|
});
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1117
|
+
styles.color.close = "\x1B[39m";
|
|
1118
|
+
styles.bgColor.close = "\x1B[49m";
|
|
1119
|
+
setLazyProperty(styles.color, "ansi", () => makeDynamicStyles(wrapAnsi16, "ansi16", ansi2ansi, false));
|
|
1120
|
+
setLazyProperty(styles.color, "ansi256", () => makeDynamicStyles(wrapAnsi256, "ansi256", ansi2ansi, false));
|
|
1121
|
+
setLazyProperty(styles.color, "ansi16m", () => makeDynamicStyles(wrapAnsi16m, "rgb", rgb2rgb, false));
|
|
1122
|
+
setLazyProperty(styles.bgColor, "ansi", () => makeDynamicStyles(wrapAnsi16, "ansi16", ansi2ansi, true));
|
|
1123
|
+
setLazyProperty(styles.bgColor, "ansi256", () => makeDynamicStyles(wrapAnsi256, "ansi256", ansi2ansi, true));
|
|
1124
|
+
setLazyProperty(styles.bgColor, "ansi16m", () => makeDynamicStyles(wrapAnsi16m, "rgb", rgb2rgb, true));
|
|
1125
|
+
return styles;
|
|
1126
|
+
}
|
|
1127
|
+
Object.defineProperty(module2, "exports", {
|
|
1128
|
+
enumerable: true,
|
|
1129
|
+
get: assembleStyles
|
|
1112
1130
|
});
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
var
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1131
|
+
})(ansiStyles);
|
|
1132
|
+
return ansiStyles.exports;
|
|
1133
|
+
}
|
|
1134
|
+
var browser;
|
|
1135
|
+
var hasRequiredBrowser;
|
|
1136
|
+
function requireBrowser() {
|
|
1137
|
+
if (hasRequiredBrowser) return browser;
|
|
1138
|
+
hasRequiredBrowser = 1;
|
|
1139
|
+
browser = {
|
|
1140
|
+
stdout: false,
|
|
1141
|
+
stderr: false
|
|
1142
|
+
};
|
|
1143
|
+
return browser;
|
|
1144
|
+
}
|
|
1145
|
+
var util;
|
|
1146
|
+
var hasRequiredUtil;
|
|
1147
|
+
function requireUtil() {
|
|
1148
|
+
if (hasRequiredUtil) return util;
|
|
1149
|
+
hasRequiredUtil = 1;
|
|
1150
|
+
const stringReplaceAll = (string, substring, replacer) => {
|
|
1151
|
+
let index = string.indexOf(substring);
|
|
1152
|
+
if (index === -1) {
|
|
1153
|
+
return string;
|
|
1154
|
+
}
|
|
1155
|
+
const substringLength = substring.length;
|
|
1156
|
+
let endIndex = 0;
|
|
1157
|
+
let returnValue = "";
|
|
1158
|
+
do {
|
|
1159
|
+
returnValue += string.substr(endIndex, index - endIndex) + substring + replacer;
|
|
1160
|
+
endIndex = index + substringLength;
|
|
1161
|
+
index = string.indexOf(substring, endIndex);
|
|
1162
|
+
} while (index !== -1);
|
|
1163
|
+
returnValue += string.substr(endIndex);
|
|
1164
|
+
return returnValue;
|
|
1165
|
+
};
|
|
1166
|
+
const stringEncaseCRLFWithFirstIndex = (string, prefix, postfix, index) => {
|
|
1167
|
+
let endIndex = 0;
|
|
1168
|
+
let returnValue = "";
|
|
1169
|
+
do {
|
|
1170
|
+
const gotCR = string[index - 1] === "\r";
|
|
1171
|
+
returnValue += string.substr(endIndex, (gotCR ? index - 1 : index) - endIndex) + prefix + (gotCR ? "\r\n" : "\n") + postfix;
|
|
1172
|
+
endIndex = index + 1;
|
|
1173
|
+
index = string.indexOf("\n", endIndex);
|
|
1174
|
+
} while (index !== -1);
|
|
1175
|
+
returnValue += string.substr(endIndex);
|
|
1176
|
+
return returnValue;
|
|
1177
|
+
};
|
|
1178
|
+
util = {
|
|
1179
|
+
stringReplaceAll,
|
|
1180
|
+
stringEncaseCRLFWithFirstIndex
|
|
1181
|
+
};
|
|
1182
|
+
return util;
|
|
1183
|
+
}
|
|
1165
1184
|
var templates;
|
|
1166
1185
|
var hasRequiredTemplates;
|
|
1167
1186
|
function requireTemplates() {
|
|
@@ -1225,27 +1244,27 @@ var __privateWrapper = (obj, member, setter, getter) => ({
|
|
|
1225
1244
|
}
|
|
1226
1245
|
return results;
|
|
1227
1246
|
}
|
|
1228
|
-
function buildStyle(chalk2,
|
|
1247
|
+
function buildStyle(chalk2, styles) {
|
|
1229
1248
|
const enabled = {};
|
|
1230
|
-
for (const layer of
|
|
1249
|
+
for (const layer of styles) {
|
|
1231
1250
|
for (const style of layer.styles) {
|
|
1232
1251
|
enabled[style[0]] = layer.inverse ? null : style.slice(1);
|
|
1233
1252
|
}
|
|
1234
1253
|
}
|
|
1235
1254
|
let current = chalk2;
|
|
1236
|
-
for (const [styleName,
|
|
1237
|
-
if (!Array.isArray(
|
|
1255
|
+
for (const [styleName, styles2] of Object.entries(enabled)) {
|
|
1256
|
+
if (!Array.isArray(styles2)) {
|
|
1238
1257
|
continue;
|
|
1239
1258
|
}
|
|
1240
1259
|
if (!(styleName in current)) {
|
|
1241
1260
|
throw new Error(`Unknown Chalk style: ${styleName}`);
|
|
1242
1261
|
}
|
|
1243
|
-
current =
|
|
1262
|
+
current = styles2.length > 0 ? current[styleName](...styles2) : current[styleName];
|
|
1244
1263
|
}
|
|
1245
1264
|
return current;
|
|
1246
1265
|
}
|
|
1247
1266
|
templates = (chalk2, temporary) => {
|
|
1248
|
-
const
|
|
1267
|
+
const styles = [];
|
|
1249
1268
|
const chunks = [];
|
|
1250
1269
|
let chunk = [];
|
|
1251
1270
|
temporary.replace(TEMPLATE_REGEX, (m, escapeCharacter, inverse, style, close, character) => {
|
|
@@ -1254,200 +1273,208 @@ var __privateWrapper = (obj, member, setter, getter) => ({
|
|
|
1254
1273
|
} else if (style) {
|
|
1255
1274
|
const string = chunk.join("");
|
|
1256
1275
|
chunk = [];
|
|
1257
|
-
chunks.push(
|
|
1258
|
-
|
|
1276
|
+
chunks.push(styles.length === 0 ? string : buildStyle(chalk2, styles)(string));
|
|
1277
|
+
styles.push({ inverse, styles: parseStyle(style) });
|
|
1259
1278
|
} else if (close) {
|
|
1260
|
-
if (
|
|
1279
|
+
if (styles.length === 0) {
|
|
1261
1280
|
throw new Error("Found extraneous } in Chalk template literal");
|
|
1262
1281
|
}
|
|
1263
|
-
chunks.push(buildStyle(chalk2,
|
|
1282
|
+
chunks.push(buildStyle(chalk2, styles)(chunk.join("")));
|
|
1264
1283
|
chunk = [];
|
|
1265
|
-
|
|
1284
|
+
styles.pop();
|
|
1266
1285
|
} else {
|
|
1267
1286
|
chunk.push(character);
|
|
1268
1287
|
}
|
|
1269
1288
|
});
|
|
1270
1289
|
chunks.push(chunk.join(""));
|
|
1271
|
-
if (
|
|
1272
|
-
const errMessage = `Chalk template literal is missing ${
|
|
1290
|
+
if (styles.length > 0) {
|
|
1291
|
+
const errMessage = `Chalk template literal is missing ${styles.length} closing bracket${styles.length === 1 ? "" : "s"} (\`}\`)`;
|
|
1273
1292
|
throw new Error(errMessage);
|
|
1274
1293
|
}
|
|
1275
1294
|
return chunks.join("");
|
|
1276
1295
|
};
|
|
1277
1296
|
return templates;
|
|
1278
1297
|
}
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1298
|
+
var source;
|
|
1299
|
+
var hasRequiredSource;
|
|
1300
|
+
function requireSource() {
|
|
1301
|
+
if (hasRequiredSource) return source;
|
|
1302
|
+
hasRequiredSource = 1;
|
|
1303
|
+
const ansiStyles2 = requireAnsiStyles();
|
|
1304
|
+
const { stdout: stdoutColor, stderr: stderrColor } = requireBrowser();
|
|
1305
|
+
const {
|
|
1306
|
+
stringReplaceAll,
|
|
1307
|
+
stringEncaseCRLFWithFirstIndex
|
|
1308
|
+
} = requireUtil();
|
|
1309
|
+
const { isArray } = Array;
|
|
1310
|
+
const levelMapping = [
|
|
1311
|
+
"ansi",
|
|
1312
|
+
"ansi",
|
|
1313
|
+
"ansi256",
|
|
1314
|
+
"ansi16m"
|
|
1315
|
+
];
|
|
1316
|
+
const styles = /* @__PURE__ */ Object.create(null);
|
|
1317
|
+
const applyOptions = (object, options = {}) => {
|
|
1318
|
+
if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) {
|
|
1319
|
+
throw new Error("The `level` option should be an integer from 0 to 3");
|
|
1320
|
+
}
|
|
1321
|
+
const colorLevel = stdoutColor ? stdoutColor.level : 0;
|
|
1322
|
+
object.level = options.level === void 0 ? colorLevel : options.level;
|
|
1323
|
+
};
|
|
1324
|
+
class ChalkClass {
|
|
1325
|
+
constructor(options) {
|
|
1326
|
+
return chalkFactory(options);
|
|
1327
|
+
}
|
|
1296
1328
|
}
|
|
1297
|
-
const
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1329
|
+
const chalkFactory = (options) => {
|
|
1330
|
+
const chalk3 = {};
|
|
1331
|
+
applyOptions(chalk3, options);
|
|
1332
|
+
chalk3.template = (...arguments_) => chalkTag(chalk3.template, ...arguments_);
|
|
1333
|
+
Object.setPrototypeOf(chalk3, Chalk.prototype);
|
|
1334
|
+
Object.setPrototypeOf(chalk3.template, chalk3);
|
|
1335
|
+
chalk3.template.constructor = () => {
|
|
1336
|
+
throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.");
|
|
1337
|
+
};
|
|
1338
|
+
chalk3.template.Instance = ChalkClass;
|
|
1339
|
+
return chalk3.template;
|
|
1340
|
+
};
|
|
1341
|
+
function Chalk(options) {
|
|
1302
1342
|
return chalkFactory(options);
|
|
1303
1343
|
}
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
chalk2.template.Instance = ChalkClass;
|
|
1315
|
-
return chalk2.template;
|
|
1316
|
-
};
|
|
1317
|
-
function Chalk(options) {
|
|
1318
|
-
return chalkFactory(options);
|
|
1319
|
-
}
|
|
1320
|
-
for (const [styleName, style] of Object.entries(ansiStyles)) {
|
|
1321
|
-
styles[styleName] = {
|
|
1344
|
+
for (const [styleName, style] of Object.entries(ansiStyles2)) {
|
|
1345
|
+
styles[styleName] = {
|
|
1346
|
+
get() {
|
|
1347
|
+
const builder = createBuilder(this, createStyler(style.open, style.close, this._styler), this._isEmpty);
|
|
1348
|
+
Object.defineProperty(this, styleName, { value: builder });
|
|
1349
|
+
return builder;
|
|
1350
|
+
}
|
|
1351
|
+
};
|
|
1352
|
+
}
|
|
1353
|
+
styles.visible = {
|
|
1322
1354
|
get() {
|
|
1323
|
-
const builder = createBuilder(this,
|
|
1324
|
-
Object.defineProperty(this,
|
|
1355
|
+
const builder = createBuilder(this, this._styler, true);
|
|
1356
|
+
Object.defineProperty(this, "visible", { value: builder });
|
|
1325
1357
|
return builder;
|
|
1326
1358
|
}
|
|
1327
1359
|
};
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1360
|
+
const usedModels = ["rgb", "hex", "keyword", "hsl", "hsv", "hwb", "ansi", "ansi256"];
|
|
1361
|
+
for (const model of usedModels) {
|
|
1362
|
+
styles[model] = {
|
|
1363
|
+
get() {
|
|
1364
|
+
const { level } = this;
|
|
1365
|
+
return function(...arguments_) {
|
|
1366
|
+
const styler = createStyler(ansiStyles2.color[levelMapping[level]][model](...arguments_), ansiStyles2.color.close, this._styler);
|
|
1367
|
+
return createBuilder(this, styler, this._isEmpty);
|
|
1368
|
+
};
|
|
1369
|
+
}
|
|
1370
|
+
};
|
|
1334
1371
|
}
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
}
|
|
1372
|
+
for (const model of usedModels) {
|
|
1373
|
+
const bgModel = "bg" + model[0].toUpperCase() + model.slice(1);
|
|
1374
|
+
styles[bgModel] = {
|
|
1375
|
+
get() {
|
|
1376
|
+
const { level } = this;
|
|
1377
|
+
return function(...arguments_) {
|
|
1378
|
+
const styler = createStyler(ansiStyles2.bgColor[levelMapping[level]][model](...arguments_), ansiStyles2.bgColor.close, this._styler);
|
|
1379
|
+
return createBuilder(this, styler, this._isEmpty);
|
|
1380
|
+
};
|
|
1381
|
+
}
|
|
1382
|
+
};
|
|
1383
|
+
}
|
|
1384
|
+
const proto = Object.defineProperties(() => {
|
|
1385
|
+
}, {
|
|
1386
|
+
...styles,
|
|
1387
|
+
level: {
|
|
1388
|
+
enumerable: true,
|
|
1389
|
+
get() {
|
|
1390
|
+
return this._generator.level;
|
|
1391
|
+
},
|
|
1392
|
+
set(level) {
|
|
1393
|
+
this._generator.level = level;
|
|
1394
|
+
}
|
|
1345
1395
|
}
|
|
1396
|
+
});
|
|
1397
|
+
const createStyler = (open, close, parent) => {
|
|
1398
|
+
let openAll;
|
|
1399
|
+
let closeAll;
|
|
1400
|
+
if (parent === void 0) {
|
|
1401
|
+
openAll = open;
|
|
1402
|
+
closeAll = close;
|
|
1403
|
+
} else {
|
|
1404
|
+
openAll = parent.openAll + open;
|
|
1405
|
+
closeAll = close + parent.closeAll;
|
|
1406
|
+
}
|
|
1407
|
+
return {
|
|
1408
|
+
open,
|
|
1409
|
+
close,
|
|
1410
|
+
openAll,
|
|
1411
|
+
closeAll,
|
|
1412
|
+
parent
|
|
1413
|
+
};
|
|
1346
1414
|
};
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1415
|
+
const createBuilder = (self2, _styler, _isEmpty) => {
|
|
1416
|
+
const builder = (...arguments_) => {
|
|
1417
|
+
if (isArray(arguments_[0]) && isArray(arguments_[0].raw)) {
|
|
1418
|
+
return applyStyle(builder, chalkTag(builder, ...arguments_));
|
|
1419
|
+
}
|
|
1420
|
+
return applyStyle(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" "));
|
|
1421
|
+
};
|
|
1422
|
+
Object.setPrototypeOf(builder, proto);
|
|
1423
|
+
builder._generator = self2;
|
|
1424
|
+
builder._styler = _styler;
|
|
1425
|
+
builder._isEmpty = _isEmpty;
|
|
1426
|
+
return builder;
|
|
1358
1427
|
};
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
}
|
|
1368
|
-
|
|
1369
|
-
|
|
1428
|
+
const applyStyle = (self2, string) => {
|
|
1429
|
+
if (self2.level <= 0 || !string) {
|
|
1430
|
+
return self2._isEmpty ? "" : string;
|
|
1431
|
+
}
|
|
1432
|
+
let styler = self2._styler;
|
|
1433
|
+
if (styler === void 0) {
|
|
1434
|
+
return string;
|
|
1435
|
+
}
|
|
1436
|
+
const { openAll, closeAll } = styler;
|
|
1437
|
+
if (string.indexOf("\x1B") !== -1) {
|
|
1438
|
+
while (styler !== void 0) {
|
|
1439
|
+
string = stringReplaceAll(string, styler.close, styler.open);
|
|
1440
|
+
styler = styler.parent;
|
|
1441
|
+
}
|
|
1370
1442
|
}
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
let openAll;
|
|
1375
|
-
let closeAll;
|
|
1376
|
-
if (parent === void 0) {
|
|
1377
|
-
openAll = open;
|
|
1378
|
-
closeAll = close;
|
|
1379
|
-
} else {
|
|
1380
|
-
openAll = parent.openAll + open;
|
|
1381
|
-
closeAll = close + parent.closeAll;
|
|
1382
|
-
}
|
|
1383
|
-
return {
|
|
1384
|
-
open,
|
|
1385
|
-
close,
|
|
1386
|
-
openAll,
|
|
1387
|
-
closeAll,
|
|
1388
|
-
parent
|
|
1389
|
-
};
|
|
1390
|
-
};
|
|
1391
|
-
const createBuilder = (self2, _styler, _isEmpty) => {
|
|
1392
|
-
const builder = (...arguments_) => {
|
|
1393
|
-
if (isArray(arguments_[0]) && isArray(arguments_[0].raw)) {
|
|
1394
|
-
return applyStyle(builder, chalkTag(builder, ...arguments_));
|
|
1443
|
+
const lfIndex = string.indexOf("\n");
|
|
1444
|
+
if (lfIndex !== -1) {
|
|
1445
|
+
string = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex);
|
|
1395
1446
|
}
|
|
1396
|
-
return
|
|
1447
|
+
return openAll + string + closeAll;
|
|
1397
1448
|
};
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
return
|
|
1424
|
-
}
|
|
1425
|
-
|
|
1426
|
-
const
|
|
1427
|
-
const [firstString] = strings;
|
|
1428
|
-
if (!isArray(firstString) || !isArray(firstString.raw)) {
|
|
1429
|
-
return strings.join(" ");
|
|
1430
|
-
}
|
|
1431
|
-
const arguments_ = strings.slice(1);
|
|
1432
|
-
const parts = [firstString.raw[0]];
|
|
1433
|
-
for (let i = 1; i < firstString.length; i++) {
|
|
1434
|
-
parts.push(
|
|
1435
|
-
String(arguments_[i - 1]).replace(/[{}\\]/g, "\\$&"),
|
|
1436
|
-
String(firstString.raw[i])
|
|
1437
|
-
);
|
|
1438
|
-
}
|
|
1439
|
-
if (template === void 0) {
|
|
1440
|
-
template = requireTemplates();
|
|
1441
|
-
}
|
|
1442
|
-
return template(chalk2, parts.join(""));
|
|
1443
|
-
};
|
|
1444
|
-
Object.defineProperties(Chalk.prototype, styles);
|
|
1445
|
-
const chalk = Chalk();
|
|
1446
|
-
chalk.supportsColor = stdoutColor;
|
|
1447
|
-
chalk.stderr = Chalk({ level: stderrColor ? stderrColor.level : 0 });
|
|
1448
|
-
chalk.stderr.supportsColor = stderrColor;
|
|
1449
|
-
var source = chalk;
|
|
1450
|
-
const chalk$1 = /* @__PURE__ */ getDefaultExportFromCjs(source);
|
|
1449
|
+
let template;
|
|
1450
|
+
const chalkTag = (chalk3, ...strings) => {
|
|
1451
|
+
const [firstString] = strings;
|
|
1452
|
+
if (!isArray(firstString) || !isArray(firstString.raw)) {
|
|
1453
|
+
return strings.join(" ");
|
|
1454
|
+
}
|
|
1455
|
+
const arguments_ = strings.slice(1);
|
|
1456
|
+
const parts = [firstString.raw[0]];
|
|
1457
|
+
for (let i = 1; i < firstString.length; i++) {
|
|
1458
|
+
parts.push(
|
|
1459
|
+
String(arguments_[i - 1]).replace(/[{}\\]/g, "\\$&"),
|
|
1460
|
+
String(firstString.raw[i])
|
|
1461
|
+
);
|
|
1462
|
+
}
|
|
1463
|
+
if (template === void 0) {
|
|
1464
|
+
template = requireTemplates();
|
|
1465
|
+
}
|
|
1466
|
+
return template(chalk3, parts.join(""));
|
|
1467
|
+
};
|
|
1468
|
+
Object.defineProperties(Chalk.prototype, styles);
|
|
1469
|
+
const chalk2 = Chalk();
|
|
1470
|
+
chalk2.supportsColor = stdoutColor;
|
|
1471
|
+
chalk2.stderr = Chalk({ level: stderrColor ? stderrColor.level : 0 });
|
|
1472
|
+
chalk2.stderr.supportsColor = stderrColor;
|
|
1473
|
+
source = chalk2;
|
|
1474
|
+
return source;
|
|
1475
|
+
}
|
|
1476
|
+
var sourceExports = requireSource();
|
|
1477
|
+
const chalk = /* @__PURE__ */ getDefaultExportFromCjs(sourceExports);
|
|
1451
1478
|
var ModelDelimeter = /* @__PURE__ */ ((ModelDelimeter2) => {
|
|
1452
1479
|
ModelDelimeter2["ROOT"] = "_";
|
|
1453
1480
|
ModelDelimeter2["SEPERATOR"] = "|";
|
|
@@ -1473,25 +1500,25 @@ var __privateWrapper = (obj, member, setter, getter) => ({
|
|
|
1473
1500
|
};
|
|
1474
1501
|
const defaultLogger = {
|
|
1475
1502
|
debug(message) {
|
|
1476
|
-
console.log(chalk
|
|
1503
|
+
console.log(chalk.grey(`debug: ${message}`));
|
|
1477
1504
|
},
|
|
1478
1505
|
error(message) {
|
|
1479
|
-
console.log(chalk
|
|
1506
|
+
console.log(chalk.red(`error: ${message}`));
|
|
1480
1507
|
},
|
|
1481
1508
|
http(message) {
|
|
1482
|
-
console.log(chalk
|
|
1509
|
+
console.log(chalk.cyan(`http: ${message}`));
|
|
1483
1510
|
},
|
|
1484
1511
|
info(message) {
|
|
1485
|
-
console.log(chalk
|
|
1512
|
+
console.log(chalk.white(`info: ${message}`));
|
|
1486
1513
|
},
|
|
1487
1514
|
silly(message) {
|
|
1488
|
-
console.log(chalk
|
|
1515
|
+
console.log(chalk.yellow(`silly: ${message}`));
|
|
1489
1516
|
},
|
|
1490
1517
|
verbose(message) {
|
|
1491
|
-
console.log(chalk
|
|
1518
|
+
console.log(chalk.green(`verbose: ${message}`));
|
|
1492
1519
|
},
|
|
1493
1520
|
warn(message) {
|
|
1494
|
-
console.log(chalk
|
|
1521
|
+
console.log(chalk.magenta(`warn: ${message}`));
|
|
1495
1522
|
}
|
|
1496
1523
|
};
|
|
1497
1524
|
function GetErrorPayload(errorCode, details = null) {
|