@storyteller-platform/transliteration 3.0.5 → 3.1.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/dist/{index-BzksFHSB.d.ts → index-D-b6wxdu.d.ts} +11 -4
- package/dist/node/src/node/index.d.ts +2 -2
- package/dist/node/src/node/index.js +4 -3
- package/dist/node/src/node/index.js.map +1 -1
- package/dist/node/src/node/latin.d.ts +2 -2
- package/dist/node/src/node/latin.js +4 -3
- package/dist/node/src/node/latin.js.map +1 -1
- package/package.json +5 -2
- package/dist/bin/slugify +0 -25
- package/dist/bin/transliterate +0 -22
- package/dist/browser/bundle.esm.min.js +0 -2
- package/dist/browser/bundle.esm.min.js.map +0 -1
- package/dist/browser/bundle.umd.min.js +0 -6
- package/dist/browser/bundle.umd.min.js.map +0 -1
- package/dist/browser/latin.esm.min.js +0 -2
- package/dist/browser/latin.esm.min.js.map +0 -1
- package/dist/browser/latin.umd.min.js +0 -6
- package/dist/browser/latin.umd.min.js.map +0 -1
- package/dist/chunk-LT5WZW6A.js +0 -6
- package/dist/chunk-LT5WZW6A.js.map +0 -1
|
@@ -39,10 +39,13 @@ declare class Mapping implements Mappable {
|
|
|
39
39
|
mapResult(pos: number, assoc?: number): MapResult;
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
type OptionReplaceArrayItem = [
|
|
42
|
+
type OptionReplaceArrayItem = [
|
|
43
|
+
string | RegExp,
|
|
44
|
+
string | ((match: RegExpExecArray) => string)
|
|
45
|
+
];
|
|
43
46
|
type OptionReplaceArray = OptionReplaceArrayItem[];
|
|
44
47
|
type OptionReplaceObject = {
|
|
45
|
-
[from: string]: string;
|
|
48
|
+
[from: string]: string | ((match: RegExpExecArray) => string);
|
|
46
49
|
};
|
|
47
50
|
type OptionReplaceCombined = OptionReplaceArray | OptionReplaceObject;
|
|
48
51
|
type OptionsTransliterate = {
|
|
@@ -78,6 +81,10 @@ type OptionsTransliterate = {
|
|
|
78
81
|
* @default true
|
|
79
82
|
*/
|
|
80
83
|
fixChineseSpacing?: boolean;
|
|
84
|
+
/**
|
|
85
|
+
* The locale to interpret the text as
|
|
86
|
+
*/
|
|
87
|
+
locale?: Intl.Locale;
|
|
81
88
|
};
|
|
82
89
|
type OptionsSlugify = OptionsTransliterate & {
|
|
83
90
|
/**
|
|
@@ -108,10 +115,10 @@ type OptionsSlugify = OptionsTransliterate & {
|
|
|
108
115
|
fixChineseSpacing?: boolean;
|
|
109
116
|
};
|
|
110
117
|
type TransliterationFunction<T> = {
|
|
111
|
-
(source: string, options?: T): {
|
|
118
|
+
(source: string, options?: T): Promise<{
|
|
112
119
|
result: string;
|
|
113
120
|
mapping: Mapping;
|
|
114
|
-
}
|
|
121
|
+
}>;
|
|
115
122
|
/**
|
|
116
123
|
* Set default config
|
|
117
124
|
* @param options
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { T as TransliterateFunction, S as SlugifyFunction } from '../../../index-
|
|
2
|
-
export { M as Mapping, a as StepMap } from '../../../index-
|
|
1
|
+
import { T as TransliterateFunction, S as SlugifyFunction } from '../../../index-D-b6wxdu.js';
|
|
2
|
+
export { M as Mapping, a as StepMap } from '../../../index-D-b6wxdu.js';
|
|
3
3
|
|
|
4
4
|
declare const transliterate: TransliterateFunction;
|
|
5
5
|
declare const slugify: SlugifyFunction;
|