Skip to content
Merged
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
11 changes: 6 additions & 5 deletions src/parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -741,8 +741,6 @@ export class Parser {

// Literal values
switch (initializer.kind) {
case ts.SyntaxKind.PropertyAccessExpression:
return initializer.getText();
case ts.SyntaxKind.FalseKeyword:
return this.savePropValueAsString ? 'false' : false;
case ts.SyntaxKind.TrueKeyword:
Expand All @@ -764,11 +762,14 @@ export class Parser {
return (initializer as ts.Identifier).text === 'undefined'
? 'undefined'
: null;
case ts.SyntaxKind.PropertyAccessExpression:
case ts.SyntaxKind.ObjectLiteralExpression:
// return the source text for an object literal
return (initializer as ts.ObjectLiteralExpression).getText();
default:
return null;
try {
return initializer.getText();
} catch(e) {
return null;
}
}
}

Expand Down