Huge News!Announcing our $40M Series B led by Abstract Ventures.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.2 to 4.0.0

test/IgnoreArrayMerger.spec.js

7

package.json
{
"name": "seamless-immutable-mergers",
"version": "3.0.2",
"version": "4.0.0",
"description": "A collection of merger functions for seamless-immutable.",
"main": "seamless-immutable-mergers.js",
"dependencies": {
"seamless-immutable": "~3.0.0"
"seamless-immutable": "~4.0.2"
},
"browserDependencies": {
"seamless-immutable": "~3.0.0"
},
"devDependencies": {

@@ -13,0 +10,0 @@ "chai": "~1.9.2",

@@ -95,2 +95,32 @@ seamless-immutable-mergers

### ignoreArrayMerger
This is a simple merger that instead of replacing an array with another keeps the original one. Example:
```javascript
var immutable = require("seamless-immutable");
var mergers = reuqire("seamless-immutable-mergers");
var immutableObject = immutable({
title: "one",
items: [1, 2]
});
var otherObject = {
title: "two",
items: [3, 4]
};
var result = immutableObject.merge(otherObject, {merger: mergers.ignoreArrayMerger});
```
The result will be:
```javascript
{
title: "two",
items: [1, 2]
}
```
### updatingByIdArrayMerger

@@ -159,2 +189,5 @@ This is a merger that operates on arrays that contains objects with specified ids. It tries to merge each object in the target array with the object with the same id from the source array. Example:

## Releases
### 4.0.0
Added *ignoreArrayMerger*, updated to *[seamless-immutable](https://github.com/rtfeldman/seamless-immutable)* 4.0.2 and bumped the major version to be in sync.
### 3.0.2

@@ -161,0 +194,0 @@ Fixed a bug in *updatingByIdArrayMerger* where a merge with an empty array would wipe the content of the current array.

@@ -28,2 +28,8 @@ "use strict";

function ignoreArrayMerger(current, other) {
if (!(current instanceof Array) || !(other instanceof Array)) return;
return current;
}
function updatingByIdArrayMerger(current, other, config) {

@@ -60,4 +66,5 @@ if (!(current instanceof Array) || !(other instanceof Array)) return;

concatArrayMerger: concatArrayMerger,
updatingByIdArrayMerger: updatingByIdArrayMerger,
equalityArrayMerger: equalityArrayMerger
equalityArrayMerger: equalityArrayMerger,
ignoreArrayMerger: ignoreArrayMerger,
updatingByIdArrayMerger: updatingByIdArrayMerger
};

@@ -64,0 +71,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