@coaction/pinia 1.1.0 → 1.2.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/dist/index.js CHANGED
@@ -83,10 +83,14 @@ var bindPinia = (0, import_coaction.createBinder)({
83
83
  handleState: ((options) => {
84
84
  const descriptors = {};
85
85
  options.getters = options.getters ?? {};
86
- for (const key in options.getters) {
86
+ for (const key of Object.keys(options.getters)) {
87
+ const getter = options.getters[key];
88
+ if (typeof getter !== "function") {
89
+ continue;
90
+ }
87
91
  descriptors[key] = {
88
92
  get() {
89
- return options.getters[key].call(this, this);
93
+ return getter.call(this, this);
90
94
  }
91
95
  };
92
96
  }
package/dist/index.mjs CHANGED
@@ -81,10 +81,14 @@ var bindPinia = createBinder({
81
81
  handleState: ((options) => {
82
82
  const descriptors = {};
83
83
  options.getters = options.getters ?? {};
84
- for (const key in options.getters) {
84
+ for (const key of Object.keys(options.getters)) {
85
+ const getter = options.getters[key];
86
+ if (typeof getter !== "function") {
87
+ continue;
88
+ }
85
89
  descriptors[key] = {
86
90
  get() {
87
- return options.getters[key].call(this, this);
91
+ return getter.call(this, this);
88
92
  }
89
93
  };
90
94
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coaction/pinia",
3
- "version": "1.1.0",
3
+ "version": "1.2.0",
4
4
  "description": "A Coaction integration tool for Pinia",
5
5
  "keywords": [
6
6
  "state",
@@ -37,7 +37,7 @@
37
37
  "url": "https://github.com/unadlib/coaction/issues"
38
38
  },
39
39
  "peerDependencies": {
40
- "coaction": "^1.1.0",
40
+ "coaction": "^1.2.0",
41
41
  "mutative": "^1.1.0",
42
42
  "pinia": "^2.0 || ^3.0.0"
43
43
  },
@@ -53,10 +53,10 @@
53
53
  }
54
54
  },
55
55
  "devDependencies": {
56
- "coaction": "^1.1.0",
57
56
  "data-transport": "^5.0.3",
58
57
  "mutative": "^1.3.0",
59
- "pinia": "^3.0.4"
58
+ "pinia": "^3.0.4",
59
+ "coaction": "1.2.0"
60
60
  },
61
61
  "dependencies": {
62
62
  "mutability": "^1.2.1"