How to use the micromatch.not function in micromatch

To help you get started, we’ve selected a few micromatch 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 saojs / sao / lib / runActions.js View on Github external
stream.use(({ files }) => {
          let fileList = Object.keys(stream.files)

          // Exclude binary path
          fileList = fileList.filter(fp => !isBinaryPath(fp))

          if (action.transformInclude) {
            fileList = matcher(fileList, action.transformInclude)
          }
          if (action.transformExclude) {
            fileList = matcher.not(fileList, action.transformExclude)
          }

          fileList.forEach(relativePath => {
            const contents = files[relativePath].contents.toString()
            const transformer = require('jstransformer')(
              require(`jstransformer-${config.transformer || 'ejs'}`)
            )
            const templateData = action.templateData || config.templateData
            stream.writeContents(
              relativePath,
              transformer.render(
                contents,
                config.transformerOptions,
                Object.assign(
                  {},
                  context.answers,
github TencentCloudBase / cloudbase-manager-node / src / storage / index.ts View on Github external
filter: (dir: string, files: string[]) => {
                    // NOTE: ignore 为空数组时会忽略全部文件
                    if (!ignore || !ignore.length) return files
                    return micromatch.not(files, ignore)
                }
            })
github njpanderson / push / src / Paths / index.js View on Github external
return new Promise((resolve, reject) => {
			let matches;

			if (!Array.isArray(ignoreGlobs) || !ignoreGlobs.length) {
				resolve(uris);
			}

			try {
				// Get uris not matching from micromatch
				matches = micromatch.not(
					Array.from(uris, uri => uri.fsPath), ignoreGlobs
				);

				// Convert back to Uris and resolve
				resolve({
					uris: Array.from(matches, match => vscode.Uri.file(match)),
					ignored: (uris.length - matches.length)
				});
			} catch(e) {
				reject(e);
			}
		});
	}
github GetTerminus / terminus-ui / lint-staged.config.js View on Github external
function removeDirectories(files) {
  const match = micromatch.not(files, [
    '**/testing/**',
    '**/demo/**',
  ]);
  return match.join(' ');
}
github zendeskgarden / react-components / lint-staged.config.js View on Github external
'*.md': files =>
    micromatch
      .not(files, '*CHANGELOG.md')
      .map(file => `markdownlint ${file}; prettier --write ${file}; git add ${file};`),
  '**/package.json': ['prettier-package-json --write', 'git add']
github remaxjs / remax / lint-staged.config.js View on Github external
'*.{md,js,jsx}': files => {
    const match = micromatch.not(files, [
      '**/__tests__/**/expected/**/*.js',
      '**/tests/fixtures/**/output.js',
    ]);
    return match.length > 1
      ? [`prettier ${match.join(' ')} --write`, `git add ${match.join(' ')}`]
      : [];
  },
};
github saojs / sao / lib / invokeActions.js View on Github external
stream.use(({ files }) => {
          let fileList = Object.keys(stream.files)

          if (action.transformInclude) {
            fileList = matcher(fileList, action.transformInclude)
          }
          if (action.transformExclude) {
            fileList = matcher.not(fileList, action.transformExclude)
          }

          fileList.forEach(relativePath => {
            const contents = files[relativePath].contents.toString()
            const transformer = require('jstransformer')(
              require(`jstransformer-${action.transformer ||
                config.transformer ||
                'ejs'}`)
            )
            stream.writeContents(
              relativePath,
              transformer.render(
                contents,
                action.transformerOptions,
                Object.assign({}, context.answers, {
                  sao: context

micromatch

Glob matching for javascript/node.js. A replacement and faster alternative to minimatch and multimatch.

MIT
Latest version published 2 years ago

Package Health Score

87 / 100
Full package analysis