@beabee/beabee-common 1.10.3 → 1.10.4

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.
@@ -31,7 +31,7 @@ const startOf = {
31
31
  m: startOfMinute_1.default,
32
32
  s: startOfSecond_1.default,
33
33
  };
34
- const relativeDate = /\$now(?<units>\(((y|M|d|h|m|s):(-?\d+),?)+\))?/;
34
+ const relativeDate = /^\$now(?<units>\(((y|M|d|h|m|s):(-?\d+),?)+\))?$/;
35
35
  const relativeUnit = /(y|M|d|h|m|s):(-?\d+)/g;
36
36
  // Matches the different parts of an ISO 8601 date. Note we don't validate the
37
37
  // pattern properly as that is handled by parseISO, we just want to know which
@@ -25,7 +25,7 @@ const startOf = {
25
25
  m: startOfMinute,
26
26
  s: startOfSecond,
27
27
  };
28
- const relativeDate = /\$now(?<units>\(((y|M|d|h|m|s):(-?\d+),?)+\))?/;
28
+ const relativeDate = /^\$now(?<units>\(((y|M|d|h|m|s):(-?\d+),?)+\))?$/;
29
29
  const relativeUnit = /(y|M|d|h|m|s):(-?\d+)/g;
30
30
  // Matches the different parts of an ISO 8601 date. Note we don't validate the
31
31
  // pattern properly as that is handled by parseISO, we just want to know which
@@ -40,4 +40,4 @@ export declare enum PaymentStatus {
40
40
  Cancelled = "cancelled"
41
41
  }
42
42
  export declare const RoleTypes: readonly ["member", "admin", "superadmin"];
43
- export type RoleType = typeof RoleTypes[number];
43
+ export type RoleType = (typeof RoleTypes)[number];
@@ -1,5 +1,5 @@
1
1
  declare const dateUnits: readonly ["s", "m", "h", "d", "M", "y"];
2
- type DateUnit = typeof dateUnits[number];
2
+ type DateUnit = (typeof dateUnits)[number];
3
3
  export declare function parseDate(value: string, now?: Date): [Date, DateUnit];
4
4
  export declare function getMinDateUnit(units: [DateUnit, ...DateUnit[]]): DateUnit;
5
5
  export declare function getMinDateUnit(units: DateUnit[]): DateUnit | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@beabee/beabee-common",
3
- "version": "1.10.3",
3
+ "version": "1.10.4",
4
4
  "description": "",
5
5
  "main": "./dist/cjs/index.js",
6
6
  "module": "./dist/esm/index.js",