|
|
@ -5,6 +5,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
const mapObj = require("map-obj");
|
|
|
|
const mapObj = require("map-obj");
|
|
|
|
const objectHash = require("object-hash");
|
|
|
|
const objectHash = require("object-hash");
|
|
|
|
|
|
|
|
const util = require("util");
|
|
|
|
|
|
|
|
|
|
|
|
const filterTypeRules = require("./util/filter-type-rules");
|
|
|
|
const filterTypeRules = require("./util/filter-type-rules");
|
|
|
|
|
|
|
|
|
|
|
@ -116,7 +117,7 @@ function hashType(type, level = 0, seenTypes = new Map()) {
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
throw new Error("Foo");
|
|
|
|
throw new Error(`Unrecognized rule type: ${util.inspect(rule)}`);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
for (let [seenRule, seenLevel] of seenTypes) {
|
|
|
|
for (let [seenRule, seenLevel] of seenTypes) {
|
|
|
@ -159,7 +160,7 @@ function hashType(type, level = 0, seenTypes = new Map()) {
|
|
|
|
|
|
|
|
|
|
|
|
module.exports = function generateTypeHash(type) {
|
|
|
|
module.exports = function generateTypeHash(type) {
|
|
|
|
return objectHash(hashType(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,
|
|
|
|
respectFunctionNames: false,
|
|
|
|
respectFunctionProperties: false
|
|
|
|
respectFunctionProperties: false
|
|
|
|
}).slice(0, 6);
|
|
|
|
}).slice(0, 6);
|
|
|
|