UNPKG

567 BTypeScriptView Raw
1import type { Constructor } from '../types';
2/**
3 * @name isChildClass
4 * @summary Tests if the child extends the parent Class
5 * @description
6 * Checks to see if the child Class extends the parent Class
7 * @example
8 * <BR>
9 *
10 * ```javascript
11 * import { isChildClass } from '@polkadot/util';
12 *
13 * console.log('isChildClass', isChildClass(BN, BN); // => true
14 * console.log('isChildClass', isChildClass(BN, Uint8Array); // => false
15 * ```
16 */
17export declare function isChildClass<P extends Constructor>(Parent: P, Child?: Constructor | null | unknown): Child is P;