Temporarily use SHA1 for type hashes, and clarify unrecognized-rule error

master
Sven Slootweg 6 years ago
parent d0079c6bac
commit b4b625065a

@ -5,6 +5,7 @@
const mapObj = require("map-obj");
const objectHash = require("object-hash");
const util = require("util");
const filterTypeRules = require("./util/filter-type-rules");
@ -116,7 +117,7 @@ function hashType(type, level = 0, seenTypes = new Map()) {
};
}
} else {
throw new Error("Foo");
throw new Error(`Unrecognized rule type: ${util.inspect(rule)}`);
}
for (let [seenRule, seenLevel] of seenTypes) {
@ -159,7 +160,7 @@ function hashType(type, level = 0, seenTypes = new Map()) {
module.exports = function generateTypeHash(type) {
return objectHash(hashType(type), {
algorithm: "sha256",
algorithm: "sha1", /* FIXME: Switch to SHA256, after figuring out how to make this work in Webpack */
respectFunctionNames: false,
respectFunctionProperties: false
}).slice(0, 6);

Loading…
Cancel
Save