export class TagPaths { public static createPathEntries ( path ) { const paths = path . split ( "/" ) ; let buff = '' ; const result = [ ] ; let parent ; for ( const current of paths ) { if ( buff === '/' ) { buff = buff + current ; } else { buff = buff + '/' + current ; } const toParent = ( ) : RawPathEntry | undefined => { if ( parent ) { return { path : parent . path , basename : parent . basename } ; } return undefined ; } ; const pathEntry = { path : buff , basename : current , parent : toParent ( ) } ; result . push ( pathEntry ) ; parent = pathEntry ; } return result ; } } export interface RawPathEntry { readonly path : string ; readonly basename : string ; } export interface PathEntry extends RawPathEntry { readonly parent : RawPathEntry | undefined ; }