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);
const parsedPath = parseName(options.path, options.name);
options.name = parsedPath.name;
options.path = parsedPath.path;
const opts = ['state', 'stateInterface'].reduce(
(current: Partial, key) => {
return omit(current, key as any);
},
options
);
const templateSource = apply(
url(options.testDepth === 'unit' ? './files' : './integration-files'),
[
options.spec
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;
const templateSource = apply(
url(options.creators ? './creator-files' : './files'),
[
options.spec
? noop()
: filter(path => !path.endsWith('.spec.ts.template')),
applyTemplates({
...stringUtils,
'if-flat': (s: string) =>
stringUtils.group(
options.flat ? '' : s,
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,
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' : ''
),
return (host: Tree, context: SchematicContext) => {
if (!options.name && !options.root) {
throw new Error(`Please provide a name for the feature state`);
}
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);
}
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' : ''),