Skip to content

pakdatakit/text

Interface Description
SlugifyOptions Options for slugify.
Type Alias Description
SlugScript Which letters slugify keeps.
BidiDirection Direction for wrapBidi.
Function Description
normalizeText Normalizes general text: trims, collapses whitespace, and applies Unicode NFC.
normalizeRomanUrdu Normalizes informal Roman Urdu spellings to common canonical forms.
toUrduDigits Converts English/Arabic-Indic digits in a string to Urdu digits (۰–۹).
toEnglishDigits Converts Urdu/Arabic-Indic digits in a string to English digits (0–9).
slugify Turns text into a URL slug: lower-case words joined by -.
compareUrdu Compares two strings in Urdu alphabetical order, for Array.sort.
isRTL Whether text reads right to left: its first letter is from a right-to-left script such as Urdu or Arabic. Digits, punctuation and spaces are skipped, as in the Unicode bidirectional algorithm’s paragraph rule.
wrapBidi Wraps text in Unicode directional isolates, so a name or number in one direction does not reorder the sentence around it (for example an English order number inside an Urdu message).