stamina-api
Version:
Npm module can make jokes generator and other. This module is for Stamina website and game. - Only Stamina's developpers: Can manage Stamina's infrastructure.
14 lines (11 loc) • 510 B
JavaScript
const MessageErrors = require("../errors/MessageErrors.js")
const j = require("../jokes/jokes.json")
module.exports = {
get(gettingOption) {
if (!gettingOption) throw new Error(MessageErrors.gettingOption_Missing)
if (typeof gettingOption !== "string") throw new Error(MessageErrors.gettingOption_Invalid)
if (gettingOption.toLowerCase() === "jokes") {
return require("./jokesBy.js")
} else throw new Error(MessageErrors.gettingOption_Invalid)
}
}