Skip to content

Commit

Permalink
Fix boolean casting for Postgres
Browse files Browse the repository at this point in the history
  • Loading branch information
backspace committed Oct 9, 2021
1 parent 1e896d9 commit 1c22b29
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export function castAttributeValue(value: unknown, type?: string) {
const isString = typeOfValue === 'string';
const isNumber = typeOfValue === 'number';
if (type === 'boolean') {
return value === 1;
return Boolean(value);
} else if (type === 'datetime' && (isString || isNumber)) {
return new Date(value as string | number);
}
Expand Down

0 comments on commit 1c22b29

Please sign in to comment.