mirror of
https://github.com/terribleplan/next.js.git
synced 2024-01-19 02:48:18 +00:00
13 lines
280 B
JavaScript
13 lines
280 B
JavaScript
|
// based on https://github.com/timneutkens/is-async-supported
|
||
|
const vm = require('vm')
|
||
|
|
||
|
module.exports = function isAsyncSupported () {
|
||
|
try {
|
||
|
// eslint-disable-next-line no-new
|
||
|
new vm.Script('(async () => ({}))()')
|
||
|
return true
|
||
|
} catch (e) {
|
||
|
return false
|
||
|
}
|
||
|
}
|