Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
extractFromPromise: function (promise) {
if (promise.then) {
var fut = new Future();
promise.then(function(result) {
fut["return"](result);
}, function(error) {
fut["throw"](error);
});
return fut.wait();
} else { //in case promise already resolved
return promise;
}
},
escapeRegExp: function (str) {