All files / src internal.ts

100% Statements 6/6
100% Branches 2/2
100% Functions 4/4
100% Lines 6/6

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60              9x           2x 2x               57x 2x   4x                                                                    
import type { HKT } from "./base/hkt";
 
export interface Identity extends HKT {
	new: (t: HKT.T<this>) => typeof t;
}
 
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion
export const never = undefined as never;
 
export type MaxDepth = 20;
 
export class AssertionError extends Error {
	public constructor(msg?: string) {
		super(msg);
		this.name = "AssertionError";
	}
}
 
export function assert(
	condition: unknown,
	msg?: string,
): asserts condition {
	if (!Boolean(condition))
		throw new AssertionError(
			["Assertion error", msg]
				.filter((v) => v !== undefined)
				.join(": "),
		);
}
 
// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-parameters, @typescript-eslint/no-unused-vars
export function assertType<T>(_v: unknown): asserts _v is T {
	/* empty */
}
 
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
type FunctionProto = Function;
export interface HidePrototype {
	/** @deprecated */
	apply: FunctionProto["apply"];
	/** @deprecated */
	arguments: FunctionProto["arguments"];
	/** @deprecated */
	bind: FunctionProto["bind"];
	/** @deprecated */
	call: FunctionProto["call"];
	/** @deprecated */
	caller: FunctionProto["caller"];
	/** @deprecated */
	length: FunctionProto["length"];
	/** @deprecated */
	name: FunctionProto["name"];
	/** @deprecated */
	prototype: FunctionProto["prototype"];
	/** @deprecated */
	toString: FunctionProto["toString"];
	/** @deprecated */
	Symbol: SymbolConstructor;
}