refactor: Consistently use index access on index signature types. (#28937)
This change helps highlight certain misoptimizations with Closure compiler. It is also stylistically preferable to consistently use index access on index sig types. Roughly, when one sees '.foo' they know it is always checked for typos in the prop name by the type system (unless 'any'), while "['foo']" is always not. Once all angular repos are conforming this will become a tsetse.info check, enforced by bazel. PR Close #28937
This commit is contained in:
@ -65,7 +65,7 @@ export class InlineResourcesMetadataTransformer implements MetadataTransformer {
|
||||
updateDecoratorMetadata(loader: StaticResourceLoader, arg: MetadataObject): MetadataObject {
|
||||
if (arg['templateUrl']) {
|
||||
arg['template'] = loader.get(arg['templateUrl']);
|
||||
delete arg.templateUrl;
|
||||
delete arg['templateUrl'];
|
||||
}
|
||||
|
||||
const styles = arg['styles'] || [];
|
||||
@ -76,7 +76,7 @@ export class InlineResourcesMetadataTransformer implements MetadataTransformer {
|
||||
styles.push(...styleUrls.map(styleUrl => loader.get(styleUrl)));
|
||||
if (styles.length > 0) {
|
||||
arg['styles'] = styles;
|
||||
delete arg.styleUrls;
|
||||
delete arg['styleUrls'];
|
||||
}
|
||||
|
||||
return arg;
|
||||
|
Reference in New Issue
Block a user