UNPKG

ottoman

Version:
28 lines 942 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getGlobalPlugins = exports.registerGlobalPlugin = exports.__plugins = void 0; const global_plugin_handler_error_1 = require("./global-plugin-handler-error"); /** * Store global plugins. */ exports.__plugins = []; /** * Register a global plugin. */ const registerGlobalPlugin = (...plugins) => { for (const plugin of plugins) { if (plugin && typeof plugin === 'function') { exports.__plugins.push(plugin); } else { throw new global_plugin_handler_error_1.GlobalPluginHandlerError('Unable to register the global plugin, only functions are allowed'); } } }; exports.registerGlobalPlugin = registerGlobalPlugin; /** * Return all global plugins */ const getGlobalPlugins = () => exports.__plugins; exports.getGlobalPlugins = getGlobalPlugins; //# sourceMappingURL=global-plugin-handler.js.map