@putout/operator-filesystem 2.10.0 → 2.11.0
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/filesystem.js +4 -1
- package/lib/maybe-fs.js +19 -3
- package/package.json +3 -1
package/lib/filesystem.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
const {join} = require('node:path');
|
|
4
4
|
const tryCatch = require('try-catch');
|
|
5
|
-
const {types} = require('putout');
|
|
5
|
+
const {types} = require('@putout/babel');
|
|
6
6
|
|
|
7
7
|
const {
|
|
8
8
|
setLiteralValue,
|
|
@@ -262,3 +262,6 @@ function writeFileContent(filePath, content) {
|
|
|
262
262
|
|
|
263
263
|
module.exports.init = maybeFS.init;
|
|
264
264
|
module.exports.deinit = maybeFS.deinit;
|
|
265
|
+
|
|
266
|
+
module.exports.pause = maybeFS.pause;
|
|
267
|
+
module.exports.start = maybeFS.start;
|
package/lib/maybe-fs.js
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
const fullstore = require('fullstore');
|
|
4
|
+
const driverStore = fullstore();
|
|
5
|
+
|
|
3
6
|
const {assign} = Object;
|
|
4
7
|
const noop = () => {};
|
|
5
8
|
const returns = (a) => () => a;
|
|
@@ -39,10 +42,23 @@ module.exports.writeFileContent = (name) => {
|
|
|
39
42
|
maybeFS.writeFileContent(name);
|
|
40
43
|
};
|
|
41
44
|
|
|
42
|
-
module.exports.init =
|
|
45
|
+
module.exports.init = init;
|
|
46
|
+
|
|
47
|
+
function init(fsDriver) {
|
|
43
48
|
assign(maybeFS, fsDriver);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
module.exports.pause = () => {
|
|
52
|
+
driverStore(maybeFS);
|
|
53
|
+
deinit();
|
|
44
54
|
};
|
|
45
55
|
|
|
46
|
-
module.exports.
|
|
47
|
-
|
|
56
|
+
module.exports.start = () => {
|
|
57
|
+
init(driverStore());
|
|
48
58
|
};
|
|
59
|
+
|
|
60
|
+
module.exports.deinit = deinit;
|
|
61
|
+
|
|
62
|
+
function deinit() {
|
|
63
|
+
assign(maybeFS, defaultFS);
|
|
64
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@putout/operator-filesystem",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.11.0",
|
|
4
4
|
"type": "commonjs",
|
|
5
5
|
"author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
|
|
6
6
|
"description": "🐊Putout operator adds ability to filesystem referenced variables that was not defined",
|
|
@@ -24,7 +24,9 @@
|
|
|
24
24
|
"report": "madrun report"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
+
"@putout/babel": "^1.5.5",
|
|
27
28
|
"@putout/operate": "^11.0.0",
|
|
29
|
+
"fullstore": "^3.0.0",
|
|
28
30
|
"try-catch": "^3.0.1"
|
|
29
31
|
},
|
|
30
32
|
"keywords": [
|