memfs 3.4.12 → 3.4.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/Stats.d.ts +1 -1
- package/lib/encoding.d.ts +2 -2
- package/lib/promises.d.ts +1 -1
- package/lib/setImmediate.d.ts +1 -1
- package/lib/setTimeoutUnref.d.ts +1 -1
- package/lib/volume.d.ts +8 -8
- package/lib/volume.js +3 -0
- package/package.json +1 -1
package/lib/Stats.d.ts
CHANGED
package/lib/encoding.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
-
export
|
|
3
|
-
export
|
|
2
|
+
export type TDataOut = string | Buffer;
|
|
3
|
+
export type TEncodingExtended = BufferEncoding | 'buffer';
|
|
4
4
|
export declare const ENCODING_UTF8: BufferEncoding;
|
|
5
5
|
export declare function assertEncoding(encoding: string | undefined): void;
|
|
6
6
|
export declare function strToEncoding(str: string, encoding?: TEncodingExtended): TDataOut;
|
package/lib/promises.d.ts
CHANGED
|
@@ -28,7 +28,7 @@ export interface IFileHandle {
|
|
|
28
28
|
write(buffer: Buffer | Uint8Array, offset?: number, length?: number, position?: number): Promise<TFileHandleWriteResult>;
|
|
29
29
|
writeFile(data: TData, options?: IWriteFileOptions): Promise<void>;
|
|
30
30
|
}
|
|
31
|
-
export
|
|
31
|
+
export type TFileHandle = PathLike | IFileHandle;
|
|
32
32
|
export interface IPromisesAPI {
|
|
33
33
|
FileHandle: any;
|
|
34
34
|
access(path: PathLike, mode?: number): Promise<void>;
|
package/lib/setImmediate.d.ts
CHANGED
package/lib/setTimeoutUnref.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type TSetTimeout = (callback: (...args: any[]) => void, time?: number, args?: any[]) => any;
|
|
2
2
|
/**
|
|
3
3
|
* `setTimeoutUnref` is just like `setTimeout`,
|
|
4
4
|
* only in Node's environment it will "unref" its macro task.
|
package/lib/volume.d.ts
CHANGED
|
@@ -14,12 +14,12 @@ import { TEncodingExtended, TDataOut } from './encoding';
|
|
|
14
14
|
export interface IError extends Error {
|
|
15
15
|
code?: string;
|
|
16
16
|
}
|
|
17
|
-
export
|
|
18
|
-
export
|
|
19
|
-
export
|
|
20
|
-
export
|
|
21
|
-
export
|
|
22
|
-
export
|
|
17
|
+
export type TFileId = PathLike | number;
|
|
18
|
+
export type TData = TDataOut | Uint8Array;
|
|
19
|
+
export type TFlags = string | number;
|
|
20
|
+
export type TMode = string | number;
|
|
21
|
+
export type TTime = number | string | Date;
|
|
22
|
+
export type TCallback<TData> = (error?: IError | null, data?: TData) => void;
|
|
23
23
|
export declare enum FLAGS {
|
|
24
24
|
r,
|
|
25
25
|
'r+',
|
|
@@ -40,7 +40,7 @@ export declare enum FLAGS {
|
|
|
40
40
|
'ax+',
|
|
41
41
|
'xa+'
|
|
42
42
|
}
|
|
43
|
-
export
|
|
43
|
+
export type TFlagsCopy = typeof constants.COPYFILE_EXCL | typeof constants.COPYFILE_FICLONE | typeof constants.COPYFILE_FICLONE_FORCE;
|
|
44
44
|
export declare function flagsToNumber(flags: TFlags | undefined): number;
|
|
45
45
|
export interface IOptions {
|
|
46
46
|
encoding?: BufferEncoding | TEncodingExtended;
|
|
@@ -114,7 +114,7 @@ export declare function dataToStr(data: TData, encoding?: string): string;
|
|
|
114
114
|
export declare function dataToBuffer(data: TData, encoding?: string): Buffer;
|
|
115
115
|
export declare function bufferToEncoding(buffer: Buffer, encoding?: TEncodingExtended): TDataOut;
|
|
116
116
|
export declare function toUnixTimestamp(time: any): any;
|
|
117
|
-
|
|
117
|
+
type DirectoryContent = string | null;
|
|
118
118
|
export interface DirectoryJSON {
|
|
119
119
|
[key: string]: DirectoryContent;
|
|
120
120
|
}
|
package/lib/volume.js
CHANGED
|
@@ -127,6 +127,9 @@ function createError(errorCode, func, path, path2, Constructor) {
|
|
|
127
127
|
if (Constructor === void 0) { Constructor = Error; }
|
|
128
128
|
var error = new Constructor(formatError(errorCode, func, path, path2));
|
|
129
129
|
error.code = errorCode;
|
|
130
|
+
if (path) {
|
|
131
|
+
error.path = path;
|
|
132
|
+
}
|
|
130
133
|
return error;
|
|
131
134
|
}
|
|
132
135
|
// ---------------------------------------- Flags
|