@rr0/cms 0.3.20 → 0.3.21

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.
@@ -4,8 +4,14 @@ import { Level2Date as EdtfDate } from "@rr0/time";
4
4
  export class CaseFactory extends TypedDataFactory {
5
5
  parse(dataJson) {
6
6
  const parsedCase = super.parse(dataJson);
7
- parsedCase.time = EdtfDate.fromString(dataJson.time);
8
- parsedCase.place = new NamedPlace(dataJson.place);
7
+ const time = dataJson.time;
8
+ if (time) {
9
+ parsedCase.time = EdtfDate.fromString(time);
10
+ }
11
+ const placeName = dataJson.place;
12
+ if (placeName) {
13
+ parsedCase.place = new NamedPlace(placeName);
14
+ }
9
15
  parsedCase.classification = dataJson.classification;
10
16
  parsedCase.conclusion = dataJson.conclusion;
11
17
  return parsedCase;
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.20",
5
+ "version": "0.3.21",
6
6
  "description": "RR0 Content Management System (CMS)",
7
7
  "exports": "./dist/index.js",
8
8
  "types": "./dist/index.d.ts",