@modernpoacher/deps 2.1.15 → 2.1.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,6 +2,8 @@
2
2
 
3
3
  import debug from 'debug'
4
4
 
5
+ import stripAnsi from 'strip-ansi'
6
+
5
7
  import {
6
8
  argv
7
9
  } from 'node:process'
@@ -92,18 +94,14 @@ export function getArgs () {
92
94
  }
93
95
 
94
96
  function filter (v) {
95
- const s = v.trim()
96
-
97
- return Boolean(s)
97
+ return Boolean(stripAnsi(v).trim())
98
98
  }
99
99
 
100
100
  export function use (key) {
101
101
  const log = debug(`@modernpoacher/deps:${key}`)
102
102
 
103
103
  function write (v) {
104
- const s = v.trimEnd()
105
-
106
- if (s) log(s)
104
+ log(v.trimEnd())
107
105
  }
108
106
 
109
107
  return function use (value) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@modernpoacher/deps",
3
- "version": "2.1.15",
3
+ "version": "2.1.17",
4
4
  "description": "Update NPM package dependencies from the command line",
5
5
  "keywords": [
6
6
  "deps",
@@ -55,6 +55,7 @@
55
55
  "commander": "^12.1.0",
56
56
  "debug": "^4.3.7",
57
57
  "glob-all": "^3.3.1",
58
+ "strip-ansi": "^7.1.0",
58
59
  "supports-color": "^9.4.0"
59
60
  },
60
61
  "devDependencies": {
@@ -1,5 +1,7 @@
1
1
  import debug from 'debug'
2
2
 
3
+ import stripAnsi from 'strip-ansi'
4
+
3
5
  import {
4
6
  normalize
5
7
  } from 'node:path'
@@ -60,9 +62,7 @@ log(`\`git\` (${VERSION} - ${PLATFORM}) is awake`)
60
62
  const trim = (v) => v.split(String.fromCharCode(10)).map((v) => v.trimEnd()).join(String.fromCharCode(10)).trim()
61
63
 
62
64
  function filter (v) {
63
- const s = v.trim()
64
-
65
- return Boolean(s)
65
+ return Boolean(stripAnsi(v).trim())
66
66
  }
67
67
 
68
68
  export function getIsDirectory (directory) {
@@ -79,9 +79,7 @@ export function use (key) {
79
79
  const log = debug(`@modernpoacher/deps:${key}`)
80
80
 
81
81
  function write (v) {
82
- const s = v.trimEnd()
83
-
84
- if (s) log(s)
82
+ log(v.trimEnd())
85
83
  }
86
84
 
87
85
  return function use (value) {
@@ -105,9 +103,7 @@ export function out (key, directory) {
105
103
  }
106
104
 
107
105
  function write (v) {
108
- const s = v.trimEnd()
109
-
110
- if (s) log(s)
106
+ if (v.trim()) log(v.trimEnd())
111
107
  }
112
108
 
113
109
  return function out (value) {
@@ -131,9 +127,7 @@ export function err (key, directory) {
131
127
  }
132
128
 
133
129
  function write (v) {
134
- const s = v.trimEnd()
135
-
136
- if (s) log(s)
130
+ if (v.trim()) log(v.trimEnd())
137
131
  }
138
132
 
139
133
  return function err (value) {
package/src/index.mjs CHANGED
@@ -10,6 +10,8 @@
10
10
 
11
11
  import debug from 'debug'
12
12
 
13
+ import stripAnsi from 'strip-ansi'
14
+
13
15
  import {
14
16
  normalize
15
17
  } from 'node:path'
@@ -46,18 +48,14 @@ const log = debug('@modernpoacher/deps')
46
48
  log(`\`deps\` (${VERSION} - ${PLATFORM}) is awake`)
47
49
 
48
50
  function filter (v) {
49
- const s = v.trim()
50
-
51
- return Boolean(s)
51
+ return Boolean(stripAnsi(v).trim())
52
52
  }
53
53
 
54
54
  export function use (key) {
55
55
  const log = debug(`@modernpoacher/deps:${key}`)
56
56
 
57
57
  function write (v) {
58
- const s = v.trimEnd()
59
-
60
- if (s) log(s)
58
+ log(v.trimEnd())
61
59
  }
62
60
 
63
61
  return function use (value) {