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

Function pluginEntityToDomain

app/src/sqlite/util.ts:156–167  ·  view source on GitHub ↗
(entity: PluginEntity)

Source from the content-addressed store, hash-verified

154}
155
156export function pluginEntityToDomain(entity: PluginEntity): Plugin {
157 return {
158 name: entity.name,
159 version: entity.version,
160 dependencies: entity.dependencies ?? undefined,
161 created: new Date(entity.created),
162 edited: new Date(entity.edited),
163 script: new Blob([entity.script], {
164 type: 'text/javascript',
165 }),
166 }
167}
168
169// I don't want to use ParseJSONResultsPlugin because it parses all columns unconditionally. I parse manually instead.
170// @ts-expect-error This means that at runtime we get a string, but Typescript thinks it's a T. Fixed by a parse and cast.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected