This commit is contained in:
Yamozha
2021-04-02 02:24:13 +03:00
parent c23950b545
commit 7256d79e2c
31493 changed files with 3036630 additions and 0 deletions

10
node_modules/ansi-fragments/build/fragments/Color.d.ts generated vendored Normal file
View File

@ -0,0 +1,10 @@
import IFragment from './IFragment';
export declare type AnsiColor = 'black' | 'red' | 'green' | 'yellow' | 'blue' | 'magenta' | 'cyan' | 'white' | 'brightBlack' | 'brightRed' | 'brightGreen' | 'brightYellow' | 'brightBlue' | 'brightMagenta' | 'brightCyan' | 'brightWhite' | 'gray' | 'bgBlack' | 'bgRed' | 'bgGreen' | 'bgYellow' | 'bgBlue' | 'bgMagenta' | 'bgCyan' | 'bgWhite' | 'bgBrightBlack' | 'bgBrightRed' | 'bgBrightGreen' | 'bgBrightYellow' | 'bgBrightBlue' | 'bgBrightMagenta' | 'bgBrightCyan' | 'bgBrightWhite' | 'none';
export declare function color(ansiColor: AnsiColor, ...children: Array<string | IFragment>): Color;
export declare class Color implements IFragment {
private readonly color;
private readonly children;
constructor(ansiColor: AnsiColor, children: Array<string | IFragment>);
build(): string;
}
//# sourceMappingURL=Color.d.ts.map

View File

@ -0,0 +1 @@
{"version":3,"file":"Color.d.ts","sourceRoot":"","sources":["../../src/fragments/Color.ts"],"names":[],"mappings":"AACA,OAAO,SAAS,MAAM,aAAa,CAAC;AAGpC,oBAAY,SAAS,GACjB,OAAO,GACP,KAAK,GACL,OAAO,GACP,QAAQ,GACR,MAAM,GACN,SAAS,GACT,MAAM,GACN,OAAO,GACP,aAAa,GACb,WAAW,GACX,aAAa,GACb,cAAc,GACd,YAAY,GACZ,eAAe,GACf,YAAY,GACZ,aAAa,GACb,MAAM,GACN,SAAS,GACT,OAAO,GACP,SAAS,GACT,UAAU,GACV,QAAQ,GACR,WAAW,GACX,QAAQ,GACR,SAAS,GACT,eAAe,GACf,aAAa,GACb,eAAe,GACf,gBAAgB,GAChB,cAAc,GACd,iBAAiB,GACjB,cAAc,GACd,eAAe,GACf,MAAM,CAAC;AAEX,wBAAgB,KAAK,CACnB,SAAS,EAAE,SAAS,EACpB,GAAG,QAAQ,EAAE,KAAK,CAAC,MAAM,GAAG,SAAS,CAAC,GACrC,KAAK,CAEP;AAED,qBAAa,KAAM,YAAW,SAAS;IACrC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAY;IAClC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAA4B;gBAEzC,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,KAAK,CAAC,MAAM,GAAG,SAAS,CAAC;IAKrE,KAAK,IAAI,MAAM;CAYhB"}

30
node_modules/ansi-fragments/build/fragments/Color.js generated vendored Normal file
View File

@ -0,0 +1,30 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const colorette_1 = __importDefault(require("colorette"));
const utils_1 = require("./utils");
function color(ansiColor, ...children) {
return new Color(ansiColor, utils_1.toArray(children));
}
exports.color = color;
class Color {
constructor(ansiColor, children) {
this.color = ansiColor;
this.children = children;
}
build() {
const children = utils_1.buildChildren(this.children);
if (this.color === 'none') {
return children;
}
else if (this.color in colorette_1.default) {
// tslint:disable-next-line: no-unsafe-any no-any
return colorette_1.default[this.color](children);
}
throw new Error(`Color ${this.color} not found`);
}
}
exports.Color = Color;
//# sourceMappingURL=Color.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"Color.js","sourceRoot":"","sources":["../../src/fragments/Color.ts"],"names":[],"mappings":";;;;;AAAA,0DAAkC;AAElC,mCAAiD;AAsCjD,SAAgB,KAAK,CACnB,SAAoB,EACpB,GAAG,QAAmC;IAEtC,OAAO,IAAI,KAAK,CAAC,SAAS,EAAE,eAAO,CAAC,QAAQ,CAAC,CAAC,CAAC;AACjD,CAAC;AALD,sBAKC;AAED,MAAa,KAAK;IAIhB,YAAY,SAAoB,EAAE,QAAmC;QACnE,IAAI,CAAC,KAAK,GAAG,SAAS,CAAC;QACvB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;IAED,KAAK;QACH,MAAM,QAAQ,GAAG,qBAAa,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAE9C,IAAI,IAAI,CAAC,KAAK,KAAK,MAAM,EAAE;YACzB,OAAO,QAAQ,CAAC;SACjB;aAAM,IAAI,IAAI,CAAC,KAAK,IAAI,mBAAS,EAAE;YAClC,iDAAiD;YACjD,OAAQ,mBAAiB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,CAAC;SACjD;QAED,MAAM,IAAI,KAAK,CAAC,SAAS,IAAI,CAAC,KAAK,YAAY,CAAC,CAAC;IACnD,CAAC;CACF;AArBD,sBAqBC"}

View File

@ -0,0 +1,8 @@
import IFragment from './IFragment';
export declare function container(...children: Array<string | IFragment>): Container;
export declare class Container implements IFragment {
private readonly children;
constructor(children: Array<string | IFragment>);
build(): string;
}
//# sourceMappingURL=Container.d.ts.map

View File

@ -0,0 +1 @@
{"version":3,"file":"Container.d.ts","sourceRoot":"","sources":["../../src/fragments/Container.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,aAAa,CAAC;AAGpC,wBAAgB,SAAS,CAAC,GAAG,QAAQ,EAAE,KAAK,CAAC,MAAM,GAAG,SAAS,CAAC,GAAG,SAAS,CAE3E;AAED,qBAAa,SAAU,YAAW,SAAS;IACzC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAA4B;gBAEzC,QAAQ,EAAE,KAAK,CAAC,MAAM,GAAG,SAAS,CAAC;IAI/C,KAAK,IAAI,MAAM;CAGhB"}

View File

@ -0,0 +1,17 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const utils_1 = require("./utils");
function container(...children) {
return new Container(children);
}
exports.container = container;
class Container {
constructor(children) {
this.children = children;
}
build() {
return utils_1.buildChildren(this.children);
}
}
exports.Container = Container;
//# sourceMappingURL=Container.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"Container.js","sourceRoot":"","sources":["../../src/fragments/Container.ts"],"names":[],"mappings":";;AACA,mCAAwC;AAExC,SAAgB,SAAS,CAAC,GAAG,QAAmC;IAC9D,OAAO,IAAI,SAAS,CAAC,QAAQ,CAAC,CAAC;AACjC,CAAC;AAFD,8BAEC;AAED,MAAa,SAAS;IAGpB,YAAY,QAAmC;QAC7C,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;IAED,KAAK;QACH,OAAO,qBAAa,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACtC,CAAC;CACF;AAVD,8BAUC"}

12
node_modules/ansi-fragments/build/fragments/Fixed.d.ts generated vendored Normal file
View File

@ -0,0 +1,12 @@
import IFragment from './IFragment';
declare type Bias = 'start' | 'end';
export declare function fixed(value: number, bias: Bias, ...children: Array<string | IFragment>): Fixed;
export declare class Fixed implements IFragment {
private readonly width;
private readonly bias;
private readonly children;
constructor(width: number, bias: Bias, children: Array<string | IFragment>);
build(): string;
}
export {};
//# sourceMappingURL=Fixed.d.ts.map

View File

@ -0,0 +1 @@
{"version":3,"file":"Fixed.d.ts","sourceRoot":"","sources":["../../src/fragments/Fixed.ts"],"names":[],"mappings":"AAEA,OAAO,SAAS,MAAM,aAAa,CAAC;AAGpC,aAAK,IAAI,GAAG,OAAO,GAAG,KAAK,CAAC;AAE5B,wBAAgB,KAAK,CACnB,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,IAAI,EACV,GAAG,QAAQ,EAAE,KAAK,CAAC,MAAM,GAAG,SAAS,CAAC,GACrC,KAAK,CAEP;AAED,qBAAa,KAAM,YAAW,SAAS;IACrC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAS;IAC/B,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAO;IAC5B,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAA4B;gBAEzC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,CAAC,MAAM,GAAG,SAAS,CAAC;IAM1E,KAAK,IAAI,MAAM;CAgBhB"}

31
node_modules/ansi-fragments/build/fragments/Fixed.js generated vendored Normal file
View File

@ -0,0 +1,31 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const slice_ansi_1 = __importDefault(require("slice-ansi"));
const strip_ansi_1 = __importDefault(require("strip-ansi"));
const utils_1 = require("./utils");
function fixed(value, bias, ...children) {
return new Fixed(value, bias, children);
}
exports.fixed = fixed;
class Fixed {
constructor(width, bias, children) {
this.width = width;
this.bias = bias;
this.children = children;
}
build() {
const children = utils_1.buildChildren(this.children);
const contentLength = strip_ansi_1.default(children).length;
if (contentLength <= this.width) {
return `${' '.repeat(this.bias === 'start' ? this.width - contentLength : 0)}${contentLength}${' '.repeat(this.bias === 'end' ? this.width - contentLength : 0)}`;
}
const start = this.bias === 'end' ? 0 : contentLength - this.width;
const end = this.bias === 'end' ? this.width : contentLength;
return slice_ansi_1.default(children, start, end);
}
}
exports.Fixed = Fixed;
//# sourceMappingURL=Fixed.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"Fixed.js","sourceRoot":"","sources":["../../src/fragments/Fixed.ts"],"names":[],"mappings":";;;;;AAAA,4DAAmC;AACnC,4DAAmC;AAEnC,mCAAwC;AAIxC,SAAgB,KAAK,CACnB,KAAa,EACb,IAAU,EACV,GAAG,QAAmC;IAEtC,OAAO,IAAI,KAAK,CAAC,KAAK,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAC;AAC1C,CAAC;AAND,sBAMC;AAED,MAAa,KAAK;IAKhB,YAAY,KAAa,EAAE,IAAU,EAAE,QAAmC;QACxE,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;IAED,KAAK;QACH,MAAM,QAAQ,GAAG,qBAAa,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAC9C,MAAM,aAAa,GAAG,oBAAS,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC;QAEjD,IAAI,aAAa,IAAI,IAAI,CAAC,KAAK,EAAE;YAC/B,OAAO,GAAG,GAAG,CAAC,MAAM,CAClB,IAAI,CAAC,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,GAAG,aAAa,CAAC,CAAC,CAAC,CAAC,CACvD,GAAG,aAAa,GAAG,GAAG,CAAC,MAAM,CAC5B,IAAI,CAAC,IAAI,KAAK,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,GAAG,aAAa,CAAC,CAAC,CAAC,CAAC,CACrD,EAAE,CAAC;SACL;QAED,MAAM,KAAK,GAAG,IAAI,CAAC,IAAI,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,aAAa,GAAG,IAAI,CAAC,KAAK,CAAC;QACnE,MAAM,GAAG,GAAG,IAAI,CAAC,IAAI,KAAK,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,aAAa,CAAC;QAC7D,OAAO,oBAAS,CAAC,QAAQ,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;IACzC,CAAC;CACF;AA3BD,sBA2BC"}

View File

@ -0,0 +1,4 @@
export default interface IFragment {
build(): string;
}
//# sourceMappingURL=IFragment.d.ts.map

View File

@ -0,0 +1 @@
{"version":3,"file":"IFragment.d.ts","sourceRoot":"","sources":["../../src/fragments/IFragment.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,WAAW,SAAS;IAChC,KAAK,IAAI,MAAM,CAAC;CACjB"}

View File

@ -0,0 +1,3 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=IFragment.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"IFragment.js","sourceRoot":"","sources":["../../src/fragments/IFragment.ts"],"names":[],"mappings":""}

View File

@ -0,0 +1,12 @@
import IFragment from './IFragment';
export declare type ConditionValue = boolean | string | number | null | undefined;
export declare type Condition = ConditionValue | (() => ConditionValue);
export declare function ifElse(condition: Condition, ifTrueFragment: string | IFragment, elseFragment?: string | IFragment): IfElse;
export declare class IfElse implements IFragment {
private readonly ifTrueFragment;
private readonly elseFragment?;
private readonly condition;
constructor(condition: Condition, ifTrueFragment: string | IFragment, elseFragment?: string | IFragment);
build(): string;
}
//# sourceMappingURL=IfElse.d.ts.map

View File

@ -0,0 +1 @@
{"version":3,"file":"IfElse.d.ts","sourceRoot":"","sources":["../../src/fragments/IfElse.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,aAAa,CAAC;AAGpC,oBAAY,cAAc,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;AAC1E,oBAAY,SAAS,GAAG,cAAc,GAAG,CAAC,MAAM,cAAc,CAAC,CAAC;AAEhE,wBAAgB,MAAM,CACpB,SAAS,EAAE,SAAS,EACpB,cAAc,EAAE,MAAM,GAAG,SAAS,EAClC,YAAY,CAAC,EAAE,MAAM,GAAG,SAAS,GAChC,MAAM,CAER;AAED,qBAAa,MAAO,YAAW,SAAS;IACtC,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAqB;IACpD,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAqB;IACnD,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAY;gBAGpC,SAAS,EAAE,SAAS,EACpB,cAAc,EAAE,MAAM,GAAG,SAAS,EAClC,YAAY,CAAC,EAAE,MAAM,GAAG,SAAS;IAOnC,KAAK,IAAI,MAAM;CAShB"}

22
node_modules/ansi-fragments/build/fragments/IfElse.js generated vendored Normal file
View File

@ -0,0 +1,22 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const utils_1 = require("./utils");
function ifElse(condition, ifTrueFragment, elseFragment) {
return new IfElse(condition, ifTrueFragment, elseFragment);
}
exports.ifElse = ifElse;
class IfElse {
constructor(condition, ifTrueFragment, elseFragment) {
this.condition = condition;
this.ifTrueFragment = ifTrueFragment;
this.elseFragment = elseFragment;
}
build() {
const value = Boolean(typeof this.condition === 'function' ? this.condition() : this.condition);
return utils_1.buildChildren([
value ? this.ifTrueFragment : this.elseFragment || '',
]);
}
}
exports.IfElse = IfElse;
//# sourceMappingURL=IfElse.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"IfElse.js","sourceRoot":"","sources":["../../src/fragments/IfElse.ts"],"names":[],"mappings":";;AACA,mCAAwC;AAKxC,SAAgB,MAAM,CACpB,SAAoB,EACpB,cAAkC,EAClC,YAAiC;IAEjC,OAAO,IAAI,MAAM,CAAC,SAAS,EAAE,cAAc,EAAE,YAAY,CAAC,CAAC;AAC7D,CAAC;AAND,wBAMC;AAED,MAAa,MAAM;IAKjB,YACE,SAAoB,EACpB,cAAkC,EAClC,YAAiC;QAEjC,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,cAAc,GAAG,cAAc,CAAC;QACrC,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;IACnC,CAAC;IAED,KAAK;QACH,MAAM,KAAK,GAAG,OAAO,CACnB,OAAO,IAAI,CAAC,SAAS,KAAK,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CACzE,CAAC;QAEF,OAAO,qBAAa,CAAC;YACnB,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,IAAI,CAAC,YAAY,IAAI,EAAE;SACtD,CAAC,CAAC;IACL,CAAC;CACF;AAxBD,wBAwBC"}

View File

@ -0,0 +1,10 @@
import IFragment from './IFragment';
export declare type AnsiModifier = 'dim' | 'bold' | 'hidden' | 'italic' | 'underline' | 'strikethrough' | 'none';
export declare function modifier(ansiModifier: AnsiModifier, ...children: Array<string | IFragment>): Modifier;
export declare class Modifier implements IFragment {
private readonly modifier;
private readonly children;
constructor(ansiModifier: AnsiModifier, children: Array<string | IFragment>);
build(): string;
}
//# sourceMappingURL=Modifier.d.ts.map

View File

@ -0,0 +1 @@
{"version":3,"file":"Modifier.d.ts","sourceRoot":"","sources":["../../src/fragments/Modifier.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,aAAa,CAAC;AAIpC,oBAAY,YAAY,GACpB,KAAK,GACL,MAAM,GACN,QAAQ,GACR,QAAQ,GACR,WAAW,GACX,eAAe,GACf,MAAM,CAAC;AAEX,wBAAgB,QAAQ,CACtB,YAAY,EAAE,YAAY,EAC1B,GAAG,QAAQ,EAAE,KAAK,CAAC,MAAM,GAAG,SAAS,CAAC,GACrC,QAAQ,CAEV;AAED,qBAAa,QAAS,YAAW,SAAS;IACxC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAe;IACxC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAA4B;gBAEzC,YAAY,EAAE,YAAY,EAAE,QAAQ,EAAE,KAAK,CAAC,MAAM,GAAG,SAAS,CAAC;IAK3E,KAAK,IAAI,MAAM;CAWhB"}

View File

@ -0,0 +1,30 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const colorette_1 = __importDefault(require("colorette"));
const utils_1 = require("./utils");
function modifier(ansiModifier, ...children) {
return new Modifier(ansiModifier, utils_1.toArray(children));
}
exports.modifier = modifier;
class Modifier {
constructor(ansiModifier, children) {
this.modifier = ansiModifier;
this.children = children;
}
build() {
const children = utils_1.buildChildren(this.children);
if (this.modifier === 'none') {
return children;
}
else if (this.modifier in colorette_1.default) {
// tslint:disable-next-line: no-unsafe-any no-any
return colorette_1.default[this.modifier](children);
}
throw new Error(`Modifier ${this.modifier} not found`);
}
}
exports.Modifier = Modifier;
//# sourceMappingURL=Modifier.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"Modifier.js","sourceRoot":"","sources":["../../src/fragments/Modifier.ts"],"names":[],"mappings":";;;;;AACA,0DAAkC;AAClC,mCAAiD;AAWjD,SAAgB,QAAQ,CACtB,YAA0B,EAC1B,GAAG,QAAmC;IAEtC,OAAO,IAAI,QAAQ,CAAC,YAAY,EAAE,eAAO,CAAC,QAAQ,CAAC,CAAC,CAAC;AACvD,CAAC;AALD,4BAKC;AAED,MAAa,QAAQ;IAInB,YAAY,YAA0B,EAAE,QAAmC;QACzE,IAAI,CAAC,QAAQ,GAAG,YAAY,CAAC;QAC7B,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;IAED,KAAK;QACH,MAAM,QAAQ,GAAG,qBAAa,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAC9C,IAAI,IAAI,CAAC,QAAQ,KAAK,MAAM,EAAE;YAC5B,OAAO,QAAQ,CAAC;SACjB;aAAM,IAAI,IAAI,CAAC,QAAQ,IAAI,mBAAS,EAAE;YACrC,iDAAiD;YACjD,OAAQ,mBAAiB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,CAAC;SACpD;QAED,MAAM,IAAI,KAAK,CAAC,YAAY,IAAI,CAAC,QAAQ,YAAY,CAAC,CAAC;IACzD,CAAC;CACF;AApBD,4BAoBC"}

9
node_modules/ansi-fragments/build/fragments/Pad.d.ts generated vendored Normal file
View File

@ -0,0 +1,9 @@
import IFragment from './IFragment';
export declare function pad(count: number, separator?: string): Pad;
export declare class Pad implements IFragment {
private readonly count;
private readonly separator;
constructor(count: number, separator?: string);
build(): string;
}
//# sourceMappingURL=Pad.d.ts.map

View File

@ -0,0 +1 @@
{"version":3,"file":"Pad.d.ts","sourceRoot":"","sources":["../../src/fragments/Pad.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,aAAa,CAAC;AAEpC,wBAAgB,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,GAAG,CAE1D;AAED,qBAAa,GAAI,YAAW,SAAS;IACnC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAS;IAC/B,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;gBAEvB,KAAK,EAAE,MAAM,EAAE,SAAS,GAAE,MAAY;IAKlD,KAAK,IAAI,MAAM;CAGhB"}

17
node_modules/ansi-fragments/build/fragments/Pad.js generated vendored Normal file
View File

@ -0,0 +1,17 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
function pad(count, separator) {
return new Pad(count, separator);
}
exports.pad = pad;
class Pad {
constructor(count, separator = ' ') {
this.count = count;
this.separator = separator;
}
build() {
return this.separator.repeat(this.count);
}
}
exports.Pad = Pad;
//# sourceMappingURL=Pad.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"Pad.js","sourceRoot":"","sources":["../../src/fragments/Pad.ts"],"names":[],"mappings":";;AAEA,SAAgB,GAAG,CAAC,KAAa,EAAE,SAAkB;IACnD,OAAO,IAAI,GAAG,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;AACnC,CAAC;AAFD,kBAEC;AAED,MAAa,GAAG;IAId,YAAY,KAAa,EAAE,YAAoB,GAAG;QAChD,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;IAC7B,CAAC;IAED,KAAK;QACH,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC3C,CAAC;CACF;AAZD,kBAYC"}

View File

@ -0,0 +1,2 @@
export {};
//# sourceMappingURL=fragments.spec.d.ts.map

View File

@ -0,0 +1 @@
{"version":3,"file":"fragments.spec.d.ts","sourceRoot":"","sources":["../../../src/fragments/__tests__/fragments.spec.ts"],"names":[],"mappings":""}

View File

@ -0,0 +1,30 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const Color_1 = require("../Color");
const Modifier_1 = require("../Modifier");
const Container_1 = require("../Container");
const Pad_1 = require("../Pad");
const Fixed_1 = require("../Fixed");
const colorette_1 = __importDefault(require("colorette"));
const IfElse_1 = require("../IfElse");
colorette_1.default.options.enabled = true;
test('should build fragments to string', () => {
const tree = Container_1.container(Color_1.color('red', Color_1.color('bgBlack', Color_1.color('none', 'Hello', Pad_1.pad(1), 'World'))), Pad_1.pad(2, '|'), Modifier_1.modifier('bold', Color_1.color('white', 'Something')), Pad_1.pad(1), Fixed_1.fixed(4, 'end', 'This', 'will', Color_1.color('blue', 'be trimmed')), Pad_1.pad(1), Fixed_1.fixed(10, 'start', Color_1.color('blue', 'nothing is awesome')));
const text = tree.build();
const expected = `${colorette_1.default.red(colorette_1.default.bgBlack('Hello World'))}||${colorette_1.default.bold(colorette_1.default.white('Something'))} This ${colorette_1.default.blue('is awesome')}`;
expect(JSON.stringify(text)).toEqual(JSON.stringify(expected));
});
test('ifElse fragment should render correct fragmnent', () => {
expect(IfElse_1.ifElse(true, 'Hello', 'Bye').build()).toEqual('Hello');
expect(IfElse_1.ifElse(1, 'Hello', 'Bye').build()).toEqual('Hello');
expect(IfElse_1.ifElse(undefined, 'Hello', 'Bye').build()).toEqual('Bye');
// tslint:disable-next-line: no-null-keyword
expect(IfElse_1.ifElse(null, 'Hello', 'Bye').build()).toEqual('Bye');
expect(IfElse_1.ifElse(true, 'Hello').build()).toEqual('Hello');
expect(IfElse_1.ifElse(false, 'Hello').build()).toEqual('');
expect(IfElse_1.ifElse(() => true, 'Hello', 'Bye').build()).toEqual('Hello');
});
//# sourceMappingURL=fragments.spec.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"fragments.spec.js","sourceRoot":"","sources":["../../../src/fragments/__tests__/fragments.spec.ts"],"names":[],"mappings":";;;;;AAAA,oCAAiC;AACjC,0CAAuC;AACvC,4CAAyC;AACzC,gCAA6B;AAC7B,oCAAiC;AACjC,0DAAkC;AAClC,sCAAmC;AAEnC,mBAAS,CAAC,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC;AAEjC,IAAI,CAAC,kCAAkC,EAAE,GAAG,EAAE;IAC5C,MAAM,IAAI,GAAG,qBAAS,CACpB,aAAK,CAAC,KAAK,EAAE,aAAK,CAAC,SAAS,EAAE,aAAK,CAAC,MAAM,EAAE,OAAO,EAAE,SAAG,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,EACvE,SAAG,CAAC,CAAC,EAAE,GAAG,CAAC,EACX,mBAAQ,CAAC,MAAM,EAAE,aAAK,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC,EAC7C,SAAG,CAAC,CAAC,CAAC,EACN,aAAK,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,aAAK,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC,EAC5D,SAAG,CAAC,CAAC,CAAC,EACN,aAAK,CAAC,EAAE,EAAE,OAAO,EAAE,aAAK,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAAC,CACxD,CAAC;IAEF,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,EAAE,CAAC;IAC1B,MAAM,QAAQ,GAAG,GAAG,mBAAS,CAAC,GAAG,CAC/B,mBAAS,CAAC,OAAO,CAAC,aAAa,CAAC,CACjC,KAAK,mBAAS,CAAC,IAAI,CAAC,mBAAS,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,SAAS,mBAAS,CAAC,IAAI,CACvE,YAAY,CACb,EAAE,CAAC;IACJ,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC;AACjE,CAAC,CAAC,CAAC;AAEH,IAAI,CAAC,iDAAiD,EAAE,GAAG,EAAE;IAC3D,MAAM,CAAC,eAAM,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IAC9D,MAAM,CAAC,eAAM,CAAC,CAAC,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IAC3D,MAAM,CAAC,eAAM,CAAC,SAAS,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IACjE,4CAA4C;IAC5C,MAAM,CAAC,eAAM,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IAC5D,MAAM,CAAC,eAAM,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IACvD,MAAM,CAAC,eAAM,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IACnD,MAAM,CAAC,eAAM,CAAC,GAAG,EAAE,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;AACtE,CAAC,CAAC,CAAC"}

View File

@ -0,0 +1,4 @@
import IFragment from './IFragment';
export declare function buildChildren(children: Array<string | IFragment>): string;
export declare function toArray<T>(value: T | T[]): T[];
//# sourceMappingURL=utils.d.ts.map

View File

@ -0,0 +1 @@
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/fragments/utils.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,aAAa,CAAC;AAEpC,wBAAgB,aAAa,CAAC,QAAQ,EAAE,KAAK,CAAC,MAAM,GAAG,SAAS,CAAC,GAAG,MAAM,CAMzE;AAED,wBAAgB,OAAO,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC,EAAE,CAE9C"}

13
node_modules/ansi-fragments/build/fragments/utils.js generated vendored Normal file
View File

@ -0,0 +1,13 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
function buildChildren(children) {
return children
.map((child) => typeof child === 'string' ? child : child.build())
.join('');
}
exports.buildChildren = buildChildren;
function toArray(value) {
return Array.isArray(value) ? value : [value];
}
exports.toArray = toArray;
//# sourceMappingURL=utils.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/fragments/utils.ts"],"names":[],"mappings":";;AAEA,SAAgB,aAAa,CAAC,QAAmC;IAC/D,OAAO,QAAQ;SACZ,GAAG,CAAC,CAAC,KAAyB,EAAE,EAAE,CACjC,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,EAAE,CAClD;SACA,IAAI,CAAC,EAAE,CAAC,CAAC;AACd,CAAC;AAND,sCAMC;AAED,SAAgB,OAAO,CAAI,KAAc;IACvC,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;AAChD,CAAC;AAFD,0BAEC"}