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

seamless-immutable-mergers

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

seamless-immutable-mergers - npm Package Compare versions

Comparing version 3.0.0 to 3.0.2

2

bower.json
{
"name": "seamless-immutable-mergers",
"version": "3.0.0",
"version": "3.0.2",
"description": "A collection of merger functions for seamless-immutable.",

@@ -5,0 +5,0 @@ "main": "seamless-immutable-mergers.js",

{
"name": "seamless-immutable-mergers",
"version": "3.0.0",
"version": "3.0.2",
"description": "A collection of merger functions for seamless-immutable.",

@@ -5,0 +5,0 @@ "main": "seamless-immutable-mergers.js",

@@ -157,3 +157,9 @@ seamless-immutable-mergers

## Major and minor releases
## Releases
### 3.0.2
Fixed a bug in *updatingByIdArrayMerger* where a merge with an empty array would wipe the content of the current array.
### 3.0.0
Updated to *[seamless-immutable](https://github.com/rtfeldman/seamless-immutable)* 3.0.0 and bumped the major version to be in sync.
### 2.2.0

@@ -160,0 +166,0 @@ Started using the UMD pattern so the library will be easy to consume as a global or with requirejs (and not only node/browserify).

@@ -30,3 +30,4 @@ "use strict";

if (!(current instanceof Array) || !(other instanceof Array)) return;
if (current.length === 0 || other.length === 0) return;
if (current.length === 0) return;
if (other.length === 0) return current;

@@ -33,0 +34,0 @@ var identifier = config.mergerObjectIdentifier;

@@ -187,2 +187,63 @@ "use strict";

});
it("doesn't empty an array when the push contains an empty array", function() {
var current = immutable({
array: [
{
id: 10,
status: "ok",
content: "text",
items: [
{
id: 100,
status: "ok",
content: "text"
}
]
}
]
});
var update = {
array: []
};
var result = current.merge(update, config);
assert.equal(result.array.length, 1);
});
it("doesn't deeply empty an array when the push contains an empty array", function() {
var current = immutable({
array: [
{
id: 10,
status: "ok",
content: "text",
items: [
{
id: 100,
status: "ok",
content: "text"
}
]
}
]
});
var update = {
array: [
{
id: 10,
items: []
}
]
};
var result = current.merge(update, config);
assert.equal(result.array.length, 1);
var resultObject = result.array[0];
var items = resultObject.items;
assert.equal(items.length, 1);
});
});
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