@zenfs/core
Advanced tools
Comparing version 0.2.2 to 0.2.3
/// <reference types="node" resolution-mode="require"/> | ||
/// <reference types="node" resolution-mode="require"/> | ||
import { FileSystem } from './filesystem.js'; | ||
import { Cred } from './cred.js'; | ||
import type { TextDecoder as _TextDecoder, TextEncoder as _TextEncoder } from 'node:util'; | ||
declare global { | ||
function setImmediate(callback: () => unknown): void; | ||
function atob(data: string): string; | ||
function btoa(data: string): string; | ||
const TextDecoder: typeof _TextDecoder; | ||
const TextEncoder: typeof _TextEncoder; | ||
} | ||
@@ -33,3 +28,3 @@ /** | ||
*/ | ||
export declare const setImmediate: typeof globalThis.setImmediate | ((cb: any) => NodeJS.Timeout); | ||
export declare const setImmediate: (callback: () => unknown) => void; | ||
/** | ||
@@ -36,0 +31,0 @@ * Encodes a string into a buffer |
@@ -126,3 +126,3 @@ import { ApiError, ErrorCode } from './ApiError.js'; | ||
case 'ascii': | ||
return new TextEncoder().encode(input).map(v => v & 0x7f); | ||
return new globalThis.TextEncoder().encode(input).map(v => v & 0x7f); | ||
case 'latin1': | ||
@@ -135,7 +135,7 @@ case 'binary': | ||
case 'hex': | ||
return new TextEncoder().encode(input); | ||
return new globalThis.TextEncoder().encode(input); | ||
case 'utf16le': | ||
case 'ucs2': | ||
case 'ucs-2': | ||
return new TextEncoder().encode(input).slice(0, -1); | ||
return new globalThis.TextEncoder().encode(input).slice(0, -1); | ||
default: | ||
@@ -154,6 +154,6 @@ throw new ApiError(ErrorCode.EINVAL, 'Invalid encoding: ' + encoding); | ||
case 'utf-8': | ||
return new TextDecoder().decode(input); | ||
return new globalThis.TextDecoder().decode(input); | ||
case 'latin1': | ||
case 'binary': | ||
return new TextDecoder('latin1').decode(input); | ||
return new globalThis.TextDecoder('latin1').decode(input); | ||
case 'utf16le': | ||
@@ -160,0 +160,0 @@ case 'ucs2': |
{ | ||
"name": "@zenfs/core", | ||
"version": "0.2.2", | ||
"version": "0.2.3", | ||
"description": "A filesystem in your browser", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1466065
11852