Comparing version 0.0.6 to 0.0.7
{ | ||
"name": "splitargs", | ||
"version": "0.0.6", | ||
"version": "0.0.7", | ||
"description": "Splits strings into tokens by given separator except treating quoted part as a single token.", | ||
@@ -5,0 +5,0 @@ "main": "splitargs.js", |
@@ -38,5 +38,4 @@ /** | ||
} else if (!!sep) { | ||
ret.push(''); | ||
ret.push(element); | ||
} | ||
} else { | ||
@@ -46,5 +45,5 @@ tokenBuffer.push(element); | ||
} | ||
if (tokenBuffer && tokenBuffer.length > 0) { | ||
if (tokenBuffer.length > 0) { | ||
ret.push(tokenBuffer.join('')); | ||
} else { | ||
} else if (!!sep) { | ||
ret.push(''); | ||
@@ -51,0 +50,0 @@ } |
@@ -17,5 +17,5 @@ /** | ||
it('should split double quoted string', function () { | ||
var i = "I said 'I am sorry.', and he said \"it doesn't matter.\""; | ||
var i = " I said 'I am sorry.', and he said \"it doesn't matter.\" "; | ||
var o = splitargs(i); | ||
expect(o.length).toBe(7); | ||
expect(7).toBe(o.length); | ||
expect(o[0]).toBe("I"); | ||
@@ -22,0 +22,0 @@ expect(o[1]).toBe("said"); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6232