slnodejs 6.1.2 → 6.1.10
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/browser-agent/dist/browser-agent-all.js +101189 -0
- package/browser-agent/dist/browser-agent-all.min.js +57 -0
- package/browser-agent/package.json +44 -0
- package/lib/cli.js +1 -1
- package/package.json +125 -124
- package/tsOutputs/api.d.ts +10 -12
- package/tsOutputs/api.js +115 -116
- package/tsOutputs/build-scanner/ast-utils.js +38 -38
- package/tsOutputs/build-scanner/ast-utils.js.map +1 -1
- package/tsOutputs/build-scanner/build-diff-process.js +352 -352
- package/tsOutputs/build-scanner/cia.js +95 -95
- package/tsOutputs/build-scanner/configuration-loader.js +17 -17
- package/tsOutputs/build-scanner/current-agent-instance.js +5 -5
- package/tsOutputs/build-scanner/default-values-resolver.js +42 -42
- package/tsOutputs/build-scanner/entities-mapper.js +35 -35
- package/tsOutputs/build-scanner/file-and-folder-utils.js +176 -176
- package/tsOutputs/build-scanner/file-system/actual-file.js +66 -66
- package/tsOutputs/build-scanner/file-system/actual-file.js.map +1 -1
- package/tsOutputs/build-scanner/git-format-builder.js +68 -68
- package/tsOutputs/build-scanner/global-error-handler.js +20 -20
- package/tsOutputs/build-scanner/instrumentation/browser-instrumenter.js +299 -299
- package/tsOutputs/build-scanner/instrumentation/file-instrumenter.js +271 -271
- package/tsOutputs/build-scanner/instrumentation/file-instrumenter.js.map +1 -1
- package/tsOutputs/build-scanner/instrumentation/instrumentation-utils.js +58 -58
- package/tsOutputs/build-scanner/instrumentation/instrumented-file-size-reducer.js +159 -159
- package/tsOutputs/build-scanner/instrumentation/markup-file-instrumenter.js +187 -185
- package/tsOutputs/build-scanner/instrumentation/markup-file-instrumenter.js.map +1 -1
- package/tsOutputs/build-scanner/instrumentation/sync-instrumenter.js +39 -39
- package/tsOutputs/build-scanner/js_diff/ast-node-types.js +44 -44
- package/tsOutputs/build-scanner/js_diff/branch-key.js +10 -10
- package/tsOutputs/build-scanner/js_diff/branch-signature.js +156 -156
- package/tsOutputs/build-scanner/js_diff/create-node-key.js +7 -7
- package/tsOutputs/build-scanner/js_diff/dry-run-files-mapping.js +23 -23
- package/tsOutputs/build-scanner/js_diff/file-signature.js +234 -234
- package/tsOutputs/build-scanner/js_diff/files-mapping.js +456 -460
- package/tsOutputs/build-scanner/js_diff/files-mapping.js.map +1 -1
- package/tsOutputs/build-scanner/js_diff/generated-file-signature.js +143 -143
- package/tsOutputs/build-scanner/js_diff/globalMethodIndexer.js +26 -26
- package/tsOutputs/build-scanner/js_diff/guess-method-location.js +100 -100
- package/tsOutputs/build-scanner/js_diff/guess-method-name.js +54 -54
- package/tsOutputs/build-scanner/js_diff/method-signature.js +142 -142
- package/tsOutputs/build-scanner/js_diff/sl-mapper.js +136 -136
- package/tsOutputs/build-scanner/js_diff/source-data-enricher.js +89 -89
- package/tsOutputs/build-scanner/js_diff/source-files-notifier.js +31 -31
- package/tsOutputs/build-scanner/js_diff/source-position-mapper.js +29 -29
- package/tsOutputs/build-scanner/mappings/ensure-files-handler.service.js +213 -213
- package/tsOutputs/build-scanner/mappings/ensure-files-handler.service.js.map +1 -1
- package/tsOutputs/build-scanner/mappings/file-element-utils.js +46 -46
- package/tsOutputs/build-scanner/mappings/file-element-utils.js.map +1 -1
- package/tsOutputs/build-scanner/mappings/file-enricher.js +209 -204
- package/tsOutputs/build-scanner/mappings/file-enricher.js.map +1 -1
- package/tsOutputs/build-scanner/mappings/files-data-container.js +51 -51
- package/tsOutputs/build-scanner/mappings/files-data-container.js.map +1 -1
- package/tsOutputs/build-scanner/mappings/scm-file-fixer.js +79 -77
- package/tsOutputs/build-scanner/mappings/scm-file-fixer.js.map +1 -1
- package/tsOutputs/build-scanner/markup-files-parser.js +71 -71
- package/tsOutputs/build-scanner/nopt-types.js +19 -19
- package/tsOutputs/build-scanner/nopt-usage-2.js +56 -56
- package/tsOutputs/build-scanner/polyfills.js +6 -6
- package/tsOutputs/build-scanner/scm/parse-log.js +5 -5
- package/tsOutputs/build-scanner/scm/scm-files-container.js +49 -49
- package/tsOutputs/build-scanner/sl-config-cia-cli.js +175 -175
- package/tsOutputs/build-scanner/utils.js +91 -91
- package/tsOutputs/cli-parse/agent-instance-data.d.ts +2 -2
- package/tsOutputs/cli-parse/agent-instance-data.js +6 -6
- package/tsOutputs/cli-parse/child-process-wrapper.js +82 -82
- package/tsOutputs/cli-parse/child-process-wrapper.js.map +1 -1
- package/tsOutputs/cli-parse/cli.js +509 -509
- package/tsOutputs/cli-parse/constants/constants.js +56 -55
- package/tsOutputs/cli-parse/constants/constants.js.map +1 -1
- package/tsOutputs/cli-parse/constants/third-parties.js +10 -10
- package/tsOutputs/cli-parse/contracts.js +2 -2
- package/tsOutputs/cli-parse/custom-commander.js +44 -44
- package/tsOutputs/cli-parse/executors/base-executor.js +254 -263
- package/tsOutputs/cli-parse/executors/base-executor.js.map +1 -1
- package/tsOutputs/cli-parse/executors/build-args-dto.js +55 -55
- package/tsOutputs/cli-parse/executors/build-end-executor.js +117 -115
- package/tsOutputs/cli-parse/executors/build-end-executor.js.map +1 -1
- package/tsOutputs/cli-parse/executors/build-executor.js +149 -147
- package/tsOutputs/cli-parse/executors/build-executor.js.map +1 -1
- package/tsOutputs/cli-parse/executors/config-executor.js +114 -112
- package/tsOutputs/cli-parse/executors/config-executor.js.map +1 -1
- package/tsOutputs/cli-parse/executors/dry-run/base-data.js +55 -55
- package/tsOutputs/cli-parse/executors/dry-run/base-data.js.map +1 -1
- package/tsOutputs/cli-parse/executors/dry-run/build-mapping-data.js +230 -228
- package/tsOutputs/cli-parse/executors/dry-run/build-mapping-data.js.map +1 -1
- package/tsOutputs/cli-parse/executors/dry-run/dry-run-executor.js +279 -277
- package/tsOutputs/cli-parse/executors/dry-run/dry-run-executor.js.map +1 -1
- package/tsOutputs/cli-parse/executors/dry-run/dry-run-validation.js +122 -120
- package/tsOutputs/cli-parse/executors/dry-run/dry-run-validation.js.map +1 -1
- package/tsOutputs/cli-parse/executors/dry-run/footprints-data.js +132 -130
- package/tsOutputs/cli-parse/executors/dry-run/footprints-data.js.map +1 -1
- package/tsOutputs/cli-parse/executors/dry-run/helper-methods.js +104 -104
- package/tsOutputs/cli-parse/executors/dry-run/helper-methods.js.map +1 -1
- package/tsOutputs/cli-parse/executors/end-execution-executor.js +90 -88
- package/tsOutputs/cli-parse/executors/end-execution-executor.js.map +1 -1
- package/tsOutputs/cli-parse/executors/integration-build-components-executor.js +134 -132
- package/tsOutputs/cli-parse/executors/integration-build-components-executor.js.map +1 -1
- package/tsOutputs/cli-parse/executors/integration-build-delete-components-executor.js +75 -73
- package/tsOutputs/cli-parse/executors/integration-build-delete-components-executor.js.map +1 -1
- package/tsOutputs/cli-parse/executors/integration-build-update-components-executor.js +73 -71
- package/tsOutputs/cli-parse/executors/integration-build-update-components-executor.js.map +1 -1
- package/tsOutputs/cli-parse/executors/mocha-executor.js +124 -122
- package/tsOutputs/cli-parse/executors/mocha-executor.js.map +1 -1
- package/tsOutputs/cli-parse/executors/nyc-report-executor.js +106 -104
- package/tsOutputs/cli-parse/executors/nyc-report-executor.js.map +1 -1
- package/tsOutputs/cli-parse/executors/pr-config-executor.js +85 -83
- package/tsOutputs/cli-parse/executors/pr-config-executor.js.map +1 -1
- package/tsOutputs/cli-parse/executors/run-executor.js +95 -93
- package/tsOutputs/cli-parse/executors/run-executor.js.map +1 -1
- package/tsOutputs/cli-parse/executors/start-execution-executor.js +93 -91
- package/tsOutputs/cli-parse/executors/start-execution-executor.js.map +1 -1
- package/tsOutputs/cli-parse/executors/test-executions-executor.js +77 -75
- package/tsOutputs/cli-parse/executors/test-executions-executor.js.map +1 -1
- package/tsOutputs/cli-parse/executors/test-listener-executor.js +151 -149
- package/tsOutputs/cli-parse/executors/test-listener-executor.js.map +1 -1
- package/tsOutputs/cli-parse/executors/test-runner-build-session-data-builder.js +77 -75
- package/tsOutputs/cli-parse/executors/test-runner-build-session-data-builder.js.map +1 -1
- package/tsOutputs/cli-parse/executors/upload-report-executor.js +118 -116
- package/tsOutputs/cli-parse/executors/upload-report-executor.js.map +1 -1
- package/tsOutputs/cli-parse/utils.js +32 -32
- package/tsOutputs/cli-parse/utils.js.map +1 -1
- package/tsOutputs/common/agent-events/agent-events-conracts.d.ts +123 -123
- package/tsOutputs/common/agent-events/agent-events-conracts.js +56 -56
- package/tsOutputs/common/agent-events/agent-events-controller.d.ts +45 -45
- package/tsOutputs/common/agent-events/agent-events-controller.js +301 -301
- package/tsOutputs/common/agent-events/agent-events-controller.js.map +1 -1
- package/tsOutputs/common/agent-events/agent-instance-info-builder.d.ts +22 -22
- package/tsOutputs/common/agent-events/agent-instance-info-builder.js +63 -63
- package/tsOutputs/common/agent-events/agent-instance-info-builder.js.map +1 -1
- package/tsOutputs/common/agent-events/agent-start-info-builder.d.ts +14 -14
- package/tsOutputs/common/agent-events/agent-start-info-builder.js +23 -23
- package/tsOutputs/common/agent-events/ci-info-builder.d.ts +7 -7
- package/tsOutputs/common/agent-events/ci-info-builder.js +30 -30
- package/tsOutputs/common/agent-events/cockpit-notifier.d.ts +26 -26
- package/tsOutputs/common/agent-events/cockpit-notifier.js +119 -119
- package/tsOutputs/common/agent-events/dry-run-agent-events-controller.d.ts +7 -7
- package/tsOutputs/common/agent-events/dry-run-agent-events-controller.js +33 -31
- package/tsOutputs/common/agent-events/dry-run-agent-events-controller.js.map +1 -1
- package/tsOutputs/common/agent-events/machine-info-builder.d.ts +7 -7
- package/tsOutputs/common/agent-events/machine-info-builder.js +35 -35
- package/tsOutputs/common/agent-events/machine-info-builder.js.map +1 -1
- package/tsOutputs/common/agent-events/nodejs-env-info-builder.d.ts +8 -8
- package/tsOutputs/common/agent-events/nodejs-env-info-builder.js +19 -19
- package/tsOutputs/common/agent-events/sensitive-data-filter.d.ts +2 -2
- package/tsOutputs/common/agent-events/sensitive-data-filter.js +54 -54
- package/tsOutputs/common/agent-instance-data.d.ts +10 -10
- package/tsOutputs/common/agent-instance-data.js +39 -39
- package/tsOutputs/common/agent-instance-data.js.map +1 -1
- package/tsOutputs/common/config-process/config-loader.d.ts +8 -8
- package/tsOutputs/common/config-process/config-loader.js +86 -86
- package/tsOutputs/common/config-process/config-system.d.ts +88 -88
- package/tsOutputs/common/config-process/config-system.js +293 -293
- package/tsOutputs/common/config-process/config.d.ts +60 -60
- package/tsOutputs/common/config-process/config.js +92 -90
- package/tsOutputs/common/config-process/config.js.map +1 -1
- package/tsOutputs/common/config-process/index.d.ts +21 -21
- package/tsOutputs/common/config-process/index.js +127 -125
- package/tsOutputs/common/config-process/index.js.map +1 -1
- package/tsOutputs/common/constants/constants.d.ts +18 -18
- package/tsOutputs/common/constants/constants.js +29 -29
- package/tsOutputs/common/constants/sl-env-vars.d.ts +52 -52
- package/tsOutputs/common/constants/sl-env-vars.js +122 -122
- package/tsOutputs/common/contracts.d.ts +123 -123
- package/tsOutputs/common/contracts.js +2 -2
- package/tsOutputs/common/coverage-elements/contracts.d.ts +25 -25
- package/tsOutputs/common/coverage-elements/contracts.js +8 -8
- package/tsOutputs/common/coverage-elements/file-element.d.ts +35 -35
- package/tsOutputs/common/coverage-elements/file-element.js +158 -158
- package/tsOutputs/common/coverage-elements/istanbul-unique-id-converter.d.ts +12 -12
- package/tsOutputs/common/coverage-elements/istanbul-unique-id-converter.js +97 -95
- package/tsOutputs/common/coverage-elements/istanbul-unique-id-converter.js.map +1 -1
- package/tsOutputs/common/coverage-elements/new-id-resolver.d.ts +3 -3
- package/tsOutputs/common/coverage-elements/new-id-resolver.js +45 -45
- package/tsOutputs/common/coverage-elements/new-id-resolver.js.map +1 -1
- package/tsOutputs/common/coverage-elements/original-module-loader.d.ts +41 -41
- package/tsOutputs/common/coverage-elements/original-module-loader.js +189 -189
- package/tsOutputs/common/coverage-elements/unique-id-converter.d.ts +32 -32
- package/tsOutputs/common/coverage-elements/unique-id-converter.js +234 -234
- package/tsOutputs/common/environment-data-service.d.ts +15 -15
- package/tsOutputs/common/environment-data-service.js +60 -60
- package/tsOutputs/common/events-process/events-contracts.d.ts +52 -52
- package/tsOutputs/common/events-process/events-contracts.js +19 -19
- package/tsOutputs/common/events-process/events-creator.js +40 -42
- package/tsOutputs/common/events-process/events-creator.js.map +1 -1
- package/tsOutputs/common/events-process/index.d.ts +42 -42
- package/tsOutputs/common/events-process/index.js +266 -265
- package/tsOutputs/common/events-process/index.js.map +1 -1
- package/tsOutputs/common/footprints-process/collection-interval.d.ts +10 -10
- package/tsOutputs/common/footprints-process/collection-interval.js +27 -27
- package/tsOutputs/common/footprints-process/collection-interval.js.map +1 -1
- package/tsOutputs/common/footprints-process/footprints-service-proxy.d.ts +12 -12
- package/tsOutputs/common/footprints-process/footprints-service-proxy.js +51 -51
- package/tsOutputs/common/footprints-process/index.d.ts +71 -71
- package/tsOutputs/common/footprints-process/index.js +264 -264
- package/tsOutputs/common/footprints-process/index.js.map +1 -1
- package/tsOutputs/common/footprints-process/istanbul-to-footprints-contract.d.ts +98 -98
- package/tsOutputs/common/footprints-process/istanbul-to-footprints-contract.js +9 -9
- package/tsOutputs/common/footprints-process/istanbul-to-footprints.d.ts +47 -47
- package/tsOutputs/common/footprints-process/istanbul-to-footprints.js +421 -421
- package/tsOutputs/common/footprints-process/istanbul-to-footprints.js.map +1 -1
- package/tsOutputs/common/footprints-process/production-footprints-handler.d.ts +54 -54
- package/tsOutputs/common/footprints-process/production-footprints-handler.js +308 -308
- package/tsOutputs/common/footprints-process/production-footprints-handler.js.map +1 -1
- package/tsOutputs/common/footprints-process-v6/base-browser-hits-converter.d.ts +20 -20
- package/tsOutputs/common/footprints-process-v6/base-browser-hits-converter.js +65 -63
- package/tsOutputs/common/footprints-process-v6/base-browser-hits-converter.js.map +1 -1
- package/tsOutputs/common/footprints-process-v6/buffer-size-helper.d.ts +15 -15
- package/tsOutputs/common/footprints-process-v6/buffer-size-helper.js +40 -40
- package/tsOutputs/common/footprints-process-v6/contracts.d.ts +181 -184
- package/tsOutputs/common/footprints-process-v6/contracts.js +9 -9
- package/tsOutputs/common/footprints-process-v6/footprints-buffer.d.ts +34 -36
- package/tsOutputs/common/footprints-process-v6/footprints-buffer.js +135 -147
- package/tsOutputs/common/footprints-process-v6/footprints-buffer.js.map +1 -1
- package/tsOutputs/common/footprints-process-v6/hits-collector.d.ts +24 -24
- package/tsOutputs/common/footprints-process-v6/hits-collector.js +168 -168
- package/tsOutputs/common/footprints-process-v6/hits-converter.d.ts +28 -30
- package/tsOutputs/common/footprints-process-v6/hits-converter.js +114 -135
- package/tsOutputs/common/footprints-process-v6/hits-converter.js.map +1 -1
- package/tsOutputs/common/footprints-process-v6/index.d.ts +40 -41
- package/tsOutputs/common/footprints-process-v6/index.js +258 -304
- package/tsOutputs/common/footprints-process-v6/index.js.map +1 -1
- package/tsOutputs/common/footprints-process-v6/location-formatter.d.ts +6 -6
- package/tsOutputs/common/footprints-process-v6/location-formatter.js +25 -25
- package/tsOutputs/common/footprints-process-v6/relative-path-resolver.d.ts +8 -8
- package/tsOutputs/common/footprints-process-v6/relative-path-resolver.js +28 -28
- package/tsOutputs/common/footprints-process-v6/remote-browser-hits-converter.d.ts +9 -9
- package/tsOutputs/common/footprints-process-v6/remote-browser-hits-converter.js +40 -38
- package/tsOutputs/common/footprints-process-v6/remote-browser-hits-converter.js.map +1 -1
- package/tsOutputs/common/footprints-process-v6/remote-footprints-process.d.ts +8 -8
- package/tsOutputs/common/footprints-process-v6/remote-footprints-process.js +34 -32
- package/tsOutputs/common/footprints-process-v6/remote-footprints-process.js.map +1 -1
- package/tsOutputs/common/footprints-process-v6/remote-hits-collector.d.ts +14 -14
- package/tsOutputs/common/footprints-process-v6/remote-hits-collector.js +41 -39
- package/tsOutputs/common/footprints-process-v6/remote-hits-collector.js.map +1 -1
- package/tsOutputs/common/footprints-process-v6/source-map-data.d.ts +9 -9
- package/tsOutputs/common/footprints-process-v6/source-map-data.js +32 -32
- package/tsOutputs/common/footprints-process-v6/source-map-data.js.map +1 -1
- package/tsOutputs/common/http/backend-proxy-interface.d.ts +33 -33
- package/tsOutputs/common/http/backend-proxy-interface.js +2 -2
- package/tsOutputs/common/http/backend-proxy.d.ts +54 -54
- package/tsOutputs/common/http/backend-proxy.js +408 -408
- package/tsOutputs/common/http/contracts.d.ts +280 -280
- package/tsOutputs/common/http/contracts.js +158 -156
- package/tsOutputs/common/http/contracts.js.map +1 -1
- package/tsOutputs/common/http/dry-run-proxy.js +106 -106
- package/tsOutputs/common/http/entities-mapper.d.ts +4 -4
- package/tsOutputs/common/http/entities-mapper.js +17 -17
- package/tsOutputs/common/http/http-client.d.ts +21 -21
- package/tsOutputs/common/http/http-client.js +191 -195
- package/tsOutputs/common/http/http-client.js.map +1 -1
- package/tsOutputs/common/http/http-verb.d.ts +6 -6
- package/tsOutputs/common/http/http-verb.js +10 -10
- package/tsOutputs/common/http/sl-routes.d.ts +70 -70
- package/tsOutputs/common/http/sl-routes.js +218 -218
- package/tsOutputs/common/ignored-files-handler.js +122 -122
- package/tsOutputs/common/ignored-files-handler.js.map +1 -1
- package/tsOutputs/common/logger.d.ts +40 -40
- package/tsOutputs/common/logger.js +190 -188
- package/tsOutputs/common/logger.js.map +1 -1
- package/tsOutputs/common/messages-formatter.d.ts +6 -6
- package/tsOutputs/common/messages-formatter.js +21 -21
- package/tsOutputs/common/queue.d.ts +19 -19
- package/tsOutputs/common/queue.js +57 -55
- package/tsOutputs/common/queue.js.map +1 -1
- package/tsOutputs/common/scm/contracts.js +2 -2
- package/tsOutputs/common/scm/git-cloner.js +137 -137
- package/tsOutputs/common/scm/git-cloner.js.map +1 -1
- package/tsOutputs/common/scm/git-format-builder.js +72 -72
- package/tsOutputs/common/scm/git.js +411 -411
- package/tsOutputs/common/scm/git.js.map +1 -1
- package/tsOutputs/common/scm/none.js +115 -115
- package/tsOutputs/common/scm/scm-factory.js +21 -21
- package/tsOutputs/common/short-name-to-file-mapper.js +79 -79
- package/tsOutputs/common/source-map-handler.d.ts +58 -58
- package/tsOutputs/common/source-map-handler.js +197 -197
- package/tsOutputs/common/source-map-reader.js +84 -84
- package/tsOutputs/common/source-maps-utils.d.ts +3 -3
- package/tsOutputs/common/source-maps-utils.js +39 -39
- package/tsOutputs/common/state-tracker-fpv6.d.ts +6 -6
- package/tsOutputs/common/state-tracker-fpv6.js +44 -42
- package/tsOutputs/common/state-tracker-fpv6.js.map +1 -1
- package/tsOutputs/common/state-tracker.d.ts +49 -49
- package/tsOutputs/common/state-tracker.js +301 -299
- package/tsOutputs/common/state-tracker.js.map +1 -1
- package/tsOutputs/common/system-date.d.ts +2 -2
- package/tsOutputs/common/system-date.js +21 -21
- package/tsOutputs/common/utils/abstract-data-builder.d.ts +10 -10
- package/tsOutputs/common/utils/abstract-data-builder.js +24 -24
- package/tsOutputs/common/utils/abstract-data-builder.js.map +1 -1
- package/tsOutputs/common/utils/build-session-data-builder.d.ts +18 -18
- package/tsOutputs/common/utils/build-session-data-builder.js +137 -135
- package/tsOutputs/common/utils/build-session-data-builder.js.map +1 -1
- package/tsOutputs/common/utils/dependency-utils.js +69 -69
- package/tsOutputs/common/utils/files-utils.d.ts +6 -6
- package/tsOutputs/common/utils/files-utils.js +45 -45
- package/tsOutputs/common/utils/parsing-utils.d.ts +4 -4
- package/tsOutputs/common/utils/parsing-utils.js +29 -29
- package/tsOutputs/common/utils/test-utils/mock-server-utils/contracts.js +10 -10
- package/tsOutputs/common/utils/test-utils/mock-server-utils/mock-server-proxy.js +248 -248
- package/tsOutputs/common/utils/timer-utils.d.ts +3 -3
- package/tsOutputs/common/utils/timer-utils.js +12 -12
- package/tsOutputs/common/utils/token-data-builder.d.ts +21 -21
- package/tsOutputs/common/utils/token-data-builder.js +97 -95
- package/tsOutputs/common/utils/token-data-builder.js.map +1 -1
- package/tsOutputs/common/utils/validation-utils.d.ts +3 -3
- package/tsOutputs/common/utils/validation-utils.js +18 -18
- package/tsOutputs/common/uuid.js +23 -23
- package/tsOutputs/common/watchdog.d.ts +96 -96
- package/tsOutputs/common/watchdog.js +151 -149
- package/tsOutputs/common/watchdog.js.map +1 -1
- package/tsOutputs/mocha-reporter/constants.js +27 -27
- package/tsOutputs/mocha-reporter/end-execution.js +22 -22
- package/tsOutputs/mocha-reporter/index.js +323 -323
- package/tsOutputs/test-listener/IConsoleLogger.js +5 -5
- package/tsOutputs/test-listener/SlNodeJsProxy.js +96 -96
- package/tsOutputs/test-listener/UserMessageHelper.js +47 -47
- package/tsOutputs/test-listener/agent-loader.js +58 -58
- package/tsOutputs/test-listener/agent.d.ts +53 -53
- package/tsOutputs/test-listener/agent.js +273 -273
- package/tsOutputs/test-listener/agent.js.map +1 -1
- package/tsOutputs/test-listener/api.js +157 -157
- package/tsOutputs/test-listener/base-proxy.d.ts +15 -15
- package/tsOutputs/test-listener/base-proxy.js +133 -133
- package/tsOutputs/test-listener/bootstrap.js +16 -16
- package/tsOutputs/test-listener/child-process-patcher.js +136 -136
- package/tsOutputs/test-listener/child-process-patcher.js.map +1 -1
- package/tsOutputs/test-listener/cli.js +64 -64
- package/tsOutputs/test-listener/coloring/http-coloring.d.ts +15 -15
- package/tsOutputs/test-listener/coloring/http-coloring.js +188 -188
- package/tsOutputs/test-listener/coloring/icoloring-provider.d.ts +10 -10
- package/tsOutputs/test-listener/coloring/icoloring-provider.js +2 -2
- package/tsOutputs/test-listener/coloring/listening-port.d.ts +20 -20
- package/tsOutputs/test-listener/coloring/listening-port.js +48 -48
- package/tsOutputs/test-listener/command-line-arg-parser.js +91 -91
- package/tsOutputs/test-listener/config-process/config-loader.js +104 -104
- package/tsOutputs/test-listener/config-process/config-system.d.ts +88 -88
- package/tsOutputs/test-listener/config-process/config-system.js +285 -285
- package/tsOutputs/test-listener/config-process/index.js +128 -126
- package/tsOutputs/test-listener/config-process/index.js.map +1 -1
- package/tsOutputs/test-listener/config.d.ts +50 -50
- package/tsOutputs/test-listener/config.js +82 -80
- package/tsOutputs/test-listener/config.js.map +1 -1
- package/tsOutputs/test-listener/contracts.d.ts +72 -72
- package/tsOutputs/test-listener/contracts.js +2 -2
- package/tsOutputs/test-listener/entities/BasicConfigurationData.js +72 -72
- package/tsOutputs/test-listener/entities/build-scanner/ConfigModeData.js +50 -48
- package/tsOutputs/test-listener/entities/build-scanner/ConfigModeData.js.map +1 -1
- package/tsOutputs/test-listener/entities/build-scanner/ScanModeData.js +53 -51
- package/tsOutputs/test-listener/entities/build-scanner/ScanModeData.js.map +1 -1
- package/tsOutputs/test-listener/environment-data-service.d.ts +11 -11
- package/tsOutputs/test-listener/environment-data-service.js +60 -60
- package/tsOutputs/test-listener/execution-process/contracts.js +5 -5
- package/tsOutputs/test-listener/execution-process/entities-mapper.js +49 -49
- package/tsOutputs/test-listener/execution-process/execution-service-proxy.js +207 -205
- package/tsOutputs/test-listener/execution-process/execution-service-proxy.js.map +1 -1
- package/tsOutputs/test-listener/execution-process/index.js +163 -163
- package/tsOutputs/test-listener/factory.d.ts +87 -87
- package/tsOutputs/test-listener/factory.js +285 -285
- package/tsOutputs/test-listener/footprints-process/footprints-service-proxy.js +52 -50
- package/tsOutputs/test-listener/footprints-process/footprints-service-proxy.js.map +1 -1
- package/tsOutputs/test-listener/footprints-process/index.js +230 -230
- package/tsOutputs/test-listener/footprints-process/index.js.map +1 -1
- package/tsOutputs/test-listener/footprints-process/istanbul-to-footprints-base.js +130 -130
- package/tsOutputs/test-listener/footprints-process/istanbul-to-footprints-contract.js +2 -2
- package/tsOutputs/test-listener/footprints-process/istanbul-to-footprints-v3.js +290 -288
- package/tsOutputs/test-listener/footprints-process/istanbul-to-footprints-v3.js.map +1 -1
- package/tsOutputs/test-listener/integrations/SlGulp.js +104 -104
- package/tsOutputs/test-listener/logs-process/index.d.ts +48 -48
- package/tsOutputs/test-listener/logs-process/index.js +142 -142
- package/tsOutputs/test-listener/logs-process/index.js.map +1 -1
- package/tsOutputs/test-listener/logs-process/log-service-proxy.d.ts +9 -9
- package/tsOutputs/test-listener/logs-process/log-service-proxy.js +31 -29
- package/tsOutputs/test-listener/logs-process/log-service-proxy.js.map +1 -1
- package/tsOutputs/test-listener/nyc-report-executor-fpv6.js +143 -143
- package/tsOutputs/test-listener/nyc-report-executor-fpv6.js.map +1 -1
- package/tsOutputs/test-listener/nyc-report-executor.js +144 -144
- package/tsOutputs/test-listener/nyc-report-executor.js.map +1 -1
- package/tsOutputs/test-listener/queue.js +57 -55
- package/tsOutputs/test-listener/queue.js.map +1 -1
- package/tsOutputs/test-listener/remote-agent.d.ts +42 -42
- package/tsOutputs/test-listener/remote-agent.js +200 -200
- package/tsOutputs/test-listener/remote-agent.js.map +1 -1
- package/tsOutputs/test-listener/resolvers/AppNameResolver.js +34 -32
- package/tsOutputs/test-listener/resolvers/AppNameResolver.js.map +1 -1
- package/tsOutputs/test-listener/resolvers/ArgumentResolver.js +64 -64
- package/tsOutputs/test-listener/resolvers/ArgumentResolver.js.map +1 -1
- package/tsOutputs/test-listener/resolvers/BuildResolver.js +33 -31
- package/tsOutputs/test-listener/resolvers/BuildResolver.js.map +1 -1
- package/tsOutputs/test-listener/resolvers/BuildSessionIdFileResolver.js +33 -31
- package/tsOutputs/test-listener/resolvers/BuildSessionIdFileResolver.js.map +1 -1
- package/tsOutputs/test-listener/resolvers/BuildSessionIdResolver.js +36 -34
- package/tsOutputs/test-listener/resolvers/BuildSessionIdResolver.js.map +1 -1
- package/tsOutputs/test-listener/resolvers/ProxyResolver.js +33 -31
- package/tsOutputs/test-listener/resolvers/ProxyResolver.js.map +1 -1
- package/tsOutputs/test-listener/resolvers/TokenResolver.js +33 -31
- package/tsOutputs/test-listener/resolvers/TokenResolver.js.map +1 -1
- package/tsOutputs/test-listener/state-tracker-process/index.js +162 -160
- package/tsOutputs/test-listener/state-tracker-process/index.js.map +1 -1
- package/tsOutputs/test-listener/state-tracker-process/state-tracker-proxy.d.ts +8 -8
- package/tsOutputs/test-listener/state-tracker-process/state-tracker-proxy.js +71 -69
- package/tsOutputs/test-listener/state-tracker-process/state-tracker-proxy.js.map +1 -1
- package/tsOutputs/test-listener/test-recommendation-handler.d.ts +29 -29
- package/tsOutputs/test-listener/test-recommendation-handler.js +161 -161
- package/tsOutputs/test-listener/upload-report-handler.js +96 -96
- package/tsOutputs/test-listener/utils.js +68 -68
- package/tsOutputs/test-listener/uuid.d.ts +3 -3
- package/tsOutputs/test-listener/uuid.js +23 -23
- package/tsOutputs/test-listener/wait-for-multiple-callbacks.d.ts +22 -22
- package/tsOutputs/test-listener/wait-for-multiple-callbacks.js +60 -60
- package/tsOutputs/test-listener/watchdog.d.ts +89 -89
- package/tsOutputs/test-listener/watchdog.js +146 -144
- package/tsOutputs/test-listener/watchdog.js.map +1 -1
- package/tsOutputs/build-scanner/complexity-metrics/complexity-metrics.js +0 -1
- package/tsOutputs/build-scanner/complexity-metrics/complexity-metrics.js.map +0 -1
- package/tsOutputs/build-scanner/js_diff/code-metrics-spec.js +0 -1
- package/tsOutputs/build-scanner/js_diff/code-metrics-spec.js.map +0 -1
- package/tsOutputs/build-scanner/js_diff/code-metrics.js +0 -1
- package/tsOutputs/build-scanner/js_diff/code-metrics.js.map +0 -1
- package/tsOutputs/build-scanner/mappings/contracts.js +0 -3
- package/tsOutputs/build-scanner/mappings/contracts.js.map +0 -1
|
@@ -1,214 +1,214 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
-
exports.EnsureFilesHandlerService = void 0;
|
|
15
|
-
var files_data_container_1 = require("./files-data-container");
|
|
16
|
-
var path_1 = require("path");
|
|
17
|
-
var ActualFile = require("../file-system/actual-file");
|
|
18
|
-
var file_element_utils_1 = require("./file-element-utils");
|
|
19
|
-
var file_enricher_1 = require("./file-enricher");
|
|
20
|
-
var scm_file_fixer_1 = require("./scm-file-fixer");
|
|
21
|
-
var files_utils_1 = require("../../common/utils/files-utils");
|
|
22
|
-
var SourceFileNotifier = require("../js_diff/source-files-notifier");
|
|
23
|
-
var EnsureFilesHandlerService = /** @class */ (function () {
|
|
24
|
-
function EnsureFilesHandlerService(logger, opts, scmFilesContainer, scmRootDir, config, slMapper) {
|
|
25
|
-
this.logger = logger;
|
|
26
|
-
this.opts = opts;
|
|
27
|
-
this.scmFilesContainer = scmFilesContainer;
|
|
28
|
-
this.scmRootDir = scmRootDir;
|
|
29
|
-
this.config = config;
|
|
30
|
-
this.slMapper = slMapper;
|
|
31
|
-
this.WEBPACK_PREFIX = 'webpack:///';
|
|
32
|
-
this.WEBPACK_BOOTSTRAP_FILE = 'webpack/bootstrap';
|
|
33
|
-
this.WEBPACK_LAZY_FILE = '$_lazy';
|
|
34
|
-
this.WEBPACK_SRC_ASYNC = 'src async';
|
|
35
|
-
this.WEBPACK_SRC_LAZY = 'src lazy';
|
|
36
|
-
this.WEBPACK_RESOURCE_SIGN = '~'; // Webpack replace 'node_modules' with '~'
|
|
37
|
-
this.NODE_MODULES = 'node_modules';
|
|
38
|
-
this.THIRD_PARTIES_FOLDERS = [
|
|
39
|
-
this.WEBPACK_BOOTSTRAP_FILE,
|
|
40
|
-
this.WEBPACK_LAZY_FILE,
|
|
41
|
-
this.WEBPACK_RESOURCE_SIGN,
|
|
42
|
-
this.NODE_MODULES,
|
|
43
|
-
this.WEBPACK_SRC_ASYNC,
|
|
44
|
-
this.WEBPACK_SRC_LAZY
|
|
45
|
-
];
|
|
46
|
-
this.filesDataContainer = new files_data_container_1.FilesDataContainer();
|
|
47
|
-
this.scmFileFixer = new scm_file_fixer_1.ScmFileFixer(this.scmFilesContainer, this.slMapper);
|
|
48
|
-
this.sourceFilesNotifier = new SourceFileNotifier(logger);
|
|
49
|
-
}
|
|
50
|
-
EnsureFilesHandlerService.prototype.ensureProcess = function (req) {
|
|
51
|
-
var result = __assign(__assign({}, req), { files: [] });
|
|
52
|
-
for (var _i = 0, _a = req.files; _i < _a.length; _i++) {
|
|
53
|
-
var jsFile = _a[_i];
|
|
54
|
-
var sourceFileObject = new ActualFile(jsFile.logicalPath, jsFile.absolutePath);
|
|
55
|
-
this.handleMappingOneFile(jsFile, sourceFileObject);
|
|
56
|
-
}
|
|
57
|
-
result.files = this.filesDataContainer.files;
|
|
58
|
-
if (this.opts.projectRoot) {
|
|
59
|
-
var root = this.opts.projectRoot;
|
|
60
|
-
if (root === '.') {
|
|
61
|
-
root = process.cwd();
|
|
62
|
-
}
|
|
63
|
-
root = path_1.normalize(root);
|
|
64
|
-
result.files = this.fixFilesPathByPath(result.files, root);
|
|
65
|
-
}
|
|
66
|
-
else if (this.scmFilesContainer) {
|
|
67
|
-
result.files = this.scmFileFixer.fixFilesPath(result.files, this.scmRootDir);
|
|
68
|
-
}
|
|
69
|
-
else {
|
|
70
|
-
result.files = this.fixFilesPathByPath(result.files, process.cwd());
|
|
71
|
-
}
|
|
72
|
-
var enricher = new file_enricher_1.FileEnricher(this.logger, this.opts, this.scmRootDir, this.scmFilesContainer, this.config);
|
|
73
|
-
var resultAfterEnrich = enricher.enrichFiles(result);
|
|
74
|
-
this.deleteRedundantFields(resultAfterEnrich);
|
|
75
|
-
return { output: resultAfterEnrich };
|
|
76
|
-
};
|
|
77
|
-
EnsureFilesHandlerService.prototype.deleteRedundantFields = function (output) {
|
|
78
|
-
output.files.forEach(function (f) {
|
|
79
|
-
f.methods.forEach(function (m) { var _a; return (_a = m === null || m === void 0 ? void 0 : m.meta) === null || _a === void 0 ? true : delete _a.identifierPosition; });
|
|
80
|
-
});
|
|
81
|
-
};
|
|
82
|
-
EnsureFilesHandlerService.prototype.fixFilesPathByPath = function (uniqueFiles, projectRoot) {
|
|
83
|
-
var _this = this;
|
|
84
|
-
var fixedProjectRoot = path_1.normalize(projectRoot);
|
|
85
|
-
var _loop_1 = function (file) {
|
|
86
|
-
var fileFixedPath = files_utils_1.FilesUtils.adjustPathSlashes(path_1.normalize(file.logicalPath).replace(fixedProjectRoot, ''));
|
|
87
|
-
if (fileFixedPath.indexOf('/') === 0) {
|
|
88
|
-
fileFixedPath = fileFixedPath.substring(1);
|
|
89
|
-
}
|
|
90
|
-
file.logicalPath = fileFixedPath;
|
|
91
|
-
file.physicalPath = fileFixedPath;
|
|
92
|
-
file.absolutePath = files_utils_1.FilesUtils.adjustPathSlashes(path_1.join(fixedProjectRoot, file.physicalPath));
|
|
93
|
-
file.methods.forEach(function (method) {
|
|
94
|
-
method.uniqueId = file.logicalPath + "@" + method.position.join(',');
|
|
95
|
-
_this.slMapper.addUniqueId(method.uniqueIdKey, method.uniqueId);
|
|
96
|
-
delete method.uniqueIdKey;
|
|
97
|
-
});
|
|
98
|
-
file.branches.forEach(function (branch) {
|
|
99
|
-
var position = file_element_utils_1.getBranchPosition(branch);
|
|
100
|
-
branch.uniqueId = file.logicalPath + "|" + position.join(',') + "|" + branch.index;
|
|
101
|
-
_this.slMapper.addUniqueId(branch.uniqueIdKey, branch.uniqueId);
|
|
102
|
-
delete branch.uniqueIdKey;
|
|
103
|
-
});
|
|
104
|
-
};
|
|
105
|
-
for (var _i = 0, uniqueFiles_1 = uniqueFiles; _i < uniqueFiles_1.length; _i++) {
|
|
106
|
-
var file = uniqueFiles_1[_i];
|
|
107
|
-
_loop_1(file);
|
|
108
|
-
}
|
|
109
|
-
return uniqueFiles;
|
|
110
|
-
};
|
|
111
|
-
EnsureFilesHandlerService.prototype.handleMappingOneFile = function (generatedFile, sourceFileObject) {
|
|
112
|
-
var _a;
|
|
113
|
-
var sourceMaps = sourceFileObject.readSourceMapsWithRaw(this.logger);
|
|
114
|
-
if (!sourceMaps.consumer) {
|
|
115
|
-
this.filesDataContainer.addFile(generatedFile);
|
|
116
|
-
}
|
|
117
|
-
else {
|
|
118
|
-
var codeElementMetrics = { hasColumnInfo: false };
|
|
119
|
-
this.addMethods(generatedFile, sourceMaps.consumer, codeElementMetrics);
|
|
120
|
-
this.addBranches(generatedFile, sourceMaps.consumer, codeElementMetrics);
|
|
121
|
-
this.sourceFilesNotifier.notifySources((_a = sourceMaps.rawSourceMaps) === null || _a === void 0 ? void 0 : _a.sources, generatedFile.absolutePath, codeElementMetrics.hasColumnInfo);
|
|
122
|
-
}
|
|
123
|
-
};
|
|
124
|
-
EnsureFilesHandlerService.prototype.trimWebpackPrefix = function (source) {
|
|
125
|
-
if (source.indexOf(this.WEBPACK_PREFIX) === 0) {
|
|
126
|
-
source = source.substring(this.WEBPACK_PREFIX.length);
|
|
127
|
-
}
|
|
128
|
-
return source;
|
|
129
|
-
};
|
|
130
|
-
EnsureFilesHandlerService.prototype.cleanPath = function (source) {
|
|
131
|
-
source = this.trimWebpackPrefix(source);
|
|
132
|
-
if (source.indexOf('/') === 0) {
|
|
133
|
-
source = source.substring(1);
|
|
134
|
-
}
|
|
135
|
-
return path_1.normalize(source);
|
|
136
|
-
};
|
|
137
|
-
EnsureFilesHandlerService.prototype.getMappingPositionForMethod = function (sourceMaps, method) {
|
|
138
|
-
var _a, _b;
|
|
139
|
-
var startMap = sourceMaps.originalPositionFor({
|
|
140
|
-
line: method.position[0],
|
|
141
|
-
column: method.position[1]
|
|
142
|
-
});
|
|
143
|
-
var endMap = sourceMaps.originalPositionFor({
|
|
144
|
-
line: method.endPosition[0],
|
|
145
|
-
column: method.endPosition[1]
|
|
146
|
-
});
|
|
147
|
-
var identifierPosition = sourceMaps.originalPositionFor({
|
|
148
|
-
line: (_a = method === null || method === void 0 ? void 0 : method.meta) === null || _a === void 0 ? void 0 : _a.identifierPosition[0],
|
|
149
|
-
column: (_b = method === null || method === void 0 ? void 0 : method.meta) === null || _b === void 0 ? void 0 : _b.identifierPosition[1]
|
|
150
|
-
});
|
|
151
|
-
return { startMap: startMap, endMap: endMap, identifierPosition: identifierPosition };
|
|
152
|
-
};
|
|
153
|
-
EnsureFilesHandlerService.prototype.getMappingPositionForBranch = function (sourceMaps, branch) {
|
|
154
|
-
var startMap = sourceMaps.originalPositionFor({
|
|
155
|
-
line: branch.position[0],
|
|
156
|
-
column: branch.position[1]
|
|
157
|
-
});
|
|
158
|
-
var parentStartMap = sourceMaps.originalPositionFor({
|
|
159
|
-
line: branch.parentPosition[0],
|
|
160
|
-
column: branch.parentPosition[1]
|
|
161
|
-
});
|
|
162
|
-
var endMap = sourceMaps.originalPositionFor({
|
|
163
|
-
line: branch.endPosition[0],
|
|
164
|
-
column: branch.endPosition[1]
|
|
165
|
-
});
|
|
166
|
-
return { startMap: startMap, endMap: endMap, parentStartMap: parentStartMap };
|
|
167
|
-
};
|
|
168
|
-
EnsureFilesHandlerService.prototype.addMethods = function (generatedFile, sourceMaps, codeElementMetrics) {
|
|
169
|
-
for (var _i = 0, _a = generatedFile.methods; _i < _a.length; _i++) {
|
|
170
|
-
var method = _a[_i];
|
|
171
|
-
var _b = this.getMappingPositionForMethod(sourceMaps, method), startMap = _b.startMap, endMap = _b.endMap, identifierPosition = _b.identifierPosition;
|
|
172
|
-
if (identifierPosition) {
|
|
173
|
-
method.meta.identifierPosition = [identifierPosition.line, identifierPosition.column];
|
|
174
|
-
}
|
|
175
|
-
if (this.isMapValid(startMap)) {
|
|
176
|
-
if (+startMap.column !== 0) {
|
|
177
|
-
codeElementMetrics.hasColumnInfo = true;
|
|
178
|
-
}
|
|
179
|
-
var cleanPath = this.cleanPath(startMap.source);
|
|
180
|
-
var generatedFileMethodKey = generatedFile.absolutePath + "@" + method.position.join(',');
|
|
181
|
-
this.filesDataContainer.addMethod(cleanPath, file_element_utils_1.createMethod(startMap, endMap, method, generatedFileMethodKey));
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
};
|
|
185
|
-
EnsureFilesHandlerService.prototype.addBranches = function (generatedFile, sourceMaps, codeElementMetrics) {
|
|
186
|
-
for (var _i = 0, _a = generatedFile.branches; _i < _a.length; _i++) {
|
|
187
|
-
var branch = _a[_i];
|
|
188
|
-
var branchInfo = branch;
|
|
189
|
-
var _b = this.getMappingPositionForBranch(sourceMaps, branch), startMap = _b.startMap, endMap = _b.endMap, parentStartMap = _b.parentStartMap;
|
|
190
|
-
if (this.isMapValid(startMap)) {
|
|
191
|
-
if (+startMap.column !== 0) {
|
|
192
|
-
codeElementMetrics.hasColumnInfo = true;
|
|
193
|
-
}
|
|
194
|
-
var cleanPath = this.cleanPath(startMap.source);
|
|
195
|
-
var generatedFileBranchKey = generatedFile.absolutePath + "|" + branchInfo.parentPosition.join(',') + "|" + branchInfo.index;
|
|
196
|
-
this.filesDataContainer.addBranch(cleanPath, file_element_utils_1.createBranch(startMap, endMap, parentStartMap, branchInfo, cleanPath, generatedFileBranchKey));
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
};
|
|
200
|
-
EnsureFilesHandlerService.prototype.fixPathByScm = function (sourceFile) {
|
|
201
|
-
var gitFiles = this.scmFilesContainer.getScmPath(sourceFile);
|
|
202
|
-
return (gitFiles === null || gitFiles === void 0 ? void 0 : gitFiles.length) == 1 ? gitFiles[0] : null;
|
|
203
|
-
};
|
|
204
|
-
EnsureFilesHandlerService.prototype.isMapValid = function (map) {
|
|
205
|
-
if (!map.source) {
|
|
206
|
-
return false;
|
|
207
|
-
}
|
|
208
|
-
var mapFix = this.trimWebpackPrefix(map.source);
|
|
209
|
-
return mapFix && !this.THIRD_PARTIES_FOLDERS.some(function (str) { return mapFix.includes(str); });
|
|
210
|
-
};
|
|
211
|
-
return EnsureFilesHandlerService;
|
|
212
|
-
}());
|
|
213
|
-
exports.EnsureFilesHandlerService = EnsureFilesHandlerService;
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.EnsureFilesHandlerService = void 0;
|
|
15
|
+
var files_data_container_1 = require("./files-data-container");
|
|
16
|
+
var path_1 = require("path");
|
|
17
|
+
var ActualFile = require("../file-system/actual-file");
|
|
18
|
+
var file_element_utils_1 = require("./file-element-utils");
|
|
19
|
+
var file_enricher_1 = require("./file-enricher");
|
|
20
|
+
var scm_file_fixer_1 = require("./scm-file-fixer");
|
|
21
|
+
var files_utils_1 = require("../../common/utils/files-utils");
|
|
22
|
+
var SourceFileNotifier = require("../js_diff/source-files-notifier");
|
|
23
|
+
var EnsureFilesHandlerService = /** @class */ (function () {
|
|
24
|
+
function EnsureFilesHandlerService(logger, opts, scmFilesContainer, scmRootDir, config, slMapper) {
|
|
25
|
+
this.logger = logger;
|
|
26
|
+
this.opts = opts;
|
|
27
|
+
this.scmFilesContainer = scmFilesContainer;
|
|
28
|
+
this.scmRootDir = scmRootDir;
|
|
29
|
+
this.config = config;
|
|
30
|
+
this.slMapper = slMapper;
|
|
31
|
+
this.WEBPACK_PREFIX = 'webpack:///';
|
|
32
|
+
this.WEBPACK_BOOTSTRAP_FILE = 'webpack/bootstrap';
|
|
33
|
+
this.WEBPACK_LAZY_FILE = '$_lazy';
|
|
34
|
+
this.WEBPACK_SRC_ASYNC = 'src async';
|
|
35
|
+
this.WEBPACK_SRC_LAZY = 'src lazy';
|
|
36
|
+
this.WEBPACK_RESOURCE_SIGN = '~'; // Webpack replace 'node_modules' with '~'
|
|
37
|
+
this.NODE_MODULES = 'node_modules';
|
|
38
|
+
this.THIRD_PARTIES_FOLDERS = [
|
|
39
|
+
this.WEBPACK_BOOTSTRAP_FILE,
|
|
40
|
+
this.WEBPACK_LAZY_FILE,
|
|
41
|
+
this.WEBPACK_RESOURCE_SIGN,
|
|
42
|
+
this.NODE_MODULES,
|
|
43
|
+
this.WEBPACK_SRC_ASYNC,
|
|
44
|
+
this.WEBPACK_SRC_LAZY
|
|
45
|
+
];
|
|
46
|
+
this.filesDataContainer = new files_data_container_1.FilesDataContainer();
|
|
47
|
+
this.scmFileFixer = new scm_file_fixer_1.ScmFileFixer(this.scmFilesContainer, this.slMapper);
|
|
48
|
+
this.sourceFilesNotifier = new SourceFileNotifier(logger);
|
|
49
|
+
}
|
|
50
|
+
EnsureFilesHandlerService.prototype.ensureProcess = function (req) {
|
|
51
|
+
var result = __assign(__assign({}, req), { files: [] });
|
|
52
|
+
for (var _i = 0, _a = req.files; _i < _a.length; _i++) {
|
|
53
|
+
var jsFile = _a[_i];
|
|
54
|
+
var sourceFileObject = new ActualFile(jsFile.logicalPath, jsFile.absolutePath);
|
|
55
|
+
this.handleMappingOneFile(jsFile, sourceFileObject);
|
|
56
|
+
}
|
|
57
|
+
result.files = this.filesDataContainer.files;
|
|
58
|
+
if (this.opts.projectRoot) {
|
|
59
|
+
var root = this.opts.projectRoot;
|
|
60
|
+
if (root === '.') {
|
|
61
|
+
root = process.cwd();
|
|
62
|
+
}
|
|
63
|
+
root = (0, path_1.normalize)(root);
|
|
64
|
+
result.files = this.fixFilesPathByPath(result.files, root);
|
|
65
|
+
}
|
|
66
|
+
else if (this.scmFilesContainer) {
|
|
67
|
+
result.files = this.scmFileFixer.fixFilesPath(result.files, this.scmRootDir);
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
result.files = this.fixFilesPathByPath(result.files, process.cwd());
|
|
71
|
+
}
|
|
72
|
+
var enricher = new file_enricher_1.FileEnricher(this.logger, this.opts, this.scmRootDir, this.scmFilesContainer, this.config);
|
|
73
|
+
var resultAfterEnrich = enricher.enrichFiles(result);
|
|
74
|
+
this.deleteRedundantFields(resultAfterEnrich);
|
|
75
|
+
return { output: resultAfterEnrich };
|
|
76
|
+
};
|
|
77
|
+
EnsureFilesHandlerService.prototype.deleteRedundantFields = function (output) {
|
|
78
|
+
output.files.forEach(function (f) {
|
|
79
|
+
f.methods.forEach(function (m) { var _a; return (_a = m === null || m === void 0 ? void 0 : m.meta) === null || _a === void 0 ? true : delete _a.identifierPosition; });
|
|
80
|
+
});
|
|
81
|
+
};
|
|
82
|
+
EnsureFilesHandlerService.prototype.fixFilesPathByPath = function (uniqueFiles, projectRoot) {
|
|
83
|
+
var _this = this;
|
|
84
|
+
var fixedProjectRoot = (0, path_1.normalize)(projectRoot);
|
|
85
|
+
var _loop_1 = function (file) {
|
|
86
|
+
var fileFixedPath = files_utils_1.FilesUtils.adjustPathSlashes((0, path_1.normalize)(file.logicalPath).replace(fixedProjectRoot, ''));
|
|
87
|
+
if (fileFixedPath.indexOf('/') === 0) {
|
|
88
|
+
fileFixedPath = fileFixedPath.substring(1);
|
|
89
|
+
}
|
|
90
|
+
file.logicalPath = fileFixedPath;
|
|
91
|
+
file.physicalPath = fileFixedPath;
|
|
92
|
+
file.absolutePath = files_utils_1.FilesUtils.adjustPathSlashes((0, path_1.join)(fixedProjectRoot, file.physicalPath));
|
|
93
|
+
file.methods.forEach(function (method) {
|
|
94
|
+
method.uniqueId = file.logicalPath + "@" + method.position.join(',');
|
|
95
|
+
_this.slMapper.addUniqueId(method.uniqueIdKey, method.uniqueId);
|
|
96
|
+
delete method.uniqueIdKey;
|
|
97
|
+
});
|
|
98
|
+
file.branches.forEach(function (branch) {
|
|
99
|
+
var position = (0, file_element_utils_1.getBranchPosition)(branch);
|
|
100
|
+
branch.uniqueId = file.logicalPath + "|" + position.join(',') + "|" + branch.index;
|
|
101
|
+
_this.slMapper.addUniqueId(branch.uniqueIdKey, branch.uniqueId);
|
|
102
|
+
delete branch.uniqueIdKey;
|
|
103
|
+
});
|
|
104
|
+
};
|
|
105
|
+
for (var _i = 0, uniqueFiles_1 = uniqueFiles; _i < uniqueFiles_1.length; _i++) {
|
|
106
|
+
var file = uniqueFiles_1[_i];
|
|
107
|
+
_loop_1(file);
|
|
108
|
+
}
|
|
109
|
+
return uniqueFiles;
|
|
110
|
+
};
|
|
111
|
+
EnsureFilesHandlerService.prototype.handleMappingOneFile = function (generatedFile, sourceFileObject) {
|
|
112
|
+
var _a;
|
|
113
|
+
var sourceMaps = sourceFileObject.readSourceMapsWithRaw(this.logger);
|
|
114
|
+
if (!sourceMaps.consumer) {
|
|
115
|
+
this.filesDataContainer.addFile(generatedFile);
|
|
116
|
+
}
|
|
117
|
+
else {
|
|
118
|
+
var codeElementMetrics = { hasColumnInfo: false };
|
|
119
|
+
this.addMethods(generatedFile, sourceMaps.consumer, codeElementMetrics);
|
|
120
|
+
this.addBranches(generatedFile, sourceMaps.consumer, codeElementMetrics);
|
|
121
|
+
this.sourceFilesNotifier.notifySources((_a = sourceMaps.rawSourceMaps) === null || _a === void 0 ? void 0 : _a.sources, generatedFile.absolutePath, codeElementMetrics.hasColumnInfo);
|
|
122
|
+
}
|
|
123
|
+
};
|
|
124
|
+
EnsureFilesHandlerService.prototype.trimWebpackPrefix = function (source) {
|
|
125
|
+
if (source.indexOf(this.WEBPACK_PREFIX) === 0) {
|
|
126
|
+
source = source.substring(this.WEBPACK_PREFIX.length);
|
|
127
|
+
}
|
|
128
|
+
return source;
|
|
129
|
+
};
|
|
130
|
+
EnsureFilesHandlerService.prototype.cleanPath = function (source) {
|
|
131
|
+
source = this.trimWebpackPrefix(source);
|
|
132
|
+
if (source.indexOf('/') === 0) {
|
|
133
|
+
source = source.substring(1);
|
|
134
|
+
}
|
|
135
|
+
return (0, path_1.normalize)(source);
|
|
136
|
+
};
|
|
137
|
+
EnsureFilesHandlerService.prototype.getMappingPositionForMethod = function (sourceMaps, method) {
|
|
138
|
+
var _a, _b;
|
|
139
|
+
var startMap = sourceMaps.originalPositionFor({
|
|
140
|
+
line: method.position[0],
|
|
141
|
+
column: method.position[1]
|
|
142
|
+
});
|
|
143
|
+
var endMap = sourceMaps.originalPositionFor({
|
|
144
|
+
line: method.endPosition[0],
|
|
145
|
+
column: method.endPosition[1]
|
|
146
|
+
});
|
|
147
|
+
var identifierPosition = sourceMaps.originalPositionFor({
|
|
148
|
+
line: (_a = method === null || method === void 0 ? void 0 : method.meta) === null || _a === void 0 ? void 0 : _a.identifierPosition[0],
|
|
149
|
+
column: (_b = method === null || method === void 0 ? void 0 : method.meta) === null || _b === void 0 ? void 0 : _b.identifierPosition[1]
|
|
150
|
+
});
|
|
151
|
+
return { startMap: startMap, endMap: endMap, identifierPosition: identifierPosition };
|
|
152
|
+
};
|
|
153
|
+
EnsureFilesHandlerService.prototype.getMappingPositionForBranch = function (sourceMaps, branch) {
|
|
154
|
+
var startMap = sourceMaps.originalPositionFor({
|
|
155
|
+
line: branch.position[0],
|
|
156
|
+
column: branch.position[1]
|
|
157
|
+
});
|
|
158
|
+
var parentStartMap = sourceMaps.originalPositionFor({
|
|
159
|
+
line: branch.parentPosition[0],
|
|
160
|
+
column: branch.parentPosition[1]
|
|
161
|
+
});
|
|
162
|
+
var endMap = sourceMaps.originalPositionFor({
|
|
163
|
+
line: branch.endPosition[0],
|
|
164
|
+
column: branch.endPosition[1]
|
|
165
|
+
});
|
|
166
|
+
return { startMap: startMap, endMap: endMap, parentStartMap: parentStartMap };
|
|
167
|
+
};
|
|
168
|
+
EnsureFilesHandlerService.prototype.addMethods = function (generatedFile, sourceMaps, codeElementMetrics) {
|
|
169
|
+
for (var _i = 0, _a = generatedFile.methods; _i < _a.length; _i++) {
|
|
170
|
+
var method = _a[_i];
|
|
171
|
+
var _b = this.getMappingPositionForMethod(sourceMaps, method), startMap = _b.startMap, endMap = _b.endMap, identifierPosition = _b.identifierPosition;
|
|
172
|
+
if (identifierPosition) {
|
|
173
|
+
method.meta.identifierPosition = [identifierPosition.line, identifierPosition.column];
|
|
174
|
+
}
|
|
175
|
+
if (this.isMapValid(startMap)) {
|
|
176
|
+
if (+startMap.column !== 0) {
|
|
177
|
+
codeElementMetrics.hasColumnInfo = true;
|
|
178
|
+
}
|
|
179
|
+
var cleanPath = this.cleanPath(startMap.source);
|
|
180
|
+
var generatedFileMethodKey = generatedFile.absolutePath + "@" + method.position.join(',');
|
|
181
|
+
this.filesDataContainer.addMethod(cleanPath, (0, file_element_utils_1.createMethod)(startMap, endMap, method, generatedFileMethodKey));
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
};
|
|
185
|
+
EnsureFilesHandlerService.prototype.addBranches = function (generatedFile, sourceMaps, codeElementMetrics) {
|
|
186
|
+
for (var _i = 0, _a = generatedFile.branches; _i < _a.length; _i++) {
|
|
187
|
+
var branch = _a[_i];
|
|
188
|
+
var branchInfo = branch;
|
|
189
|
+
var _b = this.getMappingPositionForBranch(sourceMaps, branch), startMap = _b.startMap, endMap = _b.endMap, parentStartMap = _b.parentStartMap;
|
|
190
|
+
if (this.isMapValid(startMap)) {
|
|
191
|
+
if (+startMap.column !== 0) {
|
|
192
|
+
codeElementMetrics.hasColumnInfo = true;
|
|
193
|
+
}
|
|
194
|
+
var cleanPath = this.cleanPath(startMap.source);
|
|
195
|
+
var generatedFileBranchKey = generatedFile.absolutePath + "|" + branchInfo.parentPosition.join(',') + "|" + branchInfo.index;
|
|
196
|
+
this.filesDataContainer.addBranch(cleanPath, (0, file_element_utils_1.createBranch)(startMap, endMap, parentStartMap, branchInfo, cleanPath, generatedFileBranchKey));
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
};
|
|
200
|
+
EnsureFilesHandlerService.prototype.fixPathByScm = function (sourceFile) {
|
|
201
|
+
var gitFiles = this.scmFilesContainer.getScmPath(sourceFile);
|
|
202
|
+
return (gitFiles === null || gitFiles === void 0 ? void 0 : gitFiles.length) == 1 ? gitFiles[0] : null;
|
|
203
|
+
};
|
|
204
|
+
EnsureFilesHandlerService.prototype.isMapValid = function (map) {
|
|
205
|
+
if (!map.source) {
|
|
206
|
+
return false;
|
|
207
|
+
}
|
|
208
|
+
var mapFix = this.trimWebpackPrefix(map.source);
|
|
209
|
+
return mapFix && !this.THIRD_PARTIES_FOLDERS.some(function (str) { return mapFix.includes(str); });
|
|
210
|
+
};
|
|
211
|
+
return EnsureFilesHandlerService;
|
|
212
|
+
}());
|
|
213
|
+
exports.EnsureFilesHandlerService = EnsureFilesHandlerService;
|
|
214
214
|
//# sourceMappingURL=ensure-files-handler.service.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ensure-files-handler.service.js","sourceRoot":"","sources":["../../../build-scanner/mappings/ensure-files-handler.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAA4D;AAE5D,6BAAuC;AAEvC,uDAA0D;AAC1D,2DAAkF;AAClF,iDAA+C;AAC/C,mDAAgD;AAChD,8DAA4D;AAC5D,qEAAwE;AACxE;IAuBI,mCACqB,MAAM,EACf,IAAS,EACT,iBAAoC,EACpC,UAAkB,EAClB,MAAsC,EACtC,QAAQ;QALC,WAAM,GAAN,MAAM,CAAA;QACf,SAAI,GAAJ,IAAI,CAAK;QACT,sBAAiB,GAAjB,iBAAiB,CAAmB;QACpC,eAAU,GAAV,UAAU,CAAQ;QAClB,WAAM,GAAN,MAAM,CAAgC;QACtC,aAAQ,GAAR,QAAQ,CAAA;QA3BH,mBAAc,GAAG,aAAa,CAAC;QAC/B,2BAAsB,GAAG,mBAAmB,CAAC;QAC7C,sBAAiB,GAAG,QAAQ,CAAC;QAC7B,sBAAiB,GAAG,WAAW,CAAC;QAChC,qBAAgB,GAAG,UAAU,CAAC;QAC9B,0BAAqB,GAAG,GAAG,CAAC,CAAC,0CAA0C;QACvE,iBAAY,GAAG,cAAc,CAAC;QAC9B,0BAAqB,GAAG;YACrC,IAAI,CAAC,sBAAsB;YAC3B,IAAI,CAAC,iBAAiB;YACtB,IAAI,CAAC,qBAAqB;YAC1B,IAAI,CAAC,YAAY;YACjB,IAAI,CAAC,iBAAiB;YACtB,IAAI,CAAC,gBAAgB;SAExB,CAAC;QAGM,uBAAkB,GAAG,IAAI,yCAAkB,EAAE,CAAC;QAUlD,IAAI,CAAC,YAAY,GAAG,IAAI,6BAAY,CAAC,IAAI,CAAC,iBAAiB,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;QAC5E,IAAI,CAAC,mBAAmB,GAAG,IAAI,kBAAkB,CAAC,MAAM,CAAC,CAAC;IAC9D,CAAC;IAED,iDAAa,GAAb,UAAc,GAAwB;QAClC,IAAM,MAAM,yBAA6B,GAAG,KAAE,KAAK,EAAE,EAAE,GAAE,CAAA;QAEzD,KAAqB,UAAS,EAAT,KAAA,GAAG,CAAC,KAAK,EAAT,cAAS,EAAT,IAAS,EAAE;YAA3B,IAAM,MAAM,SAAA;YACb,IAAM,gBAAgB,GAAG,IAAI,UAAU,CAAC,MAAM,CAAC,WAAW,EAAE,MAAM,CAAC,YAAY,CAAC,CAAC;YACjF,IAAI,CAAC,oBAAoB,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;SACvD;QAED,MAAM,CAAC,KAAK,GAAG,IAAI,CAAC,kBAAkB,CAAC,KAAK,CAAC;QAC7C,IAAI,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE;YACpB,IAAI,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC;YACpC,IAAI,IAAI,KAAK,GAAG,EAAE;gBACd,IAAI,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;aACxB;YACD,IAAI,GAAG,gBAAS,
|
|
1
|
+
{"version":3,"file":"ensure-files-handler.service.js","sourceRoot":"","sources":["../../../build-scanner/mappings/ensure-files-handler.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAA4D;AAE5D,6BAAuC;AAEvC,uDAA0D;AAC1D,2DAAkF;AAClF,iDAA+C;AAC/C,mDAAgD;AAChD,8DAA4D;AAC5D,qEAAwE;AACxE;IAuBI,mCACqB,MAAM,EACf,IAAS,EACT,iBAAoC,EACpC,UAAkB,EAClB,MAAsC,EACtC,QAAQ;QALC,WAAM,GAAN,MAAM,CAAA;QACf,SAAI,GAAJ,IAAI,CAAK;QACT,sBAAiB,GAAjB,iBAAiB,CAAmB;QAC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AAiB,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;QACzE,OAAO,CAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,MAAM,KAAI,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IACtD,CAAC;IAGD,8CAAU,GAAV,UAAW,GAAG;QACV,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE;YACb,OAAO,KAAK,CAAC;SAChB;QACD,IAAM,MAAM,GAAG,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QAClD,OAAO,MAAM,IAAI,CAAC,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC,UAAA,GAAG,IAAI,OAAA,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,EAApB,CAAoB,CAAC,CAAC;IACnF,CAAC;IACL,gCAAC;AAAD,CAAC,AAhND,IAgNC;AAhNY,8DAAyB"}
|
|
@@ -1,47 +1,47 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getBranchPosition = exports.createBranch = exports.createMethod = void 0;
|
|
4
|
-
var logger_1 = require("../../common/logger");
|
|
5
|
-
var logger = logger_1.LoggerFactory.getCreateApplicationLogger();
|
|
6
|
-
function createMethod(startMap, endMap, method, uniqueIdKey) {
|
|
7
|
-
var _a, _b;
|
|
8
|
-
return {
|
|
9
|
-
endPosition: [endMap.line, endMap.column],
|
|
10
|
-
position: [startMap.line, startMap.column],
|
|
11
|
-
meta: method.meta,
|
|
12
|
-
techSpecificInfo: method.techSpecificInfo,
|
|
13
|
-
displayName: (_b = (_a = startMap.name) !== null && _a !== void 0 ? _a : method.displayName) !== null && _b !== void 0 ? _b : '(Anonymous)',
|
|
14
|
-
hash: method.hash,
|
|
15
|
-
idxInMapping: method.idxInMapping,
|
|
16
|
-
sigHash: method.sigHash,
|
|
17
|
-
uniqueIdKey: uniqueIdKey,
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
exports.createMethod = createMethod;
|
|
21
|
-
function createBranch(startPosition, endPosition, parentPosition, branchInfo, logicalPath, uniqueIdKey) {
|
|
22
|
-
return {
|
|
23
|
-
filename: logicalPath,
|
|
24
|
-
type: branchInfo.type,
|
|
25
|
-
endPosition: [endPosition.line, endPosition.column],
|
|
26
|
-
position: [startPosition.line, startPosition.column],
|
|
27
|
-
hash: branchInfo.hash,
|
|
28
|
-
index: branchInfo.index,
|
|
29
|
-
parentPosition: [parentPosition.line, parentPosition.column],
|
|
30
|
-
enclosingMethodIdx: branchInfo.enclosingMethodIdx,
|
|
31
|
-
techSpecificInfo: branchInfo.techSpecificInfo || {},
|
|
32
|
-
uniqueIdKey: uniqueIdKey
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
exports.createBranch = createBranch;
|
|
36
|
-
function getBranchPosition(branch) {
|
|
37
|
-
if (branch.type !== 'IfStatement') {
|
|
38
|
-
return branch.position;
|
|
39
|
-
}
|
|
40
|
-
if (!isNaN(branch.parentPosition[0]) && !isNaN(branch.parentPosition[1])) {
|
|
41
|
-
return branch.parentPosition;
|
|
42
|
-
}
|
|
43
|
-
logger.info("Branch at position '" + branch.position + "' in file '" + branch.filename + "' is an if statement inside async methods using branch position instead of parent");
|
|
44
|
-
return branch.position;
|
|
45
|
-
}
|
|
46
|
-
exports.getBranchPosition = getBranchPosition;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getBranchPosition = exports.createBranch = exports.createMethod = void 0;
|
|
4
|
+
var logger_1 = require("../../common/logger");
|
|
5
|
+
var logger = logger_1.LoggerFactory.getCreateApplicationLogger();
|
|
6
|
+
function createMethod(startMap, endMap, method, uniqueIdKey) {
|
|
7
|
+
var _a, _b;
|
|
8
|
+
return {
|
|
9
|
+
endPosition: [endMap.line, endMap.column],
|
|
10
|
+
position: [startMap.line, startMap.column],
|
|
11
|
+
meta: method.meta,
|
|
12
|
+
techSpecificInfo: method.techSpecificInfo,
|
|
13
|
+
displayName: (_b = (_a = startMap.name) !== null && _a !== void 0 ? _a : method.displayName) !== null && _b !== void 0 ? _b : '(Anonymous)',
|
|
14
|
+
hash: method.hash,
|
|
15
|
+
idxInMapping: method.idxInMapping,
|
|
16
|
+
sigHash: method.sigHash,
|
|
17
|
+
uniqueIdKey: uniqueIdKey,
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
exports.createMethod = createMethod;
|
|
21
|
+
function createBranch(startPosition, endPosition, parentPosition, branchInfo, logicalPath, uniqueIdKey) {
|
|
22
|
+
return {
|
|
23
|
+
filename: logicalPath,
|
|
24
|
+
type: branchInfo.type,
|
|
25
|
+
endPosition: [endPosition.line, endPosition.column],
|
|
26
|
+
position: [startPosition.line, startPosition.column],
|
|
27
|
+
hash: branchInfo.hash,
|
|
28
|
+
index: branchInfo.index,
|
|
29
|
+
parentPosition: [parentPosition.line, parentPosition.column],
|
|
30
|
+
enclosingMethodIdx: branchInfo.enclosingMethodIdx,
|
|
31
|
+
techSpecificInfo: branchInfo.techSpecificInfo || {},
|
|
32
|
+
uniqueIdKey: uniqueIdKey
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
exports.createBranch = createBranch;
|
|
36
|
+
function getBranchPosition(branch) {
|
|
37
|
+
if (branch.type !== 'IfStatement') {
|
|
38
|
+
return branch.position;
|
|
39
|
+
}
|
|
40
|
+
if (!isNaN(branch.parentPosition[0]) && !isNaN(branch.parentPosition[1])) {
|
|
41
|
+
return branch.parentPosition;
|
|
42
|
+
}
|
|
43
|
+
logger.info("Branch at position '" + branch.position + "' in file '" + branch.filename + "' is an if statement inside async methods using branch position instead of parent");
|
|
44
|
+
return branch.position;
|
|
45
|
+
}
|
|
46
|
+
exports.getBranchPosition = getBranchPosition;
|
|
47
47
|
//# sourceMappingURL=file-element-utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file-element-utils.js","sourceRoot":"","sources":["../../../build-scanner/mappings/file-element-utils.ts"],"names":[],"mappings":";;;AAAA,8CAAkD;AAGlD,IAAM,MAAM,GAAG,sBAAa,CAAC,0BAA0B,EAAE,CAAC;AAC1D,SAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW;;IAC9D,OAAO;QACH,WAAW,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC;QACzC,QAAQ,EAAE,CAAC,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC;QAC1C,IAAI,EAAE,MAAM,CAAC,IAAI;QACjB,gBAAgB,EAAE,MAAM,CAAC,gBAAgB;QACzC,WAAW,
|
|
1
|
+
{"version":3,"file":"file-element-utils.js","sourceRoot":"","sources":["../../../build-scanner/mappings/file-element-utils.ts"],"names":[],"mappings":";;;AAAA,8CAAkD;AAGlD,IAAM,MAAM,GAAG,sBAAa,CAAC,0BAA0B,EAAE,CAAC;AAC1D,SAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW;;IAC9D,OAAO;QACH,WAAW,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC;QACzC,QAAQ,EAAE,CAAC,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC;QAC1C,IAAI,EAAE,MAAM,CAAC,IAAI;QACjB,gBAAgB,EAAE,MAAM,CAAC,gBAAgB;QACzC,WAAW,EAAE,MAAA,MAAA,QAAQ,CAAC,IAAI,mCAAI,MAAM,CAAC,WAAW,mCAAI,aAAa;QACjE,IAAI,EAAE,MAAM,CAAC,IAAI;QACjB,YAAY,EAAE,MAAM,CAAC,YAAY;QACjC,OAAO,EAAE,MAAM,CAAC,OAAO;QACvB,WAAW,EAAE,WAAW;KAC3B,CAAA;AACL,CAAC;AAZD,oCAYC;AAID,SAAgB,YAAY,C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