import { PathMappings } from "./configuration" ; /** Absolutifier makes  */ export class PathMapper { private mappings : PathMappings ; constructor ( mappings ) { this . mappings = mappings ; } globalizePathFunc ( ) { return this . globalizePath . bind ( this ) ; } /** converts the given executable filename into its full path */ private globalizePath ( command ) { const words = command . split ( " " ) ; const hit = this . mappings [ words [ 0 ] ] ; if ( ! hit ) { return command ; } words [ 0 ] = hit ; return words . join ( " " ) ; } }