How to use the nanomatch.isMatch function in nanomatch

To help you get started, we’ve selected a few nanomatch 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 steelbrain / pundle / packages / pundle-transformer-coffee / src / index.js View on Github external
      if (exclude.some(item => nanomatch.isMatch(file.filePath, item))) {
        // Excluded
github steelbrain / pundle / packages / pundle-transformer-babel / src / index.js View on Github external
      if (exclude.some(item => nanomatch.isMatch(file.filePath, item))) {
        // Excluded
github steelbrain / pundle / packages / pundle-transformer-typescript / src / index.js View on Github external
      if (exclude.some(item => nanomatch.isMatch(file.filePath, item))) {
        // Excluded
github steelbrain / pundle / packages / pundle-transformer-typescript / src / index.js View on Github external
      if (exclude.some(item => nanomatch.isMatch(file.filePath, item))) {
        // Excluded
github moleculerjs / moleculer / examples / api.service.js View on Github external
return route.whitelist.find(mask => {
				if (_.isString(mask))
					return nanomatch.isMatch(action, mask, { unixify: false,  });
				else if (_.isRegExp(mask))
					return mask.test(action);
			}) != null;
		},
github micromatch / picomatch / bench / code / isMatch / nanomatch.js View on Github external
module.exports = function(file, pattern) {
  return nanomatch.isMatch(file, pattern);
};
github adonisjs / adonis-cli / src / Services / RcFileWrapper.ts View on Github external
public isMetaFile (filePath: string, absolute: boolean = false): boolean {
    if (this._metaFilesCache.has(filePath)) {
      return this._metaFilesCache.get(filePath)!
    }

    const isMatch = nanomatch.isMatch(
      filePath,
      absolute ? this._metaFileAbsolutePatterns : this._metaFilePatterns,
    )

    this._metaFilesCache.set(filePath, isMatch)
    return isMatch
  }
github ArkEcosystem / core / packages / core-p2p / src / utils / is-whitelisted.ts View on Github external
export const isWhitelisted = (whitelist: string[], ip: string): boolean => {
    if (Array.isArray(whitelist)) {
        for (const item of whitelist) {
            if (nm.isMatch(ip, item)) {
                return true;
            }
        }
    }

    return false;
};
github adonisjs / adonis-cli / src / Services / RcFileWrapper.ts View on Github external
public isReloadServerFile (filePath: string, absolute: boolean = false): boolean {
    if (this._readServerFilesCache.has(filePath)) {
      return this._readServerFilesCache.get(filePath)!
    }

    const isMatch = nanomatch.isMatch(
      filePath,
      absolute ? this._reloadServerAbsolutePatterns : this._reloadServerPatterns,
    )

    this._readServerFilesCache.set(filePath, isMatch)
    return isMatch
  }
}
github ArkEcosystem / core / packages / core-utils / src / is-whitelisted.ts View on Github external
export const isWhitelisted = (whitelist: string[], remoteAddress: string): boolean => {
    if (!Array.isArray(whitelist) || !whitelist.length) {
        return true;
    }

    if (Array.isArray(whitelist)) {
        for (const ip of whitelist) {
            try {
                if (nm.isMatch(remoteAddress, ip)) {
                    return true;
                }
            } catch {
                return false;
            }
        }
    }

    return false;
};

nanomatch

Fast, minimal glob matcher for node.js. Similar to micromatch, minimatch and multimatch, but complete Bash 4.3 wildcard support only (no support for exglobs, posix brackets or braces)

MIT
Latest version published 6 years ago

Package Health Score

71 / 100
Full package analysis