createConverter
createConverter(
configuration?):Converter
Defined in: src/converter.ts:1361 (opens in a new tab)
Creates an immutable converter with isolated character extensions.
The configuration is checked as conversion options are: a misspelled key never falls back to a default.
Parameters
Section titled “Parameters”configuration?
Section titled “configuration?”Returns
Section titled “Returns”Example
Section titled “Example”import { createConverter } from "@humanities/greek-conversion";
const iso = createConverter({ preset: "iso-843-type-1", outOfScopeBehavior: "reject",});iso.convert("Αθήνα", "greek", "transliteration"); // → Athī́naiso.convert("ϟ", "greek", "transliteration");// throws CharacterScopeError: Conversion rejected: 1 unsupported character.Throws
Section titled “Throws”An OptionError if a key of the configuration,
of an alias, or of a custom character is unknown (its path is the key,
such as "exclude" or "aliases[0].spellings"), if the preset or the
out-of-scope behavior is, or if repertoire or exclude names no
character (its path is the identifier’s place, such as "exclude[0]").
Throws
Section titled “Throws”If the configuration, one of its lists, or one of its
definitions has the wrong type, or if a definition is invalid: an empty or
ambiguous spelling, a duplicate identifier, or a spelling that already has
a meaning without override.