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: Tree, context: SchematicContext) => {
options.path = getProjectPath(host, options);
if (options.module) {
options.module = findModuleFromOptions(host, options);
}
const parsedPath = parseName(options.path, options.name || '');
options.name = parsedPath.name;
options.path = parsedPath.path;
const templateSource = apply(url('./files'), [
options.spec
? noop()
: filter(path => !path.endsWith('.spec.ts.template')),
options.root && options.minimal ? filter(_ => false) : noop(),
applyTemplates({
...stringUtils,
'if-flat': (s: string) =>
stringUtils.group(
options.flat ? '' : s,
return (host: Tree, context: SchematicContext) => {
options.path = getProjectPath(host, options);
const parsedPath = parseName(options.path, options.name);
options.name = parsedPath.name;
options.path = parsedPath.path;
if (options.module) {
options.module = findModuleFromOptions(host, options);
}
const templateOptions = {
...stringUtils,
'if-flat': (s: string) => (options.flat ? '' : s),
'group-actions': (name: string) =>
stringUtils.group(name, options.group ? 'actions' : ''),
'group-models': (name: string) =>
stringUtils.group(name, options.group ? 'models' : ''),
'group-reducers': (s: string) =>
stringUtils.group(s, options.group ? 'reducers' : ''),
...(options as object),
};
const commonTemplates = apply(url('./common-files'), [
options.spec
return (host: Tree, context: SchematicContext) => {
options.path = getProjectPath(host, options);
if (options.module) {
options.module = findModuleFromOptions(host, options);
}
const parsedPath = parseName(options.path, options.name);
options.name = parsedPath.name;
options.path = parsedPath.path;
const templateOptions = {
...stringUtils,
'if-flat': (s: string) =>
stringUtils.group(
options.flat ? '' : s,
options.group ? 'reducers' : ''
),
...(options as object),
};
options.path = getProjectPath(host, options);
const parsedPath = parseName(options.path, options.name || '');
options.name = parsedPath.name;
options.path = parsedPath.path;
const statePath = `/${options.path}/${options.statePath}/index.ts`;
const srcPath = dirname(options.path as Path);
const environmentsPath = buildRelativePath(
statePath,
`${srcPath}/environments/environment`
);
if (options.module) {
options.module = findModuleFromOptions(host, options);
}
if (
options.root &&
options.stateInterface &&
options.stateInterface !== 'State'
) {
options.stateInterface = stringUtils.classify(options.stateInterface);
}
const templateSource = apply(url('./files'), [
options.root && options.minimal ? filter(_ => false) : noop(),
applyTemplates({
...stringUtils,
...(options as object),
isLib: isLib(host, options),