當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。