@lcap/nasl 3.5.0-beta.3 → 3.5.0-beta.5
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/out/breakpoint/store/core.js +1 -1
- package/out/breakpoint/store/core.js.map +1 -1
- package/out/common/BaseNode.d.ts +7 -0
- package/out/common/BaseNode.js +15 -2
- package/out/common/BaseNode.js.map +1 -1
- package/out/concepts/AnonymousFunction__.d.ts +1 -0
- package/out/concepts/AnonymousFunction__.js +34 -16
- package/out/concepts/AnonymousFunction__.js.map +1 -1
- package/out/concepts/Argument__.d.ts +1 -0
- package/out/concepts/Argument__.js +28 -8
- package/out/concepts/Argument__.js.map +1 -1
- package/out/concepts/Assignment__.js +5 -7
- package/out/concepts/Assignment__.js.map +1 -1
- package/out/concepts/BatchAssignment__.js +5 -3
- package/out/concepts/BatchAssignment__.js.map +1 -1
- package/out/concepts/BinaryExpression__.d.ts +1 -0
- package/out/concepts/BinaryExpression__.js +30 -13
- package/out/concepts/BinaryExpression__.js.map +1 -1
- package/out/concepts/BindAttribute__.js +11 -3
- package/out/concepts/BindAttribute__.js.map +1 -1
- package/out/concepts/BindDirective__.js +3 -3
- package/out/concepts/BindDirective__.js.map +1 -1
- package/out/concepts/BindEvent__.js +2 -2
- package/out/concepts/BindEvent__.js.map +1 -1
- package/out/concepts/BooleanLiteral__.d.ts +1 -0
- package/out/concepts/BooleanLiteral__.js +6 -0
- package/out/concepts/BooleanLiteral__.js.map +1 -1
- package/out/concepts/BusinessComponent__.d.ts +4 -2
- package/out/concepts/BusinessComponent__.js +128 -89
- package/out/concepts/BusinessComponent__.js.map +1 -1
- package/out/concepts/CallConnector__.d.ts +1 -0
- package/out/concepts/CallConnector__.js +6 -0
- package/out/concepts/CallConnector__.js.map +1 -1
- package/out/concepts/CallEvent__.d.ts +4 -0
- package/out/concepts/CallEvent__.js +19 -2
- package/out/concepts/CallEvent__.js.map +1 -1
- package/out/concepts/CallFunction__.d.ts +1 -0
- package/out/concepts/CallFunction__.js +62 -8
- package/out/concepts/CallFunction__.js.map +1 -1
- package/out/concepts/CallInterface__.js +31 -22
- package/out/concepts/CallInterface__.js.map +1 -1
- package/out/concepts/CallLogic__.js +49 -38
- package/out/concepts/CallLogic__.js.map +1 -1
- package/out/concepts/CallQueryComponent__.d.ts +2 -0
- package/out/concepts/CallQueryComponent__.js +94 -8
- package/out/concepts/CallQueryComponent__.js.map +1 -1
- package/out/concepts/DefaultValue__.d.ts +1 -0
- package/out/concepts/DefaultValue__.js +7 -1
- package/out/concepts/DefaultValue__.js.map +1 -1
- package/out/concepts/Destination__.d.ts +1 -1
- package/out/concepts/Destination__.js +34 -22
- package/out/concepts/Destination__.js.map +1 -1
- package/out/concepts/EntityProperty__.d.ts +1 -0
- package/out/concepts/EntityProperty__.js +26 -2
- package/out/concepts/EntityProperty__.js.map +1 -1
- package/out/concepts/Entity__.d.ts +1 -0
- package/out/concepts/Entity__.js +25 -0
- package/out/concepts/Entity__.js.map +1 -1
- package/out/concepts/EnumItem__.d.ts +1 -0
- package/out/concepts/EnumItem__.js +12 -0
- package/out/concepts/EnumItem__.js.map +1 -1
- package/out/concepts/Enum__.d.ts +1 -0
- package/out/concepts/Enum__.js +16 -2
- package/out/concepts/Enum__.js.map +1 -1
- package/out/concepts/Event__.d.ts +4 -0
- package/out/concepts/Event__.js +12 -0
- package/out/concepts/Event__.js.map +1 -1
- package/out/concepts/ForEachStatement__.js +10 -16
- package/out/concepts/ForEachStatement__.js.map +1 -1
- package/out/concepts/FrontendType__.js +1 -0
- package/out/concepts/FrontendType__.js.map +1 -1
- package/out/concepts/Identifier__.d.ts +2 -0
- package/out/concepts/Identifier__.js +21 -0
- package/out/concepts/Identifier__.js.map +1 -1
- package/out/concepts/JSBlock__.js +1 -1
- package/out/concepts/JSBlock__.js.map +1 -1
- package/out/concepts/LogicItem__.d.ts +6 -0
- package/out/concepts/LogicItem__.js +11 -1
- package/out/concepts/LogicItem__.js.map +1 -1
- package/out/concepts/Logic__.js +24 -23
- package/out/concepts/Logic__.js.map +1 -1
- package/out/concepts/MatchCase__.js +5 -5
- package/out/concepts/MatchCase__.js.map +1 -1
- package/out/concepts/Match__.js +1 -1
- package/out/concepts/Match__.js.map +1 -1
- package/out/concepts/MemberExpression__.d.ts +1 -0
- package/out/concepts/MemberExpression__.js +13 -3
- package/out/concepts/MemberExpression__.js.map +1 -1
- package/out/concepts/NewComposite__.js +3 -3
- package/out/concepts/NewComposite__.js.map +1 -1
- package/out/concepts/NewList__.js +4 -4
- package/out/concepts/NewList__.js.map +1 -1
- package/out/concepts/NewMap__.d.ts +1 -1
- package/out/concepts/NewMap__.js +6 -5
- package/out/concepts/NewMap__.js.map +1 -1
- package/out/concepts/NullLiteral__.d.ts +2 -0
- package/out/concepts/NullLiteral__.js +12 -0
- package/out/concepts/NullLiteral__.js.map +1 -1
- package/out/concepts/NumericLiteral__.d.ts +1 -0
- package/out/concepts/NumericLiteral__.js +7 -1
- package/out/concepts/NumericLiteral__.js.map +1 -1
- package/out/concepts/OqlQueryComponent__.js +4 -2
- package/out/concepts/OqlQueryComponent__.js.map +1 -1
- package/out/concepts/Param__.d.ts +1 -0
- package/out/concepts/Param__.js +41 -0
- package/out/concepts/Param__.js.map +1 -1
- package/out/concepts/ProcessElement__.js +9 -1
- package/out/concepts/ProcessElement__.js.map +1 -1
- package/out/concepts/QueryAggregateExpression__.d.ts +2 -0
- package/out/concepts/QueryAggregateExpression__.js +16 -0
- package/out/concepts/QueryAggregateExpression__.js.map +1 -1
- package/out/concepts/QueryFieldExpression__.d.ts +2 -0
- package/out/concepts/QueryFieldExpression__.js +33 -0
- package/out/concepts/QueryFieldExpression__.js.map +1 -1
- package/out/concepts/QueryFromExpression__.d.ts +2 -0
- package/out/concepts/QueryFromExpression__.js +27 -0
- package/out/concepts/QueryFromExpression__.js.map +1 -1
- package/out/concepts/QueryGroupByExpression__.d.ts +2 -0
- package/out/concepts/QueryGroupByExpression__.js +13 -1
- package/out/concepts/QueryGroupByExpression__.js.map +1 -1
- package/out/concepts/QueryJoinExpression__.d.ts +2 -0
- package/out/concepts/QueryJoinExpression__.js +37 -0
- package/out/concepts/QueryJoinExpression__.js.map +1 -1
- package/out/concepts/QueryLimitExpression__.d.ts +2 -0
- package/out/concepts/QueryLimitExpression__.js +16 -0
- package/out/concepts/QueryLimitExpression__.js.map +1 -1
- package/out/concepts/QueryOrderByExpression__.d.ts +2 -0
- package/out/concepts/QueryOrderByExpression__.js +22 -0
- package/out/concepts/QueryOrderByExpression__.js.map +1 -1
- package/out/concepts/QuerySelectExpression__.d.ts +3 -0
- package/out/concepts/QuerySelectExpression__.js +41 -0
- package/out/concepts/QuerySelectExpression__.js.map +1 -1
- package/out/concepts/SelectMembers__.d.ts +1 -0
- package/out/concepts/SelectMembers__.js +7 -0
- package/out/concepts/SelectMembers__.js.map +1 -1
- package/out/concepts/SqlQueryComponent__.js +4 -2
- package/out/concepts/SqlQueryComponent__.js.map +1 -1
- package/out/concepts/StringInterpolation__.d.ts +1 -0
- package/out/concepts/StringInterpolation__.js +20 -2
- package/out/concepts/StringInterpolation__.js.map +1 -1
- package/out/concepts/StringLiteral__.d.ts +1 -0
- package/out/concepts/StringLiteral__.js +21 -1
- package/out/concepts/StringLiteral__.js.map +1 -1
- package/out/concepts/StructureProperty__.d.ts +1 -0
- package/out/concepts/StructureProperty__.js +19 -0
- package/out/concepts/StructureProperty__.js.map +1 -1
- package/out/concepts/Structure__.d.ts +1 -0
- package/out/concepts/Structure__.js +22 -7
- package/out/concepts/Structure__.js.map +1 -1
- package/out/concepts/SwitchCase__.js +1 -1
- package/out/concepts/SwitchCase__.js.map +1 -1
- package/out/concepts/TypeAnnotation__.d.ts +1 -0
- package/out/concepts/TypeAnnotation__.js +42 -1
- package/out/concepts/TypeAnnotation__.js.map +1 -1
- package/out/concepts/TypeParam__.d.ts +2 -1
- package/out/concepts/TypeParam__.js +7 -1
- package/out/concepts/TypeParam__.js.map +1 -1
- package/out/concepts/Unparsed__.js +1 -1
- package/out/concepts/Unparsed__.js.map +1 -1
- package/out/concepts/ValidationRule__.js +2 -1
- package/out/concepts/ValidationRule__.js.map +1 -1
- package/out/concepts/ViewElement__.d.ts +1 -0
- package/out/concepts/ViewElement__.js +72 -59
- package/out/concepts/ViewElement__.js.map +1 -1
- package/out/concepts/View__.d.ts +2 -1
- package/out/concepts/View__.js +6 -19
- package/out/concepts/View__.js.map +1 -1
- package/out/generator/genBundleFiles.d.ts +1 -0
- package/out/generator/genBundleFiles.js +4 -1
- package/out/generator/genBundleFiles.js.map +1 -1
- package/out/natural/genNaturalTS.d.ts +4 -1
- package/out/natural/genNaturalTS.js +38 -1
- package/out/natural/genNaturalTS.js.map +1 -1
- package/out/natural/transformTSCode.js +52 -41
- package/out/natural/transformTSCode.js.map +1 -1
- package/out/server/formatTsUtils.js +10 -9
- package/out/server/formatTsUtils.js.map +1 -1
- package/out/server/getFunctions.js +3 -3
- package/out/server/getFunctions.js.map +1 -1
- package/out/server/getProcesses.js +3 -3
- package/out/server/getProcesses.js.map +1 -1
- package/out/server/naslServer.js +52 -17
- package/out/server/naslServer.js.map +1 -1
- package/out/server/translator.js +8 -0
- package/out/server/translator.js.map +1 -1
- package/out/templator/genCurdEditMultipleKeyBlock.js +1 -1
- package/out/templator/genCurdEditMultipleKeyBlock.js.map +1 -1
- package/out/templator/genGetBlock.js +2 -1
- package/out/templator/genGetBlock.js.map +1 -1
- package/out/templator/genUpdateBlock.js +2 -1
- package/out/templator/genUpdateBlock.js.map +1 -1
- package/out/templator/utils.js +3 -3
- package/out/templator/utils.js.map +1 -1
- package/out/translator/types.d.ts +2 -0
- package/out/translator/utils.d.ts +2 -1
- package/out/translator/utils.js +44 -7
- package/out/translator/utils.js.map +1 -1
- package/out/utils/string.js +2 -2
- package/out/utils/string.js.map +1 -1
- package/out/utils/time-slicing/performance.js +3 -3
- package/out/utils/time-slicing/performance.js.map +1 -1
- package/package.json +2 -2
- package/src/breakpoint/store/core.ts +1 -1
- package/src/common/BaseNode.ts +17 -3
- package/src/concepts/AnonymousFunction__.ts +24 -9
- package/src/concepts/Argument__.ts +28 -6
- package/src/concepts/Assignment__.ts +5 -7
- package/src/concepts/BatchAssignment__.ts +6 -3
- package/src/concepts/BinaryExpression__.ts +30 -13
- package/src/concepts/BindAttribute__.ts +10 -3
- package/src/concepts/BindDirective__.ts +3 -3
- package/src/concepts/BindEvent__.ts +2 -2
- package/src/concepts/BooleanLiteral__.ts +5 -0
- package/src/concepts/BusinessComponent__.ts +144 -100
- package/src/concepts/CallConnector__.ts +5 -0
- package/src/concepts/CallEvent__.ts +20 -3
- package/src/concepts/CallFunction__.ts +54 -8
- package/src/concepts/CallInterface__.ts +31 -24
- package/src/concepts/CallLogic__.ts +48 -37
- package/src/concepts/CallQueryComponent__.ts +101 -8
- package/src/concepts/DefaultValue__.ts +6 -1
- package/src/concepts/Destination__.ts +32 -22
- package/src/concepts/EntityProperty__.ts +30 -2
- package/src/concepts/Entity__.ts +29 -0
- package/src/concepts/EnumItem__.ts +17 -0
- package/src/concepts/Enum__.ts +19 -2
- package/src/concepts/Event__.ts +13 -0
- package/src/concepts/ForEachStatement__.ts +10 -20
- package/src/concepts/FrontendType__.ts +1 -0
- package/src/concepts/Identifier__.ts +19 -0
- package/src/concepts/JSBlock__.ts +1 -1
- package/src/concepts/LogicItem__.ts +13 -1
- package/src/concepts/Logic__.ts +24 -24
- package/src/concepts/MatchCase__.ts +5 -5
- package/src/concepts/Match__.ts +1 -1
- package/src/concepts/MemberExpression__.ts +12 -3
- package/src/concepts/NewComposite__.ts +7 -9
- package/src/concepts/NewList__.ts +4 -4
- package/src/concepts/NewMap__.ts +6 -5
- package/src/concepts/NullLiteral__.ts +10 -0
- package/src/concepts/NumericLiteral__.ts +6 -1
- package/src/concepts/OqlQueryComponent__.ts +4 -2
- package/src/concepts/Param__.ts +39 -0
- package/src/concepts/ProcessElement__.ts +8 -1
- package/src/concepts/QueryAggregateExpression__.ts +15 -0
- package/src/concepts/QueryFieldExpression__.ts +34 -0
- package/src/concepts/QueryFromExpression__.ts +29 -0
- package/src/concepts/QueryGroupByExpression__.ts +11 -1
- package/src/concepts/QueryJoinExpression__.ts +39 -0
- package/src/concepts/QueryLimitExpression__.ts +14 -0
- package/src/concepts/QueryOrderByExpression__.ts +23 -0
- package/src/concepts/QuerySelectExpression__.ts +55 -0
- package/src/concepts/SelectMembers__.ts +7 -0
- package/src/concepts/SqlQueryComponent__.ts +4 -2
- package/src/concepts/StringInterpolation__.ts +18 -2
- package/src/concepts/StringLiteral__.ts +20 -1
- package/src/concepts/StructureProperty__.ts +22 -0
- package/src/concepts/Structure__.ts +24 -7
- package/src/concepts/SwitchCase__.ts +1 -1
- package/src/concepts/TypeAnnotation__.ts +37 -1
- package/src/concepts/TypeParam__.ts +6 -1
- package/src/concepts/Unparsed__.ts +1 -1
- package/src/concepts/ValidationRule__.ts +6 -1
- package/src/concepts/ViewElement__.ts +74 -58
- package/src/concepts/View__.ts +6 -19
- package/src/generator/genBundleFiles.ts +6 -1
- package/src/natural/genNaturalTS.ts +41 -0
- package/src/natural/transformTSCode.ts +50 -42
- package/src/server/formatTsUtils.ts +16 -11
- package/src/server/getFunctions.ts +3 -3
- package/src/server/getProcesses.ts +3 -3
- package/src/server/naslServer.ts +56 -18
- package/src/server/translator.ts +7 -0
- package/src/templator/genCurdEditMultipleKeyBlock.ts +1 -1
- package/src/templator/genGetBlock.ts +2 -1
- package/src/templator/genUpdateBlock.ts +2 -1
- package/src/templator/utils.ts +3 -3
- package/src/translator/types.ts +4 -0
- package/src/translator/utils.ts +73 -34
- package/src/utils/string.ts +2 -2
- package/src/utils/time-slicing/performance.ts +3 -3
- package/test/concepts/call-interface/__snapshots__/getQuickInfoOffset.spec.ts.snap +3 -3
- package/test/concepts/call-interface/__snapshots__/toEmbeddedTS.spec.ts.snap +3 -3
- package/test/concepts/view-element/__snapshots__/toEmbeddedTS.spec.ts.snap +199 -0
- package/test/concepts/view-element/__snapshots__/toVue.spec.ts.snap +127 -6
- package/test/concepts/view-element/fixtures/table-data-source-calllogic-with-server-validation.json +2074 -0
- package/test/concepts/view-element/toVue.spec.ts +0 -1
- package/ts-worker/package.json +1 -1
- package/ts-worker/src/index.js +1 -0
|
@@ -1035,10 +1035,6 @@ export class BusinessComponent extends BaseNode {
|
|
|
1035
1035
|
return node;
|
|
1036
1036
|
}
|
|
1037
1037
|
|
|
1038
|
-
getLogicExistingNames(excludedList: Array<BusinessLogic> = []) {
|
|
1039
|
-
const excludedSet = new Set(excludedList);
|
|
1040
|
-
return ((this.logics as BusinessLogic[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item?.name);
|
|
1041
|
-
}
|
|
1042
1038
|
getLogicUniqueName(name = 'logic1') {
|
|
1043
1039
|
return utils.unique(name, this.getLogicExistingNames(), undefined, false);
|
|
1044
1040
|
}
|
|
@@ -1675,6 +1671,28 @@ export class BusinessComponent extends BaseNode {
|
|
|
1675
1671
|
// ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
|
|
1676
1672
|
// 自动生成的代码已结束。下面可以手动编写。
|
|
1677
1673
|
//================================================================================
|
|
1674
|
+
getLogicExistingNames(excludedList: Array<Logic> = []) {
|
|
1675
|
+
const excludedSet = new Set(excludedList);
|
|
1676
|
+
const varList: any[] = [];
|
|
1677
|
+
if (Array.isArray(this.params)) {
|
|
1678
|
+
varList.push(...this.params);
|
|
1679
|
+
}
|
|
1680
|
+
if (Array.isArray(this.variables)) {
|
|
1681
|
+
varList.push(...this.variables);
|
|
1682
|
+
}
|
|
1683
|
+
if (Array.isArray(this.logics)) {
|
|
1684
|
+
varList.push(...this.logics);
|
|
1685
|
+
}
|
|
1686
|
+
if (Array.isArray(this.bindEvents)) {
|
|
1687
|
+
this.bindEvents.forEach((bindEvent) => {
|
|
1688
|
+
if (Array.isArray(bindEvent.logics)) {
|
|
1689
|
+
varList.push(...bindEvent.logics);
|
|
1690
|
+
}
|
|
1691
|
+
});
|
|
1692
|
+
}
|
|
1693
|
+
return varList.filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
1694
|
+
}
|
|
1695
|
+
|
|
1678
1696
|
static getDefaultOptions() {
|
|
1679
1697
|
return {
|
|
1680
1698
|
title: '业务组件',
|
|
@@ -1813,6 +1831,23 @@ export class BusinessComponent extends BaseNode {
|
|
|
1813
1831
|
});
|
|
1814
1832
|
}
|
|
1815
1833
|
|
|
1834
|
+
collectExistingBusinessComponent() {
|
|
1835
|
+
const excludedSet = new Set();
|
|
1836
|
+
// 先把自身加进去
|
|
1837
|
+
excludedSet.add(this);
|
|
1838
|
+
this.elements.forEach((element) => {
|
|
1839
|
+
const set = element.collectExistingBusinessComponent();
|
|
1840
|
+
if (set.size) {
|
|
1841
|
+
set.forEach(value => {
|
|
1842
|
+
if (!excludedSet.has(value)) {
|
|
1843
|
+
excludedSet.add(value);
|
|
1844
|
+
}
|
|
1845
|
+
});
|
|
1846
|
+
}
|
|
1847
|
+
});
|
|
1848
|
+
return excludedSet;
|
|
1849
|
+
}
|
|
1850
|
+
|
|
1816
1851
|
// 获取当前业务组件的所有组件的名字
|
|
1817
1852
|
getViewElementExistingNames(excludedList: Array<ViewElement> = []) {
|
|
1818
1853
|
if (!this.existingViewElement.size) {
|
|
@@ -1875,14 +1910,17 @@ export class BusinessComponent extends BaseNode {
|
|
|
1875
1910
|
}
|
|
1876
1911
|
}
|
|
1877
1912
|
|
|
1878
|
-
mergeBlock({ code, nodePath, position, cb }: { code: string; nodePath: string; position: string; cb?: Function }) {
|
|
1913
|
+
mergeBlock({ code, nodePath, position, slotTarget, cb }: { code: string; nodePath: string; position: string; slotTarget?: string; cb?: Function }) {
|
|
1879
1914
|
const ViewElement = getConceptConstructor('ViewElement');
|
|
1880
1915
|
const Logic = getConceptConstructor('Logic');
|
|
1881
1916
|
const ParamWithGroup = getConceptConstructor('ParamWithGroup');
|
|
1882
1917
|
const Variable = getConceptConstructor('Variable');
|
|
1883
1918
|
const BindEvent = getConceptConstructor('BindEvent');
|
|
1884
1919
|
const Structure = getConceptConstructor('Structure');
|
|
1885
|
-
|
|
1920
|
+
let template = utils.sliceTagContent(code, 'template');
|
|
1921
|
+
if (slotTarget) {
|
|
1922
|
+
template = `<template #${slotTarget}>${template}</template>`;
|
|
1923
|
+
}
|
|
1886
1924
|
let targetNode = (this.getAncestor('App') as App)?.findNodeByPath(nodePath);
|
|
1887
1925
|
let parentNode = position === 'append' ? targetNode : targetNode.parentNode;
|
|
1888
1926
|
const definitionStr = utils.sliceTagContent(code, 'definition') || '{}';
|
|
@@ -2242,100 +2280,12 @@ export class BusinessComponent extends BaseNode {
|
|
|
2242
2280
|
// 获取虚拟logic的参数和内容
|
|
2243
2281
|
// 用作展示和tots查找引用
|
|
2244
2282
|
self.getElementLogicRoot();
|
|
2245
|
-
let code = `export class ${self.tsName} extends nasl.ui.VueComponent {\n`;
|
|
2246
|
-
// 需要类型推导的局部变量/返回值需要调整申明顺序
|
|
2247
|
-
code += `constructor(
|
|
2248
|
-
options?: {
|
|
2249
|
-
[propname: string]: any,
|
|
2250
|
-
bindAttr?: {
|
|
2251
|
-
__NASLIF?: nasl.core.Boolean,
|
|
2252
|
-
`;
|
|
2253
|
-
if (Array.isArray(self.params)) {
|
|
2254
|
-
yield* wrapForEach(self.params, function* warpForEachGenerator(param, index) {
|
|
2255
|
-
code += `${param.name}?: `;
|
|
2256
|
-
code += yield* param.typeAnnotation.toEmbeddedTS(shiftState(state, code));
|
|
2257
|
-
code += ',\n';
|
|
2258
|
-
});
|
|
2259
|
-
}
|
|
2260
|
-
code += `
|
|
2261
|
-
},
|
|
2262
|
-
slotDefault?: () => Array<any>,
|
|
2263
|
-
}) {
|
|
2264
|
-
super();\n`;
|
|
2265
|
-
|
|
2266
|
-
// 绑定事件
|
|
2267
|
-
if (Array.isArray(self.bindEvents)) {
|
|
2268
|
-
yield* wrapForEach(self.bindEvents, function* warpForEachGenerator(event) {
|
|
2269
|
-
code += yield* event.toEmbeddedTS(
|
|
2270
|
-
shiftState(state, code, {
|
|
2271
|
-
tabSize: state?.tabSize || 0,
|
|
2272
|
-
}),
|
|
2273
|
-
true,
|
|
2274
|
-
);
|
|
2275
|
-
code += '\n';
|
|
2276
|
-
});
|
|
2277
|
-
}
|
|
2278
|
-
code += `\n}`;
|
|
2279
|
-
// 自定义事件的定义
|
|
2280
|
-
if (Array.isArray(self.events) && self.events.length) {
|
|
2281
|
-
code += indent((state?.tabSize || 0) + 1);
|
|
2282
|
-
yield* wrapForEach(self.events, function* warpForEachGenerator(event) {
|
|
2283
|
-
code += yield* event.toEmbeddedTS(
|
|
2284
|
-
shiftState(state, code, {
|
|
2285
|
-
tabSize: (state?.tabSize || 0) + 2,
|
|
2286
|
-
}),
|
|
2287
|
-
);
|
|
2288
|
-
code += '\n';
|
|
2289
|
-
});
|
|
2290
|
-
code += indent((state?.tabSize || 0) + 1);
|
|
2291
|
-
}
|
|
2292
|
-
// 逻辑
|
|
2293
|
-
if (Array.isArray(self.logics) && self.logics.length) {
|
|
2294
|
-
code += indent((state?.tabSize || 0) + 1);
|
|
2295
|
-
yield* wrapForEach(self.logics, function* warpForEachGenerator(logic) {
|
|
2296
|
-
code += yield* logic.toEmbeddedTS(
|
|
2297
|
-
shiftState(state, code, {
|
|
2298
|
-
tabSize: (state?.tabSize || 0) + 2,
|
|
2299
|
-
}),
|
|
2300
|
-
'noExport',
|
|
2301
|
-
);
|
|
2302
|
-
code += '\n';
|
|
2303
|
-
});
|
|
2304
|
-
code += indent((state?.tabSize || 0) + 1);
|
|
2305
|
-
}
|
|
2306
|
-
// render函数
|
|
2307
|
-
code += `\n${indent((state?.tabSize || 0) + 1)}`;
|
|
2308
|
-
code += `__render(`;
|
|
2309
|
-
code += `){\n`;
|
|
2310
|
-
code += indent(state?.tabSize || 0);
|
|
2311
|
-
// elements 元素
|
|
2312
|
-
if (Array.isArray(self.elements)) {
|
|
2313
|
-
// 生成嵌套式的内容
|
|
2314
|
-
yield* wrapForEach(self.elements, function* warpForEachGenerator(element) {
|
|
2315
|
-
code += yield* element.toEmbeddedTS(
|
|
2316
|
-
shiftState(state, code, {
|
|
2317
|
-
tabSize: (state?.tabSize || 0) + 3,
|
|
2318
|
-
}),
|
|
2319
|
-
);
|
|
2320
|
-
code += '\n';
|
|
2321
|
-
});
|
|
2322
|
-
}
|
|
2323
|
-
code += `\n${indent((state?.tabSize || 0) + 1)}}\n`;
|
|
2324
|
-
if (Array.isArray(self.params)) {
|
|
2325
|
-
code += `${indent((state?.tabSize || 0) + 1)}$destination(options: {`;
|
|
2326
|
-
yield* wrapForEach(self.params, function* warpForEachGenerator(param, index) {
|
|
2327
|
-
code += `${param.name}?: `;
|
|
2328
|
-
code += yield* param.typeAnnotation.toEmbeddedTS(shiftState(state, code));
|
|
2329
|
-
code += ', ';
|
|
2330
|
-
});
|
|
2331
|
-
// 锚点
|
|
2332
|
-
code += `_anchor?: nasl.core.String`;
|
|
2333
|
-
code += '}){}\n';
|
|
2334
|
-
}
|
|
2335
|
-
code += `${indent(state?.tabSize || 0)}}\n`;
|
|
2336
2283
|
|
|
2284
|
+
/**
|
|
2285
|
+
* 这部分需要先执行
|
|
2286
|
+
**/
|
|
2337
2287
|
// elements类型声明定义
|
|
2338
|
-
code
|
|
2288
|
+
let code = `interface __elements {\n`;
|
|
2339
2289
|
// 生成所有的name和类型定义
|
|
2340
2290
|
yield* wrapForEach(self.elements, function* warpForEachGenerator(element) {
|
|
2341
2291
|
code += yield* element.toEmbeddedTSDefinition(
|
|
@@ -2407,7 +2357,7 @@ export class BusinessComponent extends BaseNode {
|
|
|
2407
2357
|
const IDENTIFIERMAP = new Set<Variable>();
|
|
2408
2358
|
if (Array.isArray(self.params)) {
|
|
2409
2359
|
yield* wrapForEach(self.params, function* warpForEachGenerator(param) {
|
|
2410
|
-
code +=
|
|
2360
|
+
code += `${indent((state?.tabSize || 0) + 1)}let `;
|
|
2411
2361
|
code += yield* param.toEmbeddedTS(shiftState(state, code, { inline: true }));
|
|
2412
2362
|
code += ';\n';
|
|
2413
2363
|
});
|
|
@@ -2419,7 +2369,7 @@ export class BusinessComponent extends BaseNode {
|
|
|
2419
2369
|
IDENTIFIERMAP.add(variable);
|
|
2420
2370
|
}
|
|
2421
2371
|
if (!advanceMap.get(variable)) {
|
|
2422
|
-
code +=
|
|
2372
|
+
code += `${indent((state?.tabSize || 0) + 1)}let `;
|
|
2423
2373
|
code += yield* variable.toEmbeddedTS(shiftState(state, code, { inline: true }));
|
|
2424
2374
|
code += ';\n';
|
|
2425
2375
|
}
|
|
@@ -2486,6 +2436,7 @@ export class BusinessComponent extends BaseNode {
|
|
|
2486
2436
|
code += '\n';
|
|
2487
2437
|
code += `${indent((state?.tabSize || 0) + 2)}return\n`;
|
|
2488
2438
|
|
|
2439
|
+
|
|
2489
2440
|
function* setPlaygroundCode(arr: Variable[] | ParamWithGroup[], name: string) {
|
|
2490
2441
|
if (arr.length) {
|
|
2491
2442
|
code += `${indent((state?.tabSize || 0) + 1)}/* -----以下是 ${name} 的默认值草稿------ */\n`;
|
|
@@ -2501,6 +2452,99 @@ export class BusinessComponent extends BaseNode {
|
|
|
2501
2452
|
yield* setPlaygroundCode(self.variables, 'variables');
|
|
2502
2453
|
yield* setPlaygroundCode(self.params, 'params');
|
|
2503
2454
|
|
|
2455
|
+
code += `${indent(state?.tabSize || 0)}}\n`;
|
|
2456
|
+
|
|
2457
|
+
code += `export class ${self.tsName} extends nasl.ui.VueComponent {\n`;
|
|
2458
|
+
|
|
2459
|
+
// 需要类型推导的局部变量/返回值需要调整申明顺序
|
|
2460
|
+
code += `constructor(
|
|
2461
|
+
options?: {
|
|
2462
|
+
[propname: string]: any,
|
|
2463
|
+
bindAttr?: {
|
|
2464
|
+
__NASLIF?: nasl.core.Boolean,
|
|
2465
|
+
`;
|
|
2466
|
+
if (Array.isArray(self.params)) {
|
|
2467
|
+
yield* wrapForEach(self.params, function* warpForEachGenerator(param, index) {
|
|
2468
|
+
code += `${param.name}?: `;
|
|
2469
|
+
code += yield* param.typeAnnotation.toEmbeddedTS(shiftState(state, code));
|
|
2470
|
+
code += ',\n';
|
|
2471
|
+
});
|
|
2472
|
+
}
|
|
2473
|
+
code += `
|
|
2474
|
+
},
|
|
2475
|
+
slotDefault?: () => Array<any>,
|
|
2476
|
+
}) {
|
|
2477
|
+
super();\n`;
|
|
2478
|
+
|
|
2479
|
+
// 绑定事件
|
|
2480
|
+
if (Array.isArray(self.bindEvents)) {
|
|
2481
|
+
yield* wrapForEach(self.bindEvents, function* warpForEachGenerator(event) {
|
|
2482
|
+
code += yield* event.toEmbeddedTS(
|
|
2483
|
+
shiftState(state, code, {
|
|
2484
|
+
tabSize: state?.tabSize || 0,
|
|
2485
|
+
}),
|
|
2486
|
+
true,
|
|
2487
|
+
);
|
|
2488
|
+
code += '\n';
|
|
2489
|
+
});
|
|
2490
|
+
}
|
|
2491
|
+
code += `\n}`;
|
|
2492
|
+
// 自定义事件的定义
|
|
2493
|
+
if (Array.isArray(self.events) && self.events.length) {
|
|
2494
|
+
code += indent((state?.tabSize || 0) + 1);
|
|
2495
|
+
yield* wrapForEach(self.events, function* warpForEachGenerator(event) {
|
|
2496
|
+
code += yield* event.toEmbeddedTS(
|
|
2497
|
+
shiftState(state, code, {
|
|
2498
|
+
tabSize: (state?.tabSize || 0) + 2,
|
|
2499
|
+
}),
|
|
2500
|
+
);
|
|
2501
|
+
code += '\n';
|
|
2502
|
+
});
|
|
2503
|
+
code += indent((state?.tabSize || 0) + 1);
|
|
2504
|
+
}
|
|
2505
|
+
// 逻辑
|
|
2506
|
+
if (Array.isArray(self.logics) && self.logics.length) {
|
|
2507
|
+
code += indent((state?.tabSize || 0) + 1);
|
|
2508
|
+
yield* wrapForEach(self.logics, function* warpForEachGenerator(logic) {
|
|
2509
|
+
code += yield* logic.toEmbeddedTS(
|
|
2510
|
+
shiftState(state, code, {
|
|
2511
|
+
tabSize: (state?.tabSize || 0) + 2,
|
|
2512
|
+
}),
|
|
2513
|
+
'noExport',
|
|
2514
|
+
);
|
|
2515
|
+
code += '\n';
|
|
2516
|
+
});
|
|
2517
|
+
code += indent((state?.tabSize || 0) + 1);
|
|
2518
|
+
}
|
|
2519
|
+
// render函数
|
|
2520
|
+
code += `\n${indent((state?.tabSize || 0) + 1)}`;
|
|
2521
|
+
code += `__render(`;
|
|
2522
|
+
code += `){\n`;
|
|
2523
|
+
code += indent(state?.tabSize || 0);
|
|
2524
|
+
// elements 元素
|
|
2525
|
+
if (Array.isArray(self.elements)) {
|
|
2526
|
+
// 生成嵌套式的内容
|
|
2527
|
+
yield* wrapForEach(self.elements, function* warpForEachGenerator(element) {
|
|
2528
|
+
code += yield* element.toEmbeddedTS(
|
|
2529
|
+
shiftState(state, code, {
|
|
2530
|
+
tabSize: (state?.tabSize || 0) + 3,
|
|
2531
|
+
}),
|
|
2532
|
+
);
|
|
2533
|
+
code += '\n';
|
|
2534
|
+
});
|
|
2535
|
+
}
|
|
2536
|
+
code += `\n${indent((state?.tabSize || 0) + 1)}}\n`;
|
|
2537
|
+
if (Array.isArray(self.params)) {
|
|
2538
|
+
code += `${indent((state?.tabSize || 0) + 1)}$destination(options: {`;
|
|
2539
|
+
yield* wrapForEach(self.params, function* warpForEachGenerator(param, index) {
|
|
2540
|
+
code += `${param.name}?: `;
|
|
2541
|
+
code += yield* param.typeAnnotation.toEmbeddedTS(shiftState(state, code));
|
|
2542
|
+
code += ', ';
|
|
2543
|
+
});
|
|
2544
|
+
// 锚点
|
|
2545
|
+
code += `_anchor?: nasl.core.String`;
|
|
2546
|
+
code += '}){}\n';
|
|
2547
|
+
}
|
|
2504
2548
|
code += `${indent((state?.tabSize || 0) + 1)}}\n`;
|
|
2505
2549
|
return code;
|
|
2506
2550
|
}
|
|
@@ -279,6 +279,11 @@ export class CallConnector extends CallLogic {
|
|
|
279
279
|
}
|
|
280
280
|
return code;
|
|
281
281
|
}
|
|
282
|
+
|
|
283
|
+
@withSourceMap()
|
|
284
|
+
toNaturalTS(state?: TranslatorState): string {
|
|
285
|
+
return '';
|
|
286
|
+
}
|
|
282
287
|
//================================================================================
|
|
283
288
|
// 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
|
|
284
289
|
// ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
|
|
@@ -82,6 +82,18 @@ export class CallEvent extends LogicItem {
|
|
|
82
82
|
return super.from(source, parentNode, parentKey) as CallEvent;
|
|
83
83
|
}
|
|
84
84
|
|
|
85
|
+
/**
|
|
86
|
+
* 设置calleeName
|
|
87
|
+
*/
|
|
88
|
+
setCalleeName(calleeName: string) {
|
|
89
|
+
const object = {
|
|
90
|
+
calleeName,
|
|
91
|
+
};
|
|
92
|
+
this.update({
|
|
93
|
+
...object,
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
|
|
85
97
|
/**
|
|
86
98
|
* 插入实际参数
|
|
87
99
|
* @internal
|
|
@@ -291,7 +303,7 @@ export class CallEvent extends LogicItem {
|
|
|
291
303
|
*toEmbeddedTS(state = createCompilerState()): TranslatorGenerator {
|
|
292
304
|
const self = this;
|
|
293
305
|
const { calleeName, completeArguments, arguments: eventArgs } = self;
|
|
294
|
-
let code = `this.${calleeName}(`;
|
|
306
|
+
let code = `(this as ${this.businessComponent.name}).${calleeName ?? '__IDENTIFIER__'}(`;
|
|
295
307
|
if (completeArguments?.length) {
|
|
296
308
|
yield* wrapForEach(completeArguments, function* warpForEachGenerator(arg, index) {
|
|
297
309
|
// 取到是不是必填放入参数中
|
|
@@ -309,9 +321,14 @@ export class CallEvent extends LogicItem {
|
|
|
309
321
|
let code = '';
|
|
310
322
|
code += `this.$emit('${this.calleeName}', {\n`;
|
|
311
323
|
if (Array.isArray(completeArguments) && completeArguments.length) {
|
|
324
|
+
const eventNode = this.getCallNode();
|
|
325
|
+
const eventParams = eventNode?.params;
|
|
312
326
|
completeArguments.forEach((arg, index) => {
|
|
313
|
-
|
|
314
|
-
|
|
327
|
+
let argStr = arg?.toJS(shiftState(state, code));
|
|
328
|
+
const paramDefaultValue = eventParams?.[index]?.defaultValue?.toJS?.();
|
|
329
|
+
if (paramDefaultValue) {
|
|
330
|
+
argStr = `${argStr} !== undefined ? ${argStr} : ${paramDefaultValue}`;
|
|
331
|
+
}
|
|
315
332
|
code += `${arg.keyword}: ${argStr}`;
|
|
316
333
|
if (index !== completeArguments?.length - 1) {
|
|
317
334
|
code += ', ';
|
|
@@ -563,12 +563,12 @@ export class CallFunction extends LogicItem {
|
|
|
563
563
|
}
|
|
564
564
|
|
|
565
565
|
setCallee(func: Function) {
|
|
566
|
-
const calleeNamespace = func
|
|
567
|
-
const calleeName = func
|
|
566
|
+
const calleeNamespace = func?.getNamespace?.();
|
|
567
|
+
const calleeName = func?.name;
|
|
568
568
|
const Argument = getConceptConstructor('Argument');
|
|
569
569
|
const TypeAnnotation = getConceptConstructor('TypeAnnotation');
|
|
570
570
|
const BaseNode = getBaseNode();
|
|
571
|
-
const params = func
|
|
571
|
+
const params = func?.params?.map?.((param) => {
|
|
572
572
|
const relationOptions = { parentNode: this, parentKey: 'arguments' };
|
|
573
573
|
const argument = Argument.from(
|
|
574
574
|
{
|
|
@@ -696,7 +696,53 @@ export class CallFunction extends LogicItem {
|
|
|
696
696
|
if (this.arguments.length <= 3) {
|
|
697
697
|
code += '(';
|
|
698
698
|
this.arguments.forEach((arg, index) => {
|
|
699
|
-
|
|
699
|
+
if (!arg) {
|
|
700
|
+
code += '__IDENTIFIER__';
|
|
701
|
+
} else {
|
|
702
|
+
code += arg.toNaturalTS(shiftState(state, code, { inline: true }));
|
|
703
|
+
}
|
|
704
|
+
if (index !== this.arguments.length - 1) code += ', ';
|
|
705
|
+
});
|
|
706
|
+
if (this?.typeArguments?.[0]?.typeKind === 'reference') {
|
|
707
|
+
if (this.arguments?.length > 0) code += ', ';
|
|
708
|
+
code += `{ typeNamespace: '${this.typeArguments[0].typeNamespace}' }`;
|
|
709
|
+
}
|
|
710
|
+
code += `)`;
|
|
711
|
+
} else {
|
|
712
|
+
code += '(\n';
|
|
713
|
+
this.arguments.forEach((arg, index) => {
|
|
714
|
+
if (!arg) {
|
|
715
|
+
code += '__IDENTIFIER__';
|
|
716
|
+
} else {
|
|
717
|
+
code += arg.toNaturalTS(shiftState(state, code, { tabSize: state.tabSize + 1 }));
|
|
718
|
+
}
|
|
719
|
+
if (index !== this.arguments.length - 1) {
|
|
720
|
+
code += ',\n';
|
|
721
|
+
} else if (this?.typeArguments?.[0]?.typeKind === 'reference') {
|
|
722
|
+
code += `,\n{ typeNamespace: '${this.typeArguments[0].typeNamespace}' }`;
|
|
723
|
+
} else {
|
|
724
|
+
code += '\n';
|
|
725
|
+
}
|
|
726
|
+
});
|
|
727
|
+
code += `${indent(state.tabSize)})`;
|
|
728
|
+
}
|
|
729
|
+
return code;
|
|
730
|
+
}
|
|
731
|
+
|
|
732
|
+
@withSourceMap()
|
|
733
|
+
toTextualNASL(state = createCompilerState()): string {
|
|
734
|
+
let code = '';
|
|
735
|
+
code = this.calleeKey;
|
|
736
|
+
if (Array.isArray(this.typeArguments) && this.typeArguments.length) {
|
|
737
|
+
// 如果有内容
|
|
738
|
+
const typeAnnotation = this.typeArguments[0];
|
|
739
|
+
code += `<`;
|
|
740
|
+
code += `${typeAnnotation.toTextualNASL(shiftState(state, code, { tabSize: 0 }))}>`;
|
|
741
|
+
}
|
|
742
|
+
if (this.arguments.length <= 3) {
|
|
743
|
+
code += '(';
|
|
744
|
+
this.arguments.forEach((arg, index) => {
|
|
745
|
+
code += arg.toTextualNASL(shiftState(state, code, { inline: true }));
|
|
700
746
|
if (index !== this.arguments.length - 1) code += ', ';
|
|
701
747
|
});
|
|
702
748
|
if (this?.typeArguments?.[0]?.typeKind === 'reference') {
|
|
@@ -707,7 +753,7 @@ export class CallFunction extends LogicItem {
|
|
|
707
753
|
} else {
|
|
708
754
|
code += '(\n';
|
|
709
755
|
this.arguments.forEach((arg, index) => {
|
|
710
|
-
code += arg.
|
|
756
|
+
code += arg.toTextualNASL(shiftState(state, code, { tabSize: state.tabSize + 1 }));
|
|
711
757
|
if (index !== this.arguments.length - 1) {
|
|
712
758
|
code += ',\n';
|
|
713
759
|
} else if (this?.typeArguments?.[0]?.typeKind === 'reference') {
|
|
@@ -723,10 +769,10 @@ export class CallFunction extends LogicItem {
|
|
|
723
769
|
|
|
724
770
|
checkParamNameOfAnonymousFunction() {
|
|
725
771
|
const fns = this.arguments
|
|
726
|
-
|
|
727
|
-
|
|
772
|
+
?.map((arg) => arg.expression)
|
|
773
|
+
?.filter((exp) => asserts.isAnonymousFunction(exp)) as unknown as AnonymousFunction[];
|
|
728
774
|
|
|
729
|
-
fns
|
|
775
|
+
fns?.forEach?.((fn) => {
|
|
730
776
|
fn.checkParamName();
|
|
731
777
|
});
|
|
732
778
|
}
|
|
@@ -295,10 +295,10 @@ export class CallInterface extends LogicItem {
|
|
|
295
295
|
shouldDeleteStructures.push(stru);
|
|
296
296
|
}
|
|
297
297
|
});
|
|
298
|
-
shouldDeleteStructures
|
|
298
|
+
shouldDeleteStructures?.forEach?.((s: Structure) => s.delete());
|
|
299
299
|
} else {
|
|
300
|
-
const shouldDeleteStructures = oldItf.getRefStructures(parentModule
|
|
301
|
-
shouldDeleteStructures
|
|
300
|
+
const shouldDeleteStructures = oldItf.getRefStructures(parentModule?.structures);
|
|
301
|
+
shouldDeleteStructures?.forEach?.((s: Structure) => s.delete());
|
|
302
302
|
}
|
|
303
303
|
oldItf.delete();
|
|
304
304
|
oldItf.afterDelete();
|
|
@@ -497,31 +497,35 @@ export class CallInterface extends LogicItem {
|
|
|
497
497
|
let code = `${tsCalleeKey}(`;
|
|
498
498
|
|
|
499
499
|
if (completeArguments?.length) {
|
|
500
|
-
code += '{';
|
|
500
|
+
code += '{ ';
|
|
501
501
|
completeArguments?.forEach((arg, index) => {
|
|
502
|
-
|
|
502
|
+
if (!arg) {
|
|
503
|
+
code += '__IDENTIFIER__: undefined';
|
|
504
|
+
} else {
|
|
505
|
+
code += arg.toNaturalTS(shiftState(state, code), arg.paramRequired, true);
|
|
506
|
+
}
|
|
503
507
|
if (index !== this.arguments?.length - 1) code += ', ';
|
|
504
508
|
});
|
|
505
|
-
code += '}';
|
|
509
|
+
code += ' }';
|
|
506
510
|
}
|
|
507
511
|
code += ')';
|
|
508
|
-
if (
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
) {
|
|
522
|
-
|
|
523
|
-
}
|
|
524
|
-
code += '\n';
|
|
512
|
+
// if (
|
|
513
|
+
// parentNode.concept !== 'Argument' &&
|
|
514
|
+
// parentKey !== 'test' &&
|
|
515
|
+
// parentKey !== 'patterns' &&
|
|
516
|
+
// parentKey !== 'returnExpression' &&
|
|
517
|
+
// parentNode.concept !== 'Assignment' &&
|
|
518
|
+
// parentNode.concept !== 'ForEachStatement' &&
|
|
519
|
+
// parentNode.concept !== 'SelectMembers' &&
|
|
520
|
+
// parentNode.concept !== 'UnaryExpression' &&
|
|
521
|
+
// parentNode.concept !== 'BinaryExpression' &&
|
|
522
|
+
// parentNode.concept !== 'MemberExpression' &&
|
|
523
|
+
// parentNode.concept !== 'StringInterpolation' &&
|
|
524
|
+
// !['NewMap', 'NewList'].includes(parentNode.concept)
|
|
525
|
+
// ) {
|
|
526
|
+
// code += ';';
|
|
527
|
+
// }
|
|
528
|
+
// code += '\n';
|
|
525
529
|
return code;
|
|
526
530
|
}
|
|
527
531
|
|
|
@@ -720,10 +724,13 @@ export class CallInterface extends LogicItem {
|
|
|
720
724
|
}
|
|
721
725
|
if (this.arguments?.length) {
|
|
722
726
|
this.arguments.forEach((arg) => {
|
|
727
|
+
if (!arg)
|
|
728
|
+
return;
|
|
729
|
+
|
|
723
730
|
const idx = logicParam.findIndex((params) => arg.keyword === params.name);
|
|
724
731
|
const param = logicParam[idx];
|
|
725
732
|
|
|
726
|
-
arg.paramRequired =
|
|
733
|
+
arg.paramRequired = param?.required;
|
|
727
734
|
arg.paramTypeAnnotation = undefined;
|
|
728
735
|
arg.paramDefaultValue = undefined;
|
|
729
736
|
// 取到是不是必填放入参数中
|