@ovok/core 0.4.11 → 0.4.12

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.
@@ -121,7 +121,11 @@ class OfflineMeasurementQueue {
121
121
  };
122
122
  this.writeQueue = (queue) => {
123
123
  this.storage.setObject(this.storageKey, queue);
124
- if (!Array.isArray(this.storage.getObject(this.storageKey))) {
124
+ const stored = this.storage.getObject(this.storageKey);
125
+ const queueWasPersisted = queue.length === 0
126
+ ? stored === undefined || (Array.isArray(stored) && stored.length === 0)
127
+ : Array.isArray(stored);
128
+ if (!queueWasPersisted) {
125
129
  throw new Error(`Offline measurement queue could not be persisted at storage key "${this.storageKey}".`);
126
130
  }
127
131
  };
@@ -48,7 +48,7 @@ exports.OVOK_CORE_REQUIREMENTS = {
48
48
  description: "The FHIR surface a server must provide for the @ovok/core client library's own methods to function.",
49
49
  software: {
50
50
  name: "@ovok/core",
51
- version: "0.4.11",
51
+ version: "0.4.12",
52
52
  },
53
53
  fhirVersion: "4.0.1",
54
54
  format: ["json"],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ovok/core",
3
- "version": "0.4.11",
3
+ "version": "0.4.12",
4
4
  "private": false,
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",