-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #278 from bnb-chain/wenty/aggregator
fix: Fix one-to-many logic of special tokens do not take effect
- Loading branch information
Showing
3 changed files
with
64 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,14 @@ | ||
export function isEmpty(obj?: Object) { | ||
return !obj || Object.entries(obj).length === 0; | ||
} | ||
|
||
export function uniqueArr<T = unknown>(arr: T[]) { | ||
const map = new Map<any, boolean>(); | ||
return arr.filter((item) => { | ||
if (map.get(item)) { | ||
return false; | ||
} | ||
map.set(item, true); | ||
return true; | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters