UNPKG

digitaltwin-core

Version:

Minimalist framework to collect and handle data in a Digital Twin project

21 lines 653 B
/** * Convert a DB metadata row to a full DataRecord with lazy-loaded blob. * * Also maps asset-specific fields if present (for AssetsManager components). */ export function mapToDataRecord(row, storage) { return { id: row.id, name: row.name, date: new Date(row.date), contentType: row.type, url: row.url, data: () => storage.retrieve(row.url), // Asset-specific fields (optional, only for AssetsManager) description: row.description, source: row.source, owner_id: row.owner_id, filename: row.filename }; } //# sourceMappingURL=map_to_data_record.js.map