Skip to content

Commit

Permalink
fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
ntsekouras committed May 15, 2021
1 parent 3b74b83 commit af7ba55
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ const CreateNewPostLink = ( { type } ) => {
};

// Helper function to get the term id based on user input in terms `FormTokenField`.
const getTermIdByTermValue = ( termsMapedByName, termValue ) => {
const getTermIdByTermValue = ( termsMappedByName, termValue ) => {
// First we check for exact match by `term.id` or case sensitive `term.name` match.
const termId = termValue?.id || termsMapedByName[ termValue ]?.id;
const termId = termValue?.id || termsMappedByName[ termValue ]?.id;
if ( termId ) return termId;
/**
* Here we make an extra check for entered terms in a non case sensitive way,
Expand All @@ -71,9 +71,9 @@ const getTermIdByTermValue = ( termsMapedByName, termValue ) => {
* In this edge case we always apply the first match from the terms list.
*/
const termValueLower = termValue.toLocaleLowerCase();
for ( const term in termsMapedByName ) {
for ( const term in termsMappedByName ) {
if ( term.toLocaleLowerCase() === termValueLower ) {
return termsMapedByName[ term ].id;
return termsMappedByName[ term ].id;
}
}
};
Expand Down

0 comments on commit af7ba55

Please sign in to comment.