Support type aliases when type-hashing

master
Sven Slootweg 6 years ago
parent 1ddafb60ef
commit 09c7487d34

@ -116,6 +116,12 @@ function hashType(type, level = 0, seenTypes = new Map()) {
typeHash: hashType(actualTrait, level + 1, seenTypes) typeHash: hashType(actualTrait, level + 1, seenTypes)
}; };
} }
} else if (rule._isTypeAlias === true) {
/* Should we wrap this in an `alias` to represent alias-level additional constraints? Or should we just return the canonical rule for the _alias itself? */
props = {
ruleType: "alias",
type: rule._alias
};
} else { } else {
throw new Error(`Unrecognized rule type: ${util.inspect(rule)}`); throw new Error(`Unrecognized rule type: ${util.inspect(rule)}`);
} }

Loading…
Cancel
Save