Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/util-dynamodb/src/convertToAttr.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ describe("convertToAttr", () => {

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

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

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

const BigIntConstructor = BigInt;
(BigInt as any) = undefined;
Expand Down
4 changes: 2 additions & 2 deletions packages/util-dynamodb/src/convertToAttr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,8 @@ const convertToBinaryAttr = (data: NativeAttributeBinary): { B: NativeAttributeB
const convertToStringAttr = (data: string | String): { S: string } => ({ S: data.toString() });
const convertToBigIntAttr = (data: bigint): { N: string } => ({ N: data.toString() });

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

const convertToNumberAttr = (num: number | Number): { N: string } => {
Expand Down
Loading