mirror of
https://github.com/harttle/liquidjs.git
synced 2026-09-19 06:20:38 -07:00
fix: support for NodeJS 15, fixes #732
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
interface LiquidPerformance {
|
||||
now: () => number
|
||||
}
|
||||
|
||||
const polyfill: LiquidPerformance = {
|
||||
now: () => Date.now()
|
||||
}
|
||||
|
||||
export function getPerformance (): LiquidPerformance {
|
||||
return (typeof global === 'object' && global.performance) ||
|
||||
(typeof window === 'object' && window.performance) ||
|
||||
polyfill
|
||||
}
|
||||
Reference in New Issue
Block a user