UNPKG

constatic

Version:

Constatic is a CLI for creating and managing modern TypeScript projects, providing an organized structure and features that streamline development.

19 lines (18 loc) 413 B
import { Schema } from "mongoose"; import { t } from "../utils.js"; export const guildSchema = new Schema( { id: t.string, channels: { logs: String, general: String, } }, { statics: { async get(id: string) { return await this.findOne({ id }) ?? this.create({ id }); } } } );