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

request-animation-frame

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

request-animation-frame - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

24

lib/shim.js
(function() {
var _ref;
var max, now, _ref, _ref2;
_ref = (function() {
var cancel, isNative, last, request, vendor, _i, _len, _ref;
now = (_ref = Date.now) != null ? _ref : function() {
return new Date().getTime();
};
max = Math.max;
_ref2 = (function() {
var cancel, isNative, last, request, vendor, _i, _len, _ref2;
last = 0;
request = typeof window !== "undefined" && window !== null ? window.requestAnimationFrame : void 0;
cancel = typeof window !== "undefined" && window !== null ? window.cancelAnimationFrame : void 0;
_ref = ["webkit", "moz", "o", "ms"];
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
vendor = _ref[_i];
_ref2 = ["webkit", "moz", "o", "ms"];
for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
vendor = _ref2[_i];
if (cancel == null) {

@@ -23,4 +29,4 @@ cancel = (typeof window !== "undefined" && window !== null ? window["" + vendor + "cancelAnimationFrame"] : void 0) || (typeof window !== "undefined" && window !== null ? window["" + vendor + "cancelRequestAnimationFrame"] : void 0);

if (timeout == null) timeout = 16;
cur = new Date().getTime();
time = Math.max(0, timeout + last - cur);
cur = now();
time = max(0, timeout + last - cur);
id = setTimeout(function() {

@@ -39,4 +45,4 @@ return typeof callback === "function" ? callback(cur + time) : void 0;

return [request, cancel];
})(), this.requestAnimationFrame = _ref[0], this.cancelAnimationFrame = _ref[1];
})(), this.requestAnimationFrame = _ref2[0], this.cancelAnimationFrame = _ref2[1];
}).call(this);
{ "name": "request-animation-frame"
, "description": "requestAnimationFrame shim"
, "version": "0.1.0"
, "version": "0.1.1"
, "homepage": "https://github.com/dodo/requestAnimationFrame.js"

@@ -5,0 +5,0 @@ , "author": "dodo (https://github.com/dodo)"

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