Skip to content

Commit b77eabc

Browse files
committed
update error messge to NumberValue
1 parent 053a868 commit b77eabc

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

packages/util-dynamodb/src/convertToAttr.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ describe("convertToAttr", () => {
6363

6464
expect(() => {
6565
convertToAttr(num, { convertClassInstanceToMap });
66-
}).toThrowError(`${errorPrefix} Use BigInt.`);
66+
}).toThrowError(`${errorPrefix} Use NumberValue, which is introduced from @aws-sdk/lib-dynamodb.`);
6767

6868
const BigIntConstructor = BigInt;
6969
(BigInt as any) = undefined;
@@ -81,7 +81,7 @@ describe("convertToAttr", () => {
8181

8282
expect(() => {
8383
convertToAttr(num, { convertClassInstanceToMap });
84-
}).toThrowError(`${errorPrefix} Use BigInt.`);
84+
}).toThrowError(`${errorPrefix} Use NumberValue, which is introduced from @aws-sdk/lib-dynamodb.`);
8585

8686
const BigIntConstructor = BigInt;
8787
(BigInt as any) = undefined;

packages/util-dynamodb/src/convertToAttr.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,8 @@ const convertToBinaryAttr = (data: NativeAttributeBinary): { B: NativeAttributeB
156156
const convertToStringAttr = (data: string | String): { S: string } => ({ S: data.toString() });
157157
const convertToBigIntAttr = (data: bigint): { N: string } => ({ N: data.toString() });
158158

159-
const validateBigIntAndThrow = (errorPrefix: string) => {
160-
throw new Error(`${errorPrefix} ${typeof BigInt === "function" ? "Use BigInt." : "Pass string value instead."} `);
159+
const validateBigIntAndThrow = (errorPrefix: string) => {
160+
throw new Error(`${errorPrefix} ${typeof BigInt === "function" ? "Use NumberValue, which is introduced from @aws-sdk/lib-dynamodb." : "Pass string value instead."} `);
161161
};
162162

163163
const convertToNumberAttr = (num: number | Number): { N: string } => {

0 commit comments

Comments
 (0)