import { Attachment } from '@taylordb/shared';
export class FieldsProcessor {
    process(record) {
        const newRecord = { ...record };
        for (const key in newRecord) {
            const value = newRecord[key];
            if (Array.isArray(value) &&
                value.length > 0 &&
                value[0] instanceof Attachment) {
                newRecord[key] = value.map((att) => att.toColumnValue());
            }
            else if (typeof value === 'object' &&
                value !== null &&
                // @ts-ignore
                value instanceof Attachment) {
                newRecord[key] = value.toColumnValue();
            }
        }
        return newRecord;
    }
}
//# sourceMappingURL=fields-processor.js.map