@robotlegsjs/core
Version:
An architecture-based IoC framework for JavaScript/TypeScript
28 lines • 1.37 kB
JavaScript
;
// ------------------------------------------------------------------------------
// Copyright (c) 2017-present, RobotlegsJS. All Rights Reserved.
//
// NOTICE: You are permitted to use, modify, and distribute this file
// in accordance with the terms of the license agreement accompanying it.
// ------------------------------------------------------------------------------
Object.defineProperty(exports, "__esModule", { value: true });
exports.getQualifiedClassName = void 0;
/*============================================================================*/
/* Public Functions */
/*============================================================================*/
/**
* Returns the fully qualified class name of an object. Support EcmaScript from v3 upto v6.
*
* @param {any} value The object for which a fully qualified class name is desired.
* @return {string} A string containing the fully qualified class name.
*/
function getQualifiedClassName(value) {
// es pattern
var v3 = /function\ ([^\(]+)/;
var v6 = /class\ ([^\ ]+)/;
var classDescriptor = value.toString();
var result = classDescriptor.match(v3) || classDescriptor.match(v6);
return result[1];
}
exports.getQualifiedClassName = getQualifiedClassName;
//# sourceMappingURL=getQualifiedClassName.js.map