Skip to content

Commit

Permalink
Merge pull request #16 from Exabyte-io/chore/SOF-6955-2
Browse files Browse the repository at this point in the history
chore: add guard clause to filterByType
  • Loading branch information
timurbazhirov authored Sep 20, 2023
2 parents 54eea75 + 7111d8f commit e44528e
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/include/meta_properties/pseudopotential.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ export class Pseudopotential extends Property {
* @returns {Pseudopotential[]}
*/
static filterByType(pseudos, pseudoType) {
if (pseudoType === undefined || pseudoType === "any") return pseudos;
return pseudos.filter((pseudo) => pseudo.type.includes(pseudoType));
}
}

0 comments on commit e44528e

Please sign in to comment.