cizgile 0.2.0 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +88 -35
- package/dist/idna.d.mts +60 -0
- package/dist/idna.mjs +313 -0
- package/dist/index.d.mts +20 -12
- package/dist/index.mjs +124 -53
- package/dist/shared/punycode-MAFJqHdd.mjs +180 -0
- package/dist/shared/{locales-latin-Bm94HAeL.mjs → registry-D787niCh.mjs} +162 -15
- package/dist/shared/{types-DbyhfPRc.d.mts → types-D5P1JMcX.d.mts} +2 -2
- package/dist/transliterate.d.mts +95 -2
- package/dist/transliterate.mjs +8771 -11
- package/dist/uri.d.mts +68 -17
- package/dist/uri.mjs +283 -298
- package/package.json +19 -14
|
@@ -79,6 +79,24 @@ const latin = {
|
|
|
79
79
|
ɩ: "i",
|
|
80
80
|
Ʊ: "U",
|
|
81
81
|
ʊ: "u",
|
|
82
|
+
Ƿ: "W",
|
|
83
|
+
ƿ: "w",
|
|
84
|
+
Ȝ: "Gh",
|
|
85
|
+
ȝ: "gh",
|
|
86
|
+
Ʌ: "V",
|
|
87
|
+
ʌ: "v",
|
|
88
|
+
Ƣ: "Gh",
|
|
89
|
+
ƣ: "gh",
|
|
90
|
+
Ȣ: "Ou",
|
|
91
|
+
ȣ: "ou",
|
|
92
|
+
Ʈ: "T",
|
|
93
|
+
ʈ: "t",
|
|
94
|
+
Ɲ: "N",
|
|
95
|
+
ɲ: "n",
|
|
96
|
+
Ƨ: "S",
|
|
97
|
+
ƨ: "s",
|
|
98
|
+
Ɂ: "",
|
|
99
|
+
ɂ: "",
|
|
82
100
|
ʔ: "",
|
|
83
101
|
ʼ: "",
|
|
84
102
|
ʻ: "",
|
|
@@ -164,6 +182,8 @@ const symbols = {
|
|
|
164
182
|
//#region src/transliterate/core.ts
|
|
165
183
|
/** The tables every call consults last: `latin`, then `symbols`. */
|
|
166
184
|
const DEFAULT_TABLES = [latin, symbols];
|
|
185
|
+
/** A table key that starts with this character is a rule: the rest is a regular expression source (flags `gu`) and the value its replacement, `$1` groups allowed. Rules run in table order, before the sequences and the character lookup; the scripts that reorder or contextualise letters (Thai, Lao, Khmer, Myanmar) use them. */
|
|
186
|
+
const RULE_PREFIX = "";
|
|
167
187
|
const NON_ASCII = /[^\x00-\x7F]/;
|
|
168
188
|
let tableIds;
|
|
169
189
|
let nextTableId = 0;
|
|
@@ -187,17 +207,20 @@ function tableId(table) {
|
|
|
187
207
|
function build(tables) {
|
|
188
208
|
const map = /* @__PURE__ */ new Map();
|
|
189
209
|
const multi = [];
|
|
210
|
+
const rules = [];
|
|
190
211
|
for (const table of tables) for (const key of Object.keys(table)) {
|
|
191
212
|
if (map.has(key)) continue;
|
|
192
213
|
const value = table[key] ?? "";
|
|
193
214
|
map.set(key, value);
|
|
194
|
-
if (
|
|
215
|
+
if (key.startsWith("")) rules.push([new RegExp(key.slice(1), "gu"), value]);
|
|
216
|
+
else if (codePointCount(key) > 1) multi.push([key, value]);
|
|
195
217
|
}
|
|
196
218
|
multi.sort((a, b) => b[0].length - a[0].length);
|
|
197
219
|
const asciiKeys = [...map.keys()].filter((key) => key.length === 1 && (key.codePointAt(0) ?? 0) < 128);
|
|
198
220
|
return {
|
|
199
221
|
map,
|
|
200
222
|
sequences: multi,
|
|
223
|
+
rules,
|
|
201
224
|
ascii: asciiKeys.length === 0 ? void 0 : new RegExp(`[${asciiKeys.map((k) => k.replace(/[\]\\^-]/g, "\\$&")).join("")}]`, "g"),
|
|
202
225
|
folded: /* @__PURE__ */ new Map()
|
|
203
226
|
};
|
|
@@ -275,6 +298,7 @@ function fold(input, tables, dropUnknown, foldMarks = true) {
|
|
|
275
298
|
const map = compiled.map;
|
|
276
299
|
let text = input;
|
|
277
300
|
if (!NON_ASCII.test(text)) return compiled.ascii === void 0 ? text : text.replace(compiled.ascii, (m) => map.get(m) ?? m);
|
|
301
|
+
for (const [pattern, to] of compiled.rules) text = text.replace(pattern, to);
|
|
278
302
|
if (compiled.sequences.length > 0) {
|
|
279
303
|
for (const [key, value] of compiled.sequences) if (text.includes(key)) text = text.split(key).join(value);
|
|
280
304
|
}
|
|
@@ -313,7 +337,7 @@ function compatEntries(table) {
|
|
|
313
337
|
const cached = compatCache.get(table);
|
|
314
338
|
if (cached !== void 0) return cached;
|
|
315
339
|
const out = [];
|
|
316
|
-
for (const [key, value] of Object.entries(table)) if (key.normalize("NFKC") !== key) out.push([key, value]);
|
|
340
|
+
for (const [key, value] of Object.entries(table)) if (key.normalize("NFKC") !== key && !key.startsWith("")) out.push([key, value]);
|
|
317
341
|
compatCache.set(table, out);
|
|
318
342
|
return out;
|
|
319
343
|
}
|
|
@@ -348,6 +372,9 @@ const de = {
|
|
|
348
372
|
ü: "ue",
|
|
349
373
|
ß: "ss",
|
|
350
374
|
ẞ: "SS",
|
|
375
|
+
"%": " prozent ",
|
|
376
|
+
$: " dollar ",
|
|
377
|
+
"£": " pfund ",
|
|
351
378
|
"&": " und "
|
|
352
379
|
}
|
|
353
380
|
};
|
|
@@ -367,6 +394,9 @@ const tr = {
|
|
|
367
394
|
ö: "o",
|
|
368
395
|
Ü: "U",
|
|
369
396
|
ü: "u",
|
|
397
|
+
"%": " yuzde ",
|
|
398
|
+
$: " dolar ",
|
|
399
|
+
"£": " sterlin ",
|
|
370
400
|
"&": " ve "
|
|
371
401
|
},
|
|
372
402
|
lowercase: turkishLowercase
|
|
@@ -389,6 +419,9 @@ const az = {
|
|
|
389
419
|
ü: "u",
|
|
390
420
|
Ə: "E",
|
|
391
421
|
ə: "e",
|
|
422
|
+
"%": " faiz ",
|
|
423
|
+
$: " dollar ",
|
|
424
|
+
"£": " funt ",
|
|
392
425
|
"&": " ve "
|
|
393
426
|
},
|
|
394
427
|
lowercase: turkishLowercase
|
|
@@ -403,6 +436,9 @@ const da = {
|
|
|
403
436
|
å: "aa",
|
|
404
437
|
Æ: "Ae",
|
|
405
438
|
æ: "ae",
|
|
439
|
+
"%": " procent ",
|
|
440
|
+
$: " dollar ",
|
|
441
|
+
"£": " pund ",
|
|
406
442
|
"&": " og "
|
|
407
443
|
}
|
|
408
444
|
};
|
|
@@ -416,6 +452,9 @@ const nb = {
|
|
|
416
452
|
å: "aa",
|
|
417
453
|
Æ: "Ae",
|
|
418
454
|
æ: "ae",
|
|
455
|
+
"%": " prosent ",
|
|
456
|
+
$: " dollar ",
|
|
457
|
+
"£": " pund ",
|
|
419
458
|
"&": " og "
|
|
420
459
|
}
|
|
421
460
|
};
|
|
@@ -429,6 +468,9 @@ const sv = {
|
|
|
429
468
|
ö: "oe",
|
|
430
469
|
Å: "Aa",
|
|
431
470
|
å: "aa",
|
|
471
|
+
"%": " procent ",
|
|
472
|
+
$: " dollar ",
|
|
473
|
+
"£": " pund ",
|
|
432
474
|
"&": " och "
|
|
433
475
|
}
|
|
434
476
|
};
|
|
@@ -442,13 +484,21 @@ const fi = {
|
|
|
442
484
|
ö: "oe",
|
|
443
485
|
Å: "Aa",
|
|
444
486
|
å: "aa",
|
|
487
|
+
"%": " prosenttia ",
|
|
488
|
+
$: " dollari ",
|
|
489
|
+
"£": " punta ",
|
|
445
490
|
"&": " ja "
|
|
446
491
|
}
|
|
447
492
|
};
|
|
448
493
|
/** Hungarian: `&` becomes `es`. */
|
|
449
494
|
const hu = {
|
|
450
495
|
id: "hu",
|
|
451
|
-
table: {
|
|
496
|
+
table: {
|
|
497
|
+
"%": " szazalek ",
|
|
498
|
+
$: " dollar ",
|
|
499
|
+
"£": " font ",
|
|
500
|
+
"&": " es "
|
|
501
|
+
}
|
|
452
502
|
};
|
|
453
503
|
/** Vietnamese: `đ` becomes `d`, `&` becomes `va`. */
|
|
454
504
|
const vi = {
|
|
@@ -456,6 +506,9 @@ const vi = {
|
|
|
456
506
|
table: {
|
|
457
507
|
Đ: "D",
|
|
458
508
|
đ: "d",
|
|
509
|
+
"%": " phan tram ",
|
|
510
|
+
$: " do la ",
|
|
511
|
+
"£": " bang ",
|
|
459
512
|
"&": " va "
|
|
460
513
|
}
|
|
461
514
|
};
|
|
@@ -465,6 +518,9 @@ const es = {
|
|
|
465
518
|
table: {
|
|
466
519
|
Ñ: "N",
|
|
467
520
|
ñ: "n",
|
|
521
|
+
"%": " por ciento ",
|
|
522
|
+
$: " dolar ",
|
|
523
|
+
"£": " libra ",
|
|
468
524
|
"&": " y "
|
|
469
525
|
}
|
|
470
526
|
};
|
|
@@ -476,18 +532,31 @@ const fr = {
|
|
|
476
532
|
œ: "oe",
|
|
477
533
|
Æ: "Ae",
|
|
478
534
|
æ: "ae",
|
|
535
|
+
"%": " pour cent ",
|
|
536
|
+
$: " dollar ",
|
|
537
|
+
"£": " livre ",
|
|
479
538
|
"&": " et "
|
|
480
539
|
}
|
|
481
540
|
};
|
|
482
541
|
/** Portuguese: `&` becomes `e`. */
|
|
483
542
|
const pt = {
|
|
484
543
|
id: "pt",
|
|
485
|
-
table: {
|
|
544
|
+
table: {
|
|
545
|
+
"%": " por cento ",
|
|
546
|
+
$: " dolar ",
|
|
547
|
+
"£": " libra ",
|
|
548
|
+
"&": " e "
|
|
549
|
+
}
|
|
486
550
|
};
|
|
487
551
|
/** Italian: `&` becomes `e`. */
|
|
488
552
|
const it = {
|
|
489
553
|
id: "it",
|
|
490
|
-
table: {
|
|
554
|
+
table: {
|
|
555
|
+
"%": " per cento ",
|
|
556
|
+
$: " dollaro ",
|
|
557
|
+
"£": " sterlina ",
|
|
558
|
+
"&": " e "
|
|
559
|
+
}
|
|
491
560
|
};
|
|
492
561
|
/** Dutch: `ij` becomes `ij`, `&` becomes `en`. */
|
|
493
562
|
const nl = {
|
|
@@ -495,38 +564,71 @@ const nl = {
|
|
|
495
564
|
table: {
|
|
496
565
|
IJ: "IJ",
|
|
497
566
|
ij: "ij",
|
|
567
|
+
"%": " procent ",
|
|
568
|
+
$: " dollar ",
|
|
569
|
+
"£": " pond ",
|
|
498
570
|
"&": " en "
|
|
499
571
|
}
|
|
500
572
|
};
|
|
501
573
|
/** Polish: `&` becomes `i`. */
|
|
502
574
|
const pl = {
|
|
503
575
|
id: "pl",
|
|
504
|
-
table: {
|
|
576
|
+
table: {
|
|
577
|
+
"%": " procent ",
|
|
578
|
+
$: " dolar ",
|
|
579
|
+
"£": " funt ",
|
|
580
|
+
"&": " i "
|
|
581
|
+
}
|
|
505
582
|
};
|
|
506
583
|
/** Romanian: `&` becomes `si`. */
|
|
507
584
|
const ro = {
|
|
508
585
|
id: "ro",
|
|
509
|
-
table: {
|
|
586
|
+
table: {
|
|
587
|
+
"%": " la suta ",
|
|
588
|
+
$: " dolar ",
|
|
589
|
+
"£": " lira ",
|
|
590
|
+
"&": " si "
|
|
591
|
+
}
|
|
510
592
|
};
|
|
511
593
|
/** Czech: `&` becomes `a`. */
|
|
512
594
|
const cs = {
|
|
513
595
|
id: "cs",
|
|
514
|
-
table: {
|
|
596
|
+
table: {
|
|
597
|
+
"%": " procent ",
|
|
598
|
+
$: " dolar ",
|
|
599
|
+
"£": " libra ",
|
|
600
|
+
"&": " a "
|
|
601
|
+
}
|
|
515
602
|
};
|
|
516
603
|
/** Slovak: `&` becomes `a`. */
|
|
517
604
|
const sk = {
|
|
518
605
|
id: "sk",
|
|
519
|
-
table: {
|
|
606
|
+
table: {
|
|
607
|
+
"%": " percent ",
|
|
608
|
+
$: " dolar ",
|
|
609
|
+
"£": " libra ",
|
|
610
|
+
"&": " a "
|
|
611
|
+
}
|
|
520
612
|
};
|
|
521
613
|
/** Slovenian: `&` becomes `in`. */
|
|
522
614
|
const sl = {
|
|
523
615
|
id: "sl",
|
|
524
|
-
table: {
|
|
616
|
+
table: {
|
|
617
|
+
"%": " odstotkov ",
|
|
618
|
+
$: " dolar ",
|
|
619
|
+
"£": " funt ",
|
|
620
|
+
"&": " in "
|
|
621
|
+
}
|
|
525
622
|
};
|
|
526
623
|
/** Croatian: `&` becomes `i`. */
|
|
527
624
|
const hr = {
|
|
528
625
|
id: "hr",
|
|
529
|
-
table: {
|
|
626
|
+
table: {
|
|
627
|
+
"%": " posto ",
|
|
628
|
+
$: " dolar ",
|
|
629
|
+
"£": " funta ",
|
|
630
|
+
"&": " i "
|
|
631
|
+
}
|
|
530
632
|
};
|
|
531
633
|
/** Icelandic: `þ ð` become `th d`, `&` becomes `og`. */
|
|
532
634
|
const is = {
|
|
@@ -536,29 +638,50 @@ const is = {
|
|
|
536
638
|
þ: "th",
|
|
537
639
|
Ð: "D",
|
|
538
640
|
ð: "d",
|
|
641
|
+
"%": " prosent ",
|
|
642
|
+
$: " dollari ",
|
|
643
|
+
"£": " pund ",
|
|
539
644
|
"&": " og "
|
|
540
645
|
}
|
|
541
646
|
};
|
|
542
647
|
/** Estonian: `&` becomes `ja`. */
|
|
543
648
|
const et = {
|
|
544
649
|
id: "et",
|
|
545
|
-
table: {
|
|
650
|
+
table: {
|
|
651
|
+
"%": " protsenti ",
|
|
652
|
+
$: " dollar ",
|
|
653
|
+
"£": " nael ",
|
|
654
|
+
"&": " ja "
|
|
655
|
+
}
|
|
546
656
|
};
|
|
547
657
|
/** Latvian: `&` becomes `un`. */
|
|
548
658
|
const lv = {
|
|
549
659
|
id: "lv",
|
|
550
|
-
table: {
|
|
660
|
+
table: {
|
|
661
|
+
"%": " procenti ",
|
|
662
|
+
$: " dolars ",
|
|
663
|
+
"£": " marcina ",
|
|
664
|
+
"&": " un "
|
|
665
|
+
}
|
|
551
666
|
};
|
|
552
667
|
/** Lithuanian: `&` becomes `ir`. */
|
|
553
668
|
const lt = {
|
|
554
669
|
id: "lt",
|
|
555
|
-
table: {
|
|
670
|
+
table: {
|
|
671
|
+
"%": " procentai ",
|
|
672
|
+
$: " doleris ",
|
|
673
|
+
"£": " svaras ",
|
|
674
|
+
"&": " ir "
|
|
675
|
+
}
|
|
556
676
|
};
|
|
557
677
|
/** Catalan: the punt volat in `l·l` is dropped, `&` becomes `i`. */
|
|
558
678
|
const ca = {
|
|
559
679
|
id: "ca",
|
|
560
680
|
table: {
|
|
561
681
|
"·": "",
|
|
682
|
+
"%": " per cent ",
|
|
683
|
+
$: " dolar ",
|
|
684
|
+
"£": " lliura ",
|
|
562
685
|
"&": " i "
|
|
563
686
|
}
|
|
564
687
|
};
|
|
@@ -592,4 +715,28 @@ const latinLocales = {
|
|
|
592
715
|
};
|
|
593
716
|
|
|
594
717
|
//#endregion
|
|
595
|
-
|
|
718
|
+
//#region src/transliterate/registry.ts
|
|
719
|
+
const registered = /* @__PURE__ */ new Map();
|
|
720
|
+
let version = 0;
|
|
721
|
+
/** A counter that changes whenever the registry does, so cached option resolutions can tell they are stale. */
|
|
722
|
+
function registryVersion() {
|
|
723
|
+
return version;
|
|
724
|
+
}
|
|
725
|
+
/** Makes `slugify` accept each locale's `id` as a string, for locales whose tables do not ship with the main entry (`registerLocale(ru, uk)`). Later registrations win. */
|
|
726
|
+
function registerLocale(...locales) {
|
|
727
|
+
for (const locale of locales) registered.set(locale.id, locale);
|
|
728
|
+
version += 1;
|
|
729
|
+
}
|
|
730
|
+
/** Removes a locale registered with `registerLocale`; the built-in Latin ids cannot be removed. */
|
|
731
|
+
function unregisterLocale(id) {
|
|
732
|
+
const removed = registered.delete(id);
|
|
733
|
+
if (removed) version += 1;
|
|
734
|
+
return removed;
|
|
735
|
+
}
|
|
736
|
+
/** The locale registered under `id`, if any. */
|
|
737
|
+
function registeredLocale(id) {
|
|
738
|
+
return registered.get(id);
|
|
739
|
+
}
|
|
740
|
+
|
|
741
|
+
//#endregion
|
|
742
|
+
export { vi as A, latin as B, pl as C, sl as D, sk as E, lookup as F, resolveTables as I, stripMarks as L, applyCompat as M, compileTables as N, sv as O, fold as P, transliterate as R, nl as S, ro as T, it as _, az as a, lv as b, da as c, et as d, fi as f, is as g, hu as h, unregisterLocale as i, DEFAULT_TABLES as j, tr as k, de as l, hr as m, registeredLocale as n, ca as o, fr as p, registryVersion as r, cs as s, registerLocale as t, es as u, latinLocales as v, pt as w, nb as x, lt as y, symbols as z };
|
|
@@ -16,8 +16,8 @@ interface Locale {
|
|
|
16
16
|
type LatinLocaleId = "az" | "ca" | "cs" | "da" | "de" | "es" | "et" | "fi" | "fr" | "hr" | "hu" | "is" | "it" | "lt" | "lv" | "nb" | "nl" | "pl" | "pt" | "ro" | "sk" | "sl" | "sv" | "tr" | "vi";
|
|
17
17
|
/** Locales that carry the Cyrillic table; import the objects from `cizgile/transliterate`. */
|
|
18
18
|
type CyrillicLocaleId = "be" | "bg" | "kk" | "mk" | "ru" | "sr" | "uk";
|
|
19
|
-
/** Locales that carry
|
|
20
|
-
type OtherLocaleId = "el" | "he" | "ja" | "ko";
|
|
19
|
+
/** Locales that carry a Greek, Hebrew, Indic, Southeast Asian, kana or Hangul table; import the objects from `cizgile/transliterate`. */
|
|
20
|
+
type OtherLocaleId = "bn" | "el" | "gu" | "he" | "hi" | "ja" | "km" | "kn" | "ko" | "lo" | "ml" | "my" | "or" | "pa" | "si" | "ta" | "te" | "th";
|
|
21
21
|
/** Every id in the `locales` registry. */
|
|
22
22
|
type LocaleId = LatinLocaleId | CyrillicLocaleId | OtherLocaleId;
|
|
23
23
|
//#endregion
|
package/dist/transliterate.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as OtherLocaleId, i as LocaleId, n as LatinLocaleId, o as TransliterationTable, r as Locale, t as CyrillicLocaleId } from "./shared/types-
|
|
1
|
+
import { a as OtherLocaleId, i as LocaleId, n as LatinLocaleId, o as TransliterationTable, r as Locale, t as CyrillicLocaleId } from "./shared/types-D5P1JMcX.mjs";
|
|
2
2
|
//#region src/transliterate/core.d.ts
|
|
3
3
|
/** Options for `transliterate`. */
|
|
4
4
|
interface TransliterateOptions {
|
|
@@ -17,6 +17,7 @@ type Sequences = ReadonlyArray<readonly [string, string]>;
|
|
|
17
17
|
interface CompiledTables {
|
|
18
18
|
readonly map: ReadonlyMap<string, string>;
|
|
19
19
|
readonly sequences: Sequences;
|
|
20
|
+
readonly rules: ReadonlyArray<readonly [RegExp, string]>;
|
|
20
21
|
readonly ascii: RegExp | undefined;
|
|
21
22
|
readonly folded: Map<string, string | null>;
|
|
22
23
|
}
|
|
@@ -74,6 +75,62 @@ export declare function mergeTables(...tables: readonly TransliterationTable[]):
|
|
|
74
75
|
/** A new locale from `base` with `overrides` merged in; neither object is mutated. */
|
|
75
76
|
export declare function defineLocale(base: Locale, overrides?: LocaleOverrides): Locale;
|
|
76
77
|
//#endregion
|
|
78
|
+
//#region src/transliterate/devanagari.d.ts
|
|
79
|
+
/** Devanagari (Hindi, Marathi, Nepali) to Latin without diacritics: consonants carry their inherent `a` unless a vowel sign or virama follows; vowel length is not marked and no schwa deletion is applied, so `भारत` is `bharata`. */
|
|
80
|
+
export declare const devanagari: TransliterationTable;
|
|
81
|
+
//#endregion
|
|
82
|
+
//#region src/transliterate/bengali.d.ts
|
|
83
|
+
/** Bengali to Latin without diacritics, syllable by syllable like the Devanagari table: inherent `a`, no vowel length, no schwa deletion. */
|
|
84
|
+
export declare const bengali: TransliterationTable;
|
|
85
|
+
//#endregion
|
|
86
|
+
//#region src/transliterate/gujarati.d.ts
|
|
87
|
+
/** Gujarati to Latin without diacritics, syllable by syllable like the Devanagari table: inherent `a`, no vowel length, no schwa deletion. */
|
|
88
|
+
export declare const gujarati: TransliterationTable;
|
|
89
|
+
//#endregion
|
|
90
|
+
//#region src/transliterate/gurmukhi.d.ts
|
|
91
|
+
/** Gurmukhi to Latin without diacritics, syllable by syllable like the Devanagari table: inherent `a`, no vowel length, no schwa deletion. */
|
|
92
|
+
export declare const gurmukhi: TransliterationTable;
|
|
93
|
+
//#endregion
|
|
94
|
+
//#region src/transliterate/kannada.d.ts
|
|
95
|
+
/** Kannada to Latin without diacritics, syllable by syllable like the Devanagari table: inherent `a`, no vowel length, no schwa deletion. */
|
|
96
|
+
export declare const kannada: TransliterationTable;
|
|
97
|
+
//#endregion
|
|
98
|
+
//#region src/transliterate/khmer.d.ts
|
|
99
|
+
/** Khmer to Latin in a simple UNGEGN-style scheme: consonants keep one value each, subscript consonants (after the coeng) follow their base, and the vowel signs read as the `a` series (`ក ខ ច ដ ត ប ស ហ អ`...) or the `o` series (`គ ង ជ ទ ន ព ម យ រ ល វ`...) of the base consonant, so `ា` is `a` after `ក` and `ea` after `គ`. A bare consonant after a vowel is read as a final, otherwise it takes its inherent `a` or `o`. There is no dictionary or word segmentation, so `ភ្នំពេញ` is `phnumpenh` and `កម្ពុជា` is `kampuchea`. */
|
|
100
|
+
export declare const khmer: TransliterationTable;
|
|
101
|
+
//#endregion
|
|
102
|
+
//#region src/transliterate/lao.d.ts
|
|
103
|
+
/** Lao to Latin in a simple BGN/PCGN-style scheme, without tone marks: the vowels written before the consonant (`ເ ແ ໂ ໃ ໄ`) are moved after it, a consonant is read as initial or final from its neighbours, and a bare consonant takes `a` or, before the final, `o`. Words are not segmented and there is no dictionary, so `ວຽງຈັນ` is `viangchan` and `ລາວ` is `lao`. */
|
|
104
|
+
export declare const lao: TransliterationTable;
|
|
105
|
+
//#endregion
|
|
106
|
+
//#region src/transliterate/malayalam.d.ts
|
|
107
|
+
/** Malayalam to Latin without diacritics, syllable by syllable like the Devanagari table: inherent `a`, no vowel length, no schwa deletion. */
|
|
108
|
+
export declare const malayalam: TransliterationTable;
|
|
109
|
+
//#endregion
|
|
110
|
+
//#region src/transliterate/myanmar.d.ts
|
|
111
|
+
/** Myanmar (Burmese) to Latin in a simple BGN/MLC-style scheme without tone marks: consonants carry an inherent `a` unless a vowel sign, the asat or a stacked consonant follows, the medials read `y`, `w` and `h` (`မြန်မာ` is `myanma`, `ရန်ကုန်` is `yankun`). Aspirates are `hs`, `ht`, `hp`; no sound change between syllables is applied. */
|
|
112
|
+
export declare const myanmar: TransliterationTable;
|
|
113
|
+
//#endregion
|
|
114
|
+
//#region src/transliterate/oriya.d.ts
|
|
115
|
+
/** Oriya to Latin without diacritics, syllable by syllable like the Devanagari table: inherent `a`, no vowel length, no schwa deletion. */
|
|
116
|
+
export declare const oriya: TransliterationTable;
|
|
117
|
+
//#endregion
|
|
118
|
+
//#region src/transliterate/sinhala.d.ts
|
|
119
|
+
/** Sinhala to Latin without diacritics, syllable by syllable like the Devanagari table: inherent `a`, the al-lakuna (virama) removes it, no vowel length is marked and no schwa deletion is applied, so `කොළඹ` is `kolamba`. */
|
|
120
|
+
export declare const sinhala: TransliterationTable;
|
|
121
|
+
//#endregion
|
|
122
|
+
//#region src/transliterate/tamil.d.ts
|
|
123
|
+
/** Tamil to Latin without diacritics, syllable by syllable like the Devanagari table: inherent `a`, no vowel length, no schwa deletion. */
|
|
124
|
+
export declare const tamil: TransliterationTable;
|
|
125
|
+
//#endregion
|
|
126
|
+
//#region src/transliterate/telugu.d.ts
|
|
127
|
+
/** Telugu to Latin without diacritics, syllable by syllable like the Devanagari table: inherent `a`, no vowel length, no schwa deletion. */
|
|
128
|
+
export declare const telugu: TransliterationTable;
|
|
129
|
+
//#endregion
|
|
130
|
+
//#region src/transliterate/thai.d.ts
|
|
131
|
+
/** Thai to Latin after the Royal Thai General System of Transcription, without tone marks and vowel length. The vowels written before the consonant (`เ แ โ ใ ไ`) are moved after it, a consonant is read as initial or final from its neighbours (`ก` is `k` either way, `จ` is `ch` and `t`, `ร` is `r` and `n`), and a bare consonant takes `a` or, before the final, `o`. Words are not segmented and no dictionary is used, so irregular spellings follow those rules: `ไทย` is `thai`, `กรุงเทพ` is `krungthep`. */
|
|
132
|
+
export declare const thai: TransliterationTable;
|
|
133
|
+
//#endregion
|
|
77
134
|
//#region src/transliterate/dhivehi.d.ts
|
|
78
135
|
/** Thaana (Dhivehi) to Latin, the sindresorhus/transliterate values. */
|
|
79
136
|
export declare const dhivehi: TransliterationTable;
|
|
@@ -123,13 +180,41 @@ export declare const cyrillicLocales: Readonly<Record<CyrillicLocaleId, Locale>>
|
|
|
123
180
|
//#region src/transliterate/locales-other.d.ts
|
|
124
181
|
/** Greek: the Greek table, `&` becomes `kai`. */
|
|
125
182
|
export declare const el: Locale;
|
|
183
|
+
/** Hindi: the Devanagari table, `&` becomes `aur`. */
|
|
184
|
+
export declare const hi: Locale;
|
|
126
185
|
/** Hebrew: the Hebrew table, `&` becomes `ve`. */
|
|
127
186
|
export declare const he: Locale;
|
|
128
187
|
/** Japanese: the kana table, `&` becomes `to`; kanji is left alone. */
|
|
129
188
|
export declare const ja: Locale;
|
|
130
189
|
/** Korean: the Hangul table, `&` becomes `mit`. */
|
|
131
190
|
export declare const ko: Locale;
|
|
132
|
-
/**
|
|
191
|
+
/** Bengali: the bengali table, `&` becomes `ebong`. */
|
|
192
|
+
export declare const bn: Locale;
|
|
193
|
+
/** Punjabi: the gurmukhi table, `&` becomes `ate`. */
|
|
194
|
+
export declare const pa: Locale;
|
|
195
|
+
/** Gujarati: the gujarati table, `&` becomes `ane`. */
|
|
196
|
+
export declare const gu: Locale;
|
|
197
|
+
/** Odia: the oriya table, `&` becomes `o`. */
|
|
198
|
+
export declare const or: Locale;
|
|
199
|
+
/** Tamil: the tamil table, `&` becomes `matrum`. */
|
|
200
|
+
export declare const ta: Locale;
|
|
201
|
+
/** Telugu: the telugu table, `&` becomes `mariyu`. */
|
|
202
|
+
export declare const te: Locale;
|
|
203
|
+
/** Kannada: the kannada table, `&` becomes `mattu`. */
|
|
204
|
+
export declare const kn: Locale;
|
|
205
|
+
/** Malayalam: the malayalam table, `&` becomes `um`. */
|
|
206
|
+
export declare const ml: Locale;
|
|
207
|
+
/** Thai: the thai table, `&` becomes `lae`. */
|
|
208
|
+
export declare const th: Locale;
|
|
209
|
+
/** Lao: the lao table, `&` becomes `lae`. */
|
|
210
|
+
export declare const lo: Locale;
|
|
211
|
+
/** Khmer: the khmer table, `&` becomes `ning`. */
|
|
212
|
+
export declare const km: Locale;
|
|
213
|
+
/** Burmese: the myanmar table, `&` becomes `hnin`. */
|
|
214
|
+
export declare const my: Locale;
|
|
215
|
+
/** Sinhala: the sinhala table, `&` becomes `saha`. */
|
|
216
|
+
export declare const si: Locale;
|
|
217
|
+
/** The locales that carry a non-Latin, non-Cyrillic script table, by id. */
|
|
133
218
|
export declare const otherLocales: Readonly<Record<OtherLocaleId, Locale>>;
|
|
134
219
|
//#endregion
|
|
135
220
|
//#region src/transliterate/locales-latin.d.ts
|
|
@@ -186,6 +271,14 @@ export declare const ca: Locale;
|
|
|
186
271
|
/** The Latin-script locales by id; these ship with the main entry. */
|
|
187
272
|
export declare const latinLocales: Readonly<Record<LatinLocaleId, Locale>>;
|
|
188
273
|
//#endregion
|
|
274
|
+
//#region src/transliterate/registry.d.ts
|
|
275
|
+
/** Makes `slugify` accept each locale's `id` as a string, for locales whose tables do not ship with the main entry (`registerLocale(ru, uk)`). Later registrations win. */
|
|
276
|
+
export declare function registerLocale(...locales: readonly Locale[]): void;
|
|
277
|
+
/** Removes a locale registered with `registerLocale`; the built-in Latin ids cannot be removed. */
|
|
278
|
+
export declare function unregisterLocale(id: string): boolean;
|
|
279
|
+
/** The locale registered under `id`, if any. */
|
|
280
|
+
export declare function registeredLocale(id: string): Locale | undefined;
|
|
281
|
+
//#endregion
|
|
189
282
|
//#region src/transliterate/symbols.d.ts
|
|
190
283
|
/** Symbols spelled out in English (`&`, `©`, currency signs) or turned into separators (dashes, quotes, bullets). */
|
|
191
284
|
export declare const symbols: TransliterationTable;
|