1 | "use strict";
|
2 | var __rest = (this && this.__rest) || function (s, e) {
|
3 | var t = {};
|
4 | for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
5 | t[p] = s[p];
|
6 | if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
7 | for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
8 | if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
9 | t[p[i]] = s[p[i]];
|
10 | }
|
11 | return t;
|
12 | };
|
13 | Object.defineProperty(exports, "__esModule", { value: true });
|
14 | exports.MaybeKey = void 0;
|
15 | const util_1 = require("@antv/util");
|
16 | const helper_1 = require("./utils/helper");
|
17 |
|
18 |
|
19 |
|
20 | const MaybeKey = () => {
|
21 | return (I, mark) => {
|
22 | const { encode } = mark;
|
23 | const { key } = encode, rest = __rest(encode, ["key"]);
|
24 | if (key !== undefined)
|
25 | return [I, mark];
|
26 | const values = Object.values(rest).map(({ value }) => value);
|
27 | const K = I.map((i) => values
|
28 | .filter(Array.isArray)
|
29 | .map((V) => V[i])
|
30 | .join('-'));
|
31 | return [I, (0, util_1.deepMix)({}, mark, { encode: { key: (0, helper_1.column)(K) } })];
|
32 | };
|
33 | };
|
34 | exports.MaybeKey = MaybeKey;
|
35 | exports.MaybeKey.props = {};
|
36 |
|
\ | No newline at end of file |