@essentials/raf
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -13,6 +13,3 @@ 'use strict' | ||
if (win) { | ||
let vps = ['webkit', 'moz', 'ms', 'o'], | ||
vp = null, | ||
i = 0, | ||
af = 'AnimationFrame', | ||
let af = 'AnimationFrame', | ||
Raf = 'Request' + af | ||
@@ -22,13 +19,17 @@ exports.raf = raf = win.requestAnimationFrame.bind(win) | ||
function _ref(vp) { | ||
//@ts-ignore | ||
exports.raf = raf = raf || win[vp + Raf] //@ts-ignore | ||
exports.caf = caf = | ||
caf || win[vp + 'Cancel' + af] || win[vp + 'Cancel' + Raf] | ||
} | ||
if (!raf || !caf) { | ||
for (; i < vps.length; i++) { | ||
vp = vps[i] | ||
exports.raf = raf = raf || win[vp + Raf] | ||
exports.caf = caf = | ||
caf || win[vp + 'Cancel' + af] || win[vp + 'Cancel' + Raf] | ||
} | ||
// eslint-disable-next-line no-extra-semi | ||
;['webkit', 'moz', 'ms', 'o'].forEach(_ref) | ||
} | ||
} | ||
function _ref(h) { | ||
function _ref2(h) { | ||
return clearTimeout(h) | ||
@@ -48,3 +49,3 @@ } | ||
exports.caf = caf = _ref | ||
exports.caf = caf = _ref2 | ||
} |
@@ -7,6 +7,3 @@ let p = typeof performance !== 'undefined' ? performance : Date | ||
if (win) { | ||
let vps = ['webkit', 'moz', 'ms', 'o'], | ||
vp = null, | ||
i = 0, | ||
af = 'AnimationFrame', | ||
let af = 'AnimationFrame', | ||
Raf = 'Request' + af | ||
@@ -16,12 +13,16 @@ raf = win.requestAnimationFrame.bind(win) | ||
function _ref(vp) { | ||
//@ts-ignore | ||
raf = raf || win[vp + Raf] //@ts-ignore | ||
caf = caf || win[vp + 'Cancel' + af] || win[vp + 'Cancel' + Raf] | ||
} | ||
if (!raf || !caf) { | ||
for (; i < vps.length; i++) { | ||
vp = vps[i] | ||
raf = raf || win[vp + Raf] | ||
caf = caf || win[vp + 'Cancel' + af] || win[vp + 'Cancel' + Raf] | ||
} | ||
// eslint-disable-next-line no-extra-semi | ||
;['webkit', 'moz', 'ms', 'o'].forEach(_ref) | ||
} | ||
} | ||
function _ref(h) { | ||
function _ref2(h) { | ||
return clearTimeout(h) | ||
@@ -41,5 +42,5 @@ } | ||
caf = _ref | ||
caf = _ref2 | ||
} | ||
export {raf, caf} |
{ | ||
"name": "@essentials/raf", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"homepage": "https://github.com/jaredLunde/essentials/tree/master/packages/raf#readme", | ||
@@ -5,0 +5,0 @@ "repository": "github:jaredLunde/essentials", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6594
76