Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/andrew--r/fit-to-area


https://github.com/andrew--r/fit-to-area

Last synced: about 6 hours ago
JSON representation

Awesome Lists containing this project

README

        

# @andrew-r/fit-to-area

## Install

```
$ npm install @andrew-r/fit-to-area
```

## Usage

```js
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](https://github.com/andrew--r)