@pilotlab/lux-debug
Version:
A luxurious user experience framework, developed by your friends at Pilot.
243 lines • 8.55 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var LogFormat = (function () {
function LogFormat() {
this._codesStart = "\u001B[";
this._codes = '';
this._codesEnd = 'm';
this._valueEnd = "\u001B[m";
}
LogFormat.prototype.value = function (text) {
var codes = this._codes;
this._codes = '';
return "" + this._codesStart + codes + this._codesEnd + text + this._valueEnd;
};
LogFormat.prototype._setCode = function (code) {
if (this._codes !== '')
this._codes += ';';
this._codes += code;
return this;
};
Object.defineProperty(LogFormat.prototype, "reset", {
get: function () {
this._codes = '';
return this;
},
enumerable: true,
configurable: true
});
Object.defineProperty(LogFormat.prototype, "bold", {
get: function () { return this._setCode('1'); },
enumerable: true,
configurable: true
});
Object.defineProperty(LogFormat.prototype, "dim", {
get: function () { return this._setCode('2'); },
enumerable: true,
configurable: true
});
Object.defineProperty(LogFormat.prototype, "italic", {
get: function () { return this._setCode('3'); },
enumerable: true,
configurable: true
});
Object.defineProperty(LogFormat.prototype, "underline", {
get: function () { return this._setCode('4'); },
enumerable: true,
configurable: true
});
Object.defineProperty(LogFormat.prototype, "inverse", {
get: function () { return this._setCode('7'); },
enumerable: true,
configurable: true
});
Object.defineProperty(LogFormat.prototype, "hidden", {
get: function () { return this._setCode('8'); },
enumerable: true,
configurable: true
});
Object.defineProperty(LogFormat.prototype, "strikethrough", {
get: function () { return this._setCode('9'); },
enumerable: true,
configurable: true
});
Object.defineProperty(LogFormat.prototype, "visible", {
get: function () { return this; },
enumerable: true,
configurable: true
});
Object.defineProperty(LogFormat.prototype, "black", {
get: function () { return this._setCode('30'); },
enumerable: true,
configurable: true
});
Object.defineProperty(LogFormat.prototype, "red", {
get: function () { return this._setCode('31'); },
enumerable: true,
configurable: true
});
Object.defineProperty(LogFormat.prototype, "green", {
get: function () { return this._setCode('32'); },
enumerable: true,
configurable: true
});
Object.defineProperty(LogFormat.prototype, "yellow", {
get: function () { return this._setCode('33'); },
enumerable: true,
configurable: true
});
Object.defineProperty(LogFormat.prototype, "blue", {
get: function () { return this._setCode('34'); },
enumerable: true,
configurable: true
});
Object.defineProperty(LogFormat.prototype, "magenta", {
get: function () { return this._setCode('35'); },
enumerable: true,
configurable: true
});
Object.defineProperty(LogFormat.prototype, "cyan", {
get: function () { return this._setCode('36'); },
enumerable: true,
configurable: true
});
Object.defineProperty(LogFormat.prototype, "white", {
get: function () { return this._setCode('37'); },
enumerable: true,
configurable: true
});
Object.defineProperty(LogFormat.prototype, "gray", {
get: function () { return this._setCode('90'); },
enumerable: true,
configurable: true
});
Object.defineProperty(LogFormat.prototype, "blackBright", {
get: function () { return this._setCode('90'); },
enumerable: true,
configurable: true
});
Object.defineProperty(LogFormat.prototype, "redBright", {
get: function () { return this._setCode('91'); },
enumerable: true,
configurable: true
});
Object.defineProperty(LogFormat.prototype, "greenBright", {
get: function () { return this._setCode('92'); },
enumerable: true,
configurable: true
});
Object.defineProperty(LogFormat.prototype, "yellowBright", {
get: function () { return this._setCode('93'); },
enumerable: true,
configurable: true
});
Object.defineProperty(LogFormat.prototype, "blueBright", {
get: function () { return this._setCode('94'); },
enumerable: true,
configurable: true
});
Object.defineProperty(LogFormat.prototype, "magentaBright", {
get: function () { return this._setCode('95'); },
enumerable: true,
configurable: true
});
Object.defineProperty(LogFormat.prototype, "cyanBright", {
get: function () { return this._setCode('96'); },
enumerable: true,
configurable: true
});
Object.defineProperty(LogFormat.prototype, "whiteBright", {
get: function () { return this._setCode('97'); },
enumerable: true,
configurable: true
});
Object.defineProperty(LogFormat.prototype, "orange", {
get: function () { return this._setCode('38;5;202'); },
enumerable: true,
configurable: true
});
Object.defineProperty(LogFormat.prototype, "bgBlack", {
get: function () { return this._setCode('40'); },
enumerable: true,
configurable: true
});
Object.defineProperty(LogFormat.prototype, "bgRed", {
get: function () { return this._setCode('41'); },
enumerable: true,
configurable: true
});
Object.defineProperty(LogFormat.prototype, "bgGreen", {
get: function () { return this._setCode('42'); },
enumerable: true,
configurable: true
});
Object.defineProperty(LogFormat.prototype, "bgYellow", {
get: function () { return this._setCode('43'); },
enumerable: true,
configurable: true
});
Object.defineProperty(LogFormat.prototype, "bgBlue", {
get: function () { return this._setCode('44'); },
enumerable: true,
configurable: true
});
Object.defineProperty(LogFormat.prototype, "bgMagenta", {
get: function () { return this._setCode('45'); },
enumerable: true,
configurable: true
});
Object.defineProperty(LogFormat.prototype, "bgCyan", {
get: function () { return this._setCode('46'); },
enumerable: true,
configurable: true
});
Object.defineProperty(LogFormat.prototype, "bgWhite", {
get: function () { return this._setCode('47'); },
enumerable: true,
configurable: true
});
Object.defineProperty(LogFormat.prototype, "bgBlackBright", {
get: function () { return this._setCode('100'); },
enumerable: true,
configurable: true
});
Object.defineProperty(LogFormat.prototype, "bgRedBright", {
get: function () { return this._setCode('101'); },
enumerable: true,
configurable: true
});
Object.defineProperty(LogFormat.prototype, "bgGreenBright", {
get: function () { return this._setCode('102'); },
enumerable: true,
configurable: true
});
Object.defineProperty(LogFormat.prototype, "bgYellowBright", {
get: function () { return this._setCode('103'); },
enumerable: true,
configurable: true
});
Object.defineProperty(LogFormat.prototype, "bgBlueBright", {
get: function () { return this._setCode('104'); },
enumerable: true,
configurable: true
});
Object.defineProperty(LogFormat.prototype, "bgMagentaBright", {
get: function () { return this._setCode('105'); },
enumerable: true,
configurable: true
});
Object.defineProperty(LogFormat.prototype, "bgCyanBright", {
get: function () { return this._setCode('106'); },
enumerable: true,
configurable: true
});
Object.defineProperty(LogFormat.prototype, "bgWhiteBright", {
get: function () { return this._setCode('107'); },
enumerable: true,
configurable: true
});
return LogFormat;
}());
exports.LogFormat = LogFormat;
exports.default = LogFormat;
//# sourceMappingURL=logFormat.js.map