/
githubmirror
/
angular
Обзор
Документация
Войти
/
githubmirror
/
angular
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
packages/animations/browser/test/shared.ts
36 строк
1 KB
Andrew Kushnir
refactor(animations): convert scripts within `packages/animations` to relative imports (#60230)
27 мар 2025, 21:28
27 мар 2025, 21:28
006a14d
Код
Авторство
О чём код?
/** * @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 {trigger} from '../../src/animations'; import {TriggerAst} from '../src/dsl/animation_ast'; import {buildAnimationAst} from '../src/dsl/animation_ast_builder'; import {AnimationTrigger, buildTrigger} from '../src/dsl/animation_trigger'; import {NoopAnimationStyleNormalizer} from '../src/dsl/style_normalization/animation_style_normalizer'; import {triggerParsingFailed} from '../src/error_helpers'; import {triggerParsingWarnings} from '../src/warning_helpers'; import {MockAnimationDriver} from '../testing/src/mock_animation_driver'; export function makeTrigger( name: string, steps: any, skipErrors: boolean = false, ): AnimationTrigger { const driver = new MockAnimationDriver(); const errors: Error[] = []; const warnings: string[] = []; const triggerData = trigger(name, steps); const triggerAst = buildAnimationAst(driver, triggerData, errors, warnings) as TriggerAst; if (!skipErrors && errors.length) { throw triggerParsingFailed(name, errors); } if (warnings.length) { triggerParsingWarnings(name, warnings); } return buildTrigger(name, triggerAst, new NoopAnimationStyleNormalizer()); }