@sinclair/typebox
Advanced tools
Comparing version 0.32.25 to 0.32.26
@@ -180,3 +180,3 @@ "use strict"; | ||
function IsNumberLike(value) { | ||
return !index_3.TypeSystemPolicy.AllowNaN ? `(typeof ${value} === 'number' && Number.isFinite(${value}))` : `typeof ${value} === 'number'`; | ||
return index_3.TypeSystemPolicy.AllowNaN ? `typeof ${value} === 'number'` : `Number.isFinite(${value})`; | ||
} | ||
@@ -267,3 +267,3 @@ Policy.IsNumberLike = IsNumberLike; | ||
function* FromInteger(schema, references, value) { | ||
yield `(typeof ${value} === 'number' && Number.isInteger(${value}))`; | ||
yield `Number.isInteger(${value})`; | ||
if ((0, index_11.IsNumber)(schema.exclusiveMaximum)) | ||
@@ -270,0 +270,0 @@ yield `${value} < ${schema.exclusiveMaximum}`; |
@@ -38,4 +38,3 @@ "use strict"; | ||
function IsNumberLike(value) { | ||
const isNumber = (0, index_1.IsNumber)(value); | ||
return TypeSystemPolicy.AllowNaN ? isNumber : isNumber && Number.isFinite(value); | ||
return TypeSystemPolicy.AllowNaN ? (0, index_1.IsNumber)(value) : Number.isFinite(value); | ||
} | ||
@@ -42,0 +41,0 @@ TypeSystemPolicy.IsNumberLike = IsNumberLike; |
@@ -159,3 +159,3 @@ "use strict"; | ||
function IsInteger(value) { | ||
return IsNumber(value) && Number.isInteger(value); | ||
return Number.isInteger(value); | ||
} | ||
@@ -162,0 +162,0 @@ exports.IsInteger = IsInteger; |
{ | ||
"name": "@sinclair/typebox", | ||
"version": "0.32.25", | ||
"version": "0.32.26", | ||
"description": "Json Schema Type Builder with Static Type Resolution for TypeScript", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
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 too big to display
1377657
23390