New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

nimate

Package Overview
Dependencies
Maintainers
0
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nimate - npm Package Compare versions

Comparing version 1.2.1 to 1.3.0

10

dist/animate.d.ts

@@ -15,2 +15,11 @@ import EventEmitter from 'eventemitter3';

}
interface SetOptions {
from?: AnimatableValue;
to?: AnimatableValue;
duration?: number;
easing?: TEasing;
delay?: number;
direction?: 'normal' | 'reverse' | 'alternate';
loop?: number;
}
export declare class Animate extends EventEmitter {

@@ -37,3 +46,4 @@ private from;

stop(): this;
set(options: SetOptions): void;
}
export {};

@@ -157,3 +157,52 @@ "use strict";

}
set(options) {
if (options.from !== undefined) {
if (!this.isValidAnimatableValue(options.from)) {
throw new Error('Invalid animatable value');
}
this.from = options.from;
}
if (options.to !== undefined) {
if (!this.isValidAnimatableValue(options.to)) {
throw new Error('Invalid animatable value');
}
this.to = options.to;
}
if (options.duration !== undefined) {
if (typeof options.duration !== 'number' || options.duration <= 0) {
throw new Error('Duration must be a positive number');
}
this.duration = options.duration;
}
if (options.easing !== undefined) {
this.easing = options.easing;
}
if (options.delay !== undefined) {
if (typeof options.delay !== 'number' || options.delay < 0) {
throw new Error('Delay must be a non-negative number');
}
this.delay = options.delay;
}
if (options.direction !== undefined) {
if (!['normal', 'reverse', 'alternate'].includes(options.direction)) {
throw new Error('Invalid direction');
}
this.direction = options.direction;
this.isReversed = options.direction === 'reverse';
}
if (options.loop !== undefined) {
if (typeof options.loop !== 'number' || options.loop < 0) {
throw new Error('Loop must be a non-negative number');
}
this.loop = options.loop;
this.loopsCompleted = 0;
}
// Restart the animation with updated properties
this.startTime = performance.now();
if (this.process !== undefined) {
framesync_1.cancelSync.update(this.process);
}
this.process = framesync_1.default.update(this.tick, true);
}
}
exports.Animate = Animate;

2

package.json
{
"name": "nimate",
"version": "1.2.1",
"version": "1.3.0",
"description": "A simple, flexible animation library.",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

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