UNPKG

@rsc-labs/nocto-plugin-system

Version:

Pluggable registry system for Nocto plugins

15 lines (14 loc) 379 B
class PluginConfigReg { constructor() { this.configs = new Map(); } register(pluginId, schema, rawConfig) { const parsed = schema.parse(rawConfig); this.configs.set(pluginId, parsed); return parsed; } get(pluginId) { return this.configs.get(pluginId); } } export const PluginConfigRegistry = new PluginConfigReg();