Comparing version 1.1.0 to 1.2.0
@@ -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 [![Build Status](https://travis-ci.org/dy/dotprop.svg?branch=master)](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 | ||
``` | ||
[![NPM](https://nodei.co/npm/dotprop.png?downloads=true&downloadRank=true&stars=true)](https://nodei.co/npm/dotprop/) |
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
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
3167
19
1