Skip to content
This repository was archived by the owner on Jan 15, 2025. It is now read-only.

Commit 9d73473

Browse files
committed
Ensure proper types when consulting properties
1 parent 32e49b4 commit 9d73473

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/decimal128.mts

+5-2
Original file line numberDiff line numberDiff line change
@@ -922,12 +922,15 @@ function ensureFullySpecifiedToStringOptions(
922922
return opts;
923923
}
924924

925-
if (options.format && TO_STRING_FORMATS.includes(options.format)) {
925+
if (
926+
"string" === typeof options.format &&
927+
TO_STRING_FORMATS.includes(options.format)
928+
) {
926929
opts.format = options.format;
927930
}
928931

929932
if (
930-
options.hasOwnProperty("numDecimalDigits") &&
933+
"number" === typeof options.numDecimalDigits &&
931934
Number.isInteger(options.numDecimalDigits)
932935
) {
933936
opts.numDecimalDigits = options.numDecimalDigits;

0 commit comments

Comments
 (0)