Created
January 16, 2018 01:27
-
-
Save YaoKaiLun/6edc2e9389c35095049c05612fce9fd0 to your computer and use it in GitHub Desktop.
check async support
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function supportAsyncFunctions() { | |
try { | |
new Function('(async function () {})()'); | |
return true; | |
} catch (ex) { | |
return false; | |
} | |
} | |
module.exports = supportAsyncFunctions() ? require('./lib/client.js') : require('./es5/client.js'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment