MCPcopy Create free account
hub / github.com/AlexErrant/Pentive / entityToDomain

Function entityToDomain

app/src/sqlite/media.ts:8–16  ·  view source on GitHub ↗
(entity: MediaEntity)

Source from the content-addressed store, hash-verified

6import type { MediaId } from 'shared/brand'
7
8function entityToDomain(entity: MediaEntity): Media {
9 return {
10 id: entity.id,
11 created: new Date(entity.created),
12 edited: new Date(entity.edited),
13 data: entity.data.buffer,
14 hash: entity.hash.buffer,
15 }
16}
17
18type MediaSansHash = Omit<Media, 'hash'>
19

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected