refactor: allow compilation with TypeScript 2.5 (#19966)

A small number of types need to be adjusted. The changes seem to be
backwards compatible with TS 2.4.

PR Close #19966
This commit is contained in:
Rado Kirov
2017-10-26 17:23:30 -07:00
committed by Matias Niemelä
parent 7553ce9dfe
commit 005a78bd83
4 changed files with 19 additions and 8 deletions

View File

@ -116,8 +116,8 @@ export class MetadataCollector {
function classMetadataOf(classDeclaration: ts.ClassDeclaration): ClassMetadata {
const result: ClassMetadata = {__symbolic: 'class'};
function getDecorators(decorators: ts.Decorator[] | undefined): MetadataSymbolicExpression[]|
undefined {
function getDecorators(decorators: ReadonlyArray<ts.Decorator>| undefined):
MetadataSymbolicExpression[]|undefined {
if (decorators && decorators.length)
return decorators.map(decorator => objFromDecorator(decorator));
return undefined;