intertype
Advanced tools
Comparing version 0.101.9 to 0.101.10
@@ -138,2 +138,9 @@ (function() { | ||
//......................................................................................................... | ||
declare.zero({ | ||
isa: function(x) { | ||
return x === 0/* NOTE true for -0 as well */; | ||
}, | ||
default: 0 | ||
}); | ||
//......................................................................................................... | ||
declare.nan({ | ||
@@ -140,0 +147,0 @@ isa: function(x) { |
(function() { | ||
'use strict'; | ||
var E, GUY, H, L, debug, rpr; | ||
var E, GUY, H, L, debug, negative0, positive0, rpr; | ||
@@ -20,2 +20,30 @@ //########################################################################################################### | ||
//=========================================================================================================== | ||
positive0 = function(x) { | ||
if (Object.is(x, -0)) { | ||
return false; | ||
} | ||
if (Object.is(x, +0)) { | ||
return true; | ||
} | ||
if (x === +2e308) { | ||
return true; | ||
} | ||
return (Number.isFinite(x)) && (x >= 0); | ||
}; | ||
//----------------------------------------------------------------------------------------------------------- | ||
negative0 = function(x) { | ||
if (x === -2e308) { | ||
return true; | ||
} | ||
if (Object.is(x, -0)) { | ||
return true; | ||
} | ||
if (Object.is(x, +0)) { | ||
return false; | ||
} | ||
return (Number.isFinite(x)) && (x <= 0); | ||
}; | ||
//=========================================================================================================== | ||
this.defaults = { | ||
@@ -101,11 +129,9 @@ combinator_cfg: { | ||
//....................................................................................................... | ||
positive0: function(x) { | ||
return (x === +2e308) || ((Number.isFinite(x)) && (x >= 0)); | ||
}, | ||
positive: positive0, | ||
positive0: positive0, | ||
positive1: function(x) { | ||
return (x === +2e308) || ((Number.isFinite(x)) && (x > 0)); | ||
}, | ||
negative0: function(x) { | ||
return (x === -2e308) || ((Number.isFinite(x)) && (x <= 0)); | ||
}, | ||
negative: negative0, | ||
negative0: negative0, | ||
negative1: function(x) { | ||
@@ -112,0 +138,0 @@ return (x === -2e308) || ((Number.isFinite(x)) && (x < 0)); |
@@ -600,2 +600,3 @@ (function() { | ||
var dent; | ||
level = Math.max(level, 0); | ||
dent = ' '.repeat(level); | ||
@@ -602,0 +603,0 @@ if (cfg.refs) { |
{ | ||
"name": "intertype", | ||
"version": "0.101.9", | ||
"version": "0.101.10", | ||
"description": "A JavaScript typechecker", | ||
@@ -5,0 +5,0 @@ "main": "lib/main.js", |
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
328881
1886