Comparing version 3.0.0 to 3.0.1
@@ -16,5 +16,9 @@ /*! | ||
if (!isValidObject(target)) { | ||
return options.default != null ? options.default : target; | ||
return typeof options.default !== 'undefined' ? options.default : target; | ||
} | ||
if (typeof path === 'number') { | ||
path = String(path); | ||
} | ||
const isArray = Array.isArray(path); | ||
@@ -39,2 +43,5 @@ const isString = typeof path === 'string'; | ||
let prop = segs[idx]; | ||
if (typeof prop === 'number') { | ||
prop = String(prop); | ||
} | ||
@@ -41,0 +48,0 @@ while (prop && prop.slice(-1) === '\\') { |
{ | ||
"name": "get-value", | ||
"description": "Use property paths like 'a.b.c' to get a nested value from an object. Even works when keys have dots in them (no other dot-prop library can do this!).", | ||
"version": "3.0.0", | ||
"version": "3.0.1", | ||
"homepage": "https://github.com/jonschlinkert/get-value", | ||
@@ -30,2 +30,3 @@ "author": "Jon Schlinkert (https://github.com/jonschlinkert)", | ||
"getobject": "^0.1.0", | ||
"glob": "^7.1.2", | ||
"gulp-format-md": "^1.0.0", | ||
@@ -35,3 +36,5 @@ "micromatch": "^3.1.5", | ||
"mocha": "^3.5.3", | ||
"nyc": "^11.4.1" | ||
"nyc": "^11.4.1", | ||
"object-path": "^0.11.4", | ||
"write": "^1.0.3" | ||
}, | ||
@@ -38,0 +41,0 @@ "keywords": [ |
@@ -114,3 +114,3 @@ # get-value [![NPM version](https://img.shields.io/npm/v/get-value.svg?style=flat)](https://www.npmjs.com/package/get-value) [![NPM monthly downloads](https://img.shields.io/npm/dm/get-value.svg?style=flat)](https://npmjs.org/package/get-value) [![NPM total downloads](https://img.shields.io/npm/dt/get-value.svg?style=flat)](https://npmjs.org/package/get-value) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/get-value.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/get-value) | ||
The default value to return when get-value cannot result a value from the given object. | ||
The default value to return when get-value cannot resolve a value from the given object. | ||
@@ -239,26 +239,26 @@ ```js | ||
``` | ||
# benchmark/fixtures/deep.js (175 bytes) | ||
dot-prop x 954,982 ops/sec ±1.10% (90 runs sampled) | ||
get-value x 1,508,537 ops/sec ±1.18% (89 runs sampled) | ||
# deep (175 bytes) | ||
dot-prop x 883,166 ops/sec ±0.93% (86 runs sampled) | ||
get-value x 1,448,928 ops/sec ±1.53% (87 runs sampled) | ||
getobject x 213,797 ops/sec ±0.85% (90 runs sampled) | ||
object-path x 184,347 ops/sec ±2.48% (85 runs sampled) | ||
fastest is get-value | ||
fastest is get-value (by 339% avg) | ||
# benchmark/fixtures/root.js (210 bytes) | ||
dot-prop x 3,999,758 ops/sec ±0.93% (93 runs sampled) | ||
get-value x 17,115,009 ops/sec ±0.93% (87 runs sampled) | ||
# root (210 bytes) | ||
dot-prop x 3,905,828 ops/sec ±1.36% (87 runs sampled) | ||
get-value x 16,391,934 ops/sec ±1.43% (83 runs sampled) | ||
getobject x 1,200,021 ops/sec ±1.81% (88 runs sampled) | ||
object-path x 2,788,494 ops/sec ±1.81% (86 runs sampled) | ||
fastest is get-value | ||
fastest is get-value (by 623% avg) | ||
# benchmark/fixtures/shallow.js (84 bytes) | ||
dot-prop x 2,644,287 ops/sec ±0.88% (91 runs sampled) | ||
get-value x 3,521,349 ops/sec ±0.82% (91 runs sampled) | ||
# shallow (84 bytes) | ||
dot-prop x 2,553,558 ops/sec ±0.89% (89 runs sampled) | ||
get-value x 3,070,159 ops/sec ±0.88% (90 runs sampled) | ||
getobject x 726,670 ops/sec ±0.81% (86 runs sampled) | ||
object-path x 922,351 ops/sec ±2.05% (86 runs sampled) | ||
fastest is get-value | ||
fastest is get-value (by 219% avg) | ||
# benchmark/fixtures/escaped.js (149 bytes) | ||
dot-prop x 1,514,880 ops/sec ±0.81% (92 runs sampled) | ||
get-value x 1,732,718 ops/sec ±1.23% (88 runs sampled) | ||
fastest is get-value | ||
``` | ||
@@ -335,2 +335,10 @@ | ||
### Contributors | ||
| **Commits** | **Contributor** | | ||
| --- | --- | | ||
| 81 | [jonschlinkert](https://github.com/jonschlinkert) | | ||
| 2 | [ianwalter](https://github.com/ianwalter) | | ||
| 1 | [doowb](https://github.com/doowb) | | ||
### Author | ||
@@ -340,5 +348,5 @@ | ||
* [linkedin/in/jonschlinkert](https://linkedin.com/in/jonschlinkert) | ||
* [github/jonschlinkert](https://github.com/jonschlinkert) | ||
* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) | ||
* [LinkedIn Profile](https://linkedin.com/in/jonschlinkert) | ||
* [GitHub Profile](https://github.com/jonschlinkert) | ||
* [Twitter Profile](https://twitter.com/jonschlinkert) | ||
@@ -352,2 +360,2 @@ ### License | ||
_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on January 30, 2018._ | ||
_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on March 07, 2018._ |
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
16889
88
356
12