github
13 of 238 branches covered (5.46%)
Branch coverage included in aggregate %.
0 of 472 new or added lines in 41 files covered. (0.0%)
19728 existing lines in 193 files now uncovered.91 of 28170 relevant lines covered (0.32%)
0.02 hits per line
UNCOV
1
|
// Node.js polyfills for requestAnimationFrame and cancelAnimationFrame
|
|
UNCOV
2
|
/* global window, setTimeout, clearTimeout */
|
× |
UNCOV
3
|
|
× |
UNCOV
4
|
// / <reference types="@types/node" />
|
× |
UNCOV
5
|
export function requestAnimationFrame(callback: (time?: any) => void): any { |
× |
UNCOV
6
|
return typeof window !== 'undefined' && window.requestAnimationFrame |
× |
UNCOV
7
|
? window.requestAnimationFrame(callback) |
× |
UNCOV
8
|
: setTimeout(callback, 1000 / 60); |
× |
UNCOV
9
|
} |
× |
UNCOV
10
|
|
× |
UNCOV
11
|
export function cancelAnimationFrame(timerId: any): void { |
× |
UNCOV
12
|
return typeof window !== 'undefined' && window.cancelAnimationFrame |
× |
UNCOV
13
|
? window.cancelAnimationFrame(timerId) |
× |
UNCOV
14
|
: clearTimeout(timerId); |
× |
UNCOV
15
|
} |
× |