@lcap/nasl 3.3.2-beta.4 → 3.3.2-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/coverage/index.html +108 -108
- package/coverage/src/automate/engine/index.html +1 -1
- package/coverage/src/automate/engine/utils.js.html +36 -36
- package/coverage/src/bak/index.html +15 -15
- package/coverage/src/bak/translator.js.html +183 -60
- package/coverage/src/breakpoint/generator/AfterStartNode.ts.html +1 -1
- package/coverage/src/breakpoint/generator/BeforeEndNode.ts.html +1 -1
- package/coverage/src/breakpoint/generator/BreakpointNode.ts.html +1 -1
- package/coverage/src/breakpoint/generator/CallbackNode.ts.html +1 -1
- package/coverage/src/breakpoint/generator/index.html +1 -1
- package/coverage/src/breakpoint/generator/index.ts.html +1 -1
- package/coverage/src/breakpoint/index.html +1 -1
- package/coverage/src/breakpoint/index.ts.html +1 -1
- package/coverage/src/breakpoint/shared/constants.ts.html +1 -1
- package/coverage/src/breakpoint/shared/index.html +1 -1
- package/coverage/src/breakpoint/shared/index.ts.html +1 -1
- package/coverage/src/breakpoint/shared/operations.ts.html +1 -1
- package/coverage/src/breakpoint/shared/socket.ts.html +1 -1
- package/coverage/src/breakpoint/shared/utils.ts.html +1 -1
- package/coverage/src/breakpoint/store/core.ts.html +1 -1
- package/coverage/src/breakpoint/store/dock.ts.html +1 -1
- package/coverage/src/breakpoint/store/index.html +1 -1
- package/coverage/src/breakpoint/store/index.ts.html +1 -1
- package/coverage/src/common/BaseNode.ts.html +92 -62
- package/coverage/src/common/Command.ts.html +1 -1
- package/coverage/src/common/EventEmitter.ts.html +1 -1
- package/coverage/src/common/Messager.ts.html +1 -1
- package/coverage/src/common/asyncFuncMap.ts.html +1 -1
- package/coverage/src/common/index.html +14 -14
- package/coverage/src/common/index.ts.html +1 -1
- package/coverage/src/concepts/Abort__.ts.html +9 -6
- package/coverage/src/concepts/Anchor__.ts.html +36 -21
- package/coverage/src/concepts/AnonymousFunction__.ts.html +62 -20
- package/coverage/src/concepts/App__.ts.html +917 -74
- package/coverage/src/concepts/Argument__.ts.html +41 -26
- package/coverage/src/concepts/Assignee__.ts.html +40 -13
- package/coverage/src/concepts/AssignmentLine__.ts.html +9 -6
- package/coverage/src/concepts/Assignment__.ts.html +61 -22
- package/coverage/src/concepts/Attribute__.ts.html +25 -10
- package/coverage/src/concepts/AuthInterface__.ts.html +9 -6
- package/coverage/src/concepts/AuthLogicForCallInterface__.ts.html +25 -10
- package/coverage/src/concepts/AuthLogic__.ts.html +18 -6
- package/coverage/src/concepts/BackendVariable__.ts.html +25 -10
- package/coverage/src/concepts/Backend__.ts.html +25 -10
- package/coverage/src/concepts/BatchAssignment__.ts.html +61 -16
- package/coverage/src/concepts/BinaryExpression__.ts.html +141 -39
- package/coverage/src/concepts/BindAttribute__.ts.html +134 -41
- package/coverage/src/concepts/BindDirective__.ts.html +79 -16
- package/coverage/src/concepts/BindEvent__.ts.html +80 -23
- package/coverage/src/concepts/BindStyle__.ts.html +25 -10
- package/coverage/src/concepts/BooleanLiteral__.ts.html +9 -6
- package/coverage/src/concepts/CallAuthInterface__.ts.html +25 -10
- package/coverage/src/concepts/CallConnector__.ts.html +9 -6
- package/coverage/src/concepts/CallFunction__.ts.html +56 -38
- package/coverage/src/concepts/CallInterface__.ts.html +81 -36
- package/coverage/src/concepts/CallLogic__.ts.html +195 -264
- package/coverage/src/concepts/CallQueryComponent__.ts.html +40 -13
- package/coverage/src/concepts/Comment__.ts.html +11 -8
- package/coverage/src/concepts/CompletionProperty__.ts.html +25 -10
- package/coverage/src/concepts/ConfigGroup__.ts.html +25 -10
- package/coverage/src/concepts/ConfigPropertyValue__.ts.html +9 -6
- package/coverage/src/concepts/ConfigProperty__.ts.html +25 -10
- package/coverage/src/concepts/Configuration__.ts.html +25 -10
- package/coverage/src/concepts/Connection__.ts.html +26 -11
- package/coverage/src/concepts/ConnectorTrigger__.ts.html +9 -6
- package/coverage/src/concepts/Connector__.ts.html +85 -22
- package/coverage/src/concepts/Constant__.ts.html +25 -10
- package/coverage/src/concepts/DataSource__.ts.html +26 -11
- package/coverage/src/concepts/DatabaseTypeAnnotation__.ts.html +9 -6
- package/coverage/src/concepts/Destination__.ts.html +24 -12
- package/coverage/src/concepts/End__.ts.html +9 -6
- package/coverage/src/concepts/EntityIndex__.ts.html +9 -6
- package/coverage/src/concepts/EntityProperty__.ts.html +62 -14
- package/coverage/src/concepts/Entity__.ts.html +41 -14
- package/coverage/src/concepts/EnumItem__.ts.html +9 -6
- package/coverage/src/concepts/Enum__.ts.html +25 -10
- package/coverage/src/concepts/Event__.ts.html +25 -10
- package/coverage/src/concepts/ExternalDestination__.ts.html +25 -10
- package/coverage/src/concepts/ForEachStatement__.ts.html +68 -47
- package/coverage/src/concepts/FrontendLibrary__.ts.html +40 -13
- package/coverage/src/concepts/FrontendVariable__.ts.html +1 -1
- package/coverage/src/concepts/Frontend__.ts.html +86 -23
- package/coverage/src/concepts/Function__.ts.html +92 -26
- package/coverage/src/concepts/Identifier__.ts.html +28 -25
- package/coverage/src/concepts/IfStatement__.ts.html +83 -56
- package/coverage/src/concepts/Integration__.ts.html +40 -13
- package/coverage/src/concepts/InterfaceParam__.ts.html +25 -10
- package/coverage/src/concepts/Interface__.ts.html +61 -22
- package/coverage/src/concepts/JSBlock__.ts.html +188 -8
- package/coverage/src/concepts/JavaLogic__.ts.html +9 -6
- package/coverage/src/concepts/LogicItem__.ts.html +15 -12
- package/coverage/src/concepts/Logic__.ts.html +117 -81
- package/coverage/src/concepts/MatchCase__.ts.html +100 -61
- package/coverage/src/concepts/Match__.ts.html +48 -27
- package/coverage/src/concepts/MemberExpression__.ts.html +72 -66
- package/coverage/src/concepts/MetadataType__.ts.html +1996 -0
- package/coverage/src/concepts/MicroApp__.ts.html +9 -6
- package/coverage/src/concepts/Module__.ts.html +672 -18
- package/coverage/src/concepts/MsgTriggerEvent__.ts.html +25 -10
- package/coverage/src/concepts/MsgTriggerLauncher__.ts.html +25 -10
- package/coverage/src/concepts/Namespace__.ts.html +175 -40
- package/coverage/src/concepts/NewComposite__.ts.html +93 -27
- package/coverage/src/concepts/NewList__.ts.html +44 -14
- package/coverage/src/concepts/NewMap__.ts.html +44 -14
- package/coverage/src/concepts/New__.ts.html +1 -1
- package/coverage/src/concepts/NullLiteral__.ts.html +9 -6
- package/coverage/src/concepts/NumericLiteral__.ts.html +27 -12
- package/coverage/src/concepts/OqlQueryComponent__.ts.html +103 -13
- package/coverage/src/concepts/OverriddenLogic__.ts.html +100 -25
- package/coverage/src/concepts/Param__.ts.html +24 -15
- package/coverage/src/concepts/Point__.ts.html +9 -6
- package/coverage/src/concepts/ProcessComponent__.ts.html +40 -13
- package/coverage/src/concepts/ProcessElement__.ts.html +128 -29
- package/coverage/src/concepts/ProcessOutcome__.ts.html +9 -6
- package/coverage/src/concepts/ProcessOutcomes__.ts.html +9 -6
- package/coverage/src/concepts/Process__.ts.html +85 -22
- package/coverage/src/concepts/QueryAggregateExpression__.ts.html +25 -10
- package/coverage/src/concepts/QueryFieldExpression__.ts.html +9 -6
- package/coverage/src/concepts/QueryFromExpression__.ts.html +25 -10
- package/coverage/src/concepts/QueryGroupByExpression__.ts.html +25 -10
- package/coverage/src/concepts/QueryJoinExpression__.ts.html +25 -10
- package/coverage/src/concepts/QueryLimitExpression__.ts.html +25 -10
- package/coverage/src/concepts/QueryOrderByExpression__.ts.html +25 -10
- package/coverage/src/concepts/QuerySelectExpression__.ts.html +25 -10
- package/coverage/src/concepts/Rect__.ts.html +9 -6
- package/coverage/src/concepts/Return__.ts.html +25 -10
- package/coverage/src/concepts/Role__.ts.html +9 -6
- package/coverage/src/concepts/SelectMembers__.ts.html +25 -10
- package/coverage/src/concepts/Slot__.ts.html +25 -10
- package/coverage/src/concepts/SqlQueryComponent__.ts.html +25 -10
- package/coverage/src/concepts/Start__.ts.html +9 -6
- package/coverage/src/concepts/StringInterpolation__.ts.html +40 -19
- package/coverage/src/concepts/StringLiteral__.ts.html +9 -6
- package/coverage/src/concepts/StructureProperty__.ts.html +25 -10
- package/coverage/src/concepts/Structure__.ts.html +40 -13
- package/coverage/src/concepts/SwitchCase__.ts.html +33 -18
- package/coverage/src/concepts/SwitchStatement__.ts.html +38 -23
- package/coverage/src/concepts/Theme__.ts.html +9 -6
- package/coverage/src/concepts/Transactional__.ts.html +9 -6
- package/coverage/src/concepts/TriggerEvent__.ts.html +25 -10
- package/coverage/src/concepts/TriggerLauncher__.ts.html +9 -6
- package/coverage/src/concepts/TypeAnnotation__.ts.html +223 -61
- package/coverage/src/concepts/TypeParam__.ts.html +10 -7
- package/coverage/src/concepts/UnaryExpression__.ts.html +40 -13
- package/coverage/src/concepts/Unparsed__.ts.html +11 -8
- package/coverage/src/concepts/UseComponent__.ts.html +9 -6
- package/coverage/src/concepts/ValidationRule__.ts.html +30 -15
- package/coverage/src/concepts/Variable__.ts.html +61 -16
- package/coverage/src/concepts/ViewBlock__.ts.html +9 -6
- package/coverage/src/concepts/ViewComponent__.ts.html +99 -24
- package/coverage/src/concepts/ViewElement__.ts.html +334 -181
- package/coverage/src/concepts/View__.ts.html +326 -71
- package/coverage/src/concepts/WhileStatement__.ts.html +78 -45
- package/coverage/src/concepts/basics/stdlib/index.html +1 -1
- package/coverage/src/concepts/basics/stdlib/index.ts.html +1 -1
- package/coverage/src/concepts/basics/stdlib/nasl.auth.ts.html +1 -1
- package/coverage/src/concepts/basics/stdlib/nasl.browser.ts.html +1 -1
- package/coverage/src/concepts/basics/stdlib/nasl.collection.ts.html +1 -1
- package/coverage/src/concepts/basics/stdlib/nasl.configuration.ts.html +1 -1
- package/coverage/src/concepts/basics/stdlib/nasl.core.ts.html +1 -1
- package/coverage/src/concepts/basics/stdlib/nasl.event.ts.html +1 -1
- package/coverage/src/concepts/basics/stdlib/nasl.http.ts.html +1 -1
- package/coverage/src/concepts/basics/stdlib/nasl.interface.ts.html +1 -1
- package/coverage/src/concepts/basics/stdlib/nasl.io.ts.html +1 -1
- package/coverage/src/concepts/basics/stdlib/nasl.logging.ts.html +1 -1
- package/coverage/src/concepts/basics/stdlib/nasl.process.ts.html +1 -1
- package/coverage/src/concepts/basics/stdlib/nasl.ui.ts.html +1 -1
- package/coverage/src/concepts/basics/stdlib/nasl.util.ts.html +1 -1
- package/coverage/src/concepts/basics/stdlib/nasl.validation.ts.html +1 -1
- package/coverage/src/concepts/basics/stdlib/reference2TypeAnnotationList.ts.html +1 -1
- package/coverage/src/concepts/basics/stdlib/timeZone.ts.html +1 -1
- package/coverage/src/concepts/basics/types/coreTypeList.ts.html +1 -1
- package/coverage/src/concepts/basics/types/index.html +1 -1
- package/coverage/src/concepts/basics/types/index.ts.html +1 -1
- package/coverage/src/concepts/index.html +823 -808
- package/coverage/src/concepts/index.ts.html +1 -1
- package/coverage/src/concepts/index__.ts.html +7 -4
- package/coverage/src/config.ts.html +1 -1
- package/coverage/src/decorators/index.html +1 -1
- package/coverage/src/decorators/index.ts.html +24 -24
- package/coverage/src/decorators/promise.ts.html +1 -1
- package/coverage/src/eventBus.ts.html +1 -1
- package/coverage/src/generator/compileComponent.ts.html +1 -1
- package/coverage/src/generator/genBundleFiles.ts.html +13 -19
- package/coverage/src/generator/genHash.ts.html +1 -1
- package/coverage/src/generator/genMetaData.ts.html +103 -16
- package/coverage/src/generator/genReleaseBody.ts.html +1 -1
- package/coverage/src/generator/icestark.ts.html +1 -1
- package/coverage/src/generator/index.html +15 -15
- package/coverage/src/generator/index.ts.html +1 -1
- package/coverage/src/generator/microApp.ts.html +1 -1
- package/coverage/src/generator/permission.ts.html +1 -1
- package/coverage/src/generator/qiankun.ts.html +1 -1
- package/coverage/src/generator/styleReplacer.ts.html +1 -1
- package/coverage/src/index.html +7 -7
- package/coverage/src/index.ts.html +4 -4
- package/coverage/src/manager/diagnostic.ts.html +1 -1
- package/coverage/src/manager/index.html +1 -1
- package/coverage/src/manager/stepRecorder.ts.html +1 -1
- package/coverage/src/natural/genNaturalTS.ts.html +1 -1
- package/coverage/src/natural/index.html +15 -15
- package/coverage/src/natural/index.ts.html +1 -1
- package/coverage/src/natural/naslStdlibMap.ts.html +1 -1
- package/coverage/src/natural/transformTSCode.ts.html +78 -18
- package/coverage/src/sentry/index.html +1 -1
- package/coverage/src/sentry/index.ts.html +21 -21
- package/coverage/src/server/createUiTs.ts.html +15 -6
- package/coverage/src/server/entity2LogicNamespace.ts.html +1 -1
- package/coverage/src/server/event.js.html +1 -1
- package/coverage/src/server/extendBaseNode.ts.html +7 -4
- package/coverage/src/server/formatTsUtils.ts.html +1 -1
- package/coverage/src/server/getConnector.ts.html +1 -1
- package/coverage/src/server/getExtensionModules.ts.html +1 -1
- package/coverage/src/server/getFunctions.ts.html +1 -1
- package/coverage/src/server/getInterfaces.ts.html +1 -1
- package/coverage/src/server/getLogging.ts.html +1 -1
- package/coverage/src/server/getLogics.ts.html +1 -1
- package/coverage/src/server/getMemberIdentifier.ts.html +161 -113
- package/coverage/src/server/getProcessComponents.ts.html +1 -1
- package/coverage/src/server/getProcesses.ts.html +1 -1
- package/coverage/src/server/getValidates.ts.html +1 -1
- package/coverage/src/server/index.html +25 -25
- package/coverage/src/server/index.ts.html +1 -1
- package/coverage/src/server/naslServer.ts.html +470 -59
- package/coverage/src/server/naslStdlibMap.ts.html +1 -1
- package/coverage/src/server/process2LogicNamespace.ts.html +1 -1
- package/coverage/src/server/translator.ts.html +3 -3
- package/coverage/src/service/creator/add.configs.js.html +26 -8
- package/coverage/src/service/creator/errHandles.js.html +19 -37
- package/coverage/src/service/creator/index.html +22 -22
- package/coverage/src/service/creator/index.js.html +1 -1
- package/coverage/src/service/datasource/api.js.html +1 -1
- package/coverage/src/service/datasource/index.html +1 -1
- package/coverage/src/service/datasource/index.js.html +1 -1
- package/coverage/src/service/logic/api.js.html +1 -1
- package/coverage/src/service/logic/index.html +1 -1
- package/coverage/src/service/logic/index.js.html +1 -1
- package/coverage/src/service/storage/api.js.html +1 -1
- package/coverage/src/service/storage/index.html +19 -19
- package/coverage/src/service/storage/index.ts.html +1 -1
- package/coverage/src/service/storage/init.ts.html +1498 -598
- package/coverage/src/service/storage/jsoner.ts.html +3 -3
- package/coverage/src/service/storage/map.ts.html +1 -1
- package/coverage/src/service/storage/service.ts.html +1 -1
- package/coverage/src/service/storage/storagePoint.ts.html +1 -1
- package/coverage/src/templator/genCallComponentLogic.ts.html +1 -1
- package/coverage/src/templator/genCreateBlock.ts.html +47 -56
- package/coverage/src/templator/genCurdEditMultipleKeyBlock.ts.html +49 -31
- package/coverage/src/templator/genCurdMultipleKeyBlock.ts.html +81 -93
- package/coverage/src/templator/genEditTableBlock.ts.html +80 -11
- package/coverage/src/templator/genEnumSelectBlock.ts.html +1 -1
- package/coverage/src/templator/genGetBlock.ts.html +1 -1
- package/coverage/src/templator/genGridViewBlock.ts.html +1 -1
- package/coverage/src/templator/genListViewBlock.ts.html +1 -1
- package/coverage/src/templator/genQueryComponent.ts.html +1 -1
- package/coverage/src/templator/genSelectBlock.ts.html +1 -1
- package/coverage/src/templator/genTableBlock.ts.html +66 -3
- package/coverage/src/templator/genUpdateBlock.ts.html +48 -36
- package/coverage/src/templator/index.html +39 -39
- package/coverage/src/templator/index.ts.html +1 -1
- package/coverage/src/templator/utils.ts.html +77 -11
- package/coverage/src/translator/constant.ts.html +1 -1
- package/coverage/src/translator/index.html +20 -20
- package/coverage/src/translator/index.ts.html +1 -1
- package/coverage/src/translator/utils.ts.html +87 -30
- package/coverage/src/utils/cookie.ts.html +1 -1
- package/coverage/src/utils/env.ts.html +1 -1
- package/coverage/src/utils/index.html +27 -27
- package/coverage/src/utils/index.ts.html +115 -22
- package/coverage/src/utils/logger.ts.html +1 -1
- package/coverage/src/utils/sortTsString.ts.html +1 -1
- package/coverage/src/utils/string.ts.html +110 -8
- package/coverage/src/utils/time-slicing.ts.html +1 -1
- package/coverage/src/utils/traverse.ts.html +1 -1
- package/coverage/src/utils/window.ts.html +1 -1
- package/out/common/BaseNode.d.ts +1 -1
- package/out/common/BaseNode.js +6 -2
- package/out/common/BaseNode.js.map +1 -1
- package/out/concepts/Abort__.js +3 -1
- package/out/concepts/Abort__.js.map +1 -1
- package/out/concepts/Anchor__.js +11 -4
- package/out/concepts/Anchor__.js.map +1 -1
- package/out/concepts/AnonymousFunction__.js +30 -11
- package/out/concepts/AnonymousFunction__.js.map +1 -1
- package/out/concepts/App__.js +147 -63
- package/out/concepts/App__.js.map +1 -1
- package/out/concepts/Argument__.js +11 -4
- package/out/concepts/Argument__.js.map +1 -1
- package/out/concepts/Assignee__.js +23 -9
- package/out/concepts/Assignee__.js.map +1 -1
- package/out/concepts/AssignmentLine__.js +3 -1
- package/out/concepts/AssignmentLine__.js.map +1 -1
- package/out/concepts/Assignment__.js +19 -6
- package/out/concepts/Assignment__.js.map +1 -1
- package/out/concepts/Attribute__.js +11 -4
- package/out/concepts/Attribute__.js.map +1 -1
- package/out/concepts/AuthInterface__.js +3 -1
- package/out/concepts/AuthInterface__.js.map +1 -1
- package/out/concepts/AuthLogicForCallInterface__.js +12 -5
- package/out/concepts/AuthLogicForCallInterface__.js.map +1 -1
- package/out/concepts/AuthLogic__.js +3 -1
- package/out/concepts/AuthLogic__.js.map +1 -1
- package/out/concepts/BackendVariable__.js +11 -4
- package/out/concepts/BackendVariable__.js.map +1 -1
- package/out/concepts/Backend__.js +12 -5
- package/out/concepts/Backend__.js.map +1 -1
- package/out/concepts/BatchAssignment__.js +32 -16
- package/out/concepts/BatchAssignment__.js.map +1 -1
- package/out/concepts/BinaryExpression__.js +15 -8
- package/out/concepts/BinaryExpression__.js.map +1 -1
- package/out/concepts/BindAttribute__.js +21 -6
- package/out/concepts/BindAttribute__.js.map +1 -1
- package/out/concepts/BindDirective__.js +28 -5
- package/out/concepts/BindDirective__.js.map +1 -1
- package/out/concepts/BindEvent__.js +20 -8
- package/out/concepts/BindEvent__.js.map +1 -1
- package/out/concepts/BindStyle__.js +11 -4
- package/out/concepts/BindStyle__.js.map +1 -1
- package/out/concepts/BooleanLiteral__.js +3 -1
- package/out/concepts/BooleanLiteral__.js.map +1 -1
- package/out/concepts/CallAuthInterface__.js +14 -5
- package/out/concepts/CallAuthInterface__.js.map +1 -1
- package/out/concepts/CallConnector__.js +3 -1
- package/out/concepts/CallConnector__.js.map +1 -1
- package/out/concepts/CallFunction__.js +23 -12
- package/out/concepts/CallFunction__.js.map +1 -1
- package/out/concepts/CallInterface__.js +15 -8
- package/out/concepts/CallInterface__.js.map +1 -1
- package/out/concepts/CallLogic__.js +45 -26
- package/out/concepts/CallLogic__.js.map +1 -1
- package/out/concepts/CallQueryComponent__.js +19 -7
- package/out/concepts/CallQueryComponent__.js.map +1 -1
- package/out/concepts/Comment__.js +3 -1
- package/out/concepts/Comment__.js.map +1 -1
- package/out/concepts/CompletionProperty__.js +11 -4
- package/out/concepts/CompletionProperty__.js.map +1 -1
- package/out/concepts/ConfigGroup__.js +12 -5
- package/out/concepts/ConfigGroup__.js.map +1 -1
- package/out/concepts/ConfigPropertyValue__.js +3 -1
- package/out/concepts/ConfigPropertyValue__.js.map +1 -1
- package/out/concepts/ConfigProperty__.js +12 -5
- package/out/concepts/ConfigProperty__.js.map +1 -1
- package/out/concepts/Configuration__.js +12 -5
- package/out/concepts/Configuration__.js.map +1 -1
- package/out/concepts/Connection__.js +12 -5
- package/out/concepts/Connection__.js.map +1 -1
- package/out/concepts/ConnectorTrigger__.js +3 -1
- package/out/concepts/ConnectorTrigger__.js.map +1 -1
- package/out/concepts/Connector__.js +48 -21
- package/out/concepts/Connector__.js.map +1 -1
- package/out/concepts/Constant__.js +11 -4
- package/out/concepts/Constant__.js.map +1 -1
- package/out/concepts/DataSource__.js +12 -5
- package/out/concepts/DataSource__.js.map +1 -1
- package/out/concepts/DatabaseTypeAnnotation__.js +3 -1
- package/out/concepts/DatabaseTypeAnnotation__.js.map +1 -1
- package/out/concepts/Destination__.js +11 -4
- package/out/concepts/Destination__.js.map +1 -1
- package/out/concepts/End__.js +3 -1
- package/out/concepts/End__.js.map +1 -1
- package/out/concepts/EntityIndex__.js +3 -1
- package/out/concepts/EntityIndex__.js.map +1 -1
- package/out/concepts/EntityProperty__.js +19 -7
- package/out/concepts/EntityProperty__.js.map +1 -1
- package/out/concepts/Entity__.js +21 -9
- package/out/concepts/Entity__.js.map +1 -1
- package/out/concepts/EnumItem__.js +3 -1
- package/out/concepts/EnumItem__.js.map +1 -1
- package/out/concepts/Enum__.js +11 -4
- package/out/concepts/Enum__.js.map +1 -1
- package/out/concepts/Event__.js +12 -5
- package/out/concepts/Event__.js.map +1 -1
- package/out/concepts/ExternalDestination__.js +11 -4
- package/out/concepts/ExternalDestination__.js.map +1 -1
- package/out/concepts/ForEachStatement__.js +34 -24
- package/out/concepts/ForEachStatement__.js.map +1 -1
- package/out/concepts/FrontendLibrary__.js +21 -9
- package/out/concepts/FrontendLibrary__.js.map +1 -1
- package/out/concepts/Frontend__.js +47 -20
- package/out/concepts/Frontend__.js.map +1 -1
- package/out/concepts/Function__.js +47 -18
- package/out/concepts/Function__.js.map +1 -1
- package/out/concepts/Identifier__.js +3 -1
- package/out/concepts/Identifier__.js.map +1 -1
- package/out/concepts/IfStatement__.js +26 -17
- package/out/concepts/IfStatement__.js.map +1 -1
- package/out/concepts/Integration__.js +20 -8
- package/out/concepts/Integration__.js.map +1 -1
- package/out/concepts/InterfaceParam__.js +11 -4
- package/out/concepts/InterfaceParam__.js.map +1 -1
- package/out/concepts/Interface__.js +27 -10
- package/out/concepts/Interface__.js.map +1 -1
- package/out/concepts/JSBlock__.js +3 -1
- package/out/concepts/JSBlock__.js.map +1 -1
- package/out/concepts/JavaLogic__.js +3 -1
- package/out/concepts/JavaLogic__.js.map +1 -1
- package/out/concepts/LogicItem__.d.ts +4 -4
- package/out/concepts/LogicItem__.js +7 -5
- package/out/concepts/LogicItem__.js.map +1 -1
- package/out/concepts/Logic__.js +68 -36
- package/out/concepts/Logic__.js.map +1 -1
- package/out/concepts/MatchCase__.js +36 -24
- package/out/concepts/MatchCase__.js.map +1 -1
- package/out/concepts/Match__.js +23 -16
- package/out/concepts/Match__.js.map +1 -1
- package/out/concepts/MemberExpression__.js +27 -20
- package/out/concepts/MemberExpression__.js.map +1 -1
- package/out/concepts/MicroApp__.js +3 -1
- package/out/concepts/MicroApp__.js.map +1 -1
- package/out/concepts/Module__.js +5 -3
- package/out/concepts/Module__.js.map +1 -1
- package/out/concepts/MsgTriggerEvent__.js +12 -5
- package/out/concepts/MsgTriggerEvent__.js.map +1 -1
- package/out/concepts/MsgTriggerLauncher__.js +12 -5
- package/out/concepts/MsgTriggerLauncher__.js.map +1 -1
- package/out/concepts/Namespace__.js +102 -45
- package/out/concepts/Namespace__.js.map +1 -1
- package/out/concepts/NewComposite__.js +57 -25
- package/out/concepts/NewComposite__.js.map +1 -1
- package/out/concepts/NewList__.js +20 -8
- package/out/concepts/NewList__.js.map +1 -1
- package/out/concepts/NewMap__.js +20 -8
- package/out/concepts/NewMap__.js.map +1 -1
- package/out/concepts/NullLiteral__.js +3 -1
- package/out/concepts/NullLiteral__.js.map +1 -1
- package/out/concepts/NumericLiteral__.js +11 -4
- package/out/concepts/NumericLiteral__.js.map +1 -1
- package/out/concepts/OqlQueryComponent__.js +32 -5
- package/out/concepts/OqlQueryComponent__.js.map +1 -1
- package/out/concepts/OverriddenLogic__.js +52 -20
- package/out/concepts/OverriddenLogic__.js.map +1 -1
- package/out/concepts/Param__.js +12 -5
- package/out/concepts/Param__.js.map +1 -1
- package/out/concepts/Point__.js +3 -1
- package/out/concepts/Point__.js.map +1 -1
- package/out/concepts/ProcessComponent__.js +21 -9
- package/out/concepts/ProcessComponent__.js.map +1 -1
- package/out/concepts/ProcessElement__.js +73 -31
- package/out/concepts/ProcessElement__.js.map +1 -1
- package/out/concepts/ProcessOutcome__.js +3 -1
- package/out/concepts/ProcessOutcome__.js.map +1 -1
- package/out/concepts/ProcessOutcomes__.js +3 -1
- package/out/concepts/ProcessOutcomes__.js.map +1 -1
- package/out/concepts/Process__.js +48 -21
- package/out/concepts/Process__.js.map +1 -1
- package/out/concepts/QueryAggregateExpression__.js +11 -4
- package/out/concepts/QueryAggregateExpression__.js.map +1 -1
- package/out/concepts/QueryFieldExpression__.js +3 -1
- package/out/concepts/QueryFieldExpression__.js.map +1 -1
- package/out/concepts/QueryFromExpression__.js +11 -4
- package/out/concepts/QueryFromExpression__.js.map +1 -1
- package/out/concepts/QueryGroupByExpression__.js +11 -4
- package/out/concepts/QueryGroupByExpression__.js.map +1 -1
- package/out/concepts/QueryJoinExpression__.js +12 -5
- package/out/concepts/QueryJoinExpression__.js.map +1 -1
- package/out/concepts/QueryLimitExpression__.js +11 -4
- package/out/concepts/QueryLimitExpression__.js.map +1 -1
- package/out/concepts/QueryOrderByExpression__.js +11 -4
- package/out/concepts/QueryOrderByExpression__.js.map +1 -1
- package/out/concepts/QuerySelectExpression__.js +12 -5
- package/out/concepts/QuerySelectExpression__.js.map +1 -1
- package/out/concepts/Rect__.js +3 -1
- package/out/concepts/Rect__.js.map +1 -1
- package/out/concepts/Return__.js +11 -4
- package/out/concepts/Return__.js.map +1 -1
- package/out/concepts/Role__.js +3 -1
- package/out/concepts/Role__.js.map +1 -1
- package/out/concepts/SelectMembers__.js +12 -5
- package/out/concepts/SelectMembers__.js.map +1 -1
- package/out/concepts/Slot__.js +11 -4
- package/out/concepts/Slot__.js.map +1 -1
- package/out/concepts/SqlQueryComponent__.js +11 -4
- package/out/concepts/SqlQueryComponent__.js.map +1 -1
- package/out/concepts/Start__.js +3 -1
- package/out/concepts/Start__.js.map +1 -1
- package/out/concepts/StringInterpolation__.js +12 -5
- package/out/concepts/StringInterpolation__.js.map +1 -1
- package/out/concepts/StringLiteral__.js +3 -1
- package/out/concepts/StringLiteral__.js.map +1 -1
- package/out/concepts/StructureProperty__.js +11 -4
- package/out/concepts/StructureProperty__.js.map +1 -1
- package/out/concepts/Structure__.js +21 -9
- package/out/concepts/Structure__.js.map +1 -1
- package/out/concepts/SwitchCase__.js +15 -8
- package/out/concepts/SwitchCase__.js.map +1 -1
- package/out/concepts/SwitchStatement__.js +11 -4
- package/out/concepts/SwitchStatement__.js.map +1 -1
- package/out/concepts/Theme__.js +3 -1
- package/out/concepts/Theme__.js.map +1 -1
- package/out/concepts/Transactional__.js +3 -1
- package/out/concepts/Transactional__.js.map +1 -1
- package/out/concepts/TriggerEvent__.js +12 -5
- package/out/concepts/TriggerEvent__.js.map +1 -1
- package/out/concepts/TriggerLauncher__.js +3 -1
- package/out/concepts/TriggerLauncher__.js.map +1 -1
- package/out/concepts/TypeAnnotation__.d.ts +2 -1
- package/out/concepts/TypeAnnotation__.js +48 -15
- package/out/concepts/TypeAnnotation__.js.map +1 -1
- package/out/concepts/TypeParam__.js +3 -1
- package/out/concepts/TypeParam__.js.map +1 -1
- package/out/concepts/UnaryExpression__.js +17 -6
- package/out/concepts/UnaryExpression__.js.map +1 -1
- package/out/concepts/Unparsed__.js +3 -1
- package/out/concepts/Unparsed__.js.map +1 -1
- package/out/concepts/UseComponent__.js +3 -1
- package/out/concepts/UseComponent__.js.map +1 -1
- package/out/concepts/ValidationRule__.js +11 -4
- package/out/concepts/ValidationRule__.js.map +1 -1
- package/out/concepts/Variable__.js +11 -4
- package/out/concepts/Variable__.js.map +1 -1
- package/out/concepts/ViewBlock__.js +3 -1
- package/out/concepts/ViewBlock__.js.map +1 -1
- package/out/concepts/ViewComponent__.js +59 -25
- package/out/concepts/ViewComponent__.js.map +1 -1
- package/out/concepts/ViewElement__.js +51 -24
- package/out/concepts/ViewElement__.js.map +1 -1
- package/out/concepts/View__.js +54 -22
- package/out/concepts/View__.js.map +1 -1
- package/out/concepts/WhileStatement__.js +20 -11
- package/out/concepts/WhileStatement__.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.util.js +2 -2
- package/out/concepts/basics/stdlib/nasl.util.js.map +1 -1
- package/out/generator/permission.js +32 -6
- package/out/generator/permission.js.map +1 -1
- package/out/sentry/index.js +2 -1
- package/out/sentry/index.js.map +1 -1
- package/out/server/translator.js +5 -2
- package/out/server/translator.js.map +1 -1
- package/out/service/storage/init.d.ts +1 -1
- package/out/service/storage/init.js +17 -5
- package/out/service/storage/init.js.map +1 -1
- package/out/utils/sortTsString.js +10 -4
- package/out/utils/sortTsString.js.map +1 -1
- package/package.json +1 -1
- package/src/common/BaseNode.ts +9 -4
- package/src/concepts/Abort__.ts +1 -0
- package/src/concepts/Anchor__.ts +20 -14
- package/src/concepts/AnonymousFunction__.ts +29 -12
- package/src/concepts/App__.ts +161 -76
- package/src/concepts/Argument__.ts +9 -3
- package/src/concepts/Assignee__.ts +21 -8
- package/src/concepts/AssignmentLine__.ts +1 -0
- package/src/concepts/Assignment__.ts +28 -14
- package/src/concepts/Attribute__.ts +9 -3
- package/src/concepts/AuthInterface__.ts +1 -0
- package/src/concepts/AuthLogicForCallInterface__.ts +10 -4
- package/src/concepts/AuthLogic__.ts +4 -0
- package/src/concepts/BackendVariable__.ts +9 -3
- package/src/concepts/Backend__.ts +10 -4
- package/src/concepts/BatchAssignment__.ts +33 -16
- package/src/concepts/BinaryExpression__.ts +15 -9
- package/src/concepts/BindAttribute__.ts +35 -18
- package/src/concepts/BindDirective__.ts +26 -4
- package/src/concepts/BindEvent__.ts +37 -16
- package/src/concepts/BindStyle__.ts +9 -3
- package/src/concepts/BooleanLiteral__.ts +1 -0
- package/src/concepts/CallAuthInterface__.ts +12 -4
- package/src/concepts/CallConnector__.ts +1 -0
- package/src/concepts/CallFunction__.ts +25 -20
- package/src/concepts/CallInterface__.ts +44 -28
- package/src/concepts/CallLogic__.ts +80 -59
- package/src/concepts/CallQueryComponent__.ts +17 -6
- package/src/concepts/Comment__.ts +2 -1
- package/src/concepts/CompletionProperty__.ts +9 -3
- package/src/concepts/ConfigGroup__.ts +10 -4
- package/src/concepts/ConfigPropertyValue__.ts +1 -0
- package/src/concepts/ConfigProperty__.ts +10 -4
- package/src/concepts/Configuration__.ts +10 -4
- package/src/concepts/Connection__.ts +11 -5
- package/src/concepts/ConnectorTrigger__.ts +1 -0
- package/src/concepts/Connector__.ts +46 -20
- package/src/concepts/Constant__.ts +9 -3
- package/src/concepts/DataSource__.ts +10 -4
- package/src/concepts/DatabaseTypeAnnotation__.ts +1 -0
- package/src/concepts/Destination__.ts +9 -4
- package/src/concepts/End__.ts +1 -0
- package/src/concepts/EntityIndex__.ts +1 -0
- package/src/concepts/EntityProperty__.ts +17 -6
- package/src/concepts/Entity__.ts +19 -8
- package/src/concepts/EnumItem__.ts +1 -0
- package/src/concepts/Enum__.ts +9 -3
- package/src/concepts/Event__.ts +10 -4
- package/src/concepts/ExternalDestination__.ts +9 -3
- package/src/concepts/ForEachStatement__.ts +45 -36
- package/src/concepts/FrontendLibrary__.ts +19 -8
- package/src/concepts/Frontend__.ts +45 -19
- package/src/concepts/Function__.ts +46 -19
- package/src/concepts/Identifier__.ts +1 -0
- package/src/concepts/IfStatement__.ts +30 -20
- package/src/concepts/Integration__.ts +18 -7
- package/src/concepts/InterfaceParam__.ts +9 -3
- package/src/concepts/Interface__.ts +31 -15
- package/src/concepts/JSBlock__.ts +1 -0
- package/src/concepts/JavaLogic__.ts +1 -0
- package/src/concepts/LogicItem__.ts +5 -4
- package/src/concepts/Logic__.ts +77 -59
- package/src/concepts/MatchCase__.ts +46 -31
- package/src/concepts/Match__.ts +24 -16
- package/src/concepts/MemberExpression__.ts +25 -19
- package/src/concepts/MicroApp__.ts +1 -0
- package/src/concepts/Module__.ts +10 -9
- package/src/concepts/MsgTriggerEvent__.ts +10 -4
- package/src/concepts/MsgTriggerLauncher__.ts +10 -4
- package/src/concepts/Namespace__.ts +100 -44
- package/src/concepts/NewComposite__.ts +60 -28
- package/src/concepts/NewList__.ts +20 -8
- package/src/concepts/NewMap__.ts +20 -8
- package/src/concepts/NullLiteral__.ts +1 -0
- package/src/concepts/NumericLiteral__.ts +9 -3
- package/src/concepts/OqlQueryComponent__.ts +32 -4
- package/src/concepts/OverriddenLogic__.ts +51 -20
- package/src/concepts/Param__.ts +10 -6
- package/src/concepts/Point__.ts +1 -0
- package/src/concepts/ProcessComponent__.ts +19 -8
- package/src/concepts/ProcessElement__.ts +71 -30
- package/src/concepts/ProcessOutcome__.ts +1 -0
- package/src/concepts/ProcessOutcomes__.ts +1 -0
- package/src/concepts/Process__.ts +46 -20
- package/src/concepts/QueryAggregateExpression__.ts +9 -3
- package/src/concepts/QueryFieldExpression__.ts +1 -0
- package/src/concepts/QueryFromExpression__.ts +9 -3
- package/src/concepts/QueryGroupByExpression__.ts +9 -3
- package/src/concepts/QueryJoinExpression__.ts +10 -4
- package/src/concepts/QueryLimitExpression__.ts +9 -3
- package/src/concepts/QueryOrderByExpression__.ts +9 -3
- package/src/concepts/QuerySelectExpression__.ts +10 -4
- package/src/concepts/Rect__.ts +1 -0
- package/src/concepts/Return__.ts +9 -3
- package/src/concepts/Role__.ts +1 -0
- package/src/concepts/SelectMembers__.ts +10 -4
- package/src/concepts/Slot__.ts +9 -3
- package/src/concepts/SqlQueryComponent__.ts +9 -3
- package/src/concepts/Start__.ts +1 -0
- package/src/concepts/StringInterpolation__.ts +11 -5
- package/src/concepts/StringLiteral__.ts +1 -0
- package/src/concepts/StructureProperty__.ts +9 -3
- package/src/concepts/Structure__.ts +19 -8
- package/src/concepts/SwitchCase__.ts +15 -9
- package/src/concepts/SwitchStatement__.ts +22 -16
- package/src/concepts/Theme__.ts +1 -0
- package/src/concepts/Transactional__.ts +1 -0
- package/src/concepts/TriggerEvent__.ts +10 -4
- package/src/concepts/TriggerLauncher__.ts +1 -0
- package/src/concepts/TypeAnnotation__.ts +55 -21
- package/src/concepts/TypeParam__.ts +2 -1
- package/src/concepts/UnaryExpression__.ts +16 -6
- package/src/concepts/Unparsed__.ts +2 -1
- package/src/concepts/UseComponent__.ts +1 -0
- package/src/concepts/ValidationRule__.ts +10 -4
- package/src/concepts/Variable__.ts +9 -3
- package/src/concepts/ViewBlock__.ts +1 -0
- package/src/concepts/ViewComponent__.ts +57 -24
- package/src/concepts/ViewElement__.ts +148 -110
- package/src/concepts/View__.ts +100 -56
- package/src/concepts/WhileStatement__.ts +27 -15
- package/src/concepts/basics/stdlib/nasl.util.ts +2 -2
- package/src/generator/permission.ts +33 -9
- package/src/sentry/index.ts +3 -1
- package/src/server/translator.ts +5 -2
- package/src/service/storage/init.ts +17 -5
- package/src/utils/sortTsString.ts +9 -4
- package/test/concepts/call-function/__snapshots__/toEmbeddedTS.spec.ts.snap +26 -0
- package/test/concepts/call-function/__snapshots__/toJS.spec.ts.snap +26 -0
- package/test/concepts/call-function/constant.ts +5 -0
- package/test/concepts/call-function/fixtures/from-string.json +100 -0
- package/test/concepts/call-function/fixtures/to-string-global-tz.json +99 -0
- package/test/concepts/call-function/fixtures/to-string-no-tz.json +89 -0
- package/test/concepts/call-function/fixtures/to-string-user-tz.json +101 -0
- package/test/concepts/call-function/fixtures/to-string-utc-tz.json +101 -0
- package/test/concepts/call-function/toEmbeddedTS.spec.ts +14 -0
- package/test/concepts/call-function/toJS.spec.ts +14 -0
- package/.nyc_output/d58d92d8-c0d6-479b-9f82-1f4da8e73ff3.json +0 -1
- package/.nyc_output/processinfo/d58d92d8-c0d6-479b-9f82-1f4da8e73ff3.json +0 -1
- package/.nyc_output/processinfo/index.json +0 -1
package/src/concepts/Enum__.ts
CHANGED
|
@@ -28,6 +28,7 @@ export class Enum extends BaseNode {
|
|
|
28
28
|
/**
|
|
29
29
|
* 产品概念
|
|
30
30
|
*/
|
|
31
|
+
@property('concept')
|
|
31
32
|
// @ts-ignore
|
|
32
33
|
readonly concept!: 'Enum';
|
|
33
34
|
|
|
@@ -254,11 +255,16 @@ export class Enum extends BaseNode {
|
|
|
254
255
|
};
|
|
255
256
|
if (parentKey) {
|
|
256
257
|
params.parentKey = parentKey;
|
|
257
|
-
|
|
258
|
-
|
|
258
|
+
// @ts-ignore
|
|
259
|
+
const t = this.__v_raw || this;
|
|
260
|
+
// @ts-ignore
|
|
261
|
+
const n = enumItem.__v_raw || enumItem;
|
|
262
|
+
if (Array.isArray((t as any)[parentKey])) {
|
|
263
|
+
// @ts-ignore
|
|
264
|
+
const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
|
|
259
265
|
~index && (this as any)[parentKey].splice(index, 1);
|
|
260
266
|
params.index = index;
|
|
261
|
-
} else if ((
|
|
267
|
+
} else if ((t as any)[parentKey] === n) {
|
|
262
268
|
params.index = 0;
|
|
263
269
|
(this as any)[parentKey] = undefined;
|
|
264
270
|
}
|
package/src/concepts/Event__.ts
CHANGED
|
@@ -26,6 +26,7 @@ export class Event extends BaseNode {
|
|
|
26
26
|
/**
|
|
27
27
|
* 产品概念
|
|
28
28
|
*/
|
|
29
|
+
@property('concept')
|
|
29
30
|
// @ts-ignore
|
|
30
31
|
readonly concept!: 'Event';
|
|
31
32
|
|
|
@@ -116,7 +117,7 @@ export class Event extends BaseNode {
|
|
|
116
117
|
|
|
117
118
|
getParamExistingNames(excludedList: Array<Param> = []) {
|
|
118
119
|
const excludedSet = new Set(excludedList);
|
|
119
|
-
return ((this.params as Param[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item
|
|
120
|
+
return ((this.params as Param[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item?.name);
|
|
120
121
|
}
|
|
121
122
|
getParamUniqueName(name = 'param1') {
|
|
122
123
|
return utils.unique(name, this.getParamExistingNames(), undefined, false);
|
|
@@ -303,11 +304,16 @@ export class Event extends BaseNode {
|
|
|
303
304
|
};
|
|
304
305
|
if (parentKey) {
|
|
305
306
|
params.parentKey = parentKey;
|
|
306
|
-
|
|
307
|
-
|
|
307
|
+
// @ts-ignore
|
|
308
|
+
const t = this.__v_raw || this;
|
|
309
|
+
// @ts-ignore
|
|
310
|
+
const n = param.__v_raw || param;
|
|
311
|
+
if (Array.isArray((t as any)[parentKey])) {
|
|
312
|
+
// @ts-ignore
|
|
313
|
+
const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
|
|
308
314
|
~index && (this as any)[parentKey].splice(index, 1);
|
|
309
315
|
params.index = index;
|
|
310
|
-
} else if ((
|
|
316
|
+
} else if ((t as any)[parentKey] === n) {
|
|
311
317
|
params.index = 0;
|
|
312
318
|
(this as any)[parentKey] = undefined;
|
|
313
319
|
}
|
|
@@ -29,6 +29,7 @@ export class ExternalDestination extends LogicItem {
|
|
|
29
29
|
/**
|
|
30
30
|
* 产品概念
|
|
31
31
|
*/
|
|
32
|
+
@property('concept')
|
|
32
33
|
// @ts-ignore
|
|
33
34
|
readonly concept!: 'ExternalDestination';
|
|
34
35
|
|
|
@@ -168,11 +169,16 @@ export class ExternalDestination extends LogicItem {
|
|
|
168
169
|
};
|
|
169
170
|
if (parentKey) {
|
|
170
171
|
params.parentKey = parentKey;
|
|
171
|
-
|
|
172
|
-
|
|
172
|
+
// @ts-ignore
|
|
173
|
+
const t = this.__v_raw || this;
|
|
174
|
+
// @ts-ignore
|
|
175
|
+
const n = logicItem.__v_raw || logicItem;
|
|
176
|
+
if (Array.isArray((t as any)[parentKey])) {
|
|
177
|
+
// @ts-ignore
|
|
178
|
+
const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
|
|
173
179
|
~index && (this as any)[parentKey].splice(index, 1);
|
|
174
180
|
params.index = index;
|
|
175
|
-
} else if ((
|
|
181
|
+
} else if ((t as any)[parentKey] === n) {
|
|
176
182
|
params.index = 0;
|
|
177
183
|
(this as any)[parentKey] = undefined;
|
|
178
184
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { v4 as uuidv4 } from 'uuid';
|
|
2
1
|
import { TranslatorState, shiftState, withSourceMap, indent, createCompilerState } from '../translator';
|
|
3
2
|
import TypeAnnotation from './TypeAnnotation__';
|
|
4
3
|
import Identifier from './Identifier__';
|
|
@@ -12,6 +11,7 @@ import { EventPayload, Params } from '../common/EventEmitter';
|
|
|
12
11
|
import { concept, excludedInJSON, property, className } from '../decorators';
|
|
13
12
|
|
|
14
13
|
import * as utils from '../utils';
|
|
14
|
+
import { v4 as uuidv4 } from 'uuid';
|
|
15
15
|
import BaseNode from '../common/BaseNode';
|
|
16
16
|
import LogicItem from './LogicItem__';
|
|
17
17
|
import Param from './Param__';
|
|
@@ -29,6 +29,7 @@ export class ForEachStatement extends LogicItem {
|
|
|
29
29
|
/**
|
|
30
30
|
* 产品概念
|
|
31
31
|
*/
|
|
32
|
+
@property('concept')
|
|
32
33
|
// @ts-ignore
|
|
33
34
|
readonly concept!: 'ForEachStatement';
|
|
34
35
|
|
|
@@ -77,7 +78,7 @@ export class ForEachStatement extends LogicItem {
|
|
|
77
78
|
* @param source 需要合并的部分参数
|
|
78
79
|
*/
|
|
79
80
|
constructor(source?: Partial<ForEachStatement>) {
|
|
80
|
-
source = {
|
|
81
|
+
source = Object.assign({}, ForEachStatement.getDefaultOptions(), source);
|
|
81
82
|
super(source);
|
|
82
83
|
super.subConstructor(source);
|
|
83
84
|
}
|
|
@@ -278,7 +279,7 @@ export class ForEachStatement extends LogicItem {
|
|
|
278
279
|
if (typeof options === 'string') {
|
|
279
280
|
each = this.each;
|
|
280
281
|
if (!each) {
|
|
281
|
-
throw new Error(
|
|
282
|
+
throw new Error('找不到逻辑项 ' + options);
|
|
282
283
|
}
|
|
283
284
|
} else {
|
|
284
285
|
each = options;
|
|
@@ -303,7 +304,7 @@ export class ForEachStatement extends LogicItem {
|
|
|
303
304
|
if (typeof options === 'string') {
|
|
304
305
|
start = this.start;
|
|
305
306
|
if (!start) {
|
|
306
|
-
throw new Error(
|
|
307
|
+
throw new Error('找不到逻辑项 ' + options);
|
|
307
308
|
}
|
|
308
309
|
} else {
|
|
309
310
|
start = options;
|
|
@@ -328,7 +329,7 @@ export class ForEachStatement extends LogicItem {
|
|
|
328
329
|
if (typeof options === 'string') {
|
|
329
330
|
end = this.end;
|
|
330
331
|
if (!end) {
|
|
331
|
-
throw new Error(
|
|
332
|
+
throw new Error('找不到逻辑项 ' + options);
|
|
332
333
|
}
|
|
333
334
|
} else {
|
|
334
335
|
end = options;
|
|
@@ -343,12 +344,12 @@ export class ForEachStatement extends LogicItem {
|
|
|
343
344
|
removeItemInBody(logicItem: LogicItem): void;
|
|
344
345
|
|
|
345
346
|
removeItemInBody(options: LogicItem) {
|
|
346
|
-
|
|
347
|
+
let logicItem: LogicItem = options;
|
|
347
348
|
return logicItem.delete();
|
|
348
349
|
}
|
|
349
350
|
|
|
350
351
|
__removeLogicItem(logicItem: LogicItem) {
|
|
351
|
-
const
|
|
352
|
+
const parentKey = logicItem.parentKey;
|
|
352
353
|
const params: Params = {
|
|
353
354
|
parentNode: this,
|
|
354
355
|
parentKey,
|
|
@@ -358,11 +359,16 @@ export class ForEachStatement extends LogicItem {
|
|
|
358
359
|
};
|
|
359
360
|
if (parentKey) {
|
|
360
361
|
params.parentKey = parentKey;
|
|
361
|
-
|
|
362
|
-
|
|
362
|
+
// @ts-ignore
|
|
363
|
+
const t = this.__v_raw || this;
|
|
364
|
+
// @ts-ignore
|
|
365
|
+
const n = logicItem.__v_raw || logicItem;
|
|
366
|
+
if (Array.isArray((t as any)[parentKey])) {
|
|
367
|
+
// @ts-ignore
|
|
368
|
+
const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
|
|
363
369
|
~index && (this as any)[parentKey].splice(index, 1);
|
|
364
370
|
params.index = index;
|
|
365
|
-
} else if ((
|
|
371
|
+
} else if ((t as any)[parentKey] === n) {
|
|
366
372
|
params.index = 0;
|
|
367
373
|
(this as any)[parentKey] = undefined;
|
|
368
374
|
}
|
|
@@ -387,7 +393,7 @@ export class ForEachStatement extends LogicItem {
|
|
|
387
393
|
if (typeof options === 'string') {
|
|
388
394
|
item = this.item;
|
|
389
395
|
if (!item) {
|
|
390
|
-
throw new Error(
|
|
396
|
+
throw new Error('找不到输入参数 ' + options);
|
|
391
397
|
}
|
|
392
398
|
} else {
|
|
393
399
|
item = options;
|
|
@@ -412,7 +418,7 @@ export class ForEachStatement extends LogicItem {
|
|
|
412
418
|
if (typeof options === 'string') {
|
|
413
419
|
index = this.index;
|
|
414
420
|
if (!index) {
|
|
415
|
-
throw new Error(
|
|
421
|
+
throw new Error('找不到输入参数 ' + options);
|
|
416
422
|
}
|
|
417
423
|
} else {
|
|
418
424
|
index = options;
|
|
@@ -421,7 +427,7 @@ export class ForEachStatement extends LogicItem {
|
|
|
421
427
|
}
|
|
422
428
|
|
|
423
429
|
__removeParam(param: Param) {
|
|
424
|
-
const
|
|
430
|
+
const parentKey = param.parentKey;
|
|
425
431
|
const params: Params = {
|
|
426
432
|
parentNode: this,
|
|
427
433
|
parentKey,
|
|
@@ -431,11 +437,16 @@ export class ForEachStatement extends LogicItem {
|
|
|
431
437
|
};
|
|
432
438
|
if (parentKey) {
|
|
433
439
|
params.parentKey = parentKey;
|
|
434
|
-
|
|
435
|
-
|
|
440
|
+
// @ts-ignore
|
|
441
|
+
const t = this.__v_raw || this;
|
|
442
|
+
// @ts-ignore
|
|
443
|
+
const n = param.__v_raw || param;
|
|
444
|
+
if (Array.isArray((t as any)[parentKey])) {
|
|
445
|
+
// @ts-ignore
|
|
446
|
+
const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
|
|
436
447
|
~index && (this as any)[parentKey].splice(index, 1);
|
|
437
448
|
params.index = index;
|
|
438
|
-
} else if ((
|
|
449
|
+
} else if ((t as any)[parentKey] === n) {
|
|
439
450
|
params.index = 0;
|
|
440
451
|
(this as any)[parentKey] = undefined;
|
|
441
452
|
}
|
|
@@ -518,12 +529,11 @@ export class ForEachStatement extends LogicItem {
|
|
|
518
529
|
code += `const ${this.item.name} = $forEachListVariable${number}[${this.index.name}];\n`;
|
|
519
530
|
if (Array.isArray(this.body)) {
|
|
520
531
|
this.body.forEach((logicItem) => {
|
|
521
|
-
code +=
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
) }\n`;
|
|
532
|
+
code += `${logicItem.toJS(
|
|
533
|
+
shiftState(state, code, {
|
|
534
|
+
tabSize: 0,
|
|
535
|
+
}),
|
|
536
|
+
)}\n`;
|
|
527
537
|
});
|
|
528
538
|
}
|
|
529
539
|
code += '}\n';
|
|
@@ -553,15 +563,14 @@ export class ForEachStatement extends LogicItem {
|
|
|
553
563
|
code += ') => {\n';
|
|
554
564
|
if (Array.isArray(this.body)) {
|
|
555
565
|
this.body.forEach((logicItem) => {
|
|
556
|
-
code +=
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
) };\n`;
|
|
566
|
+
code += `${logicItem.toEmbeddedTS(
|
|
567
|
+
shiftState(state, code, {
|
|
568
|
+
tabSize: (state?.tabSize || 0) + 1,
|
|
569
|
+
}),
|
|
570
|
+
)};\n`;
|
|
562
571
|
});
|
|
563
572
|
}
|
|
564
|
-
code += `${indent(state?.tabSize || 0)
|
|
573
|
+
code += `${indent(state?.tabSize || 0)}})\n`;
|
|
565
574
|
|
|
566
575
|
return code;
|
|
567
576
|
}
|
|
@@ -571,10 +580,10 @@ export class ForEachStatement extends LogicItem {
|
|
|
571
580
|
let code = '';
|
|
572
581
|
code += this.each
|
|
573
582
|
? this.each.toNaturalTS(
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
583
|
+
shiftState(state, code, {
|
|
584
|
+
tabSize: 0,
|
|
585
|
+
}),
|
|
586
|
+
)
|
|
578
587
|
: '__IDENTIFIER__';
|
|
579
588
|
if (['NewList', 'NewMap'].includes(this.each?.concept)) code += '\n';
|
|
580
589
|
code += '.__slice(';
|
|
@@ -600,18 +609,18 @@ export class ForEachStatement extends LogicItem {
|
|
|
600
609
|
code += `${logicItem.toNaturalTS(
|
|
601
610
|
shiftState(state, code, {
|
|
602
611
|
tabSize: (state?.tabSize || 0) + 1,
|
|
603
|
-
})
|
|
612
|
+
}),
|
|
604
613
|
)};\n`;
|
|
605
614
|
});
|
|
606
615
|
if (state.focusedNodePath === `${this.nodePath}.body[${this.body.length}]`)
|
|
607
|
-
|
|
616
|
+
code += `${indent(state.tabSize + 1)}// 当前位置\n`;
|
|
608
617
|
}
|
|
609
618
|
code += `${indent(state?.tabSize || 0)}})\n`;
|
|
610
619
|
|
|
611
620
|
return code;
|
|
612
621
|
}
|
|
613
622
|
|
|
614
|
-
|
|
623
|
+
//================================================================================
|
|
615
624
|
// 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
|
|
616
625
|
// ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
|
|
617
626
|
//================================================================================
|
|
@@ -28,6 +28,7 @@ export class FrontendLibrary extends BaseNode {
|
|
|
28
28
|
/**
|
|
29
29
|
* 产品概念
|
|
30
30
|
*/
|
|
31
|
+
@property('concept')
|
|
31
32
|
// @ts-ignore
|
|
32
33
|
readonly concept!: 'FrontendLibrary';
|
|
33
34
|
|
|
@@ -97,7 +98,7 @@ export class FrontendLibrary extends BaseNode {
|
|
|
97
98
|
|
|
98
99
|
getLogicExistingNames(excludedList: Array<Logic> = []) {
|
|
99
100
|
const excludedSet = new Set(excludedList);
|
|
100
|
-
return ((this.logics as Logic[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item
|
|
101
|
+
return ((this.logics as Logic[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item?.name);
|
|
101
102
|
}
|
|
102
103
|
getLogicUniqueName(name = 'logic1') {
|
|
103
104
|
return utils.unique(name, this.getLogicExistingNames(), undefined, true);
|
|
@@ -252,7 +253,7 @@ export class FrontendLibrary extends BaseNode {
|
|
|
252
253
|
const excludedSet = new Set(excludedList);
|
|
253
254
|
return ((this.viewComponents as ViewComponent[]) || [])
|
|
254
255
|
.filter((item) => !excludedSet.has(item))
|
|
255
|
-
.map((item) => item
|
|
256
|
+
.map((item) => item?.name);
|
|
256
257
|
}
|
|
257
258
|
getViewComponentUniqueName(name = 'viewComponent1') {
|
|
258
259
|
return utils.unique(name, this.getViewComponentExistingNames(), undefined, false);
|
|
@@ -439,11 +440,16 @@ export class FrontendLibrary extends BaseNode {
|
|
|
439
440
|
};
|
|
440
441
|
if (parentKey) {
|
|
441
442
|
params.parentKey = parentKey;
|
|
442
|
-
|
|
443
|
-
|
|
443
|
+
// @ts-ignore
|
|
444
|
+
const t = this.__v_raw || this;
|
|
445
|
+
// @ts-ignore
|
|
446
|
+
const n = logic.__v_raw || logic;
|
|
447
|
+
if (Array.isArray((t as any)[parentKey])) {
|
|
448
|
+
// @ts-ignore
|
|
449
|
+
const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
|
|
444
450
|
~index && (this as any)[parentKey].splice(index, 1);
|
|
445
451
|
params.index = index;
|
|
446
|
-
} else if ((
|
|
452
|
+
} else if ((t as any)[parentKey] === n) {
|
|
447
453
|
params.index = 0;
|
|
448
454
|
(this as any)[parentKey] = undefined;
|
|
449
455
|
}
|
|
@@ -487,11 +493,16 @@ export class FrontendLibrary extends BaseNode {
|
|
|
487
493
|
};
|
|
488
494
|
if (parentKey) {
|
|
489
495
|
params.parentKey = parentKey;
|
|
490
|
-
|
|
491
|
-
|
|
496
|
+
// @ts-ignore
|
|
497
|
+
const t = this.__v_raw || this;
|
|
498
|
+
// @ts-ignore
|
|
499
|
+
const n = viewComponent.__v_raw || viewComponent;
|
|
500
|
+
if (Array.isArray((t as any)[parentKey])) {
|
|
501
|
+
// @ts-ignore
|
|
502
|
+
const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
|
|
492
503
|
~index && (this as any)[parentKey].splice(index, 1);
|
|
493
504
|
params.index = index;
|
|
494
|
-
} else if ((
|
|
505
|
+
} else if ((t as any)[parentKey] === n) {
|
|
495
506
|
params.index = 0;
|
|
496
507
|
(this as any)[parentKey] = undefined;
|
|
497
508
|
}
|
|
@@ -32,6 +32,7 @@ export class Frontend extends BaseNode {
|
|
|
32
32
|
/**
|
|
33
33
|
* 产品概念
|
|
34
34
|
*/
|
|
35
|
+
@property('concept')
|
|
35
36
|
// @ts-ignore
|
|
36
37
|
readonly concept!: 'Frontend';
|
|
37
38
|
|
|
@@ -237,7 +238,7 @@ export class Frontend extends BaseNode {
|
|
|
237
238
|
|
|
238
239
|
getBindEventExistingNames(excludedList: Array<BindEvent> = []) {
|
|
239
240
|
const excludedSet = new Set(excludedList);
|
|
240
|
-
return ((this.bindEvents as BindEvent[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item
|
|
241
|
+
return ((this.bindEvents as BindEvent[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item?.name);
|
|
241
242
|
}
|
|
242
243
|
getBindEventUniqueName(name = 'bindEvent1') {
|
|
243
244
|
return utils.unique(name, this.getBindEventExistingNames(), undefined, false);
|
|
@@ -390,7 +391,7 @@ export class Frontend extends BaseNode {
|
|
|
390
391
|
|
|
391
392
|
getViewExistingNames(excludedList: Array<View> = []) {
|
|
392
393
|
const excludedSet = new Set(excludedList);
|
|
393
|
-
return ((this.views as View[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item
|
|
394
|
+
return ((this.views as View[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item?.name);
|
|
394
395
|
}
|
|
395
396
|
getViewUniqueName(name = 'view1') {
|
|
396
397
|
return utils.unique(name, this.getViewExistingNames(), undefined, true);
|
|
@@ -545,7 +546,7 @@ export class Frontend extends BaseNode {
|
|
|
545
546
|
const excludedSet = new Set(excludedList);
|
|
546
547
|
return ((this.variables as FrontendVariable[]) || [])
|
|
547
548
|
.filter((item) => !excludedSet.has(item))
|
|
548
|
-
.map((item) => item
|
|
549
|
+
.map((item) => item?.name);
|
|
549
550
|
}
|
|
550
551
|
getFrontendVariableUniqueName(name = 'frontendVariable1') {
|
|
551
552
|
return utils.unique(name, this.getVarExistingNames(), undefined, true);
|
|
@@ -700,7 +701,7 @@ export class Frontend extends BaseNode {
|
|
|
700
701
|
const excludedSet = new Set(excludedList);
|
|
701
702
|
return ((this.componentDependencies as Module[]) || [])
|
|
702
703
|
.filter((item) => !excludedSet.has(item))
|
|
703
|
-
.map((item) => item
|
|
704
|
+
.map((item) => item?.name);
|
|
704
705
|
}
|
|
705
706
|
getModuleUniqueName(name = 'module1') {
|
|
706
707
|
return utils.unique(name, this.getModuleExistingNames(), undefined, false);
|
|
@@ -887,11 +888,16 @@ export class Frontend extends BaseNode {
|
|
|
887
888
|
};
|
|
888
889
|
if (parentKey) {
|
|
889
890
|
params.parentKey = parentKey;
|
|
890
|
-
|
|
891
|
-
|
|
891
|
+
// @ts-ignore
|
|
892
|
+
const t = this.__v_raw || this;
|
|
893
|
+
// @ts-ignore
|
|
894
|
+
const n = bindEvent.__v_raw || bindEvent;
|
|
895
|
+
if (Array.isArray((t as any)[parentKey])) {
|
|
896
|
+
// @ts-ignore
|
|
897
|
+
const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
|
|
892
898
|
~index && (this as any)[parentKey].splice(index, 1);
|
|
893
899
|
params.index = index;
|
|
894
|
-
} else if ((
|
|
900
|
+
} else if ((t as any)[parentKey] === n) {
|
|
895
901
|
params.index = 0;
|
|
896
902
|
(this as any)[parentKey] = undefined;
|
|
897
903
|
}
|
|
@@ -935,11 +941,16 @@ export class Frontend extends BaseNode {
|
|
|
935
941
|
};
|
|
936
942
|
if (parentKey) {
|
|
937
943
|
params.parentKey = parentKey;
|
|
938
|
-
|
|
939
|
-
|
|
944
|
+
// @ts-ignore
|
|
945
|
+
const t = this.__v_raw || this;
|
|
946
|
+
// @ts-ignore
|
|
947
|
+
const n = view.__v_raw || view;
|
|
948
|
+
if (Array.isArray((t as any)[parentKey])) {
|
|
949
|
+
// @ts-ignore
|
|
950
|
+
const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
|
|
940
951
|
~index && (this as any)[parentKey].splice(index, 1);
|
|
941
952
|
params.index = index;
|
|
942
|
-
} else if ((
|
|
953
|
+
} else if ((t as any)[parentKey] === n) {
|
|
943
954
|
params.index = 0;
|
|
944
955
|
(this as any)[parentKey] = undefined;
|
|
945
956
|
}
|
|
@@ -983,11 +994,16 @@ export class Frontend extends BaseNode {
|
|
|
983
994
|
};
|
|
984
995
|
if (parentKey) {
|
|
985
996
|
params.parentKey = parentKey;
|
|
986
|
-
|
|
987
|
-
|
|
997
|
+
// @ts-ignore
|
|
998
|
+
const t = this.__v_raw || this;
|
|
999
|
+
// @ts-ignore
|
|
1000
|
+
const n = variable.__v_raw || variable;
|
|
1001
|
+
if (Array.isArray((t as any)[parentKey])) {
|
|
1002
|
+
// @ts-ignore
|
|
1003
|
+
const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
|
|
988
1004
|
~index && (this as any)[parentKey].splice(index, 1);
|
|
989
1005
|
params.index = index;
|
|
990
|
-
} else if ((
|
|
1006
|
+
} else if ((t as any)[parentKey] === n) {
|
|
991
1007
|
params.index = 0;
|
|
992
1008
|
(this as any)[parentKey] = undefined;
|
|
993
1009
|
}
|
|
@@ -1031,11 +1047,16 @@ export class Frontend extends BaseNode {
|
|
|
1031
1047
|
};
|
|
1032
1048
|
if (parentKey) {
|
|
1033
1049
|
params.parentKey = parentKey;
|
|
1034
|
-
|
|
1035
|
-
|
|
1050
|
+
// @ts-ignore
|
|
1051
|
+
const t = this.__v_raw || this;
|
|
1052
|
+
// @ts-ignore
|
|
1053
|
+
const n = theme.__v_raw || theme;
|
|
1054
|
+
if (Array.isArray((t as any)[parentKey])) {
|
|
1055
|
+
// @ts-ignore
|
|
1056
|
+
const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
|
|
1036
1057
|
~index && (this as any)[parentKey].splice(index, 1);
|
|
1037
1058
|
params.index = index;
|
|
1038
|
-
} else if ((
|
|
1059
|
+
} else if ((t as any)[parentKey] === n) {
|
|
1039
1060
|
params.index = 0;
|
|
1040
1061
|
(this as any)[parentKey] = undefined;
|
|
1041
1062
|
}
|
|
@@ -1079,11 +1100,16 @@ export class Frontend extends BaseNode {
|
|
|
1079
1100
|
};
|
|
1080
1101
|
if (parentKey) {
|
|
1081
1102
|
params.parentKey = parentKey;
|
|
1082
|
-
|
|
1083
|
-
|
|
1103
|
+
// @ts-ignore
|
|
1104
|
+
const t = this.__v_raw || this;
|
|
1105
|
+
// @ts-ignore
|
|
1106
|
+
const n = module.__v_raw || module;
|
|
1107
|
+
if (Array.isArray((t as any)[parentKey])) {
|
|
1108
|
+
// @ts-ignore
|
|
1109
|
+
const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
|
|
1084
1110
|
~index && (this as any)[parentKey].splice(index, 1);
|
|
1085
1111
|
params.index = index;
|
|
1086
|
-
} else if ((
|
|
1112
|
+
} else if ((t as any)[parentKey] === n) {
|
|
1087
1113
|
params.index = 0;
|
|
1088
1114
|
(this as any)[parentKey] = undefined;
|
|
1089
1115
|
}
|
|
@@ -34,6 +34,7 @@ export class Function extends BaseNode {
|
|
|
34
34
|
/**
|
|
35
35
|
* 产品概念
|
|
36
36
|
*/
|
|
37
|
+
@property('concept')
|
|
37
38
|
// @ts-ignore
|
|
38
39
|
readonly concept!: 'Function';
|
|
39
40
|
|
|
@@ -161,7 +162,7 @@ export class Function extends BaseNode {
|
|
|
161
162
|
|
|
162
163
|
getTypeParamExistingNames(excludedList: Array<TypeParam> = []) {
|
|
163
164
|
const excludedSet = new Set(excludedList);
|
|
164
|
-
return ((this.typeParams as TypeParam[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item
|
|
165
|
+
return ((this.typeParams as TypeParam[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item?.name);
|
|
165
166
|
}
|
|
166
167
|
getTypeParamUniqueName(name = 'typeParam1') {
|
|
167
168
|
return utils.unique(name, this.getTypeParamExistingNames(), undefined, false);
|
|
@@ -795,11 +796,16 @@ export class Function extends BaseNode {
|
|
|
795
796
|
};
|
|
796
797
|
if (parentKey) {
|
|
797
798
|
params.parentKey = parentKey;
|
|
798
|
-
|
|
799
|
-
|
|
799
|
+
// @ts-ignore
|
|
800
|
+
const t = this.__v_raw || this;
|
|
801
|
+
// @ts-ignore
|
|
802
|
+
const n = typeParam.__v_raw || typeParam;
|
|
803
|
+
if (Array.isArray((t as any)[parentKey])) {
|
|
804
|
+
// @ts-ignore
|
|
805
|
+
const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
|
|
800
806
|
~index && (this as any)[parentKey].splice(index, 1);
|
|
801
807
|
params.index = index;
|
|
802
|
-
} else if ((
|
|
808
|
+
} else if ((t as any)[parentKey] === n) {
|
|
803
809
|
params.index = 0;
|
|
804
810
|
(this as any)[parentKey] = undefined;
|
|
805
811
|
}
|
|
@@ -843,11 +849,16 @@ export class Function extends BaseNode {
|
|
|
843
849
|
};
|
|
844
850
|
if (parentKey) {
|
|
845
851
|
params.parentKey = parentKey;
|
|
846
|
-
|
|
847
|
-
|
|
852
|
+
// @ts-ignore
|
|
853
|
+
const t = this.__v_raw || this;
|
|
854
|
+
// @ts-ignore
|
|
855
|
+
const n = param.__v_raw || param;
|
|
856
|
+
if (Array.isArray((t as any)[parentKey])) {
|
|
857
|
+
// @ts-ignore
|
|
858
|
+
const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
|
|
848
859
|
~index && (this as any)[parentKey].splice(index, 1);
|
|
849
860
|
params.index = index;
|
|
850
|
-
} else if ((
|
|
861
|
+
} else if ((t as any)[parentKey] === n) {
|
|
851
862
|
params.index = 0;
|
|
852
863
|
(this as any)[parentKey] = undefined;
|
|
853
864
|
}
|
|
@@ -891,11 +902,16 @@ export class Function extends BaseNode {
|
|
|
891
902
|
};
|
|
892
903
|
if (parentKey) {
|
|
893
904
|
params.parentKey = parentKey;
|
|
894
|
-
|
|
895
|
-
|
|
905
|
+
// @ts-ignore
|
|
906
|
+
const t = this.__v_raw || this;
|
|
907
|
+
// @ts-ignore
|
|
908
|
+
const n = ret.__v_raw || ret;
|
|
909
|
+
if (Array.isArray((t as any)[parentKey])) {
|
|
910
|
+
// @ts-ignore
|
|
911
|
+
const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
|
|
896
912
|
~index && (this as any)[parentKey].splice(index, 1);
|
|
897
913
|
params.index = index;
|
|
898
|
-
} else if ((
|
|
914
|
+
} else if ((t as any)[parentKey] === n) {
|
|
899
915
|
params.index = 0;
|
|
900
916
|
(this as any)[parentKey] = undefined;
|
|
901
917
|
}
|
|
@@ -939,11 +955,16 @@ export class Function extends BaseNode {
|
|
|
939
955
|
};
|
|
940
956
|
if (parentKey) {
|
|
941
957
|
params.parentKey = parentKey;
|
|
942
|
-
|
|
943
|
-
|
|
958
|
+
// @ts-ignore
|
|
959
|
+
const t = this.__v_raw || this;
|
|
960
|
+
// @ts-ignore
|
|
961
|
+
const n = variable.__v_raw || variable;
|
|
962
|
+
if (Array.isArray((t as any)[parentKey])) {
|
|
963
|
+
// @ts-ignore
|
|
964
|
+
const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
|
|
944
965
|
~index && (this as any)[parentKey].splice(index, 1);
|
|
945
966
|
params.index = index;
|
|
946
|
-
} else if ((
|
|
967
|
+
} else if ((t as any)[parentKey] === n) {
|
|
947
968
|
params.index = 0;
|
|
948
969
|
(this as any)[parentKey] = undefined;
|
|
949
970
|
}
|
|
@@ -987,11 +1008,16 @@ export class Function extends BaseNode {
|
|
|
987
1008
|
};
|
|
988
1009
|
if (parentKey) {
|
|
989
1010
|
params.parentKey = parentKey;
|
|
990
|
-
|
|
991
|
-
|
|
1011
|
+
// @ts-ignore
|
|
1012
|
+
const t = this.__v_raw || this;
|
|
1013
|
+
// @ts-ignore
|
|
1014
|
+
const n = logicItem.__v_raw || logicItem;
|
|
1015
|
+
if (Array.isArray((t as any)[parentKey])) {
|
|
1016
|
+
// @ts-ignore
|
|
1017
|
+
const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
|
|
992
1018
|
~index && (this as any)[parentKey].splice(index, 1);
|
|
993
1019
|
params.index = index;
|
|
994
|
-
} else if ((
|
|
1020
|
+
} else if ((t as any)[parentKey] === n) {
|
|
995
1021
|
params.index = 0;
|
|
996
1022
|
(this as any)[parentKey] = undefined;
|
|
997
1023
|
}
|
|
@@ -1083,8 +1109,7 @@ export class Function extends BaseNode {
|
|
|
1083
1109
|
code += `(`;
|
|
1084
1110
|
this.params.forEach((param, index) => {
|
|
1085
1111
|
code += param.toNaturalTS(shiftState(state, code, { inline: true }));
|
|
1086
|
-
if (index !== this.params.length - 1)
|
|
1087
|
-
code += ', ';
|
|
1112
|
+
if (index !== this.params.length - 1) code += ', ';
|
|
1088
1113
|
});
|
|
1089
1114
|
code += `)`;
|
|
1090
1115
|
if (this.returns.length) {
|
|
@@ -1094,7 +1119,9 @@ export class Function extends BaseNode {
|
|
|
1094
1119
|
code += ` => (`;
|
|
1095
1120
|
|
|
1096
1121
|
if (this.returnExpression) {
|
|
1097
|
-
code +=
|
|
1122
|
+
code +=
|
|
1123
|
+
this.returnExpression.toNaturalTS &&
|
|
1124
|
+
this.returnExpression.toNaturalTS(shiftState(state, code, { tabSize: state.tabSize + 1, inline: true }));
|
|
1098
1125
|
}
|
|
1099
1126
|
code += `${indent(state.tabSize)})`;
|
|
1100
1127
|
} else {
|