slnodejs 6.1.410 → 6.1.429
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 +33 -28
- package/browser-agent/dist/browser-agent-all.min.js +2 -2
- package/browser-agent/package.json +1 -1
- package/package.json +2 -2
- package/tsOutputs/api.js +32 -86
- package/tsOutputs/build-scanner/ast-utils.js +11 -11
- package/tsOutputs/build-scanner/ast-utils.js.map +1 -1
- package/tsOutputs/build-scanner/build-diff-process.js +36 -16
- package/tsOutputs/build-scanner/build-diff-process.js.map +1 -1
- package/tsOutputs/build-scanner/cia.js +2 -2
- package/tsOutputs/build-scanner/cia.js.map +1 -1
- package/tsOutputs/build-scanner/default-values-resolver.js +5 -7
- package/tsOutputs/build-scanner/default-values-resolver.js.map +1 -1
- package/tsOutputs/build-scanner/diagnostic/build-scan-diagnosis.js +101 -159
- package/tsOutputs/build-scanner/diagnostic/build-scan-diagnosis.js.map +1 -1
- package/tsOutputs/build-scanner/diagnostic/none-diagnosis.js +23 -55
- package/tsOutputs/build-scanner/diagnostic/none-diagnosis.js.map +1 -1
- package/tsOutputs/build-scanner/file-and-folder-utils.js +3 -3
- package/tsOutputs/build-scanner/file-and-folder-utils.js.map +1 -1
- package/tsOutputs/build-scanner/file-system/actual-file.js +3 -3
- package/tsOutputs/build-scanner/file-system/actual-file.js.map +1 -1
- package/tsOutputs/build-scanner/instrumentation/browser-instrumenter.js +57 -60
- package/tsOutputs/build-scanner/instrumentation/browser-instrumenter.js.map +1 -1
- package/tsOutputs/build-scanner/instrumentation/content-instrumenter.js +9 -10
- package/tsOutputs/build-scanner/instrumentation/content-instrumenter.js.map +1 -1
- package/tsOutputs/build-scanner/instrumentation/files-instrumenter.js +80 -124
- package/tsOutputs/build-scanner/instrumentation/files-instrumenter.js.map +1 -1
- package/tsOutputs/build-scanner/instrumentation/instrumentation-utils.js +3 -3
- package/tsOutputs/build-scanner/instrumentation/instrumentation-utils.js.map +1 -1
- package/tsOutputs/build-scanner/instrumentation/instrumented-file-size-reducer.js +4 -4
- package/tsOutputs/build-scanner/instrumentation/instrumented-file-size-reducer.js.map +1 -1
- package/tsOutputs/build-scanner/instrumentation/process-pool/instrumenter-spawn.js +15 -50
- package/tsOutputs/build-scanner/instrumentation/process-pool/instrumenter-spawn.js.map +1 -1
- package/tsOutputs/build-scanner/instrumentation/process-pool/process-pool.js +84 -141
- package/tsOutputs/build-scanner/instrumentation/process-pool/process-pool.js.map +1 -1
- package/tsOutputs/build-scanner/instrumentation/process-pool/split-by-transform-stream.js +15 -34
- package/tsOutputs/build-scanner/instrumentation/process-pool/split-by-transform-stream.js.map +1 -1
- package/tsOutputs/build-scanner/instrumentation/process-pool/stop-by-condition-transform-stream.js +9 -27
- package/tsOutputs/build-scanner/instrumentation/process-pool/stop-by-condition-transform-stream.js.map +1 -1
- package/tsOutputs/build-scanner/instrumentation/strategies/copy-as-is-strategy.js +8 -10
- package/tsOutputs/build-scanner/instrumentation/strategies/copy-as-is-strategy.js.map +1 -1
- package/tsOutputs/build-scanner/instrumentation/strategies/js-instrumnetation-strategy.js +22 -54
- package/tsOutputs/build-scanner/instrumentation/strategies/js-instrumnetation-strategy.js.map +1 -1
- package/tsOutputs/build-scanner/instrumentation/strategies/markup-instrumnetation-strategy.js +55 -107
- package/tsOutputs/build-scanner/instrumentation/strategies/markup-instrumnetation-strategy.js.map +1 -1
- package/tsOutputs/build-scanner/js_diff/file-signature.js +5 -6
- package/tsOutputs/build-scanner/js_diff/file-signature.js.map +1 -1
- package/tsOutputs/build-scanner/js_diff/files-mapping.js +6 -6
- package/tsOutputs/build-scanner/js_diff/files-mapping.js.map +1 -1
- package/tsOutputs/build-scanner/js_diff/generated-file-signature.js +3 -3
- package/tsOutputs/build-scanner/js_diff/generated-file-signature.js.map +1 -1
- package/tsOutputs/build-scanner/js_diff/guess-method-location.js +26 -27
- package/tsOutputs/build-scanner/js_diff/guess-method-location.js.map +1 -1
- package/tsOutputs/build-scanner/js_diff/method-signature.js +1 -1
- package/tsOutputs/build-scanner/js_diff/method-signature.js.map +1 -1
- package/tsOutputs/build-scanner/js_diff/sl-mapper.js +28 -79
- package/tsOutputs/build-scanner/js_diff/sl-mapper.js.map +1 -1
- package/tsOutputs/build-scanner/js_diff/source-data-enricher.js +3 -2
- package/tsOutputs/build-scanner/js_diff/source-data-enricher.js.map +1 -1
- package/tsOutputs/build-scanner/js_diff/source-files-notifier.js +1 -1
- package/tsOutputs/build-scanner/js_diff/source-files-notifier.js.map +1 -1
- package/tsOutputs/build-scanner/mappings/ensure-files-handler.service.js +76 -149
- package/tsOutputs/build-scanner/mappings/ensure-files-handler.service.js.map +1 -1
- package/tsOutputs/build-scanner/mappings/file-element-utils.js +9 -9
- package/tsOutputs/build-scanner/mappings/file-element-utils.js.map +1 -1
- package/tsOutputs/build-scanner/mappings/file-enricher.js +71 -100
- package/tsOutputs/build-scanner/mappings/file-enricher.js.map +1 -1
- package/tsOutputs/build-scanner/mappings/file-path-fixer.js +106 -0
- package/tsOutputs/build-scanner/mappings/file-path-fixer.js.map +1 -0
- package/tsOutputs/build-scanner/mappings/files-container.js +89 -0
- package/tsOutputs/build-scanner/mappings/files-container.js.map +1 -0
- package/tsOutputs/build-scanner/mappings/files-data-container.js +18 -23
- package/tsOutputs/build-scanner/mappings/files-data-container.js.map +1 -1
- package/tsOutputs/build-scanner/mappings/source-path-mapper.js +15 -45
- package/tsOutputs/build-scanner/mappings/source-path-mapper.js.map +1 -1
- package/tsOutputs/build-scanner/markup-files-parser.js +1 -1
- package/tsOutputs/build-scanner/markup-files-parser.js.map +1 -1
- package/tsOutputs/build-scanner/scm/scm-file-fixer.js +27 -0
- package/tsOutputs/build-scanner/scm/scm-file-fixer.js.map +1 -0
- package/tsOutputs/build-scanner/scm/scm-files-container.js +9 -45
- package/tsOutputs/build-scanner/scm/scm-files-container.js.map +1 -1
- package/tsOutputs/build-scanner/sl-config-cia-cli.js +1 -1
- package/tsOutputs/build-scanner/sl-config-cia-cli.js.map +1 -1
- package/tsOutputs/build-scanner/utils.js +5 -5
- package/tsOutputs/build-scanner/utils.js.map +1 -1
- package/tsOutputs/cli-parse/agent-instance-data.js +2 -2
- package/tsOutputs/cli-parse/agent-instance-data.js.map +1 -1
- package/tsOutputs/cli-parse/child-process-wrapper.js +26 -60
- package/tsOutputs/cli-parse/child-process-wrapper.js.map +1 -1
- package/tsOutputs/cli-parse/cli.js +74 -191
- package/tsOutputs/cli-parse/cli.js.map +1 -1
- package/tsOutputs/cli-parse/constants/constants.js +9 -9
- package/tsOutputs/cli-parse/constants/constants.js.map +1 -1
- package/tsOutputs/cli-parse/contracts.d.ts +2 -0
- package/tsOutputs/cli-parse/contracts.js.map +1 -1
- package/tsOutputs/cli-parse/custom-commander.js +17 -18
- package/tsOutputs/cli-parse/custom-commander.js.map +1 -1
- package/tsOutputs/cli-parse/executors/base-executor.js +121 -236
- package/tsOutputs/cli-parse/executors/base-executor.js.map +1 -1
- package/tsOutputs/cli-parse/executors/build-args-dto.js +11 -11
- package/tsOutputs/cli-parse/executors/build-args-dto.js.map +1 -1
- package/tsOutputs/cli-parse/executors/build-end-executor.js +34 -92
- package/tsOutputs/cli-parse/executors/build-end-executor.js.map +1 -1
- package/tsOutputs/cli-parse/executors/build-executor.js +68 -132
- package/tsOutputs/cli-parse/executors/build-executor.js.map +1 -1
- package/tsOutputs/cli-parse/executors/config-executor.js +35 -92
- package/tsOutputs/cli-parse/executors/config-executor.js.map +1 -1
- package/tsOutputs/cli-parse/executors/dry-run/base-data.js +29 -39
- package/tsOutputs/cli-parse/executors/dry-run/base-data.js.map +1 -1
- package/tsOutputs/cli-parse/executors/dry-run/build-mapping-data.js +92 -177
- 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 +110 -194
- 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 +49 -83
- package/tsOutputs/cli-parse/executors/dry-run/dry-run-validation.js.map +1 -1
- package/tsOutputs/cli-parse/executors/dry-run/footprints-data.js +55 -113
- package/tsOutputs/cli-parse/executors/dry-run/footprints-data.js.map +1 -1
- package/tsOutputs/cli-parse/executors/dry-run/helper-methods.js +24 -25
- package/tsOutputs/cli-parse/executors/dry-run/helper-methods.js.map +1 -1
- package/tsOutputs/cli-parse/executors/end-execution-executor.js +16 -64
- package/tsOutputs/cli-parse/executors/end-execution-executor.js.map +1 -1
- package/tsOutputs/cli-parse/executors/integration-build-components-executor.js +29 -82
- package/tsOutputs/cli-parse/executors/integration-build-components-executor.js.map +1 -1
- package/tsOutputs/cli-parse/executors/integration-build-delete-components-executor.js +12 -59
- 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 +9 -58
- package/tsOutputs/cli-parse/executors/integration-build-update-components-executor.js.map +1 -1
- package/tsOutputs/cli-parse/executors/mocha-executor.js +41 -101
- package/tsOutputs/cli-parse/executors/mocha-executor.js.map +1 -1
- package/tsOutputs/cli-parse/executors/nyc-report-executor.js +24 -83
- package/tsOutputs/cli-parse/executors/nyc-report-executor.js.map +1 -1
- package/tsOutputs/cli-parse/executors/pr-config-executor.js +15 -63
- package/tsOutputs/cli-parse/executors/pr-config-executor.js.map +1 -1
- package/tsOutputs/cli-parse/executors/run-executor.js +23 -75
- package/tsOutputs/cli-parse/executors/run-executor.js.map +1 -1
- package/tsOutputs/cli-parse/executors/start-execution-executor.js +16 -64
- package/tsOutputs/cli-parse/executors/start-execution-executor.js.map +1 -1
- package/tsOutputs/cli-parse/executors/test-executions-executor.js +9 -63
- package/tsOutputs/cli-parse/executors/test-executions-executor.js.map +1 -1
- package/tsOutputs/cli-parse/executors/test-listener-executor.js +47 -117
- package/tsOutputs/cli-parse/executors/test-listener-executor.js.map +1 -1
- package/tsOutputs/cli-parse/executors/upload-report-executor.js +23 -71
- package/tsOutputs/cli-parse/executors/upload-report-executor.js.map +1 -1
- package/tsOutputs/cli-parse/utils.js +10 -10
- package/tsOutputs/cli-parse/utils.js.map +1 -1
- package/tsOutputs/common/agent-events/agent-events-controller.js +146 -251
- package/tsOutputs/common/agent-events/agent-events-controller.js.map +1 -1
- package/tsOutputs/common/agent-events/agent-events-guard.js +12 -15
- package/tsOutputs/common/agent-events/agent-events-guard.js.map +1 -1
- package/tsOutputs/common/agent-events/agent-instance-info-builder.js +22 -24
- package/tsOutputs/common/agent-events/agent-instance-info-builder.js.map +1 -1
- package/tsOutputs/common/agent-events/agent-start-info-builder.js +7 -8
- package/tsOutputs/common/agent-events/agent-start-info-builder.js.map +1 -1
- package/tsOutputs/common/agent-events/browser-info-builder.js +9 -10
- package/tsOutputs/common/agent-events/browser-info-builder.js.map +1 -1
- package/tsOutputs/common/agent-events/ci-info-builder.js +12 -13
- package/tsOutputs/common/agent-events/ci-info-builder.js.map +1 -1
- package/tsOutputs/common/agent-events/cockpit-notifier.js +38 -87
- package/tsOutputs/common/agent-events/cockpit-notifier.js.map +1 -1
- package/tsOutputs/common/agent-events/dry-run-agent-events-controller.js +10 -27
- package/tsOutputs/common/agent-events/dry-run-agent-events-controller.js.map +1 -1
- package/tsOutputs/common/agent-events/machine-info-builder.js +21 -22
- package/tsOutputs/common/agent-events/machine-info-builder.js.map +1 -1
- package/tsOutputs/common/agent-events/no-op-agent-events-controller.js +30 -84
- package/tsOutputs/common/agent-events/no-op-agent-events-controller.js.map +1 -1
- package/tsOutputs/common/agent-events/nodejs-env-info-builder.js +7 -8
- package/tsOutputs/common/agent-events/nodejs-env-info-builder.js.map +1 -1
- package/tsOutputs/common/agent-events/sensitive-data-filter.js +3 -4
- package/tsOutputs/common/agent-events/sensitive-data-filter.js.map +1 -1
- package/tsOutputs/common/agent-instance-data.js +23 -28
- package/tsOutputs/common/agent-instance-data.js.map +1 -1
- package/tsOutputs/common/cli-progress.js +16 -19
- package/tsOutputs/common/cli-progress.js.map +1 -1
- package/tsOutputs/common/config-process/config-loader.js +23 -24
- package/tsOutputs/common/config-process/config-loader.js.map +1 -1
- package/tsOutputs/common/config-process/config-system.js +104 -131
- package/tsOutputs/common/config-process/config-system.js.map +1 -1
- package/tsOutputs/common/config-process/config.js +52 -73
- package/tsOutputs/common/config-process/config.js.map +1 -1
- package/tsOutputs/common/config-process/index.js +38 -57
- package/tsOutputs/common/config-process/index.js.map +1 -1
- package/tsOutputs/common/config-process/no-op-config-process.js +9 -29
- package/tsOutputs/common/config-process/no-op-config-process.js.map +1 -1
- package/tsOutputs/common/constants/constants.js +19 -25
- package/tsOutputs/common/constants/constants.js.map +1 -1
- package/tsOutputs/common/constants/sl-env-vars.js +125 -131
- package/tsOutputs/common/constants/sl-env-vars.js.map +1 -1
- package/tsOutputs/common/coverage-elements/file-element.js +66 -103
- package/tsOutputs/common/coverage-elements/file-element.js.map +1 -1
- package/tsOutputs/common/coverage-elements/istanbul-unique-id-converter.js +28 -47
- package/tsOutputs/common/coverage-elements/istanbul-unique-id-converter.js.map +1 -1
- package/tsOutputs/common/coverage-elements/new-id-resolver.js +17 -17
- package/tsOutputs/common/coverage-elements/new-id-resolver.js.map +1 -1
- package/tsOutputs/common/coverage-elements/original-module-loader.js +71 -79
- package/tsOutputs/common/coverage-elements/original-module-loader.js.map +1 -1
- package/tsOutputs/common/coverage-elements/unique-id-converter.js +90 -110
- package/tsOutputs/common/coverage-elements/unique-id-converter.js.map +1 -1
- package/tsOutputs/common/environment-data-service.js +10 -11
- package/tsOutputs/common/environment-data-service.js.map +1 -1
- package/tsOutputs/common/events-process/events-creator.js +20 -32
- package/tsOutputs/common/events-process/events-creator.js.map +1 -1
- package/tsOutputs/common/events-process/index.js +97 -186
- package/tsOutputs/common/events-process/index.js.map +1 -1
- package/tsOutputs/common/footprints-process/collection-interval.js +10 -11
- package/tsOutputs/common/footprints-process/collection-interval.js.map +1 -1
- package/tsOutputs/common/footprints-process/footprints-service-proxy.js +21 -22
- package/tsOutputs/common/footprints-process/footprints-service-proxy.js.map +1 -1
- package/tsOutputs/common/footprints-process/index.js +68 -102
- package/tsOutputs/common/footprints-process/index.js.map +1 -1
- package/tsOutputs/common/footprints-process/istanbul-to-footprints-contract.js +2 -5
- package/tsOutputs/common/footprints-process/istanbul-to-footprints-contract.js.map +1 -1
- package/tsOutputs/common/footprints-process/istanbul-to-footprints.js +160 -162
- package/tsOutputs/common/footprints-process/istanbul-to-footprints.js.map +1 -1
- package/tsOutputs/common/footprints-process/production-footprints-handler.js +103 -156
- package/tsOutputs/common/footprints-process/production-footprints-handler.js.map +1 -1
- package/tsOutputs/common/footprints-process-v6/base-browser-hits-converter.js +30 -48
- package/tsOutputs/common/footprints-process-v6/base-browser-hits-converter.js.map +1 -1
- package/tsOutputs/common/footprints-process-v6/browser-footprints-buffer.js +7 -25
- package/tsOutputs/common/footprints-process-v6/browser-footprints-buffer.js.map +1 -1
- package/tsOutputs/common/footprints-process-v6/buffer-size-helper.js +13 -14
- package/tsOutputs/common/footprints-process-v6/buffer-size-helper.js.map +1 -1
- package/tsOutputs/common/footprints-process-v6/collector-footprints-buffer.js +14 -32
- package/tsOutputs/common/footprints-process-v6/collector-footprints-buffer.js.map +1 -1
- package/tsOutputs/common/footprints-process-v6/collector-footprints-process.js +43 -109
- package/tsOutputs/common/footprints-process-v6/collector-footprints-process.js.map +1 -1
- package/tsOutputs/common/footprints-process-v6/contracts.js +2 -5
- package/tsOutputs/common/footprints-process-v6/contracts.js.map +1 -1
- package/tsOutputs/common/footprints-process-v6/footprints-buffer.js +55 -78
- package/tsOutputs/common/footprints-process-v6/footprints-buffer.js.map +1 -1
- package/tsOutputs/common/footprints-process-v6/hits-collector.js +89 -129
- package/tsOutputs/common/footprints-process-v6/hits-collector.js.map +1 -1
- package/tsOutputs/common/footprints-process-v6/hits-converter.js +70 -78
- package/tsOutputs/common/footprints-process-v6/hits-converter.js.map +1 -1
- package/tsOutputs/common/footprints-process-v6/index.js +204 -347
- package/tsOutputs/common/footprints-process-v6/index.js.map +1 -1
- package/tsOutputs/common/footprints-process-v6/location-formatter.js +2 -2
- package/tsOutputs/common/footprints-process-v6/location-formatter.js.map +1 -1
- package/tsOutputs/common/footprints-process-v6/relative-path-resolver.js +10 -11
- package/tsOutputs/common/footprints-process-v6/relative-path-resolver.js.map +1 -1
- package/tsOutputs/common/footprints-process-v6/remote-browser-hits-converter.js +5 -25
- package/tsOutputs/common/footprints-process-v6/remote-browser-hits-converter.js.map +1 -1
- package/tsOutputs/common/footprints-process-v6/remote-footprints-process.js +6 -57
- package/tsOutputs/common/footprints-process-v6/remote-footprints-process.js.map +1 -1
- package/tsOutputs/common/footprints-process-v6/remote-hits-collector.js +7 -27
- package/tsOutputs/common/footprints-process-v6/remote-hits-collector.js.map +1 -1
- package/tsOutputs/common/footprints-process-v6/source-map-data.js +14 -15
- package/tsOutputs/common/footprints-process-v6/source-map-data.js.map +1 -1
- package/tsOutputs/common/http/backend-proxy.js +222 -321
- package/tsOutputs/common/http/backend-proxy.js.map +1 -1
- package/tsOutputs/common/http/contracts.js +40 -116
- package/tsOutputs/common/http/contracts.js.map +1 -1
- package/tsOutputs/common/http/dry-run-proxy.js +68 -111
- package/tsOutputs/common/http/dry-run-proxy.js.map +1 -1
- package/tsOutputs/common/http/entities-mapper.js +6 -9
- package/tsOutputs/common/http/entities-mapper.js.map +1 -1
- package/tsOutputs/common/http/http-client.js +76 -86
- package/tsOutputs/common/http/http-client.js.map +1 -1
- package/tsOutputs/common/http/sl-routes.js +119 -122
- package/tsOutputs/common/http/sl-routes.js.map +1 -1
- package/tsOutputs/common/ignored-files-handler.js +48 -49
- package/tsOutputs/common/ignored-files-handler.js.map +1 -1
- package/tsOutputs/common/logger.js +66 -88
- package/tsOutputs/common/logger.js.map +1 -1
- package/tsOutputs/common/messages-formatter.js +9 -14
- package/tsOutputs/common/messages-formatter.js.map +1 -1
- package/tsOutputs/common/no-op-state-tracker.js +14 -37
- package/tsOutputs/common/no-op-state-tracker.js.map +1 -1
- package/tsOutputs/common/queue.js +18 -36
- package/tsOutputs/common/queue.js.map +1 -1
- package/tsOutputs/common/scm/git-cloner.js +30 -94
- package/tsOutputs/common/scm/git-cloner.js.map +1 -1
- package/tsOutputs/common/scm/git-format-builder.js +24 -25
- package/tsOutputs/common/scm/git-format-builder.js.map +1 -1
- package/tsOutputs/common/scm/git.js +192 -327
- package/tsOutputs/common/scm/git.js.map +1 -1
- package/tsOutputs/common/scm/none.js +58 -110
- package/tsOutputs/common/scm/none.js.map +1 -1
- package/tsOutputs/common/scm/scm-factory.js +6 -9
- package/tsOutputs/common/scm/scm-factory.js.map +1 -1
- package/tsOutputs/common/short-name-to-file-mapper.js +30 -33
- package/tsOutputs/common/short-name-to-file-mapper.js.map +1 -1
- package/tsOutputs/common/source-map-handler.js +76 -98
- package/tsOutputs/common/source-map-handler.js.map +1 -1
- package/tsOutputs/common/source-map-reader.js +35 -36
- package/tsOutputs/common/source-map-reader.js.map +1 -1
- package/tsOutputs/common/source-maps-utils.js +8 -11
- package/tsOutputs/common/source-maps-utils.js.map +1 -1
- package/tsOutputs/common/state-tracker-fpv6.js +15 -37
- package/tsOutputs/common/state-tracker-fpv6.js.map +1 -1
- package/tsOutputs/common/state-tracker.js +124 -212
- package/tsOutputs/common/state-tracker.js.map +1 -1
- package/tsOutputs/common/system-date.js +3 -3
- package/tsOutputs/common/system-date.js.map +1 -1
- package/tsOutputs/common/utils/abstract-data-builder.js +8 -9
- package/tsOutputs/common/utils/abstract-data-builder.js.map +1 -1
- package/tsOutputs/common/utils/build-session-data-builder.js +25 -79
- package/tsOutputs/common/utils/build-session-data-builder.js.map +1 -1
- package/tsOutputs/common/utils/dependency-utils.js +13 -16
- package/tsOutputs/common/utils/dependency-utils.js.map +1 -1
- package/tsOutputs/common/utils/env-var-parsing.js +10 -14
- package/tsOutputs/common/utils/env-var-parsing.js.map +1 -1
- package/tsOutputs/common/utils/files-utils.js +16 -19
- package/tsOutputs/common/utils/files-utils.js.map +1 -1
- package/tsOutputs/common/utils/process-utils.js +12 -25
- package/tsOutputs/common/utils/process-utils.js.map +1 -1
- package/tsOutputs/common/utils/test-runner-build-session-data-builder.js +16 -62
- package/tsOutputs/common/utils/test-runner-build-session-data-builder.js.map +1 -1
- package/tsOutputs/common/utils/test-utils/mock-server-utils/mock-server-proxy.js +120 -192
- package/tsOutputs/common/utils/test-utils/mock-server-utils/mock-server-proxy.js.map +1 -1
- package/tsOutputs/common/utils/timer-utils.js +4 -7
- package/tsOutputs/common/utils/timer-utils.js.map +1 -1
- package/tsOutputs/common/utils/token-data-builder.js +30 -50
- package/tsOutputs/common/utils/token-data-builder.js.map +1 -1
- package/tsOutputs/common/utils/validation-utils.js +7 -10
- package/tsOutputs/common/utils/validation-utils.js.map +1 -1
- package/tsOutputs/common/uuid.js +7 -10
- package/tsOutputs/common/uuid.js.map +1 -1
- package/tsOutputs/common/v8-utils.js +12 -50
- package/tsOutputs/common/v8-utils.js.map +1 -1
- package/tsOutputs/common/watchdog.js +35 -56
- package/tsOutputs/common/watchdog.js.map +1 -1
- package/tsOutputs/mocha-reporter/index.js +12 -12
- package/tsOutputs/mocha-reporter/index.js.map +1 -1
- package/tsOutputs/mocha-reporter/otel-agent.js +47 -118
- package/tsOutputs/mocha-reporter/otel-agent.js.map +1 -1
- package/tsOutputs/test-listener/SlNodeJsProxy.js +34 -35
- package/tsOutputs/test-listener/SlNodeJsProxy.js.map +1 -1
- package/tsOutputs/test-listener/UserMessageHelper.js +14 -19
- package/tsOutputs/test-listener/UserMessageHelper.js.map +1 -1
- package/tsOutputs/test-listener/agent-loader.js +42 -59
- package/tsOutputs/test-listener/agent-loader.js.map +1 -1
- package/tsOutputs/test-listener/agent.js +93 -150
- package/tsOutputs/test-listener/agent.js.map +1 -1
- package/tsOutputs/test-listener/api.js +36 -70
- package/tsOutputs/test-listener/api.js.map +1 -1
- package/tsOutputs/test-listener/base-proxy.js +25 -27
- package/tsOutputs/test-listener/base-proxy.js.map +1 -1
- package/tsOutputs/test-listener/bootstrap.js +6 -6
- package/tsOutputs/test-listener/bootstrap.js.map +1 -1
- package/tsOutputs/test-listener/child-process-patcher.js +10 -10
- package/tsOutputs/test-listener/child-process-patcher.js.map +1 -1
- package/tsOutputs/test-listener/cli.js +27 -30
- package/tsOutputs/test-listener/cli.js.map +1 -1
- package/tsOutputs/test-listener/coloring/http-coloring.js +30 -33
- package/tsOutputs/test-listener/coloring/http-coloring.js.map +1 -1
- package/tsOutputs/test-listener/coloring/listening-port.js +14 -17
- package/tsOutputs/test-listener/coloring/listening-port.js.map +1 -1
- package/tsOutputs/test-listener/command-line-arg-parser.js +12 -15
- package/tsOutputs/test-listener/command-line-arg-parser.js.map +1 -1
- package/tsOutputs/test-listener/config-process/config-loader.js +21 -22
- package/tsOutputs/test-listener/config-process/config-loader.js.map +1 -1
- package/tsOutputs/test-listener/config-process/config-system.js +100 -127
- package/tsOutputs/test-listener/config-process/config-system.js.map +1 -1
- package/tsOutputs/test-listener/config-process/index.js +38 -57
- package/tsOutputs/test-listener/config-process/index.js.map +1 -1
- package/tsOutputs/test-listener/config.js +38 -59
- package/tsOutputs/test-listener/config.js.map +1 -1
- package/tsOutputs/test-listener/entities/BasicConfigurationData.js +37 -64
- package/tsOutputs/test-listener/entities/BasicConfigurationData.js.map +1 -1
- package/tsOutputs/test-listener/entities/build-scanner/ConfigModeData.js +17 -42
- package/tsOutputs/test-listener/entities/build-scanner/ConfigModeData.js.map +1 -1
- package/tsOutputs/test-listener/entities/build-scanner/ScanModeData.js +19 -45
- package/tsOutputs/test-listener/entities/build-scanner/ScanModeData.js.map +1 -1
- package/tsOutputs/test-listener/environment-data-service.js +10 -11
- package/tsOutputs/test-listener/environment-data-service.js.map +1 -1
- package/tsOutputs/test-listener/execution-process/entities-mapper.js +11 -14
- package/tsOutputs/test-listener/execution-process/entities-mapper.js.map +1 -1
- package/tsOutputs/test-listener/execution-process/execution-service-proxy.js +54 -72
- package/tsOutputs/test-listener/execution-process/execution-service-proxy.js.map +1 -1
- package/tsOutputs/test-listener/execution-process/index.js +26 -26
- package/tsOutputs/test-listener/execution-process/index.js.map +1 -1
- package/tsOutputs/test-listener/factory.js +140 -175
- package/tsOutputs/test-listener/factory.js.map +1 -1
- package/tsOutputs/test-listener/footprints-process/footprints-service-proxy.js +17 -34
- package/tsOutputs/test-listener/footprints-process/footprints-service-proxy.js.map +1 -1
- package/tsOutputs/test-listener/footprints-process/index.js +53 -58
- package/tsOutputs/test-listener/footprints-process/index.js.map +1 -1
- package/tsOutputs/test-listener/footprints-process/istanbul-to-footprints-base.js +49 -50
- package/tsOutputs/test-listener/footprints-process/istanbul-to-footprints-base.js.map +1 -1
- package/tsOutputs/test-listener/footprints-process/istanbul-to-footprints-v3.js +98 -117
- package/tsOutputs/test-listener/footprints-process/istanbul-to-footprints-v3.js.map +1 -1
- package/tsOutputs/test-listener/footprints-process/ts-node-hits-collector.js +57 -141
- package/tsOutputs/test-listener/footprints-process/ts-node-hits-collector.js.map +1 -1
- package/tsOutputs/test-listener/integrations/SlGulp.js +25 -26
- package/tsOutputs/test-listener/integrations/SlGulp.js.map +1 -1
- package/tsOutputs/test-listener/logs-process/index.js +30 -35
- package/tsOutputs/test-listener/logs-process/index.js.map +1 -1
- package/tsOutputs/test-listener/logs-process/log-service-proxy.js +8 -25
- package/tsOutputs/test-listener/logs-process/log-service-proxy.js.map +1 -1
- package/tsOutputs/test-listener/nyc-report-executor-fpv6.js +53 -110
- package/tsOutputs/test-listener/nyc-report-executor-fpv6.js.map +1 -1
- package/tsOutputs/test-listener/nyc-report-executor.js +48 -85
- package/tsOutputs/test-listener/nyc-report-executor.js.map +1 -1
- package/tsOutputs/test-listener/otel-agent-loader.js +30 -33
- package/tsOutputs/test-listener/otel-agent-loader.js.map +1 -1
- package/tsOutputs/test-listener/queue.js +18 -36
- package/tsOutputs/test-listener/queue.js.map +1 -1
- package/tsOutputs/test-listener/remote-agent.js +97 -223
- package/tsOutputs/test-listener/remote-agent.js.map +1 -1
- package/tsOutputs/test-listener/resolvers/AppNameResolver.js +8 -25
- package/tsOutputs/test-listener/resolvers/AppNameResolver.js.map +1 -1
- package/tsOutputs/test-listener/resolvers/ArgumentResolver.js +11 -12
- package/tsOutputs/test-listener/resolvers/ArgumentResolver.js.map +1 -1
- package/tsOutputs/test-listener/resolvers/BuildResolver.js +8 -25
- package/tsOutputs/test-listener/resolvers/BuildResolver.js.map +1 -1
- package/tsOutputs/test-listener/resolvers/BuildSessionIdFileResolver.js +8 -25
- package/tsOutputs/test-listener/resolvers/BuildSessionIdFileResolver.js.map +1 -1
- package/tsOutputs/test-listener/resolvers/BuildSessionIdResolver.js +8 -25
- package/tsOutputs/test-listener/resolvers/BuildSessionIdResolver.js.map +1 -1
- package/tsOutputs/test-listener/resolvers/ProxyResolver.js +8 -25
- package/tsOutputs/test-listener/resolvers/ProxyResolver.js.map +1 -1
- package/tsOutputs/test-listener/resolvers/TokenResolver.js +8 -25
- package/tsOutputs/test-listener/resolvers/TokenResolver.js.map +1 -1
- package/tsOutputs/test-listener/state-tracker-process/index.js +54 -74
- package/tsOutputs/test-listener/state-tracker-process/index.js.map +1 -1
- package/tsOutputs/test-listener/state-tracker-process/state-tracker-proxy.js +18 -37
- package/tsOutputs/test-listener/state-tracker-process/state-tracker-proxy.js.map +1 -1
- package/tsOutputs/test-listener/test-recommendation-handler.js +66 -109
- package/tsOutputs/test-listener/test-recommendation-handler.js.map +1 -1
- package/tsOutputs/test-listener/upload-report-handler.js +33 -35
- package/tsOutputs/test-listener/upload-report-handler.js.map +1 -1
- package/tsOutputs/test-listener/utils.js +13 -14
- package/tsOutputs/test-listener/utils.js.map +1 -1
- package/tsOutputs/test-listener/uuid.js +7 -10
- package/tsOutputs/test-listener/uuid.js.map +1 -1
- package/tsOutputs/test-listener/wait-for-multiple-callbacks.js +17 -19
- package/tsOutputs/test-listener/wait-for-multiple-callbacks.js.map +1 -1
- package/tsOutputs/test-listener/watchdog.js +32 -51
- package/tsOutputs/test-listener/watchdog.js.map +1 -1
- package/tsOutputs/build-scanner/mappings/scm-file-fixer.js +0 -96
- package/tsOutputs/build-scanner/mappings/scm-file-fixer.js.map +0 -1
|
@@ -1,31 +1,11 @@
|
|
|
1
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
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
14
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
15
|
-
if (ar || !(i in from)) {
|
|
16
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
17
|
-
ar[i] = from[i];
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
21
|
-
};
|
|
22
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
3
|
exports.FileEnricher = void 0;
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
4
|
+
const FileSignature = require("../js_diff/file-signature");
|
|
5
|
+
const path = require("path");
|
|
6
|
+
const fs = require("fs");
|
|
7
|
+
class FileEnricher {
|
|
8
|
+
constructor(logger, diagnosticCollector, opts, scmRootDir, scmFilesContainer, config) {
|
|
29
9
|
this.logger = logger;
|
|
30
10
|
this.diagnosticCollector = diagnosticCollector;
|
|
31
11
|
this.opts = opts;
|
|
@@ -33,114 +13,107 @@ var FileEnricher = /** @class */ (function () {
|
|
|
33
13
|
this.scmFilesContainer = scmFilesContainer;
|
|
34
14
|
this.config = config;
|
|
35
15
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
for (
|
|
39
|
-
var file = _a[_i];
|
|
16
|
+
enrichFiles(res) {
|
|
17
|
+
const result = Object.assign(Object.assign({}, res), { files: [...res.files] });
|
|
18
|
+
for (const file of result.files) {
|
|
40
19
|
if (file.absolutePath && file.fromSourceMaps) {
|
|
41
20
|
if (this.isFileSupported(file.absolutePath)) {
|
|
42
21
|
try {
|
|
43
|
-
|
|
22
|
+
const currentFileSource = this.getFileSignature(file.absolutePath, file.logicalPath);
|
|
44
23
|
file.methods = this.enrichItems(currentFileSource, file.methods, CodeElementsType.METHOD, file.positionToMethod, file.endPositionToMethod);
|
|
45
24
|
file.branches = this.enrichItems(currentFileSource, file.branches, CodeElementsType.BRANCH, file.positionToBranch, {});
|
|
46
25
|
}
|
|
47
26
|
catch (e) {
|
|
48
|
-
this.logger.error(
|
|
27
|
+
this.logger.error(`Error while enriching file ${file.absolutePath}`, e);
|
|
49
28
|
}
|
|
50
29
|
}
|
|
51
30
|
}
|
|
52
31
|
else {
|
|
53
|
-
this.logger.info(
|
|
32
|
+
this.logger.info(`File ${file.absolutePath} not resolved from source maps, skipping enrichment`);
|
|
54
33
|
this.diagnosticCollector.skipEnrichment(file.absolutePath, 'not from source maps');
|
|
55
34
|
}
|
|
56
35
|
}
|
|
57
36
|
return result;
|
|
58
|
-
}
|
|
59
|
-
|
|
37
|
+
}
|
|
38
|
+
isFileSupported(absolutePath) {
|
|
60
39
|
if (!fs.existsSync(absolutePath)) {
|
|
61
|
-
this.logger.warn(
|
|
40
|
+
this.logger.warn(`Source file '${absolutePath}' does not exists, skipping enrichment`);
|
|
62
41
|
return false;
|
|
63
42
|
}
|
|
64
|
-
|
|
65
|
-
|
|
43
|
+
const validExtensions = ['.ts', '.jsx', '.js', '.tsx'];
|
|
44
|
+
const extension = path.extname(absolutePath);
|
|
66
45
|
if (!validExtensions.includes(extension)) {
|
|
67
|
-
this.logger.info(
|
|
46
|
+
this.logger.info(`Extension '${extension}' for file '${absolutePath}' is not supported, skipping enrichment`);
|
|
68
47
|
this.diagnosticCollector.skipEnrichment(absolutePath, 'not valid extension');
|
|
69
48
|
return false;
|
|
70
49
|
}
|
|
71
50
|
return true;
|
|
72
|
-
}
|
|
73
|
-
|
|
51
|
+
}
|
|
52
|
+
getItemsMap(resolvePositionToElement, currentFileSource, type, resolveEndPositionToElement) {
|
|
74
53
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
for (
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
var sourceIdxByEnd = type === CodeElementsType.BRANCH ? -1 : this.getIdxByPosition(resolvedIdxToEndPosition[+idx], sourceFileEndPositionMap);
|
|
54
|
+
const sourceFileStartPositionMap = type == CodeElementsType.METHOD ? currentFileSource.positionToMethod : currentFileSource.positionToBranchMap;
|
|
55
|
+
const sourceFileEndPositionMap = type == CodeElementsType.METHOD ? currentFileSource.endPositionToMethod : {};
|
|
56
|
+
const sourceElements = type == CodeElementsType.METHOD ? currentFileSource.methods : currentFileSource.branches;
|
|
57
|
+
const sourceFileIdxToStartPosition = this.itemIndexToPosition(sourceFileStartPositionMap);
|
|
58
|
+
const resolvedIdxToStartPosition = this.itemIndexToPosition(resolvePositionToElement);
|
|
59
|
+
const resolvedIdxToEndPosition = type === CodeElementsType.BRANCH ? {} : this.itemIndexToPosition(resolveEndPositionToElement);
|
|
60
|
+
const itemsToEnrich = [];
|
|
61
|
+
const itemsToMarkAsAutoGenerate = [];
|
|
62
|
+
const itemsToAdd = [];
|
|
63
|
+
for (const [idx, startPositions] of Object.entries(resolvedIdxToStartPosition)) {
|
|
64
|
+
const sourceIdxByStart = this.getIdxByPosition(startPositions, sourceFileStartPositionMap);
|
|
65
|
+
const sourceIdxByEnd = type === CodeElementsType.BRANCH ? -1 : this.getIdxByPosition(resolvedIdxToEndPosition[+idx], sourceFileEndPositionMap);
|
|
88
66
|
if (sourceIdxByStart > -1) {
|
|
89
67
|
itemsToEnrich.push({ resolvedIdx: +idx, sourceIdx: sourceIdxByStart });
|
|
90
|
-
this.logger.debug(
|
|
68
|
+
this.logger.debug(`Item starts at '${(_c = (_b = (_a = sourceElements[sourceIdxByStart]) === null || _a === void 0 ? void 0 : _a.srcData) === null || _b === void 0 ? void 0 : _b.position) === null || _c === void 0 ? void 0 : _c.join(',')}' in file '${currentFileSource.absolutePath}' will be enriched`);
|
|
91
69
|
}
|
|
92
70
|
else if (sourceIdxByEnd > -1 && ((_e = (_d = sourceElements[sourceIdxByEnd]) === null || _d === void 0 ? void 0 : _d.techSpecificInfo) === null || _e === void 0 ? void 0 : _e.isDecorated)) {
|
|
93
71
|
itemsToEnrich.push({ resolvedIdx: +idx, sourceIdx: sourceIdxByEnd });
|
|
94
|
-
this.logger.debug(
|
|
72
|
+
this.logger.debug(`Item starts at '${(_h = (_g = (_f = sourceElements[sourceIdxByEnd]) === null || _f === void 0 ? void 0 : _f.srcData) === null || _g === void 0 ? void 0 : _g.position) === null || _h === void 0 ? void 0 : _h.join(',')}' in file '${currentFileSource.absolutePath}' is a decorated method, will be enriched by end position matching`);
|
|
95
73
|
}
|
|
96
74
|
else {
|
|
97
75
|
itemsToMarkAsAutoGenerate.push(+idx);
|
|
98
|
-
this.logger.debug(
|
|
76
|
+
this.logger.debug(`Could not find source element in any of the following positions '${startPositions.join(' || ')}' in file '${currentFileSource.absolutePath}', marking as auto generated`);
|
|
99
77
|
}
|
|
100
78
|
}
|
|
101
79
|
if (type === CodeElementsType.METHOD) {
|
|
102
|
-
for (
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
var isDecorated = resolvedIdxByEnd > -1 && ((_k = (_j = sourceElements[+idx]) === null || _j === void 0 ? void 0 : _j.techSpecificInfo) === null || _k === void 0 ? void 0 : _k.isDecorated) == true;
|
|
80
|
+
for (const [idx, startPositions] of Object.entries(sourceFileIdxToStartPosition)) {
|
|
81
|
+
const resolvedIdxByStart = this.getIdxByPosition(startPositions, resolvePositionToElement);
|
|
82
|
+
const resolvedIdxByEnd = this.getIdxByPosition(resolvedIdxToEndPosition[+idx], resolveEndPositionToElement);
|
|
83
|
+
const isDecorated = resolvedIdxByEnd > -1 && ((_k = (_j = sourceElements[+idx]) === null || _j === void 0 ? void 0 : _j.techSpecificInfo) === null || _k === void 0 ? void 0 : _k.isDecorated) == true;
|
|
107
84
|
if (resolvedIdxByStart === -1 && !isDecorated) {
|
|
108
85
|
itemsToAdd.push(+idx);
|
|
109
|
-
this.logger.debug(
|
|
86
|
+
this.logger.debug(`Element in file '${currentFileSource.absolutePath}' at position '${sourceElements[idx].position}' not exists in generated file`);
|
|
110
87
|
}
|
|
111
88
|
}
|
|
112
89
|
}
|
|
113
|
-
return { itemsToEnrich
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
var position = startPositions_1[_i];
|
|
119
|
-
var sourceIdx = sourceFilePositionMap[position];
|
|
90
|
+
return { itemsToEnrich, itemsToMarkAsAutoGenerate, itemsToAdd };
|
|
91
|
+
}
|
|
92
|
+
getIdxByPosition(startPositions = [], sourceFilePositionMap) {
|
|
93
|
+
for (const position of startPositions) {
|
|
94
|
+
const sourceIdx = sourceFilePositionMap[position];
|
|
120
95
|
if (sourceIdx > -1) {
|
|
121
96
|
return sourceIdx;
|
|
122
97
|
}
|
|
123
98
|
}
|
|
124
99
|
return -1;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
|
|
100
|
+
}
|
|
101
|
+
enrichItems(currentFileSource, codeItems, type, positionToElement, resolveEndPositionToElement) {
|
|
102
|
+
const result = [];
|
|
128
103
|
if (currentFileSource) {
|
|
129
|
-
|
|
130
|
-
for (
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
var codeItemCopy = __assign({}, codeItem);
|
|
104
|
+
const { itemsToEnrich, itemsToMarkAsAutoGenerate } = this.getItemsMap(positionToElement, currentFileSource, type, resolveEndPositionToElement);
|
|
105
|
+
for (const idx of itemsToMarkAsAutoGenerate) {
|
|
106
|
+
const codeItem = codeItems[idx];
|
|
107
|
+
const codeItemCopy = Object.assign({}, codeItem);
|
|
134
108
|
codeItemCopy.techSpecificInfo.autoGenerated = true;
|
|
135
109
|
result.push(codeItemCopy);
|
|
136
110
|
if (type === CodeElementsType.METHOD) {
|
|
137
111
|
this.diagnosticCollector.autoGeneratedMethod(currentFileSource.absolutePath, codeItemCopy.uniqueId);
|
|
138
112
|
}
|
|
139
113
|
}
|
|
140
|
-
for (
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
var codeItemCopy = __assign({}, codeItem);
|
|
114
|
+
for (const item of itemsToEnrich) {
|
|
115
|
+
const codeItem = codeItems[item.resolvedIdx];
|
|
116
|
+
const codeItemCopy = Object.assign({}, codeItem);
|
|
144
117
|
if (type === CodeElementsType.METHOD) {
|
|
145
118
|
this.enrichMethod(codeItemCopy, currentFileSource.methods[item.sourceIdx]);
|
|
146
119
|
}
|
|
@@ -151,20 +124,19 @@ var FileEnricher = /** @class */ (function () {
|
|
|
151
124
|
}
|
|
152
125
|
}
|
|
153
126
|
return result;
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
for (
|
|
158
|
-
var _b = _a[_i], position = _b[0], idx = _b[1];
|
|
127
|
+
}
|
|
128
|
+
itemIndexToPosition(positionMap) {
|
|
129
|
+
const itemToPosition = {};
|
|
130
|
+
for (const [position, idx] of Object.entries(positionMap)) {
|
|
159
131
|
itemToPosition[idx] = itemToPosition[idx] || [];
|
|
160
132
|
itemToPosition[idx].push(position);
|
|
161
133
|
}
|
|
162
134
|
return itemToPosition;
|
|
163
|
-
}
|
|
164
|
-
|
|
135
|
+
}
|
|
136
|
+
enrichMethod(generatedMethod, sourceMethod) {
|
|
165
137
|
generatedMethod.displayName = sourceMethod.srcData.displayName;
|
|
166
|
-
generatedMethod.meta =
|
|
167
|
-
generatedMethod.techSpecificInfo =
|
|
138
|
+
generatedMethod.meta = Object.assign({}, sourceMethod.meta);
|
|
139
|
+
generatedMethod.techSpecificInfo = Object.assign({}, sourceMethod.techSpecificInfo);
|
|
168
140
|
if (generatedMethod.techSpecificInfo.isAsync) {
|
|
169
141
|
generatedMethod.hash = sourceMethod.srcData.hash;
|
|
170
142
|
generatedMethod.sigHash = sourceMethod.srcData.sigHash;
|
|
@@ -175,11 +147,11 @@ var FileEnricher = /** @class */ (function () {
|
|
|
175
147
|
generatedMethod.hash = sourceMethod.srcData.hash;
|
|
176
148
|
generatedMethod.sigHash = sourceMethod.srcData.sigHash;
|
|
177
149
|
}
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
|
|
150
|
+
}
|
|
151
|
+
getFileSignature(absolutePath, logicalPath) {
|
|
152
|
+
const babylonPlugins = Array.isArray(this.opts.babylonPlugins) ? [...this.opts.babylonPlugins] : [];
|
|
181
153
|
babylonPlugins.push('classProperties');
|
|
182
|
-
|
|
154
|
+
const extension = path.extname(absolutePath);
|
|
183
155
|
if (extension === '.jsx' || extension === '.tsx') {
|
|
184
156
|
if (babylonPlugins.indexOf('jsx') === -1) {
|
|
185
157
|
this.diagnosticCollector.pluginAdded(absolutePath, 'jsx');
|
|
@@ -190,15 +162,15 @@ var FileEnricher = /** @class */ (function () {
|
|
|
190
162
|
this.diagnosticCollector.pluginAdded(absolutePath, 'typescript');
|
|
191
163
|
babylonPlugins.push('typescript');
|
|
192
164
|
}
|
|
193
|
-
|
|
165
|
+
const opts = {
|
|
194
166
|
es6Modules: true,
|
|
195
|
-
babylonPlugins
|
|
167
|
+
babylonPlugins,
|
|
196
168
|
projectRoot: this.opts.projectRoot,
|
|
197
169
|
scmRootDir: this.scmRootDir,
|
|
198
170
|
isBranchCoverage: this.config.useBranchCoverage || this.opts.usebranchcoverage,
|
|
199
171
|
isForEnrichment: true,
|
|
200
172
|
};
|
|
201
|
-
|
|
173
|
+
const fileContent = fs.readFileSync(absolutePath, 'utf-8');
|
|
202
174
|
do {
|
|
203
175
|
try {
|
|
204
176
|
return FileSignature.create(absolutePath, logicalPath, fileContent, null, opts, this.scmFilesContainer, this.logger, this.diagnosticCollector);
|
|
@@ -213,9 +185,8 @@ var FileEnricher = /** @class */ (function () {
|
|
|
213
185
|
}
|
|
214
186
|
}
|
|
215
187
|
} while (true);
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
}());
|
|
188
|
+
}
|
|
189
|
+
}
|
|
219
190
|
exports.FileEnricher = FileEnricher;
|
|
220
191
|
var CodeElementsType;
|
|
221
192
|
(function (CodeElementsType) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file-enricher.js","sourceRoot":"","sources":["../../../build-scanner/mappings/file-enricher.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"file-enricher.js","sourceRoot":"","sources":["../../../build-scanner/mappings/file-enricher.ts"],"names":[],"mappings":";;;AAAA,2DAA4D;AAE5D,6BAA8B;AAE9B,yBAAyB;AAYzB,MAAa,YAAY;IACrB,YACqB,MAAc,EACd,mBAAwC,EACxC,IAAS,EACT,UAAkB,EAClB,iBAAoC,EACpC,MAA2B;QAL3B,WAAM,GAAN,MAAM,CAAQ;QACd,wBAAmB,GAAnB,mBAAmB,CAAqB;QACxC,SAAI,GAAJ,IAAI,CAAK;QACT,eAAU,GAAV,UAAU,CAAQ;QAClB,sBAAiB,GAAjB,iBAAiB,CAAmB;QACpC,WAAM,GAAN,MAAM,CAAqB;IAEhD,CAAC;IAED,WAAW,CAAC,GAAwB;QAChC,MAAM,MAAM,mCAA6B,GAAG,KAAE,KAAK,EAAE,CAAC,GAAG,GAAG,CAAC,KAAK,CAAC,GAAE,CAAA;QACrE,KAAK,MAAM,IAAI,IAAI,MAAM,CAAC,KAAK,EAAE;YAC7B,IAAI,IAAI,CAAC,YAAY,IAAI,IAAI,CAAC,cAAc,EAAE;gBAC1C,IAAI,IAAI,CAAC,eAAe,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,MAAM,EAAE,IAAI,CAAC,mBAAmB,CAAC,CAAC;aACtE;YAAC,OAAO,KAAK,EAAE;gBACZ,IAAI,KAAK,CAAC,aAAa,EAAE;oBACrB,IAAI,CAAC,mBAAmB,CAAC,YAAY,CAAC,YAAY,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC;oBAC5E,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC;iBACpD;qBAAM;oBACH,MAAM,KAAK,CAAC;iBACf;aACJ;SACJ,QAAQ,IAAI,EAAE;IACnB,CAAC;CAEJ;AApMD,oCAoMC;AACD,IAAK,gBAGJ;AAHD,WAAK,gBAAgB;IACjB,qCAAiB,CAAA;IACjB,qCAAiB,CAAA;AACrB,CAAC,EAHI,gBAAgB,KAAhB,gBAAgB,QAGpB"}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FilePathFixer = void 0;
|
|
4
|
+
const path_1 = require("path");
|
|
5
|
+
const files_utils_1 = require("../../common/utils/files-utils");
|
|
6
|
+
const file_element_utils_1 = require("./file-element-utils");
|
|
7
|
+
const sl_mapper_1 = require("../js_diff/sl-mapper");
|
|
8
|
+
const cockpit_notifier_1 = require("../../common/agent-events/cockpit-notifier");
|
|
9
|
+
class FilePathFixer {
|
|
10
|
+
constructor(filesContainer, slMapper, logger, diagnostic, useModulePrefix, uniqueModuleId) {
|
|
11
|
+
this.filesContainer = filesContainer;
|
|
12
|
+
this.slMapper = slMapper;
|
|
13
|
+
this.logger = logger;
|
|
14
|
+
this.diagnostic = diagnostic;
|
|
15
|
+
this.prefix = '';
|
|
16
|
+
this.removeAutoGeneratedFiles = false;
|
|
17
|
+
if (useModulePrefix) {
|
|
18
|
+
this.setPrefix(uniqueModuleId);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
setPrefix(uniqueModuleId) {
|
|
22
|
+
if (uniqueModuleId) {
|
|
23
|
+
this.prefix = `${uniqueModuleId}/`;
|
|
24
|
+
}
|
|
25
|
+
if (this.prefix) {
|
|
26
|
+
cockpit_notifier_1.CockpitNotifier.sendGenericMessage(`Using '${this.prefix}' as prefix to files path and uniqueIds, moduleName: '${uniqueModuleId}'`);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
fixFilePathes(files, projectRoot) {
|
|
30
|
+
const fixedProjectRoot = (0, path_1.normalize)(projectRoot);
|
|
31
|
+
const duplicatesMatchFiles = [];
|
|
32
|
+
let prefixToAdd = '';
|
|
33
|
+
const uniqueFiles = [...files];
|
|
34
|
+
for (const file of files) {
|
|
35
|
+
const filesFromFileContainer = this.findPathInFilesContainer(file.logicalPath);
|
|
36
|
+
// will be processed later
|
|
37
|
+
if (filesFromFileContainer.length > 1) {
|
|
38
|
+
duplicatesMatchFiles.push(file);
|
|
39
|
+
continue;
|
|
40
|
+
}
|
|
41
|
+
// perfect case - processing
|
|
42
|
+
if (filesFromFileContainer.length === 1) {
|
|
43
|
+
const fullFilePath = filesFromFileContainer[0];
|
|
44
|
+
prefixToAdd = fullFilePath.replace(file.logicalPath, '');
|
|
45
|
+
this.fixOneFile(file, fullFilePath, fixedProjectRoot);
|
|
46
|
+
continue;
|
|
47
|
+
}
|
|
48
|
+
// remove file from build map if flag allow that
|
|
49
|
+
if (this.removeAutoGeneratedFiles) {
|
|
50
|
+
this.logger.info(`Cannot find file ${file.logicalPath} in source files. File is auto generated.`);
|
|
51
|
+
const indexToRemove = uniqueFiles.indexOf(file);
|
|
52
|
+
uniqueFiles.splice(indexToRemove, 1);
|
|
53
|
+
continue;
|
|
54
|
+
}
|
|
55
|
+
// fallback - source file was not found, trying to resolve path only by references from build map
|
|
56
|
+
const fixedPath = file.logicalPath.replace(fixedProjectRoot, '');
|
|
57
|
+
this.fixOneFile(file, fixedPath, fixedProjectRoot);
|
|
58
|
+
}
|
|
59
|
+
for (const fileToFix of duplicatesMatchFiles) {
|
|
60
|
+
const fullScmFile = files_utils_1.FilesUtils.adjustPathSlashes(`${prefixToAdd}${fileToFix.logicalPath}`);
|
|
61
|
+
this.fixOneFile(fileToFix, fullScmFile, fixedProjectRoot);
|
|
62
|
+
}
|
|
63
|
+
return uniqueFiles;
|
|
64
|
+
}
|
|
65
|
+
fixOneFile(file, filePath, fixedProjectRoot) {
|
|
66
|
+
const fixedFilePath = files_utils_1.FilesUtils.adjustPathSlashes(filePath);
|
|
67
|
+
if ((this.slMapper instanceof sl_mapper_1.SlMapper) && !(this.slMapper instanceof sl_mapper_1.BrowserSlMapper)) {
|
|
68
|
+
this.slMapper.addMapping(file.logicalPath, fixedFilePath);
|
|
69
|
+
}
|
|
70
|
+
file.logicalPath = this.getLogicalPath(fixedFilePath);
|
|
71
|
+
file.physicalPath = fixedFilePath;
|
|
72
|
+
file.absolutePath = this.getAbsolutePath(fixedFilePath, fixedProjectRoot);
|
|
73
|
+
file.methods.forEach(method => {
|
|
74
|
+
method.uniqueId = `${files_utils_1.FilesUtils.adjustPathSlashes(file.logicalPath)}@${method.position.join(',')}`;
|
|
75
|
+
if (this.slMapper instanceof sl_mapper_1.BrowserSlMapper) {
|
|
76
|
+
this.slMapper.addMapping(method.uniqueIdKey, method.uniqueId);
|
|
77
|
+
}
|
|
78
|
+
delete method.uniqueIdKey;
|
|
79
|
+
});
|
|
80
|
+
file.branches.forEach(branch => {
|
|
81
|
+
const position = (0, file_element_utils_1.getBranchPosition)(branch);
|
|
82
|
+
branch.uniqueId = `${files_utils_1.FilesUtils.adjustPathSlashes(file.logicalPath)}|${position.join(',')}|${branch.index}`;
|
|
83
|
+
if (this.slMapper instanceof sl_mapper_1.BrowserSlMapper) {
|
|
84
|
+
this.slMapper.addMapping(branch.uniqueIdKey, branch.uniqueId);
|
|
85
|
+
}
|
|
86
|
+
delete branch.uniqueIdKey;
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
getLogicalPath(fixedPath) {
|
|
90
|
+
let pathWithPrefix = `${this.prefix}${fixedPath}`;
|
|
91
|
+
if (pathWithPrefix.indexOf('/') === 0) {
|
|
92
|
+
pathWithPrefix = pathWithPrefix.substring(1);
|
|
93
|
+
}
|
|
94
|
+
return pathWithPrefix;
|
|
95
|
+
}
|
|
96
|
+
getAbsolutePath(fixedPath, fixedProjectRoot) {
|
|
97
|
+
const absolutePath = (0, path_1.join)(fixedProjectRoot, fixedPath);
|
|
98
|
+
return files_utils_1.FilesUtils.adjustPathSlashes(absolutePath);
|
|
99
|
+
}
|
|
100
|
+
findPathInFilesContainer(sourceFilePath) {
|
|
101
|
+
const files = this.filesContainer.getFilePath(sourceFilePath);
|
|
102
|
+
return files !== null ? files : [];
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
exports.FilePathFixer = FilePathFixer;
|
|
106
|
+
//# sourceMappingURL=file-path-fixer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-path-fixer.js","sourceRoot":"","sources":["../../../build-scanner/mappings/file-path-fixer.ts"],"names":[],"mappings":";;;AAAA,+BAAuC;AAEvC,gEAA4D;AAE5D,6DAAyD;AACzD,oDAAiE;AACjE,iFAA6E;AAO7E,MAAa,aAAa;IAItB,YAAsB,cAA8B,EACtC,QAAkB,EAClB,MAAc,EACd,UAA+B,EACzC,eAAyB,EACzB,cAAuB;QALL,mBAAc,GAAd,cAAc,CAAgB;QACtC,aAAQ,GAAR,QAAQ,CAAU;QAClB,WAAM,GAAN,MAAM,CAAQ;QACd,eAAU,GAAV,UAAU,CAAqB;QANrC,WAAM,GAAW,EAAE,CAAC;QAClB,6BAAwB,GAAY,KAAK,CAAC;QAShD,IAAG,eAAe,EAAC;YACf,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;SAClC;IACL,CAAC;IAEO,SAAS,CAAC,cAAsB;QACpC,IAAG,cAAc,EAAC;YACd,IAAI,CAAC,MAAM,GAAG,GAAG,cAAc,GA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Aa,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC,cAAc,CAAC,CAAC;QACxE,OAAO,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;IACvC,CAAC;CACJ;AAtHD,sCAsHC"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.FilesContainer = void 0;
|
|
13
|
+
const glob_1 = require("glob");
|
|
14
|
+
const utils = require("../utils");
|
|
15
|
+
/**
|
|
16
|
+
* Contains the mapping between partial file path to git path.
|
|
17
|
+
*/
|
|
18
|
+
class FilesContainer {
|
|
19
|
+
constructor(logger) {
|
|
20
|
+
this.logger = logger;
|
|
21
|
+
this.partialToFullPathMap = {};
|
|
22
|
+
}
|
|
23
|
+
static create(logger, projectRoot = process.cwd(), ignore = 'node_modules/**') {
|
|
24
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
25
|
+
const filesContainer = new FilesContainer(logger);
|
|
26
|
+
const files = glob_1.glob.sync('**/*', {
|
|
27
|
+
cwd: projectRoot,
|
|
28
|
+
ignore,
|
|
29
|
+
nodir: true,
|
|
30
|
+
});
|
|
31
|
+
files.forEach(filePath => {
|
|
32
|
+
filesContainer.addFilePath(filePath);
|
|
33
|
+
});
|
|
34
|
+
return filesContainer;
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
static createWithFiles(logger, files) {
|
|
38
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
39
|
+
const filesContainer = new FilesContainer(logger);
|
|
40
|
+
files.forEach(filePath => {
|
|
41
|
+
filesContainer.addFilePath(filePath);
|
|
42
|
+
});
|
|
43
|
+
return filesContainer;
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Add file to files map, each file has keys per each optional sub path.
|
|
48
|
+
* For example: given file 'foo/src/index.js', it gets the following keys:
|
|
49
|
+
* 1. 'foo/src/index.js'
|
|
50
|
+
* 2. 'src/index.js'
|
|
51
|
+
* 3. 'index.js'
|
|
52
|
+
*/
|
|
53
|
+
addFilePath(filePath) {
|
|
54
|
+
for (const subPath of iterateSubPathes(filePath)) {
|
|
55
|
+
this.partialToFullPathMap[subPath] = this.partialToFullPathMap[subPath] || [];
|
|
56
|
+
this.partialToFullPathMap[subPath].push(filePath);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Return files that contain partial file path
|
|
61
|
+
*/
|
|
62
|
+
getFilePath(partialPath) {
|
|
63
|
+
let filePathes = null;
|
|
64
|
+
for (const subPath of iterateSubPathes(partialPath)) {
|
|
65
|
+
filePathes = this.partialToFullPathMap[subPath] || null;
|
|
66
|
+
if ((filePathes === null || filePathes === void 0 ? void 0 : filePathes.length) === 1) {
|
|
67
|
+
break;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
if (filePathes === null) {
|
|
71
|
+
this.logger.warn(`${partialPath} has no match to any source file`);
|
|
72
|
+
}
|
|
73
|
+
return filePathes;
|
|
74
|
+
}
|
|
75
|
+
getWarningText(partialPath) {
|
|
76
|
+
return `${partialPath} has no match to any source file`;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
exports.FilesContainer = FilesContainer;
|
|
80
|
+
function* iterateSubPathes(filePath) {
|
|
81
|
+
const normalizedFilePath = utils.adjustPathSlashes(filePath);
|
|
82
|
+
const parts = normalizedFilePath.split('/');
|
|
83
|
+
for (let i = parts.length; i > 0; i--) {
|
|
84
|
+
const partsToSlice = parts.length - i;
|
|
85
|
+
const key = parts.slice(partsToSlice).join('/');
|
|
86
|
+
yield key;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
//# sourceMappingURL=files-container.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"files-container.js","sourceRoot":"","sources":["../../../build-scanner/mappings/files-container.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+BAA4B;AAE5B,kCAAkC;AAElC;;GAEG;AACH,MAAa,cAAc;IAEvB,YAAsB,MAAc;QAAd,WAAM,GAAN,MAAM,CAAQ;QAChC,IAAI,CAAC,oBAAoB,GAAG,EAAE,CAAC;IACnC,CAAC;IAED,MAAM,CAAO,MAAM,CAAC,MAAc,EAAE,cAAsB,OAAO,CAAC,GAAG,EAAE,EAAE,SAA4B,iBAAiB;;YAClH,MAAM,cAAc,GAAG,IAAI,cAAc,CAAC,MAAM,CAAC,CAAC;YAElD,MAAM,KAAK,GAAG,WAAI,CAAC,IAAI,CAAC,MAAM,EAAE;gBAC5B,GAAG,EAAE,WAAW;gBAChB,MAAM;gBACN,KAAK,EAAE,IAAI;aACd,CAAC,CAAA;YAEF,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE;gBACrB,cAAc,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;YACzC,CAAC,CAAC,CAAC;YACH,OAAO,cAAc,CAAC;QAC1B,CAAC;KAAA;IAED,MAAM,CAAO,eAAe,CAAC,MAAc,EAAE,KAAe;;YACxD,MAAM,cAAc,GAAG,IAAI,cAAc,CAAC,MAAM,CAAC,CAAC;YAClD,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE;gBACrB,cAAc,CAAC,WAAW,CAAC,QAAQ,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AAE;QACnC,MAAM,YAAY,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC;QACtC,MAAM,GAAG,GAAG,KAAK,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAChD,MAAM,GAAG,CAAC;KACb;AACL,CAAC"}
|
|
@@ -1,38 +1,34 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.FilesDataContainer = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
class FilesDataContainer {
|
|
5
|
+
constructor() {
|
|
6
6
|
this._files = {};
|
|
7
7
|
}
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
enumerable: false,
|
|
13
|
-
configurable: true
|
|
14
|
-
});
|
|
15
|
-
FilesDataContainer.prototype.addFile = function (file) {
|
|
8
|
+
get files() {
|
|
9
|
+
return Object.values(this._files);
|
|
10
|
+
}
|
|
11
|
+
addFile(file) {
|
|
16
12
|
if (!(file.absolutePath in this._files)) {
|
|
17
13
|
this._files[file.absolutePath] = file;
|
|
18
14
|
}
|
|
19
|
-
}
|
|
20
|
-
|
|
15
|
+
}
|
|
16
|
+
addMethod(path, method) {
|
|
21
17
|
var _a;
|
|
22
18
|
this._files[path] = this._files[path] || this.createEmptyFileData(path);
|
|
23
|
-
|
|
19
|
+
const index = this._files[path].methods.push(method) - 1;
|
|
24
20
|
this._files[path].positionToMethod[method.position.join(',')] = index;
|
|
25
21
|
this._files[path].endPositionToMethod[method.endPosition.join(',')] = index;
|
|
26
|
-
if ((_a = method.meta.identifierPosition) === null || _a === void 0 ? void 0 : _a.every(
|
|
22
|
+
if ((_a = method.meta.identifierPosition) === null || _a === void 0 ? void 0 : _a.every(x => x !== null)) {
|
|
27
23
|
this._files[path].positionToMethod[method.meta.identifierPosition.join(',')] = index;
|
|
28
24
|
}
|
|
29
|
-
}
|
|
30
|
-
|
|
25
|
+
}
|
|
26
|
+
addBranch(path, branch) {
|
|
31
27
|
this._files[path] = this._files[path] || this.createEmptyFileData(path);
|
|
32
|
-
|
|
33
|
-
this._files[path].positionToBranch[
|
|
34
|
-
}
|
|
35
|
-
|
|
28
|
+
const index = this._files[path].branches.push(branch) - 1;
|
|
29
|
+
this._files[path].positionToBranch[`${branch.position.join(',')}|${branch.index}`] = index;
|
|
30
|
+
}
|
|
31
|
+
createEmptyFileData(cleanPath) {
|
|
36
32
|
return {
|
|
37
33
|
lines: [],
|
|
38
34
|
methods: [],
|
|
@@ -45,8 +41,7 @@ var FilesDataContainer = /** @class */ (function () {
|
|
|
45
41
|
positionToBranch: {},
|
|
46
42
|
endPositionToMethod: {}
|
|
47
43
|
};
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
}());
|
|
44
|
+
}
|
|
45
|
+
}
|
|
51
46
|
exports.FilesDataContainer = FilesDataContainer;
|
|
52
47
|
//# sourceMappingURL=files-data-container.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"files-data-container.js","sourceRoot":"","sources":["../../../build-scanner/mappings/files-data-container.ts"],"names":[],"mappings":";;;AAEA;
|
|
1
|
+
{"version":3,"file":"files-data-container.js","sourceRoot":"","sources":["../../../build-scanner/mappings/files-data-container.ts"],"names":[],"mappings":";;;AAEA,MAAa,kBAAkB;IAA/B;QAEY,WAAM,GAAgC,EAAE,CAAC;IA2CrD,CAAC;IAzCG,IAAI,KAAK;QACL,OAAO,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACtC,CAAC;IAED,OAAO,CAAC,IAAc;QAClB,IAAG,CAAC,CAAC,IAAI,CAAC,YAAY,IAAI,IAAI,CAAC,MAAM,CAAC,EAAE;YACpC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,GAAG,IAAI,CAAC;SACzC;IACL,CAAC;IAED,SAAS,CAAC,IAAY,EAAE,MAAkB;;QACtC,IAA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