diff --git a/packages/ckeditor5-alignment/src/alignmentediting.js b/packages/ckeditor5-alignment/src/alignmentediting.js index 0820a80ceee..6da914b9de2 100644 --- a/packages/ckeditor5-alignment/src/alignmentediting.js +++ b/packages/ckeditor5-alignment/src/alignmentediting.js @@ -87,11 +87,11 @@ function buildDowncastInlineDefinition( options ) { view: {} }; - for ( const option of options ) { - definition.view[ option.name ] = { + for ( const { name } of options ) { + definition.view[ name ] = { key: 'style', value: { - 'text-align': option.name + 'text-align': name } }; } @@ -104,17 +104,17 @@ function buildDowncastInlineDefinition( options ) { function buildUpcastInlineDefinitions( options ) { const definitions = []; - for ( const option of options ) { + for ( const { name } of options ) { definitions.push( { view: { key: 'style', value: { - 'text-align': option.name + 'text-align': name } }, model: { key: 'alignment', - value: option.name + value: name } } ); } diff --git a/packages/ckeditor5-alignment/src/utils.js b/packages/ckeditor5-alignment/src/utils.js index c82568e715e..75883d864a9 100644 --- a/packages/ckeditor5-alignment/src/utils.js +++ b/packages/ckeditor5-alignment/src/utils.js @@ -19,10 +19,6 @@ import { CKEditorError, logWarning } from 'ckeditor5/src/utils'; */ export const supportedOptions = [ 'left', 'right', 'center', 'justify' ]; -const optionNameToOptionMap = Object.fromEntries( - supportedOptions.map( option => [ option, { name: option } ] ) -); - /** * Checks whether the passed option is supported by {@link module:alignment/alignmentediting~AlignmentEditing}. * @@ -65,7 +61,7 @@ export function normalizeAlignmentOptions( configuredOptions ) { if ( typeof option == 'string' ) { result = { name: option }; } else { - result = { ...optionNameToOptionMap[ option.name ], ...option }; + result = option; } return result;