當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript minimatch類代碼示例

本文整理匯總了TypeScript中minimatch的典型用法代碼示例。如果您正苦於以下問題:TypeScript minimatch類的具體用法?TypeScript minimatch怎麽用?TypeScript minimatch使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了minimatch類的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: return

 return (globs || []).some(glob => {
   try {
     const globStat = lstatSync(join(configDir, glob))
     const newGlob = glob.length === 0 ? '.' : glob
     const globToMatch = globStat.isDirectory() ? `${glob}/**` : glob
     return minimatch(filePath, globToMatch, { matchBase: true })
   } catch (error) {
     // Out of errors that lstat provides, EACCES and ENOENT are the
     // most likely. For both cases, run the match with the raw glob
     // and return the result.
     return minimatch(filePath, glob, { matchBase: true })
   }
 })
開發者ID:graphcool,項目名稱:graphql-config,代碼行數:13,代碼來源:utils.ts

示例2: minimatch

export const getModuleSourceDirectory = (state: ApplicationState) => {
  if (state.fileCache.length) {
    const pcFileCacheItem = state.fileCache.find((item) => (
      minimatch(state.options.projectConfig.sourceFilePattern, item.filePath)
    ));

    if (pcFileCacheItem) {
      return path.dirname(pcFileCacheItem.filePath);
    }
  }
  const sourceFiles = getModuleFilePaths(state);
  if (!sourceFiles.length) {

    if (minimatch(state.options.projectConfig.sourceFilePattern, DEFAULT_COMPONENT_SOURCE_DIRECTORY)) {
      return path.join(state.options.cwd,DEFAULT_COMPONENT_SOURCE_DIRECTORY);
    } else {

      // scan for ALL files and directories if source directory does not match
      const allFiles = glob.sync(state.options.projectConfig.sourceFilePattern.replace(/\.*\w+$/, ""));

      for (const file of allFiles) {
        if (fs.lstatSync(file).isDirectory()) {
          return file;
        }
      }
    }
  }

  return path.dirname(sourceFiles[0]);
}
開發者ID:cryptobuks,項目名稱:tandem,代碼行數:30,代碼來源:index.ts

示例3:

	const shouldUnpackFile = (file: VinylFile): boolean => {
		for (let i = 0; i < unpackGlobs.length; i++) {
			if (minimatch(file.relative, unpackGlobs[i])) {
				return true;
			}
		}
		return false;
	};
開發者ID:AllureFer,項目名稱:vscode,代碼行數:8,代碼來源:asar.ts

示例4:

    keys.forEach((key) => {
      if (!minimatch(key, dependency)) {
        return;
      }
      if (fullDependencies.indexOf(key) === -1) {
        fullDependencies.push(key);
      }

      fullDependencies = fullDependencies.concat(traverse(treeStorage[key]));
    });
開發者ID:mrmlnc,項目名稱:yellfy-pug-inheritance,代碼行數:10,代碼來源:inheritance.ts

示例5: while

 patterns.forEach(function (pattern) {
   if (pattern[0] === "!") {
     i = list.length - 1;
     while (i > -1) {
       if (!minimatch(list[i], pattern)) {
         list.splice(i, 1);
       }
       i--;
     }
   }
   else {
     var newList = glob.sync(pattern, options);
     newList.forEach(function (item) {
       if (list.indexOf(item) === -1) {
         list.push(item);
       }
     });
   }
 });
開發者ID:aelbore,項目名稱:loopback-model-binder,代碼行數:19,代碼來源:utils.ts

示例6:

				sourceFiles = sourceFiles.filter(source => !minimatch(source, `**/${constants.TNS_MODULES_FOLDER_NAME}/**`, { nocase: true }));
開發者ID:Emat12,項目名稱:nativescript-cli,代碼行數:1,代碼來源:platform-service.ts

示例7:

 if (paths.find(path => minimatch(path, watcher.source))) {
開發者ID:Resounding,項目名稱:Jobs-Web,代碼行數:1,代碼來源:watch.ts

示例8: minimatch

 fileGlobs.some(p => minimatch(relativeFilePath, p));
開發者ID:OkBayat,項目名稱:material2,代碼行數:1,代碼來源:validateDecoratorsRule.ts

示例9: minimatch

		constants.LIVESYNC_EXCLUDED_FILE_PATTERNS.forEach(pattern => scriptRelatedFiles = _.concat(scriptRelatedFiles, localToDevicePaths.filter(file => minimatch(file.getDevicePath(), pattern, { nocase: true }))));
開發者ID:NathanaelA,項目名稱:nativescript-cli,代碼行數:1,代碼來源:ios-device-livesync-service.ts


注:本文中的minimatch類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。