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

How to use
defaults
function
in
LoDashStatic

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

origin: nodejs/nodejs.org

Promise
 .all([
  queryCollaborators({ repositoryOwner, repositoryName }),
  queryCommits({ repositoryOwner, repositoryName, since })
 ])
 .then(results => {
  const collaborators = _.keyBy(results[0], 'login')

  return _.chain(results[1])
   .map('author.user')
   .reject(_.isEmpty)
   .groupBy('login')
   .map(group => _.defaults({ commits: _.size(group) }, _.head(group)))
   .filter(user => _.isEmpty(collaborators[user.login]))
   .value()
 })
 .then(res => formatOutput(res))
 .catch(err => console.log(err))
origin: nodejs/nodejs.org

 return queryCollaborators(_.defaults({ collaboratorsAfter }, variables))
  .then(others => _.concat(collaborators, others))
})
origin: nodejs/nodejs.org

 return queryCommits(_.defaults({ historyAfter }, variables))
  .then(others => _.concat(commits, others))
})
origin: an-sh/chat-service

constructor (props) {
  _.defaults(this, props)
  this.busAckTimeout = this.server.busAckTimeout
  this.clusterBus = this.server.clusterBus
  this.onJoin = this.server.hooks.onJoin
  this.onLeave = this.server.hooks.onLeave
  this.lockTTL = this.state.lockTTL
  mixin(this, UserReports, this.transport, this.echoChannel)
 }
origin: matthew1000/node-snowmix

constructor(snowmix, id, args, defaults) {
    this.snowmix = snowmix
    if (id) this.id = parseInt(id)
    if (args) Object.assign(this, args)
    if (defaults) _.defaults(this, defaults)
  }
origin: leboff/sfdx-node

function _createCommand(fn){
  return function(flags, opts){
    var ctx = _.defaults(opts || {}, _optsDefaults);
    ctx.flags = _.defaults(flags || {}, _flagDefaults);
    return fn(ctx);
  }
}
origin: chiefy/vaulted

Promise.method(function startRekey(options) {

 options = _.defaults(options || {}, {
  secret_shares: this.config.get('secret_shares'),
  secret_threshold: this.config.get('secret_threshold')
 });

 return this.getRekeyInitEndpoint()
  .put({
   headers: this.headers,
   body: options,
   _token: options.token
  });
})
origin: nswbmw/mongolass

constructor (name, schema) {
  if (!name || !_.isString(name)) {
   throw new TypeError('Schema must have a name')
  }
  super(name, _.defaults(schema, { _id: { type: Types.ObjectId } }))
 }
origin: chiefy/vaulted

function createRequest(ep, options) {
 options = _.assign(options, ep.defaults);

 var request_opts = _.defaults(options, {
  uri: ep.server_url + '/' + formatPath(ep.name, options),
  json: true
 });
 return rp(request_opts);
}
origin: jiripospisil/ashley

constructor(bindName, container, target, dependencies, options) {
  this.bindName = bindName;
  this.container = container;
  this.target = target;
  this.dependencies = dependencies;

  this.options = _.defaults(options, {
   initialize: false
  });
 }
origin: matthew1000/node-snowmix

constructor(snowmix, id, args) {
    super(snowmix)
    const defaults = {
      id: parseInt(id),
      name: 'AudioFeed #' + id,
      channels: 2,
      rate: 44100,
      signess: 'signed'
    }
    _.defaults(this, args, defaults)
  }
origin: nodejs/nodejs.org

Promise
 .all([
  queryCollaborators({ repositoryOwner, repositoryName }),
  queryCommits({ repositoryOwner, repositoryName, since })
 ])
 .then(results => {
  const collaborators = _.keyBy(results[0], 'login')

  return _.chain(results[1])
   .map('author.user')
   .reject(_.isEmpty)
   .groupBy('login')
   .map(group => _.defaults({ commits: _.size(group) }, _.head(group)))
   .filter(user => _.isEmpty(collaborators[user.login]))
   .value()
 })
 .then(res => formatOutput(res))
 .catch(err => console.log(err))
origin: nodejs/nodejs.org

 return queryCollaborators(_.defaults({ collaboratorsAfter }, variables))
  .then(others => _.concat(collaborators, others))
})
origin: nodejs/nodejs.org

 return queryCommits(_.defaults({ historyAfter }, variables))
  .then(others => _.concat(commits, others))
})
origin: matthew1000/node-snowmix

constructor(snowmix, id, args) {
    super(snowmix)
    const defaults = {
      id: parseInt(id),
      name: 'AudioSink #' + id,
      channels: 2,
      rate: 44100,
      signess: 'signed'
    }
    _.defaults(this, args, defaults)
  }
lodash(npm)LoDashStaticdefaults

JSDoc

Assigns own enumerable properties of source object(s) to the destination object for all destination
properties that resolve to undefined. Once a property is set, additional values of the same property are
ignored.
Note: This method mutates object.

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

  • handlebars
    Handlebars provides the power necessary to let you build semantic templates effectively with no frustration
  • redis
    Redis client library
  • through2
    A tiny wrapper around Node.js streams.Transform (Streams2/3) to avoid explicit subclassing noise
  • express
    Fast, unopinionated, minimalist web framework
  • axios
    Promise based HTTP client for the browser and node.js
  • postcss
  • js-yaml
    YAML 1.2 parser and serializer
  • mkdirp
    Recursively mkdir, like `mkdir -p`
  • lodash
    Lodash modular utilities.
  • Top Vim plugins
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