@terra-dev/big-interpolate
v0.20.1
Published
Interpolate function for [Big.js](https://www.npmjs.com/package/big.js)
Downloads
18
Readme
@terra-dev/big-interpolate
Interpolate function for Big.js
API
export interface Options {
/** start value */
from: BigSource;
/** end value */
to: BigSource;
/** ease function (e.g. import { easeQuadInOut } from 'd3-ease') */
ease?: (nomalizedTime: number) => number;
}
export const interpolateBig = ({
from,
to,
ease = easeLinear,
}: Options): ((e: number) => Big) => {};
Spec
__tests__/interpolateBig.test.ts
import { interpolateBig } from '@terra-dev/big-interpolate/index';
describe('interpolateBig', () => {
test('should get right value', () => {
const interpolate = interpolateBig({
from: 0,
to: 100,
});
expect(interpolate(0).toNumber()).toBe(0);
expect(interpolate(0.5).toNumber()).toBe(50);
expect(interpolate(1).toNumber()).toBe(100);
});
});