Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@motionone/generators

Package Overview
Dependencies
Maintainers
2
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@motionone/generators - npm Package Compare versions

Comparing version 10.13.2 to 10.14.0

8

dist/utils/pregenerate-keyframes.cjs.js

@@ -5,12 +5,14 @@ 'use strict';

var utils = require('@motionone/utils');
const timeStep = 10;
const maxDuration = 10000;
function pregenerateKeyframes(generator) {
function pregenerateKeyframes(generator, toUnit = utils.noopReturn) {
let overshootDuration = undefined;
let timestamp = timeStep;
let state = generator(0);
const keyframes = [state.current];
const keyframes = [toUnit(state.current)];
while (!state.done && timestamp < maxDuration) {
state = generator(timestamp);
keyframes.push(state.done ? state.target : state.current);
keyframes.push(toUnit(state.done ? state.target : state.current));
if (overshootDuration === undefined && state.hasReachedTarget) {

@@ -17,0 +19,0 @@ overshootDuration = timestamp;

@@ -0,11 +1,13 @@

import { noopReturn } from '@motionone/utils';
const timeStep = 10;
const maxDuration = 10000;
function pregenerateKeyframes(generator) {
function pregenerateKeyframes(generator, toUnit = noopReturn) {
let overshootDuration = undefined;
let timestamp = timeStep;
let state = generator(0);
const keyframes = [state.current];
const keyframes = [toUnit(state.current)];
while (!state.done && timestamp < maxDuration) {
state = generator(timestamp);
keyframes.push(state.done ? state.target : state.current);
keyframes.push(toUnit(state.done ? state.target : state.current));
if (overshootDuration === undefined && state.hasReachedTarget) {

@@ -12,0 +14,0 @@ overshootDuration = timestamp;

@@ -0,11 +1,12 @@

import { noopReturn } from "@motionone/utils";
const timeStep = 10;
const maxDuration = 10000;
export function pregenerateKeyframes(generator) {
export function pregenerateKeyframes(generator, toUnit = noopReturn) {
let overshootDuration = undefined;
let timestamp = timeStep;
let state = generator(0);
const keyframes = [state.current];
const keyframes = [toUnit(state.current)];
while (!state.done && timestamp < maxDuration) {
state = generator(timestamp);
keyframes.push(state.done ? state.target : state.current);
keyframes.push(toUnit(state.done ? state.target : state.current));
if (overshootDuration === undefined && state.hasReachedTarget) {

@@ -12,0 +13,0 @@ overshootDuration = timestamp;

{
"name": "@motionone/generators",
"version": "10.13.2",
"version": "10.14.0",
"description": "A collection of animation generators.",

@@ -18,4 +18,4 @@ "license": "MIT",

"dependencies": {
"@motionone/types": "^10.13.2",
"@motionone/utils": "^10.13.2",
"@motionone/types": "^10.14.0",
"@motionone/utils": "^10.14.0",
"tslib": "^2.3.1"

@@ -33,3 +33,3 @@ },

],
"gitHead": "a33ab88400c8aac4a6755cda6f93c24563d9ddc5"
"gitHead": "4c59ce9e5539899722427bd00f857dc80f29fc09"
}
import { AnimationGenerator } from "@motionone/types";
export interface KeyframesMetadata {
keyframes: number[];
keyframes: Array<string | number>;
duration: number;
overshootDuration: number;
}
export declare function pregenerateKeyframes(generator: AnimationGenerator): KeyframesMetadata;
export declare function pregenerateKeyframes(generator: AnimationGenerator, toUnit?: (value: number) => number | string): KeyframesMetadata;
//# sourceMappingURL=pregenerate-keyframes.d.ts.map

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc