You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
10 lines
304 B
10 lines
304 B
export default interface Instantiable<T> {
|
|
new(...args: any[]): T
|
|
}
|
|
|
|
const isInstantiable = (what: any): what is Instantiable<any> => {
|
|
return (typeof what === 'object' || typeof what === 'function') && 'constructor' in what && typeof what.constructor === 'function'
|
|
}
|
|
|
|
export { isInstantiable }
|