Charles Lyding 2b14ac6924 refactor(@schematics/angular): use a helper function for basic generation schematics
An internal schematics helper rule has been introduced for Angular schematics that only generate a set of project files from a set of templated files. Multiple current generation schematics contained essentially the same code which increased the sustainment burden and made refactoring and improvements more complicated.
2021-07-15 12:54:34 +02:00

18 lines
535 B
TypeScript

/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import { Rule } from '@angular-devkit/schematics';
import { generateFromFiles } from '../utility/generate-from-files';
import { Schema as InterfaceOptions } from './schema';
export default function (options: InterfaceOptions): Rule {
options.type = options.type ? `.${options.type}` : '';
return generateFromFiles(options);
}