|
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:
440 bytes
|
| Line | |
|---|
| 1 | 'use strict';
|
|---|
| 2 |
|
|---|
| 3 | Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|---|
| 4 |
|
|---|
| 5 | const identity = require('../../function/identity.js');
|
|---|
| 6 | const isFunction = require('../../predicate/isFunction.js');
|
|---|
| 7 |
|
|---|
| 8 | function wrap(value, wrapper) {
|
|---|
| 9 | return function (...args) {
|
|---|
| 10 | const wrapFn = isFunction.isFunction(wrapper) ? wrapper : identity.identity;
|
|---|
| 11 | return wrapFn.apply(this, [value, ...args]);
|
|---|
| 12 | };
|
|---|
| 13 | }
|
|---|
| 14 |
|
|---|
| 15 | exports.wrap = wrap;
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.