Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return (host, context) => {
options.path = schematics_core_1.getProjectPath(host, options);
if (options.module) {
options.module = schematics_core_1.findModuleFromOptions(host, {
name: '',
module: options.module,
path: options.path,
});
}
const parsedPath = schematics_core_1.parseName(options.path, '');
options.path = parsedPath.path;
if (options.maxAge < 0 || options.maxAge === 1) {
throw new schematics_1.SchematicsException(`maxAge should be an integer greater than 1.`);
}
return schematics_1.chain([
schematics_1.branchAndMerge(schematics_1.chain([addImportToNgModule(options)])),
options && options.skipPackageJson
? schematics_1.noop()
return (host: Tree, context: SchematicContext) => {
options.path = getProjectPath(host, options);
if (options.module) {
options.module = findModuleFromOptions(host, {
name: '',
module: options.module,
path: options.path,
});
}
const parsedPath = parseName(options.path, '');
options.path = parsedPath.path;
if (options.maxAge! < 0 || options.maxAge === 1) {
throw new SchematicsException(
`maxAge should be an integer greater than 1.`
);