Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@loaders.gl/worker-utils

Package Overview
Dependencies
Maintainers
9
Versions
205
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@loaders.gl/worker-utils - npm Package Compare versions

Comparing version 4.2.0-alpha.6 to 4.2.0-beta.1

4

dist/lib/env-utils/version.js

@@ -14,3 +14,3 @@ // loaders.gl

// __VERSION__ is injected by babel-plugin-version-inline
if (typeof "4.2.0-alpha.5" === 'undefined') {
if (typeof "4.2.0-alpha.6" === 'undefined') {
// eslint-disable-next-line

@@ -21,3 +21,3 @@ console.warn('loaders.gl: The __VERSION__ variable is not injected using babel plugin. Latest unstable workers would be fetched from the CDN.');

else {
globalThis._loadersgl_.version = "4.2.0-alpha.5";
globalThis._loadersgl_.version = "4.2.0-alpha.6";
}

@@ -24,0 +24,0 @@ }

@@ -6,3 +6,2 @@ // loaders.gl

import { isBrowser, isWorker } from "../env-utils/globals.js";
import * as node from "../node/require-utils.node.js";
import { assert } from "../env-utils/assert.js";

@@ -44,2 +43,3 @@ import { VERSION } from "../env-utils/version.js";

// Allow application to import and supply libraries through `options.modules`
// TODO - See js-module-utils in loader-utils
const modules = options.modules || {};

@@ -77,3 +77,4 @@ if (modules[libraryName]) {

try {
return node && node.requireFromFile && (await node.requireFromFile(libraryUrl));
const { requireFromFile } = globalThis.loaders || {};
return await requireFromFile?.(libraryUrl);
}

@@ -114,3 +115,4 @@ catch (error) {

if (!isBrowser) {
return node.requireFromString && node.requireFromString(scriptSource, id);
const { requireFromString } = globalThis.loaders || {};
return requireFromString?.(scriptSource, id);
}

@@ -151,7 +153,8 @@ if (isWorker) {

async function loadAsArrayBuffer(url) {
if (isBrowser || !node.readFileAsArrayBuffer || url.startsWith('http')) {
const { readFileAsArrayBuffer } = globalThis.loaders || {};
if (isBrowser || !readFileAsArrayBuffer || url.startsWith('http')) {
const response = await fetch(url);
return await response.arrayBuffer();
}
return await node.readFileAsArrayBuffer(url);
return await readFileAsArrayBuffer(url);
}

@@ -164,7 +167,8 @@ /**

async function loadAsText(url) {
if (isBrowser || !node.readFileAsText || url.startsWith('http')) {
const { readFileAsText } = globalThis.loaders || {};
if (isBrowser || !readFileAsText || url.startsWith('http')) {
const response = await fetch(url);
return await response.text();
}
return await node.readFileAsText(url);
return await readFileAsText(url);
}
{
"name": "@loaders.gl/worker-utils",
"version": "4.2.0-alpha.6",
"version": "4.2.0-beta.1",
"description": "Utilities for running tasks on worker threads",

@@ -55,3 +55,3 @@ "license": "MIT",

},
"gitHead": "37bd8ca71763529f18727ee4bf29dd176aa914ca"
"gitHead": "c386a9196516fe3ff24847b40e6c77be039cf905"
}

@@ -7,3 +7,2 @@ // loaders.gl

import {isBrowser, isWorker} from '../env-utils/globals';
import * as node from '../node/require-utils.node';
import {assert} from '../env-utils/assert';

@@ -61,2 +60,3 @@ import {VERSION} from '../env-utils/version';

// Allow application to import and supply libraries through `options.modules`
// TODO - See js-module-utils in loader-utils
const modules = options.modules || {};

@@ -100,3 +100,4 @@ if (modules[libraryName]) {

try {
return node && node.requireFromFile && (await node.requireFromFile(libraryUrl));
const {requireFromFile} = globalThis.loaders || {};
return await requireFromFile?.(libraryUrl);
} catch (error) {

@@ -139,3 +140,4 @@ console.error(error); // eslint-disable-line no-console

if (!isBrowser) {
return node.requireFromString && node.requireFromString(scriptSource, id);
const {requireFromString} = globalThis.loaders || {};
return requireFromString?.(scriptSource, id);
}

@@ -179,7 +181,8 @@

async function loadAsArrayBuffer(url: string): Promise<ArrayBuffer> {
if (isBrowser || !node.readFileAsArrayBuffer || url.startsWith('http')) {
const {readFileAsArrayBuffer} = globalThis.loaders || {};
if (isBrowser || !readFileAsArrayBuffer || url.startsWith('http')) {
const response = await fetch(url);
return await response.arrayBuffer();
}
return await node.readFileAsArrayBuffer(url);
return await readFileAsArrayBuffer(url);
}

@@ -193,7 +196,8 @@

async function loadAsText(url: string): Promise<string> {
if (isBrowser || !node.readFileAsText || url.startsWith('http')) {
const {readFileAsText} = globalThis.loaders || {};
if (isBrowser || !readFileAsText || url.startsWith('http')) {
const response = await fetch(url);
return await response.text();
}
return await node.readFileAsText(url);
return await readFileAsText(url);
}

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc