Rocky_Mountain_Vending/.pnpm-store/v10/files/88/57e2ded19e8be0fd2bf88ac1f2727ebc71293e13021c010c18bf2c978f51a1a1c56c35c735e79949af7daa68859e3aebf2262f26f54fbdf5b0e1e7de9da98e
DMleadgen 46d973904b
Initial commit: Rocky Mountain Vending website
Next.js website for Rocky Mountain Vending company featuring:
- Product catalog with Stripe integration
- Service areas and parts pages
- Admin dashboard with Clerk authentication
- SEO optimized pages with JSON-LD structured data

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 16:22:15 -07:00

1 line
No EOL
2.7 KiB
Text

{"version":3,"sources":["../../src/lib/detect-typo.ts"],"sourcesContent":["// the minimum number of operations required to convert string a to string b.\nfunction minDistance(a: string, b: string, threshold: number): number {\n const m = a.length\n const n = b.length\n\n if (m < n) {\n return minDistance(b, a, threshold)\n }\n\n if (n === 0) {\n return m\n }\n\n let previousRow = Array.from({ length: n + 1 }, (_, i) => i)\n\n for (let i = 0; i < m; i++) {\n const s1 = a[i]\n let currentRow = [i + 1]\n for (let j = 0; j < n; j++) {\n const s2 = b[j]\n const insertions = previousRow[j + 1] + 1\n const deletions = currentRow[j] + 1\n const substitutions = previousRow[j] + Number(s1 !== s2)\n currentRow.push(Math.min(insertions, deletions, substitutions))\n }\n previousRow = currentRow\n }\n return previousRow[previousRow.length - 1]\n}\n\nexport function detectTypo(input: string, options: string[], threshold = 2) {\n const potentialTypos = options\n .map((o) => ({\n option: o,\n distance: minDistance(o, input, threshold),\n }))\n .filter(({ distance }) => distance <= threshold && distance > 0)\n .sort((a, b) => a.distance - b.distance)\n\n if (potentialTypos.length) {\n return potentialTypos[0].option\n }\n return null\n}\n"],"names":["detectTypo","minDistance","a","b","threshold","m","length","n","previousRow","Array","from","_","i","s1","currentRow","j","s2","insertions","deletions","substitutions","Number","push","Math","min","input","options","potentialTypos","map","o","option","distance","filter","sort"],"mappings":"AAAA,6EAA6E;;;;;+BA8B7DA;;;eAAAA;;;AA7BhB,SAASC,YAAYC,CAAS,EAA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