All files / istanbul-lib-source-maps/src pathutils.ts

50% Statements 1/2
33.33% Branches 2/6
50% Functions 1/2
50% Lines 1/2

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16                          43x    
/*
 Copyright 2015, Yahoo Inc.
 Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
 */
import path from "node:path";
 
export const isAbsolute = path.isAbsolute;
 
export function asAbsolute(file: string, baseDir?: string | null): string {
  return path.isAbsolute(file) ? file : path.resolve(baseDir || process.cwd(), file);
}
 
export function relativeTo(file: string, origFile: string): string {
  return path.isAbsolute(file) ? file : path.resolve(path.dirname(origFile), file);
}