Helpers
Formatting and utility functions you can use without the hook.
Mask helpers
| Function | Description |
|---|---|
applyMask(value, mask) | Applies a pattern to a raw value |
unmask(value, mask) | Extracts data characters from a masked value |
stripMask(value, mask) | At a locked mask step, keeps only data slots |
cleanValue(value, allowed?, forbidden?) | Filters with allow / forbid regex |
Currency
formatCurrency(value, options): raw"1234.56"→ display (1,234.56US default; customize separators for TR)unformatCurrency(value, options): display → raw
Card
getCardType(cardNumber) → "visa" | "mastercard" | "amex" | "troy" | "unknown". Works from BIN prefixes (Visa 4, Amex 34/37, Troy 9792…).
Refs
mergeRefs(...refs): merge the RHF register ref with a local ref. The hook uses this internally; useful on your own controlled inputs too.
