boxed-immutable
Advanced tools
Comparing version 0.7.0 to 0.7.2
@@ -17,2 +17,3 @@ 'use strict'; | ||
createBox: boxed.createBox, | ||
defaultCanBox: boxed.defaultCanBox, | ||
boxState: boxed.boxState, | ||
@@ -19,0 +20,0 @@ boxOut: boxed.boxOut, |
{ | ||
"name": "boxed-immutable", | ||
"version": "0.7.0", | ||
"version": "0.7.2", | ||
"private": false, | ||
@@ -5,0 +5,0 @@ "description": "Immutable proxy wrapper with exception free access to nested properties and auto-instantiation of intermediate containers when nested properties are defined", |
@@ -48,7 +48,9 @@ "use strict"; | ||
const customBox = boxedImmutable.createBox({ | ||
canBox(value) { | ||
return !(value instanceof UnBoxable); | ||
} | ||
}); | ||
// non-pure Array or Object are now not boxed by default | ||
// const customBox = boxedImmutable.createBox({ | ||
// canBox(value) { | ||
// return !(value instanceof UnBoxable); | ||
// } | ||
// }); | ||
const customBox = boxedImmutable.box; | ||
@@ -55,0 +57,0 @@ describe("unboxable", () => { |
@@ -5,2 +5,3 @@ # Version History | ||
- [0.7.2](#072) | ||
- [0.7.0](#070) | ||
@@ -32,2 +33,21 @@ - [0.6.0](#060) | ||
## 0.7.2 | ||
* Change: by default only box values which are either non-object like or are pure `Array` or | ||
`Object`. This will store all others by reference. If the properties of particular class are | ||
desired to be persisted then define a custom box with your `canBox` function to test which | ||
values should be boxed. | ||
```javascript | ||
const boxedImmutable = require('boxed-immutable'); | ||
const createBox = boxedImmutable.createBox; | ||
const defaultCanBox = boxedImmutable.defaultCanBox; | ||
const _$ = createBox({ | ||
canBox(value, prop, collection) { | ||
return value instanceof YourType || defaultCanBox(value); | ||
} | ||
}); | ||
``` | ||
## 0.7.0 | ||
@@ -34,0 +54,0 @@ |
Sorry, the diff of this file is too big to display
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
240515
5584