Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion util/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,10 @@ function isReadonlyPropertyFromMappedType(type: ts.Type, name: ts.__String, chec
// well-known symbols are not affected by mapped types
if (declaration.readonlyToken !== undefined && !/^__@[^@]+$/.test(<string>name))
return declaration.readonlyToken.kind !== ts.SyntaxKind.MinusToken;
return isPropertyReadonlyInType((<{modifiersType: ts.Type}><unknown>type).modifiersType, name, checker);
const modifiersType = (<{ modifiersType: ts.Type }><unknown>type).modifiersType;
if (modifiersType === undefined)
return false;
return isPropertyReadonlyInType(modifiersType, name, checker);
}

export function symbolHasReadonlyDeclaration(symbol: ts.Symbol, checker: ts.TypeChecker) {
Expand Down