当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript path.relative函数代码示例

本文整理汇总了TypeScript中path.relative函数的典型用法代码示例。如果您正苦于以下问题:TypeScript relative函数的具体用法?TypeScript relative怎么用?TypeScript relative使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了relative函数的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: constructor

 constructor() {
   super({
     fileName: path.relative(BUILD_PUBLIC_DIR, ASSETS_MANIFEST),
     cache,
   });
 }
开发者ID:ompanda,项目名称:gulp-typescript-webpack-react-hotreload,代码行数:6,代码来源:manifest-plugin.ts

示例2: relative

 src.push(...Config.NPM_DEPENDENCIES.map(x => relative(Config.PROJECT_ROOT, x.src)));
开发者ID:hellofornow,项目名称:angular2-seed-advanced,代码行数:1,代码来源:desktop.libs.ts

示例3: constructor

 constructor(path: string) {
   this.path = resolve(path);
   this.relativePath = relative(REPO_ROOT, this.path);
   this.ext = extname(this.path);
 }
开发者ID:austec-automation,项目名称:kibana,代码行数:5,代码来源:file.ts

示例4: promoteRelativePath

 depWXSSList = buildDepComponentsResult.map(item => {
   let wxss = item.wxss
   wxss = wxss.replace(sourceDir, outputDir)
   wxss = promoteRelativePath(path.relative(outputFilePath, wxss))
   return wxss
 })
开发者ID:YangShaoQun,项目名称:taro,代码行数:6,代码来源:helper.ts

示例5:

				.map(file => {
					return {
						file: path.relative(process.cwd(), file),
						size: chunk.modules[file].renderedLength
					};
				})
开发者ID:varholak-peter,项目名称:sapper,代码行数:6,代码来源:RollupResult.ts

示例6:

 const configPaths = projects.map(p => `"${relative(REPO_ROOT, p.tsConfigPath)}"`);
开发者ID:elastic,项目名称:kibana,代码行数:1,代码来源:get_ts_project_for_absolute_path.ts

示例7: shouldInstrument

export default function shouldInstrument(
  filename: Config.Path,
  options: ShouldInstrumentOptions,
  config: Config.ProjectConfig,
): boolean {
  if (!options.collectCoverage) {
    return false;
  }

  if (
    config.forceCoverageMatch.length &&
    micromatch.any(filename, config.forceCoverageMatch)
  ) {
    return true;
  }

  if (
    !config.testPathIgnorePatterns.some(pattern => !!filename.match(pattern))
  ) {
    if (config.testRegex.some(regex => new RegExp(regex).test(filename))) {
      return false;
    }

    if (micromatch.some(replacePathSepForGlob(filename), config.testMatch)) {
      return false;
    }
  }

  if (
    // This configuration field contains an object in the form of:
    // {'path/to/file.js': true}
    options.collectCoverageOnlyFrom &&
    !options.collectCoverageOnlyFrom[filename]
  ) {
    return false;
  }

  if (
    // still cover if `only` is specified
    !options.collectCoverageOnlyFrom &&
    options.collectCoverageFrom &&
    !micromatch.some(
      replacePathSepForGlob(path.relative(config.rootDir, filename)),
      options.collectCoverageFrom,
    )
  ) {
    return false;
  }

  if (
    config.coveragePathIgnorePatterns.some(pattern => !!filename.match(pattern))
  ) {
    return false;
  }

  if (config.globalSetup === filename) {
    return false;
  }

  if (config.globalTeardown === filename) {
    return false;
  }

  if (config.setupFiles.some(setupFile => setupFile === filename)) {
    return false;
  }

  if (config.setupFilesAfterEnv.some(setupFile => setupFile === filename)) {
    return false;
  }

  if (MOCKS_PATTERN.test(filename)) {
    return false;
  }

  if (options.changedFiles && !options.changedFiles.has(filename)) {
    return false;
  }

  return true;
}
开发者ID:Volune,项目名称:jest,代码行数:81,代码来源:shouldInstrument.ts

示例8:

 .filter(p => {
   var relativePath = path.relative(this.inputPaths[0], p);
   // TODO(alxhub): better detection of worker script.
   return relativePath !== MANIFEST_NAME && relativePath !== 'vendor/@angular/service-worker/dist/worker.js';
 })
开发者ID:SuperSoe,项目名称:mobile-toolkit,代码行数:5,代码来源:cli-sw.ts

示例9: resolveVersionedPath

function resolveVersionedPath(binPath: string, relativePath: string): string {
  const appFolder = Path.resolve(process.execPath, '..')
  return Path.relative(binPath, Path.join(appFolder, relativePath))
}
开发者ID:ghmoore,项目名称:desktop,代码行数:4,代码来源:squirrel-updater.ts

示例10: function

 return function (relativePath: string): string {
     return relative(path, relativePath);
 };
开发者ID:wavesplatform,项目名称:WavesGUI,代码行数:3,代码来源:utils.ts


注:本文中的path.relative函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。