Last active
December 27, 2020 06:55
-
-
Save munierujp/c1e5349eb6b67913974354ac3105c061 to your computer and use it in GitHub Desktop.
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 tryEscape (escape) { | |
return new Promise((resolve, reject) => { | |
try { | |
const result = escape() | |
resolve(result) | |
} catch (e) { | |
reject(e) | |
} | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment