Skip to content

Commit

Permalink
fix: error if bad specref entry found (closes #1082)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcoscaceres authored and Marcos Cáceres committed Feb 16, 2017
1 parent 908b29d commit 958d378
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/core/biblio-db.js
Expand Up @@ -10,6 +10,8 @@
*
*/
/*globals IDBKeyRange, DOMException, console */
import { pub } from "core/pubsubhub";

const ALLOWED_TYPES = new Set(["alias", "reference"]);
// Database initialization, tracked by "readyPromise"
const readyPromise = new Promise((resolve, reject) => {
Expand Down Expand Up @@ -206,6 +208,15 @@ export const biblioDB = {
};
Object
.keys(data)
.filter(key => {
if (typeof data[key] === "string") {
let msg = "Legacy SpecRef entries are not supported: [[" + key + "]]. ";
msg += "Please update it at https://github.com/tobie/specref/";
pub("error", msg);
return false;
}
return true;
})
.map(
id => Object.assign({ id }, data[id])
)
Expand Down

0 comments on commit 958d378

Please sign in to comment.