Skip to content

Commit

Permalink
jan's feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviertassinari committed Oct 6, 2024
1 parent 5637c55 commit c5b480f
Showing 1 changed file with 9 additions and 15 deletions.
24 changes: 9 additions & 15 deletions docs/data/material/components/material-icons/SearchIcons.js
Original file line number Diff line number Diff line change
Expand Up @@ -518,26 +518,20 @@ const searchIndex = new FlexSearchIndex({
tokenize: 'full',
});

const nameCleanRegex = /(Outlined|TwoTone|Rounded|Sharp)$/;

const allIconsMap = {};
const allIcons = Object.keys(mui)
.sort()
.map((importName) => {
let theme;
if (importName.endsWith('Outlined')) {
theme = 'Outlined';
} else if (importName.endsWith('TwoTone')) {
theme = 'Two tone';
} else if (importName.endsWith('Rounded')) {
theme = 'Rounded';
} else if (importName.endsWith('Sharp')) {
theme = 'Sharp';
} else {
theme = 'Filled';
let theme = 'Filled';
let name = importName;

for (const currentTheme of ['Outlined', 'Rounded', 'TwoTone', 'Sharp']) {
if (importName.endsWith(currentTheme)) {
theme = currentTheme === 'TwoTone' ? 'Two tone' : currentTheme;
name = importName.slice(0, -currentTheme.length);
break;
}
}

const name = importName.replace(nameCleanRegex, '');
let searchable = name;
if (synonyms[searchable]) {
searchable += ` ${synonyms[searchable]}`;
Expand Down

0 comments on commit c5b480f

Please sign in to comment.