@zenfs/core
Advanced tools
Comparing version 0.5.1 to 0.5.2
@@ -61,2 +61,6 @@ /// <reference types="node" resolution-mode="require"/> | ||
/** | ||
* Resource deadlock would occur | ||
*/ | ||
EDEADLK = 35, | ||
/** | ||
* Directory is not empty | ||
@@ -63,0 +67,0 @@ */ |
@@ -61,2 +61,6 @@ /** | ||
/** | ||
* Resource deadlock would occur | ||
*/ | ||
ErrorCode[ErrorCode["EDEADLK"] = 35] = "EDEADLK"; | ||
/** | ||
* Directory is not empty | ||
@@ -88,2 +92,3 @@ */ | ||
[ErrorCode.EROFS]: 'Cannot modify a read-only file system.', | ||
[ErrorCode.EDEADLK]: 'Resource deadlock would occur', | ||
[ErrorCode.ENOTEMPTY]: 'Directory is not empty.', | ||
@@ -90,0 +95,0 @@ [ErrorCode.ENOTSUP]: 'Operation is not supported.', |
@@ -88,3 +88,3 @@ import { FileSystem } from '../filesystem.js'; | ||
*/ | ||
export declare function resolveBackendConfig(options: BackendConfig): Promise<FileSystem>; | ||
export declare function resolveBackend(options: BackendConfig, _depth?: number): Promise<FileSystem>; | ||
export {}; |
@@ -62,3 +62,3 @@ import { ApiError, ErrorCode } from '../ApiError.js'; | ||
*/ | ||
export async function resolveBackendConfig(options) { | ||
export async function resolveBackend(options, _depth = 0) { | ||
if (typeof options !== 'object' || options == null) { | ||
@@ -78,3 +78,6 @@ throw new ApiError(ErrorCode.EINVAL, 'Invalid options on configuration object.'); | ||
if (isBackendConfig(option)) { | ||
options[prop] = await resolveBackendConfig(option); | ||
if (_depth > 10) { | ||
throw new ApiError(ErrorCode.EINVAL, 'Invalid configuration, too deep and possibly infinite'); | ||
} | ||
options[prop] = await resolveBackend(option, ++_depth); | ||
} | ||
@@ -81,0 +84,0 @@ } |
@@ -1,2 +0,2 @@ | ||
import { isBackend, resolveBackendConfig } from './backends/backend.js'; | ||
import { isBackend, resolveBackend } from './backends/backend.js'; | ||
import * as fs from './emulation/index.js'; | ||
@@ -32,5 +32,5 @@ import { setCred } from './emulation/shared.js'; | ||
} | ||
config[point] = await resolveBackendConfig(value); | ||
config[point] = await resolveBackend(value); | ||
} | ||
initialize(config); | ||
} |
{ | ||
"name": "@zenfs/core", | ||
"version": "0.5.1", | ||
"version": "0.5.2", | ||
"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
1472463
11356