source: node_modules/recharts/lib/util/payload/getUniqPayload.js@ ba17441

Last change on this file since ba17441 was a762898, checked in by istevanoska <ilinastevanoska@…>, 5 months ago

Added visualizations

  • Property mode set to 100644
File size: 780 bytes
Line 
1"use strict";
2
3Object.defineProperty(exports, "__esModule", {
4 value: true
5});
6exports.getUniqPayload = getUniqPayload;
7var _uniqBy = _interopRequireDefault(require("es-toolkit/compat/uniqBy"));
8function _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
17function 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.