@sinclair/typebox
Advanced tools
Comparing version 0.34.13 to 0.34.14
@@ -379,3 +379,3 @@ "use strict"; | ||
function* FromPromise(schema, references, value) { | ||
yield `(typeof value === 'object' && typeof ${value}.then === 'function')`; | ||
yield `${value} instanceof Promise`; | ||
} | ||
@@ -382,0 +382,0 @@ function* FromRecord(schema, references, value) { |
@@ -43,7 +43,7 @@ "use strict"; | ||
function IsAsyncIterator(value) { | ||
return IsObject(value) && Symbol.asyncIterator in value; | ||
return IsObject(value) && globalThis.Symbol.asyncIterator in value; | ||
} | ||
/** Returns true if this value is an iterator */ | ||
function IsIterator(value) { | ||
return IsObject(value) && Symbol.iterator in value; | ||
return IsObject(value) && globalThis.Symbol.iterator in value; | ||
} | ||
@@ -55,3 +55,3 @@ // -------------------------------------------------------------------------- | ||
function IsStandardObject(value) { | ||
return IsObject(value) && (Object.getPrototypeOf(value) === Object.prototype || Object.getPrototypeOf(value) === null); | ||
return IsObject(value) && (globalThis.Object.getPrototypeOf(value) === Object.prototype || globalThis.Object.getPrototypeOf(value) === null); | ||
} | ||
@@ -67,7 +67,7 @@ /** Returns true if this value is an instance of a class */ | ||
function IsPromise(value) { | ||
return value instanceof Promise; | ||
return value instanceof globalThis.Promise; | ||
} | ||
/** Returns true if this value is a Date */ | ||
function IsDate(value) { | ||
return value instanceof Date && Number.isFinite(value.getTime()); | ||
return value instanceof Date && globalThis.Number.isFinite(value.getTime()); | ||
} | ||
@@ -88,3 +88,3 @@ /** Returns true if this value is an instance of Map<K, T> */ | ||
function IsTypedArray(value) { | ||
return ArrayBuffer.isView(value); | ||
return globalThis.ArrayBuffer.isView(value); | ||
} | ||
@@ -151,3 +151,3 @@ /** Returns true if the value is a Int8Array */ | ||
function IsArray(value) { | ||
return Array.isArray(value) && !ArrayBuffer.isView(value); | ||
return globalThis.Array.isArray(value) && !globalThis.ArrayBuffer.isView(value); | ||
} | ||
@@ -172,3 +172,3 @@ /** Returns true if this value is an undefined */ | ||
function IsInteger(value) { | ||
return Number.isInteger(value); | ||
return globalThis.Number.isInteger(value); | ||
} | ||
@@ -175,0 +175,0 @@ /** Returns true if this value is bigint */ |
{ | ||
"name": "@sinclair/typebox", | ||
"version": "0.34.13", | ||
"version": "0.34.14", | ||
"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
1693108
349
3
1
11