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)

graph LR augmentTypo["augmentTypo"] buildKeywordsFromDictionary["buildKeywordsFromDictionary"] buildKeywordsFromDictionary -->|uses| augmentTypo style augmentTypo fill:#dbeafe,stroke:#2563eb,stroke-width:2px click augmentTypo "d345acd14e868d5a.html" click buildKeywordsFromDictionary "dfb7d9bfef2aba38.html"
SourceType
buildKeywordsFromDictionary uses