Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
exports.foo = a => {
/* eslint-disable-next-line no-shadow, global-require */
const Nat = require('@agoric/nat');
return Nat(a);
};
}
function insistWithinBounds(num, canvasSize) {
Nat(num);
Nat(canvasSize);
// 0 to canvasSize - 1
insist(num >= 0 && num < canvasSize)`\
pixel position must be within bounds`;
}
function insistWithinBounds(num, canvasSize) {
Nat(num);
Nat(canvasSize);
// 0 to canvasSize - 1
insist(num >= 0 && num < canvasSize)`\
pixel position must be within bounds`;
}
divide: (x, y) => Nat(Math.floor(x / y)),
});
add: (x, y) => Nat(x + y),
subtract: (x, y) => Nat(x - y),
with: (left, right) => Nat(left + right),
without: (whole, part) => Nat(whole - part),
function getPixelColor(x, y) {
const rawPixel = harden({ x: Nat(x), y: Nat(y) });
return state[rawPixel.x][rawPixel.y];
}
multiply: (x, y) => Nat(x * y),
divide: (x, y) => Nat(Math.floor(x / y)),