join-images
Version:
Merge multiple images into a single image
30 lines • 789 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
function calcMargin(obj = {}) {
if (Number.isInteger(obj)) {
return {
bottom: obj,
left: obj,
right: obj,
top: obj,
};
}
if (typeof obj === 'string') {
const [top, right = top, bottom = top, left = right] = obj.split(' ');
return {
bottom: Number(bottom),
left: Number(left),
right: Number(right),
top: Number(top),
};
}
const { top = 0, right = 0, bottom = 0, left = 0 } = obj;
return {
bottom,
left,
right,
top,
};
}
exports.default = calcMargin;
//# sourceMappingURL=calcMargin.js.map