From 8be88700789f9a0526fdf222407f6e502eebd579 Mon Sep 17 00:00:00 2001 From: Salah Alhashmi Date: Sat, 15 Jul 2023 10:46:50 +0400 Subject: [PATCH] move Chalk class to the bottom (readablity) --- source/index.js | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/source/index.js b/source/index.js index 8bc993d..ec7643b 100644 --- a/source/index.js +++ b/source/index.js @@ -31,13 +31,6 @@ const applyOptions = (object, options = {}) => { 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 chalk = (...strings) => strings.join(' '); applyOptions(chalk, options); @@ -202,6 +195,14 @@ const applyStyle = (self, string) => { Object.defineProperties(createChalk.prototype, styles); 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 {