@opentermsarchive/engine 13.0.0 → 13.0.1

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": "@opentermsarchive/engine",
3
- "version": "13.0.0",
3
+ "version": "13.0.1",
4
4
  "description": "Tracks and makes visible changes to the terms of online services",
5
5
  "homepage": "https://opentermsarchive.org",
6
6
  "bugs": {
@@ -260,6 +260,9 @@ async function loadServiceHistoryFiles(serviceId) {
260
260
  ]);
261
261
 
262
262
  Object.entries(serviceDeclaration.terms).forEach(([ termsType, declaration ]) => {
263
+ if (!Array.isArray(serviceHistory[termsType]) && serviceHistory[termsType] !== undefined) {
264
+ throw new Error(`History file for "${termsType}" is not properly formatted: expected an array but got an object. Please use [] instead of {}.`);
265
+ }
263
266
  serviceHistory[termsType] = serviceHistory[termsType] || [];
264
267
  serviceHistory[termsType].push(declaration);
265
268
  });