@solvprotocol/upgrade-safe-transpiler
Version:
Solidity preprocessor used to generate OpenZeppelin Contracts Upgrade Safe.
19 lines • 623 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.shiftBounds = void 0;
function shiftBounds(shifts, b) {
const end = b.start + b.length;
let startOffset = 0;
let lengthOffset = 0;
for (const s of shifts) {
if (s.location <= b.start) {
startOffset += s.amount;
}
else if (s.location < end || (s.location === end && !s.lengthZero)) {
lengthOffset += s.amount;
}
}
return { start: b.start + startOffset, length: b.length + lengthOffset };
}
exports.shiftBounds = shiftBounds;
//# sourceMappingURL=shifts.js.map