import { normalize } from 'path' ; export const removeExtension = ( path ) => path . includes ( '.' ) ? path . split ( '.' ) . slice ( 0 , - 1 ) . join ( '.' ) : path ; export const splitSegments = ( path ) : string [ ] => normalize ( path ) . split ( /\/|\\/ ) . filter ( part => part && part !== '.' ) ;