@airpower/transformer 0.1.7 → 0.1.9
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 +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
|
|
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
|
|
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) {
|