diff --git a/integration/simple-long/simple.ts b/integration/simple-long/simple.ts index 95c7eda7a..87561d012 100644 --- a/integration/simple-long/simple.ts +++ b/integration/simple-long/simple.ts @@ -227,7 +227,7 @@ export const SimpleWithMap = { ); message.longLookup = Object.entries(object.longLookup ?? {}).reduce<{ [key: string]: Long }>( (acc, [key, value]) => { - acc[key] = Long.fromString(value as string); + acc[key] = Long.fromValue(value as Long | string); return acc; }, {} diff --git a/src/main.ts b/src/main.ts index 5cf94537c..8b7ddb02c 100644 --- a/src/main.ts +++ b/src/main.ts @@ -990,7 +990,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.fromString(${from} as string)`; + return code`Long.fromValue(${from} as Long | string)`; } else if (isEnum(valueType)) { return code`${from} as number`; } else {