@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.js
CHANGED
|
@@ -32,56 +32,6 @@ var __toESM = (mod2, isNodeMode, target) => (target = mod2 != null ? __create(__
|
|
|
32
32
|
));
|
|
33
33
|
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
34
34
|
|
|
35
|
-
// node_modules/thenby/thenBy.module.js
|
|
36
|
-
var require_thenBy_module = __commonJS({
|
|
37
|
-
"node_modules/thenby/thenBy.module.js"(exports, module) {
|
|
38
|
-
"use strict";
|
|
39
|
-
module.exports = function() {
|
|
40
|
-
function identity3(v) {
|
|
41
|
-
return v;
|
|
42
|
-
}
|
|
43
|
-
function ignoreCase(v) {
|
|
44
|
-
return typeof v === "string" ? v.toLowerCase() : v;
|
|
45
|
-
}
|
|
46
|
-
function makeCompareFunction(f, opt) {
|
|
47
|
-
opt = typeof opt === "object" ? opt : { direction: opt };
|
|
48
|
-
if (typeof f != "function") {
|
|
49
|
-
var prop = f;
|
|
50
|
-
f = function(v1) {
|
|
51
|
-
return !!v1[prop] ? v1[prop] : "";
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
if (f.length === 1) {
|
|
55
|
-
var uf = f;
|
|
56
|
-
var preprocess = opt.ignoreCase ? ignoreCase : identity3;
|
|
57
|
-
var cmp = opt.cmp || function(v1, v2) {
|
|
58
|
-
return v1 < v2 ? -1 : v1 > v2 ? 1 : 0;
|
|
59
|
-
};
|
|
60
|
-
f = function(v1, v2) {
|
|
61
|
-
return cmp(preprocess(uf(v1)), preprocess(uf(v2)));
|
|
62
|
-
};
|
|
63
|
-
}
|
|
64
|
-
const descTokens = { "-1": "", desc: "" };
|
|
65
|
-
if (opt.direction in descTokens) return function(v1, v2) {
|
|
66
|
-
return -f(v1, v2);
|
|
67
|
-
};
|
|
68
|
-
return f;
|
|
69
|
-
}
|
|
70
|
-
function tb(func, opt) {
|
|
71
|
-
var x = typeof this == "function" && !this.firstBy ? this : false;
|
|
72
|
-
var y = makeCompareFunction(func, opt);
|
|
73
|
-
var f = x ? function(a, b) {
|
|
74
|
-
return x(a, b) || y(a, b);
|
|
75
|
-
} : y;
|
|
76
|
-
f.thenBy = tb;
|
|
77
|
-
return f;
|
|
78
|
-
}
|
|
79
|
-
tb.firstBy = tb;
|
|
80
|
-
return tb;
|
|
81
|
-
}();
|
|
82
|
-
}
|
|
83
|
-
});
|
|
84
|
-
|
|
85
35
|
// node_modules/moment/moment.js
|
|
86
36
|
var require_moment = __commonJS({
|
|
87
37
|
"node_modules/moment/moment.js"(exports, module) {
|
|
@@ -7348,8 +7298,53 @@ function normalizeKeys(keys) {
|
|
|
7348
7298
|
return Array.isArray(keys) ? keys : typeof keys === "string" ? [keys] : void 0;
|
|
7349
7299
|
}
|
|
7350
7300
|
|
|
7301
|
+
// src/vendor/thenby.ts
|
|
7302
|
+
var firstBy = function() {
|
|
7303
|
+
function identity3(v) {
|
|
7304
|
+
return v;
|
|
7305
|
+
}
|
|
7306
|
+
function ignoreCase(v) {
|
|
7307
|
+
return typeof v === "string" ? v.toLowerCase() : v;
|
|
7308
|
+
}
|
|
7309
|
+
function makeCompareFunction(f, opt) {
|
|
7310
|
+
opt = typeof opt === "object" ? opt : { direction: opt };
|
|
7311
|
+
if (typeof f != "function") {
|
|
7312
|
+
const prop = f;
|
|
7313
|
+
f = function(v1) {
|
|
7314
|
+
return v1[prop] ? v1[prop] : "";
|
|
7315
|
+
};
|
|
7316
|
+
}
|
|
7317
|
+
if (f.length === 1) {
|
|
7318
|
+
const uf = f;
|
|
7319
|
+
const preprocess = opt.ignoreCase ? ignoreCase : identity3;
|
|
7320
|
+
const cmp = opt.cmp || function(v1, v2) {
|
|
7321
|
+
return v1 < v2 ? -1 : v1 > v2 ? 1 : 0;
|
|
7322
|
+
};
|
|
7323
|
+
f = function(v1, v2) {
|
|
7324
|
+
return cmp(preprocess(uf(v1)), preprocess(uf(v2)));
|
|
7325
|
+
};
|
|
7326
|
+
}
|
|
7327
|
+
const descTokens = { "-1": "", desc: "" };
|
|
7328
|
+
if (opt.direction in descTokens)
|
|
7329
|
+
return function(v1, v2) {
|
|
7330
|
+
return -f(v1, v2);
|
|
7331
|
+
};
|
|
7332
|
+
return f;
|
|
7333
|
+
}
|
|
7334
|
+
function tb(func, opt) {
|
|
7335
|
+
const x = typeof this == "function" && !this.firstBy ? this : false;
|
|
7336
|
+
const y = makeCompareFunction(func, opt);
|
|
7337
|
+
const f = x ? function(a, b) {
|
|
7338
|
+
return x(a, b) || y(a, b);
|
|
7339
|
+
} : y;
|
|
7340
|
+
f.thenBy = tb;
|
|
7341
|
+
return f;
|
|
7342
|
+
}
|
|
7343
|
+
tb.firstBy = tb;
|
|
7344
|
+
return tb;
|
|
7345
|
+
}();
|
|
7346
|
+
|
|
7351
7347
|
// src/operations/applySorting.ts
|
|
7352
|
-
var import_thenby = __toESM(require_thenBy_module(), 1);
|
|
7353
7348
|
function applySorting(features, {
|
|
7354
7349
|
sortBy,
|
|
7355
7350
|
sortByDirection = "asc",
|
|
@@ -7380,7 +7375,7 @@ function createSortFn({
|
|
|
7380
7375
|
sortByDirection,
|
|
7381
7376
|
sortByColumnType
|
|
7382
7377
|
});
|
|
7383
|
-
let sortFn =
|
|
7378
|
+
let sortFn = firstBy(...firstSortOption);
|
|
7384
7379
|
for (const sortOptions of othersSortOptions) {
|
|
7385
7380
|
sortFn = sortFn.thenBy(...sortOptions);
|
|
7386
7381
|
}
|