hfs 0.49.0-alpha2 → 0.49.0-alpha3
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/README.md +8 -17
- package/admin/assets/{index-6afd4b06.js → index-01a34c44.js} +49 -44
- package/admin/assets/{sha512-f5f12dc1.js → sha512-7ee6016e.js} +1 -1
- package/admin/index.html +1 -1
- package/central.json +12 -0
- package/frontend/assets/{index-3a379840.js → index-51e1daa3.js} +2 -2
- package/frontend/assets/{sha512-3392c31f.js → sha512-33a5ce93.js} +1 -1
- package/frontend/index.html +1 -1
- package/package.json +1 -1
- package/src/adminApis.js +9 -2
- package/src/api.net.js +74 -37
- package/src/commands.js +3 -10
- package/src/config.js +9 -6
- package/src/const.js +6 -29
- package/src/cross-const.js +31 -0
- package/src/cross.js +16 -1
- package/src/index.js +2 -1
- package/src/listen.js +1 -1
- package/src/misc.js +1 -1
- package/src/perm.js +16 -1
- package/src/plugins.js +2 -1
- package/src/serveFile.js +1 -1
- package/src/serveGuiFiles.js +2 -1
- package/src/update.js +13 -5
- package/src/util-files.js +3 -2
- package/src/util-http.js +1 -3
- package/src/watchLoad.js +6 -2
package/src/watchLoad.js
CHANGED
|
@@ -15,8 +15,12 @@ function watchLoad(path, parser, { failedOnFirstAttempt, immediateFirst } = {})
|
|
|
15
15
|
let retry;
|
|
16
16
|
let last;
|
|
17
17
|
install(true);
|
|
18
|
-
const save = (0, misc_1.debounceAsync)((data
|
|
19
|
-
|
|
18
|
+
const save = (0, misc_1.debounceAsync)(async (data, { reparse = false } = {}) => {
|
|
19
|
+
await promises_1.default.writeFile(path, data, 'utf8');
|
|
20
|
+
if (reparse)
|
|
21
|
+
await parser(data);
|
|
22
|
+
});
|
|
23
|
+
return { unwatch, save, getText: () => last, getPath: () => path };
|
|
20
24
|
function install(first = false) {
|
|
21
25
|
try {
|
|
22
26
|
watcher = (0, fs_1.watch)(path, () => {
|