group-array
Advanced tools
Comparing version 0.3.2 to 0.3.3
25
index.js
@@ -10,4 +10,5 @@ /*! | ||
var split = require('split-string'); | ||
var flatten = require('arr-flatten'); | ||
var union = require('union-value'); | ||
var flatten = require('arr-flatten'); | ||
var forOwn = require('for-own'); | ||
@@ -59,3 +60,4 @@ var typeOf = require('kind-of'); | ||
case 'number': | ||
union(groups, String(val), obj); | ||
case 'boolean': | ||
union(groups, escape(String(val)), obj); | ||
break; | ||
@@ -76,7 +78,7 @@ case 'object': | ||
val.forEach(function(key) { | ||
union(groups, key, obj); | ||
union(groups, escape(key), obj); | ||
}); | ||
} else { | ||
forOwn(val, function(v, key) { | ||
union(groups, key, obj); | ||
union(groups, escape(key), obj); | ||
}); | ||
@@ -97,2 +99,17 @@ } | ||
function escape(str) { | ||
var opts = { | ||
strict: false, | ||
keepEscaping: true, | ||
keepDoubleQuotes: true, | ||
keepSingleQuotes: true | ||
}; | ||
try { | ||
return split(str, opts).join('\\.'); | ||
} catch (err) { | ||
return str; | ||
} | ||
} | ||
/** | ||
@@ -99,0 +116,0 @@ * Expose `groupArray` |
{ | ||
"name": "group-array", | ||
"description": "Group array of objects into lists.", | ||
"version": "0.3.2", | ||
"version": "0.3.3", | ||
"homepage": "https://github.com/doowb/group-array", | ||
"author": "Brian Woodward (https://github.com/doowb)", | ||
"contributors": [ | ||
"Brian Woodward <brian.woodward@gmail.com> (https://github.com/doowb)", | ||
"Brian Woodward <brian.woodward@gmail.com> (https://twitter.com/doowb)", | ||
"Chris Kirk (http://www.chrispkirk.com)", | ||
@@ -32,2 +32,3 @@ "Jon Schlinkert <jon.schlinkert@sellside.com> (http://twitter.com/jonschlinkert)" | ||
"kind-of": "^3.1.0", | ||
"split-string": "^1.0.1", | ||
"union-value": "^0.2.3" | ||
@@ -34,0 +35,0 @@ }, |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
14318
98
0
6
+ Addedsplit-string@^1.0.1
+ Addedsplit-string@1.0.1(transitive)