Documentation

API

The transform and analyze functions, every option with its default, and the eight stable error codes.

Updated · spec 1.12.0

  • transform The one function polytypo is built around: its signature in all five runtimes, what it returns, what it throws, and the purity it guarantees.
  • Options Every polytypo option, its type and default, what it requires, and which error an invalid value raises.
  • analyze The same pipeline as transform, reporting what it would change instead of changing it, with code-point offsets into your input.
  • Error codes The eight stable polytypo error codes, when each is thrown, and why the code, not the message, is the contract.

Already using polytypo? Add our badge

Two lines: a script tag and a span. No per-embed network call. Pick a language and a theme, then copy the code into your footer or credits. Embedding notes cover Content Security Policy. Sites with the badge are listed on Sites using polytypo.

<script async src="https://polytypo.dev/badge.js"></script>
<span data-polytypo-lang="en" data-polytypo-theme="light"></span>

Search runs in your browser. Nothing is sent anywhere.