@leafer/decorator 1.5.0 → 1.5.1

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/package.json +5 -5
  2. package/src/data.ts +1 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leafer/decorator",
3
- "version": "1.5.0",
3
+ "version": "1.5.1",
4
4
  "description": "@leafer/decorator",
5
5
  "author": "Chao (Leafer) Wan",
6
6
  "license": "MIT",
@@ -22,11 +22,11 @@
22
22
  "leaferjs"
23
23
  ],
24
24
  "dependencies": {
25
- "@leafer/platform": "1.5.0",
26
- "@leafer/data": "1.5.0",
27
- "@leafer/debug": "1.5.0"
25
+ "@leafer/platform": "1.5.1",
26
+ "@leafer/data": "1.5.1",
27
+ "@leafer/debug": "1.5.1"
28
28
  },
29
29
  "devDependencies": {
30
- "@leafer/interface": "1.5.0"
30
+ "@leafer/interface": "1.5.1"
31
31
  }
32
32
  }
package/src/data.ts CHANGED
@@ -275,8 +275,7 @@ export function defineDataProcessor(target: ILeaf, key: string, defaultValue?: I
275
275
  } else if (typeof defaultValue === 'function') {
276
276
  property.get = function () {
277
277
  let v = this[computedKey]
278
- if (v === undefined) this[computedKey] = v = defaultValue((this as ILeafData).__leaf)
279
- return v
278
+ return v === undefined ? defaultValue((this as ILeafData).__leaf) : v
280
279
  }
281
280
  }
282
281