Skip to content

Commit

Permalink
fix(): Ensure non-scalars are in lookup results
Browse files Browse the repository at this point in the history
  • Loading branch information
jwerle committed Jan 13, 2020
1 parent 25e24c9 commit b762265
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions iso-639/codes.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,10 @@ function lookup(filter, opts) {

return Object.values(codes).reverse().filter((item) => {
let result = true
if (!item || 'object' !== typeof item) {
return false
}

for (const key of keys) {
if (key in filter && !test(filter[key], item[key])) {
if (alias[key] in item && test(filter[key], item[alias[key]])) {
Expand Down

0 comments on commit b762265

Please sign in to comment.