parsePickerItemsfunction
Reads a bounded list, one item per line or a JSON string array.
Import it
import { parsePickerItems } from "@johnmorrisdotca/tane/element";
Also exported from: @johnmorrisdotca/tane/element/define
Definition
function parsePickerItems(text: string | null): string[] | null
Parameters
| Name | Type | Description |
|---|---|---|
text | string | null | The list, or null for the example list. |
Returns
string[] | null
Trimmed nonempty items, or null for malformed, empty or oversized input.
Examples
import { parsePickerItems } from "@johnmorrisdotca/tane/element";
console.log(parsePickerItems("A\nB\nC"));[ 'A', 'B', 'C' ]What it prints (run when this page was built)