@wordpress/block-library
Version:
Block library for the WordPress editor.
8 lines (7 loc) • 864 B
Source Map (JSON)
{
"version": 3,
"sources": ["../../src/table/utils.js"],
"sourcesContent": ["/**\n * Normalize the rowspan/colspan value.\n * Returns undefined if the parameter is not a positive number\n * or the default value (1) for rowspan/colspan.\n *\n * @param {number|undefined} rowColSpan rowspan/colspan value.\n *\n * @return {string|undefined} normalized rowspan/colspan value.\n */\nexport function normalizeRowColSpan( rowColSpan ) {\n\tconst parsedValue = parseInt( rowColSpan, 10 );\n\tif ( ! Number.isInteger( parsedValue ) ) {\n\t\treturn undefined;\n\t}\n\treturn parsedValue < 0 || parsedValue === 1\n\t\t? undefined\n\t\t: parsedValue.toString();\n}\n"],
"mappings": ";AASO,SAAS,oBAAqB,YAAa;AACjD,QAAM,cAAc,SAAU,YAAY,EAAG;AAC7C,MAAK,CAAE,OAAO,UAAW,WAAY,GAAI;AACxC,WAAO;AAAA,EACR;AACA,SAAO,cAAc,KAAK,gBAAgB,IACvC,SACA,YAAY,SAAS;AACzB;",
"names": []
}