You're Invited:Meet the Socket Team at RSAC and BSidesSF 2026, March 23–26.RSVP
Socket
Book a DemoSign in
Socket

scourjs

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

scourjs - npm Package Compare versions

Comparing version
0.9.3
to
0.10.0
+5
-0
HISTORY.md
# 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;

{
"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": {

@@ -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 @@