How to use the array-includes function in array-includes

To help you get started, we’ve selected a few array-includes 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 boltpkg / bolt / src / utils / symlinkPackageDependencies.js View on Github external
******************************************************************/

  // TODO: Same as above, we should really be making sure we get all the transitive bins as well

  for (let dependency of internalDeps) {
    let depWorkspace = dependencyGraph.get(dependency) || {};
    let depBinFiles =
      depWorkspace.pkg &&
      depWorkspace.pkg.config &&
      depWorkspace.pkg.config.getBin();

    if (!depBinFiles) {
      continue;
    }

    if (!includes(dependencies, dependency)) {
      // dependency is not one we are supposed to symlink right now
      continue;
    }

    if (typeof depBinFiles === 'string') {
      // package may be scoped, name will only be the second part
      let binName = dependency.split('/').pop();
      let src = path.join(depWorkspace.pkg.dir, depBinFiles);
      let dest = path.join(pkg.nodeModulesBin, binName);

      symlinksToCreate.push({ src, dest, type: 'exec' });
      continue;
    }

    for (let [binName, binPath] of Object.entries(depBinFiles)) {
      let src = path.join(depWorkspace.pkg.dir, String(binPath));
github JPeer264 / node-rcs-core / lib / baseLibrary.js View on Github external
isExcluded(string) {
    if (string === '__proto__') {
      // Since this.values['__proto__'] always exists, we mustn't accept this as a renaming
      return true;
    }
    if (includes(this.excludes, string)) {
      return true;
    }

    return (
      this.excludesRegex.some((excludeRegex) => (
        string.match(excludeRegex)
      ))
    );
  }
}
github carloscuesta / generator-starterkit / generators / app / index.es6.js View on Github external
function hasAdditionalPackages(pkg) {
			return answers.additionalPackages && includes(answers.additionalPackages, pkg);
		}
		this.appname = answers.name;
github JPeer264 / node-rcs-core / lib / baseLibrary.js View on Github external
isReserved(string) {
    return includes(this.reserved, string);
  }

array-includes

An ES7/ES2016 spec-compliant `Array.prototype.includes` shim/polyfill/replacement that works as far down as ES3.

MIT
Latest version published 1 month ago

Package Health Score

74 / 100
Full package analysis

Popular array-includes functions