aboutsummaryrefslogtreecommitdiff
path: root/node_modules/picocolors
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/picocolors')
-rw-r--r--node_modules/picocolors/LICENSE15
-rw-r--r--node_modules/picocolors/README.md21
-rw-r--r--node_modules/picocolors/package.json25
-rw-r--r--node_modules/picocolors/picocolors.browser.js4
-rw-r--r--node_modules/picocolors/picocolors.d.ts5
-rw-r--r--node_modules/picocolors/picocolors.js58
-rw-r--r--node_modules/picocolors/types.ts30
7 files changed, 158 insertions, 0 deletions
diff --git a/node_modules/picocolors/LICENSE b/node_modules/picocolors/LICENSE
new file mode 100644
index 0000000..496098c
--- /dev/null
+++ b/node_modules/picocolors/LICENSE
@@ -0,0 +1,15 @@
+ISC License
+
+Copyright (c) 2021 Alexey Raspopov, Kostiantyn Denysov, Anton Verinov
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
diff --git a/node_modules/picocolors/README.md b/node_modules/picocolors/README.md
new file mode 100644
index 0000000..8e47aa8
--- /dev/null
+++ b/node_modules/picocolors/README.md
@@ -0,0 +1,21 @@
+# picocolors
+
+The tiniest and the fastest library for terminal output formatting with ANSI colors.
+
+```javascript
+import pc from "picocolors"
+
+console.log(
+ pc.green(`How are ${pc.italic(`you`)} doing?`)
+)
+```
+
+- **No dependencies.**
+- **14 times** smaller and **2 times** faster than chalk.
+- Used by popular tools like PostCSS, SVGO, Stylelint, and Browserslist.
+- Node.js v6+ & browsers support. Support for both CJS and ESM projects.
+- TypeScript type declarations included.
+- [`NO_COLOR`](https://no-color.org/) friendly.
+
+## Docs
+Read **[full docs](https://github.com/alexeyraspopov/picocolors#readme)** on GitHub.
diff --git a/node_modules/picocolors/package.json b/node_modules/picocolors/package.json
new file mode 100644
index 0000000..85a12d5
--- /dev/null
+++ b/node_modules/picocolors/package.json
@@ -0,0 +1,25 @@
+{
+ "name": "picocolors",
+ "version": "1.0.0",
+ "main": "./picocolors.js",
+ "types": "./picocolors.d.ts",
+ "browser": {
+ "./picocolors.js": "./picocolors.browser.js"
+ },
+ "sideEffects": false,
+ "description": "The tiniest and the fastest library for terminal output formatting with ANSI colors",
+ "files": [
+ "picocolors.*",
+ "types.ts"
+ ],
+ "keywords": [
+ "terminal",
+ "colors",
+ "formatting",
+ "cli",
+ "console"
+ ],
+ "author": "Alexey Raspopov",
+ "repository": "alexeyraspopov/picocolors",
+ "license": "ISC"
+}
diff --git a/node_modules/picocolors/picocolors.browser.js b/node_modules/picocolors/picocolors.browser.js
new file mode 100644
index 0000000..5eb9fbe
--- /dev/null
+++ b/node_modules/picocolors/picocolors.browser.js
@@ -0,0 +1,4 @@
+var x=String;
+var create=function() {return {isColorSupported:false,reset:x,bold:x,dim:x,italic:x,underline:x,inverse:x,hidden:x,strikethrough:x,black:x,red:x,green:x,yellow:x,blue:x,magenta:x,cyan:x,white:x,gray:x,bgBlack:x,bgRed:x,bgGreen:x,bgYellow:x,bgBlue:x,bgMagenta:x,bgCyan:x,bgWhite:x}};
+module.exports=create();
+module.exports.createColors = create;
diff --git a/node_modules/picocolors/picocolors.d.ts b/node_modules/picocolors/picocolors.d.ts
new file mode 100644
index 0000000..94e146a
--- /dev/null
+++ b/node_modules/picocolors/picocolors.d.ts
@@ -0,0 +1,5 @@
+import { Colors } from "./types"
+
+declare const picocolors: Colors & { createColors: (enabled?: boolean) => Colors }
+
+export = picocolors
diff --git a/node_modules/picocolors/picocolors.js b/node_modules/picocolors/picocolors.js
new file mode 100644
index 0000000..fdb6304
--- /dev/null
+++ b/node_modules/picocolors/picocolors.js
@@ -0,0 +1,58 @@
+let tty = require("tty")
+
+let isColorSupported =
+ !("NO_COLOR" in process.env || process.argv.includes("--no-color")) &&
+ ("FORCE_COLOR" in process.env ||
+ process.argv.includes("--color") ||
+ process.platform === "win32" ||
+ (tty.isatty(1) && process.env.TERM !== "dumb") ||
+ "CI" in process.env)
+
+let formatter =
+ (open, close, replace = open) =>
+ input => {
+ let string = "" + input
+ let index = string.indexOf(close, open.length)
+ return ~index
+ ? open + replaceClose(string, close, replace, index) + close
+ : open + string + close
+ }
+
+let replaceClose = (string, close, replace, index) => {
+ let start = string.substring(0, index) + replace
+ let end = string.substring(index + close.length)
+ let nextIndex = end.indexOf(close)
+ return ~nextIndex ? start + replaceClose(end, close, replace, nextIndex) : start + end
+}
+
+let createColors = (enabled = isColorSupported) => ({
+ isColorSupported: enabled,
+ reset: enabled ? s => `\x1b[0m${s}\x1b[0m` : String,
+ bold: enabled ? formatter("\x1b[1m", "\x1b[22m", "\x1b[22m\x1b[1m") : String,
+ dim: enabled ? formatter("\x1b[2m", "\x1b[22m", "\x1b[22m\x1b[2m") : String,
+ italic: enabled ? formatter("\x1b[3m", "\x1b[23m") : String,
+ underline: enabled ? formatter("\x1b[4m", "\x1b[24m") : String,
+ inverse: enabled ? formatter("\x1b[7m", "\x1b[27m") : String,
+ hidden: enabled ? formatter("\x1b[8m", "\x1b[28m") : String,
+ strikethrough: enabled ? formatter("\x1b[9m", "\x1b[29m") : String,
+ black: enabled ? formatter("\x1b[30m", "\x1b[39m") : String,
+ red: enabled ? formatter("\x1b[31m", "\x1b[39m") : String,
+ green: enabled ? formatter("\x1b[32m", "\x1b[39m") : String,
+ yellow: enabled ? formatter("\x1b[33m", "\x1b[39m") : String,
+ blue: enabled ? formatter("\x1b[34m", "\x1b[39m") : String,
+ magenta: enabled ? formatter("\x1b[35m", "\x1b[39m") : String,
+ cyan: enabled ? formatter("\x1b[36m", "\x1b[39m") : String,
+ white: enabled ? formatter("\x1b[37m", "\x1b[39m") : String,
+ gray: enabled ? formatter("\x1b[90m", "\x1b[39m") : String,
+ bgBlack: enabled ? formatter("\x1b[40m", "\x1b[49m") : String,
+ bgRed: enabled ? formatter("\x1b[41m", "\x1b[49m") : String,
+ bgGreen: enabled ? formatter("\x1b[42m", "\x1b[49m") : String,
+ bgYellow: enabled ? formatter("\x1b[43m", "\x1b[49m") : String,
+ bgBlue: enabled ? formatter("\x1b[44m", "\x1b[49m") : String,
+ bgMagenta: enabled ? formatter("\x1b[45m", "\x1b[49m") : String,
+ bgCyan: enabled ? formatter("\x1b[46m", "\x1b[49m") : String,
+ bgWhite: enabled ? formatter("\x1b[47m", "\x1b[49m") : String,
+})
+
+module.exports = createColors()
+module.exports.createColors = createColors
diff --git a/node_modules/picocolors/types.ts b/node_modules/picocolors/types.ts
new file mode 100644
index 0000000..b4bacee
--- /dev/null
+++ b/node_modules/picocolors/types.ts
@@ -0,0 +1,30 @@
+export type Formatter = (input: string | number | null | undefined) => string
+
+export interface Colors {
+ isColorSupported: boolean
+ reset: Formatter
+ bold: Formatter
+ dim: Formatter
+ italic: Formatter
+ underline: Formatter
+ inverse: Formatter
+ hidden: Formatter
+ strikethrough: Formatter
+ black: Formatter
+ red: Formatter
+ green: Formatter
+ yellow: Formatter
+ blue: Formatter
+ magenta: Formatter
+ cyan: Formatter
+ white: Formatter
+ gray: Formatter
+ bgBlack: Formatter
+ bgRed: Formatter
+ bgGreen: Formatter
+ bgYellow: Formatter
+ bgBlue: Formatter
+ bgMagenta: Formatter
+ bgCyan: Formatter
+ bgWhite: Formatter
+}