@peteanderson/ansi 0.1.2 → 0.2.0
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/ansi.d.ts +1 -3
- package/dist/ansi.js +0 -3
- package/dist/index.d.ts +0 -8
- package/package.json +1 -1
- package/src/ansi.js +0 -4
- package/dist/caps.d.ts +0 -10
- package/dist/caps.js +0 -22
- package/src/caps.js +0 -27
package/dist/ansi.d.ts
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { colorDepth } from "./caps";
|
|
2
|
-
import { enabled } from "./caps";
|
|
3
1
|
import caret = require("./caret");
|
|
4
2
|
import erase = require("./erase");
|
|
5
3
|
import scroll = require("./scroll");
|
|
@@ -10,4 +8,4 @@ import { bg } from "./sgr";
|
|
|
10
8
|
import { strip } from "./strip";
|
|
11
9
|
import { sanitize } from "./strip";
|
|
12
10
|
import { slice } from "./strip";
|
|
13
|
-
export {
|
|
11
|
+
export { caret, erase, scroll, reset, style, fg, bg, strip, sanitize, slice };
|
package/dist/ansi.js
CHANGED
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
const { colorDepth, enabled } = require("./caps");
|
|
3
2
|
const caret = require("./caret");
|
|
4
3
|
const erase = require("./erase");
|
|
5
4
|
const scroll = require("./scroll");
|
|
6
5
|
const { bg, fg, reset, style } = require("./sgr");
|
|
7
6
|
const { sanitize, slice, strip } = require("./strip");
|
|
8
7
|
const ansi = {
|
|
9
|
-
colorDepth,
|
|
10
|
-
enabled,
|
|
11
8
|
caret,
|
|
12
9
|
erase,
|
|
13
10
|
scroll,
|
package/dist/index.d.ts
CHANGED
package/package.json
CHANGED
package/src/ansi.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
const {colorDepth, enabled} = require("./caps");
|
|
4
3
|
const caret = require("./caret");
|
|
5
4
|
const erase = require("./erase");
|
|
6
5
|
const scroll = require("./scroll");
|
|
@@ -8,9 +7,6 @@ const {bg, fg, reset, style} = require("./sgr");
|
|
|
8
7
|
const {sanitize, slice, strip} = require("./strip");
|
|
9
8
|
|
|
10
9
|
const ansi = {
|
|
11
|
-
colorDepth,
|
|
12
|
-
enabled,
|
|
13
|
-
|
|
14
10
|
caret,
|
|
15
11
|
erase,
|
|
16
12
|
scroll,
|
package/dist/caps.d.ts
DELETED
package/dist/caps.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/** @type {(stream: NodeJS.WriteStream) => number} */
|
|
3
|
-
const getColorDepth = (stream) => stream.isTTY ?
|
|
4
|
-
stream.getColorDepth() :
|
|
5
|
-
process.env.FORCE_COLOR !== undefined ?
|
|
6
|
-
["1", "true", ""].includes(process.env.FORCE_COLOR) ?
|
|
7
|
-
4 :
|
|
8
|
-
process.env.FORCE_COLOR === "2" ?
|
|
9
|
-
8 :
|
|
10
|
-
process.env.FORCE_COLOR === "3" ?
|
|
11
|
-
24 :
|
|
12
|
-
1 :
|
|
13
|
-
1;
|
|
14
|
-
const colorDepth = {
|
|
15
|
-
stdout: getColorDepth(process.stdout),
|
|
16
|
-
stderr: getColorDepth(process.stderr),
|
|
17
|
-
};
|
|
18
|
-
const enabled = {
|
|
19
|
-
stdout: colorDepth.stdout > 1,
|
|
20
|
-
stderr: colorDepth.stderr > 1,
|
|
21
|
-
};
|
|
22
|
-
module.exports = { colorDepth, enabled };
|
package/src/caps.js
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
/** @type {(stream: NodeJS.WriteStream) => number} */
|
|
4
|
-
const getColorDepth = (stream) =>
|
|
5
|
-
stream.isTTY ?
|
|
6
|
-
stream.getColorDepth() :
|
|
7
|
-
process.env.FORCE_COLOR !== undefined ?
|
|
8
|
-
["1", "true", ""].includes(process.env.FORCE_COLOR) ?
|
|
9
|
-
4 :
|
|
10
|
-
process.env.FORCE_COLOR === "2" ?
|
|
11
|
-
8 :
|
|
12
|
-
process.env.FORCE_COLOR === "3" ?
|
|
13
|
-
24 :
|
|
14
|
-
1 :
|
|
15
|
-
1;
|
|
16
|
-
|
|
17
|
-
const colorDepth = {
|
|
18
|
-
stdout: getColorDepth(process.stdout),
|
|
19
|
-
stderr: getColorDepth(process.stderr),
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
const enabled = {
|
|
23
|
-
stdout: colorDepth.stdout > 1,
|
|
24
|
-
stderr: colorDepth.stderr > 1,
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
module.exports = {colorDepth, enabled};
|