Code coverage report for lib/utils/index.js

Statements: 100% (6 / 6)      Branches: 100% (2 / 2)      Functions: 100% (3 / 3)      Lines: 100% (6 / 6)      Ignored: none     

All files » lib/utils/ » index.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 25          1   1           290 290   290             1  
'use strict';
 
/*
Helping functions
*/
var Promise = require('bluebird');
 
var _utils = {
    // no-operation callback helper function
    noop : function() {},
 
    // promisification function
    promisify : function (data,callback) {
        callback = callback || this.noop;
        return new Promise(function (resolve,reject) {
            // the data is already there
            resolve(data);
        }).nodeify(callback);
    },
 
    Promise : Promise
}
 
module.exports = _utils;