New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

putil-merge

Package Overview
Dependencies
Maintainers
1
Versions
47
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

putil-merge - npm Package Compare versions

Comparing version 3.8.0 to 3.9.0

13

lib/merge.js

@@ -7,5 +7,4 @@ /* putil-merge

const isObjectOrClass = (v) => v && (
(typeof v === 'object' && !Array.isArray(v)) ||
(typeof v === 'function' && v.prototype && v.prototype.constructor));
const isObject = (v) => v && (
(typeof v === 'object' && !Array.isArray(v)));

@@ -26,7 +25,7 @@ /**

function merge(target, source, options = {}) {
if (!isObjectOrClass(target))
if (!isObject(target))
throw new TypeError('Property "target" requires object type');
if (!source)
return target;
if (!isObjectOrClass(source))
if (!isObject(source))
throw new TypeError('Property "source" requires object type');

@@ -64,5 +63,5 @@

let trgVal = target[key];
if (isObjectOrClass(srcVal)) {
if (isObject(srcVal)) {
if (options.deep) {
if (!isObjectOrClass(trgVal)) {
if (!isObject(trgVal)) {
descriptor.value = trgVal = {};

@@ -69,0 +68,0 @@ Object.defineProperty(target, key, descriptor);

{
"name": "putil-merge",
"description": "Lightweight solution for merging multiple objects into one. Also it supports deep merge and deep clone",
"version": "3.8.0",
"version": "3.9.0",
"author": "Panates Ltd.",

@@ -22,5 +22,7 @@ "contributors": [

"devDependencies": {
"eslint": "^8.8.0",
"@types/node": "^18.7.23",
"@types/mocha": "^9.1.1",
"eslint": "^8.24.0",
"eslint-config-google": "^0.14.0",
"mocha": "^9.2.0",
"mocha": "^10.0.0",
"nyc": "^15.1.0"

@@ -27,0 +29,0 @@ },

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