|
Last change
on this file since a762898 was a762898, checked in by istevanoska <ilinastevanoska@…>, 5 months ago |
|
Added visualizations
|
-
Property mode
set to
100644
|
|
File size:
327 bytes
|
| Line | |
|---|
| 1 | import { identity } from '../../function/identity.mjs';
|
|---|
| 2 | import { isFunction } from '../../predicate/isFunction.mjs';
|
|---|
| 3 |
|
|---|
| 4 | function wrap(value, wrapper) {
|
|---|
| 5 | return function (...args) {
|
|---|
| 6 | const wrapFn = isFunction(wrapper) ? wrapper : identity;
|
|---|
| 7 | return wrapFn.apply(this, [value, ...args]);
|
|---|
| 8 | };
|
|---|
| 9 | }
|
|---|
| 10 |
|
|---|
| 11 | export { wrap };
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.