mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
41eacff363
Sets up the compliance tests to target es2022 since that's the default in the CLI. Also updates all of the tests, primarily because the generated output for static properties has changed.
19 lines
527 B
TypeScript
19 lines
527 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.dev/license
|
|
*/
|
|
|
|
/**
|
|
* Verifies that there is exactly one factory definition for the provided type.
|
|
*/
|
|
export function verifyUniqueFactory(output: string, type: string): boolean {
|
|
const matches = output.match(new RegExp(`function ${type}_Factory`, 'g'));
|
|
if (matches === null) {
|
|
return false;
|
|
}
|
|
return matches.length === 1;
|
|
}
|