Skip to content

Commit

Permalink
Lodash: Refactor PageAttributesParent away from _.deburr() (WordPress…
Browse files Browse the repository at this point in the history
  • Loading branch information
tyxla authored Jul 15, 2022
1 parent 3828a65 commit 066a446
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 11 deletions.
3 changes: 2 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion packages/editor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@
"lodash": "^4.17.21",
"memize": "^1.1.0",
"react-autosize-textarea": "^7.1.0",
"rememo": "^4.0.0"
"rememo": "^4.0.0",
"remove-accents": "^0.4.2"
},
"peerDependencies": {
"react": "^17.0.0",
Expand Down
13 changes: 4 additions & 9 deletions packages/editor/src/components/page-attributes/parent.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
/**
* External dependencies
*/
import {
get,
unescape as unescapeString,
debounce,
find,
deburr,
} from 'lodash';
import { get, unescape as unescapeString, debounce, find } from 'lodash';
import removeAccents from 'remove-accents';

/**
* WordPress dependencies
Expand All @@ -32,8 +27,8 @@ function getTitle( post ) {
}

export const getItemPriority = ( name, searchValue ) => {
const normalizedName = deburr( name ).toLowerCase();
const normalizedSearch = deburr( searchValue ).toLowerCase();
const normalizedName = removeAccents( name || '' ).toLowerCase();
const normalizedSearch = removeAccents( searchValue || '' ).toLowerCase();
if ( normalizedName === normalizedSearch ) {
return 0;
}
Expand Down

0 comments on commit 066a446

Please sign in to comment.