import { relative } from 'path' ; export function isSubpath ( expectedParent , expectedChild ) { const relativePath = relative ( expectedParent , expectedChild ) ; return relativePath !== '' && ! relativePath . startsWith ( '..' ) && relativePath !== expectedChild ; } export function isPathEqual ( fsPath1 , fsPath2 ) { const relativePath = relative ( fsPath1 , fsPath2 ) ; return relativePath === '' ; } export function getFileExtension ( fsPath ) { return fsPath . split ( '.' ) . pop ( ) ; }