@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.
@@ -39,10 +39,13 @@ declare class Mapping implements Mappable {
39
39
  mapResult(pos: number, assoc?: number): MapResult;
40
40
  }
41
41
 
42
- type OptionReplaceArrayItem = [string | RegExp, string];
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-BzksFHSB.js';
2
- export { M as Mapping, a as StepMap } from '../../../index-BzksFHSB.js';
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;