memfs 4.17.0 → 4.17.1
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/index.d.ts +7 -8
- package/lib/index.js +2 -2
- package/lib/index.js.map +1 -1
- package/package.json +1 -1
package/lib/index.d.ts
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import Stats from './Stats';
|
|
2
2
|
import Dirent from './Dirent';
|
|
3
|
-
import { Volume
|
|
3
|
+
import { Volume, StatWatcher, FSWatcher, IWriteStream, DirectoryJSON, NestedDirectoryJSON } from './volume';
|
|
4
4
|
import { constants } from './constants';
|
|
5
5
|
import type { FsPromisesApi } from './node/types';
|
|
6
6
|
import type * as misc from './node/types/misc';
|
|
7
|
-
export { DirectoryJSON, NestedDirectoryJSON };
|
|
8
|
-
export declare const
|
|
9
|
-
export
|
|
10
|
-
export interface IFs extends _Volume {
|
|
7
|
+
export { DirectoryJSON, NestedDirectoryJSON, Volume };
|
|
8
|
+
export declare const vol: Volume;
|
|
9
|
+
export interface IFs extends Volume {
|
|
11
10
|
constants: typeof constants;
|
|
12
11
|
Stats: new (...args: any[]) => Stats;
|
|
13
12
|
Dirent: new (...args: any[]) => Dirent;
|
|
@@ -18,7 +17,7 @@ export interface IFs extends _Volume {
|
|
|
18
17
|
promises: FsPromisesApi;
|
|
19
18
|
_toUnixTimestamp: any;
|
|
20
19
|
}
|
|
21
|
-
export declare function createFsFromVolume(vol:
|
|
20
|
+
export declare function createFsFromVolume(vol: Volume): IFs;
|
|
22
21
|
export declare const fs: IFs;
|
|
23
22
|
/**
|
|
24
23
|
* Creates a new file system instance.
|
|
@@ -32,8 +31,8 @@ export declare const fs: IFs;
|
|
|
32
31
|
*/
|
|
33
32
|
export declare const memfs: (json?: NestedDirectoryJSON, cwd?: string) => {
|
|
34
33
|
fs: IFs;
|
|
35
|
-
vol:
|
|
34
|
+
vol: Volume;
|
|
36
35
|
};
|
|
37
36
|
export type IFsWithVolume = IFs & {
|
|
38
|
-
__vol:
|
|
37
|
+
__vol: Volume;
|
|
39
38
|
};
|
package/lib/index.js
CHANGED
|
@@ -5,11 +5,11 @@ exports.createFsFromVolume = createFsFromVolume;
|
|
|
5
5
|
const Stats_1 = require("./Stats");
|
|
6
6
|
const Dirent_1 = require("./Dirent");
|
|
7
7
|
const volume_1 = require("./volume");
|
|
8
|
+
Object.defineProperty(exports, "Volume", { enumerable: true, get: function () { return volume_1.Volume; } });
|
|
8
9
|
const constants_1 = require("./constants");
|
|
9
10
|
const fsSynchronousApiList_1 = require("./node/lists/fsSynchronousApiList");
|
|
10
11
|
const fsCallbackApiList_1 = require("./node/lists/fsCallbackApiList");
|
|
11
12
|
const { F_OK, R_OK, W_OK, X_OK } = constants_1.constants;
|
|
12
|
-
exports.Volume = volume_1.Volume;
|
|
13
13
|
// Default volume.
|
|
14
14
|
exports.vol = new volume_1.Volume();
|
|
15
15
|
function createFsFromVolume(vol) {
|
|
@@ -42,7 +42,7 @@ exports.fs = createFsFromVolume(exports.vol);
|
|
|
42
42
|
* the `fs` module.
|
|
43
43
|
*/
|
|
44
44
|
const memfs = (json = {}, cwd = '/') => {
|
|
45
|
-
const vol =
|
|
45
|
+
const vol = volume_1.Volume.fromNestedJSON(json, cwd);
|
|
46
46
|
const fs = createFsFromVolume(vol);
|
|
47
47
|
return { fs, vol };
|
|
48
48
|
};
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAmCA,gDAiBC;AApDD,mCAA4B;AAC5B,qCAA8B;AAC9B,qCAQkB;AAQ2B,uFAf3C,eAAM,OAe2C;AAPnD,2CAAwC;AAGxC,4EAAyE;AACzE,sEAAmE;AACnE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,I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