All files / mutxt-react/src/translit/schemes index.ts

100% Statements 37/37
100% Branches 0/0
87.5% Functions 14/16
100% Lines 35/35

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 612x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x       2x 2x 6x 6x 5x 8x 8x 8x 7x 4x 4x 7x 11x 11x 8x       2x                                     2x 5x 5x 5x    
import {ruTranslit} from './ru-translit';
import {ruPhonetic} from './ru-phonetic';
import {ukTranslit} from './uk-translit';
import {bgTranslit} from './bg-translit';
import {beTranslit} from './be-translit';
import {mkTranslit} from './mk-translit';
import {srTranslit} from './sr-translit';
import {elTranslit} from './el-translit';
import {heTranslit} from './he-translit';
import {hyTranslit} from './hy-translit';
import {kaTranslit} from './ka-translit';
import {eoXsystem} from './eo-xsystem';
import {viTelex} from './vi-telex';
import {arArabizi} from './ar-arabizi';
import {ipaTranslit} from './ipa-translit';
import type {TranslitScheme} from '../types';
 
export {
  ruTranslit,
  ruPhonetic,
  ukTranslit,
  bgTranslit,
  beTranslit,
  mkTranslit,
  srTranslit,
  elTranslit,
  heTranslit,
  hyTranslit,
  kaTranslit,
  eoXsystem,
  viTelex,
  arArabizi,
  ipaTranslit,
};
 
/** Schemes shipped by default, ordered roughly by reader population. */
export const defaultSchemes: readonly TranslitScheme[] = [
  ruTranslit,
  ruPhonetic,
  ukTranslit,
  bgTranslit,
  beTranslit,
  mkTranslit,
  srTranslit,
  elTranslit,
  heTranslit,
  hyTranslit,
  kaTranslit,
  arArabizi,
  viTelex,
  eoXsystem,
  ipaTranslit,
];
 
/** Build a `Map<id, scheme>` from an iterable of schemes. */
export const schemeMap = (schemes: Iterable<TranslitScheme>): Map<string, TranslitScheme> => {
  const m = new Map<string, TranslitScheme>();
  for (const s of schemes) m.set(s.id, s);
  return m;
};