diff --git a/packages/core/src/modules/credentials/CredentialUtils.ts b/packages/core/src/modules/credentials/CredentialUtils.ts index 52bdb6ccc2..43b4b5653b 100644 --- a/packages/core/src/modules/credentials/CredentialUtils.ts +++ b/packages/core/src/modules/credentials/CredentialUtils.ts @@ -153,7 +153,7 @@ export class CredentialUtils { // If value is an int32 number string return as number string if (isString(value) && !isEmpty(value) && !isNaN(Number(value)) && this.isInt32(Number(value))) { - return value + return Number(value).toString() } if (isNumber(value)) { diff --git a/packages/core/src/modules/credentials/__tests__/CredentialUtils.test.ts b/packages/core/src/modules/credentials/__tests__/CredentialUtils.test.ts index 9684e1832a..6a391014f5 100644 --- a/packages/core/src/modules/credentials/__tests__/CredentialUtils.test.ts +++ b/packages/core/src/modules/credentials/__tests__/CredentialUtils.test.ts @@ -74,6 +74,10 @@ const testEncodings: { [key: string]: { raw: string | number | boolean | null; e raw: '0.1', encoded: '9382477430624249591204401974786823110077201914483282671737639310288175260432', }, + 'leading zero number string': { + raw: '012345', + encoded: '12345', + }, 'chr 0': { raw: String.fromCharCode(0), encoded: '49846369543417741186729467304575255505141344055555831574636310663216789168157',