log4js2
Version:
[](https://travis-ci.org/anigenero/log4js2) [](https://codecov.io/gh/anigenero/log4js2)
31 lines • 861 B
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
/**
* Gets the function name of the specified function
*
* @function
* @param {Function} func
*
* @returns {string}
*/
exports.getFunctionName = (func) => {
if (func.name !== '') {
return func.name;
}
else {
// get the name of the function
let name = func.toString().substring('function '.length);
name = name.substring(0, name.indexOf('('));
// if the string is not empty
return (name && name.trim()) ? name : 'anonymous';
}
};
/**
* Determines whether or not the value is an array. Return false is null
*
* @param {any} value
* @returns {boolean} true if non-null array, else false
*/
exports.isArray = (value) => {
return (typeof value === 'object' && value instanceof Array);
};
//# sourceMappingURL=utility.js.map