mootant 0.1.0 → 0.2.0
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/dist/adapters/jest/build-dry-file.d.ts +12 -12
- package/dist/adapters/jest/collect-jest-dependencies.d.ts +8 -7
- package/dist/adapters/jest/runner.d.ts +1 -1
- package/dist/adapters/jest/runner.js +1 -1
- package/dist/adapters/jest/types/jest-record.d.ts +4 -4
- package/dist/adapters/jest/types/unit-worker.d.ts +16 -8
- package/dist/adapters/jest/types/worker-session.d.ts +6 -7
- package/dist/adapters/jest/worker/boot-worker.d.ts +4 -3
- package/dist/adapters/jest/worker/run-unit.d.ts +20 -18
- package/dist/adapters/jest/worker/vm-setup.js +1 -1
- package/dist/adapters/jest/worker/worker.js +1 -1
- package/dist/adapters/jest/write-worker-session.d.ts +1 -2
- package/dist/adapters/jest/write-worker-session.js +2 -2
- package/dist/adapters/node-test/collect-node-dependencies.d.ts +5 -5
- package/dist/adapters/node-test/preload/preload.js +4 -1
- package/dist/adapters/node-test/run-test-file.js +1 -0
- package/dist/adapters/node-test/types/node-test-record.d.ts +3 -3
- package/dist/adapters/node-test/types/node-test-unit.d.ts +6 -1
- package/dist/adapters/shared/create-input-filter.d.ts +26 -0
- package/dist/adapters/shared/create-input-filter.js +32 -0
- package/dist/adapters/shared/track-file-inputs.d.ts +7 -3
- package/dist/adapters/shared/track-file-inputs.js +16 -7
- package/dist/adapters/shared/track-file-reads.d.ts +12 -8
- package/dist/adapters/shared/track-file-reads.js +110 -57
- package/dist/adapters/shared/track-inputs.d.ts +13 -6
- package/dist/adapters/shared/track-inputs.js +7 -7
- package/dist/adapters/shared/types/file-input-tracking.d.ts +6 -0
- package/dist/adapters/shared/types/input-tracking.d.ts +3 -3
- package/dist/adapters/vitest/collect-dependencies.d.ts +4 -3
- package/dist/adapters/vitest/collect-dependencies.js +25 -24
- package/dist/adapters/vitest/get-cache-inputs.js +3 -1
- package/dist/adapters/vitest/is-virtual-module.d.ts +11 -0
- package/dist/adapters/vitest/is-virtual-module.js +8 -0
- package/dist/adapters/vitest/read-out-files.d.ts +7 -2
- package/dist/adapters/vitest/read-out-files.js +5 -5
- package/dist/adapters/vitest/read-out-records.d.ts +17 -0
- package/dist/adapters/vitest/read-out-records.js +27 -0
- package/dist/adapters/vitest/read-strays.d.ts +20 -0
- package/dist/adapters/vitest/read-strays.js +53 -0
- package/dist/adapters/vitest/read-unit-inputs.d.ts +7 -1
- package/dist/adapters/vitest/read-unit-inputs.js +1 -1
- package/dist/adapters/vitest/run-dry.js +16 -16
- package/dist/adapters/vitest/run-plan.d.ts +3 -1
- package/dist/adapters/vitest/run-plan.js +15 -15
- package/dist/adapters/vitest/run-specifications.d.ts +3 -2
- package/dist/adapters/vitest/runner.d.ts +38 -23
- package/dist/adapters/vitest/runner.js +84 -85
- package/dist/adapters/vitest/types/stray-decisions.d.ts +8 -0
- package/dist/adapters/vitest/types/unit-outcome.d.ts +2 -1
- package/dist/adapters/vitest/types/vitest-worker.d.ts +83 -12
- package/dist/adapters/vitest/worker/encode-stray.d.ts +16 -0
- package/dist/adapters/vitest/worker/encode-stray.js +16 -0
- package/dist/adapters/vitest/worker/intercept-strays.d.ts +26 -0
- package/dist/adapters/vitest/worker/intercept-strays.js +13 -0
- package/dist/adapters/vitest/worker/read-try-facts.d.ts +5 -4
- package/dist/adapters/vitest/worker/write-out-record.d.ts +2 -2
- package/dist/cli/html/build-html-report.js +1 -1
- package/dist/cli/html/client/main.js +1 -1
- package/dist/cli/html/client/render-change.d.ts +3 -2
- package/dist/cli/html/client/render-code.d.ts +1 -1
- package/dist/cli/html/pack-replacement.d.ts +1 -1
- package/dist/cli/parse-arguments.js +1 -1
- package/dist/cli/report/build-list-report.js +1 -1
- package/dist/cli/report/build-run-report.js +1 -1
- package/dist/cli/report/format-file-groups.d.ts +1 -1
- package/dist/cli/run-mutation.js +31 -31
- package/dist/cli/terminal/create-spinner.d.ts +1 -1
- package/dist/cli/terminal/get-text-style.js +4 -4
- package/dist/core/cache/get-environment-key.js +2 -2
- package/dist/core/cache/hash-files.d.ts +7 -3
- package/dist/core/cache/hash-files.js +16 -17
- package/dist/core/cache/prepare-run-cache.d.ts +29 -7
- package/dist/core/cache/prepare-run-cache.js +96 -62
- package/dist/core/cache/save-run-cache.d.ts +8 -7
- package/dist/core/cache/save-run-cache.js +2 -1
- package/dist/core/cache/unknown-hash.d.ts +7 -0
- package/dist/core/cache/unknown-hash.js +2 -0
- package/dist/core/files/select-changed-mutants.d.ts +11 -6
- package/dist/core/files/select-changed-mutants.js +38 -13
- package/dist/core/generate/apply-solitary-rule.d.ts +8 -5
- package/dist/core/generate/apply-solitary-rule.js +36 -29
- package/dist/core/generate/collect-candidates.d.ts +18 -4
- package/dist/core/generate/collect-candidates.js +168 -86
- package/dist/core/generate/compare-targets.d.ts +14 -0
- package/dist/core/generate/compare-targets.js +6 -0
- package/dist/core/generate/deduplicate-candidates.d.ts +6 -4
- package/dist/core/generate/deduplicate-candidates.js +11 -9
- package/dist/core/generate/find-list-removal.d.ts +20 -0
- package/dist/core/generate/find-list-removal.js +26 -0
- package/dist/core/generate/generate-file-mutants.js +47 -46
- package/dist/core/generate/get-mutant-site.d.ts +18 -0
- package/dist/core/generate/get-mutant-site.js +4 -0
- package/dist/core/generate/get-target.d.ts +14 -0
- package/dist/core/generate/get-target.js +4 -0
- package/dist/core/generate/pick-host.d.ts +10 -0
- package/dist/core/generate/pick-host.js +16 -0
- package/dist/core/generate/validate-replacement.d.ts +15 -4
- package/dist/core/generate/validate-replacement.js +28 -13
- package/dist/core/ignore/find-ignore-rule.d.ts +8 -7
- package/dist/core/instrument/find-attribute-values.d.ts +12 -0
- package/dist/core/instrument/find-attribute-values.js +13 -0
- package/dist/core/instrument/get-site-syntax.d.ts +14 -0
- package/dist/core/instrument/get-site-syntax.js +12 -0
- package/dist/core/instrument/group-mutant-ranges.d.ts +7 -3
- package/dist/core/instrument/group-mutant-ranges.js +25 -19
- package/dist/core/instrument/instrument-file.d.ts +5 -3
- package/dist/core/instrument/instrument-file.js +10 -9
- package/dist/core/instrument/instrumenter-version.d.ts +1 -1
- package/dist/core/instrument/render-branch.d.ts +17 -0
- package/dist/core/instrument/render-branch.js +81 -0
- package/dist/core/instrument/render-mutant-range.d.ts +17 -6
- package/dist/core/instrument/render-mutant-range.js +39 -13
- package/dist/core/list-mutants.d.ts +7 -5
- package/dist/core/list-mutants.js +2 -2
- package/dist/core/mutators/array-element.d.ts +7 -6
- package/dist/core/mutators/array-element.js +13 -13
- package/dist/core/mutators/assignment-operator.js +34 -33
- package/dist/core/mutators/boolean-literal.d.ts +3 -2
- package/dist/core/mutators/number-literal.d.ts +1 -1
- package/dist/core/mutators/object-property.d.ts +4 -3
- package/dist/core/mutators/object-property.js +7 -8
- package/dist/core/mutators/return-value.js +65 -33
- package/dist/core/mutators/shared/get-branch-copy-skip.d.ts +12 -7
- package/dist/core/mutators/shared/get-branch-copy-skip.js +34 -35
- package/dist/core/mutators/shared/get-canonical-falsy-default.d.ts +32 -0
- package/dist/core/mutators/shared/get-canonical-falsy-default.js +11 -0
- package/dist/core/mutators/shared/get-comparison-plan.js +86 -85
- package/dist/core/mutators/shared/get-condition-constants.d.ts +8 -8
- package/dist/core/mutators/shared/get-condition-constants.js +3 -3
- package/dist/core/mutators/shared/get-endless-value.d.ts +20 -0
- package/dist/core/mutators/shared/get-endless-value.js +25 -0
- package/dist/core/mutators/shared/get-forced-test-justifier.d.ts +44 -0
- package/dist/core/mutators/shared/get-forced-test-justifier.js +25 -0
- package/dist/core/mutators/shared/get-group-constant.d.ts +4 -4
- package/dist/core/mutators/shared/get-group-constant.js +2 -2
- package/dist/core/mutators/shared/get-literal-skip.d.ts +6 -6
- package/dist/core/mutators/shared/get-literal-skip.js +2 -2
- package/dist/core/mutators/shared/get-logical-drops.d.ts +8 -8
- package/dist/core/mutators/shared/get-logical-drops.js +80 -82
- package/dist/core/mutators/shared/get-owner-constant.d.ts +3 -1
- package/dist/core/mutators/shared/get-running-value.d.ts +5 -4
- package/dist/core/mutators/shared/get-toward-mutant.d.ts +10 -2
- package/dist/core/mutators/shared/get-toward-mutant.js +45 -40
- package/dist/core/mutators/shared/has-other-exit.js +16 -36
- package/dist/core/mutators/shared/is-loop-exit.d.ts +20 -0
- package/dist/core/mutators/shared/is-loop-exit.js +32 -0
- package/dist/core/mutators/shared/is-read-only.d.ts +26 -0
- package/dist/core/mutators/shared/is-read-only.js +53 -0
- package/dist/core/mutators/statement-removal.d.ts +4 -3
- package/dist/core/mutators/statement-removal.js +69 -73
- package/dist/core/mutators/string-literal.d.ts +15 -5
- package/dist/core/mutators/string-literal.js +79 -50
- package/dist/core/presets/recommended.d.ts +2 -2
- package/dist/core/presets/strict.d.ts +4 -2
- package/dist/core/run/apply-batch-result.d.ts +23 -22
- package/dist/core/run/apply-batch-result.js +5 -5
- package/dist/core/run/apply-isolated-result.d.ts +18 -17
- package/dist/core/run/apply-isolated-result.js +1 -0
- package/dist/core/run/classify-try.d.ts +9 -8
- package/dist/core/run/get-test-file-limits.d.ts +13 -0
- package/dist/core/run/get-test-file-limits.js +13 -0
- package/dist/core/run/get-unit-evidence.d.ts +6 -3
- package/dist/core/run/get-unit-evidence.js +1 -1
- package/dist/core/run/plan-batch.d.ts +6 -3
- package/dist/core/run/plan-batch.js +36 -31
- package/dist/core/run/plan-isolated.d.ts +3 -1
- package/dist/core/run/plan-isolated.js +8 -14
- package/dist/core/run/read-isolated-unit.d.ts +4 -4
- package/dist/core/run/run-batch-phases.d.ts +4 -3
- package/dist/core/run/run-dry-phase.d.ts +35 -19
- package/dist/core/run/run-dry-phase.js +127 -77
- package/dist/core/run/run-isolated-rounds.d.ts +6 -5
- package/dist/core/run/run-isolated-rounds.js +1 -0
- package/dist/core/run-mutants.d.ts +26 -21
- package/dist/core/run-mutants.js +72 -64
- package/dist/core/runtime/create-hit-limit-error.d.ts +5 -3
- package/dist/core/runtime/create-hit-limit-error.js +1 -1
- package/dist/core/runtime/install-mutant-runtime.js +23 -6
- package/dist/core/runtime/runtime-version.d.ts +4 -4
- package/dist/core/skips/skip-rules.d.ts +4 -0
- package/dist/core/skips/skip-rules.js +4 -0
- package/dist/core/syntax/is-brace-sensitive-attribute.d.ts +18 -0
- package/dist/core/syntax/is-brace-sensitive-attribute.js +28 -0
- package/dist/core/syntax/is-spread-safe-member.d.ts +18 -0
- package/dist/core/syntax/is-spread-safe-member.js +18 -0
- package/dist/core/syntax/is-value-position.d.ts +3 -1
- package/dist/core/text/get-list-removal-range.d.ts +22 -0
- package/dist/core/text/get-list-removal-range.js +46 -0
- package/dist/core/text/is-plain-attribute-string.d.ts +10 -0
- package/dist/core/text/is-plain-attribute-string.js +5 -0
- package/dist/core/text/parse-expression.d.ts +8 -4
- package/dist/core/text/parse-expression.js +1 -0
- package/dist/core/text/remove-list-element.d.ts +2 -4
- package/dist/core/text/remove-list-element.js +4 -45
- package/dist/docs/styles/colors.js +1 -1
- package/dist/package.js +1 -1
- package/dist/types/adapter/dry-file.d.ts +2 -1
- package/dist/types/adapter/dry-run-request.d.ts +5 -4
- package/dist/types/adapter/mutant-runtime.d.ts +30 -1
- package/dist/types/cli/text-style.d.ts +1 -1
- package/dist/types/config/preset-settings.d.ts +2 -2
- package/dist/types/config/run-config.d.ts +12 -4
- package/dist/types/html/indexed-mutant.d.ts +4 -2
- package/dist/types/html/shown-change.d.ts +4 -3
- package/dist/types/mutant/list-removal.d.ts +37 -0
- package/dist/types/mutant/mutant-candidate.d.ts +11 -17
- package/dist/types/mutant/mutant-host.d.ts +49 -0
- package/dist/types/mutant/mutant-kind.d.ts +18 -0
- package/dist/types/mutant/mutant-range.d.ts +15 -8
- package/dist/types/mutant/mutant.d.ts +9 -15
- package/dist/types/mutant/site-syntax.d.ts +14 -0
- package/dist/types/mutant/skip-justifier.d.ts +3 -1
- package/dist/types/mutant/skipped-candidate.d.ts +13 -10
- package/dist/types/mutant/skipped-mutant.d.ts +9 -6
- package/dist/types/mutator/replacement.d.ts +14 -3
- package/dist/types/report/html-report.d.ts +10 -7
- package/dist/types/report/list-report-focus.d.ts +3 -2
- package/dist/types/report/list-report-justifier.d.ts +4 -2
- package/dist/types/report/list-report-mutant.d.ts +15 -9
- package/dist/types/report/list-report-skipped.d.ts +3 -2
- package/dist/types/report/list-report.d.ts +1 -1
- package/dist/types/report/run-report.d.ts +2 -2
- package/dist/types/report/slim-list-report.d.ts +6 -3
- package/dist/types/report/slim-run-report.d.ts +1 -1
- package/dist/types/run/isolated-reason.d.ts +4 -3
- package/dist/types/run/mutant-state.d.ts +1 -1
- package/dist/types/run/run-event.d.ts +1 -1
- package/dist/types/run/run-kind.d.ts +3 -2
- package/dist/types/run/run-result.d.ts +6 -3
- package/dist/types/run/run-state.d.ts +9 -1
- package/dist/types/run/run-status.d.ts +2 -2
- package/dist/types/run/try-cause.d.ts +8 -6
- package/dist/types/syntax/syntax-helpers.d.ts +5 -3
- package/package.json +5 -5
- package/skills/mootant/SKILL.md +14 -12
- package/skills/mootant/references/mutators.md +3 -1
- package/dist/core/instrument/get-site-check.d.ts +0 -9
- package/dist/core/instrument/get-site-check.js +0 -5
- package/dist/core/instrument/get-template-site-check.d.ts +0 -12
- package/dist/core/instrument/get-template-site-check.js +0 -5
- /package/dist/cli/{built-in-adapters.d.ts → get-built-in-adapters.d.ts} +0 -0
- /package/dist/cli/{built-in-adapters.js → get-built-in-adapters.js} +0 -0
- /package/dist/cli/terminal/{colors.d.ts → create-colors.d.ts} +0 -0
- /package/dist/cli/terminal/{colors.js → create-colors.js} +0 -0
|
@@ -20,12 +20,14 @@ import { compareCandidates as v } from "./compare-candidates.js";
|
|
|
20
20
|
import { getMutantRegions as y } from "./get-mutant-regions.js";
|
|
21
21
|
import { isLogMessage as b } from "../syntax/is-log-message.js";
|
|
22
22
|
import { analyzeScopes as x } from "../hints/analyze-scopes.js";
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
|
|
28
|
-
|
|
23
|
+
import { getMutantSite as S } from "./get-mutant-site.js";
|
|
24
|
+
import { parseFile as C } from "../parser/parse-file.js";
|
|
25
|
+
import { skipRules as w } from "../skips/skip-rules.js";
|
|
26
|
+
import { indexTree as T } from "../tree/index-tree.js";
|
|
27
|
+
import { pickFocus as E } from "./pick-focus.js";
|
|
28
|
+
import { pickHost as D } from "./pick-host.js";
|
|
29
|
+
function O(e) {
|
|
30
|
+
let { source: t, file: n } = e, { templateDiagnostics: i, parseDiagnostics: a, programs: o } = M(e);
|
|
29
31
|
if (o.length === 0 && a.length > 0) return {
|
|
30
32
|
diagnostics: [...a, ...i],
|
|
31
33
|
parsed: !1,
|
|
@@ -34,14 +36,14 @@ function E(e) {
|
|
|
34
36
|
source: t,
|
|
35
37
|
file: n
|
|
36
38
|
};
|
|
37
|
-
let c =
|
|
39
|
+
let c = j(e, o), l = [
|
|
38
40
|
...a,
|
|
39
41
|
...i,
|
|
40
42
|
...c.diagnostics
|
|
41
|
-
], d = c.candidates.filter((e) =>
|
|
43
|
+
], d = c.candidates.filter((e) => I(e, t)).toSorted(v), f = u(d, n, t), p = e.settings.coarseMutants ? null : g(d), m = s(p?.kept ?? d, t), { kept: h } = m, _ = h.map((e) => F(e, f.get(e), n)), [b] = o;
|
|
42
44
|
return {
|
|
43
|
-
skipped: e.skipped ?
|
|
44
|
-
collected: c.skipped.filter((e) =>
|
|
45
|
+
skipped: e.skipped ? k({
|
|
46
|
+
collected: c.skipped.filter((e) => I(e, t)),
|
|
45
47
|
solitary: p?.dropped ?? /* @__PURE__ */ new Map(),
|
|
46
48
|
duplicates: m.duplicates,
|
|
47
49
|
kept: h,
|
|
@@ -63,14 +65,14 @@ function E(e) {
|
|
|
63
65
|
file: n
|
|
64
66
|
};
|
|
65
67
|
}
|
|
66
|
-
function
|
|
68
|
+
function k(e, t) {
|
|
67
69
|
let { duplicates: n, collected: r, solitary: i, kept: a, ids: o } = e, s = new Set(a), c = [];
|
|
68
70
|
function l(e, t, n) {
|
|
69
71
|
return {
|
|
70
72
|
by: {
|
|
71
73
|
id: s.has(t) ? o.get(t) : null,
|
|
72
74
|
mutator: t.registered.id,
|
|
73
|
-
start: t
|
|
75
|
+
start: S(t)
|
|
74
76
|
},
|
|
75
77
|
registered: e.registered,
|
|
76
78
|
emission: e.emission,
|
|
@@ -79,7 +81,7 @@ function D(e, t) {
|
|
|
79
81
|
kind: e.kind,
|
|
80
82
|
end: e.end,
|
|
81
83
|
heuristic: !1,
|
|
82
|
-
...
|
|
84
|
+
...E(e),
|
|
83
85
|
...n
|
|
84
86
|
};
|
|
85
87
|
}
|
|
@@ -92,8 +94,8 @@ function D(e, t) {
|
|
|
92
94
|
rule: "duplicate"
|
|
93
95
|
}));
|
|
94
96
|
return [...r, ...c].toSorted(v).map((e) => ({
|
|
95
|
-
...
|
|
96
|
-
heuristic:
|
|
97
|
+
...w[e.rule],
|
|
98
|
+
heuristic: w[e.rule].heuristic || e.heuristic,
|
|
97
99
|
mutator: e.registered.id,
|
|
98
100
|
replacement: e.text,
|
|
99
101
|
reason: e.reason,
|
|
@@ -102,11 +104,11 @@ function D(e, t) {
|
|
|
102
104
|
kind: e.kind,
|
|
103
105
|
end: e.end,
|
|
104
106
|
by: e.by,
|
|
105
|
-
...
|
|
107
|
+
...E(e),
|
|
106
108
|
file: t
|
|
107
109
|
}));
|
|
108
110
|
}
|
|
109
|
-
function
|
|
111
|
+
function A(t, n, r) {
|
|
110
112
|
let { settings: a, mutators: o } = t, { handlers: s, parsed: c, scopes: u, tree: f } = n, g = new Set(o.map((e) => e.id));
|
|
111
113
|
return _({
|
|
112
114
|
services: {
|
|
@@ -140,12 +142,12 @@ function O(t, n, r) {
|
|
|
140
142
|
tree: f
|
|
141
143
|
});
|
|
142
144
|
}
|
|
143
|
-
function
|
|
145
|
+
function j(e, t) {
|
|
144
146
|
let n = t.flatMap((e) => e.rules.filter((e) => e.kind === "file")), r = [], i = [], a = [];
|
|
145
147
|
for (let o of t) {
|
|
146
|
-
let t =
|
|
148
|
+
let t = A(e, o, [...o.rules, ...n.filter((e) => !o.rules.includes(e))].toSorted((e, t) => e.order - t.order));
|
|
147
149
|
r.push(...t.diagnostics, ...o.diagnostics), a.push(...t.skipped);
|
|
148
|
-
for (let e of t.candidates) b(o.loggingCalls, e, e.kind === "block") ? a.push(
|
|
150
|
+
for (let e of t.candidates) b(o.loggingCalls, e, e.kind === "block") ? a.push(P(e)) : i.push(e);
|
|
149
151
|
}
|
|
150
152
|
return {
|
|
151
153
|
diagnostics: r,
|
|
@@ -153,11 +155,11 @@ function k(e, t) {
|
|
|
153
155
|
skipped: a
|
|
154
156
|
};
|
|
155
157
|
}
|
|
156
|
-
function
|
|
158
|
+
function M(e) {
|
|
157
159
|
let { source: n, file: r } = e, i = [], o = [], s = [], c = f(r, n);
|
|
158
160
|
for (let t of c) {
|
|
159
|
-
let n =
|
|
160
|
-
n.kind === "failed" ? o.push(...n.diagnostics) : s.push(
|
|
161
|
+
let n = C(r, t.text, t);
|
|
162
|
+
n.kind === "failed" ? o.push(...n.diagnostics) : s.push(N(n.parsed, e));
|
|
161
163
|
}
|
|
162
164
|
if (e.compilers && e.settings.templates) {
|
|
163
165
|
let o = t(e.compilers, {
|
|
@@ -165,7 +167,7 @@ function A(e) {
|
|
|
165
167
|
source: n,
|
|
166
168
|
file: r
|
|
167
169
|
});
|
|
168
|
-
o.kind === "parsed" && s.push(
|
|
170
|
+
o.kind === "parsed" && s.push(N(o.parsed, e, o)), o.kind !== "empty" && o.diagnostic && i.push(o.diagnostic);
|
|
169
171
|
}
|
|
170
172
|
return {
|
|
171
173
|
templateDiagnostics: i,
|
|
@@ -173,8 +175,8 @@ function A(e) {
|
|
|
173
175
|
programs: s
|
|
174
176
|
};
|
|
175
177
|
}
|
|
176
|
-
function
|
|
177
|
-
let i = n(e, t.knownMutatorIds), a = o(e, i.directives, r ? "template" : "script"), s =
|
|
178
|
+
function N(e, t, r) {
|
|
179
|
+
let i = n(e, t.knownMutatorIds), a = o(e, i.directives, r ? "template" : "script"), s = T(e.program, t.settings.loggers), l = x(e.program);
|
|
178
180
|
return {
|
|
179
181
|
diagnostics: [...i.diagnostics, ...a.diagnostics],
|
|
180
182
|
loggingCalls: c(s, l, t.settings.loggers),
|
|
@@ -187,7 +189,22 @@ function j(e, t, r) {
|
|
|
187
189
|
tree: s
|
|
188
190
|
};
|
|
189
191
|
}
|
|
190
|
-
function
|
|
192
|
+
function P(e) {
|
|
193
|
+
return {
|
|
194
|
+
reason: e.kind === "block" ? "it only removes a log message" : "it only changes the text of a log message",
|
|
195
|
+
registered: e.registered,
|
|
196
|
+
emission: e.emission,
|
|
197
|
+
start: e.start,
|
|
198
|
+
text: e.text,
|
|
199
|
+
kind: e.kind,
|
|
200
|
+
rule: "log-message",
|
|
201
|
+
end: e.end,
|
|
202
|
+
heuristic: !1,
|
|
203
|
+
...E(e),
|
|
204
|
+
by: null
|
|
205
|
+
};
|
|
206
|
+
}
|
|
207
|
+
function F(e, t, n) {
|
|
191
208
|
let r = e.ignoreRule;
|
|
192
209
|
return {
|
|
193
210
|
ignoredBy: r === null ? null : r.source,
|
|
@@ -197,29 +214,13 @@ function M(e, t, n) {
|
|
|
197
214
|
replacement: e.text,
|
|
198
215
|
scope: e.scope,
|
|
199
216
|
start: e.start,
|
|
200
|
-
|
|
217
|
+
...D(e),
|
|
201
218
|
end: e.end,
|
|
202
|
-
...T(e),
|
|
203
219
|
file: n,
|
|
204
220
|
id: t
|
|
205
221
|
};
|
|
206
222
|
}
|
|
207
|
-
function
|
|
208
|
-
return {
|
|
209
|
-
reason: e.kind === "block" ? "it only removes a log message" : "it only changes the text of a log message",
|
|
210
|
-
registered: e.registered,
|
|
211
|
-
emission: e.emission,
|
|
212
|
-
start: e.start,
|
|
213
|
-
text: e.text,
|
|
214
|
-
kind: e.kind,
|
|
215
|
-
rule: "log-message",
|
|
216
|
-
end: e.end,
|
|
217
|
-
heuristic: !1,
|
|
218
|
-
...T(e),
|
|
219
|
-
by: null
|
|
220
|
-
};
|
|
221
|
-
}
|
|
222
|
-
function P(e, t) {
|
|
223
|
+
function I(e, t) {
|
|
223
224
|
return e.text !== t.slice(e.start, e.end);
|
|
224
225
|
}
|
|
225
|
-
export {
|
|
226
|
+
export { O as generateFileMutants };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { MutantKind } from '../../types/mutant/mutant-kind.js';
|
|
2
|
+
import { TextEdit } from '../../types/source/text-edit.js';
|
|
3
|
+
/**
|
|
4
|
+
* Tells where a mutant, a candidate or a skipped candidate is placed: at its
|
|
5
|
+
* removed element or member when it removes one from an array or object
|
|
6
|
+
* literal, since its range may start at the comma after the element before, and
|
|
7
|
+
* at the start of its range otherwise. Ignore directives cover it there, and a
|
|
8
|
+
* skip that it justifies names it there.
|
|
9
|
+
*
|
|
10
|
+
* @param entry - Mutant, candidate or skipped candidate, with its kind and with
|
|
11
|
+
* its focus, which every removal of an element or a member has.
|
|
12
|
+
* @returns Offset where it is placed.
|
|
13
|
+
*/
|
|
14
|
+
export declare function getMutantSite(entry: {
|
|
15
|
+
kind: MutantKind | null;
|
|
16
|
+
focus?: TextEdit;
|
|
17
|
+
start: number;
|
|
18
|
+
}): number;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { MutantCandidate } from '../../types/mutant/mutant-candidate.js';
|
|
2
|
+
import { SourceRange } from '../../types/source/source-range.js';
|
|
3
|
+
/**
|
|
4
|
+
* Reads the range by which deduplication and the solitary rule order, place and
|
|
5
|
+
* tell apart a candidate: the literal of the removal of an element or a member,
|
|
6
|
+
* since the removal amounts to a change of the whole literal, as before it was
|
|
7
|
+
* narrowed to the element, and the replaced range otherwise. So narrowing a
|
|
8
|
+
* removal changes neither the candidates these steps keep nor the candidates
|
|
9
|
+
* they name.
|
|
10
|
+
*
|
|
11
|
+
* @param candidate - Candidate of a file.
|
|
12
|
+
* @returns Its literal or its range.
|
|
13
|
+
*/
|
|
14
|
+
export declare function getTarget(candidate: MutantCandidate): SourceRange;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { MutantHost } from '../../types/mutant/mutant-host.js';
|
|
2
|
+
/**
|
|
3
|
+
* Copies how a candidate or a mutant is hosted: its kind with its focus and,
|
|
4
|
+
* for the removal of an element or a member, its literal. An entry without a
|
|
5
|
+
* focus gets no `focus` key.
|
|
6
|
+
*
|
|
7
|
+
* @param entry - Candidate or mutant.
|
|
8
|
+
* @returns Its kind, focus and literal.
|
|
9
|
+
*/
|
|
10
|
+
export declare function pickHost(entry: MutantHost): MutantHost;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { pickFocus as e } from "./pick-focus.js";
|
|
2
|
+
function t(t) {
|
|
3
|
+
if (t.kind === "element" || t.kind === "property") {
|
|
4
|
+
let { focus: e, kind: n, list: r } = t;
|
|
5
|
+
return {
|
|
6
|
+
focus: e,
|
|
7
|
+
kind: n,
|
|
8
|
+
list: r
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
return {
|
|
12
|
+
kind: t.kind,
|
|
13
|
+
...e(t)
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
export { t as pickHost };
|
|
@@ -5,13 +5,24 @@ import { TextEdit } from '../../types/source/text-edit.js';
|
|
|
5
5
|
* Checks that the mutant switch can wrap the node a replacement targets: the
|
|
6
6
|
* node holds runtime code, is a statement or an expression, sits in a value
|
|
7
7
|
* position when it is an expression, and sits in a statement position other
|
|
8
|
-
* than the body of a labeled statement when it is a statement. A
|
|
9
|
-
*
|
|
8
|
+
* than the body of a labeled statement when it is a statement. A quoted JSX
|
|
9
|
+
* attribute value, which is not a value position, is a valid target when it and
|
|
10
|
+
* the text of the replacement are both plain strings (see
|
|
11
|
+
* `isPlainAttributeString`) and a compiler reads its attribute the same way in
|
|
12
|
+
* braces (see `isBraceSensitiveAttribute`): the switch hosts it in braces, and
|
|
13
|
+
* the text written in place of the value still means what the switch runs. A
|
|
14
|
+
* focus, when given, must lie inside the node.
|
|
10
15
|
*
|
|
11
16
|
* @param tree - Runtime tree of the file.
|
|
12
17
|
* @param node - Node the replacement targets.
|
|
13
|
-
* @param
|
|
18
|
+
* @param written - Text of the replacement and the edit inside the node.
|
|
19
|
+
* @param written.focus - Edit inside the node that reports show, if any.
|
|
20
|
+
* @param written.text - Text written in place of the node; without it, a quoted
|
|
21
|
+
* JSX attribute value is not a valid target.
|
|
14
22
|
* @returns The violation, worded to follow `Mutator "<id>" `, or null when the
|
|
15
23
|
* target is valid.
|
|
16
24
|
*/
|
|
17
|
-
export declare function validateReplacement(tree: TreeIndex, node: Node,
|
|
25
|
+
export declare function validateReplacement(tree: TreeIndex, node: Node, written?: {
|
|
26
|
+
focus?: TextEdit;
|
|
27
|
+
text?: string;
|
|
28
|
+
}): string | null;
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import { isBraceSensitiveAttribute as e } from "../syntax/is-brace-sensitive-attribute.js";
|
|
2
|
+
import { isPlainAttributeString as t } from "../text/is-plain-attribute-string.js";
|
|
3
|
+
import { isValuePosition as n } from "../syntax/is-value-position.js";
|
|
4
|
+
import { getReplacementKind as r } from "./get-replacement-kind.js";
|
|
5
|
+
let i = /* @__PURE__ */ new Map([
|
|
4
6
|
["SwitchCase", "consequent"],
|
|
5
7
|
["BlockStatement", "body"],
|
|
6
8
|
["TSModuleBlock", "body"],
|
|
7
9
|
["StaticBlock", "body"],
|
|
8
10
|
["Program", "body"]
|
|
9
|
-
]),
|
|
11
|
+
]), a = /* @__PURE__ */ new Map([
|
|
10
12
|
["IfStatement", ["consequent", "alternate"]],
|
|
11
13
|
["DoWhileStatement", ["body"]],
|
|
12
14
|
["LabeledStatement", ["body"]],
|
|
@@ -16,14 +18,27 @@ let n = /* @__PURE__ */ new Map([
|
|
|
16
18
|
["WithStatement", ["body"]],
|
|
17
19
|
["ForStatement", ["body"]]
|
|
18
20
|
]);
|
|
19
|
-
function
|
|
20
|
-
let
|
|
21
|
-
if (!
|
|
22
|
-
let
|
|
23
|
-
|
|
21
|
+
function o(e, t, i = {}) {
|
|
22
|
+
let a = e.slots.get(t);
|
|
23
|
+
if (!a) return "returned a replacement for a node outside the runtime code of the file.";
|
|
24
|
+
let o = r(t);
|
|
25
|
+
if (o === null) return `cannot replace a ${t.type} node; replace an expression or a statement.`;
|
|
26
|
+
if (o === "expression" && !n(e, t) && !s(t, a, {
|
|
27
|
+
text: i.text,
|
|
28
|
+
tree: e
|
|
29
|
+
}) || o === "block" && !c(a)) return `cannot replace a ${t.type} node in a position where Mootant cannot switch a mutant on.`;
|
|
30
|
+
if (o === "block" && a.parent.type === "LabeledStatement" && a.key === "body") return "cannot replace the body of a labeled statement; replace the LabeledStatement.";
|
|
31
|
+
let { focus: l } = i;
|
|
32
|
+
return l && (l.start < t.start || l.end < l.start || t.end < l.end) ? "returned a focus outside the node it replaces." : null;
|
|
24
33
|
}
|
|
25
|
-
function
|
|
26
|
-
let { parent:
|
|
27
|
-
|
|
34
|
+
function s(n, r, i) {
|
|
35
|
+
let { parent: a } = r;
|
|
36
|
+
if (a?.type !== "JSXAttribute" || n.type !== "Literal" || i.text === void 0) return !1;
|
|
37
|
+
let o = i.tree.slots.get(a).parent;
|
|
38
|
+
return !e(a, o) && t(n.raw) && t(i.text);
|
|
28
39
|
}
|
|
29
|
-
|
|
40
|
+
function c(e) {
|
|
41
|
+
let { parent: t, index: n, key: r } = e;
|
|
42
|
+
return n === null ? a.get(t.type)?.includes(r) ?? !1 : i.get(t.type) === r;
|
|
43
|
+
}
|
|
44
|
+
export { o as validateReplacement };
|
|
@@ -8,23 +8,24 @@ interface IgnoreTarget {
|
|
|
8
8
|
*/
|
|
9
9
|
mutator: string;
|
|
10
10
|
/**
|
|
11
|
-
*
|
|
11
|
+
* Offset where the mutant is placed: the start of its focus, or of its range
|
|
12
|
+
* when it has none.
|
|
12
13
|
*/
|
|
13
14
|
start: number;
|
|
14
15
|
/**
|
|
15
|
-
* 1-based line of
|
|
16
|
+
* 1-based line of that offset.
|
|
16
17
|
*/
|
|
17
18
|
line: number;
|
|
18
19
|
}
|
|
19
20
|
/**
|
|
20
21
|
* Finds the rule that decides whether a mutant is ignored. A rule applies when
|
|
21
|
-
* it lists the mutant's mutator or every mutator, and covers the mutant
|
|
22
|
-
*
|
|
23
|
-
* Among applicable rules a next-line rule beats a region, a region beats
|
|
24
|
-
* rule, and within a kind the later directive wins.
|
|
22
|
+
* it lists the mutant's mutator or every mutator, and covers where the mutant
|
|
23
|
+
* is placed: its line for a next-line rule, its offset for a region or file
|
|
24
|
+
* rule. Among applicable rules a next-line rule beats a region, a region beats
|
|
25
|
+
* a file rule, and within a kind the later directive wins.
|
|
25
26
|
*
|
|
26
27
|
* @param rules - Ignore rules of the file.
|
|
27
|
-
* @param target - Mutator id,
|
|
28
|
+
* @param target - Mutator id, offset and line where the mutant is placed.
|
|
28
29
|
* @returns The winning rule, or null when no rule applies and the mutant runs.
|
|
29
30
|
*/
|
|
30
31
|
export declare function findIgnoreRule(rules: readonly IgnoreRule[], target: IgnoreTarget): IgnoreRule | null;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Finds where the quoted values of JSX attributes start, such as `"password"`
|
|
3
|
+
* in `type="password"`. A conditional expression stands in place of such a
|
|
4
|
+
* value only inside braces, so the mutant switch hosts it in them.
|
|
5
|
+
*
|
|
6
|
+
* @param file - Name of the file, whose extension selects the language; every
|
|
7
|
+
* script block of a component file is parsed.
|
|
8
|
+
* @param source - Text of the file as read.
|
|
9
|
+
* @returns Offsets in `source` where quoted attribute values start.
|
|
10
|
+
* @throws Error - When the text does not parse.
|
|
11
|
+
*/
|
|
12
|
+
export declare function findAttributeValues(file: string, source: string): Set<number>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { getSourceBlocks as e } from "../parser/get-source-blocks.js";
|
|
2
|
+
import { parseFile as t } from "../parser/parse-file.js";
|
|
3
|
+
import { walkTree as n } from "../tree/walk-tree.js";
|
|
4
|
+
function r(r, i) {
|
|
5
|
+
let a = /* @__PURE__ */ new Set();
|
|
6
|
+
for (let o of e(r, i)) {
|
|
7
|
+
let e = t(r, o.text, o);
|
|
8
|
+
if (e.kind === "failed") throw Error(`The original text of ${r} does not parse.`);
|
|
9
|
+
n(e.parsed.program, (e) => (e.type === "JSXAttribute" && e.value?.type === "Literal" && a.add(e.value.start), !0));
|
|
10
|
+
}
|
|
11
|
+
return a;
|
|
12
|
+
}
|
|
13
|
+
export { r as findAttributeValues };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { SiteSyntax } from '../../types/mutant/site-syntax.js';
|
|
2
|
+
/**
|
|
3
|
+
* Tells how switched code reaches the mutant runtime. Script code reads the
|
|
4
|
+
* runtime global and quotes ids as JSON strings. The Vue compiler reads
|
|
5
|
+
* `globalThis` in a template as a property of the component, so a template
|
|
6
|
+
* reaches the runtime through `Math`, which the compiler leaves alone, as it
|
|
7
|
+
* leaves `Symbol` since version 3.5, and quotes ids with backticks, which
|
|
8
|
+
* neither quote of an attribute value ends. Neither needs an import or a
|
|
9
|
+
* declaration: outside mootant's workers the runtime is undefined.
|
|
10
|
+
*
|
|
11
|
+
* @param template - Whether the code is in the template of a Vue component.
|
|
12
|
+
* @returns The runtime expression and the quoting of ids.
|
|
13
|
+
*/
|
|
14
|
+
export declare function getSiteSyntax(template: boolean): SiteSyntax;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { RUNTIME_SYMBOL_KEY as e } from "../runtime/runtime-symbol-key.js";
|
|
2
|
+
import { RUNTIME_GLOBAL as t } from "../runtime/runtime-global.js";
|
|
3
|
+
function n(n) {
|
|
4
|
+
return n ? {
|
|
5
|
+
runtime: `Math[Symbol.for(\`${e}\`)]`,
|
|
6
|
+
quote: (e) => `\`${e}\``
|
|
7
|
+
} : {
|
|
8
|
+
runtime: `globalThis.${t}`,
|
|
9
|
+
quote: (e) => JSON.stringify(e)
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
export { n as getSiteSyntax };
|
|
@@ -3,9 +3,13 @@ import { Mutant } from '../../types/mutant/mutant.js';
|
|
|
3
3
|
/**
|
|
4
4
|
* Groups the mutants of one file by the range they replace and the way they are
|
|
5
5
|
* hosted, and nests the groups into a forest: a group is the child of the
|
|
6
|
-
* smallest group whose range holds it.
|
|
7
|
-
*
|
|
8
|
-
*
|
|
6
|
+
* smallest group whose range holds it. The removals of the elements of one
|
|
7
|
+
* array literal, or of the members of one object literal, form one group whose
|
|
8
|
+
* range is the literal, since they are hosted together around it. An expression
|
|
9
|
+
* statement can be removed as a block and changed as an expression; its block
|
|
10
|
+
* group then holds its expression group. A group of removals holds an
|
|
11
|
+
* expression group of its whole literal. Mutants keep their list order within a
|
|
12
|
+
* group.
|
|
9
13
|
*
|
|
10
14
|
* @param mutants - Mutants of one file to host.
|
|
11
15
|
* @returns Top-level groups sorted by start, each with its nested groups.
|
|
@@ -1,24 +1,30 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
let e = {
|
|
2
|
+
expression: 2,
|
|
3
|
+
property: 1,
|
|
4
|
+
element: 1,
|
|
5
|
+
block: 0
|
|
6
|
+
};
|
|
7
|
+
function t(t) {
|
|
8
|
+
let n = /* @__PURE__ */ new Map();
|
|
9
|
+
for (let e of t) {
|
|
10
|
+
let { start: t, end: r } = e.kind === "element" || e.kind === "property" ? e.list : e, i = `${e.kind}:${t}:${r}`, a = n.get(i);
|
|
11
|
+
a === void 0 ? n.set(i, {
|
|
12
|
+
kind: e.kind,
|
|
13
|
+
mutants: [e],
|
|
14
|
+
children: [],
|
|
15
|
+
start: t,
|
|
16
|
+
end: r
|
|
17
|
+
}) : a.mutants.push(e);
|
|
12
18
|
}
|
|
13
|
-
let
|
|
14
|
-
for (let e of
|
|
15
|
-
for (;
|
|
16
|
-
let t =
|
|
17
|
-
if (t === void 0)
|
|
19
|
+
let r = [...n.values()].toSorted((t, n) => t.start - n.start || n.end - t.end || e[t.kind] - e[n.kind]), i = [], a = [];
|
|
20
|
+
for (let e of r) {
|
|
21
|
+
for (; a.length > 0 && a.at(-1).end <= e.start;) a.pop();
|
|
22
|
+
let t = a.at(-1);
|
|
23
|
+
if (t === void 0) i.push(e);
|
|
18
24
|
else if (e.end > t.end) throw Error(`Mutant ranges of ${e.mutants[0].file} overlap at ${e.start}.`);
|
|
19
25
|
else t.children.push(e);
|
|
20
|
-
|
|
26
|
+
a.push(e);
|
|
21
27
|
}
|
|
22
|
-
return
|
|
28
|
+
return i;
|
|
23
29
|
}
|
|
24
|
-
export {
|
|
30
|
+
export { t as groupMutantRanges };
|
|
@@ -26,9 +26,11 @@ interface InstrumentFileInput {
|
|
|
26
26
|
* Builds the switched text of a file: every mutant is hosted behind a site
|
|
27
27
|
* check of the mutant runtime, so one text runs the original code or any one of
|
|
28
28
|
* its mutants. Mutants of one range share a host; nested ranges are hosted
|
|
29
|
-
* inside the original branch of the outer one.
|
|
30
|
-
*
|
|
31
|
-
*
|
|
29
|
+
* inside the original branch of the outer one. The removals of the elements or
|
|
30
|
+
* members of one array or object literal share a host around the literal. A
|
|
31
|
+
* mutant of a quoted JSX attribute value is hosted in braces. A mutant in the
|
|
32
|
+
* template of a Vue component, outside its script blocks, reaches the runtime
|
|
33
|
+
* through `Math`. No source map is made.
|
|
32
34
|
*
|
|
33
35
|
* @param input - File name, text, mutants and template compilers.
|
|
34
36
|
* @returns The switched text, or the text as is when there are no mutants.
|
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
import { getComponentFramework as e } from "../parser/get-component-framework.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { scanScriptBlocks as t } from "../parser/scan-script-blocks.js";
|
|
3
|
+
import { findAttributeValues as n } from "./find-attribute-values.js";
|
|
4
4
|
import { findStatementStarts as r } from "./find-statement-starts.js";
|
|
5
5
|
import { groupMutantRanges as i } from "./group-mutant-ranges.js";
|
|
6
6
|
import { renderMutantRange as a } from "./render-mutant-range.js";
|
|
7
|
-
import {
|
|
7
|
+
import { getSiteSyntax as o } from "./get-site-syntax.js";
|
|
8
8
|
function s(s) {
|
|
9
9
|
let { compilers: c, mutants: l, source: u, file: d } = s;
|
|
10
10
|
if (l.length === 0) return u;
|
|
11
|
-
let f = i(l), p = r(d, u, c), m = e(d) === "vue",
|
|
11
|
+
let f = i(l), p = r(d, u, c), m = n(d, u), h = e(d) === "vue", g = h ? t(u, "vue") : [], _ = "", v = 0;
|
|
12
12
|
for (let e of f) {
|
|
13
|
-
let
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
let t = h && g.every((t) => !(t.start <= e.start) || !(e.end <= t.end));
|
|
14
|
+
_ += u.slice(v, e.start), _ += a(e, u, {
|
|
15
|
+
syntax: o(t),
|
|
16
|
+
attributeValues: m,
|
|
16
17
|
statementStarts: p
|
|
17
|
-
}),
|
|
18
|
+
}), v = e.end;
|
|
18
19
|
}
|
|
19
|
-
return
|
|
20
|
+
return _ + u.slice(v);
|
|
20
21
|
}
|
|
21
22
|
export { s as instrumentFile };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Writes an expression as a branch of the mutant switch, in parentheses, which
|
|
3
|
+
* keep a sequence whole. The oxc parser, which Vite 8 reads modules with, takes
|
|
4
|
+
* a regular expression literal whose pattern starts with `<!--` right after a
|
|
5
|
+
* `(` that opens an expression for an HTML comment, white space and comments
|
|
6
|
+
* between them aside, which a module does not allow, so the module would not
|
|
7
|
+
* load. The nearest `(` before such a literal, of the branch or of the text, is
|
|
8
|
+
* followed by `0, ` when its parentheses hold a value, which keeps it: `(0,
|
|
9
|
+
* /<!--/g)`. Parentheses around a callee, a tag or a write target stay as they
|
|
10
|
+
* are, since `0, ` would lose the `this` of the call or the target. Only the
|
|
11
|
+
* start of a text lands somewhere new in the switched code; every other `(`
|
|
12
|
+
* stays after the code the source or the mutator put before it.
|
|
13
|
+
*
|
|
14
|
+
* @param text - Replacement or original text of the branch.
|
|
15
|
+
* @returns Text to write as the branch.
|
|
16
|
+
*/
|
|
17
|
+
export declare function renderBranch(text: string): string;
|