Skip to content

Commit 391ca80

Browse files
committed
chore(util-dynamodb): fix types
1 parent 824ddec commit 391ca80

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/util-dynamodb/src/convertToAttr.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,9 +169,9 @@ const convertToNumberAttr = (num: number | Number, options?: marshallOptions): {
169169
throw new Error(`Special numeric value ${num.toString()} is not allowed`);
170170
} else if (!options?.allowImpreciseNumbers) {
171171
// Only perform these checks if allowImpreciseNumbers is false
172-
if (num > Number.MAX_SAFE_INTEGER) {
172+
if (Number(num) > Number.MAX_SAFE_INTEGER) {
173173
validateBigIntAndThrow(`Number ${num.toString()} is greater than Number.MAX_SAFE_INTEGER.`);
174-
} else if (num < Number.MIN_SAFE_INTEGER) {
174+
} else if (Number(num) < Number.MIN_SAFE_INTEGER) {
175175
validateBigIntAndThrow(`Number ${num.toString()} is lesser than Number.MIN_SAFE_INTEGER.`);
176176
}
177177
}

0 commit comments

Comments
 (0)