expand-object
Advanced tools
Comparing version 0.3.1 to 0.3.2
15
index.js
@@ -30,2 +30,17 @@ 'use strict'; | ||
var i = str.indexOf(':'); | ||
var key = str.slice(0, i); | ||
var val = str.slice(i + 1); | ||
if (/\w+,\w+,/.test(val)) { | ||
var obj = {}; | ||
obj[key] = toArray(val).map(function (ele) { | ||
if (~ele.indexOf(':')) { | ||
return expandObject({}, ele); | ||
} | ||
return ele; | ||
}); | ||
return obj; | ||
} | ||
return toArray(str).map(function (ele) { | ||
@@ -32,0 +47,0 @@ return expandObject({}, ele); |
{ | ||
"name": "expand-object", | ||
"description": "Expand a string into a JavaScript object using a simple notation. Use the CLI or as a node.js lib.", | ||
"version": "0.3.1", | ||
"version": "0.3.2", | ||
"homepage": "https://github.com/jonschlinkert/expand-object", | ||
@@ -6,0 +6,0 @@ "author": "Jon Schlinkert (https://github.com/jonschlinkert)", |
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
11212
179