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 CHANGED
@@ -1,5 +1,5 @@
1
1
  import { Node } from './node';
2
- export declare type TStatNumber = number | bigint;
2
+ export type TStatNumber = number | bigint;
3
3
  /**
4
4
  * Statistics about a file/directory, like `fs.Stats`.
5
5
  */
package/lib/encoding.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  /// <reference types="node" />
2
- export declare type TDataOut = string | Buffer;
3
- export declare type TEncodingExtended = BufferEncoding | 'buffer';
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 declare type TFileHandle = PathLike | IFileHandle;
31
+ export type TFileHandle = PathLike | IFileHandle;
32
32
  export interface IPromisesAPI {
33
33
  FileHandle: any;
34
34
  access(path: PathLike, mode?: number): Promise<void>;
@@ -1,3 +1,3 @@
1
- declare type TSetImmediate = (callback: (...args: any[]) => void, args?: any) => void;
1
+ type TSetImmediate = (callback: (...args: any[]) => void, args?: any) => void;
2
2
  declare const _default: TSetImmediate;
3
3
  export default _default;
@@ -1,4 +1,4 @@
1
- export declare type TSetTimeout = (callback: (...args: any[]) => void, time?: number, args?: any[]) => any;
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 declare type TFileId = PathLike | number;
18
- export declare type TData = TDataOut | Uint8Array;
19
- export declare type TFlags = string | number;
20
- export declare type TMode = string | number;
21
- export declare type TTime = number | string | Date;
22
- export declare type TCallback<TData> = (error?: IError | null, data?: TData) => void;
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 declare type TFlagsCopy = typeof constants.COPYFILE_EXCL | typeof constants.COPYFILE_FICLONE | typeof constants.COPYFILE_FICLONE_FORCE;
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
- declare type DirectoryContent = string | null;
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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "memfs",
3
- "version": "3.4.12",
3
+ "version": "3.4.13",
4
4
  "description": "In-memory file-system with Node's fs API.",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",