UNPKG

566 BJavaScriptView Raw
1"use strict";
2const CustomError = require("./Error");
3const Model_1 = require("./Model");
4let models = {};
5const returnObject = (input) => {
6 if (input instanceof Model_1.Model) {
7 models[input.name] = input;
8 return input;
9 }
10 else if (typeof input === "string") {
11 return models[input];
12 }
13 else {
14 throw new CustomError.InvalidParameter("You must pass in a Model or table name as a string.");
15 }
16};
17returnObject.clear = () => {
18 models = {};
19};
20module.exports = returnObject;
21//# sourceMappingURL=ModelStore.js.map
\No newline at end of file