mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-05 09:27:49 +00:00
Remove remaining rest helper use.
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
import apply from './_apply.js';
|
||||
import baseRest from './_baseRest.js';
|
||||
import isError from './isError.js';
|
||||
|
||||
/**
|
||||
@@ -24,12 +23,12 @@ import isError from './isError.js';
|
||||
* elements = [];
|
||||
* }
|
||||
*/
|
||||
const attempt = baseRest((func, args) => {
|
||||
function attempt(func, ...args) {
|
||||
try {
|
||||
return apply(func, undefined, args);
|
||||
} catch (e) {
|
||||
return isError(e) ? e : new Error(e);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
export default attempt;
|
||||
|
||||
Reference in New Issue
Block a user