Comparing version 0.3.0 to 0.3.1
@@ -9,2 +9,9 @@ # {%= name %} {%= badge("fury") %} | ||
## Benchmarks | ||
```bash | ||
node benchmark | ||
``` | ||
## Usage | ||
@@ -11,0 +18,0 @@ |
15
index.js
@@ -42,3 +42,3 @@ /*! | ||
if (last == null) { | ||
return {}; | ||
return null; | ||
} | ||
@@ -54,12 +54,9 @@ if (typeof last === 'object') { | ||
function replaceStr(str, pattern, replacement) { | ||
var i, from = 0; | ||
while (str.indexOf(pattern, from) !== -1) { | ||
i = str.indexOf(pattern, from); | ||
from = i + pattern.length; | ||
str = str.substr(0, i) | ||
+ replacement | ||
+ str.substr(from, str.length); | ||
from = i + replacement.length; | ||
var i = str.indexOf(pattern); | ||
var end = i + pattern.length; | ||
str = str.substr(0, i) + replacement + str.substr(end, str.length); | ||
if (str.indexOf(pattern, end) !== -1) { | ||
str = replace(str, pattern, replacement); | ||
} | ||
return str; | ||
} |
{ | ||
"name": "get-value", | ||
"description": "Use property paths (`a.b.c`) get a nested value from an object.", | ||
"version": "0.3.0", | ||
"version": "0.3.1", | ||
"homepage": "https://github.com/jonschlinkert/get-value", | ||
@@ -31,2 +31,4 @@ "author": { | ||
"devDependencies": { | ||
"benchmarked": "^0.1.1", | ||
"getobject": "^0.1.0", | ||
"mocha": "*", | ||
@@ -59,2 +61,2 @@ "should": "^4.0.4", | ||
} | ||
} | ||
} |
@@ -10,2 +10,9 @@ # get-value [![NPM version](https://badge.fury.io/js/get-value.svg)](http://badge.fury.io/js/get-value) | ||
## Benchmarks | ||
```bash | ||
node benchmark | ||
``` | ||
## Usage | ||
@@ -64,2 +71,2 @@ | ||
_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on October 18, 2014._ | ||
_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on October 26, 2014._ |
@@ -24,6 +24,6 @@ /*! | ||
it('should return an empty object if the path is not found', function () { | ||
it('should return `null` if the path is not found', function () { | ||
var fixture = {}; | ||
get(fixture, 'a.locals.name').should.eql({}); | ||
get(fixture, 'b.locals.name').should.eql({}); | ||
(get(fixture, 'a.locals.name') == null).should.be.true; | ||
(get(fixture, 'b.locals.name') == null).should.be.true; | ||
}); | ||
@@ -30,0 +30,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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
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
22685
34
701
70
6
1