本文整理汇总了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;未经允许,请勿转载。 |
请发表评论