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

@loaders.gl/loader-utils

Package Overview
Dependencies
Maintainers
9
Versions
319
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

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

Comparing version 4.1.0-alpha.2 to 4.1.0-alpha.3

2

dist/json-loader.js

@@ -1,2 +0,2 @@

const VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';
const VERSION = typeof "4.1.0-alpha.3" !== 'undefined' ? "4.1.0-alpha.3" : 'latest';
export const JSONLoader = {

@@ -3,0 +3,0 @@ name: 'JSON',

@@ -9,6 +9,14 @@ import { FileProvider } from './file-provider';

private file;
/** The file length in bytes */
private size;
/** Create a new FileHandleFile */
constructor(path: string);
constructor(path: string, append?: boolean);
/**
* Truncates the file descriptor.
* @param length desired file lenght
*/
truncate(length: number): Promise<void>;
/**
* Append data to a file.
* @param buffer data to append
*/
append(buffer: Uint8Array): Promise<void>;
/** Close file */

@@ -15,0 +23,0 @@ destroy(): Promise<void>;

import { NodeFileFacade as NodeFile } from "../files/node-file-facade.js";
export class FileHandleFile {
constructor(path) {
let append = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
this.file = void 0;
this.size = void 0;
this.file = new NodeFile(path, 'r');
this.size = this.file.bigsize;
this.file = new NodeFile(path, append ? 'a+' : 'r');
}
async truncate(length) {
await this.file.truncate(length);
}
async append(buffer) {
await this.file.append(buffer);
}
async destroy() {

@@ -53,5 +58,5 @@ await this.file.close();

get length() {
return this.size;
return this.file.bigsize;
}
}
//# sourceMappingURL=file-handle-file.js.map

@@ -8,3 +8,3 @@ import { ReadableFile, WritableFile, Stat } from './file';

url: string;
constructor(url: string, flags?: 'r' | 'w' | 'wx', mode?: number);
constructor(url: string, flags?: 'r' | 'w' | 'wx' | 'a+', mode?: number);
/** Read data */

@@ -16,2 +16,6 @@ read(start?: number | bigint, end?: number | bigint): Promise<ArrayBuffer>;

stat(): Promise<Stat>;
/** Truncates the file descriptor. Only available on NodeFile. */
truncate(length: number): Promise<void>;
/** Append data to a file. Only available on NodeFile. */
append(data: Uint8Array): Promise<void>;
/** Close the file */

@@ -18,0 +22,0 @@ close(): Promise<void>;

@@ -27,4 +27,10 @@ import { isBrowser } from "../env-utils/globals.js";

}
async truncate(length) {
throw NOT_IMPLEMENTED;
}
async append(data) {
throw NOT_IMPLEMENTED;
}
async close() {}
}
//# sourceMappingURL=node-file-facade.js.map

@@ -136,2 +136,6 @@ import { FetchLike, TransformBatches } from './types';

parseSync?: (arrayBuffer: ArrayBuffer, options?: LoaderOptionsT, context?: LoaderContext) => DataT;
/** Parse batches of data from an iterator (e.g. fetch stream), return an iterator that yield parsed batches. */
parseInBatches?: (iterator: AsyncIterable<ArrayBuffer> | Iterable<ArrayBuffer>, options?: LoaderOptionsT, context?: LoaderContext) => AsyncIterable<BatchT>;
/** For random access, file like sources, source that don't integrate with fetch. */
parseFileInBatches?: (file: ReadableFile, options?: LoaderOptionsT, context?: LoaderContext) => AsyncIterable<BatchT>;
/** Parse atomically from a string asynchronously */

@@ -141,6 +145,2 @@ parseText?: (text: string, options?: LoaderOptionsT, context?: LoaderContext) => Promise<DataT>;

parseTextSync?: (text: string, options?: LoaderOptionsT, context?: LoaderContext) => DataT;
/** Parse batches of data from an iterator (e.g. fetch stream), return an iterator that yield parsed batches. */
parseInBatches?: (iterator: AsyncIterable<ArrayBuffer> | Iterable<ArrayBuffer>, options?: LoaderOptionsT, context?: LoaderContext) => AsyncIterable<BatchT>;
/** For random access, file like sources, source that don't integrate with fetch. */
parseFileInBatches?: (file: ReadableFile, options?: LoaderOptionsT, context?: LoaderContext) => AsyncIterable<BatchT>;
};

@@ -147,0 +147,0 @@ /**

@@ -38,2 +38,3 @@ /** Options for writers */

text?: boolean;
/** Default options for this writer */
options: WriterOptionsT;

@@ -46,7 +47,14 @@ deprecatedOptions?: Record<string, string>;

export type WriterWithEncoder<DataT = unknown, BatchT = unknown, WriterOptionsT = WriterOptions> = Writer<DataT, BatchT, WriterOptionsT> & {
encode?(data: DataT, options?: WriterOptionsT): Promise<ArrayBuffer>;
/** Encode to binary, asynchronously */
encode(data: DataT, options?: WriterOptionsT): Promise<ArrayBuffer>;
/** Encode to binary, synchronously */
encodeSync?(data: DataT, options?: WriterOptionsT): ArrayBuffer;
/** Encode to binary in batches */
encodeInBatches?(data: AsyncIterable<any>, options?: WriterOptionsT): AsyncIterable<ArrayBuffer>;
/** Encode to text, asynchronously. For text formats. */
encodeText?(table: DataT, options?: WriterOptionsT): Promise<string>;
/** Encode to text, synchronously. For text formats. */
encodeTextSync?(table: DataT, options?: WriterOptionsT): string;
encodeInBatches?(data: AsyncIterable<any>, options?: WriterOptionsT): AsyncIterable<ArrayBuffer>;
/** Encode to text in batched. For text formats. */
encodeTextInBatches?(data: AsyncIterable<any>, options?: WriterOptionsT): AsyncIterable<ArrayBuffer>;
encodeURLtoURL?: (inputUrl: string, outputUrl: string, options?: WriterOptionsT) => Promise<string>;

@@ -53,0 +61,0 @@ };

{
"name": "@loaders.gl/loader-utils",
"version": "4.1.0-alpha.2",
"version": "4.1.0-alpha.3",
"description": "Framework-independent loaders for 3D graphics formats",

@@ -50,6 +50,6 @@ "license": "MIT",

"@babel/runtime": "^7.3.1",
"@loaders.gl/worker-utils": "4.1.0-alpha.2",
"@loaders.gl/worker-utils": "4.1.0-alpha.3",
"@probe.gl/stats": "^4.0.2"
},
"gitHead": "a248382edd20e846c1ccb23c15d089fb9b368dbc"
"gitHead": "b78075a7cb8d4ecd4aac84805ce74b8ceb400cf7"
}

@@ -1,2 +0,3 @@

// loaders.gl, MIT license
// loaders.gl
// SPDX-License-Identifier: MIT
// Copyright (c) vis.gl contributors

@@ -3,0 +4,0 @@

@@ -1,2 +0,3 @@

// loaders.gl, MIT license
// loaders.gl
// SPDX-License-Identifier: MIT
// Copyright (c) vis.gl contributors

@@ -3,0 +4,0 @@

@@ -1,2 +0,3 @@

// loaders.gl, MIT license
// loaders.gl
// SPDX-License-Identifier: MIT
// Copyright (c) vis.gl contributors

@@ -3,0 +4,0 @@

@@ -1,2 +0,3 @@

// loaders.gl, MIT license
// loaders.gl
// SPDX-License-Identifier: MIT
// Copyright (c) vis.gl contributors

@@ -15,11 +16,23 @@

/** The file length in bytes */
private size: bigint;
/** Create a new FileHandleFile */
constructor(path: string) {
this.file = new NodeFile(path, 'r');
this.size = this.file.bigsize;
constructor(path: string, append: boolean = false) {
this.file = new NodeFile(path, append ? 'a+' : 'r');
}
/**
* Truncates the file descriptor.
* @param length desired file lenght
*/
async truncate(length: number): Promise<void> {
await this.file.truncate(length);
}
/**
* Append data to a file.
* @param buffer data to append
*/
async append(buffer: Uint8Array): Promise<void> {
await this.file.append(buffer);
}
/** Close file */

@@ -100,4 +113,4 @@ async destroy(): Promise<void> {

get length(): bigint {
return this.size;
return this.file.bigsize;
}
}

@@ -1,2 +0,3 @@

// loaders.gl, MIT license
// loaders.gl
// SPDX-License-Identifier: MIT
// Copyright (c) vis.gl contributors

@@ -3,0 +4,0 @@

@@ -1,2 +0,3 @@

// loaders.gl, MIT license
// loaders.gl
// SPDX-License-Identifier: MIT
// Copyright (c) vis.gl contributors

@@ -3,0 +4,0 @@

@@ -1,2 +0,3 @@

// loaders.gl, MIT license
// loaders.gl
// SPDX-License-Identifier: MIT
// Copyright (c) vis.gl contributors

@@ -3,0 +4,0 @@

@@ -1,2 +0,3 @@

// loaders.gl, MIT license
// loaders.gl
// SPDX-License-Identifier: MIT
// Copyright (c) vis.gl contributors

@@ -16,3 +17,3 @@

constructor(url: string, flags?: 'r' | 'w' | 'wx', mode?: number) {
constructor(url: string, flags?: 'r' | 'w' | 'wx' | 'a+', mode?: number) {
// Return the actual implementation instance

@@ -39,4 +40,14 @@ if (globalThis.loaders?.NodeFile) {

}
/** Truncates the file descriptor. Only available on NodeFile. */
async truncate(length: number): Promise<void> {
throw NOT_IMPLEMENTED;
}
/** Append data to a file. Only available on NodeFile. */
async append(data: Uint8Array): Promise<void> {
throw NOT_IMPLEMENTED;
}
/** Close the file */
async close(): Promise<void> {}
}

@@ -1,2 +0,3 @@

// loaders.gl, MIT license
// loaders.gl
// SPDX-License-Identifier: MIT
// Copyright (c) vis.gl contributors

@@ -3,0 +4,0 @@

@@ -1,2 +0,3 @@

// loaders.gl, MIT license
// loaders.gl
// SPDX-License-Identifier: MIT
// Copyright (c) vis.gl contributors

@@ -3,0 +4,0 @@

@@ -1,2 +0,3 @@

// loaders.gl, MIT license
// loaders.gl
// SPDX-License-Identifier: MIT
// Copyright (c) vis.gl contributors

@@ -3,0 +4,0 @@

@@ -1,2 +0,3 @@

// loaders.gl, MIT license
// loaders.gl
// SPDX-License-Identifier: MIT
// Copyright (c) vis.gl contributors

@@ -3,0 +4,0 @@

@@ -1,2 +0,3 @@

// loaders.gl, MIT license
// loaders.gl
// SPDX-License-Identifier: MIT
// Copyright (c) vis.gl contributors

@@ -3,0 +4,0 @@

@@ -1,2 +0,3 @@

// loaders.gl, MIT license
// loaders.gl
// SPDX-License-Identifier: MIT
// Copyright (c) vis.gl contributors

@@ -3,0 +4,0 @@

@@ -1,2 +0,3 @@

// loaders.gl, MIT license
// loaders.gl
// SPDX-License-Identifier: MIT
// Copyright (c) vis.gl contributors

@@ -3,0 +4,0 @@

@@ -1,2 +0,3 @@

// loaders.gl, MIT license
// loaders.gl
// SPDX-License-Identifier: MIT
// Copyright (c) vis.gl contributors

@@ -3,0 +4,0 @@

@@ -1,2 +0,3 @@

// loaders.gl, MIT license
// loaders.gl
// SPDX-License-Identifier: MIT
// Copyright (c) vis.gl contributors

@@ -3,0 +4,0 @@

@@ -1,2 +0,3 @@

// loaders.gl, MIT license
// loaders.gl
// SPDX-License-Identifier: MIT

@@ -3,0 +4,0 @@ import {TileSource, GetTileParameters} from './tile-source';

@@ -1,2 +0,3 @@

// loaders.gl, MIT license
// loaders.gl
// SPDX-License-Identifier: MIT
// Copyright (c) vis.gl contributors

@@ -3,0 +4,0 @@

@@ -1,2 +0,3 @@

// loaders.gl, MIT license
// loaders.gl
// SPDX-License-Identifier: MIT
// Copyright (c) vis.gl contributors

@@ -3,0 +4,0 @@

@@ -1,2 +0,3 @@

// loaders.gl, MIT license
// loaders.gl
// SPDX-License-Identifier: MIT
// Copyright (c) vis.gl contributors

@@ -3,0 +4,0 @@

@@ -1,2 +0,3 @@

// loaders.gl, MIT license
// loaders.gl
// SPDX-License-Identifier: MIT
// Copyright (c) vis.gl contributors

@@ -183,6 +184,2 @@

) => DataT;
/** Parse atomically from a string asynchronously */
parseText?: (text: string, options?: LoaderOptionsT, context?: LoaderContext) => Promise<DataT>;
/** Parse atomically from a string synchronously */
parseTextSync?: (text: string, options?: LoaderOptionsT, context?: LoaderContext) => DataT;
/** Parse batches of data from an iterator (e.g. fetch stream), return an iterator that yield parsed batches. */

@@ -200,2 +197,7 @@ parseInBatches?: (

) => AsyncIterable<BatchT>;
/** Parse atomically from a string asynchronously */
parseText?: (text: string, options?: LoaderOptionsT, context?: LoaderContext) => Promise<DataT>;
/** Parse atomically from a string synchronously */
parseTextSync?: (text: string, options?: LoaderOptionsT, context?: LoaderContext) => DataT;
};

@@ -202,0 +204,0 @@

@@ -1,2 +0,3 @@

// loaders.gl, MIT license
// loaders.gl
// SPDX-License-Identifier: MIT
// Copyright (c) vis.gl contributors

@@ -3,0 +4,0 @@

@@ -1,2 +0,3 @@

// loaders.gl, MIT license
// loaders.gl
// SPDX-License-Identifier: MIT
// Copyright (c) vis.gl contributors

@@ -50,2 +51,3 @@

/** Default options for this writer */
options: WriterOptionsT;

@@ -63,10 +65,19 @@ deprecatedOptions?: Record<string, string>;

> = Writer<DataT, BatchT, WriterOptionsT> & {
encode?(data: DataT, options?: WriterOptionsT): Promise<ArrayBuffer>;
/** Encode to binary, asynchronously */
encode(data: DataT, options?: WriterOptionsT): Promise<ArrayBuffer>;
/** Encode to binary, synchronously */
encodeSync?(data: DataT, options?: WriterOptionsT): ArrayBuffer;
/** Encode to binary in batches */
encodeInBatches?(data: AsyncIterable<any>, options?: WriterOptionsT): AsyncIterable<ArrayBuffer>;
/** Encode to text, asynchronously. For text formats. */
encodeText?(table: DataT, options?: WriterOptionsT): Promise<string>;
/** Encode to text, synchronously. For text formats. */
encodeTextSync?(table: DataT, options?: WriterOptionsT): string;
/** Encode to text in batched. For text formats. */
encodeTextInBatches?(
data: AsyncIterable<any>,
options?: WriterOptionsT
): AsyncIterable<ArrayBuffer>;
encodeInBatches?(data: AsyncIterable<any>, options?: WriterOptionsT): AsyncIterable<ArrayBuffer>;
encodeURLtoURL?: (

@@ -73,0 +84,0 @@ inputUrl: string,

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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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