mirror of
https://github.com/flynx/colors.js.git
synced 2025-10-28 18:40:09 +00:00
parent
dc82cc01d0
commit
b674514f1b
2
index.d.ts
vendored
2
index.d.ts
vendored
@ -46,6 +46,8 @@ export interface Color {
|
||||
zalgo: Color;
|
||||
}
|
||||
|
||||
export function enable(): void;
|
||||
export function disable(): void;
|
||||
export function setTheme(theme: any): void;
|
||||
|
||||
export let enabled: boolean;
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
|
||||
The MIT License (MIT)
|
||||
|
||||
Original Library
|
||||
Original Library
|
||||
- Copyright (c) Marak Squires
|
||||
|
||||
Additional functionality
|
||||
@ -42,6 +42,14 @@ if (typeof colors.enabled === "undefined") {
|
||||
colors.enabled = colors.supportsColor() !== false;
|
||||
}
|
||||
|
||||
colors.enable = function () {
|
||||
colors.enabled = true;
|
||||
};
|
||||
|
||||
colors.disable = function () {
|
||||
colors.enabled = false;
|
||||
};
|
||||
|
||||
colors.stripColors = colors.strip = function(str){
|
||||
return ("" + str).replace(/\x1B\[\d+m/g, '');
|
||||
};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user