Tabnine Logo For Javascript
LoDashStatic.partial
Code IndexAdd Tabnine to your IDE (free)

How to use
partial
function
in
LoDashStatic

Best JavaScript code snippets using lodash.LoDashStatic.partial(Showing top 15 results out of 315)

origin: chiefy/vaulted

router
  .route('/remount')
  .post(function remount(req, res) {
   app.vault.reMount(req.body)
    .then(function remountSuccess(mounts) {
     console.info('Remount successful!');
     res.json(mounts);
    })
    .catch(_.partial(onError, res, 'There was an error remounting'));
  });
origin: mrijk/speculaas

function createObjectSpec(predicate, gen) {
  if (isSpec(predicate)) {
    return predicate;
  } else {
    return {
      conform: (value, unwrap = false) => conform(value, unwrap, _.partial(_.has, predicate)),
      unform: _.identity,
      gen
    };
  }
}
origin: mrijk/speculaas

function star(spec) {
  return {
    op: 'star',
    conform: _.partial(_conform, spec),
    unform: _.identity,
    gen: () => tcg.null.then(() => tcg.array(gen(spec), {size: _.random(0, 5)})),
    describe: () => [star.name, ...describe([spec])],
    explain: function*(values, {via}) {
      yield* explainInvalid(values, spec, via);
    }
  };
}
origin: christophetd/docker-python-sandbox

/* 
  * Private method
  * Starts the specified container
  */
 _startContainer(container, cb) {
  container.instance.start( (err, data) => {
   if (err) {
    return container.cleanup(_.partial(cb, err))
   }
   cb(null, container)
  })
 }
origin: mrijk/speculaas

function createArraySpec(predicate) {
  return {
    conform: (value, unwrap = false) => conform(value, unwrap, _.partial(_.includes, predicate)),
    describe: () => predicate,
    explain: function*(value, options) {
      if (!_.includes(predicate, value)) {
        yield getExplanation(value, options);
      }
    },
    gen: () => tcg.null.then(() => tcg.return(_.sample(predicate)))
  };
}
origin: chiefy/vaulted

function load(config, metadata) {
 var
  defaults = {},
  base_url = getVaultURL(config) + '/' + API_PREFIX,
  partial;

 if (config.has('timeout')) {
  defaults.timeout = config.get('timeout');
 }

 defaults = _.assign(defaults, getSSLOptions(config));
 defaults = _.assign(defaults, getProxy(config));

 partial = _.partial(Endpoint.create, base_url, defaults);
 return _.transform(metadata, partial, {});
}
origin: piyush94/NodeApp

/**
 * Creates a [fs.writeFile](https://nodejs.org/api/fs.html#fs_fs_writefile_file_data_options_callback)
 * function with `filePath` and `data` partially applied.
 *
 * @memberOf file
 * @param {string} destPath The path to write the file to.
 * @param {string} data The data to write to the file.
 * @returns {Function} Returns the partially applied function.
 */
function write(destPath, data) {
 return _.partial(fs.writeFile, destPath, data);
}
origin: christophetd/docker-python-sandbox

/*
 * Private method
 * Retrieves info of a container
 */
 _getContainerInfo(container, cb) {
  container.instance.inspect( (err, data) => {
   if (err || !data || !data.NetworkSettings || !data.NetworkSettings.IPAddress 
     || data.NetworkSettings.IPAddress.length == 0) {
      
    err = err || new Error("unable to retrieve container IP")
    return container.cleanup(_.partial(cb, err))
   }
   container.setIp(data.NetworkSettings.IPAddress)
   cb(null, container)
  })
 }
origin: roccomuso/price-monitoring

addProduct (product) {
  if (!_.every(['name', 'link', 'price', 'variation'], _.partial(_.has, product))) {
   this.emit('error', 'Fields missing in ' + JSON.stringify(product))
   return this
  }

  if (!this.doUrlMatch(product.link)) {
   this.emit('error', url.parse(product.link).hostname + ' mismatch ' + this.url)
   return this
  }

  this.products.push(product)
  debug('Product', product.name, 'added')
  this.emit('submit', product)
  return this /* for method chaining */
 }
origin: piyush94/NodeApp

/*----------------------------------------------------------------------------*/

/**
 * Creates browser builds of the FP converter and mappings at the `target` path.
 *
 * @private
 * @param {string} target The output directory path.
 */
function build() {
 async.series([
  _.partial(webpack, mappingConfig),
  _.partial(webpack, fpConfig),
  file.min(path.join(distPath, filename))
 ], util.pitch);
}
origin: mrijk/speculaas

function mapOf(kpred, vpred, options = {}) {
  return {
    conform: _.partial(_conform, kpred, vpred, options),
    unform: _.identity,
    gen: () => tcg.object(gen(kpred), gen(vpred)),
    describe: () => [mapOf.name, ...describe([kpred, vpred])],
    explain: function*(value, {via}) {
      yield* explainInvalid(value, kpred, vpred, via);
    }
  };
}
origin: mrijk/speculaas

function cat(...predicates) {
  const pairs = _.chunk(predicates, 2);

  return {
    op: 'cat',
    conform: _.partial(_conform, pairs),
    unform: values => _.map(pairs, ([k, p]) => unform(p, values[k])),
    gen: () => tcg.array(_.map(pairs, ([, p]) => gen(p))),
    describe: () => [cat.name, ...describe(predicates)],
    explain: function*(values, {via}) {
      yield* explainInsufficientInput(values, pairs, via);
      yield* explainExtraInput(pairs, values, via);
      yield* explainInvalid(values, pairs, via);
    }
  };
}
origin: piyush94/NodeApp

/*----------------------------------------------------------------------------*/

/**
 * Creates a [fs.copy](https://github.com/jprichardson/node-fs-extra#copy)
 * function with `srcPath` and `destPath` partially applied.
 *
 * @memberOf file
 * @param {string} srcPath The path of the file to copy.
 * @param {string} destPath The path to copy the file to.
 * @returns {Function} Returns the partially applied function.
 */
function copy(srcPath, destPath) {
 return _.partial(fs.copy, srcPath, destPath);
}
origin: piyush94/NodeApp

/**
 * Creates a `minify` function with `srcPath` and `destPath` partially applied.
 *
 * @memberOf file
 * @param {string} srcPath The path of the file to minify.
 * @param {string} destPath The path to write the file to.
 * @returns {Function} Returns the partially applied function.
 */
function min(srcPath, destPath) {
 return _.partial(minify, srcPath, destPath);
}
origin: chiefy/vaulted

router
  .route('/remount')
  .post(function remount(req, res) {
   app.vault.reMount(req.body)
    .then(function remountSuccess(mounts) {
     console.info('Remount successful!');
     res.json(mounts);
    })
    .catch(_.partial(onError, res, 'There was an error remounting'));
  });
lodash(npm)LoDashStaticpartial

JSDoc

Creates a function that, when called, invokes func with any additional partial arguments
prepended to those provided to the new function. This method is similar to _.bind except
it does not alter the this binding.

Most used lodash functions

  • LoDashStatic.map
    Creates an array of values by running each element in collection through iteratee. The iteratee is
  • LoDashStatic.isEmpty
    Checks if value is empty. A value is considered empty unless it’s an arguments object, array, string
  • LoDashStatic.forEach
    Iterates over elements of collection invoking iteratee for each element. The iteratee is invoked wit
  • LoDashStatic.find
    Iterates over elements of collection, returning the first element predicate returns truthy for.
  • LoDashStatic.pick
    Creates an object composed of the picked `object` properties.
  • LoDashStatic.get,
  • LoDashStatic.isArray,
  • LoDashStatic.filter,
  • LoDashStatic.merge,
  • LoDashStatic.isString,
  • LoDashStatic.isFunction,
  • LoDashStatic.assign,
  • LoDashStatic.extend,
  • LoDashStatic.includes,
  • LoDashStatic.keys,
  • LoDashStatic.cloneDeep,
  • LoDashStatic.uniq,
  • LoDashStatic.isObject,
  • LoDashStatic.omit

Popular in JavaScript

  • winston
    A logger for just about everything.
  • semver
    The semantic version parser used by npm.
  • cheerio
    Tiny, fast, and elegant implementation of core jQuery designed specifically for the server
  • minimatch
    a glob matcher in javascript
  • chalk
    Terminal string styling done right
  • bluebird
    Full featured Promises/A+ implementation with exceptionally good performance
  • webpack
    Packs CommonJs/AMD modules for the browser. Allows to split your codebase into multiple bundles, which can be loaded on demand. Support loaders to preprocess files, i.e. json, jsx, es7, css, less, ... and your custom stuff.
  • http
  • colors
    get colors in your node.js console
  • Best plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJavascript Code Index
Get Tabnine for your IDE now