build and publish config

This commit is contained in:
2024-01-29 10:31:52 -06:00
parent 971a288794
commit 430cff39b8
11 changed files with 28 additions and 11 deletions

14
pkg/lib/mongodb.ts Normal file
View File

@@ -0,0 +1,14 @@
import { MongoClient, type MongoClientOptions } from "mongodb";
import { z } from "zod";
// mongodb ObjectId as zod schema (we'll settle on our definition later)
export const ObjectId = z.any();
export async function createMongoClient(url: string, options?: MongoClientOptions) {
try {
return new MongoClient(url, options);
} catch(e) {
console.log(e);
return;
}
}