From aee4a30bfb88ac147f5f8ac9bdb28cfc0be16e7f Mon Sep 17 00:00:00 2001 From: Gar Date: Mon, 19 Jun 2023 07:56:38 -0700 Subject: [PATCH] deps: strip-ansi@7.1.0 --- .../@isaacs/cliui/node_modules/strip-ansi/index.js | 7 ++++++- .../cliui/node_modules/strip-ansi/package.json | 2 +- .../wrap-ansi/node_modules/strip-ansi/index.js | 7 ++++++- .../wrap-ansi/node_modules/strip-ansi/package.json | 2 +- package-lock.json | 12 ++++++------ 5 files changed, 20 insertions(+), 10 deletions(-) diff --git a/node_modules/@isaacs/cliui/node_modules/strip-ansi/index.js b/node_modules/@isaacs/cliui/node_modules/strip-ansi/index.js index ef3c095f5fd42..ba19750e64e06 100644 --- a/node_modules/@isaacs/cliui/node_modules/strip-ansi/index.js +++ b/node_modules/@isaacs/cliui/node_modules/strip-ansi/index.js @@ -1,9 +1,14 @@ import ansiRegex from 'ansi-regex'; +const regex = ansiRegex(); + export default function stripAnsi(string) { if (typeof string !== 'string') { throw new TypeError(`Expected a \`string\`, got \`${typeof string}\``); } - return string.replace(ansiRegex(), ''); + // Even though the regex is global, we don't need to reset the `.lastIndex` + // because unlike `.exec()` and `.test()`, `.replace()` does it automatically + // and doing it manually has a performance penalty. + return string.replace(regex, ''); } diff --git a/node_modules/@isaacs/cliui/node_modules/strip-ansi/package.json b/node_modules/@isaacs/cliui/node_modules/strip-ansi/package.json index 0de0586f7eef1..e1f455c325b00 100644 --- a/node_modules/@isaacs/cliui/node_modules/strip-ansi/package.json +++ b/node_modules/@isaacs/cliui/node_modules/strip-ansi/package.json @@ -1,6 +1,6 @@ { "name": "strip-ansi", - "version": "7.0.1", + "version": "7.1.0", "description": "Strip ANSI escape codes from a string", "license": "MIT", "repository": "chalk/strip-ansi", diff --git a/node_modules/wrap-ansi/node_modules/strip-ansi/index.js b/node_modules/wrap-ansi/node_modules/strip-ansi/index.js index ef3c095f5fd42..ba19750e64e06 100644 --- a/node_modules/wrap-ansi/node_modules/strip-ansi/index.js +++ b/node_modules/wrap-ansi/node_modules/strip-ansi/index.js @@ -1,9 +1,14 @@ import ansiRegex from 'ansi-regex'; +const regex = ansiRegex(); + export default function stripAnsi(string) { if (typeof string !== 'string') { throw new TypeError(`Expected a \`string\`, got \`${typeof string}\``); } - return string.replace(ansiRegex(), ''); + // Even though the regex is global, we don't need to reset the `.lastIndex` + // because unlike `.exec()` and `.test()`, `.replace()` does it automatically + // and doing it manually has a performance penalty. + return string.replace(regex, ''); } diff --git a/node_modules/wrap-ansi/node_modules/strip-ansi/package.json b/node_modules/wrap-ansi/node_modules/strip-ansi/package.json index 0de0586f7eef1..e1f455c325b00 100644 --- a/node_modules/wrap-ansi/node_modules/strip-ansi/package.json +++ b/node_modules/wrap-ansi/node_modules/strip-ansi/package.json @@ -1,6 +1,6 @@ { "name": "strip-ansi", - "version": "7.0.1", + "version": "7.1.0", "description": "Strip ANSI escape codes from a string", "license": "MIT", "repository": "chalk/strip-ansi", diff --git a/package-lock.json b/package-lock.json index dee41b223fd55..e1a2a119dbe83 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1329,9 +1329,9 @@ } }, "node_modules/@isaacs/cliui/node_modules/strip-ansi": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.0.1.tgz", - "integrity": "sha512-cXNxvT8dFNRVfhVME3JAe98mkXDYN2O1l7jmcwMnOslDeESg1rF/OZMtK0nRAhiari1unG5cD4jG3rapUAkLbw==", + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", + "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", "inBundle": true, "dependencies": { "ansi-regex": "^6.0.1" @@ -15231,9 +15231,9 @@ } }, "node_modules/wrap-ansi/node_modules/strip-ansi": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.0.1.tgz", - "integrity": "sha512-cXNxvT8dFNRVfhVME3JAe98mkXDYN2O1l7jmcwMnOslDeESg1rF/OZMtK0nRAhiari1unG5cD4jG3rapUAkLbw==", + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", + "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", "inBundle": true, "dependencies": { "ansi-regex": "^6.0.1"