UNPKG

desi-mongoose

Version:

A fun and intuitive MongoDB ODM for Node.js with a Hinglish twist

19 lines (18 loc) 526 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.DesiPlugin = void 0; const errors_1 = require("./errors"); class DesiPlugin { static lagao(name, fn) { this.plugins.set(name, fn); } static chalao(name, ...args) { const plugin = this.plugins.get(name); if (plugin) { return plugin(...args); } throw new errors_1.DesiError(`Plugin '${name}' nahi mila!`); } } exports.DesiPlugin = DesiPlugin; DesiPlugin.plugins = new Map();