@modernpoacher/deps 2.2.32 → 2.2.33

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.
@@ -16,8 +16,6 @@
16
16
  * @returns {void}
17
17
  */
18
18
 
19
- import stripAnsi from 'strip-ansi'
20
-
21
19
  import {
22
20
  argv
23
21
  } from 'node:process'
@@ -43,6 +41,11 @@ import {
43
41
 
44
42
  import debug from '#deps/src/common/debug'
45
43
 
44
+ import {
45
+ use,
46
+ tidy
47
+ } from '#deps/src/common/format'
48
+
46
49
  import {
47
50
  VERSION,
48
51
  PLATFORM,
@@ -76,33 +79,8 @@ const CODE = 0
76
79
 
77
80
  const MESSAGE = 'Either no error message has been defined or no error has been supplied'
78
81
 
79
- const LF = String.fromCodePoint(10)
80
82
  const SP = String.fromCodePoint(32)
81
83
 
82
- /**
83
- * @param {string} v
84
- * @returns {string}
85
- */
86
- export function trim (v) {
87
- return v.split(LF).map(trimEnd).join(LF).trim()
88
- }
89
-
90
- /**
91
- * @param {string} v
92
- * @returns {string}
93
- */
94
- export function trimEnd (v) {
95
- return v.trimEnd()
96
- }
97
-
98
- /**
99
- * @param {string} v
100
- * @returns {string}
101
- */
102
- export function tidy (v) {
103
- return v.replace(/\n{2,}}/gm, LF).trim()
104
- }
105
-
106
84
  const getRmrfCommands = PLATFORM === 'win32'
107
85
  ? () => tidy(`
108
86
  rmdir /s /q node_modules 2> nul & del package-lock.json 2> nul
@@ -155,40 +133,6 @@ export const ARGS = PLATFORM === 'win32'
155
133
  ? ARGV.map(toDouble).join(SP)
156
134
  : ARGV.map(toSingle).join(SP)
157
135
 
158
- /**
159
- * @param {string} v
160
- * @returns {boolean}
161
- */
162
- function filter (v) {
163
- return Boolean(stripAnsi(v).trim())
164
- }
165
-
166
- /**
167
- * @param {string} key
168
- * @returns {(value: string) => void}
169
- */
170
- export function use (key) {
171
- const log = debug(`@modernpoacher/deps:${key}`)
172
-
173
- /**
174
- * @param {string} v
175
- * @returns {void}
176
- */
177
- function write (v) {
178
- log(v.trimEnd())
179
- }
180
-
181
- /**
182
- * @param {string} value
183
- * @returns {void}
184
- */
185
- return function use (value) {
186
- value.split(LF)
187
- .filter(filter)
188
- .forEach(write)
189
- }
190
- }
191
-
192
136
  /**
193
137
  * @param {{ code?: number, message?: string }} [e]
194
138
  */
package/bin/node/deps.mjs CHANGED
@@ -8,6 +8,10 @@ import '#deps/src/common/write'
8
8
 
9
9
  import '#deps/src/common/debug'
10
10
 
11
+ import {
12
+ use
13
+ } from '#deps/src/common/format'
14
+
11
15
  import {
12
16
  getOptions
13
17
  } from '#deps/src/common/options'
@@ -15,7 +19,6 @@ import {
15
19
  import {
16
20
  DEPS,
17
21
  ARGS,
18
- use,
19
22
  handleComplete
20
23
  } from '#deps/bin/common'
21
24
 
package/bin/node/head.mjs CHANGED
@@ -8,6 +8,10 @@ import '#deps/src/common/write'
8
8
 
9
9
  import '#deps/src/common/debug'
10
10
 
11
+ import {
12
+ use
13
+ } from '#deps/src/common/format'
14
+
11
15
  import {
12
16
  getOptions
13
17
  } from '#deps/src/common/options'
@@ -15,7 +19,6 @@ import {
15
19
  import {
16
20
  HEAD,
17
21
  ARGS,
18
- use,
19
22
  handleComplete
20
23
  } from '#deps/bin/common'
21
24
 
package/bin/node/push.mjs CHANGED
@@ -8,6 +8,10 @@ import '#deps/src/common/write'
8
8
 
9
9
  import '#deps/src/common/debug'
10
10
 
11
+ import {
12
+ use
13
+ } from '#deps/src/common/format'
14
+
11
15
  import {
12
16
  getOptions
13
17
  } from '#deps/src/common/options'
@@ -15,7 +19,6 @@ import {
15
19
  import {
16
20
  PUSH,
17
21
  ARGS,
18
- use,
19
22
  handleComplete
20
23
  } from '#deps/bin/common'
21
24
 
package/bin/node/wipe.mjs CHANGED
@@ -8,6 +8,10 @@ import '#deps/src/common/write'
8
8
 
9
9
  import '#deps/src/common/debug'
10
10
 
11
+ import {
12
+ use
13
+ } from '#deps/src/common/format'
14
+
11
15
  import {
12
16
  getOptions
13
17
  } from '#deps/src/common/options'
@@ -15,7 +19,6 @@ import {
15
19
  import {
16
20
  WIPE,
17
21
  ARGS,
18
- use,
19
22
  handleComplete
20
23
  } from '#deps/bin/common'
21
24
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@modernpoacher/deps",
3
- "version": "2.2.32",
3
+ "version": "2.2.33",
4
4
  "description": "Update NPM package dependencies from the command line",
5
5
  "keywords": [
6
6
  "deps",
@@ -2,14 +2,14 @@ import debug from 'debug'
2
2
 
3
3
  import stripAnsi from 'strip-ansi'
4
4
 
5
- const LF = String.fromCodePoint(32)
5
+ const LF = String.fromCodePoint(10)
6
6
 
7
7
  /**
8
8
  * @param {string} v
9
9
  * @returns {string}
10
10
  */
11
- export function tidy (v) {
12
- return v.replace(/\n{2,}}/gm, LF).trim()
11
+ export function trim (v) {
12
+ return v.split(LF).map(trimEnd).join(LF).trim()
13
13
  }
14
14
 
15
15
  /**
@@ -24,8 +24,8 @@ export function trimEnd (v) {
24
24
  * @param {string} v
25
25
  * @returns {string}
26
26
  */
27
- export function trim (v) {
28
- return v.split(LF).map(trimEnd).join(LF).trim()
27
+ export function tidy (v) {
28
+ return v.replace(/\n{2,}}/gm, LF).trim()
29
29
  }
30
30
 
31
31
  /**
@@ -21,6 +21,11 @@ import {
21
21
 
22
22
  import debug from '#deps/src/common/debug'
23
23
 
24
+ import {
25
+ use,
26
+ trim
27
+ } from '#deps/src/common/format'
28
+
24
29
  import {
25
30
  BIN,
26
31
  VERSION,
@@ -73,30 +78,6 @@ log(`\`common/git\` (${VERSION} - ${PLATFORM}) is awake`)
73
78
 
74
79
  const LF = String.fromCodePoint(10)
75
80
 
76
- /**
77
- * @param {string} v
78
- * @returns {string}
79
- */
80
- export function trim (v) {
81
- return v.split(LF).map(trimEnd).join(LF).trim()
82
- }
83
-
84
- /**
85
- * @param {string} v
86
- * @returns {string}
87
- */
88
- export function trimEnd (v) {
89
- return v.trimEnd()
90
- }
91
-
92
- /**
93
- * @param {string} v
94
- * @returns {string}
95
- */
96
- export function tidy (v) {
97
- return v.replace(/\n{2,}}/gm, LF).trim()
98
- }
99
-
100
81
  /**
101
82
  * @param {string} v
102
83
  * @returns {boolean}
@@ -123,32 +104,6 @@ function isFatal (v) {
123
104
  return v.toLowerCase().startsWith('fatal: not a git repository')
124
105
  }
125
106
 
126
- /**
127
- * @param {string} key
128
- * @returns {(value: string) => void}
129
- */
130
- export function use (key) {
131
- const log = debug(`@modernpoacher/deps:${key}`)
132
-
133
- /**
134
- * @param {string} v
135
- * @returns {void}
136
- */
137
- function write (v) {
138
- log(v.trimEnd())
139
- }
140
-
141
- /**
142
- * @param {string} value
143
- * @returns {void}
144
- */
145
- return function use (value) {
146
- value.split(LF)
147
- .filter(filter)
148
- .forEach(write)
149
- }
150
- }
151
-
152
107
  /**
153
108
  * @param {string} key
154
109
  * @param {string} directory
@@ -13,6 +13,10 @@ import PATH from '#where-am-i'
13
13
 
14
14
  import debug from '#deps/src/common/debug'
15
15
 
16
+ import {
17
+ tidy
18
+ } from '#deps/src/common/format'
19
+
16
20
  import {
17
21
  VERSION,
18
22
  PLATFORM
@@ -30,33 +34,8 @@ const log = debug('@modernpoacher/deps')
30
34
 
31
35
  log(`\`common\` (${VERSION} - ${PLATFORM}) is awake`)
32
36
 
33
- const LF = String.fromCodePoint(10)
34
37
  const SP = String.fromCodePoint(32)
35
38
 
36
- /**
37
- * @param {string} v
38
- * @returns {string}
39
- */
40
- export function trim (v) {
41
- return v.split(LF).map(trimEnd).join(LF).trim()
42
- }
43
-
44
- /**
45
- * @param {string} v
46
- * @returns {string}
47
- */
48
- export function trimEnd (v) {
49
- return v.trimEnd()
50
- }
51
-
52
- /**
53
- * @param {string} v
54
- * @returns {string}
55
- */
56
- export function tidy (v) {
57
- return v.replace(/\n{2,}}/gm, LF).trim()
58
- }
59
-
60
39
  /**
61
40
  * @function getSaveProdParameter
62
41
  * @description
package/src/index.mjs CHANGED
@@ -19,8 +19,6 @@
19
19
  * @returns {void}
20
20
  */
21
21
 
22
- import stripAnsi from 'strip-ansi'
23
-
24
22
  import {
25
23
  normalize
26
24
  } from 'node:path'
@@ -31,6 +29,10 @@ import {
31
29
 
32
30
  import debug from '#deps/src/common/debug'
33
31
 
32
+ import {
33
+ use
34
+ } from '#deps/src/common/format'
35
+
34
36
  import {
35
37
  VERSION,
36
38
  PLATFORM
@@ -62,42 +64,6 @@ const info = debug('@modernpoacher/deps:info')
62
64
 
63
65
  log(`\`deps\` (${VERSION} - ${PLATFORM}) is awake`)
64
66
 
65
- const LF = String.fromCodePoint(10)
66
-
67
- /**
68
- * @param {string} v
69
- * @returns {boolean}
70
- */
71
- function filter (v) {
72
- return Boolean(stripAnsi(v).trim())
73
- }
74
-
75
- /**
76
- * @param {string} key
77
- * @returns {(value: string) => void}
78
- */
79
- export function use (key) {
80
- const log = debug(`@modernpoacher/deps:${key}`)
81
-
82
- /**
83
- * @param {string} v
84
- * @returns {void}
85
- */
86
- function write (v) {
87
- log(v.trimEnd())
88
- }
89
-
90
- /**
91
- * @param {string} value
92
- * @returns {void}
93
- */
94
- return function use (value) {
95
- value.split(LF)
96
- .filter(filter)
97
- .forEach(write)
98
- }
99
- }
100
-
101
67
  /**
102
68
  * @function getInstallSaveExactCommands
103
69
  * @description