boxed-immutable
Advanced tools
Comparing version 0.2.6 to 0.2.8
@@ -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 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
159800
3521