augmentTypo function exported ✓ 100.0%
Last updated: 2026-02-24T21:07:57.579Z
Metrics
LOC: 14
Complexity: 2
Params: 1
Coverage: 100.0% (7/7 lines, 1004x executed)
Signature
augmentTypo(signals: string): : string
Summary
Simple augmentation: add noise (typo simulation)
Source Code
export function augmentTypo(signals: string): string {
const words = signals.split(/\s+/);
const idx = Math.floor(Math.random() * words.length);
const word = words[idx];
if (word.length > 2) {
const charIdx = Math.floor(Math.random() * (word.length - 1));
words[idx] =
word.slice(0, charIdx) +
word[charIdx + 1] +
word[charIdx] +
word.slice(charIdx + 2);
}
return words.join(" ");
}
No outgoing dependencies.
Impact (Incoming)
| Source | Type |
|---|---|
| buildKeywordsFromDictionary | uses |