UNPKG

@nestjs/schematics

Version:

Nest - modern, fast, powerful node.js web framework (@schematics)

14 lines (13 loc) 437 B
import { basename, dirname, normalize } from '@angular-devkit/core'; export class NameParser { parse(options) { const nameWithoutPath = basename(options.name); const namePath = dirname((options.path === undefined ? '' : options.path) .concat('/') .concat(options.name)); return { name: nameWithoutPath, path: normalize('/'.concat(namePath)), }; } }