Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

smart-setter

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

smart-setter - npm Package Compare versions

Comparing version 1.0.11 to 1.0.12

26

lib/smartSetter.js

@@ -43,2 +43,26 @@ 'use strict';

var fillWhereTargetNotPresent = function fillWhereTargetNotPresent(config) {
return function (source) {
if (config.isArrayOrList(source)) {
return source.map(fillWhereTargetNotPresent(config));
} else if (!config.isObjectOrMap(source)) {
return source;
} else {
var keys = config.getKeys(source);
if (keys) {
return keys.reduce(function (acc, key) {
var value = config.get(source, key);
if (key === '_replace') {
return config.merge(acc, fillWhereTargetNotPresent(config)(value));
} else {
return config.set(acc, key, fillWhereTargetNotPresent(config)(value));
}
}, config.emptyObjectOrMap());
} else {
return source;
}
}
};
};
var helper = function helper(config) {

@@ -51,3 +75,3 @@ return function (source) {

if (!config.isObjectOrMap(source)) return source;
if (target === null || target === undefined) return source;
if (target === null || target === undefined) return fillWhereTargetNotPresent(config)(source);
return config.getKeys(source).reduce(function (acc, key) {

@@ -54,0 +78,0 @@ var _ret = function () {

7

package.json
{
"name": "smart-setter",
"version": "1.0.11",
"version": "1.0.12",
"description": "create new object based on old object and set of modifications that can be applied at selective depths",

@@ -42,4 +42,5 @@ "main": "index.js",

"mocha": "^3.0.2",
"object-config-for-smart-setter": ""
}
"object-config-for-smart-setter": "^1.0.11"
},
"dependencies": {}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc