This commit is contained in:
syuilo
2018-08-29 16:26:33 +09:00
parent 256a2d25b0
commit 9654ffab42
4 changed files with 28 additions and 26 deletions

View File

@ -0,0 +1,13 @@
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;
}