diff --git a/integration/simple-long/simple.ts b/integration/simple-long/simple.ts index edbc8b312..579f37c6c 100644 --- a/integration/simple-long/simple.ts +++ b/integration/simple-long/simple.ts @@ -226,7 +226,7 @@ export const SimpleWithMap = { message.longLookup = {}; if (object.longLookup !== undefined && object.longLookup !== null) { Object.entries(object.longLookup).forEach(([key, value]) => { - message.longLookup[key] = Long.fromValue(value as string); + message.longLookup[key] = Long.fromValue(value as Long | string); }); } return message; diff --git a/src/main.ts b/src/main.ts index 41662fca5..77d3320c7 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1047,7 +1047,7 @@ function generateFromJson(ctx: Context, fullName: string, messageDesc: Descripto return code`${utils.bytesFromBase64}(${from} as string)`; } } else if (isLong(valueType) && options.forceLong === LongOption.LONG) { - return code`Long.fromValue(${from} as string)`; + return code`Long.fromValue(${from} as Long | string)`; } else if (isEnum(valueType)) { return code`${from} as number`; } else {