pull/404/head
Augustin Chan 2023-12-06 17:11:41 +08:00
parent f6b64f8efc
commit cece9bfb22
1 changed files with 1 additions and 1 deletions

View File

@ -99,7 +99,7 @@ export class Env {
set ImageData(val) { this.#imageData = val; globalThis.ImageData = val; } set ImageData(val) { this.#imageData = val; globalThis.ImageData = val; }
constructor() { constructor() {
this.browser = typeof navigator !== 'undefined'; this.browser = typeof navigator !== 'undefined' && Object.keys(navigator).length !== 0;
this.node = (typeof process !== 'undefined') && (typeof process.versions !== 'undefined') && (typeof process.versions.node !== 'undefined'); this.node = (typeof process !== 'undefined') && (typeof process.versions !== 'undefined') && (typeof process.versions.node !== 'undefined');
this.tfjs = { version: tf.version['tfjs-core'] }; this.tfjs = { version: tf.version['tfjs-core'] };
this.offscreen = typeof OffscreenCanvas !== 'undefined'; this.offscreen = typeof OffscreenCanvas !== 'undefined';