1.1.0 • Published 4 years ago

@andrew-r/fit-to-area v1.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

@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

1.1.0

4 years ago

1.0.0

4 years ago

0.1.0

4 years ago