UNPKG

camo

Version:

A class-based ES6 ODM for Mongo-like databases.

13 lines (11 loc) 317 B
'use strict'; const assertConnected = function(db) { if (db === null || db === undefined) { throw new Error('You must first call \'connect\' before loading/saving documents.'); } }; exports.getClient = function() { const client = global.CLIENT; assertConnected(client); return client; };