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

baobab

Package Overview
Dependencies
Maintainers
1
Versions
64
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

baobab - npm Package Compare versions

Comparing version 2.3.2 to 2.3.3

4

CHANGELOG.md
# Changelog
## v2.3.3
* Fixing again an issue concerning merging an monkeys (thanks to [@abalmos](https://github.com/abalmos) and [@Zache](https://github.com/Zache)).
## v2.3.2

@@ -4,0 +8,0 @@

9

dist/baobab.js

@@ -390,9 +390,14 @@ /**

var realOperation = operation;
if (/merge/.test(operation.type)) {
if (/merge/i.test(operation.type)) {
var monkeysNode = getIn(this._monkeys, solvedPath).data;
if (_type2['default'].object(monkeysNode)) {
// Cloning the operation not to create weird behavior for the user
realOperation = shallowClone(realOperation);
if (/deep/.test(realOperation.type)) realOperation.value = deepMerge({}, deepClone(monkeysNode), realOperation.value);else realOperation.value = shallowMerge({}, deepClone(monkeysNode), realOperation.value);
// Fetching the existing node in the current data
var currentNode = getIn(this._data, solvedPath).data;
if (/deep/i.test(realOperation.type)) realOperation.value = deepMerge({}, deepMerge({}, currentNode, deepClone(monkeysNode)), realOperation.value);else realOperation.value = shallowMerge({}, deepMerge({}, currentNode, deepClone(monkeysNode)), realOperation.value);
}

@@ -399,0 +404,0 @@ }

{
"name": "baobab",
"version": "2.3.2",
"version": "2.3.3",
"description": "JavaScript persistent data tree with cursors.",

@@ -10,3 +10,3 @@ "main": "./dist/baobab.js",

"devDependencies": {
"@yomguithereal/eslint-config": "^1.1.0",
"@yomguithereal/eslint-config": "^1.1.1",
"add-banner": "^0.1.0",

@@ -13,0 +13,0 @@ "async": "^1.2.1",

@@ -371,12 +371,23 @@ /**

let realOperation = operation;
if (/merge/.test(operation.type)) {
if (/merge/i.test(operation.type)) {
const monkeysNode = getIn(this._monkeys, solvedPath).data;
if (type.object(monkeysNode)) {
// Cloning the operation not to create weird behavior for the user
realOperation = shallowClone(realOperation);
if (/deep/.test(realOperation.type))
realOperation.value = deepMerge({}, deepClone(monkeysNode), realOperation.value);
// Fetching the existing node in the current data
const currentNode = getIn(this._data, solvedPath).data;
if (/deep/i.test(realOperation.type))
realOperation.value = deepMerge({},
deepMerge({}, currentNode, deepClone(monkeysNode)),
realOperation.value
);
else
realOperation.value = shallowMerge({}, deepClone(monkeysNode), realOperation.value);
realOperation.value = shallowMerge({},
deepMerge({}, currentNode, deepClone(monkeysNode)),
realOperation.value
);
}

@@ -383,0 +394,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