@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/worker.js CHANGED
@@ -1,81 +1,7 @@
1
- var __create = Object.create;
2
1
  var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
2
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
- var __commonJS = (cb, mod2) => function __require() {
9
- return mod2 || (0, cb[__getOwnPropNames(cb)[0]])((mod2 = { exports: {} }).exports, mod2), mod2.exports;
10
- };
11
- var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from))
14
- if (!__hasOwnProp.call(to, key) && key !== except)
15
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
- }
17
- return to;
18
- };
19
- var __toESM = (mod2, isNodeMode, target) => (target = mod2 != null ? __create(__getProtoOf(mod2)) : {}, __copyProps(
20
- // If the importer is in node compatibility mode or this is not an ESM
21
- // file that has been converted to a CommonJS file using a Babel-
22
- // compatible transform (i.e. "__esModule" has not been set), then set
23
- // "default" to the CommonJS "module.exports" for node compatibility.
24
- isNodeMode || !mod2 || !mod2.__esModule ? __defProp(target, "default", { value: mod2, enumerable: true }) : target,
25
- mod2
26
- ));
27
3
  var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
28
4
 
29
- // node_modules/thenby/thenBy.module.js
30
- var require_thenBy_module = __commonJS({
31
- "node_modules/thenby/thenBy.module.js"(exports, module) {
32
- "use strict";
33
- module.exports = function() {
34
- function identity(v) {
35
- return v;
36
- }
37
- function ignoreCase(v) {
38
- return typeof v === "string" ? v.toLowerCase() : v;
39
- }
40
- function makeCompareFunction(f, opt) {
41
- opt = typeof opt === "object" ? opt : { direction: opt };
42
- if (typeof f != "function") {
43
- var prop = f;
44
- f = function(v1) {
45
- return !!v1[prop] ? v1[prop] : "";
46
- };
47
- }
48
- if (f.length === 1) {
49
- var uf = f;
50
- var preprocess = opt.ignoreCase ? ignoreCase : identity;
51
- var cmp = opt.cmp || function(v1, v2) {
52
- return v1 < v2 ? -1 : v1 > v2 ? 1 : 0;
53
- };
54
- f = function(v1, v2) {
55
- return cmp(preprocess(uf(v1)), preprocess(uf(v2)));
56
- };
57
- }
58
- const descTokens = { "-1": "", desc: "" };
59
- if (opt.direction in descTokens) return function(v1, v2) {
60
- return -f(v1, v2);
61
- };
62
- return f;
63
- }
64
- function tb(func, opt) {
65
- var x = typeof this == "function" && !this.firstBy ? this : false;
66
- var y = makeCompareFunction(func, opt);
67
- var f = x ? function(a, b) {
68
- return x(a, b) || y(a, b);
69
- } : y;
70
- f.thenBy = tb;
71
- return f;
72
- }
73
- tb.firstBy = tb;
74
- return tb;
75
- }();
76
- }
77
- });
78
-
79
5
  // src/constants.ts
80
6
  var FilterType = /* @__PURE__ */ ((FilterType2) => {
81
7
  FilterType2["IN"] = "in";
@@ -995,8 +921,53 @@ function normalizeKeys(keys) {
995
921
  return Array.isArray(keys) ? keys : typeof keys === "string" ? [keys] : void 0;
996
922
  }
997
923
 
924
+ // src/vendor/thenby.ts
925
+ var firstBy = function() {
926
+ function identity(v) {
927
+ return v;
928
+ }
929
+ function ignoreCase(v) {
930
+ return typeof v === "string" ? v.toLowerCase() : v;
931
+ }
932
+ function makeCompareFunction(f, opt) {
933
+ opt = typeof opt === "object" ? opt : { direction: opt };
934
+ if (typeof f != "function") {
935
+ const prop = f;
936
+ f = function(v1) {
937
+ return v1[prop] ? v1[prop] : "";
938
+ };
939
+ }
940
+ if (f.length === 1) {
941
+ const uf = f;
942
+ const preprocess = opt.ignoreCase ? ignoreCase : identity;
943
+ const cmp = opt.cmp || function(v1, v2) {
944
+ return v1 < v2 ? -1 : v1 > v2 ? 1 : 0;
945
+ };
946
+ f = function(v1, v2) {
947
+ return cmp(preprocess(uf(v1)), preprocess(uf(v2)));
948
+ };
949
+ }
950
+ const descTokens = { "-1": "", desc: "" };
951
+ if (opt.direction in descTokens)
952
+ return function(v1, v2) {
953
+ return -f(v1, v2);
954
+ };
955
+ return f;
956
+ }
957
+ function tb(func, opt) {
958
+ const x = typeof this == "function" && !this.firstBy ? this : false;
959
+ const y = makeCompareFunction(func, opt);
960
+ const f = x ? function(a, b) {
961
+ return x(a, b) || y(a, b);
962
+ } : y;
963
+ f.thenBy = tb;
964
+ return f;
965
+ }
966
+ tb.firstBy = tb;
967
+ return tb;
968
+ }();
969
+
998
970
  // src/operations/applySorting.ts
999
- var import_thenby = __toESM(require_thenBy_module(), 1);
1000
971
  function applySorting(features, {
1001
972
  sortBy,
1002
973
  sortByDirection = "asc",
@@ -1027,7 +998,7 @@ function createSortFn({
1027
998
  sortByDirection,
1028
999
  sortByColumnType
1029
1000
  });
1030
- let sortFn = (0, import_thenby.firstBy)(...firstSortOption);
1001
+ let sortFn = firstBy(...firstSortOption);
1031
1002
  for (const sortOptions of othersSortOptions) {
1032
1003
  sortFn = sortFn.thenBy(...sortOptions);
1033
1004
  }