|
Last change
on this file was a762898, checked in by istevanoska <ilinastevanoska@…>, 6 months ago |
|
Added visualizations
|
-
Property mode
set to
100644
|
|
File size:
780 bytes
|
| Rev | Line | |
|---|
| [a762898] | 1 | "use strict";
|
|---|
| 2 |
|
|---|
| 3 | Object.defineProperty(exports, "__esModule", {
|
|---|
| 4 | value: true
|
|---|
| 5 | });
|
|---|
| 6 | exports.getUniqPayload = getUniqPayload;
|
|---|
| 7 | var _uniqBy = _interopRequireDefault(require("es-toolkit/compat/uniqBy"));
|
|---|
| 8 | function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|---|
| 9 | /**
|
|---|
| 10 | * This is configuration option that decides how to filter for unique values only:
|
|---|
| 11 | *
|
|---|
| 12 | * - `false` means "no filter"
|
|---|
| 13 | * - `true` means "use recharts default filter"
|
|---|
| 14 | * - function means "use return of this function as the default key"
|
|---|
| 15 | */
|
|---|
| 16 |
|
|---|
| 17 | function getUniqPayload(payload, option, defaultUniqBy) {
|
|---|
| 18 | if (option === true) {
|
|---|
| 19 | return (0, _uniqBy.default)(payload, defaultUniqBy);
|
|---|
| 20 | }
|
|---|
| 21 | if (typeof option === 'function') {
|
|---|
| 22 | return (0, _uniqBy.default)(payload, option);
|
|---|
| 23 | }
|
|---|
| 24 | return payload;
|
|---|
| 25 | } |
|---|
Note:
See
TracBrowser
for help on using the repository browser.