Skip to content

Commit

Permalink
make isColorEnabled a default enabled value
Browse files Browse the repository at this point in the history
  • Loading branch information
alexeyraspopov committed Oct 4, 2021
1 parent 0598553 commit aaf57e1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions picocolors.js
Expand Up @@ -25,7 +25,7 @@ function replaceClose(string, close, replace, index) {
return !~nextIndex ? start + end : start + replaceClose(end, close, replace, nextIndex)
}

function createColors(enabled) {
function createColors(enabled = isColorSupported) {
return {
isColorSupported: enabled,
reset: enabled ? (s) => `\x1b[0m${s}\x1b[0m` : String,
Expand Down Expand Up @@ -56,5 +56,5 @@ function createColors(enabled) {
}
}

module.exports = createColors(isColorSupported)
module.exports = createColors()
module.exports.createColors = createColors

0 comments on commit aaf57e1

Please sign in to comment.