@andrew-r/fit-to-area
v1.1.0
Published
## Install
Downloads
5
Readme
@andrew-r/fit-to-area
Install
$ npm install @andrew-r/fit-to-area
Usage
const fitToArea = require('@andrew-r/fit-to-area');
fitToArea({
areaDimensions: {
width: 5,
height: 5,
},
objectDimensions: {
width: 5,
height: 10,
},
});
//=> { width: 2.5, height: 5 }
API
type Dimensions = {|
width: number,
height: number,
|};
fitToArea(options: {|
areaDimensions: Dimensions,
objectDimensions: Dimensions,
|}): Dimensions
License
MIT © Andrey Romanov