10 lines
208 B
JavaScript
10 lines
208 B
JavaScript
|
import curry from 'lodash/function/curry';
|
||
|
import freeze from './freeze';
|
||
|
|
||
|
export default function wrap(func, length = func.length) {
|
||
|
return curry(
|
||
|
(...args) => freeze(func(...args)),
|
||
|
length
|
||
|
);
|
||
|
}
|