Code coverage report for dist\lib\cacheControllers\IDDirector.js

Statements: 100% (17 / 17)      Branches: 100% (4 / 4)      Functions: 100% (6 / 6)      Lines: 100% (17 / 17)      Ignored: none     

All files » dist/lib/cacheControllers/ » IDDirector.js
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 251 1 1   1 20   1 19 18 1   1 17   1 7 6 1   1   1    
var MongoDB = require('mongodb');
var IDCacheDirector = (function () {
    function IDCacheDirector() {
    }
    IDCacheDirector.prototype.valid = function (object) {
        return !!object._id;
    };
    IDCacheDirector.prototype.buildKey = function (object) {
        if (object._id._bsontype == 'ObjectID')
            return new MongoDB.ObjectID(object._id.id).toHexString();
        return object._id;
    };
    IDCacheDirector.prototype.validQuery = function (conditions) {
        return !!conditions._id;
    };
    IDCacheDirector.prototype.buildQueryKey = function (conditions) {
        if (conditions._id._bsontype == 'ObjectID')
            return new MongoDB.ObjectID(conditions._id.id).toHexString();
        return conditions._id;
    };
    return IDCacheDirector;
})();
exports.default = IDCacheDirector;
 
//# sourceMappingURL=../../lib/cacheControllers/IDDirector.js.map