(one: string, other: string)
| 12 | } |
| 13 | |
| 14 | function common(one: string, other: string) { |
| 15 | const a = Array.from(one) |
| 16 | const b = Array.from(other) |
| 17 | let i = 0 |
| 18 | while (i < a.length && i < b.length && a[i] === b[i]) i++ |
| 19 | return { |
| 20 | stem: a.slice(0, i).join(""), |
| 21 | one: a.slice(i).join(""), |
| 22 | other: b.slice(i).join(""), |
| 23 | } |
| 24 | } |
| 25 | |
| 26 | export function AnimatedCountLabel(props: { count: number; one: string; other: string; class?: string }) { |
| 27 | const one = createMemo(() => split(props.one)) |
no test coverage detected