@nsnanocat/util 2.5.15 → 2.5.16
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/package.json +1 -1
- package/polyfill/Storage.js +0 -2
package/package.json
CHANGED
package/polyfill/Storage.js
CHANGED
|
@@ -288,9 +288,7 @@ export class Storage {
|
|
|
288
288
|
if ($app !== "Node.js") return {};
|
|
289
289
|
// 优先复用全局运行时对象,不存在时再按需加载。
|
|
290
290
|
// Prefer reusing global runtime modules and lazily require when missing.
|
|
291
|
-
// eslint-disable-next-line n/no-missing-require, n/prefer-node-protocol
|
|
292
291
|
if (!globalThis.fs) globalThis.fs = require("fs");
|
|
293
|
-
// eslint-disable-next-line n/no-missing-require, n/prefer-node-protocol
|
|
294
292
|
if (!globalThis.path) globalThis.path = require("path");
|
|
295
293
|
const dataFilePathCandidates = [...new Set([globalThis.path.resolve(dataFile), globalThis.path.resolve(process.cwd(), dataFile)])];
|
|
296
294
|
const dataFilePath = dataFilePathCandidates.find(filePath => globalThis.fs.existsSync(filePath));
|