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

carnaval

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

carnaval - npm Package Compare versions

Comparing version 0.2.2 to 0.2.3

5

lib/Masker.js

@@ -36,2 +36,4 @@ class Masker {

_settleValue(destination, source, prop, Type, layer) {
destination = destination || {};
source = source || {};
layer = layer || {};

@@ -44,5 +46,2 @@ layer = layer.length ? layer[0] : layer;

const settled = {};
destination = destination || {};
source = source || {};
if (!destination[prop] && !source[prop]) {

@@ -49,0 +48,0 @@ return settled;

2

package.json
{
"name": "carnaval",
"version": "0.2.2",
"version": "0.2.3",
"repository": {

@@ -5,0 +5,0 @@ "type": "git",

@@ -311,2 +311,27 @@ const test = require('ava');

class Cart extends Domain {
get props() {
return {
gifts: [Gift]
};
}
}
test('assign deep array within array, touched (less)', t => {
const mask = Mask.cover(Cart);
const names = ['Shoes', 'Shirt', 'Jeans'];
const cart = new Cart({gifts: [new Gift({names}), new Gift({names})]});
const touched = mask.settle(
cart,
new Cart({gifts: [new Gift({names: ['Jeans', 'Shirt']})]})
);
t.deepEqual(cart.gifts[0].names, ['Shoes', 'Shirt', 'Jeans']);
t.deepEqual(cart.gifts[1].names, ['Shoes', 'Shirt', 'Jeans']);
t.deepEqual(touched.gifts[0].names, [true, false, true]);
t.deepEqual(touched.gifts[1].names, [true, true, true]);
});
class UnreferencedBoxes extends Domain {

@@ -313,0 +338,0 @@ get props() {

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