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

sinks

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sinks - npm Package Compare versions

Comparing version 3.0.2 to 3.0.3

12

dist/index.js

@@ -41,8 +41,10 @@ var dlv = require('dlv');

};
var isInt = function isInt(str) {
return /^\d+$/.test(str);
};
var stripBrackets = function stripBrackets(str) {
return str.replace(/[[\]]/g, '');
};
var injectBrackets = function injectBrackets(str) {
if (!str) return str;
var split = str.split('.');
return ["[" + split[0] + "]"].concat(split.slice(1)).join('.');
};

@@ -265,3 +267,5 @@ // Modified version of clean-set (https://github.com/fwilkerson/clean-set)

for (var otherKey in otherChanges) {
changes[(isInt(key) ? "[" + key + "]" : key) + '.' + otherKey] = otherChanges[otherKey];
var value = otherChanges[otherKey];
var isArray = Array.isArray(modified[key]);
changes[key + '.' + (isArray ? injectBrackets(otherKey) : otherKey)] = value;
}

@@ -268,0 +272,0 @@ } else {

@@ -37,4 +37,8 @@ import dlv from 'dlv';

};
const isInt = str => /^\d+$/.test(str);
const stripBrackets = str => str.replace(/[[\]]/g, '');
const injectBrackets = str => {
if (!str) return str;
const split = str.split('.');
return [`[${split[0]}]`, ...split.slice(1)].join('.');
};

@@ -225,3 +229,5 @@ // Modified version of clean-set (https://github.com/fwilkerson/clean-set)

for (const otherKey in otherChanges) {
changes[(isInt(key) ? `[${key}]` : key) + '.' + otherKey] = otherChanges[otherKey];
const value = otherChanges[otherKey];
const isArray = Array.isArray(modified[key]);
changes[key + '.' + (isArray ? injectBrackets(otherKey) : otherKey)] = value;
}

@@ -228,0 +234,0 @@ } else {

@@ -37,8 +37,10 @@ import dlv from 'dlv';

};
var isInt = function isInt(str) {
return /^\d+$/.test(str);
};
var stripBrackets = function stripBrackets(str) {
return str.replace(/[[\]]/g, '');
};
var injectBrackets = function injectBrackets(str) {
if (!str) return str;
var split = str.split('.');
return ["[" + split[0] + "]"].concat(split.slice(1)).join('.');
};

@@ -261,3 +263,5 @@ // Modified version of clean-set (https://github.com/fwilkerson/clean-set)

for (var otherKey in otherChanges) {
changes[(isInt(key) ? "[" + key + "]" : key) + '.' + otherKey] = otherChanges[otherKey];
var value = otherChanges[otherKey];
var isArray = Array.isArray(modified[key]);
changes[key + '.' + (isArray ? injectBrackets(otherKey) : otherKey)] = value;
}

@@ -264,0 +268,0 @@ } else {

@@ -44,8 +44,10 @@ (function (global, factory) {

};
var isInt = function isInt(str) {
return /^\d+$/.test(str);
};
var stripBrackets = function stripBrackets(str) {
return str.replace(/[[\]]/g, '');
};
var injectBrackets = function injectBrackets(str) {
if (!str) return str;
var split = str.split('.');
return ["[" + split[0] + "]"].concat(split.slice(1)).join('.');
};

@@ -268,3 +270,5 @@ // Modified version of clean-set (https://github.com/fwilkerson/clean-set)

for (var otherKey in otherChanges) {
changes[(isInt(key) ? "[" + key + "]" : key) + '.' + otherKey] = otherChanges[otherKey];
var value = otherChanges[otherKey];
var isArray = Array.isArray(modified[key]);
changes[key + '.' + (isArray ? injectBrackets(otherKey) : otherKey)] = value;
}

@@ -271,0 +275,0 @@ } else {

{
"name": "sinks",
"version": "3.0.2",
"version": "3.0.3",
"description": "Tools for object sync (get it?!), validation, diffing, and immutable deep setting",

@@ -5,0 +5,0 @@ "source": "src/index.js",

@@ -320,2 +320,3 @@ # sinks

- `3.0.3`: Fixed bug where `getChanges` not handle objects with integer keys correctly.
- `3.0.2`: Fix bad prepublish script.

@@ -322,0 +323,0 @@ - `3.0.1`: Removing unnecessary conditional check.

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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