UNPKG

@wordpress/block-library

Version:
23 lines (22 loc) • 759 B
"use strict"; Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } }); // packages/block-library/src/table/utils.js /** * Normalize the rowspan/colspan value. * Returns undefined if the parameter is not a positive number * or the default value (1) for rowspan/colspan. * * @param {number|undefined} rowColSpan rowspan/colspan value. * * @return {string|undefined} normalized rowspan/colspan value. */ function normalizeRowColSpan(rowColSpan) { const parsedValue = parseInt(rowColSpan, 10); if (!Number.isInteger(parsedValue)) return; return parsedValue < 0 || parsedValue === 1 ? void 0 : parsedValue.toString(); } exports.normalizeRowColSpan = normalizeRowColSpan; //# sourceMappingURL=utils.cjs.map