intertype
Advanced tools
Comparing version
@@ -371,10 +371,12 @@ (function() { | ||
//....................................................................................................... | ||
if ((create == null) && (cfg != null)) { | ||
if ((t = H.js_type_of(R)) === '[object Object]' || t === '[object Array]') { | ||
R = Object.assign(H.deep_copy(R), cfg); | ||
if (create == null) { | ||
if (cfg != null) { | ||
if ((t = H.js_type_of(R)) === '[object Object]' || t === '[object Array]') { | ||
R = Object.assign(H.deep_copy(R), cfg); | ||
} else { | ||
R = cfg; | ||
} | ||
} else { | ||
R = cfg; | ||
R = H.deep_copy(R); | ||
} | ||
} else { | ||
R = H.deep_copy(R); | ||
} | ||
@@ -381,0 +383,0 @@ //....................................................................................................... |
{ | ||
"name": "intertype", | ||
"version": "0.102.1", | ||
"version": "0.102.2", | ||
"description": "A JavaScript typechecker", | ||
@@ -5,0 +5,0 @@ "main": "lib/main.js", |
@@ -22,2 +22,3 @@ | ||
- [Intertype `state` Property](#intertype-state-property) | ||
- [Intertype `cast`](#intertype-cast) | ||
- [Intertype `create`](#intertype-create) | ||
@@ -653,2 +654,9 @@ - [Intertype `equals()`](#intertype-equals) | ||
* **[β]** phase out dollar sigil for field declarations; instead, use `fields` sub-object | ||
* **[β]** implement option to make result an instance of `GUY.props.Strict_owner` | ||
* **[β]** provide a way to add computed defaults (which are, strictly speaking, redundant, or | ||
denormalizations); e.g. a 'layout' might specify where to put 'pages' on a printing 'sheet'; from this | ||
arrangement we can deduce the pages per sheet ('pps') setting which is good to have around as a ready-made | ||
number (as opposed to having it to compute it on the fly, maybe repeatedly, from array lengths). Suggest | ||
to offer a method `prepare()` that will be called *before* field validation (the way that `create()` used | ||
to). Note that now we have `cast()`, `prepare()`, and `create()` to aid in value construction. | ||
@@ -655,0 +663,0 @@ ## Is Done |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
337322
0.24%1921
0.1%725
1.12%