1
0
Fork 0
mirror of https://github.com/terribleplan/next.js.git synced 2024-01-19 02:48:18 +00:00
next.js/server/lib/is-async-supported.js

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
}
}