convert
convert(
input,from,to,options?):string
Defined in: src/core.ts:99 (opens in a new tab)
Converts text with a reader and a writer.
The conversion of convert() from the main entry point: unknown literals
are preserved, and the result is canonical and idempotent for fixed
formats and options, but a reverse conversion is not necessarily lossless;
use convertDetailed when that distinction matters.
Without options, the defaults apply: the library’s own transliteration, the letters of the SBL Handbook of Style with the accents, iota subscript, diaeresis, and quantity marks that the Handbook leaves out.
Parameters
Section titled “Parameters”string
The reader of the input’s format.
The writer of the output’s format.
options?
Section titled “options?”A preset from ./presets, or what prepareOptions
returns; the defaults if omitted.
Returns
Section titled “Returns”string
Example
Section titled “Example”import { convert } from "@humanities/greek-conversion/core";import { betaCodeReader } from "@humanities/greek-conversion/beta-code";import { greekWriter } from "@humanities/greek-conversion/greek";
convert("*)odusseu/s", betaCodeReader, greekWriter); // → ὈδυσσεύςThrows
Section titled “Throws”If input is not a string, from not a reader, to
not a writer, or options not prepared options.