Finding
Two helper functions in src/index.ts are each called exactly once:
updateArrayItem (lines 298-304) — called at line 343
updateShallowProperty (lines 307-317) — called at line 364
Both are two-line operations: spread-copy, then assign at index/key. The indirection adds cognitive overhead without reuse benefit.
Proposed fix
Inline both at their single call sites:
updateArrayItem becomes const copy = [...arr]; copy[index] = value; return copy
updateShallowProperty becomes const result = { ...obj }; result[key] = value; return result
Remove both helper functions.
Source: out/report-simplify.txt, Findings 5 + 6
Finding
Two helper functions in
src/index.tsare each called exactly once:updateArrayItem(lines 298-304) — called at line 343updateShallowProperty(lines 307-317) — called at line 364Both are two-line operations: spread-copy, then assign at index/key. The indirection adds cognitive overhead without reuse benefit.
Proposed fix
Inline both at their single call sites:
updateArrayItembecomesconst copy = [...arr]; copy[index] = value; return copyupdateShallowPropertybecomesconst result = { ...obj }; result[key] = value; return resultRemove both helper functions.
Source:
out/report-simplify.txt, Findings 5 + 6