@halospv3/hce.shared-config
Version:
Automate commit message quality, changelogs, and CI/CD releases. Exports a semantic-release shareable configuration deserialized from this package's '.releaserc.yml'. Shared resources for .NET projects are also distributed with this package.
17 lines • 983 B
TypeScript
/**
* A very jank function to determine if an object can be the target of Reflect.construct.
* Unfortunately, many functions have a constructor in their prototype. These
* functions are treated like classes due to JavaScript's poor distinction between
* classes and functions.\
* Typescript can enforce "new" keyword usage, but overriding the type
* allows you to `new isConstructor()` despite this function not intended to be
* used with the `new` keyword.
* #### NOTE: Only works when targeting ES6/ES2015 or later.
* > If your project or a dependent project is compiled to < ES6, this function will always return `false`; classes and constructors were introduced in ES6/ES2015.
* @param obj Anything.
* @returns `true` if the obj is a constructor. Else, `false`.
* @since 3.0.0
* @see https://stackoverflow.com/a/49510834
*/
export declare function isConstructor(obj: unknown): obj is abstract new (...args: any[]) => any;
//# sourceMappingURL=isConstructor.d.ts.map