@airpower/transformer 0.1.6 → 0.1.7
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/main.js +1 -16
- package/dist/transformer/DecoratorUtil.d.ts +1 -9
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -43,12 +43,8 @@ class DecoratorUtil {
|
|
|
43
43
|
* @param field 属性
|
|
44
44
|
* @param fieldConfigKey 配置项索引键值
|
|
45
45
|
* @param fieldConfig 配置的参数
|
|
46
|
-
* @param fieldListKey `可选` 类配置项列表索引值
|
|
47
46
|
*/
|
|
48
|
-
static setFieldConfig(instance, field, fieldConfigKey, fieldConfig
|
|
49
|
-
if (fieldListKey) {
|
|
50
|
-
this.addFieldDecoratorKey(instance, field, fieldListKey);
|
|
51
|
-
}
|
|
47
|
+
static setFieldConfig(instance, field, fieldConfigKey, fieldConfig) {
|
|
52
48
|
this.setProperty(instance, `${fieldConfigKey}[${field.toString()}]`, fieldConfig);
|
|
53
49
|
}
|
|
54
50
|
/**
|
|
@@ -108,17 +104,6 @@ class DecoratorUtil {
|
|
|
108
104
|
configurable: true
|
|
109
105
|
});
|
|
110
106
|
}
|
|
111
|
-
/**
|
|
112
|
-
* ### 设置一个属性的包含装饰器索引
|
|
113
|
-
* @param instance 目标类
|
|
114
|
-
* @param field 属性
|
|
115
|
-
* @param propertyKey 类配置项列表索引值
|
|
116
|
-
*/
|
|
117
|
-
static addFieldDecoratorKey(instance, field, propertyKey) {
|
|
118
|
-
const list = Reflect.get(instance, propertyKey) || [];
|
|
119
|
-
list.push(field);
|
|
120
|
-
this.setProperty(instance, propertyKey, list);
|
|
121
|
-
}
|
|
122
107
|
}
|
|
123
108
|
class Transformer {
|
|
124
109
|
/**
|
|
@@ -27,9 +27,8 @@ export declare class DecoratorUtil {
|
|
|
27
27
|
* @param field 属性
|
|
28
28
|
* @param fieldConfigKey 配置项索引键值
|
|
29
29
|
* @param fieldConfig 配置的参数
|
|
30
|
-
* @param fieldListKey `可选` 类配置项列表索引值
|
|
31
30
|
*/
|
|
32
|
-
static setFieldConfig<T extends Transformer>(instance: T, field: keyof T, fieldConfigKey: string, fieldConfig: unknown
|
|
31
|
+
static setFieldConfig<T extends Transformer>(instance: T, field: keyof T, fieldConfigKey: string, fieldConfig: unknown): void;
|
|
33
32
|
/**
|
|
34
33
|
* ### 获取类指定属性的指定类型的配置
|
|
35
34
|
* @param Class 目标类
|
|
@@ -52,11 +51,4 @@ export declare class DecoratorUtil {
|
|
|
52
51
|
* @param value 配置值
|
|
53
52
|
*/
|
|
54
53
|
private static setProperty;
|
|
55
|
-
/**
|
|
56
|
-
* ### 设置一个属性的包含装饰器索引
|
|
57
|
-
* @param instance 目标类
|
|
58
|
-
* @param field 属性
|
|
59
|
-
* @param propertyKey 类配置项列表索引值
|
|
60
|
-
*/
|
|
61
|
-
private static addFieldDecoratorKey;
|
|
62
54
|
}
|