Normalize message attachments

This commit is contained in:
trevor-signal
2025-05-22 21:09:54 -04:00
committed by GitHub
parent 8d8e0329cf
commit d6e81eee11
39 changed files with 2540 additions and 807 deletions

View File

@@ -418,3 +418,27 @@ export class TableIterator<ObjectType extends { id: string }> {
}
}
}
export function convertOptionalIntegerToBoolean(
optionalInteger?: number
): boolean | undefined {
if (optionalInteger === 1) {
return true;
}
if (optionalInteger === 0) {
return false;
}
return undefined;
}
export function convertOptionalBooleanToNullableInteger(
optionalBoolean?: boolean
): 1 | 0 | null {
if (optionalBoolean === true) {
return 1;
}
if (optionalBoolean === false) {
return 0;
}
return null;
}