@dxtmisha/scripts
Version:
Development scripts and CLI tools for DXT UI projects - automated component generation, library building and project management tools
15 lines (13 loc) • 527 B
text/typescript
import { PropertiesFile, type PropertiesFilePath } from '../classes/Properties/PropertiesFile'
/**
* Get the name of the last directory from the given paths.
*
* Получить имя последней директории из заданных путей.
* @param paths Array of path segments/ Массив сегментов пути
*/
export function getNameDirByPaths(paths: PropertiesFilePath) {
const dirs = PropertiesFile.splitForDir(
PropertiesFile.joinPath(paths)
)
return dirs[dirs.length - 1]
}