jsir 2.1.2 → 2.1.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/cmd/oaa.js +1 -1
- package/deps/util.js +8 -3
- package/package.json +1 -1
package/cmd/oaa.js
CHANGED
package/deps/util.js
CHANGED
|
@@ -36,16 +36,20 @@ const $draft = str => {
|
|
|
36
36
|
}
|
|
37
37
|
const $fnCache = {}
|
|
38
38
|
|
|
39
|
-
function isArgsMatch(text, args, callback, useMd5
|
|
39
|
+
function isArgsMatch(text, args, callback, useMd5) {
|
|
40
40
|
let match = false
|
|
41
41
|
for (let arg of args) {
|
|
42
42
|
let r = true
|
|
43
43
|
for (let str of arg.split(',').map(trim).filter(i => i)) {
|
|
44
44
|
let reg = new RegExp(str.split(/\s+/).join('\\s+'), 'i')
|
|
45
|
-
if (
|
|
46
|
-
|
|
45
|
+
if (useMd5 && /^0x[a-z\d]{8}$/.test(str)) {
|
|
46
|
+
if (('0x' + md5(text).substr(0, 8)) === str) {
|
|
47
|
+
break
|
|
48
|
+
}
|
|
49
|
+
} else if (reg.test(text)){
|
|
47
50
|
break
|
|
48
51
|
}
|
|
52
|
+
r = false
|
|
49
53
|
}
|
|
50
54
|
if (r) {
|
|
51
55
|
match = true
|
|
@@ -413,6 +417,7 @@ function getConfig(key, defaultVal) {
|
|
|
413
417
|
if (!(key in config)) {
|
|
414
418
|
writeFlag = true
|
|
415
419
|
config[key] = null
|
|
420
|
+
warn(`require config "${key}" in ${configFile}`)
|
|
416
421
|
}
|
|
417
422
|
if (writeFlag) {
|
|
418
423
|
fs.writeFileSync(configFile, JSON.stringify(config, null, 2))
|