How to use the lodash-es.includes function in lodash-es

To help you get started, we’ve selected a few lodash-es examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ParasolJS / parasol-es / src / util / add_column.js View on Github external
const add_column = (columns, col_name) => {
  // ignore repeats
  const names = columns.map(col => col.name);
  if (includes(names, col_name)) {
    return columns;
  } else {
    const col_def = {
      id: col_name,
      name: col_name,
      field: col_name,
      sortable: true,
    };
    columns.push(col_def);
    return columns;
  }
};
export default add_column;
github ParasolJS / parasol-es / dist / parasol.esm.js View on Github external
var add_column = function add_column(columns, col_name) {
  // ignore repeats
  var names = columns.map(function (col) {
    return col.name;
  });
  if (includes(names, col_name)) {
    return columns;
  } else {
    var col_def = {
      id: col_name,
      name: col_name,
      field: col_name,
      sortable: true
    };
    columns.push(col_def);
    return columns;
  }
};
github Yoast / YoastSEO.js / src / researches / matchKeywordInSubheadings.js View on Github external
const numberOfSubheadingsReflectingTopic = function( topicForms, subheadings, useSynonyms, locale ) {
	const isFunctionWordLanguage = includes( functionWordLanguages, getLanguage( locale ) );

	return subheadings.filter( subheading => {
		const matchedTopicForms = findTopicFormsInString( topicForms, subheading, useSynonyms, locale );

		if ( ! isFunctionWordLanguage ) {
			return matchedTopicForms.percentWordMatches === 100;
		}
		return matchedTopicForms.percentWordMatches > 50;
	} ).length;
};
github Sunbird-Ed / SunbirdEd-portal / src / app / client / projects / desktop / src / app / modules / offline / components / desktop-explore-content / desktop-explore-content.component.ts View on Github external
_.each(this.contentList, (value) => {
      value['hoverData'] = {
        'note': this.isBrowse && _.get(value, 'downloadStatus') ===
          'DOWNLOADED' ? this.resourceService.frmelmnts.lbl.goToMyDownloads : '',
        'actions': [
          {
            'type': this.isBrowse ? 'download' : 'save',
            'label': this.isBrowse ? _.capitalize(_.get(value, 'downloadStatus')) ||
              this.resourceService.frmelmnts.btn.download :
              this.resourceService.frmelmnts.lbl.saveToPenDrive,
            'disabled': this.isBrowse && _.includes(['DOWNLOADED', 'DOWNLOADING', 'PAUSED'], _.get(value, 'downloadStatus')) ? true : false
          },
          {
            'type': 'open',
            'label': this.resourceService.frmelmnts.lbl.open
          }
        ]
      };
    });
  }
github Yoast / YoastSEO.js / src / researches / english / passiveVoice / EnglishParticiple.js View on Github external
EnglishParticiple.prototype.isNonVerbEndingEd = function() {
	if ( this.getType() === "irregular" ) {
		return false;
	}
	return includes( nonVerbsEndingEd, this.getParticiple() );
};
github virtool / virtool / client / src / js / samples / components / Create / ReadSelector.js View on Github external
            file => !this.state.filter || includes(toLower(file.name), loweredFilter)
        );
github openshift / console / frontend / public / components / overview / pods-overview.tsx View on Github external
const isPodError = (pod: PodKind) => _.includes(errorPhases, podPhase(pod));
github Yoast / YoastSEO.js / src / stringProcessing / matchWordInSentence.js View on Github external
var characterInBoundary = function( character ) {
	return includes( wordBoundaries, character );
};