@wordpress/core-data
Version:
Access to and manipulation of core WordPress entities.
8 lines (7 loc) • 926 B
Source Map (JSON)
{
"version": 3,
"sources": ["../../src/utils/get-normalized-comma-separable.js"],
"sourcesContent": ["/**\n * Given a value which can be specified as one or the other of a comma-separated\n * string or an array, returns a value normalized to an array of strings, or\n * null if the value cannot be interpreted as either.\n *\n * @param {string|string[]|*} value\n *\n * @return {?(string[])} Normalized field value.\n */\nfunction getNormalizedCommaSeparable( value ) {\n\tif ( typeof value === 'string' ) {\n\t\treturn value.split( ',' );\n\t} else if ( Array.isArray( value ) ) {\n\t\treturn value;\n\t}\n\n\treturn null;\n}\n\nexport default getNormalizedCommaSeparable;\n"],
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,SAAS,4BAA6B,OAAQ;AAC7C,MAAK,OAAO,UAAU,UAAW;AAChC,WAAO,MAAM,MAAO,GAAI;AAAA,EACzB,WAAY,MAAM,QAAS,KAAM,GAAI;AACpC,WAAO;AAAA,EACR;AAEA,SAAO;AACR;AAEA,IAAO,yCAAQ;",
"names": []
}