View as Markdown

API reference: @salmonui/inputs/otp-field

normalizeOtpfunction

import { normalizeOtp } from '@salmonui/inputs/otp-field';
function normalizeOtp(raw: string, length: number, type?: 'numeric' | 'alphanumeric' | 'text', transform?: 'uppercase' | 'lowercase' | 'none'): string;

Keeps the accepted characters, applies transform and cuts to length.