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

boxed-immutable

Package Overview
Dependencies
Maintainers
1
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

boxed-immutable - npm Package Compare versions

Comparing version 0.2.6 to 0.2.8

2

lib/boxed-immutable.js

@@ -460,3 +460,3 @@ /** internal

const isArrayEnd = prop !== wrappedProp && prop === BOXED_ARRAY_END;
const isArrayEnd = prop === BOXED_ARRAY_END;

@@ -463,0 +463,0 @@ // can't have boxed values here

{
"name": "boxed-immutable",
"version": "0.2.6",
"version": "0.2.8",
"private": false,

@@ -5,0 +5,0 @@ "description": "Immutable proxy wrapper with auto-vivification",

@@ -102,4 +102,4 @@ # boxed-immutable

empty["_$"] = 5;
empty[_$] = 5; // depending on how function is converted to string this may accept any function, not just box.
empty._$ = 5; // simplest and safest alternative
empty[_$] = 5;
empty._$ = 5; // simplest alternative
// result: [5]

@@ -106,0 +106,0 @@

@@ -550,2 +550,56 @@ "use strict";

describe('Boxed Empty Array Append to End with [""]', () => {
let origVal;
let boxedVal;
let boxedProxy;
beforeAll(() => {
let vals = createBoxed([]);
origVal = vals.origVal;
boxedVal = vals.boxedVal;
boxedProxy = vals.boxedProxy;
boxedProxy[""] = 5;
});
test('is proxied', () => {
expect(boxedProxy).not.toBe(undefined);
});
test('._$ proxy is proxy', () => {
expect(boxedProxy._$).toBe(boxedProxy);
});
test('valueOf() === value', () => {
expect(boxedVal.valueOf()).toBe(boxedVal.value);
});
test('value === original', () => {
expect(boxedVal.value).not.toBe(origVal);
});
test('value === modified', () => {
expect(boxedVal.value).toEqual([5]);
});
test('modified$_$ is value', () => {
expect(boxedProxy.modified$_$).toBe(boxedVal.value);
});
test('delta$_$ !== value', () => {
expect(boxedProxy.delta$_$).not.toBe(boxedVal.value);
});
test('delta$_$ == value', () => {
expect(boxedProxy.delta$_$).toEqual(boxedVal.value);
});
test('deepDelta$_$ !== value', () => {
expect(boxedProxy.delta$_$).not.toBe(boxedVal.value);
});
test('deepDelta$_$ == value', () => {
expect(boxedProxy.deepDelta$_$).toEqual(boxedVal.value);
});
});
describe('Boxed Empty Array Append to End with ["_$"]', () => {

@@ -552,0 +606,0 @@ let origVal;

@@ -6,2 +6,3 @@ # Version History

- [0.2.8](#028)
- [0.2.6](#026)

@@ -20,2 +21,6 @@ - [0.2.4](#024)

## 0.2.8
* Add: `boxedValue_$[""] = value;` as a synonym for `boxedValue_$[_$] = value;`
## 0.2.6

@@ -22,0 +27,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