@humanities/greek-conversion/core
Conversions that bring into a bundle only the formats and the options they are given: the functions of the main entry point, which take the names of formats, with readers and writers in their place.
Readers and writers are imported from the entry point of their format
(greekReader and greekWriter from ./greek, and so on), presets from
./presets, as prepared options. Other options are prepared once with
prepareOptions, which brings their validation into the bundle. A
bundle that converts Greek into transliteration with a preset is then
about half the size of one that imports convert() from the main entry
point. The
guide on smaller bundles (opens in a new tab)
compares the cases: an application that reads and writes every format,
or lets its users choose them, gains little, and a server none.
Example
Section titled “Example”import { convert } from "@humanities/greek-conversion/core";import { greekReader } from "@humanities/greek-conversion/greek";import { iso843Type2 } from "@humanities/greek-conversion/presets";import { transliterationWriter } from "@humanities/greek-conversion/transliteration";
convert("Θεσσαλονίκη", greekReader, transliterationWriter, iso843Type2);// → ThessaloníkiInterfaces
Section titled “Interfaces”Type Aliases
Section titled “Type Aliases”Functions
Section titled “Functions”References
Section titled “References”ConversionLoss
Section titled “ConversionLoss”Re-exports ConversionLoss
ConversionLossCode
Section titled “ConversionLossCode”Re-exports ConversionLossCode
ConversionOptions
Section titled “ConversionOptions”Re-exports ConversionOptions
ConversionResult
Section titled “ConversionResult”Re-exports ConversionResult
ConversionSpan
Section titled “ConversionSpan”Re-exports ConversionSpan
Format
Section titled “Format”Re-exports Format
OptionError
Section titled “OptionError”Re-exports OptionError
PreparedOptions
Section titled “PreparedOptions”Re-exports PreparedOptions
prepareOptions
Section titled “prepareOptions”Re-exports prepareOptions
Preset
Section titled “Preset”Re-exports Preset
SourceOptions
Section titled “SourceOptions”Re-exports SourceOptions