Skip to content

Commit 739634d

Browse files
committed
deps: remove strip-ansi
Only removes from direct dependencies, is still a non-dev subdependency
1 parent d4ebfba commit 739634d

File tree

5 files changed

+7
-15
lines changed

5 files changed

+7
-15
lines changed

DEPENDENCIES.md

-1
Original file line numberDiff line numberDiff line change
@@ -557,7 +557,6 @@ graph LR;
557557
npm-->spawk;
558558
npm-->spdx-expression-parse;
559559
npm-->ssri;
560-
npm-->strip-ansi;
561560
npm-->supports-color;
562561
npm-->tap;
563562
npm-->tar;

package-lock.json

-2
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@
7070
"semver",
7171
"spdx-expression-parse",
7272
"ssri",
73-
"strip-ansi",
7473
"supports-color",
7574
"tar",
7675
"text-table",
@@ -151,7 +150,6 @@
151150
"semver": "^7.5.4",
152151
"spdx-expression-parse": "^3.0.1",
153152
"ssri": "^10.0.5",
154-
"strip-ansi": "^7.1.0",
155153
"supports-color": "^9.4.0",
156154
"tar": "^6.2.0",
157155
"text-table": "~0.2.0",

package.json

-2
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,6 @@
113113
"semver": "^7.5.4",
114114
"spdx-expression-parse": "^3.0.1",
115115
"ssri": "^10.0.5",
116-
"strip-ansi": "^7.1.0",
117116
"supports-color": "^9.4.0",
118117
"tar": "^6.2.0",
119118
"text-table": "~0.2.0",
@@ -186,7 +185,6 @@
186185
"semver",
187186
"spdx-expression-parse",
188187
"ssri",
189-
"strip-ansi",
190188
"supports-color",
191189
"tar",
192190
"text-table",

test/lib/commands/hook.js

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
const t = require('tap')
22
const mockNpm = require('../../fixtures/mock-npm')
3+
const { stripVTControlCharacters } = require('node:util')
34

45
const mockHook = async (t, { hookResponse, ...npmOpts } = {}) => {
56
const now = Date.now()
@@ -243,8 +244,7 @@ t.test('npm hook ls', async t => {
243244
'received the correct arguments'
244245
)
245246
t.equal(outputs[0][0], 'You have 3 hooks configured.', 'prints the correct header')
246-
const { default: stripAnsi } = await import('strip-ansi')
247-
const out = stripAnsi(outputs[1][0])
247+
const out = stripVTControlCharacters(outputs[1][0])
248248
t.match(out, /semver.*https:\/\/google.com.*\n.*\n.*never triggered/, 'prints package hook')
249249
t.match(out, /@npmcli.*https:\/\/google.com.*\n.*\n.*triggered just now/, 'prints scope hook')
250250
t.match(out, /~npm.*https:\/\/google.com.*\n.*\n.*never triggered/, 'prints owner hook')
@@ -293,8 +293,7 @@ t.test('npm hook ls, single result', async t => {
293293
'received the correct arguments'
294294
)
295295
t.equal(outputs[0][0], 'You have one hook configured.', 'prints the correct header')
296-
const { default: stripAnsi } = await import('strip-ansi')
297-
const out = stripAnsi(outputs[1][0])
296+
const out = stripVTControlCharacters(outputs[1][0])
298297
t.match(out, /semver.*https:\/\/google.com.*\n.*\n.*never triggered/, 'prints package hook')
299298
})
300299

test/lib/commands/org.js

+4-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
const t = require('tap')
22
const mockNpm = require('../../fixtures/mock-npm')
3+
const { stripVTControlCharacters } = require('node:util')
34

45
const mockOrg = async (t, { orgSize = 1, orgList = {}, ...npmOpts } = {}) => {
56
let setArgs = null
@@ -426,8 +427,7 @@ t.test('npm org ls', async t => {
426427
},
427428
'receieved the correct args'
428429
)
429-
const { default: stripAnsi } = await import('strip-ansi')
430-
const out = stripAnsi(outputs[0][0])
430+
const out = stripVTControlCharacters(outputs[0][0])
431431
t.match(out, /one.*developer/, 'contains the developer member')
432432
t.match(out, /two.*admin/, 'contains the admin member')
433433
t.match(out, /three.*owner/, 'contains the owner member')
@@ -452,8 +452,7 @@ t.test('npm org ls - user filter', async t => {
452452
},
453453
'receieved the correct args'
454454
)
455-
const { default: stripAnsi } = await import('strip-ansi')
456-
const out = stripAnsi(outputs[0][0])
455+
const out = stripVTControlCharacters(outputs[0][0])
457456
t.match(out, /username.*admin/, 'contains the filtered member')
458457
t.notMatch(out, /missing.*admin/, 'does not contain other members')
459458
})
@@ -476,8 +475,7 @@ t.test('npm org ls - user filter, missing user', async t => {
476475
},
477476
'receieved the correct args'
478477
)
479-
const { default: stripAnsi } = await import('strip-ansi')
480-
const out = stripAnsi(outputs[0][0])
478+
const out = stripVTControlCharacters(outputs[0][0])
481479
t.notMatch(out, /username/, 'does not contain the requested member')
482480
t.notMatch(out, /missing.*admin/, 'does not contain other members')
483481
})

0 commit comments

Comments
 (0)