intertype
Advanced tools
Comparing version 0.101.5 to 0.101.6
@@ -138,2 +138,9 @@ (function() { | ||
//......................................................................................................... | ||
declare.nan({ | ||
isa: function(x) { | ||
return Number.isNaN(x); | ||
}, | ||
default: 0/0 | ||
}); | ||
//......................................................................................................... | ||
declare.negatable({ // numeric? numeral? | ||
@@ -140,0 +147,0 @@ isa: function(x) { |
@@ -193,3 +193,3 @@ (function() { | ||
convention for this method. */ | ||
var dsc; | ||
var dsc, dscv; | ||
dsc = this.type_factory.create_type(...P); | ||
@@ -199,3 +199,6 @@ this.registry[dsc.typename] = dsc; | ||
this.isa[dsc.typename] = new Proxy(dsc, this._get_hedge_sub_proxy_cfg(this)); | ||
this.validate[dsc.typename] = new Proxy(dsc, this._get_hedge_sub_proxy_cfg(this)); | ||
dscv = (x) => { | ||
return this._validate(dsc.typename, x); | ||
}; | ||
this.validate[dsc.typename] = new Proxy(dscv, this._get_hedge_sub_proxy_cfg(this)); | ||
if (dsc.collection) { | ||
@@ -313,3 +316,3 @@ this._collections.add(dsc.typename); | ||
//..................................................................................................... | ||
throw new E.Intertype_internal_error('^intertype.isa@9^', `unexpected return value from hedgemethod for hedge ${rpr(hedge)}: ${rpr(R)}`); | ||
throw new E.Intertype_internal_error('^intertype.isa@9^', `unexpected return value from hedgemethod for hedge ${rpr(hedge)}: ${rpr(result)}`); | ||
} | ||
@@ -316,0 +319,0 @@ //....................................................................................................... |
@@ -141,10 +141,7 @@ (function() { | ||
this.hub.push_hedgeresult(['▲nt2', this.hub.state.isa_depth, dsc.name, x, R]); | ||
if ((this.hub.state.verb === 'validate') && (this.hub.state.hedges.length === 1)) { | ||
return x; | ||
} else { | ||
return R; | ||
} | ||
return R; | ||
}; | ||
})()); | ||
} | ||
// return if ( @hub.state.verb is 'validate' ) and ( @hub.state.hedges.length is 1 ) then x else R | ||
//....................................................................................................... | ||
@@ -151,0 +148,0 @@ dsc = {...H.defaults.Type_factory_type_dsc, ...dsc}; |
{ | ||
"name": "intertype", | ||
"version": "0.101.5", | ||
"version": "0.101.6", | ||
"description": "A JavaScript typechecker", | ||
@@ -5,0 +5,0 @@ "main": "lib/main.js", |
@@ -612,2 +612,4 @@ | ||
* **[–]** make sure key properties of `Intertype` instances are hidden to avoid terminal flooding on output | ||
* **[–]** implement a way for type tests to communicate a reason for rejection of a value; this should be | ||
picked up by `validate` when throwing error | ||
@@ -614,0 +616,0 @@ ## Is Done |
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
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
324627
1847
676