Skip to content

Commit

Permalink
Adjust code style.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mati365 committed Jan 10, 2025
1 parent 6696ecf commit 76be543
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -289,8 +289,9 @@ function createAttributeStrategies( enabledProperties: ListPropertiesConfig ) {

if ( allowedTypes ) {
supportedTypes = supportedTypes.filter( styleType => {
const listType = getListTypeFromListStyleType( styleType );
return allowedTypes[ listType as 'numbered' | 'bulleted' ].includes( styleType );
const listType = getListTypeFromListStyleType( styleType )!;

return allowedTypes[ listType ].includes( styleType );
} );
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -474,15 +474,11 @@ function getMenuBarStylesMenuCreator(

if ( configuredTypes ) {
const listType = parentCommandName.replace( 'List', '' ) as 'numbered' | 'bulleted';
const allowedTypes = configuredTypes[ listType ] || [];

filteredDefinitions = styleDefinitions.filter( def => allowedTypes.includes( def.type ) );
filteredDefinitions = styleDefinitions.filter( def => ( configuredTypes[ listType ] || [] ).includes( def.type ) );
}

const styleButtonViews = filteredDefinitions
.filter( isStyleTypeSupported )
.map( styleButtonCreator );

const styleButtonViews = filteredDefinitions.filter( isStyleTypeSupported ).map( styleButtonCreator );
const listPropertiesView = new ListPropertiesView( locale, {
styleGridAriaLabel,
enabledProperties: {
Expand Down

0 comments on commit 76be543

Please sign in to comment.