@tarojs/plugin-platform-h5 3.7.0-alpha.2 → 3.7.0-alpha.22
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/build/definition-json/index.ts +3 -0
- package/build/definition-json/parser.ts +112 -0
- package/build/rollup-plugin-export-name-only.js +16 -0
- package/build/utils/ast.ts +182 -0
- package/build/utils/helper.ts +56 -0
- package/build/utils/parser.ts +43 -0
- package/dist/definition.json +2407 -0
- package/dist/dist/definition.json.d.ts +3620 -0
- package/dist/dist/definition.json.js +4 -0
- package/dist/dist/definition.json.js.map +1 -0
- package/dist/index.d.ts +8 -2
- package/dist/index.js +92 -88
- package/dist/index.js.map +1 -1
- package/dist/runtime/apis/index.d.ts +5 -4
- package/dist/runtime/apis/index.js +22 -0
- package/dist/runtime/apis/index.js.map +1 -1
- package/package.json +27 -15
- package/types/global.d.ts +4 -0
- package/dist/rollup-plugin-export-name-only.js +0 -22
- package/dist/taroApis.d.ts +0 -5
- package/dist/taroApis.js +0 -2
- package/dist/taroApis.js.map +0 -1
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { fs } from '@tarojs/helper'
|
|
2
|
+
import { paramCase } from 'change-case'
|
|
3
|
+
import ts from 'typescript'
|
|
4
|
+
|
|
5
|
+
import { generateDocumentation } from '../utils/ast'
|
|
6
|
+
|
|
7
|
+
import type { DocEntry } from '../utils/ast'
|
|
8
|
+
|
|
9
|
+
const tsconfig: ts.CompilerOptions = {
|
|
10
|
+
target: ts.ScriptTarget.ES5,
|
|
11
|
+
module: ts.ModuleKind.NodeNext,
|
|
12
|
+
moduleResolution: ts.ModuleResolutionKind.NodeNext,
|
|
13
|
+
noResolve: false,
|
|
14
|
+
paths: {
|
|
15
|
+
'@tarojs/api': ['node_modules/@tarojs/taro/types']
|
|
16
|
+
},
|
|
17
|
+
'types': ['@tarojs/taro-h5/types']
|
|
18
|
+
}
|
|
19
|
+
const CompRGX = /^Taro(.*)Core$/
|
|
20
|
+
const IgnoreSymbols = [
|
|
21
|
+
ts.SymbolFlags.Interface,
|
|
22
|
+
ts.SymbolFlags.TypeLiteral,
|
|
23
|
+
ts.SymbolFlags.TypeAlias,
|
|
24
|
+
]
|
|
25
|
+
|
|
26
|
+
export function parseComponents (docTree: DocEntry[]) {
|
|
27
|
+
// ${component}.${attribute}.${option}
|
|
28
|
+
return docTree.reduce((p, e) => {
|
|
29
|
+
let { name = '', members = [] } = e
|
|
30
|
+
if (CompRGX.test(name)) {
|
|
31
|
+
name = paramCase(name.replace(CompRGX, '$1'))
|
|
32
|
+
p[name] = members.reduce((p2, e2) => {
|
|
33
|
+
p2[e2.name ?? ''] = parseComponentAttribute(e2)
|
|
34
|
+
|
|
35
|
+
return p2
|
|
36
|
+
}, {})
|
|
37
|
+
}
|
|
38
|
+
return p
|
|
39
|
+
}, {})
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export function parseAPIs (docTree: DocEntry[]) {
|
|
43
|
+
// ${API}.${method}.${param}.${option}
|
|
44
|
+
return docTree.reduce((p, e) => {
|
|
45
|
+
if (!IgnoreSymbols.includes(e.flags!)) {
|
|
46
|
+
p[e.name ?? ''] = parseAPIMethod(e)
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
return p
|
|
50
|
+
}, {})
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
const anyTypes = ['any', 'TaroStatic', '{}', 'IAnyObject', 'T']
|
|
54
|
+
const voidTypes = ['', 'void', 'null', 'undefined']
|
|
55
|
+
const anyStr = '*'
|
|
56
|
+
const voidStr = 'void'
|
|
57
|
+
export function parseComponentAttribute (e: DocEntry) {
|
|
58
|
+
return parseAnyOrVoid(e.type, e.type)
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export function parseAPIMethod (e: DocEntry) {
|
|
62
|
+
const o: Record<string, any> = {}
|
|
63
|
+
const { type = 'any', flags = ts.SymbolFlags.None, declarations = [] } = e
|
|
64
|
+
if (anyTypes.includes(type)) {
|
|
65
|
+
return anyStr
|
|
66
|
+
} else if (flags === ts.SymbolFlags.BlockScopedVariable && declarations.length > 0) {
|
|
67
|
+
const [declaration = {}] = declarations
|
|
68
|
+
const { parameters = [], returnType = '' } = declaration
|
|
69
|
+
const [parameter] = parameters
|
|
70
|
+
const isCallback = parameter?.name === 'callback'
|
|
71
|
+
// console.log('parseAPIMethod', e.name, parameters)
|
|
72
|
+
if (isCallback) {
|
|
73
|
+
const [callback] = parameter?.declarations || []
|
|
74
|
+
const obj = callback?.parameters?.[0] || {}
|
|
75
|
+
// FIXME parse callback ${param}.${option}
|
|
76
|
+
o.callback = parseAnyOrVoid(obj?.type)
|
|
77
|
+
} else {
|
|
78
|
+
// FIXME parse parameter ${param}.${option}
|
|
79
|
+
o.object = parseAnyOrVoid(parameter?.type)
|
|
80
|
+
// FIXME parse successCallback ${param}.${option}
|
|
81
|
+
o.success = voidStr
|
|
82
|
+
}
|
|
83
|
+
// FIXME parse returnType ${param}.${option}
|
|
84
|
+
const returnValue = parseAnyOrVoid(returnType)
|
|
85
|
+
if (returnValue !== voidStr) {
|
|
86
|
+
o.return = returnValue
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
return o
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export function parseAnyOrVoid (str = '', obj: unknown = str) {
|
|
93
|
+
return anyTypes.includes(str) ? anyStr : voidTypes.includes(str) ? voidStr : obj || str
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export function parseDefinitionJSON ({
|
|
97
|
+
apisPath = require.resolve('@tarojs/taro-h5/dist/index.esm.d.ts'),
|
|
98
|
+
componentsPath = require.resolve('@tarojs/components/dist/types/components.d.ts'),
|
|
99
|
+
} = {},
|
|
100
|
+
config: ts.CompilerOptions = tsconfig,
|
|
101
|
+
) {
|
|
102
|
+
const apis = parseAPIs(generateDocumentation([apisPath], config))
|
|
103
|
+
const Components = generateDocumentation([componentsPath], config).find(e => e.name === 'Components')?.children || []
|
|
104
|
+
const components = parseComponents(Components)
|
|
105
|
+
|
|
106
|
+
// Note: 写入文件
|
|
107
|
+
fs.ensureDirSync('dist')
|
|
108
|
+
fs.writeJSONSync('dist/definition.json', {
|
|
109
|
+
apis,
|
|
110
|
+
components,
|
|
111
|
+
}, { spaces: 2 })
|
|
112
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export default function exportNameOnly () {
|
|
2
|
+
const emptyMap = { mappings: '' }
|
|
3
|
+
return {
|
|
4
|
+
name: 'export-name-only',
|
|
5
|
+
renderChunk (code, chunk) {
|
|
6
|
+
const pos = chunk.exports.indexOf('default')
|
|
7
|
+
if (pos > -1) {
|
|
8
|
+
chunk.exports.splice(pos, 1)
|
|
9
|
+
}
|
|
10
|
+
return {
|
|
11
|
+
code: `module.exports = new Set(${JSON.stringify(chunk.exports)})`,
|
|
12
|
+
map: emptyMap
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
import * as path from 'path'
|
|
2
|
+
import ts from 'typescript'
|
|
3
|
+
|
|
4
|
+
export interface DocEntry {
|
|
5
|
+
name?: string
|
|
6
|
+
kind?: ts.SyntaxKind
|
|
7
|
+
flags?: ts.SymbolFlags
|
|
8
|
+
fileName?: string
|
|
9
|
+
type?: string
|
|
10
|
+
constructors?: DocEntry[]
|
|
11
|
+
parameters?: DocEntry[]
|
|
12
|
+
returnType?: string
|
|
13
|
+
members?: DocEntry[]
|
|
14
|
+
exports?: DocEntry[]
|
|
15
|
+
children?: DocEntry[]
|
|
16
|
+
declarations?: DocEntry[]
|
|
17
|
+
symbol?: DocEntry
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export function pathsAreEqual (path1: string, path2: string) {
|
|
21
|
+
path1 = path.resolve(path1)
|
|
22
|
+
path2 = path.resolve(path2)
|
|
23
|
+
if (process.platform === 'win32') {
|
|
24
|
+
return path1.toLowerCase() === path2.toLowerCase()
|
|
25
|
+
}
|
|
26
|
+
return path1 === path2
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export function generateDocumentation (
|
|
30
|
+
filepaths: string[],
|
|
31
|
+
options: ts.CompilerOptions,
|
|
32
|
+
param: {
|
|
33
|
+
mapAll?: boolean
|
|
34
|
+
withDeclaration?: boolean
|
|
35
|
+
} = {},
|
|
36
|
+
output: DocEntry[] = []
|
|
37
|
+
): DocEntry[] {
|
|
38
|
+
const program = ts.createProgram(filepaths, options)
|
|
39
|
+
const checker = program.getTypeChecker()
|
|
40
|
+
|
|
41
|
+
for (const sourceFile of program.getSourceFiles()) {
|
|
42
|
+
if (param.withDeclaration !== false || !sourceFile.isDeclarationFile) {
|
|
43
|
+
if (
|
|
44
|
+
(param.mapAll === true && filepaths.includes(sourceFile.fileName))
|
|
45
|
+
|| pathsAreEqual(sourceFile.fileName, filepaths[0])
|
|
46
|
+
) {
|
|
47
|
+
ts.forEachChild(sourceFile, (n) => visitAST(n, output))
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
return output
|
|
53
|
+
|
|
54
|
+
function visitAST (node: ts.Node, o: DocEntry[]) {
|
|
55
|
+
// Only consider exported nodes
|
|
56
|
+
if (!isNodeExported(node as ts.Declaration) || node.kind === ts.SyntaxKind.EndOfFileToken || node.kind === ts.SyntaxKind.DeclareKeyword
|
|
57
|
+
|| ts.isImportDeclaration(node) || ts.isImportEqualsDeclaration(node) || ts.isImportClause(node)
|
|
58
|
+
|| ts.isExportAssignment(node) || ts.isExportDeclaration(node)
|
|
59
|
+
|| ts.isExpressionStatement(node) || ts.isEmptyStatement(node)
|
|
60
|
+
|| ts.isStringLiteral(node)
|
|
61
|
+
|| node.kind === ts.SyntaxKind.ExportKeyword) {
|
|
62
|
+
return
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
if (ts.isVariableDeclaration(node) || ts.isClassDeclaration(node) && node.name) {
|
|
66
|
+
const symbol = checker.getSymbolAtLocation(node)
|
|
67
|
+
symbol && o.push(serializeClass(symbol))
|
|
68
|
+
} else if (ts.isFunctionDeclaration(node)) {
|
|
69
|
+
const signature = checker.getSignatureFromDeclaration(node)
|
|
70
|
+
signature && o.push(serializeSignature(signature, node.name && ts.idText(node.name)))
|
|
71
|
+
} else if (ts.isInterfaceDeclaration(node)) {
|
|
72
|
+
const symbol = checker.getTypeAtLocation(node).getSymbol()
|
|
73
|
+
symbol && o.push(serializeType(symbol, undefined, 'InterfaceDeclaration'))
|
|
74
|
+
} else if (ts.isTypeAliasDeclaration(node)) {
|
|
75
|
+
const type = checker.getTypeAtLocation(node)
|
|
76
|
+
const symbol = type.getSymbol()
|
|
77
|
+
if (symbol) {
|
|
78
|
+
const st = serializeType(symbol, ts.idText(node.name))
|
|
79
|
+
o.push(st)
|
|
80
|
+
} else {
|
|
81
|
+
// @ts-ignore
|
|
82
|
+
const sym = node.symbol; const type = node.type?.types?.map(e => checker.typeToString(checker.getTypeFromTypeNode(e))).join(' | ')
|
|
83
|
+
o.push(
|
|
84
|
+
serializeSymbol(sym, sym.getName(), type)
|
|
85
|
+
)
|
|
86
|
+
}
|
|
87
|
+
} else if (ts.isEnumDeclaration(node)) {
|
|
88
|
+
const symbol = checker.getTypeAtLocation(node).getSymbol()
|
|
89
|
+
symbol && o.push(serializeType(symbol))
|
|
90
|
+
} else if (ts.isIdentifier(node)) {
|
|
91
|
+
const symbol = checker.getTypeAtLocation(node).getSymbol()
|
|
92
|
+
symbol && o.push(serializeType(symbol))
|
|
93
|
+
} else if (ts.isModuleDeclaration(node) || ts.isVariableStatement(node)) {
|
|
94
|
+
// This is a namespace, visitAST its children
|
|
95
|
+
ts.forEachChild(node, (n) => visitAST(n, o))
|
|
96
|
+
} else if (ts.isModuleBlock(node)) {
|
|
97
|
+
// This is a namespace, visitAST its children
|
|
98
|
+
const out: DocEntry = {
|
|
99
|
+
name: ts.isIdentifier(node.parent.name) ? ts.idText(node.parent.name) : '',
|
|
100
|
+
kind: node.kind,
|
|
101
|
+
children: []
|
|
102
|
+
}
|
|
103
|
+
ts.forEachChild(node, (n) => visitAST(n, out.children!))
|
|
104
|
+
o.push(out)
|
|
105
|
+
} else if (ts.isVariableDeclarationList(node)) {
|
|
106
|
+
node.declarations.forEach(d => {
|
|
107
|
+
// @ts-ignore
|
|
108
|
+
const symbol = d.symbol // checker.getSymbolsInScope(d, d.symbol.flags)
|
|
109
|
+
symbol && o.push(serializeType(symbol))
|
|
110
|
+
})
|
|
111
|
+
} else {
|
|
112
|
+
console.warn(`WARN: Statement kind ${node.kind} is missing parse!\n\n${node.getText()}\n\n`)
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/** Serialize a symbol into a json object */
|
|
117
|
+
function serializeSymbol (symbol: ts.Symbol, name?: string, type?: string): DocEntry {
|
|
118
|
+
const declarations: DocEntry[] = [];
|
|
119
|
+
(symbol.getDeclarations() || []).map(
|
|
120
|
+
d => checker.getSignaturesOfType(checker.getTypeAtLocation(d), ts.SignatureKind.Call).map(
|
|
121
|
+
e => declarations.push(serializeSignature(e))
|
|
122
|
+
)
|
|
123
|
+
)
|
|
124
|
+
|
|
125
|
+
return {
|
|
126
|
+
name: name || symbol.getName(),
|
|
127
|
+
flags: symbol.flags,
|
|
128
|
+
type: type || checker.typeToString(
|
|
129
|
+
checker.getTypeOfSymbolAtLocation(symbol, symbol.valueDeclaration!)
|
|
130
|
+
),
|
|
131
|
+
declarations
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
/** Serialize a class symbol information */
|
|
136
|
+
function serializeClass (symbol: ts.Symbol) {
|
|
137
|
+
const details = serializeSymbol(symbol)
|
|
138
|
+
// Get the construct signatures
|
|
139
|
+
const constructorType = checker.getTypeOfSymbolAtLocation(
|
|
140
|
+
symbol,
|
|
141
|
+
symbol.valueDeclaration!
|
|
142
|
+
)
|
|
143
|
+
const signatures = constructorType.getConstructSignatures()
|
|
144
|
+
details.constructors = signatures.map(n => serializeSignature(n))
|
|
145
|
+
return details
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/** Serialize a types (type or interface) symbol information */
|
|
149
|
+
function serializeType (symbol: ts.Symbol, name?: string, type?: keyof typeof ts.SyntaxKind): DocEntry {
|
|
150
|
+
// console.log(type, Object.keys(symbol))
|
|
151
|
+
const doc: DocEntry = serializeSymbol(symbol, name, type)
|
|
152
|
+
symbol.exports && symbol.exports.forEach((value) => {
|
|
153
|
+
if (!doc.exports) doc.exports = []
|
|
154
|
+
doc.exports.push(serializeSymbol(value))
|
|
155
|
+
})
|
|
156
|
+
symbol.members && symbol.members.forEach((value) => {
|
|
157
|
+
if (!doc.members) doc.members = []
|
|
158
|
+
doc.members.push(serializeSymbol(value))
|
|
159
|
+
})
|
|
160
|
+
return doc
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
/** Serialize a signature (call or construct) */
|
|
164
|
+
function serializeSignature (signature: ts.Signature, name?: string) {
|
|
165
|
+
const typeParameters = signature.getTypeParameters() || []
|
|
166
|
+
|
|
167
|
+
return {
|
|
168
|
+
name,
|
|
169
|
+
parameters: signature.getParameters().map((e, i) =>
|
|
170
|
+
serializeSymbol(e, undefined, typeParameters[i] && checker.typeToString(typeParameters[i]))),
|
|
171
|
+
returnType: checker.typeToString(signature.getReturnType())
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
/** True if this is visible outside this file, false otherwise */
|
|
176
|
+
function isNodeExported (node: ts.Declaration): boolean {
|
|
177
|
+
return (
|
|
178
|
+
(ts.getCombinedModifierFlags(node) & ts.ModifierFlags.Export) !== 0 ||
|
|
179
|
+
(!!node.parent/* && node.parent.kind === ts.SyntaxKind.SourceFile */)
|
|
180
|
+
)
|
|
181
|
+
}
|
|
182
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import ts from 'typescript'
|
|
2
|
+
|
|
3
|
+
const SymbolFlags = Object.values(ts.SymbolFlags)
|
|
4
|
+
|
|
5
|
+
export function splicing (arr: (string | undefined)[] = [], lf = '\n') {
|
|
6
|
+
return arr.filter(e => typeof e === 'string').join(lf)
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export function parseLineFeed (s?: string, isCode = false) {
|
|
10
|
+
if (!s) return ''
|
|
11
|
+
const r = s.split('|').join('or').split('\n').join('<br />')
|
|
12
|
+
return isCode && !s.includes('|') ? `\`${r}\`` : r
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export function isShowMembers (flags?: ts.SymbolFlags, used: ts.SymbolFlags[] = []) {
|
|
16
|
+
return [
|
|
17
|
+
ts.SymbolFlags.EnumMember,
|
|
18
|
+
ts.SymbolFlags.Function,
|
|
19
|
+
ts.SymbolFlags.Class,
|
|
20
|
+
ts.SymbolFlags.Interface,
|
|
21
|
+
ts.SymbolFlags.ValueModule,
|
|
22
|
+
ts.SymbolFlags.NamespaceModule,
|
|
23
|
+
ts.SymbolFlags.TypeLiteral,
|
|
24
|
+
ts.SymbolFlags.Method,
|
|
25
|
+
ts.SymbolFlags.TypeAlias,
|
|
26
|
+
].some(v => {
|
|
27
|
+
const e = (flags || -1) - v
|
|
28
|
+
return e > -1 && !used.includes(v) && (e === 0 || isShowMembers(e, [...used, v]))
|
|
29
|
+
})
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export function isShowAPI (flags?: ts.SymbolFlags): flags is ts.SymbolFlags.Property | ts.SymbolFlags.Method {
|
|
33
|
+
return [
|
|
34
|
+
ts.SymbolFlags.Property,
|
|
35
|
+
ts.SymbolFlags.Method,
|
|
36
|
+
ts.SymbolFlags.Optional + ts.SymbolFlags.Property,
|
|
37
|
+
ts.SymbolFlags.Optional + ts.SymbolFlags.Method,
|
|
38
|
+
].includes(flags || -1)
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export function isNotAPI (flags?: ts.SymbolFlags): flags is ts.SymbolFlags.Signature | ts.SymbolFlags.TypeParameter {
|
|
42
|
+
return [
|
|
43
|
+
-1,
|
|
44
|
+
ts.SymbolFlags.Signature,
|
|
45
|
+
ts.SymbolFlags.TypeParameter,
|
|
46
|
+
].includes(flags || -1)
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export function isFunction (flags?: ts.SymbolFlags): flags is ts.SymbolFlags.Function | ts.SymbolFlags.Method {
|
|
50
|
+
return SymbolFlags.includes((flags || -1) - ts.SymbolFlags.Function)
|
|
51
|
+
|| SymbolFlags.includes((flags || -1) - ts.SymbolFlags.Method)
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export function isOptional (flags?: ts.SymbolFlags): flags is ts.SymbolFlags.Optional {
|
|
55
|
+
return SymbolFlags.includes((flags || -1) - ts.SymbolFlags.Optional)
|
|
56
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { isFunction } from './helper'
|
|
2
|
+
|
|
3
|
+
import type { DocEntry } from './ast'
|
|
4
|
+
|
|
5
|
+
export async function childrenMerge (d: DocEntry[] = [], o: DocEntry[] = []) {
|
|
6
|
+
for (const e of d) {
|
|
7
|
+
const name = e.name || 'undefined'
|
|
8
|
+
if (!o.find(v => v.name === name)) o.push(e)
|
|
9
|
+
const target = o.find(v => v.name === name) || {}
|
|
10
|
+
for (const key in e) {
|
|
11
|
+
if (e.hasOwnProperty(key) && e[key] && !['name', 'kind'].includes(key)) {
|
|
12
|
+
if (key === 'flags') {
|
|
13
|
+
if (!target.flags || !isFunction(e.flags)) target.flags = e.flags
|
|
14
|
+
} else if (key === 'children') {
|
|
15
|
+
target.children = await childrenMerge(e.children, target.children)
|
|
16
|
+
} else if (key === 'exports') {
|
|
17
|
+
target.exports = await childrenMerge(e.exports, target.exports)
|
|
18
|
+
target[key] = e[key] || target[key]
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
return o.map(e => {
|
|
25
|
+
if (e.children) {
|
|
26
|
+
if (!e.exports) e.exports = []
|
|
27
|
+
for (const k of e.children) {
|
|
28
|
+
const kk = e.exports!.find(kk => kk.name === k.name)
|
|
29
|
+
if (!kk) {
|
|
30
|
+
e.exports!.push(k)
|
|
31
|
+
} else {
|
|
32
|
+
for (const key in k) {
|
|
33
|
+
if (k.hasOwnProperty(key) && !kk[key]) {
|
|
34
|
+
kk[key] = k[key]
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
delete e.children
|
|
40
|
+
}
|
|
41
|
+
return e
|
|
42
|
+
})
|
|
43
|
+
}
|