Codota Logo For Javascript
LoDashStatic.last
Code IndexAdd Codota to your IDE (free)

How to use
last
function
in
LoDashStatic

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

origin: lando/lando

// Helper to sort tokens
const sortTokens = (...sources) => _(_.flatten([...sources]))
 .sortBy('date')
 .groupBy('user')
 .map(tokens => _.last(tokens))
 .value()
origin: lando/lando

/*
 * Helper to cleanse path
 */
const cleanLine = (line = '') => {
 const m = /.*\((.*)\).?/.exec(line) || [];
 return m[1] ? line.replace(m[1], _.last(m[1].split(path.sep))) : line;
}
origin: lando/lando

_.map(overrides.volumes, volume => {
   if (!_.includes(volume, ':')) {
    return volume;
   } else {
    const local = exports.getHostPath(volume);
    const remote = _.last(volume.split(':'));
    // @TODO: I don't think below does anything?
    const excludes = _.keys(volumes).concat(_.keys(volumes));
    const host = exports.normalizePath(local, base, excludes);
    return [host, remote].join(':');
   }
  })
origin: FormidableLabs/nodejs-dashboard

// receiving metrics now would cause an emit
   sandbox.stub(metricsProvider, "emit").callsFake((key, data, discardEvent) => {
    if (discardEvent) {
     return;
    }

    expect(key)
     .to.be.a("string")
     .that.equals("metrics");

    expect(data)
     .to.be.an("object")
     .that.deep.equals(
      _.last(metricsProvider._aggregation[metricsProvider.zoomLevelKey].data)
     );
   });
origin: FormidableLabs/nodejs-dashboard

_.map(this.series, (series, id) => {
  let seriesLabel = "";
  if (this.seriesOptions[id].label) {
   seriesLabel = `${this.seriesOptions[id].label} `;
  } else if (!this.seriesOptions[id].hasOwnProperty("label")) {
   seriesLabel = `${id} `;
  }
  return util.format("%s(%d%s)", seriesLabel, _.last(this.series[id].y), this.unit);
 }).join(", ")
origin: tumobi/nideshop

/**
  * 保存用户头像
  * @returns {Promise.<void>}
  */
 async saveAvatarAction() {
  const avatar = this.file('avatar');
  if (think.isEmpty(avatar)) {
   return this.fail('保存失败');
  }

  const avatarPath = think.RESOURCE_PATH + `/static/user/avatar/${this.getLoginUserId()}.` + _.last(_.split(avatar.path, '.'));

  fs.rename(avatar.path, avatarPath, function(res) {
   return this.success();
  });
 }
origin: lando/lando

scanner(urls, {max: 1, waitCodes: []})
 .filter(url => url.status === false)
 .map(port => _.last(port.url.split(':')))
 .then(ports => ports[0])
origin: lando/lando

/*
 * Helper to return a type and version from platform data
 */
const getPlatformServiceType = ({name = 'app', type} = {}) => ({
 name,
 type: _.first(type.split(':')),
 version: _.last(type.split(':')),
})
origin: lando/lando

 _.set(landoFile, `config.${key}`, _.last(option.split('=')));
});
origin: lando/lando

/*
 * Helper to get config defaults
 */
const getConfigDefaults = options => {
 // Get the viaconf
 if (_.startsWith(options.via, 'nginx')) options.defaultFiles.vhosts = 'default.conf.tpl';

 // Get the default db conf
 const dbConfig = _.get(options, 'database', 'mysql');
 const database = _.first(dbConfig.split(':'));
 const version = _.last(dbConfig.split(':'));
 if (database === 'mysql' || database === 'mariadb') {
  if (version === '8.0') {
   options.defaultFiles.database = 'mysql8.cnf';
  } else {
   options.defaultFiles.database = 'mysql.cnf';
  }
 }

 // Verify files exist and remove if it doesn't
 _.forEach(options.defaultFiles, (file, type) => {
  if (!fs.existsSync(`${options.confDest}/${file}`)) {
   delete options.defaultFiles[type];
  }
 });

 // Return
 return options.defaultFiles;
}
origin: FormidableLabs/nodejs-dashboard

this.highestAggregationKey = _.last(this.aggregationLevels);
origin: lando/lando

if (code !== 0 && _.isEmpty(stderr)) stderr = _.trim(_.last(_.compact(stdout.split(os.EOL))));
origin: lando/lando

get: url => {
 counter[url] = counter[url] + 1 || 0;
 const last = _.last(url.split('.'));
 let code = 200;
 if (_.includes(last, ':')) {
  else code = last.split(':')[0];
 } else {
  code = isFinite(_.last(url.split('.'))) ? _.last(url.split('.')) : 200;
origin: lando/lando

_(_.flatten([...sources]))
 .sortBy('date')
 .groupBy('email')
 .map(tokens => _.last(tokens))
 .value()
origin: lando/lando

_(_.flatten([...sources]))
 .sortBy('date')
 .groupBy('email')
 .map(tokens => _.last(tokens))
 .value()
lodash(npm)LoDashStaticlast

JSDoc

Gets the last element of array.

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

  • bluebird
    Full featured Promises/A+ implementation with exceptionally good performance
  • readable-stream
    Streams3, a user-land copy of the stream library from Node.js
  • semver
    The semantic version parser used by npm.
  • colors
    get colors in your node.js console
  • js-yaml
    YAML 1.2 parser and serializer
  • path
  • mongodb
    The official MongoDB driver for Node.js
  • qs
    A querystring parser that supports nesting and arrays, with a depth limit
  • fs
  • Top plugins for WebStorm
    The challenge is finding the best plugins for JavaScript development on Intellij IDEs. Who wants to sit there and go over hundreds of plugins to pick the best?
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJavascript Code Index
Get Codota for your IDE now