intertype
Advanced tools
Comparing version 0.115.0 to 0.116.0
@@ -226,3 +226,3 @@ (function() { | ||
this.types.declare('deep_boolean', function(x) { | ||
return x === 'deep' || x === false || x === true; | ||
return x === false || x === true || x === 'deep' || x === 'shallow'; | ||
}); | ||
@@ -229,0 +229,0 @@ |
@@ -456,3 +456,3 @@ (function() { | ||
_create(type, cfg) { | ||
var R, create, t, type_dsc; | ||
var R, create, ref1, t, type_dsc; | ||
create = null; | ||
@@ -488,3 +488,3 @@ //....................................................................................................... | ||
//....................................................................................................... | ||
if (type_dsc.freeze === true) { | ||
if ((ref1 = type_dsc.freeze) === true || ref1 === 'shallow') { | ||
R = Object.freeze(R); | ||
@@ -491,0 +491,0 @@ } else if (type_dsc.freeze === 'deep') { |
{ | ||
"name": "intertype", | ||
"version": "0.115.0", | ||
"version": "0.116.0", | ||
"description": "A JavaScript typechecker", | ||
@@ -5,0 +5,0 @@ "main": "lib/main.js", |
@@ -275,8 +275,8 @@ | ||
in JS) | ||
* `true`: returned value will be a shallow freeze (implemented with | ||
* `true` or `'shallow'`: returned value will be a shallow freeze (implemented with | ||
[`Object.freeze()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/freeze)) | ||
* `deep`: returned value will be a deep-frozen version of the result returned by `{ defaults..., cfg..., | ||
}`. **Note** that in this preliminary version we will always freeze a deep copy (structural clone) of | ||
the `cfg` value so in no case will any nested list or object of the original `cfg` get inadvertantly | ||
frozen | ||
* `'deep'`: returned value will be a deep-frozen version of the result returned by `{ defaults..., | ||
cfg..., }`. **Note** that in this preliminary version we will always freeze a deep copy (structural | ||
clone) of the `cfg` value so in no case will any nested list or object of the original `cfg` get | ||
inadvertantly frozen | ||
@@ -283,0 +283,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
361635