UNPKG

@wordpress/block-library

Version:
24 lines (23 loc) • 593 B
// packages/block-library/src/utils/migrate-text-align.js /** * Migrates the current textAlign attribute, * * @param {Object} attributes The current attributes * @return {Object} The updated attributes. */ function migrate_text_align_default(attributes) { const { textAlign, ...restAttributes } = attributes; if (!textAlign) return attributes; return { ...restAttributes, style: { ...attributes.style, typography: { ...attributes.style?.typography, textAlign } } }; } export { migrate_text_align_default as default }; //# sourceMappingURL=migrate-text-align.mjs.map