@airpower/transformer 0.1.7 → 0.1.8

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/main.js +2 -2
  2. package/package.json +1 -1
package/dist/main.js CHANGED
@@ -55,7 +55,7 @@ class DecoratorUtil {
55
55
  * @param isObject `可选` 是否对象配置
56
56
  */
57
57
  static getFieldConfig(Class, field, fieldConfigKey, isObject = false) {
58
- let fieldConfig = Reflect.get(Class.prototype, `${fieldConfigKey}[${field.toString()}]`);
58
+ let fieldConfig = Reflect.get(new Class(), `${fieldConfigKey}[${field.toString()}]`);
59
59
  const SuperClass = Reflect.getPrototypeOf(Class);
60
60
  if (!isObject) {
61
61
  if (fieldConfig !== void 0) {
@@ -82,7 +82,7 @@ class DecoratorUtil {
82
82
  * @param list `递归参数` 无需传入
83
83
  */
84
84
  static getFieldList(Class, fieldConfigKey, list = []) {
85
- const fieldList = Reflect.get(Class.prototype, fieldConfigKey) || [];
85
+ const fieldList = Reflect.get(new Class(), fieldConfigKey) || [];
86
86
  fieldList.forEach((item) => list.includes(item) || list.push(item));
87
87
  const SuperClass = Reflect.getPrototypeOf(Class);
88
88
  if (!SuperClass || SuperClass.prototype.constructor.name === Transformer.name) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@airpower/transformer",
3
3
  "type": "module",
4
- "version": "0.1.7",
4
+ "version": "0.1.8",
5
5
  "description": "AirPower-Transformer 是一个基于 TypeScript 的数据转换器,提供了从 JSON 对象到 类实例 对象之间互相转换的系列装饰器和方法。",
6
6
  "author": {
7
7
  "name": "Hamm",