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.0.0 to 4.0.1

4

dist/lib/library-utils/library-utils.js

@@ -76,3 +76,3 @@ import { isBrowser, isWorker } from "../env-utils/globals.js";

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

@@ -84,3 +84,3 @@ return await response.arrayBuffer();

async function loadAsText(url) {
if (!node.readFileAsText || url.startsWith('http')) {
if (isBrowser || !node.readFileAsText || url.startsWith('http')) {
const response = await fetch(url);

@@ -87,0 +87,0 @@ return await response.text();

@@ -29,3 +29,3 @@ import Module from 'module';

}
const code = await fs.readFileSync(filename, 'utf8');
const code = await fs.promises.readFile(filename, 'utf8');
return requireFromString(code);

@@ -32,0 +32,0 @@ }

{
"name": "@loaders.gl/worker-utils",
"version": "4.0.0",
"version": "4.0.1",
"description": "Utilities for running tasks on worker threads",

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

},
"gitHead": "9b4211dc0ecd4134a1638ac0a29c5ea9008fd971"
"gitHead": "765e5a26a6bf3f2cc02cabffc4a1e3665ec92a53"
}

@@ -171,3 +171,3 @@ /* global importScripts */

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

@@ -185,3 +185,3 @@ return await response.arrayBuffer();

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

@@ -188,0 +188,0 @@ return await response.text();

@@ -53,3 +53,3 @@ // Fork of https://github.com/floatdrop/require-from-string/blob/master/index.js

}
const code = await fs.readFileSync(filename, 'utf8');
const code = await fs.promises.readFile(filename, 'utf8');
return requireFromString(code);

@@ -56,0 +56,0 @@ }

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