adding dist

This commit is contained in:
Federico Builes
2022-09-12 06:56:41 +02:00
parent 8c58cdad09
commit 7eeddef885
2 changed files with 26 additions and 23 deletions
Generated Vendored
+25 -22
View File
@@ -15215,7 +15215,7 @@ function assembleStyles() {
overline: [53, 55], overline: [53, 55],
inverse: [7, 27], inverse: [7, 27],
hidden: [8, 28], hidden: [8, 28],
strikethrough: [9, 29] strikethrough: [9, 29],
}, },
color: { color: {
black: [30, 39], black: [30, 39],
@@ -15235,7 +15235,7 @@ function assembleStyles() {
blueBright: [94, 39], blueBright: [94, 39],
magentaBright: [95, 39], magentaBright: [95, 39],
cyanBright: [96, 39], cyanBright: [96, 39],
whiteBright: [97, 39] whiteBright: [97, 39],
}, },
bgColor: { bgColor: {
bgBlack: [40, 49], bgBlack: [40, 49],
@@ -15255,8 +15255,8 @@ function assembleStyles() {
bgBlueBright: [104, 49], bgBlueBright: [104, 49],
bgMagentaBright: [105, 49], bgMagentaBright: [105, 49],
bgCyanBright: [106, 49], bgCyanBright: [106, 49],
bgWhiteBright: [107, 49] bgWhiteBright: [107, 49],
} },
}; };
// Alias bright black as gray (and grey) // Alias bright black as gray (and grey)
@@ -15269,7 +15269,7 @@ function assembleStyles() {
for (const [styleName, style] of Object.entries(group)) { for (const [styleName, style] of Object.entries(group)) {
styles[styleName] = { styles[styleName] = {
open: `\u001B[${style[0]}m`, open: `\u001B[${style[0]}m`,
close: `\u001B[${style[1]}m` close: `\u001B[${style[1]}m`,
}; };
group[styleName] = styles[styleName]; group[styleName] = styles[styleName];
@@ -15279,13 +15279,13 @@ function assembleStyles() {
Object.defineProperty(styles, groupName, { Object.defineProperty(styles, groupName, {
value: group, value: group,
enumerable: false enumerable: false,
}); });
} }
Object.defineProperty(styles, 'codes', { Object.defineProperty(styles, 'codes', {
value: codes, value: codes,
enumerable: false enumerable: false,
}); });
styles.color.close = '\u001B[39m'; styles.color.close = '\u001B[39m';
@@ -15316,39 +15316,41 @@ function assembleStyles() {
return Math.round(((red - 8) / 247) * 24) + 232; return Math.round(((red - 8) / 247) * 24) + 232;
} }
return 16 + return 16
(36 * Math.round(red / 255 * 5)) + + (36 * Math.round(red / 255 * 5))
(6 * Math.round(green / 255 * 5)) + + (6 * Math.round(green / 255 * 5))
Math.round(blue / 255 * 5); + Math.round(blue / 255 * 5);
}, },
enumerable: false enumerable: false,
}, },
hexToRgb: { hexToRgb: {
value: hex => { value: hex => {
const matches = /(?<colorString>[a-f\d]{6}|[a-f\d]{3})/i.exec(hex.toString(16)); const matches = /[a-f\d]{6}|[a-f\d]{3}/i.exec(hex.toString(16));
if (!matches) { if (!matches) {
return [0, 0, 0]; return [0, 0, 0];
} }
let {colorString} = matches.groups; let [colorString] = matches;
if (colorString.length === 3) { if (colorString.length === 3) {
colorString = colorString.split('').map(character => character + character).join(''); colorString = [...colorString].map(character => character + character).join('');
} }
const integer = Number.parseInt(colorString, 16); const integer = Number.parseInt(colorString, 16);
return [ return [
/* eslint-disable no-bitwise */
(integer >> 16) & 0xFF, (integer >> 16) & 0xFF,
(integer >> 8) & 0xFF, (integer >> 8) & 0xFF,
integer & 0xFF integer & 0xFF,
/* eslint-enable no-bitwise */
]; ];
}, },
enumerable: false enumerable: false,
}, },
hexToAnsi256: { hexToAnsi256: {
value: hex => styles.rgbToAnsi256(...styles.hexToRgb(hex)), value: hex => styles.rgbToAnsi256(...styles.hexToRgb(hex)),
enumerable: false enumerable: false,
}, },
ansi256ToAnsi: { ansi256ToAnsi: {
value: code => { value: code => {
@@ -15384,6 +15386,7 @@ function assembleStyles() {
return 30; return 30;
} }
// eslint-disable-next-line no-bitwise
let result = 30 + ((Math.round(blue) << 2) | (Math.round(green) << 1) | Math.round(red)); let result = 30 + ((Math.round(blue) << 2) | (Math.round(green) << 1) | Math.round(red));
if (value === 2) { if (value === 2) {
@@ -15392,16 +15395,16 @@ function assembleStyles() {
return result; return result;
}, },
enumerable: false enumerable: false,
}, },
rgbToAnsi: { rgbToAnsi: {
value: (red, green, blue) => styles.ansi256ToAnsi(styles.rgbToAnsi256(red, green, blue)), value: (red, green, blue) => styles.ansi256ToAnsi(styles.rgbToAnsi256(red, green, blue)),
enumerable: false enumerable: false,
}, },
hexToAnsi: { hexToAnsi: {
value: hex => styles.ansi256ToAnsi(styles.hexToAnsi256(hex)), value: hex => styles.ansi256ToAnsi(styles.hexToAnsi256(hex)),
enumerable: false enumerable: false,
} },
}); });
return styles; return styles;
Generated Vendored
+1 -1
View File
File diff suppressed because one or more lines are too long