Skip to content

Commit

Permalink
refactor: Remove has-ansi dependency due to security issues (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
G-Rath authored Oct 22, 2021
1 parent 278749f commit 5813577
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion lib/writer.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@

const isObject = require("type/object/is")
, formatParts = require("sprintf-kit/format-parts")
, hasAnsi = require("has-ansi")
, ansiRegex = require("ansi-regex")({ onlyFirst: true })
, { blackBright, red, yellow } = require("cli-color/bare")
, LogWriter = require("log/lib/abstract-writer")
, colorsSupportLevel = require("./private/colors-support-level")
, levelPrefixes = require("./level-prefixes")
, getNamespacePrefix = require("./get-namespace-prefix")
, resolveParts = require("./resolve-format-parts");

const hasAnsi = string => ansiRegex.test(string);

const WARNING_LEVEL_INDEX = 1, ERROR_LEVEL_INDEX = 0;

class NodeLogWriter extends LogWriter {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@
"url": "https://github.com/medikoo/log-node.git"
},
"dependencies": {
"ansi-regex": "^5.0.1",
"cli-color": "^2.0.0",
"cli-sprintf-format": "^1.1.0",
"d": "^1.0.1",
"es5-ext": "^0.10.53",
"has-ansi": "^4.0.1",
"sprintf-kit": "^2.0.1",
"supports-color": "^8.1.1",
"type": "^2.5.0"
Expand Down

0 comments on commit 5813577

Please sign in to comment.