import * as path from 'path' ; import fileUrl = require ( 'file-url' ) ; const pathIsInside = require ( 'path-is-inside' ) as ( source : string , dist : string ) => boolean ; export function encodePathAsUrl ( ... pathSegments ) { const resolvedPath = path . resolve ( ... pathSegments ) ; return fileUrl ( resolvedPath ) ; } example param { string } source param { string } dist export function isOutsidePath ( source , dist ) { return ! pathIsInside ( source , dist ) ; }