diff options
| author | Shipwreckt <me@shipwreckt.co.uk> | 2025-10-31 20:02:14 +0000 |
|---|---|---|
| committer | Shipwreckt <me@shipwreckt.co.uk> | 2025-10-31 20:02:14 +0000 |
| commit | 7a52ddeba2a68388b544f529d2d92104420f77b0 (patch) | |
| tree | 15ddd47457a2cb4a96060747437d36474e4f6b4e /node_modules/@sindresorhus/transliterate/index.d.ts | |
| parent | 53d6ae2b5568437afa5e4995580a3fb679b7b91b (diff) | |
Changed from static to 11ty!
Diffstat (limited to 'node_modules/@sindresorhus/transliterate/index.d.ts')
| -rw-r--r-- | node_modules/@sindresorhus/transliterate/index.d.ts | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/node_modules/@sindresorhus/transliterate/index.d.ts b/node_modules/@sindresorhus/transliterate/index.d.ts new file mode 100644 index 0000000..535f4e1 --- /dev/null +++ b/node_modules/@sindresorhus/transliterate/index.d.ts @@ -0,0 +1,48 @@ +export interface Options { + /** + Add your own custom replacements. + + The replacements are run on the original string before any other transformations. + + This only overrides a default replacement if you set an item with the same key. + + @default [] + + @example + ``` + import transliterate from '@sindresorhus/transliterate'; + + transliterate('Я люблю единорогов', { + customReplacements: [ + ['единорогов', '🦄'] + ] + }) + //=> 'Ya lyublyu 🦄' + ``` + */ + readonly customReplacements?: ReadonlyArray<[string, string]>; +} + +/** +Convert Unicode characters to Latin characters using [transliteration](https://en.wikipedia.org/wiki/Transliteration). + +@param string - String to transliterate. + +@example +``` +import transliterate from '@sindresorhus/transliterate'; + +transliterate('Fußgängerübergänge'); +//=> 'Fussgaengeruebergaenge' + +transliterate('Я люблю единорогов'); +//=> 'Ya lyublyu edinorogov' + +transliterate('أنا أحب حيدات'); +//=> 'ana ahb hydat' + +transliterate('tôi yêu những chú kỳ lân'); +//=> 'toi yeu nhung chu ky lan' +``` +*/ +export default function transliterate(string: string, options?: Options): string; |
