import { join } from 'path' ; export default class StephaneLink { private inputValue : [ string , string ] = null ; public constructor ( link , root ) { this . inputValue = [ link , root ] ; } public get value ( ) : string { const [ link , root ] = this . inputValue ; return this . normalize ( [ link , root ] ) ; } public normalize ( [ link , root ] ) { const url = new URL ( root ) ; const strippedLink = link . replace ( '/../' , '' ) ; return url . protocol + '//' + join ( url . host , strippedLink ) ; } }