mdvorscak/validate-params

View on GitHub
lib/custom-type-checker.js

Summary

Maintainability
A
0 mins
Test Coverage
/**
 * Created by Mike Dvorscak on 9/5/2015.
 */

/*
 * Credit for type checking functions to underscore:
 * https://github.com/jashkenas/underscore/blob/master/LICENSE
 */
var toString = Object.prototype.toString;
function getObjectsType(arg){
    return toString.call(arg).slice(8, -1).toLowerCase();
}
module.exports = {
    getObjectsType: getObjectsType
};