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

How to use
uniq
function
in
LoDashStatic

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

origin: moleculerjs/moleculer

/**
   * Get all groups for event
   *
   * @param {String} eventName
   * @returns Array<String>
   * @memberof EventCatalog
   */
  getGroups(eventName) {
    return _.uniq(this.events.filter(list => utils.match(eventName, list.name)).map(item => item.group));
  }
origin: moleculerjs/moleculer

_.debounce(function() {
      console.log("\x1b[2J");
      console.log("\x1b[0;0H");
      console.log(kleur.yellow().bold("\nRegistry:  "), kleur.grey("Time:"), kleur.grey(humanize(process.uptime() * 1000)));
      console.log(kleur.yellow().bold(  "========"));

      const nodeIDs = _.uniq([].concat(
        Object.keys(this.workerRegistry),
        this.broker.registry.nodes.toArray().map(node => node.id)
      ))
        .filter(nodeID => nodeID != this.broker.nodeID)
        .sort((a, b) => Number(a.replace(/[^\d]/g, "")) - Number(b.replace(/[^\d]/g, "")));

      nodeIDs.forEach(nodeID => this.printWorkerRegistry(nodeID, this.workerRegistry[nodeID], nodeIDs));
    }, 250)
origin: lando/lando

_.mergeWith(old, ...fresh, (s, f) => {
 if (_.isArray(s)) return _.uniq(s.concat(f));
})
origin: lando/lando

_.forEach(_.uniq(_.map(build, 'id')), container => {
   build.unshift({
    id: container,
    cmd: '/helpers/user-perms.sh --silent',
    compose: app.compose,
    project: app.project,
    opts: {
     mode: 'attach',
     prestart,
     user: 'root',
     services: [container.split('_')[1]],
    },
   });
  });
origin: moleculerjs/moleculer

/**
   * Merge `settings` property in schema
   *
   * @static
   * @param {Object} src Source schema property
   * @param {Object} target Target schema property
   *
   * @returns {Object} Merged schema
   */
  static mergeSchemaSettings(src, target) {
    if ((target && target.$secureSettings) || (src && src.$secureSettings)) {
      const srcSS = src && src.$secureSettings ? src.$secureSettings : [];
      const targetSS = target && target.$secureSettings ? target.$secureSettings : [];
      if (!target) target = {};

      target.$secureSettings = _.uniq([].concat(srcSS, targetSS));
    }

    return _.defaultsDeep(src, target);
  }
origin: lando/lando

// Add proxy URLS to our app info
  _.forEach(['post-start', 'post-init'], event => {
   app.events.on(event, () => {
    // Get last known ports
    const ports = lando.cache.get(lando.config.proxyCache);
    // Map to protocol and add portz
    // @TODO: do something more meaningful below like logging?, obviously starting to not GAS
    if (ports) {
     _(app.info)
      .filter(service => _.has(app, `config.proxy.${service.service}`))
      .flatMap(s => s.urls = _.uniq(s.urls.concat(utils.parse2Info(
       app.config.proxy[s.service],
       ports,
       _.get(s, 'hasCerts', false)
      ))))
      .value();
    }
   });
  });
origin: princejwesley/Mancy

function saveHistory(event, cmds = []) {
 if(noAccessToHistory ||
  historySize === 0 ||
  !_.isArray(cmds) ||
  cmds.length === 0
 ) { return; }
 // remove adjacent duplicates
 history = _.uniq(history.concat(cmds), true);
 // trim history
 updateHistorySize(null, historySize);
 // rewrite
 fs.writeFile(HISTORY_FILE, JSON.stringify(history), (err) => {
  if(err) {
   noAccessToHistory = true;
   console.error(`Failed to write history file ${err.message}`);
  }
 });
}
origin: lando/lando

const nets = _.uniq(networks).concat(['bridge', 'host', 'none', lando.config.networkBridge]);
if (_.has(lando, 'config.proxyNet')) nets.push(lando.config.proxyNet);
return nets;
origin: lando/lando

const eventCommands = utils.events2Runz(cmds, app, data);
if (!_.isEmpty(eventCommands)) {
 _.forEach(_.uniq(_.map(eventCommands, 'id')), container => {
  eventCommands.unshift({
   id: container,
origin: doramart/DoraCMS

removeArr = _.uniq(removeArr);
origin: moleculerjs/moleculer

  watchItem.services.push(service.fullName);
watchItem.others = _.uniq([].concat(watchItem.others, parents || []));
  const watchItem = getWatchItem(fName);
  watchItem.allServices = true;
  watchItem.others = _.uniq([].concat(watchItem.others, parents || []));
origin: moleculerjs/moleculer

  serviceNames = [serviceNames];
serviceNames = _.uniq(_.compact(serviceNames.map(x => {
  if (utils.isPlainObject(x) && x.name)
    return this.ServiceFactory.getVersionedFullName(x.name, x.version);
origin: shen100/mili

async create(createArticleDto: EditArticleDto, userID: number) {
    const tagIDs = _.uniq(createArticleDto.tags);
    const tags: Tag[] = tagIDs.map(tagID => {
      const tag = new Tag();
origin: doramart/DoraCMS

})
userItem.content_num = userContents.length;
userItem.watch_num = _.uniq(userItem.watchers).length;
userItem.follow_num = _.uniq(userItem.followers).length;
userItem.had_followed = false;
origin: shen100/mili

const categoryIDs = [];
const insertTags = [];
const tagIDs = _.uniq(editArticleDto.tags);
tagIDs.map(tagID => {
  insertTags.push(`(${articleID}, ${tagID})`);
lodash(npm)LoDashStaticuniq

JSDoc

Creates a duplicate-free version of an array, using
[`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
for equality comparisons, in which only the first occurrence of each element
is kept.

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

  • superagent
    elegant & feature rich browser / node HTTP with a fluent API
  • minimist
    parse argument options
  • cheerio
    Tiny, fast, and elegant implementation of core jQuery designed specifically for the server
  • handlebars
    Handlebars provides the power necessary to let you build semantic templates effectively with no frustration
  • semver
    The semantic version parser used by npm.
  • through2
    A tiny wrapper around Node.js streams.Transform (Streams2/3) to avoid explicit subclassing noise
  • node-fetch
    A light-weight module that brings window.fetch to node.js
  • fs-extra
    fs-extra contains methods that aren't included in the vanilla Node.js fs package. Such as mkdir -p, cp -r, and rm -rf.
  • axios
    Promise based HTTP client for the browser and node.js
  • Sublime Text for Python
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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