Remove semicolons.

This commit is contained in:
John-David Dalton
2017-02-04 23:50:10 -08:00
parent f3a8e55e70
commit 6cb3460fce
452 changed files with 4261 additions and 4261 deletions

View File

@@ -1,5 +1,5 @@
import apply from './.internal/apply.js';
import isError from './isError.js';
import apply from './.internal/apply.js'
import isError from './isError.js'
/**
* Attempts to invoke `func`, returning either the result or the caught error
@@ -14,18 +14,18 @@ import isError from './isError.js';
*
* // Avoid throwing errors for invalid selectors.
* const elements = attempt(selector =>
* document.querySelectorAll(selector), '>_>');
* document.querySelectorAll(selector), '>_>')
*
* if (isError(elements)) {
* elements = [];
* elements = []
* }
*/
function attempt(func, ...args) {
try {
return apply(func, undefined, args);
return apply(func, undefined, args)
} catch (e) {
return isError(e) ? e : new Error(e);
return isError(e) ? e : new Error(e)
}
}
export default attempt;
export default attempt