function booleanFromDb(dbValue) {
    if (dbValue.BOOL === undefined) {
        throw new Error('only attribute values with BOOL value can be mapped to a boolean');
    }
    return dbValue.BOOL === true;
}
function booleanToDb(modelValue) {
    if (!(modelValue === true || modelValue === false)) {
        throw new Error('only boolean values are mapped to a BOOl attribute');
    }
    return { BOOL: modelValue };
}
export var BooleanMapper = {
    fromDb: booleanFromDb,
    toDb: booleanToDb,
};
//# sourceMappingURL=boolean.mapper.js.map