@carto/api-client 0.5.0-alpha.15 → 0.5.0-alpha.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/api-client.cjs +50 -53
- package/build/api-client.cjs.map +1 -1
- package/build/api-client.js +47 -52
- package/build/api-client.js.map +1 -1
- package/build/worker.js +47 -76
- package/build/worker.js.map +1 -1
- package/package.json +1 -2
- package/src/operations/applySorting.ts +1 -1
- package/src/vendor/thenby.ts +83 -0
package/build/api-client.cjs
CHANGED
|
@@ -45,57 +45,6 @@ var init_cjs_shims = __esm({
|
|
|
45
45
|
}
|
|
46
46
|
});
|
|
47
47
|
|
|
48
|
-
// node_modules/thenby/thenBy.module.js
|
|
49
|
-
var require_thenBy_module = __commonJS({
|
|
50
|
-
"node_modules/thenby/thenBy.module.js"(exports2, module2) {
|
|
51
|
-
"use strict";
|
|
52
|
-
init_cjs_shims();
|
|
53
|
-
module2.exports = function() {
|
|
54
|
-
function identity3(v) {
|
|
55
|
-
return v;
|
|
56
|
-
}
|
|
57
|
-
function ignoreCase(v) {
|
|
58
|
-
return typeof v === "string" ? v.toLowerCase() : v;
|
|
59
|
-
}
|
|
60
|
-
function makeCompareFunction(f, opt) {
|
|
61
|
-
opt = typeof opt === "object" ? opt : { direction: opt };
|
|
62
|
-
if (typeof f != "function") {
|
|
63
|
-
var prop = f;
|
|
64
|
-
f = function(v1) {
|
|
65
|
-
return !!v1[prop] ? v1[prop] : "";
|
|
66
|
-
};
|
|
67
|
-
}
|
|
68
|
-
if (f.length === 1) {
|
|
69
|
-
var uf = f;
|
|
70
|
-
var preprocess = opt.ignoreCase ? ignoreCase : identity3;
|
|
71
|
-
var cmp = opt.cmp || function(v1, v2) {
|
|
72
|
-
return v1 < v2 ? -1 : v1 > v2 ? 1 : 0;
|
|
73
|
-
};
|
|
74
|
-
f = function(v1, v2) {
|
|
75
|
-
return cmp(preprocess(uf(v1)), preprocess(uf(v2)));
|
|
76
|
-
};
|
|
77
|
-
}
|
|
78
|
-
const descTokens = { "-1": "", desc: "" };
|
|
79
|
-
if (opt.direction in descTokens) return function(v1, v2) {
|
|
80
|
-
return -f(v1, v2);
|
|
81
|
-
};
|
|
82
|
-
return f;
|
|
83
|
-
}
|
|
84
|
-
function tb(func, opt) {
|
|
85
|
-
var x = typeof this == "function" && !this.firstBy ? this : false;
|
|
86
|
-
var y = makeCompareFunction(func, opt);
|
|
87
|
-
var f = x ? function(a, b) {
|
|
88
|
-
return x(a, b) || y(a, b);
|
|
89
|
-
} : y;
|
|
90
|
-
f.thenBy = tb;
|
|
91
|
-
return f;
|
|
92
|
-
}
|
|
93
|
-
tb.firstBy = tb;
|
|
94
|
-
return tb;
|
|
95
|
-
}();
|
|
96
|
-
}
|
|
97
|
-
});
|
|
98
|
-
|
|
99
48
|
// node_modules/moment/moment.js
|
|
100
49
|
var require_moment = __commonJS({
|
|
101
50
|
"node_modules/moment/moment.js"(exports2, module2) {
|
|
@@ -7547,7 +7496,55 @@ function normalizeKeys(keys) {
|
|
|
7547
7496
|
|
|
7548
7497
|
// src/operations/applySorting.ts
|
|
7549
7498
|
init_cjs_shims();
|
|
7550
|
-
|
|
7499
|
+
|
|
7500
|
+
// src/vendor/thenby.ts
|
|
7501
|
+
init_cjs_shims();
|
|
7502
|
+
var firstBy = function() {
|
|
7503
|
+
function identity3(v) {
|
|
7504
|
+
return v;
|
|
7505
|
+
}
|
|
7506
|
+
function ignoreCase(v) {
|
|
7507
|
+
return typeof v === "string" ? v.toLowerCase() : v;
|
|
7508
|
+
}
|
|
7509
|
+
function makeCompareFunction(f, opt) {
|
|
7510
|
+
opt = typeof opt === "object" ? opt : { direction: opt };
|
|
7511
|
+
if (typeof f != "function") {
|
|
7512
|
+
const prop = f;
|
|
7513
|
+
f = function(v1) {
|
|
7514
|
+
return v1[prop] ? v1[prop] : "";
|
|
7515
|
+
};
|
|
7516
|
+
}
|
|
7517
|
+
if (f.length === 1) {
|
|
7518
|
+
const uf = f;
|
|
7519
|
+
const preprocess = opt.ignoreCase ? ignoreCase : identity3;
|
|
7520
|
+
const cmp = opt.cmp || function(v1, v2) {
|
|
7521
|
+
return v1 < v2 ? -1 : v1 > v2 ? 1 : 0;
|
|
7522
|
+
};
|
|
7523
|
+
f = function(v1, v2) {
|
|
7524
|
+
return cmp(preprocess(uf(v1)), preprocess(uf(v2)));
|
|
7525
|
+
};
|
|
7526
|
+
}
|
|
7527
|
+
const descTokens = { "-1": "", desc: "" };
|
|
7528
|
+
if (opt.direction in descTokens)
|
|
7529
|
+
return function(v1, v2) {
|
|
7530
|
+
return -f(v1, v2);
|
|
7531
|
+
};
|
|
7532
|
+
return f;
|
|
7533
|
+
}
|
|
7534
|
+
function tb(func, opt) {
|
|
7535
|
+
const x = typeof this == "function" && !this.firstBy ? this : false;
|
|
7536
|
+
const y = makeCompareFunction(func, opt);
|
|
7537
|
+
const f = x ? function(a, b) {
|
|
7538
|
+
return x(a, b) || y(a, b);
|
|
7539
|
+
} : y;
|
|
7540
|
+
f.thenBy = tb;
|
|
7541
|
+
return f;
|
|
7542
|
+
}
|
|
7543
|
+
tb.firstBy = tb;
|
|
7544
|
+
return tb;
|
|
7545
|
+
}();
|
|
7546
|
+
|
|
7547
|
+
// src/operations/applySorting.ts
|
|
7551
7548
|
function applySorting(features, {
|
|
7552
7549
|
sortBy,
|
|
7553
7550
|
sortByDirection = "asc",
|
|
@@ -7578,7 +7575,7 @@ function createSortFn({
|
|
|
7578
7575
|
sortByDirection,
|
|
7579
7576
|
sortByColumnType
|
|
7580
7577
|
});
|
|
7581
|
-
let sortFn =
|
|
7578
|
+
let sortFn = firstBy(...firstSortOption);
|
|
7582
7579
|
for (const sortOptions of othersSortOptions) {
|
|
7583
7580
|
sortFn = sortFn.thenBy(...sortOptions);
|
|
7584
7581
|
}
|