/
githubmirror
/
angular-cli
Обзор
Документация
Войти
/
githubmirror
/
angular-cli
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
packages/schematics/angular/pipe/index.ts
38 строк
1 KB
Charles Lyding
refactor(@schematics/angular): update type usage to support isolated declarations
12 дек 2025, 22:37
12 дек 2025, 22:37
e4eee62
Код
Авторство
О чём код?
/** * @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.dev/license */ import { RuleFactory, chain, strings } from '@angular-devkit/schematics'; import { addDeclarationToNgModule } from '../utility/add-declaration-to-ng-module'; import { findModuleFromOptions } from '../utility/find-module'; import { generateFromFiles } from '../utility/generate-from-files'; import { parseName } from '../utility/parse-name'; import { createProjectSchematic } from '../utility/project'; import { validateClassName } from '../utility/validation'; import { createDefaultPath } from '../utility/workspace'; import { Schema as PipeOptions } from './schema'; const pipeSchematic: RuleFactory<PipeOptions> = createProjectSchematic( async (options, { tree }) => { options.path ??= await createDefaultPath(tree, options.project); options.module = findModuleFromOptions(tree, options); const parsedPath = parseName(options.path, options.name); options.name = parsedPath.name; options.path = parsedPath.path; validateClassName(strings.classify(options.name)); return chain([ addDeclarationToNgModule({ type: 'pipe', ...options, }), generateFromFiles(options), ]); }, ); export default pipeSchematic;