rectangle-state
Generate a state meaning a rectangle as a plane object
Installation
npm install rectangle-state
Usage
const createRectangleState toXYWidthHeight = ; console; // -> { top: 1, right: 12, bottom: 2, left: 11 } console; // -> { top: 1, right: 12, bottom: 2, left: 11 } console; // -> { x: 11, y: 1, width: 1, height: 1 } // Error - The `x` is mixed.//createRectangleState({ top: 1, right: 12, bottom: 2, left: 11, x: 1 }); // Error - The `top` is greater than the `bottom`.//createRectangleState({ top: 100, right: 12, bottom: 2, left: 11 });