@halospv3/hce.shared-config
Version:
Automate commit message quality, changelogs, and CI/CD releases. Its `main` entry point is a Semantic Release config. Functions and classes are exposed for customization. An ESLint config, a Commitlint config, and addl. resources for .NET projects are als
14 lines (12 loc) • 575 B
text/typescript
import type { ProtoOrSuperClass as PrototypeOrSuperClass, WithProto as WithPrototype } from './inheritance.ts';
/**
* A nearly useless wrapper for {@link Reflect.getPrototypeOf}
* @param object An object with the internal `__proto__` property present in its type.
* @returns The `__proto__` of the `object` param.
*/
export function getPrototypeOf<
T extends WithPrototype<PrototypeOrSuperClass>,
>(object: T): T['__proto__'] {
// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
return Reflect.getPrototypeOf(object) as T['__proto__'];
}