+5
-0
| # Changelog | ||
| ## [v0.10.0] | ||
| > Jan 1, 2016 | ||
| - `scour#extend()` - override non-objects. | ||
| ## [v0.9.3] | ||
@@ -4,0 +9,0 @@ > Dec 30, 2015 |
+14
-5
@@ -539,5 +539,4 @@ /* eslint-disable new-cap */ | ||
| * extend : extend(objects...) | ||
| * Extends the data with more values. Returns a [scour]-wrapped object. Only | ||
| * supports objects; arrays and non-objects will return undefined. Just like | ||
| * [Object.assign], you may pass multiple objects to the parameters. | ||
| * Extends the data with more values. Returns a [scour]-wrapped object. Just | ||
| * like [Object.assign], you may pass multiple objects to the parameters. | ||
| * | ||
@@ -550,2 +549,10 @@ * data = { a: 1, b: 2 } | ||
| * | ||
| * When used with anything non-object, it will be overridden. | ||
| * | ||
| * data = {} | ||
| * db = scour(data) | ||
| * db = db.go('state').extend({ pressed: true }).root | ||
| * | ||
| * db.value // => { state: { pressed: true } } | ||
| * | ||
| * See [set()] for more information on working with immutables. | ||
@@ -555,5 +562,7 @@ */ | ||
| extend: function extend() { | ||
| if (_typeof(this.value) !== 'object' || Array.isArray(this.value)) return; | ||
| var result = {}; | ||
| assign(result, this.value); | ||
| if (_typeof(this.value) === 'object' && !Array.isArray(this.value)) { | ||
| assign(result, this.value); | ||
| } | ||
| for (var i = 0, len = arguments.length; i < len; i++) { | ||
@@ -560,0 +569,0 @@ if (_typeof(arguments[i]) !== 'object') return; |
+1
-1
| { | ||
| "name": "scourjs", | ||
| "description": "Traverse objects and arrays", | ||
| "version": "0.9.3", | ||
| "version": "0.10.0", | ||
| "author": "Rico Sta. Cruz <rico@ricostacruz.com>", | ||
@@ -6,0 +6,0 @@ "babel": { |
+12
-3
@@ -603,5 +603,4 @@ # scour.js | ||
| Extends the data with more values. Returns a [scour]-wrapped object. Only | ||
| supports objects; arrays and non-objects will return undefined. Just like | ||
| [Object.assign], you may pass multiple objects to the parameters. | ||
| Extends the data with more values. Returns a [scour]-wrapped object. Just | ||
| like [Object.assign], you may pass multiple objects to the parameters. | ||
@@ -618,2 +617,12 @@ ```js | ||
| When used with anything non-object, it will be overridden. | ||
| ```js | ||
| data = {} | ||
| db = scour(data) | ||
| db = db.go('state').extend({ pressed: true }).root | ||
| db.value // => { state: { pressed: true } } | ||
| ``` | ||
| See [set()] for more information on working with immutables. | ||
@@ -620,0 +629,0 @@ |
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
533568
0.07%4336
0.18%1130
0.8%