reencode
reencode(
input,format,options?):string
Defined in: src/mod.ts:213 (opens in a new tab)
Parses and re-encodes text in the same format.
This is the expressive shorthand for convert(input, format, format, options). It canonicalizes accepted aliases and applies the selected
orthographic policies. The options describe the input as well, which
normalizes a text in its own style. Reading transliteration depends on its
options: to restyle a transliteration, give the style it is written in as
options.source (ConversionOptions.source).
Parameters
Section titled “Parameters”string
format
Section titled “format”options?
Section titled “options?”ConversionOptions | PreparedOptions = {}
Returns
Section titled “Returns”string
Example
Section titled “Example”import { reencode } from "@humanities/greek-conversion";
reencode("λόγος", "greek", { greek: { finalSigma: "medial" },});// → λόγοσ
reencode("phílos", "transliteration", { transliteration: { phi: "f" }, source: {},});// → fílos