fix dupe name bug

This commit is contained in:
Cory Mawhorter
2018-04-07 19:36:50 +08:00
committed by Jun Yang
parent c6ff1f7911
commit aa54dad36e
3 changed files with 41 additions and 2 deletions
+3 -1
View File
@@ -36,7 +36,9 @@ module.exports = function (options) {
while ((match = valueRE.exec(argList.trim()))) {
var v = match[0]
var re = new RegExp(`${v}\\s*:`, 'g')
re.test(match.input) ? args.push(`'${v}'`) : args.push(v)
var keyMatch = re.exec(match.input)
var currentMatchIsKey = keyMatch && keyMatch.index === match.index
currentMatchIsKey ? args.push(`'${v}'`) : args.push(v)
}
this.name = name