@bettergi/utils 0.1.29 → 0.1.30

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.
Files changed (2) hide show
  1. package/dist/store.js +2 -12
  2. package/package.json +4 -4
package/dist/store.js CHANGED
@@ -34,21 +34,11 @@ export const useStore = (name) => {
34
34
  },
35
35
  set: (target, key, value) => {
36
36
  const success = Reflect.set(target, key, value);
37
- if (success) {
38
- Promise.resolve().then(() => {
39
- file.writeTextSync(filePath, JSON.stringify(storeData, null, 2));
40
- });
41
- }
42
- return success;
37
+ return success && file.writeTextSync(filePath, JSON.stringify(storeData, null, 2));
43
38
  },
44
39
  deleteProperty: (target, key) => {
45
40
  const success = Reflect.deleteProperty(target, key);
46
- if (success) {
47
- Promise.resolve().then(() => {
48
- file.writeTextSync(filePath, JSON.stringify(storeData, null, 2));
49
- });
50
- }
51
- return success;
41
+ return success && file.writeTextSync(filePath, JSON.stringify(storeData, null, 2));
52
42
  }
53
43
  });
54
44
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bettergi/utils",
3
- "version": "0.1.29",
3
+ "version": "0.1.30",
4
4
  "description": "开发 BetterGI 脚本常用工具集",
5
5
  "type": "module",
6
6
  "author": "Bread Grocery<https://github.com/breadgrocery>",
@@ -29,11 +29,11 @@
29
29
  "utils"
30
30
  ],
31
31
  "dependencies": {
32
- "@bettergi/types": "^0.1.10"
32
+ "@bettergi/types": "^0.1.12"
33
33
  },
34
34
  "devDependencies": {
35
- "rimraf": "^6.1.2",
36
- "typescript": "^5.9.3"
35
+ "rimraf": "^6.1.3",
36
+ "typescript": "^6.0.2"
37
37
  },
38
38
  "scripts": {
39
39
  "dev": "tsc --watch",