@harmoniclabs/plu-ts-onchain
Version:
An embedded DSL for Cardano smart contracts creation coupled with a library for Cardano transactions, all in Typescript
25 lines (24 loc) • 768 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.shallowEqualIRTermHash = exports.equalIRTermHash = void 0;
var IRHash_1 = require("../IRHash.js");
/**
* forces hash evaluation
*/
function equalIRTermHash(a, b) {
return a === b || (0, IRHash_1.equalIrHash)(a.hash, b.hash);
}
exports.equalIRTermHash = equalIRTermHash;
/**
* only checks the hash if already present ON BOTH
*
* otherwise it assumes the terms are different and returns false
* (even if they might be the same)
*/
function shallowEqualIRTermHash(a, b) {
if (a === b)
return true;
return (a.isHashPresent() && b.isHashPresent() &&
(0, IRHash_1.equalIrHash)(a.hash, b.hash));
}
exports.shallowEqualIRTermHash = shallowEqualIRTermHash;