Skip to content

Commit 1c22b29

Browse files
committed
Fix boolean casting for Postgres
1 parent 1e896d9 commit 1c22b29

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export function castAttributeValue(value: unknown, type?: string) {
1010
const isString = typeOfValue === 'string';
1111
const isNumber = typeOfValue === 'number';
1212
if (type === 'boolean') {
13-
return value === 1;
13+
return Boolean(value);
1414
} else if (type === 'datetime' && (isString || isNumber)) {
1515
return new Date(value as string | number);
1616
}

0 commit comments

Comments
 (0)