mirror of
https://github.com/nullnyat/NullcatChan.git
synced 2025-04-29 09:07:16 +09:00
14 lines
267 B
TypeScript
14 lines
267 B
TypeScript
import * as loki from 'lokijs';
|
|
|
|
export default function(db: loki, name: string, opts?: any): loki.Collection {
|
|
let collection;
|
|
|
|
collection = db.getCollection(name);
|
|
|
|
if (collection == null) {
|
|
collection = db.addCollection(name, opts);
|
|
}
|
|
|
|
return collection;
|
|
}
|