import Dependencies from '@/src/types/dependencies' ; param directoryPath param dependencies function getFirstExistingParentPath ( directoryPath , dependencies ) { let parentDirectoryPath = directoryPath ; let parentDirectoryFound = dependencies . fsExistsSync ( parentDirectoryPath ) ; while ( ! parentDirectoryFound ) { parentDirectoryPath = dependencies . pathNormalize ( parentDirectoryPath + '/..' ) ; parentDirectoryFound = dependencies . fsExistsSync ( parentDirectoryPath ) ; } return parentDirectoryPath ; } export default getFirstExistingParentPath ;