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.5 to 0.2.6

5

lib/Masker.js

@@ -53,3 +53,6 @@ class Masker {

const touched = layer[prop]._settleObject(destination[prop], source[prop], props, schema);
const holder = destination[prop] || {};
const touched = layer[prop]._settleObject(holder, source[prop], props, schema);
destination[prop] = new layer[prop].Clazz(holder);
if (touched) {

@@ -56,0 +59,0 @@ settled.touched = touched;

2

package.json
{
"name": "carnaval",
"version": "0.2.5",
"version": "0.2.6",
"repository": {

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

@@ -257,2 +257,50 @@ const test = require('ava');

test('assign empty deeply, touched & schema', t => {
const mask = Mask.cover(Box).with({
thing: {
physical: true
}
});
const physical = true;
const box = new Box();
const touched = mask.settle(
box,
new Box({thing: new Thing({physical})})
);
t.true(box.thing instanceof Thing);
t.is(box.thing.name, undefined);
t.is(box.thing.description, undefined);
t.is(box.thing.size, undefined);
t.is(box.thing.physical, physical);
t.is(touched.thing, undefined);
});
test('assign empty tuned deeply, touched & schema', t => {
const mask = Mask.cover(Box).with({
thing: Mask.cover(Thing).with({
physical: true
})
});
const physical = true;
const box = new Box();
const touched = mask.settle(
box,
new Box({thing: new Thing({physical})})
);
t.true(box.thing instanceof Thing);
t.is(box.thing.name, undefined);
t.is(box.thing.description, undefined);
t.is(box.thing.size, undefined);
t.is(box.thing.physical, physical);
t.is(touched.thing, undefined);
});
class Shipping extends Domain {

@@ -367,3 +415,3 @@ get props() {

const boxes = new Boxes({things: []});
mask.settle(
const touched = mask.settle(
boxes,

@@ -378,2 +426,5 @@ new Boxes(({things: [new Thing({name: 'overriden', description, physical})]}))

t.is(boxes.things[0].physical, physical);
t.true(touched.things[0].name);
t.true(touched.things[0].description);
});

@@ -380,0 +431,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