Comparing version
@@ -12,3 +12,3 @@ /** | ||
if (propName == null || !holder) return holder; | ||
var propParts = (propName + '').split('.'); | ||
var propParts = Array.isArray(propName) ? propName : (propName + '').split('.'); | ||
var result = holder, lastPropName; | ||
@@ -15,0 +15,0 @@ |
{ | ||
"name": "dotprop", | ||
"version": "1.1.0", | ||
"version": "1.2.0", | ||
"description": "Get property value by dot notation", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -12,4 +12,8 @@ # dotprop [](https://travis-ci.org/dy/dotprop) | ||
getProp({}, 'a.b') // undefined | ||
// recognizes arrays too | ||
getProp({a: { b: { c: 1}} }, ['a', 'b', 'c']) // 1 | ||
getProp({a: { 'b.c': 1 }}, ['a', 'b.c']) // 1 | ||
``` | ||
[](https://nodei.co/npm/dotprop/) |
AI-detected possible typosquat
Supply chain riskAI has identified this package as a potential typosquat of a more popular package. This suggests that the package may be intentionally mimicking another package's name, description, or other metadata.
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
3167
5.46%19
26.67%2
Infinity%