Skip to main content

@dialstack/sdk-dev / js/src / parsePhoneNumberRows

Function: parsePhoneNumberRows()

TypeScript
function parsePhoneNumberRows(text): ParsedRow[];

Defined in: sdk/js/src/utils/phone-list.ts:296

Split pasted text into one entry per number, in input order, for a UI that holds each number separately.

Everything the writer put in comes back out: a segment that could not be read keeps its text verbatim and carries a reason, and a line with no digits at all — a spreadsheet heading, or a typo like asdf — is an unreadable entry rather than something quietly dropped. Only genuinely blank lines disappear.

Repeats are kept. Whether a repeat is worth flagging is a question about the whole list, which the caller can answer by looking at what came before it; dropping it here would lose the writer's text.

Parameters

text

string

Returns

ParsedRow[]