tsreflect-ioc
Version:
Inversion of control and Dependency injection framework for typescript based on the tsreflect-compiler package.
22 lines (19 loc) • 663 B
text/typescript
/// <reference path="_references.ts" />
var extend = require('extend');
interface Object {
/**
* Returns the class name which was figured out by using the name of the constructor method.
**/
getClassName(): string;
}
class ObjectExtensions implements Object {
/**
* Returns the class name which was figured out by using the name of the constructor method.
* @returns {String} The name of the class.
**/
public getClassName(): string {
return this.constructor.toString().match(/\w+/g)[1];
}
}
extend(false, Object.prototype, ObjectExtensions.prototype);
var proto = Object.prototype;