Commit 870ab00
committed
fix(brief): address 2 Greptile P2 inline comments on PR #3751
1. shared/brief-filter.js:115-134 — titleCase JSDoc accuracy.
The function returns input unchanged when v is non-string or empty
(preserving type), not always `string`. Updated `@param` to `unknown`
and `@returns` to `string | unknown`. Clarified the guard-comment
framing: the `|| 'General'` fallback at :384 runs BEFORE titleCase
is invoked at out.push, so the type-preserving branch is never
reached at the current call site — kept as defense-in-depth for
future callers.
2. tests/digest-buildDigest-category-passthrough.test.mjs:55-78 —
replaced brittle `indexOf('});')` with a brace-depth-tracking
scanner that finds the matching close at the same depth. Old
approach would silently truncate the search slice if a future
refactor added a nested object literal ending in `});` inside
stories.push (e.g. a `.map()` callback) — Greptile P2 concern.
Also tightened the per-line assertion from substring `includes` to
regex `match` so coercion or alt defensive patterns would fail the
test rather than silently pass on partial match.
Both nits surfaced by Greptile's review of commit 6f40264 (last
reviewed commit pre-cache-prefix-bump). Test posture: 284 tests pass
across the touched + neighboring surfaces.1 parent e998644 commit 870ab00
2 files changed
Lines changed: 45 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
122 | | - | |
123 | | - | |
124 | | - | |
| 122 | + | |
125 | 123 | | |
126 | | - | |
127 | | - | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
128 | 134 | | |
129 | 135 | | |
130 | 136 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
53 | | - | |
54 | | - | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
55 | 60 | | |
56 | 61 | | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
61 | 81 | | |
62 | | - | |
63 | | - | |
64 | | - | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
65 | 90 | | |
66 | 91 | | |
67 | 92 | | |
| |||
0 commit comments