Sha256: dcfebf623523363f0c24faf07c6763fa004883d8bc2e5f2c0e1a1244ed8fdcaf

Contents?: true

Size: 871 Bytes

Versions: 276

Compression:

Stored size: 871 Bytes

Contents

var castFunction = require('./_castFunction'),
    partial = require('./partial');

/**
 * Creates a function that provides `value` to `wrapper` as its first
 * argument. Any additional arguments provided to the function are appended
 * to those provided to the `wrapper`. The wrapper is invoked with the `this`
 * binding of the created function.
 *
 * @static
 * @memberOf _
 * @since 0.1.0
 * @category Function
 * @param {*} value The value to wrap.
 * @param {Function} [wrapper=identity] The wrapper function.
 * @returns {Function} Returns the new function.
 * @example
 *
 * var p = _.wrap(_.escape, function(func, text) {
 *   return '<p>' + func(text) + '</p>';
 * });
 *
 * p('fred, barney, & pebbles');
 * // => '<p>fred, barney, &amp; pebbles</p>'
 */
function wrap(value, wrapper) {
  return partial(castFunction(wrapper), value);
}

module.exports = wrap;

Version data entries

276 entries across 274 versions & 30 rubygems

Version Path
rapid_stack-0.2.0 templates/frontend/node_modules/lodash/wrap.js
rapid_stack-0.1.1 templates/FrontEnd/node_modules/lodash/wrap.js
rapid_stack-0.1.0 templates/FrontEnd/node_modules/lodash/wrap.js
immosquare-cleaner-0.1.60 node_modules/lodash/wrap.js
immosquare-cleaner-0.1.59 node_modules/lodash/wrap.js
immosquare-cleaner-0.1.58 node_modules/lodash/wrap.js
immosquare-cleaner-0.1.57 node_modules/lodash/wrap.js
immosquare-cleaner-0.1.56 node_modules/lodash/wrap.js
immosquare-cleaner-0.1.55 node_modules/lodash/wrap.js
immosquare-cleaner-0.1.54 node_modules/lodash/wrap.js
immosquare-cleaner-0.1.53 node_modules/lodash/wrap.js
immosquare-cleaner-0.1.52 node_modules/lodash/wrap.js
trusty-cms-6.3.1 node_modules/lodash/wrap.js
immosquare-cleaner-0.1.51 node_modules/lodash/wrap.js
boring_generators-0.15.0 tmp/templates/app_template/node_modules/lodash/wrap.js
clapton-0.0.26 lib/clapton/javascripts/node_modules/lodash/wrap.js
clapton-0.0.25 lib/clapton/javascripts/node_modules/lodash/wrap.js
immosquare-cleaner-0.1.50 node_modules/lodash/wrap.js
clapton-0.0.24 lib/clapton/javascripts/node_modules/lodash/wrap.js
clapton-0.0.23 lib/clapton/javascripts/node_modules/lodash/wrap.js