parObj
parObj(
str,base?,sep?):Record<string,string|undefined>
Defined in: core/utils/parse.ts:18
Parses a key:value:key:value string (the format used by data-* option
attributes such as data-modal="width:700") into an object.
Values are always strings. An empty string gives {}. If there is an odd
number of segments the last key maps to undefined.
Parameters
Section titled “Parameters”string
String to parse.
string
Text to strip from the front of the string before parsing.
string
Separator between each key and value. Defaults to :.
Returns
Section titled “Returns”Record<string, string | undefined>
Example
Section titled “Example”parObj('width:700:align:left'); // { width: '700', align: 'left' }parObj(''); // {}