@modernpoacher/deps 2.1.9 → 2.1.11
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/bin/common/index.mjs +4 -4
- package/package.json +1 -1
- package/src/common/git/index.mjs +23 -23
- package/src/common/index.mjs +3 -1
- package/src/index.mjs +6 -8
package/bin/common/index.mjs
CHANGED
|
@@ -53,9 +53,9 @@ const CODE = 0
|
|
|
53
53
|
|
|
54
54
|
const MESSAGE = 'Either no error message has been defined or no error has been supplied'
|
|
55
55
|
|
|
56
|
-
const tidy = (v) => v.replace(/\n
|
|
56
|
+
export const tidy = (v) => v.replace(/\n{2,}}/gm, String.fromCharCode(10)).trim()
|
|
57
57
|
|
|
58
|
-
const trim = (v) => v.split(
|
|
58
|
+
export const trim = (v) => v.split(String.fromCharCode(10)).map((v) => v.trimEnd()).join(String.fromCharCode(10)).trim()
|
|
59
59
|
|
|
60
60
|
const toRelativePath = (to) => relative(process.cwd(), to) // const toRelativePath = relative.bind(null, process.cwd())
|
|
61
61
|
|
|
@@ -95,10 +95,10 @@ export function use (key) {
|
|
|
95
95
|
const log = debug(`@modernpoacher/deps:${key}`)
|
|
96
96
|
|
|
97
97
|
return function use (v) {
|
|
98
|
-
if (v.includes(
|
|
98
|
+
if (v.includes(String.fromCharCode(10))) v.split(String.fromCharCode(10)).map((s) => s.trimEnd()).filter(Boolean).forEach((s) => { log(s) })
|
|
99
99
|
else {
|
|
100
100
|
const s = v.trim()
|
|
101
|
-
if (s !== '') log(
|
|
101
|
+
if (s !== '') log(v.trimEnd())
|
|
102
102
|
}
|
|
103
103
|
}
|
|
104
104
|
}
|
package/package.json
CHANGED
package/src/common/git/index.mjs
CHANGED
|
@@ -57,45 +57,45 @@ const log = debug('@modernpoacher/deps')
|
|
|
57
57
|
|
|
58
58
|
log(`\`git\` (${VERSION} - ${PLATFORM}) is awake`)
|
|
59
59
|
|
|
60
|
-
const trim = (v) => v.split(
|
|
60
|
+
const trim = (v) => v.split(String.fromCharCode(10)).map((v) => v.trimEnd()).join(String.fromCharCode(10)).trim()
|
|
61
61
|
|
|
62
|
-
function
|
|
62
|
+
function isFatal (s) {
|
|
63
|
+
return s.toLowerCase().startsWith('fatal: not a git repository')
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export function use (key) {
|
|
63
67
|
const log = debug(`@modernpoacher/deps:${key}`)
|
|
64
68
|
|
|
65
69
|
return function use (v) {
|
|
66
|
-
if (v.
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
log(
|
|
70
|
-
|
|
70
|
+
if (v.includes(String.fromCharCode(10))) v.split(String.fromCharCode(10)).map((s) => s.trimEnd()).filter(Boolean).forEach((s) => { log(s) })
|
|
71
|
+
else {
|
|
72
|
+
const s = v.trim()
|
|
73
|
+
if (s !== '') log(v.trimEnd())
|
|
74
|
+
}
|
|
71
75
|
}
|
|
72
76
|
}
|
|
73
77
|
|
|
74
|
-
function out (key, directory) {
|
|
78
|
+
export function out (key, directory) {
|
|
75
79
|
const log = debug(`@modernpoacher/deps:${key}`)
|
|
76
80
|
|
|
77
81
|
return function out (v) {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
log(trim(s))
|
|
84
|
-
)
|
|
82
|
+
if (v.includes(String.fromCharCode(10))) v.split(String.fromCharCode(10)).map((s) => s.trimEnd()).filter(Boolean).filter((s) => directory !== s).forEach((s) => { log(s) })
|
|
83
|
+
else {
|
|
84
|
+
const s = v.trim()
|
|
85
|
+
if (s !== '' && directory !== s) log(v.trimEnd())
|
|
86
|
+
}
|
|
85
87
|
}
|
|
86
88
|
}
|
|
87
89
|
|
|
88
|
-
function err (key, directory) {
|
|
90
|
+
export function err (key, directory) {
|
|
89
91
|
const log = debug(`@modernpoacher/deps:${key}`)
|
|
90
92
|
|
|
91
93
|
return function err (v) {
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
log(trim(s))
|
|
98
|
-
)
|
|
94
|
+
if (v.includes(String.fromCharCode(10))) v.split(String.fromCharCode(10)).map((s) => s.trimEnd()).filter(Boolean).filter((s) => directory !== s).filter((s) => !isFatal(s)).forEach((s) => { log(s) })
|
|
95
|
+
else {
|
|
96
|
+
const s = v.trim()
|
|
97
|
+
if (s !== '' && directory !== s && !isFatal(s)) log(v.trimEnd())
|
|
98
|
+
}
|
|
99
99
|
}
|
|
100
100
|
}
|
|
101
101
|
|
package/src/common/index.mjs
CHANGED
|
@@ -70,7 +70,9 @@ const log = debug('@modernpoacher/deps')
|
|
|
70
70
|
|
|
71
71
|
log(`\`common\` (${VERSION} - ${PLATFORM}) is awake at "${PATH}"`)
|
|
72
72
|
|
|
73
|
-
const tidy = (v) => v.replace(/\n{2,}}/gm, String.fromCharCode(10)).trim()
|
|
73
|
+
export const tidy = (v) => v.replace(/\n{2,}}/gm, String.fromCharCode(10)).trim()
|
|
74
|
+
|
|
75
|
+
export const trim = (v) => v.split(String.fromCharCode(10)).map((v) => v.trimEnd()).join(String.fromCharCode(10)).trim()
|
|
74
76
|
|
|
75
77
|
/**
|
|
76
78
|
* @function getSaveProdParameter
|
package/src/index.mjs
CHANGED
|
@@ -45,17 +45,15 @@ const log = debug('@modernpoacher/deps')
|
|
|
45
45
|
|
|
46
46
|
log(`\`deps\` (${VERSION} - ${PLATFORM}) is awake`)
|
|
47
47
|
|
|
48
|
-
function use (key) {
|
|
48
|
+
export function use (key) {
|
|
49
49
|
const log = debug(`@modernpoacher/deps:${key}`)
|
|
50
50
|
|
|
51
51
|
return function use (v) {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
log(s)
|
|
58
|
-
)
|
|
52
|
+
if (v.includes(String.fromCharCode(10))) v.split(String.fromCharCode(10)).map((s) => s.trimEnd()).filter(Boolean).forEach((s) => { log(s) })
|
|
53
|
+
else {
|
|
54
|
+
const s = v.trim()
|
|
55
|
+
if (s !== '') log(v.trimEnd())
|
|
56
|
+
}
|
|
59
57
|
}
|
|
60
58
|
}
|
|
61
59
|
|