es-toolkit 1.46.1-dev.1804 → 1.46.1-dev.1806
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/browser.global.js +3 -3
- package/dist/index.d.mts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -0
- package/dist/index.mjs +2 -1
- package/dist/object/index.d.mts +2 -1
- package/dist/object/index.d.ts +2 -1
- package/dist/object/index.js +2 -0
- package/dist/object/index.mjs +2 -1
- package/dist/object/sortKeys.d.mts +22 -0
- package/dist/object/sortKeys.d.ts +22 -0
- package/dist/object/sortKeys.js +30 -0
- package/dist/object/sortKeys.mjs +30 -0
- package/dist/server/colors/_internal/parseHex.js +32 -0
- package/dist/server/colors/_internal/parseHex.mjs +32 -0
- package/dist/server/colors/_internal/wrapAnsi.js +21 -0
- package/dist/server/colors/_internal/wrapAnsi.mjs +21 -0
- package/dist/server/colors/_internal/wrapAnsiBg.js +30 -0
- package/dist/server/colors/_internal/wrapAnsiBg.mjs +30 -0
- package/dist/server/colors/ansi256.d.mts +18 -0
- package/dist/server/colors/ansi256.d.ts +18 -0
- package/dist/server/colors/ansi256.js +19 -0
- package/dist/server/colors/ansi256.mjs +19 -0
- package/dist/server/colors/bgAnsi256.d.mts +18 -0
- package/dist/server/colors/bgAnsi256.d.ts +18 -0
- package/dist/server/colors/bgAnsi256.js +19 -0
- package/dist/server/colors/bgAnsi256.mjs +19 -0
- package/dist/server/colors/bgBlack.d.mts +15 -0
- package/dist/server/colors/bgBlack.d.ts +15 -0
- package/dist/server/colors/bgBlack.js +18 -0
- package/dist/server/colors/bgBlack.mjs +18 -0
- package/dist/server/colors/bgBlackBright.d.mts +15 -0
- package/dist/server/colors/bgBlackBright.d.ts +15 -0
- package/dist/server/colors/bgBlackBright.js +18 -0
- package/dist/server/colors/bgBlackBright.mjs +18 -0
- package/dist/server/colors/bgBlue.d.mts +15 -0
- package/dist/server/colors/bgBlue.d.ts +15 -0
- package/dist/server/colors/bgBlue.js +18 -0
- package/dist/server/colors/bgBlue.mjs +18 -0
- package/dist/server/colors/bgBlueBright.d.mts +15 -0
- package/dist/server/colors/bgBlueBright.d.ts +15 -0
- package/dist/server/colors/bgBlueBright.js +18 -0
- package/dist/server/colors/bgBlueBright.mjs +18 -0
- package/dist/server/colors/bgCyan.d.mts +15 -0
- package/dist/server/colors/bgCyan.d.ts +15 -0
- package/dist/server/colors/bgCyan.js +18 -0
- package/dist/server/colors/bgCyan.mjs +18 -0
- package/dist/server/colors/bgCyanBright.d.mts +15 -0
- package/dist/server/colors/bgCyanBright.d.ts +15 -0
- package/dist/server/colors/bgCyanBright.js +18 -0
- package/dist/server/colors/bgCyanBright.mjs +18 -0
- package/dist/server/colors/bgGreen.d.mts +15 -0
- package/dist/server/colors/bgGreen.d.ts +15 -0
- package/dist/server/colors/bgGreen.js +18 -0
- package/dist/server/colors/bgGreen.mjs +18 -0
- package/dist/server/colors/bgGreenBright.d.mts +15 -0
- package/dist/server/colors/bgGreenBright.d.ts +15 -0
- package/dist/server/colors/bgGreenBright.js +18 -0
- package/dist/server/colors/bgGreenBright.mjs +18 -0
- package/dist/server/colors/bgHex.d.mts +18 -0
- package/dist/server/colors/bgHex.d.ts +18 -0
- package/dist/server/colors/bgHex.js +21 -0
- package/dist/server/colors/bgHex.mjs +21 -0
- package/dist/server/colors/bgMagenta.d.mts +15 -0
- package/dist/server/colors/bgMagenta.d.ts +15 -0
- package/dist/server/colors/bgMagenta.js +18 -0
- package/dist/server/colors/bgMagenta.mjs +18 -0
- package/dist/server/colors/bgMagentaBright.d.mts +15 -0
- package/dist/server/colors/bgMagentaBright.d.ts +15 -0
- package/dist/server/colors/bgMagentaBright.js +18 -0
- package/dist/server/colors/bgMagentaBright.mjs +18 -0
- package/dist/server/colors/bgRed.d.mts +15 -0
- package/dist/server/colors/bgRed.d.ts +15 -0
- package/dist/server/colors/bgRed.js +18 -0
- package/dist/server/colors/bgRed.mjs +18 -0
- package/dist/server/colors/bgRedBright.d.mts +15 -0
- package/dist/server/colors/bgRedBright.d.ts +15 -0
- package/dist/server/colors/bgRedBright.js +18 -0
- package/dist/server/colors/bgRedBright.mjs +18 -0
- package/dist/server/colors/bgRgb.d.mts +20 -0
- package/dist/server/colors/bgRgb.d.ts +20 -0
- package/dist/server/colors/bgRgb.js +21 -0
- package/dist/server/colors/bgRgb.mjs +21 -0
- package/dist/server/colors/bgWhite.d.mts +15 -0
- package/dist/server/colors/bgWhite.d.ts +15 -0
- package/dist/server/colors/bgWhite.js +18 -0
- package/dist/server/colors/bgWhite.mjs +18 -0
- package/dist/server/colors/bgWhiteBright.d.mts +15 -0
- package/dist/server/colors/bgWhiteBright.d.ts +15 -0
- package/dist/server/colors/bgWhiteBright.js +18 -0
- package/dist/server/colors/bgWhiteBright.mjs +18 -0
- package/dist/server/colors/bgYellow.d.mts +15 -0
- package/dist/server/colors/bgYellow.d.ts +15 -0
- package/dist/server/colors/bgYellow.js +18 -0
- package/dist/server/colors/bgYellow.mjs +18 -0
- package/dist/server/colors/bgYellowBright.d.mts +15 -0
- package/dist/server/colors/bgYellowBright.d.ts +15 -0
- package/dist/server/colors/bgYellowBright.js +18 -0
- package/dist/server/colors/bgYellowBright.mjs +18 -0
- package/dist/server/colors/black.d.mts +15 -0
- package/dist/server/colors/black.d.ts +15 -0
- package/dist/server/colors/black.js +18 -0
- package/dist/server/colors/black.mjs +18 -0
- package/dist/server/colors/blackBright.d.mts +15 -0
- package/dist/server/colors/blackBright.d.ts +15 -0
- package/dist/server/colors/blackBright.js +18 -0
- package/dist/server/colors/blackBright.mjs +18 -0
- package/dist/server/colors/blue.d.mts +15 -0
- package/dist/server/colors/blue.d.ts +15 -0
- package/dist/server/colors/blue.js +18 -0
- package/dist/server/colors/blue.mjs +18 -0
- package/dist/server/colors/blueBright.d.mts +15 -0
- package/dist/server/colors/blueBright.d.ts +15 -0
- package/dist/server/colors/blueBright.js +18 -0
- package/dist/server/colors/blueBright.mjs +18 -0
- package/dist/server/colors/bold.d.mts +15 -0
- package/dist/server/colors/bold.d.ts +15 -0
- package/dist/server/colors/bold.js +18 -0
- package/dist/server/colors/bold.mjs +18 -0
- package/dist/server/colors/cyan.d.mts +15 -0
- package/dist/server/colors/cyan.d.ts +15 -0
- package/dist/server/colors/cyan.js +18 -0
- package/dist/server/colors/cyan.mjs +18 -0
- package/dist/server/colors/cyanBright.d.mts +15 -0
- package/dist/server/colors/cyanBright.d.ts +15 -0
- package/dist/server/colors/cyanBright.js +18 -0
- package/dist/server/colors/cyanBright.mjs +18 -0
- package/dist/server/colors/dim.d.mts +15 -0
- package/dist/server/colors/dim.d.ts +15 -0
- package/dist/server/colors/dim.js +18 -0
- package/dist/server/colors/dim.mjs +18 -0
- package/dist/server/colors/gray.js +18 -0
- package/dist/server/colors/gray.mjs +19 -0
- package/dist/server/colors/green.d.mts +15 -0
- package/dist/server/colors/green.d.ts +15 -0
- package/dist/server/colors/green.js +18 -0
- package/dist/server/colors/green.mjs +18 -0
- package/dist/server/colors/greenBright.d.mts +15 -0
- package/dist/server/colors/greenBright.d.ts +15 -0
- package/dist/server/colors/greenBright.js +18 -0
- package/dist/server/colors/greenBright.mjs +18 -0
- package/dist/server/colors/hex.d.mts +18 -0
- package/dist/server/colors/hex.d.ts +18 -0
- package/dist/server/colors/hex.js +21 -0
- package/dist/server/colors/hex.mjs +21 -0
- package/dist/server/colors/hidden.d.mts +15 -0
- package/dist/server/colors/hidden.d.ts +15 -0
- package/dist/server/colors/hidden.js +18 -0
- package/dist/server/colors/hidden.mjs +18 -0
- package/dist/server/colors/index.d.mts +99 -0
- package/dist/server/colors/index.d.ts +99 -0
- package/dist/server/colors/index.js +99 -0
- package/dist/server/colors/index.mjs +99 -0
- package/dist/server/colors/inverse.d.mts +15 -0
- package/dist/server/colors/inverse.d.ts +15 -0
- package/dist/server/colors/inverse.js +18 -0
- package/dist/server/colors/inverse.mjs +18 -0
- package/dist/server/colors/italic.d.mts +15 -0
- package/dist/server/colors/italic.d.ts +15 -0
- package/dist/server/colors/italic.js +18 -0
- package/dist/server/colors/italic.mjs +18 -0
- package/dist/server/colors/magenta.d.mts +15 -0
- package/dist/server/colors/magenta.d.ts +15 -0
- package/dist/server/colors/magenta.js +18 -0
- package/dist/server/colors/magenta.mjs +18 -0
- package/dist/server/colors/magentaBright.d.mts +15 -0
- package/dist/server/colors/magentaBright.d.ts +15 -0
- package/dist/server/colors/magentaBright.js +18 -0
- package/dist/server/colors/magentaBright.mjs +18 -0
- package/dist/server/colors/red.d.mts +15 -0
- package/dist/server/colors/red.d.ts +15 -0
- package/dist/server/colors/red.js +18 -0
- package/dist/server/colors/red.mjs +18 -0
- package/dist/server/colors/redBright.d.mts +15 -0
- package/dist/server/colors/redBright.d.ts +15 -0
- package/dist/server/colors/redBright.js +18 -0
- package/dist/server/colors/redBright.mjs +18 -0
- package/dist/server/colors/reset.d.mts +15 -0
- package/dist/server/colors/reset.d.ts +15 -0
- package/dist/server/colors/reset.js +18 -0
- package/dist/server/colors/reset.mjs +18 -0
- package/dist/server/colors/rgb.d.mts +20 -0
- package/dist/server/colors/rgb.d.ts +20 -0
- package/dist/server/colors/rgb.js +21 -0
- package/dist/server/colors/rgb.mjs +21 -0
- package/dist/server/colors/strikethrough.d.mts +15 -0
- package/dist/server/colors/strikethrough.d.ts +15 -0
- package/dist/server/colors/strikethrough.js +18 -0
- package/dist/server/colors/strikethrough.mjs +18 -0
- package/dist/server/colors/types.d.mts +4 -0
- package/dist/server/colors/types.d.ts +4 -0
- package/dist/server/colors/underline.d.mts +15 -0
- package/dist/server/colors/underline.d.ts +15 -0
- package/dist/server/colors/underline.js +18 -0
- package/dist/server/colors/underline.mjs +18 -0
- package/dist/server/colors/white.d.mts +15 -0
- package/dist/server/colors/white.d.ts +15 -0
- package/dist/server/colors/white.js +18 -0
- package/dist/server/colors/white.mjs +18 -0
- package/dist/server/colors/whiteBright.d.mts +15 -0
- package/dist/server/colors/whiteBright.d.ts +15 -0
- package/dist/server/colors/whiteBright.js +18 -0
- package/dist/server/colors/whiteBright.mjs +18 -0
- package/dist/server/colors/yellow.d.mts +15 -0
- package/dist/server/colors/yellow.d.ts +15 -0
- package/dist/server/colors/yellow.js +18 -0
- package/dist/server/colors/yellow.mjs +18 -0
- package/dist/server/colors/yellowBright.d.mts +15 -0
- package/dist/server/colors/yellowBright.d.ts +15 -0
- package/dist/server/colors/yellowBright.js +18 -0
- package/dist/server/colors/yellowBright.mjs +18 -0
- package/dist/server/index.d.mts +3 -0
- package/dist/server/index.d.ts +3 -0
- package/dist/server/index.js +3 -0
- package/dist/server/index.mjs +2 -0
- package/package.json +22 -1
- package/server.d.ts +1 -0
- package/server.js +1 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { wrapAnsi } from "./_internal/wrapAnsi.mjs";
|
|
2
|
+
//#region src/server/colors/magentaBright.ts
|
|
3
|
+
/**
|
|
4
|
+
* Bright magenta foreground. Wraps text with ANSI codes.
|
|
5
|
+
*
|
|
6
|
+
* @param text - The text to style.
|
|
7
|
+
* @returns The styled text.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* import { colors } from 'es-toolkit/server';
|
|
11
|
+
*
|
|
12
|
+
* console.log(colors.magentaBright('hello'));
|
|
13
|
+
*/
|
|
14
|
+
function magentaBright(text) {
|
|
15
|
+
return wrapAnsi("\x1B[95m", "\x1B[39m", text);
|
|
16
|
+
}
|
|
17
|
+
//#endregion
|
|
18
|
+
export { magentaBright };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
//#region src/server/colors/red.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Red foreground. Wraps text with ANSI codes.
|
|
4
|
+
*
|
|
5
|
+
* @param text - The text to style.
|
|
6
|
+
* @returns The styled text.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* import { colors } from 'es-toolkit/server';
|
|
10
|
+
*
|
|
11
|
+
* console.log(colors.red('error'));
|
|
12
|
+
*/
|
|
13
|
+
declare function red(text: string): string;
|
|
14
|
+
//#endregion
|
|
15
|
+
export { red };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
//#region src/server/colors/red.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Red foreground. Wraps text with ANSI codes.
|
|
4
|
+
*
|
|
5
|
+
* @param text - The text to style.
|
|
6
|
+
* @returns The styled text.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* import { colors } from 'es-toolkit/server';
|
|
10
|
+
*
|
|
11
|
+
* console.log(colors.red('error'));
|
|
12
|
+
*/
|
|
13
|
+
declare function red(text: string): string;
|
|
14
|
+
//#endregion
|
|
15
|
+
export { red };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
const require_wrapAnsi = require("./_internal/wrapAnsi.js");
|
|
2
|
+
//#region src/server/colors/red.ts
|
|
3
|
+
/**
|
|
4
|
+
* Red foreground. Wraps text with ANSI codes.
|
|
5
|
+
*
|
|
6
|
+
* @param text - The text to style.
|
|
7
|
+
* @returns The styled text.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* import { colors } from 'es-toolkit/server';
|
|
11
|
+
*
|
|
12
|
+
* console.log(colors.red('error'));
|
|
13
|
+
*/
|
|
14
|
+
function red(text) {
|
|
15
|
+
return require_wrapAnsi.wrapAnsi("\x1B[31m", "\x1B[39m", text);
|
|
16
|
+
}
|
|
17
|
+
//#endregion
|
|
18
|
+
exports.red = red;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { wrapAnsi } from "./_internal/wrapAnsi.mjs";
|
|
2
|
+
//#region src/server/colors/red.ts
|
|
3
|
+
/**
|
|
4
|
+
* Red foreground. Wraps text with ANSI codes.
|
|
5
|
+
*
|
|
6
|
+
* @param text - The text to style.
|
|
7
|
+
* @returns The styled text.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* import { colors } from 'es-toolkit/server';
|
|
11
|
+
*
|
|
12
|
+
* console.log(colors.red('error'));
|
|
13
|
+
*/
|
|
14
|
+
function red(text) {
|
|
15
|
+
return wrapAnsi("\x1B[31m", "\x1B[39m", text);
|
|
16
|
+
}
|
|
17
|
+
//#endregion
|
|
18
|
+
export { red };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
//#region src/server/colors/redBright.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Bright red foreground. Wraps text with ANSI codes.
|
|
4
|
+
*
|
|
5
|
+
* @param text - The text to style.
|
|
6
|
+
* @returns The styled text.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* import { colors } from 'es-toolkit/server';
|
|
10
|
+
*
|
|
11
|
+
* console.log(colors.redBright('hello'));
|
|
12
|
+
*/
|
|
13
|
+
declare function redBright(text: string): string;
|
|
14
|
+
//#endregion
|
|
15
|
+
export { redBright };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
//#region src/server/colors/redBright.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Bright red foreground. Wraps text with ANSI codes.
|
|
4
|
+
*
|
|
5
|
+
* @param text - The text to style.
|
|
6
|
+
* @returns The styled text.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* import { colors } from 'es-toolkit/server';
|
|
10
|
+
*
|
|
11
|
+
* console.log(colors.redBright('hello'));
|
|
12
|
+
*/
|
|
13
|
+
declare function redBright(text: string): string;
|
|
14
|
+
//#endregion
|
|
15
|
+
export { redBright };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
const require_wrapAnsi = require("./_internal/wrapAnsi.js");
|
|
2
|
+
//#region src/server/colors/redBright.ts
|
|
3
|
+
/**
|
|
4
|
+
* Bright red foreground. Wraps text with ANSI codes.
|
|
5
|
+
*
|
|
6
|
+
* @param text - The text to style.
|
|
7
|
+
* @returns The styled text.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* import { colors } from 'es-toolkit/server';
|
|
11
|
+
*
|
|
12
|
+
* console.log(colors.redBright('hello'));
|
|
13
|
+
*/
|
|
14
|
+
function redBright(text) {
|
|
15
|
+
return require_wrapAnsi.wrapAnsi("\x1B[91m", "\x1B[39m", text);
|
|
16
|
+
}
|
|
17
|
+
//#endregion
|
|
18
|
+
exports.redBright = redBright;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { wrapAnsi } from "./_internal/wrapAnsi.mjs";
|
|
2
|
+
//#region src/server/colors/redBright.ts
|
|
3
|
+
/**
|
|
4
|
+
* Bright red foreground. Wraps text with ANSI codes.
|
|
5
|
+
*
|
|
6
|
+
* @param text - The text to style.
|
|
7
|
+
* @returns The styled text.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* import { colors } from 'es-toolkit/server';
|
|
11
|
+
*
|
|
12
|
+
* console.log(colors.redBright('hello'));
|
|
13
|
+
*/
|
|
14
|
+
function redBright(text) {
|
|
15
|
+
return wrapAnsi("\x1B[91m", "\x1B[39m", text);
|
|
16
|
+
}
|
|
17
|
+
//#endregion
|
|
18
|
+
export { redBright };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
//#region src/server/colors/reset.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Resets every style and color set up to this point. Wraps text with the ANSI reset code.
|
|
4
|
+
*
|
|
5
|
+
* @param text - The text to style.
|
|
6
|
+
* @returns The styled text.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* import { colors } from 'es-toolkit/server';
|
|
10
|
+
*
|
|
11
|
+
* console.log(colors.reset('hello'));
|
|
12
|
+
*/
|
|
13
|
+
declare function reset(text: string): string;
|
|
14
|
+
//#endregion
|
|
15
|
+
export { reset };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
//#region src/server/colors/reset.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Resets every style and color set up to this point. Wraps text with the ANSI reset code.
|
|
4
|
+
*
|
|
5
|
+
* @param text - The text to style.
|
|
6
|
+
* @returns The styled text.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* import { colors } from 'es-toolkit/server';
|
|
10
|
+
*
|
|
11
|
+
* console.log(colors.reset('hello'));
|
|
12
|
+
*/
|
|
13
|
+
declare function reset(text: string): string;
|
|
14
|
+
//#endregion
|
|
15
|
+
export { reset };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
const require_wrapAnsi = require("./_internal/wrapAnsi.js");
|
|
2
|
+
//#region src/server/colors/reset.ts
|
|
3
|
+
/**
|
|
4
|
+
* Resets every style and color set up to this point. Wraps text with the ANSI reset code.
|
|
5
|
+
*
|
|
6
|
+
* @param text - The text to style.
|
|
7
|
+
* @returns The styled text.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* import { colors } from 'es-toolkit/server';
|
|
11
|
+
*
|
|
12
|
+
* console.log(colors.reset('hello'));
|
|
13
|
+
*/
|
|
14
|
+
function reset(text) {
|
|
15
|
+
return require_wrapAnsi.wrapAnsi("\x1B[0m", "\x1B[0m", text);
|
|
16
|
+
}
|
|
17
|
+
//#endregion
|
|
18
|
+
exports.reset = reset;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { wrapAnsi } from "./_internal/wrapAnsi.mjs";
|
|
2
|
+
//#region src/server/colors/reset.ts
|
|
3
|
+
/**
|
|
4
|
+
* Resets every style and color set up to this point. Wraps text with the ANSI reset code.
|
|
5
|
+
*
|
|
6
|
+
* @param text - The text to style.
|
|
7
|
+
* @returns The styled text.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* import { colors } from 'es-toolkit/server';
|
|
11
|
+
*
|
|
12
|
+
* console.log(colors.reset('hello'));
|
|
13
|
+
*/
|
|
14
|
+
function reset(text) {
|
|
15
|
+
return wrapAnsi("\x1B[0m", "\x1B[0m", text);
|
|
16
|
+
}
|
|
17
|
+
//#endregion
|
|
18
|
+
export { reset };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ColorFunction } from "./types.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/server/colors/rgb.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* Returns a function that wraps text with the given 24-bit (truecolor) foreground.
|
|
6
|
+
*
|
|
7
|
+
* @param r - Red component (0–255).
|
|
8
|
+
* @param g - Green component (0–255).
|
|
9
|
+
* @param b - Blue component (0–255).
|
|
10
|
+
* @returns A color function that wraps text with the chosen RGB foreground.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* import { colors } from 'es-toolkit/server';
|
|
14
|
+
*
|
|
15
|
+
* const brand = colors.rgb(255, 99, 71);
|
|
16
|
+
* console.log(brand('hello'));
|
|
17
|
+
*/
|
|
18
|
+
declare function rgb(r: number, g: number, b: number): ColorFunction;
|
|
19
|
+
//#endregion
|
|
20
|
+
export { rgb };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ColorFunction } from "./types.js";
|
|
2
|
+
|
|
3
|
+
//#region src/server/colors/rgb.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* Returns a function that wraps text with the given 24-bit (truecolor) foreground.
|
|
6
|
+
*
|
|
7
|
+
* @param r - Red component (0–255).
|
|
8
|
+
* @param g - Green component (0–255).
|
|
9
|
+
* @param b - Blue component (0–255).
|
|
10
|
+
* @returns A color function that wraps text with the chosen RGB foreground.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* import { colors } from 'es-toolkit/server';
|
|
14
|
+
*
|
|
15
|
+
* const brand = colors.rgb(255, 99, 71);
|
|
16
|
+
* console.log(brand('hello'));
|
|
17
|
+
*/
|
|
18
|
+
declare function rgb(r: number, g: number, b: number): ColorFunction;
|
|
19
|
+
//#endregion
|
|
20
|
+
export { rgb };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
const require_wrapAnsi = require("./_internal/wrapAnsi.js");
|
|
2
|
+
//#region src/server/colors/rgb.ts
|
|
3
|
+
/**
|
|
4
|
+
* Returns a function that wraps text with the given 24-bit (truecolor) foreground.
|
|
5
|
+
*
|
|
6
|
+
* @param r - Red component (0–255).
|
|
7
|
+
* @param g - Green component (0–255).
|
|
8
|
+
* @param b - Blue component (0–255).
|
|
9
|
+
* @returns A color function that wraps text with the chosen RGB foreground.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* import { colors } from 'es-toolkit/server';
|
|
13
|
+
*
|
|
14
|
+
* const brand = colors.rgb(255, 99, 71);
|
|
15
|
+
* console.log(brand('hello'));
|
|
16
|
+
*/
|
|
17
|
+
function rgb(r, g, b) {
|
|
18
|
+
return (text) => require_wrapAnsi.wrapAnsi(`\x1b[38;2;${r};${g};${b}m`, "\x1B[39m", text);
|
|
19
|
+
}
|
|
20
|
+
//#endregion
|
|
21
|
+
exports.rgb = rgb;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { wrapAnsi } from "./_internal/wrapAnsi.mjs";
|
|
2
|
+
//#region src/server/colors/rgb.ts
|
|
3
|
+
/**
|
|
4
|
+
* Returns a function that wraps text with the given 24-bit (truecolor) foreground.
|
|
5
|
+
*
|
|
6
|
+
* @param r - Red component (0–255).
|
|
7
|
+
* @param g - Green component (0–255).
|
|
8
|
+
* @param b - Blue component (0–255).
|
|
9
|
+
* @returns A color function that wraps text with the chosen RGB foreground.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* import { colors } from 'es-toolkit/server';
|
|
13
|
+
*
|
|
14
|
+
* const brand = colors.rgb(255, 99, 71);
|
|
15
|
+
* console.log(brand('hello'));
|
|
16
|
+
*/
|
|
17
|
+
function rgb(r, g, b) {
|
|
18
|
+
return (text) => wrapAnsi(`\x1b[38;2;${r};${g};${b}m`, "\x1B[39m", text);
|
|
19
|
+
}
|
|
20
|
+
//#endregion
|
|
21
|
+
export { rgb };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
//#region src/server/colors/strikethrough.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Strikethrough text. Wraps text with ANSI codes.
|
|
4
|
+
*
|
|
5
|
+
* @param text - The text to style.
|
|
6
|
+
* @returns The styled text.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* import { colors } from 'es-toolkit/server';
|
|
10
|
+
*
|
|
11
|
+
* console.log(colors.strikethrough('hello'));
|
|
12
|
+
*/
|
|
13
|
+
declare function strikethrough(text: string): string;
|
|
14
|
+
//#endregion
|
|
15
|
+
export { strikethrough };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
//#region src/server/colors/strikethrough.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Strikethrough text. Wraps text with ANSI codes.
|
|
4
|
+
*
|
|
5
|
+
* @param text - The text to style.
|
|
6
|
+
* @returns The styled text.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* import { colors } from 'es-toolkit/server';
|
|
10
|
+
*
|
|
11
|
+
* console.log(colors.strikethrough('hello'));
|
|
12
|
+
*/
|
|
13
|
+
declare function strikethrough(text: string): string;
|
|
14
|
+
//#endregion
|
|
15
|
+
export { strikethrough };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
const require_wrapAnsi = require("./_internal/wrapAnsi.js");
|
|
2
|
+
//#region src/server/colors/strikethrough.ts
|
|
3
|
+
/**
|
|
4
|
+
* Strikethrough text. Wraps text with ANSI codes.
|
|
5
|
+
*
|
|
6
|
+
* @param text - The text to style.
|
|
7
|
+
* @returns The styled text.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* import { colors } from 'es-toolkit/server';
|
|
11
|
+
*
|
|
12
|
+
* console.log(colors.strikethrough('hello'));
|
|
13
|
+
*/
|
|
14
|
+
function strikethrough(text) {
|
|
15
|
+
return require_wrapAnsi.wrapAnsi("\x1B[9m", "\x1B[29m", text);
|
|
16
|
+
}
|
|
17
|
+
//#endregion
|
|
18
|
+
exports.strikethrough = strikethrough;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { wrapAnsi } from "./_internal/wrapAnsi.mjs";
|
|
2
|
+
//#region src/server/colors/strikethrough.ts
|
|
3
|
+
/**
|
|
4
|
+
* Strikethrough text. Wraps text with ANSI codes.
|
|
5
|
+
*
|
|
6
|
+
* @param text - The text to style.
|
|
7
|
+
* @returns The styled text.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* import { colors } from 'es-toolkit/server';
|
|
11
|
+
*
|
|
12
|
+
* console.log(colors.strikethrough('hello'));
|
|
13
|
+
*/
|
|
14
|
+
function strikethrough(text) {
|
|
15
|
+
return wrapAnsi("\x1B[9m", "\x1B[29m", text);
|
|
16
|
+
}
|
|
17
|
+
//#endregion
|
|
18
|
+
export { strikethrough };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
//#region src/server/colors/underline.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Underlined text. Wraps text with ANSI codes.
|
|
4
|
+
*
|
|
5
|
+
* @param text - The text to style.
|
|
6
|
+
* @returns The styled text.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* import { colors } from 'es-toolkit/server';
|
|
10
|
+
*
|
|
11
|
+
* console.log(colors.underline('hello'));
|
|
12
|
+
*/
|
|
13
|
+
declare function underline(text: string): string;
|
|
14
|
+
//#endregion
|
|
15
|
+
export { underline };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
//#region src/server/colors/underline.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Underlined text. Wraps text with ANSI codes.
|
|
4
|
+
*
|
|
5
|
+
* @param text - The text to style.
|
|
6
|
+
* @returns The styled text.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* import { colors } from 'es-toolkit/server';
|
|
10
|
+
*
|
|
11
|
+
* console.log(colors.underline('hello'));
|
|
12
|
+
*/
|
|
13
|
+
declare function underline(text: string): string;
|
|
14
|
+
//#endregion
|
|
15
|
+
export { underline };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
const require_wrapAnsi = require("./_internal/wrapAnsi.js");
|
|
2
|
+
//#region src/server/colors/underline.ts
|
|
3
|
+
/**
|
|
4
|
+
* Underlined text. Wraps text with ANSI codes.
|
|
5
|
+
*
|
|
6
|
+
* @param text - The text to style.
|
|
7
|
+
* @returns The styled text.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* import { colors } from 'es-toolkit/server';
|
|
11
|
+
*
|
|
12
|
+
* console.log(colors.underline('hello'));
|
|
13
|
+
*/
|
|
14
|
+
function underline(text) {
|
|
15
|
+
return require_wrapAnsi.wrapAnsi("\x1B[4m", "\x1B[24m", text);
|
|
16
|
+
}
|
|
17
|
+
//#endregion
|
|
18
|
+
exports.underline = underline;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { wrapAnsi } from "./_internal/wrapAnsi.mjs";
|
|
2
|
+
//#region src/server/colors/underline.ts
|
|
3
|
+
/**
|
|
4
|
+
* Underlined text. Wraps text with ANSI codes.
|
|
5
|
+
*
|
|
6
|
+
* @param text - The text to style.
|
|
7
|
+
* @returns The styled text.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* import { colors } from 'es-toolkit/server';
|
|
11
|
+
*
|
|
12
|
+
* console.log(colors.underline('hello'));
|
|
13
|
+
*/
|
|
14
|
+
function underline(text) {
|
|
15
|
+
return wrapAnsi("\x1B[4m", "\x1B[24m", text);
|
|
16
|
+
}
|
|
17
|
+
//#endregion
|
|
18
|
+
export { underline };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
//#region src/server/colors/white.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* White foreground. Wraps text with ANSI codes.
|
|
4
|
+
*
|
|
5
|
+
* @param text - The text to style.
|
|
6
|
+
* @returns The styled text.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* import { colors } from 'es-toolkit/server';
|
|
10
|
+
*
|
|
11
|
+
* console.log(colors.white('hello'));
|
|
12
|
+
*/
|
|
13
|
+
declare function white(text: string): string;
|
|
14
|
+
//#endregion
|
|
15
|
+
export { white };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
//#region src/server/colors/white.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* White foreground. Wraps text with ANSI codes.
|
|
4
|
+
*
|
|
5
|
+
* @param text - The text to style.
|
|
6
|
+
* @returns The styled text.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* import { colors } from 'es-toolkit/server';
|
|
10
|
+
*
|
|
11
|
+
* console.log(colors.white('hello'));
|
|
12
|
+
*/
|
|
13
|
+
declare function white(text: string): string;
|
|
14
|
+
//#endregion
|
|
15
|
+
export { white };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
const require_wrapAnsi = require("./_internal/wrapAnsi.js");
|
|
2
|
+
//#region src/server/colors/white.ts
|
|
3
|
+
/**
|
|
4
|
+
* White foreground. Wraps text with ANSI codes.
|
|
5
|
+
*
|
|
6
|
+
* @param text - The text to style.
|
|
7
|
+
* @returns The styled text.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* import { colors } from 'es-toolkit/server';
|
|
11
|
+
*
|
|
12
|
+
* console.log(colors.white('hello'));
|
|
13
|
+
*/
|
|
14
|
+
function white(text) {
|
|
15
|
+
return require_wrapAnsi.wrapAnsi("\x1B[37m", "\x1B[39m", text);
|
|
16
|
+
}
|
|
17
|
+
//#endregion
|
|
18
|
+
exports.white = white;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { wrapAnsi } from "./_internal/wrapAnsi.mjs";
|
|
2
|
+
//#region src/server/colors/white.ts
|
|
3
|
+
/**
|
|
4
|
+
* White foreground. Wraps text with ANSI codes.
|
|
5
|
+
*
|
|
6
|
+
* @param text - The text to style.
|
|
7
|
+
* @returns The styled text.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* import { colors } from 'es-toolkit/server';
|
|
11
|
+
*
|
|
12
|
+
* console.log(colors.white('hello'));
|
|
13
|
+
*/
|
|
14
|
+
function white(text) {
|
|
15
|
+
return wrapAnsi("\x1B[37m", "\x1B[39m", text);
|
|
16
|
+
}
|
|
17
|
+
//#endregion
|
|
18
|
+
export { white };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
//#region src/server/colors/whiteBright.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Bright white foreground. Wraps text with ANSI codes.
|
|
4
|
+
*
|
|
5
|
+
* @param text - The text to style.
|
|
6
|
+
* @returns The styled text.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* import { colors } from 'es-toolkit/server';
|
|
10
|
+
*
|
|
11
|
+
* console.log(colors.whiteBright('hello'));
|
|
12
|
+
*/
|
|
13
|
+
declare function whiteBright(text: string): string;
|
|
14
|
+
//#endregion
|
|
15
|
+
export { whiteBright };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
//#region src/server/colors/whiteBright.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Bright white foreground. Wraps text with ANSI codes.
|
|
4
|
+
*
|
|
5
|
+
* @param text - The text to style.
|
|
6
|
+
* @returns The styled text.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* import { colors } from 'es-toolkit/server';
|
|
10
|
+
*
|
|
11
|
+
* console.log(colors.whiteBright('hello'));
|
|
12
|
+
*/
|
|
13
|
+
declare function whiteBright(text: string): string;
|
|
14
|
+
//#endregion
|
|
15
|
+
export { whiteBright };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
const require_wrapAnsi = require("./_internal/wrapAnsi.js");
|
|
2
|
+
//#region src/server/colors/whiteBright.ts
|
|
3
|
+
/**
|
|
4
|
+
* Bright white foreground. Wraps text with ANSI codes.
|
|
5
|
+
*
|
|
6
|
+
* @param text - The text to style.
|
|
7
|
+
* @returns The styled text.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* import { colors } from 'es-toolkit/server';
|
|
11
|
+
*
|
|
12
|
+
* console.log(colors.whiteBright('hello'));
|
|
13
|
+
*/
|
|
14
|
+
function whiteBright(text) {
|
|
15
|
+
return require_wrapAnsi.wrapAnsi("\x1B[97m", "\x1B[39m", text);
|
|
16
|
+
}
|
|
17
|
+
//#endregion
|
|
18
|
+
exports.whiteBright = whiteBright;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { wrapAnsi } from "./_internal/wrapAnsi.mjs";
|
|
2
|
+
//#region src/server/colors/whiteBright.ts
|
|
3
|
+
/**
|
|
4
|
+
* Bright white foreground. Wraps text with ANSI codes.
|
|
5
|
+
*
|
|
6
|
+
* @param text - The text to style.
|
|
7
|
+
* @returns The styled text.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* import { colors } from 'es-toolkit/server';
|
|
11
|
+
*
|
|
12
|
+
* console.log(colors.whiteBright('hello'));
|
|
13
|
+
*/
|
|
14
|
+
function whiteBright(text) {
|
|
15
|
+
return wrapAnsi("\x1B[97m", "\x1B[39m", text);
|
|
16
|
+
}
|
|
17
|
+
//#endregion
|
|
18
|
+
export { whiteBright };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
//#region src/server/colors/yellow.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Yellow foreground. Wraps text with ANSI codes.
|
|
4
|
+
*
|
|
5
|
+
* @param text - The text to style.
|
|
6
|
+
* @returns The styled text.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* import { colors } from 'es-toolkit/server';
|
|
10
|
+
*
|
|
11
|
+
* console.log(colors.yellow('hello'));
|
|
12
|
+
*/
|
|
13
|
+
declare function yellow(text: string): string;
|
|
14
|
+
//#endregion
|
|
15
|
+
export { yellow };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
//#region src/server/colors/yellow.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Yellow foreground. Wraps text with ANSI codes.
|
|
4
|
+
*
|
|
5
|
+
* @param text - The text to style.
|
|
6
|
+
* @returns The styled text.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* import { colors } from 'es-toolkit/server';
|
|
10
|
+
*
|
|
11
|
+
* console.log(colors.yellow('hello'));
|
|
12
|
+
*/
|
|
13
|
+
declare function yellow(text: string): string;
|
|
14
|
+
//#endregion
|
|
15
|
+
export { yellow };
|