Skip to content

Commit

Permalink
Fix lint issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Schascha committed Feb 20, 2024
1 parent 55ff7c6 commit 92276a0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/event.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export function debounce(fn, delay) {
export function throttled(fn, delay) {
let timer = 0;
return (...args) => {
const now = (new Date).getTime();
const now = new Date().getTime();
if (now - timer < delay) {
return;
}
Expand Down
20 changes: 10 additions & 10 deletions src/filter.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,16 @@ export function compare(a, b, operator = '') {
export function filter(obj, filters) {
return filters && filters.length
? obj.filter((el) => {
return filters.every((filter) => {
if (Array.isArray(filter.field)) {
return filter.field.find((item) =>
compare(el[item], filter.value, filter.operator)
);
} else {
return compare(el[filter.field], filter.value, filter.operator);
}
});
})
return filters.every((filter) => {
if (Array.isArray(filter.field)) {
return filter.field.find((item) =>
compare(el[item], filter.value, filter.operator)
);
} else {
return compare(el[filter.field], filter.value, filter.operator);
}
});
})
: obj;
}

Expand Down

0 comments on commit 92276a0

Please sign in to comment.