Skip to content

Commit

Permalink
chore: add guard clause to filterByType
Browse files Browse the repository at this point in the history
  • Loading branch information
azech-hqs committed Sep 19, 2023
1 parent 54eea75 commit 7111d8f
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 7111d8f

Please sign in to comment.