fileoverview see https author kazuya kawaguchi (a.k.a. kazupon)
  import { normalize , isAbsolute , resolve , relative } from 'path' ; /**
 * Replace Windows with posix style paths
 */ export function convertPathToPosix ( filepath ) { const normalizedFilepath = normalize ( filepath ) ; const posixFilepath = normalizedFilepath . replace ( /\\/g , '/' ) ; return posixFilepath ; } /**
 * Converts an absolute filepath to a relative path from a given base path
 */ export function getRelativePath ( filepath , baseDir ) { const absolutePath = isAbsolute ( filepath ) ? filepath : resolve ( filepath ) ; if ( baseDir ) { if ( ! isAbsolute ( baseDir ) ) { throw new Error ( `baseDir should be an absolute path: ${ baseDir }` ) ; } return relative ( baseDir , absolutePath ) ; } return absolutePath . replace ( /^\// , '' ) ; }