string — levenshtein, slugify

2 utility functions over string, each with a published contract: a signature, property-based invariants, and every edge case named and settled. The source is copied into your project.

[toopo](../../)

- [How we verify](../../method/)
- [What we refuse](../../refused/)

typescript / string

# string

This domain publishes 2 contracts, settling 64 named edge cases between them. Taking all of them puts 5 748 bytes of TypeScript in your project, and they import nothing.

- ## [levenshtein](../../typescript/string/levenshtein@1/)

  Count the single-character insertions, deletions and substitutions that turn one string into the other, counting in Unicode code points.

  23 settled cases · 2 416 bytes · no imports

  npx toopo add string/levenshtein
- ## [slugify](../../typescript/string/slugify@1/)

  Turn text into a URL-safe identifier: one lower-case run of letters, marks and digits per word, joined by single hyphens. The output is Unicode, not ASCII.

  41 settled cases · 3 332 bytes · no imports

  npx toopo add string/slugify

string · 2 contracts

- [levenshtein](../../typescript/string/levenshtein@1/)
- [slugify](../../typescript/string/slugify@1/)

Domains

- [number](../../typescript/number/)
- [date](../../typescript/date/)
- string
