move Chalk class to the bottom (readablity)
This commit is contained in:
parent
f399cd0ff6
commit
8be8870078
1 changed files with 8 additions and 7 deletions
|
|
@ -31,13 +31,6 @@ const applyOptions = (object, options = {}) => {
|
||||||
object.level = options.level === undefined ? colorLevel : options.level;
|
object.level = options.level === undefined ? colorLevel : options.level;
|
||||||
};
|
};
|
||||||
|
|
||||||
export class Chalk {
|
|
||||||
constructor(options) {
|
|
||||||
// eslint-disable-next-line no-constructor-return
|
|
||||||
return chalkFactory(options);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const chalkFactory = options => {
|
const chalkFactory = options => {
|
||||||
const chalk = (...strings) => strings.join(' ');
|
const chalk = (...strings) => strings.join(' ');
|
||||||
applyOptions(chalk, options);
|
applyOptions(chalk, options);
|
||||||
|
|
@ -202,6 +195,14 @@ const applyStyle = (self, string) => {
|
||||||
Object.defineProperties(createChalk.prototype, styles);
|
Object.defineProperties(createChalk.prototype, styles);
|
||||||
|
|
||||||
const chalk = createChalk();
|
const chalk = createChalk();
|
||||||
|
|
||||||
|
export class Chalk {
|
||||||
|
constructor(options) {
|
||||||
|
// eslint-disable-next-line no-constructor-return
|
||||||
|
return chalkFactory(options);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export const chalkStderr = createChalk({level: stderrColor ? stderrColor.level : 0});
|
export const chalkStderr = createChalk({level: stderrColor ? stderrColor.level : 0});
|
||||||
|
|
||||||
export {
|
export {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue