@tmsfe/tms-core 0.0.104 → 0.0.105
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/config.js +17 -2
- package/tsconfig.json +31 -0
package/package.json
CHANGED
package/src/config.js
CHANGED
|
@@ -115,8 +115,23 @@ function getApolloConfig(configPath, extendAttr = {}, defaultCfg) {
|
|
|
115
115
|
const { errCode, resData = {} } = res || {};
|
|
116
116
|
const { status, msg, data } = resData;
|
|
117
117
|
if (errCode === 0 && status === 0) {
|
|
118
|
-
return data
|
|
119
|
-
|
|
118
|
+
return data
|
|
119
|
+
.sort((a, b) =>
|
|
120
|
+
// eslint-disable-next-line implicit-arrow-linebreak
|
|
121
|
+
configPaths.findIndex(configPath => configPath === a.configKey)
|
|
122
|
+
- configPaths.findIndex(configPath => configPath === b.configKey))
|
|
123
|
+
.map((item) => {
|
|
124
|
+
const newItem = {
|
|
125
|
+
...item.content,
|
|
126
|
+
};
|
|
127
|
+
Object.keys(item).forEach((key) => {
|
|
128
|
+
if (key !== 'content') {
|
|
129
|
+
newItem[`_${key}`] = item[key];
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
return newItem;
|
|
133
|
+
});
|
|
134
|
+
};
|
|
120
135
|
throw new Error(msg);
|
|
121
136
|
})
|
|
122
137
|
.catch((e) => {
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"sourceMap": false,
|
|
4
|
+
"target": "esnext",
|
|
5
|
+
"module": "esnext",
|
|
6
|
+
"moduleResolution": "node",
|
|
7
|
+
"allowJs": true,
|
|
8
|
+
"strict": false,
|
|
9
|
+
"declarationMap": false,
|
|
10
|
+
"noUnusedLocals": false,
|
|
11
|
+
"experimentalDecorators": true,
|
|
12
|
+
"resolveJsonModule": true,
|
|
13
|
+
"esModuleInterop": true,
|
|
14
|
+
"removeComments": false,
|
|
15
|
+
"jsx": "preserve",
|
|
16
|
+
"lib": ["esnext"],
|
|
17
|
+
"rootDir": ".",
|
|
18
|
+
"typeRoots": [
|
|
19
|
+
"./node_modules/miniprogram-api-typings/types",
|
|
20
|
+
"./../global.d.ts"
|
|
21
|
+
],
|
|
22
|
+
"outDir": "dist",
|
|
23
|
+
"paths": {
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
"include": [
|
|
27
|
+
"src/**/*.js",
|
|
28
|
+
"src/**/*.ts",
|
|
29
|
+
"../../global.d.ts"
|
|
30
|
+
]
|
|
31
|
+
}
|