Skip to content

Commit 8c5882f

Browse files
committed
deps: strip-ansi@7.1.0
1 parent cd0c649 commit 8c5882f

36 files changed

Lines changed: 513 additions & 204 deletions

File tree

lib/commands/outdated.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ const npa = require('npm-package-arg')
66
const pickManifest = require('npm-pick-manifest')
77
const localeCompare = require('@isaacs/string-locale-compare')('en')
88

9-
const ansiTrim = require('strip-ansi')
109
const ArboristWorkspaceCmd = require('../arborist-cmd.js')
1110

1211
class Outdated extends ArboristWorkspaceCmd {
@@ -23,6 +22,7 @@ class Outdated extends ArboristWorkspaceCmd {
2322
]
2423

2524
async exec (args) {
25+
const { default: stripAnsi } = await import('strip-ansi')
2626
const global = resolve(this.npm.globalDir, '..')
2727
const where = this.npm.global
2828
? global
@@ -106,7 +106,7 @@ class Outdated extends ArboristWorkspaceCmd {
106106

107107
const tableOpts = {
108108
align: ['l', 'r', 'r', 'r', 'l'],
109-
stringLength: s => ansiTrim(s).length,
109+
stringLength: s => stripAnsi(s).length,
110110
}
111111
this.npm.output(table(outTable, tableOpts))
112112
}

lib/commands/search.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ class Search extends BaseCommand {
8383

8484
// Grab a configured output stream that will spit out packages in the
8585
// desired format.
86-
const outputStream = formatSearchStream({
86+
const outputStream = await formatSearchStream({
8787
args, // --searchinclude options are not highlighted
8888
...opts,
8989
})

lib/utils/format-search-stream.js

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
const { Minipass } = require('minipass')
22
const columnify = require('columnify')
3-
const ansiTrim = require('strip-ansi')
43

54
// This module consumes package data in the following format:
65
//
@@ -16,7 +15,10 @@ const ansiTrim = require('strip-ansi')
1615
// The returned stream will format this package data
1716
// into a byte stream of formatted, displayable output.
1817

19-
module.exports = (opts) => {
18+
let stripAnsi
19+
module.exports = async (opts) => {
20+
stripAnsi = await import('strip-ansi')
21+
stripAnsi = stripAnsi.default
2022
return opts.json ? new JSONOutputStream() : new TextOutputStream(opts)
2123
}
2224

@@ -142,13 +144,13 @@ function highlightSearchTerms (str, terms) {
142144

143145
function normalizePackage (data, opts) {
144146
return {
145-
name: ansiTrim(data.name),
146-
description: ansiTrim(data.description ?? ''),
147-
author: data.maintainers.map((m) => `=${ansiTrim(m.username)}`).join(' '),
147+
name: stripAnsi(data.name),
148+
description: stripAnsi(data.description ?? ''),
149+
author: data.maintainers.map((m) => `=${stripAnsi(m.username)}`).join(' '),
148150
keywords: Array.isArray(data.keywords)
149-
? data.keywords.map(ansiTrim).join(' ')
151+
? data.keywords.map(stripAnsi).join(' ')
150152
: typeof data.keywords === 'string'
151-
? ansiTrim(data.keywords.replace(/[,\s]+/, ' '))
153+
? stripAnsi(data.keywords.replace(/[,\s]+/, ' '))
152154
: '',
153155
version: data.version,
154156
date: (data.date &&

node_modules/.gitignore

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,8 @@
1111
!/@isaacs/cliui
1212
!/@isaacs/cliui/node_modules/
1313
/@isaacs/cliui/node_modules/*
14-
!/@isaacs/cliui/node_modules/ansi-regex
1514
!/@isaacs/cliui/node_modules/emoji-regex
1615
!/@isaacs/cliui/node_modules/string-width
17-
!/@isaacs/cliui/node_modules/strip-ansi
1816
!/@isaacs/string-locale-compare
1917
!/@npmcli/
2018
/@npmcli/*
@@ -72,13 +70,19 @@
7270
!/cidr-regex
7371
!/clean-stack
7472
!/cli-columns
73+
!/cli-columns/node_modules/
74+
/cli-columns/node_modules/*
75+
!/cli-columns/node_modules/strip-ansi
7576
!/cli-table3
7677
!/clone
7778
!/cmd-shim
7879
!/color-convert
7980
!/color-name
8081
!/color-support
8182
!/columnify
83+
!/columnify/node_modules/
84+
/columnify/node_modules/*
85+
!/columnify/node_modules/strip-ansi
8286
!/common-ancestor-path
8387
!/console-control-strings
8488
!/cross-spawn
@@ -106,6 +110,9 @@
106110
!/fs-minipass
107111
!/function-bind
108112
!/gauge
113+
!/gauge/node_modules/
114+
/gauge/node_modules/*
115+
!/gauge/node_modules/strip-ansi
109116
!/glob
110117
!/graceful-fs
111118
!/has-unicode
@@ -219,9 +226,18 @@
219226
!/ssri
220227
!/string_decoder
221228
!/string-width-cjs
229+
!/string-width-cjs/node_modules/
230+
/string-width-cjs/node_modules/*
231+
!/string-width-cjs/node_modules/strip-ansi
222232
!/string-width
233+
!/string-width/node_modules/
234+
/string-width/node_modules/*
235+
!/string-width/node_modules/strip-ansi
223236
!/strip-ansi-cjs
224237
!/strip-ansi
238+
!/strip-ansi/node_modules/
239+
/strip-ansi/node_modules/*
240+
!/strip-ansi/node_modules/ansi-regex
225241
!/supports-color
226242
!/tar
227243
!/tar/node_modules/
@@ -248,14 +264,15 @@
248264
!/which/node_modules/isexe
249265
!/wide-align
250266
!/wrap-ansi-cjs
267+
!/wrap-ansi-cjs/node_modules/
268+
/wrap-ansi-cjs/node_modules/*
269+
!/wrap-ansi-cjs/node_modules/strip-ansi
251270
!/wrap-ansi
252271
!/wrap-ansi/node_modules/
253272
/wrap-ansi/node_modules/*
254-
!/wrap-ansi/node_modules/ansi-regex
255273
!/wrap-ansi/node_modules/ansi-styles
256274
!/wrap-ansi/node_modules/emoji-regex
257275
!/wrap-ansi/node_modules/string-width
258-
!/wrap-ansi/node_modules/strip-ansi
259276
!/write-file-atomic
260277
!/yallist
261278
# Always ignore some specific patterns within any allowed package

node_modules/@isaacs/cliui/node_modules/strip-ansi/index.js

Lines changed: 0 additions & 14 deletions
This file was deleted.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
'use strict';
2+
const ansiRegex = require('ansi-regex');
3+
4+
module.exports = string => typeof string === 'string' ? string.replace(ansiRegex(), '') : string;

node_modules/wrap-ansi/node_modules/ansi-regex/license renamed to node_modules/cli-columns/node_modules/strip-ansi/license

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
3+
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
66

node_modules/wrap-ansi/node_modules/strip-ansi/package.json renamed to node_modules/cli-columns/node_modules/strip-ansi/package.json

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,16 @@
11
{
22
"name": "strip-ansi",
3-
"version": "7.1.0",
3+
"version": "6.0.1",
44
"description": "Strip ANSI escape codes from a string",
55
"license": "MIT",
66
"repository": "chalk/strip-ansi",
7-
"funding": "https://github.com/chalk/strip-ansi?sponsor=1",
87
"author": {
98
"name": "Sindre Sorhus",
109
"email": "sindresorhus@gmail.com",
11-
"url": "https://sindresorhus.com"
10+
"url": "sindresorhus.com"
1211
},
13-
"type": "module",
14-
"exports": "./index.js",
1512
"engines": {
16-
"node": ">=12"
13+
"node": ">=8"
1714
},
1815
"scripts": {
1916
"test": "xo && ava && tsd"
@@ -47,11 +44,11 @@
4744
"text"
4845
],
4946
"dependencies": {
50-
"ansi-regex": "^6.0.1"
47+
"ansi-regex": "^5.0.1"
5148
},
5249
"devDependencies": {
53-
"ava": "^3.15.0",
54-
"tsd": "^0.17.0",
55-
"xo": "^0.44.0"
50+
"ava": "^2.4.0",
51+
"tsd": "^0.10.0",
52+
"xo": "^0.25.3"
5653
}
5754
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
'use strict';
2+
const ansiRegex = require('ansi-regex');
3+
4+
module.exports = string => typeof string === 'string' ? string.replace(ansiRegex(), '') : string;

node_modules/@isaacs/cliui/node_modules/strip-ansi/license renamed to node_modules/columnify/node_modules/strip-ansi/license

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
3+
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
66

0 commit comments

Comments
 (0)