Comparing version 0.0.7 to 0.0.8
{ | ||
"name": "webdetta", | ||
"version": "0.0.7", | ||
"version": "0.0.8", | ||
"author": "Fedot Kriutchenko <fodyadev@gmail.com>", | ||
@@ -5,0 +5,0 @@ "description": "", |
const AsyncFunction = (async () => {}).constructor; | ||
export const isAsync = f => f instanceof AsyncFunction; | ||
export const safe = func => function() { | ||
export const safe = f => function() { | ||
try { | ||
return isAsync(func) | ||
return isAsync(f) | ||
? Promise.resolve() | ||
@@ -8,0 +8,0 @@ .then(() => f.apply(this, arguments)) |
24135