UNPKG

398 BJavaScriptView Raw
1const Error = require("./Error");
2let models = {};
3
4module.exports = (input) => {
5 const Model = require("./Model");
6 if (input instanceof Model) {
7 models[input.name] = input;
8 } else if (typeof input === "string") {
9 return models[input];
10 } else {
11 throw new Error.InvalidParameter("You must pass in a Model or table name as a string.");
12 }
13};
14module.exports.clear = () => {
15 models = {};
16};