@rr0/cms 0.3.8 → 0.3.9

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.
@@ -6,6 +6,7 @@ import { Place } from "@rr0/place";
6
6
  export declare class RR0ContextFilter extends TimeContextFilter<RR0CaseSummary> {
7
7
  }
8
8
  export declare abstract class RR0Datasource extends AbstractDatasource<RR0CaseSummary> {
9
+ static idCount: number;
9
10
  static readonly placeRegex: RegExp;
10
11
  protected constructor();
11
12
  static id(dateTime: EdtfDate, place: Place | undefined): string;
@@ -8,7 +8,8 @@ export class RR0Datasource extends AbstractDatasource {
8
8
  }
9
9
  static id(dateTime, place) {
10
10
  var _a;
11
- return `${dateTime.toString()}$${((_a = place === null || place === void 0 ? void 0 : place.toString()) !== null && _a !== void 0 ? _a : "")}`;
11
+ return `${(dateTime === null || dateTime === void 0 ? void 0 : dateTime.toString()) || ("rr0-" + this.idCount++)}$${((_a = place === null || place === void 0 ? void 0 : place.toString()) !== null && _a !== void 0 ? _a : "")}`;
12
12
  }
13
13
  }
14
+ RR0Datasource.idCount = 0;
14
15
  RR0Datasource.placeRegex = /^(.+?)(?:\s*\((.+?)(?:\s*,\s*(.+?)(?:\s*,\s*(.+?)))?\))?$/g;
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@rr0/cms",
3
3
  "type": "module",
4
4
  "author": "Jérôme Beau <rr0@rr0.org> (https://rr0.org)",
5
- "version": "0.3.8",
5
+ "version": "0.3.9",
6
6
  "description": "RR0 Content Management System (CMS)",
7
7
  "exports": "./dist/index.js",
8
8
  "types": "./dist/index.d.ts",