fn

unmask

v0.0.14tested

The masked → raw bridge: strip a mask's fixed characters from a masked string, without needing a DOM element. RegExp masks have no fixed characters, so the value is returned unchanged.

Example

ts
unmask('+1 (123) 456-7890', maskPhoneOptions({ template: '+1 (###) ###-####' }));
// '1234567890'

Signature

ts
export function unmask(maskedValue: string, options: MaskOptions): string{ ... }

Parameters

ParameterTypeDescription
maskedValuestring
optionsMaskOptions

Returns

string