@@ -266,10 +266,9 @@ export class Parser {
266
266
if ( exp . flags & ts . SymbolFlags . Alias ) {
267
267
targetSymbol = this . checker . getAliasedSymbol ( exp ) ;
268
268
}
269
- const declaration =
270
- targetSymbol . valueDeclaration || targetSymbol . declarations ! [ 0 ] ;
269
+ const declaration = targetSymbol . valueDeclaration ;
271
270
272
- if ( ts . isClassDeclaration ( declaration ) ) {
271
+ if ( ! declaration || ts . isClassDeclaration ( declaration ) ) {
273
272
return false ;
274
273
}
275
274
@@ -1203,18 +1202,22 @@ export class Parser {
1203
1202
properties : ts . NodeArray < ts . PropertyAssignment | ts . BindingElement >
1204
1203
) : StringIndexedObject < string | boolean | number | null > {
1205
1204
return properties . reduce ( ( acc , property ) => {
1206
- const propertyName = getPropertyName ( ts . isBindingElement ( property ) ? ( property . propertyName || property . name ) : property . name ) ;
1205
+ const propertyName = getPropertyName (
1206
+ ts . isBindingElement ( property )
1207
+ ? property . propertyName || property . name
1208
+ : property . name
1209
+ ) ;
1207
1210
if ( ts . isSpreadAssignment ( property ) || ! propertyName ) {
1208
1211
return acc ;
1209
1212
}
1210
1213
1211
1214
const literalValue = this . getLiteralValueFromPropertyAssignment ( property ) ;
1212
1215
1213
1216
if (
1214
- ( typeof literalValue === 'string' ||
1215
- typeof literalValue === 'number' ||
1216
- typeof literalValue === 'boolean' ||
1217
- literalValue === null )
1217
+ typeof literalValue === 'string' ||
1218
+ typeof literalValue === 'number' ||
1219
+ typeof literalValue === 'boolean' ||
1220
+ literalValue === null
1218
1221
) {
1219
1222
acc [ propertyName ] = literalValue ;
1220
1223
}
0 commit comments