Socket
Socket
Sign inDemoInstall

@terra-dev/big-interpolate

Package Overview
Dependencies
2
Maintainers
1
Versions
30
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @terra-dev/big-interpolate

Interpolate function for [Big.js](https://www.npmjs.com/package/big.js)


Version published
Maintainers
1
Created

Readme

Source

@terra-dev/big-interpolate

Interpolate function for Big.js

API

index.ts

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);
  });
});

FAQs

Last updated on 15 Jul 2021

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc