Skip to content

Commit

Permalink
fix: wrong conversion of typeof instead of value in toAnyValue
Browse files Browse the repository at this point in the history
  • Loading branch information
witoszekdev committed Jan 29, 2024
1 parent fce57da commit 29bc0bf
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export function toKeyValue(key: string, value: unknown): IKeyValue {
export function toAnyValue(value: unknown): IAnyValue {
const t = typeof value;
if (t === 'string') return { stringValue: value as string };
if (t === 'number' && Number.isFinite(t)) {
if (t === 'number' && Number.isFinite(value)) {
if (!Number.isInteger(value)) return { doubleValue: value as number };
return { intValue: value as number };
}
Expand Down

0 comments on commit 29bc0bf

Please sign in to comment.