(entity: PluginEntity)
| 154 | } |
| 155 | |
| 156 | export 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. |
nothing calls this directly
no outgoing calls
no test coverage detected