(file: string)
| 241 | |
| 242 | /** The plugin's own icon as a data URI, read from the user's local install. */ |
| 243 | const readIconDataUri = (file: string): string | undefined => |
| 244 | tryOrElse(() => { |
| 245 | const mime = ICON_MIME[path.extname(file).toLowerCase()]; |
| 246 | if (mime === undefined) return undefined; |
| 247 | if (fs.statSync(file).size > MAX_ICON_BYTES) return undefined; |
| 248 | return `data:${mime};base64,${fs.readFileSync(file).toString("base64")}`; |
| 249 | }, undefined); |
| 250 | |
| 251 | interface CodexPluginDisplay { |
| 252 | readonly icon?: string; |
no test coverage detected