Skip to content

Commit

Permalink
Merge pull request #13 from zetkin/231127-fix-bug-return-multi-param
Browse files Browse the repository at this point in the history
return multi param
  • Loading branch information
amerharb authored Dec 4, 2023
2 parents d009fe2 + 1d79eae commit 535045b
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions webapp/src/utils/readTypedMessages.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import ts from 'typescript';

export default function readTypedMessages(fileName: string) {
export default function readTypedMessages(fileName: string): MessageData[] {
const host = ts.createIncrementalCompilerHost(
{},
{
Expand Down Expand Up @@ -88,9 +88,8 @@ function inspectMessages(node: ts.CallExpression): MessageData[] {
defaultMessage: argNode.text,
id: id,
params:
callNode.typeArguments?.map((typeArg) => {
const typeNode = typeArg as ts.TypeLiteralNode;
const memberNode = typeNode.members[0] as ts.PropertySignature;
(callNode.typeArguments?.[0] as ts.TypeLiteralNode)?.members.map((member) => {
const memberNode = member as ts.PropertySignature;
const typeIdNode = memberNode.name as ts.Identifier;
if (memberNode.type?.kind == ts.SyntaxKind.UnionType) {
const unionNode = memberNode.type as ts.UnionTypeNode;
Expand Down

0 comments on commit 535045b

Please sign in to comment.