@nestjs/schematics
Version:
The generators behind the Nest CLI: scaffold NestJS applications, libraries, modules, controllers, services and CRUD resources.
14 lines (13 loc) • 437 B
JavaScript
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)),
};
}
}