@modernpoacher/deps 2.3.1 → 2.3.3

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@modernpoacher/deps",
3
- "version": "2.3.1",
3
+ "version": "2.3.3",
4
4
  "description": "Update NPM package dependencies from the command line",
5
5
  "keywords": [
6
6
  "deps",
@@ -71,7 +71,7 @@
71
71
  "chai": "^6.2.2",
72
72
  "cross-env": "^10.1.0",
73
73
  "eslint": "9.38.0",
74
- "eslint-plugin-jsdoc": "^63.0.13",
74
+ "eslint-plugin-jsdoc": "^63.2.0",
75
75
  "globals": "^17.7.0",
76
76
  "husky": "^9.1.7",
77
77
  "mocha": "^11.7.6"
@@ -38,9 +38,9 @@ export function formatAuthor (name, email) {
38
38
  * @type {(directory: string) => string}
39
39
  */
40
40
  export const formatDirectory = PLATFORM === 'win32'
41
- ? (directory) => resolve(normalize(directory)).trim()
41
+ ? (directory) => resolve(normalize(directory.trim()))
42
42
  : (directory) => {
43
- const d = resolve(normalize(directory)).trim()
43
+ const d = resolve(normalize(directory.trim()))
44
44
  if (d.startsWith(HOME)) return d.replace(new RegExp('^' + HOME), '~')
45
45
  return d
46
46
  }
@@ -108,7 +108,13 @@ export function use (key) {
108
108
  * @returns {void}
109
109
  */
110
110
  function write (v) {
111
- if (v.trim()) log(v.trimEnd())
111
+ if (v.trim()) {
112
+ if (v.trimStart().startsWith(HOME)) {
113
+ log(formatDirectory(v))
114
+ } else {
115
+ log(v.trimEnd())
116
+ }
117
+ }
112
118
  }
113
119
 
114
120
  /**
@@ -23,7 +23,8 @@ import debug from '#deps/src/common/debug'
23
23
 
24
24
  import {
25
25
  BIN,
26
- PLATFORM
26
+ PLATFORM,
27
+ HOME
27
28
  } from '#deps/src/common/env'
28
29
 
29
30
  import {
@@ -131,7 +132,13 @@ export function out (key, directory) {
131
132
  * @returns {void}
132
133
  */
133
134
  function write (v) {
134
- if (v.trim()) log(v.trimEnd())
135
+ if (v.trim()) {
136
+ if (v.trimStart().startsWith(HOME)) {
137
+ log(formatDirectory(v))
138
+ } else {
139
+ log(v.trimEnd())
140
+ }
141
+ }
135
142
  }
136
143
 
137
144
  return function out (value) {
@@ -168,7 +175,13 @@ export function err (key, directory) {
168
175
  * @returns {void}
169
176
  */
170
177
  function write (v) {
171
- if (v.trim()) log(v.trimEnd())
178
+ if (v.trim()) {
179
+ if (v.trimStart().startsWith(HOME)) {
180
+ log(formatDirectory(v))
181
+ } else {
182
+ log(v.trimEnd())
183
+ }
184
+ }
172
185
  }
173
186
 
174
187
  return function err (value) {
@@ -182,8 +195,8 @@ export function err (key, directory) {
182
195
  * @function getErrorCode
183
196
  * @description
184
197
  * Get an error code from an error
185
- * @param {{code?: number, message?: string}} e
186
- * @returns {number}
198
+ * @param {{code?: string | number, message?: string}} e
199
+ * @returns {string | number}
187
200
  */
188
201
  const getErrorCode = ({ code = 0 }) => code
189
202
 
@@ -191,7 +204,7 @@ const getErrorCode = ({ code = 0 }) => code
191
204
  * @function getErrorMessage
192
205
  * @description
193
206
  * Get an error message from an error
194
- * @param {{code?: number, message?: string}} e
207
+ * @param {{code?: string | number, message?: string}} e
195
208
  * @returns {string}
196
209
  */
197
210
  const getErrorMessage = ({ message = '' }) => message
@@ -200,7 +213,7 @@ const getErrorMessage = ({ message = '' }) => message
200
213
  * @function isCommandError
201
214
  * @description
202
215
  * Determine whether an error is a safe non-zero exit from a Git command
203
- * @param {{code?: number, message?: string}} e
216
+ * @param {{code?: string | number, message?: string}} e
204
217
  * @returns {boolean}
205
218
  */
206
219
  function isCommandError (e) {
package/tsconfig.json CHANGED
@@ -5,7 +5,10 @@
5
5
  "allowJs": true,
6
6
  "checkJs": true,
7
7
  "noEmit": true,
8
- "strict": true
8
+ "strict": true,
9
+ "types": [
10
+ "node"
11
+ ]
9
12
  },
10
13
  "include": [
11
14
  "."
@@ -15,8 +18,5 @@
15
18
  ".github",
16
19
  ".husky",
17
20
  "test"
18
- ],
19
- "types": [
20
- "node"
21
21
  ]
22
22
  }