• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

TypeScript path.relative函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
TypeScript path.resolve函数代码示例发布时间:2022-05-25
下一篇:
TypeScript path.parse函数代码示例发布时间:2022-05-25
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap