not-node 5.1.28 → 5.1.29
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/package.json +1 -1
- package/src/fields/index.js +9 -1
package/package.json
CHANGED
package/src/fields/index.js
CHANGED
|
@@ -7,6 +7,7 @@ const { objHas } = require("../common");
|
|
|
7
7
|
const DEFAULT_TYPE = "ui";
|
|
8
8
|
const DEFAULT_FROM = ":FIELDS";
|
|
9
9
|
const DEFAULT_TO = ":thisSchema";
|
|
10
|
+
const DEFAULT_SPLITER = "//";
|
|
10
11
|
|
|
11
12
|
module.exports.initFileSchemaFromFields = ({
|
|
12
13
|
app,
|
|
@@ -79,6 +80,7 @@ module.exports.initSchemaField = (
|
|
|
79
80
|
* ['destFieldName', {full: true, field: 'content'}] - form 2
|
|
80
81
|
* ['destFieldName', 'srcFieldName'] //field alias, form 3
|
|
81
82
|
* ['destFieldName', {mutation: 'content'}, 'srcFieldName']// - form 4
|
|
83
|
+
* 'module-name//field-name' - form 5, equal to ['field-name', 'module-name//field-name']
|
|
82
84
|
**/
|
|
83
85
|
const parseFieldDescription = (field) => {
|
|
84
86
|
let srcName,
|
|
@@ -98,7 +100,13 @@ const parseFieldDescription = (field) => {
|
|
|
98
100
|
srcName = field[2];
|
|
99
101
|
}
|
|
100
102
|
} else {
|
|
101
|
-
|
|
103
|
+
if (field.includes(DEFAULT_SPLITER)) {
|
|
104
|
+
//form 5
|
|
105
|
+
destName = field.split(DEFAULT_SPLITER)[0];
|
|
106
|
+
srcName = field;
|
|
107
|
+
} else {
|
|
108
|
+
destName = srcName = field; //form 1
|
|
109
|
+
}
|
|
102
110
|
}
|
|
103
111
|
return {
|
|
104
112
|
srcName,
|