|
Last change
on this file was a762898, checked in by istevanoska <ilinastevanoska@…>, 6 months ago |
|
Added visualizations
|
-
Property mode
set to
100644
|
|
File size:
525 bytes
|
| Line | |
|---|
| 1 | import uniqBy from 'es-toolkit/compat/uniqBy';
|
|---|
| 2 |
|
|---|
| 3 | /**
|
|---|
| 4 | * This is configuration option that decides how to filter for unique values only:
|
|---|
| 5 | *
|
|---|
| 6 | * - `false` means "no filter"
|
|---|
| 7 | * - `true` means "use recharts default filter"
|
|---|
| 8 | * - function means "use return of this function as the default key"
|
|---|
| 9 | */
|
|---|
| 10 |
|
|---|
| 11 | export function getUniqPayload(payload, option, defaultUniqBy) {
|
|---|
| 12 | if (option === true) {
|
|---|
| 13 | return uniqBy(payload, defaultUniqBy);
|
|---|
| 14 | }
|
|---|
| 15 | if (typeof option === 'function') {
|
|---|
| 16 | return uniqBy(payload, option);
|
|---|
| 17 | }
|
|---|
| 18 | return payload;
|
|---|
| 19 | } |
|---|
Note:
See
TracBrowser
for help on using the repository browser.