@budibase/shared-core 2.3.21-alpha.1 → 2.3.21-alpha.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@budibase/shared-core",
3
- "version": "2.3.21-alpha.1",
3
+ "version": "2.3.21-alpha.2",
4
4
  "description": "Shared data utils",
5
5
  "main": "dist/src/index.js",
6
6
  "types": "dist/src/index.d.ts",
@@ -10,6 +10,9 @@
10
10
  "build": "tsc",
11
11
  "dev:builder": "tsc --watch"
12
12
  },
13
+ "dependencies": {
14
+ "@budibase/types": "2.3.21-alpha.2"
15
+ },
13
16
  "devDependencies": {
14
17
  "typescript": "4.7.3"
15
18
  }
package/src/filters.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import { SortDirection } from "@budibase/types"
1
2
  import { OperatorOptions, SqlNumberTypeRangeMap } from "./constants"
2
3
 
3
4
  const HBS_REGEX = /{{([^{].*?)}}/g
@@ -399,7 +400,7 @@ export const runLuceneQuery = (
399
400
  export const luceneSort = (
400
401
  docs: any[],
401
402
  sort: string | number,
402
- sortOrder: string,
403
+ sortOrder: SortDirection,
403
404
  sortType = "string"
404
405
  ) => {
405
406
  if (!sort || !sortOrder || !sortType) {
@@ -412,7 +413,7 @@ export const luceneSort = (
412
413
  .sort((a: { [x: string]: any }, b: { [x: string]: any }) => {
413
414
  const colA = parse(a[sort])
414
415
  const colB = parse(b[sort])
415
- if (sortOrder === "Descending") {
416
+ if (sortOrder.toLowerCase() === "descending") {
416
417
  return colA > colB ? -1 : 1
417
418
  } else {
418
419
  return colA > colB ? 1 : -1
package/dist/src/index.js DELETED
@@ -1,32 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
19
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
20
- };
21
- var __importStar = (this && this.__importStar) || function (mod) {
22
- if (mod && mod.__esModule) return mod;
23
- var result = {};
24
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
25
- __setModuleDefault(result, mod);
26
- return result;
27
- };
28
- Object.defineProperty(exports, "__esModule", { value: true });
29
- exports.dataFilters = void 0;
30
- __exportStar(require("./constants"), exports);
31
- exports.dataFilters = __importStar(require("./filters"));
32
- //# sourceMappingURL=index.js.map