MCPcopy Index your code
hub / github.com/angular/angular-cli / schematic

Function schematic

packages/angular_devkit/schematics/src/rules/schematic.ts:51–71  ·  view source on GitHub ↗
(
  schematicName: string,
  options: OptionT,
  executionOptions?: Partial<ExecutionOptions>,
)

Source from the content-addressed store, hash-verified

49 * @param options The options to pass as input to the RuleFactory.
50 */
51export function schematic<OptionT extends object>(
52 schematicName: string,
53 options: OptionT,
54 executionOptions?: Partial<ExecutionOptions>,
55): Rule {
56 return (input: Tree, context: SchematicContext) => {
57 const collection = context.schematic.collection;
58 const schematic = collection.createSchematic(schematicName, true);
59
60 return schematic.call(options, observableOf(branch(input)), context, executionOptions).pipe(
61 last(),
62 map((x) => {
63 // We allow overwrite conflict here because they're the only merge conflict we particularly
64 // don't want to deal with; the input tree might have an OVERWRITE which the sub
65 input.merge(x, MergeStrategy.AllowOverwriteConflict);
66
67 return input;
68 }),
69 );
70 };
71}

Callers 8

index.tsFile · 0.90
index.tsFile · 0.90
index.tsFile · 0.90
index.tsFile · 0.90
index.tsFile · 0.90
index.tsFile · 0.90
index.tsFile · 0.90
index.tsFile · 0.90

Calls 4

branchFunction · 0.90
createSchematicMethod · 0.65
callMethod · 0.65
mergeMethod · 0.65

Tested by

no test coverage detected