@megaorm/utils
Version:
This package provides utility functions to validate whether a value is a MegaORM driver or a connection.
43 lines (42 loc) • 1.83 kB
TypeScript
/**
* Checks if the given object is a valid `MegaDriver`.
* @param driver - The object to validate as a `MegaDriver`.
* @returns `true` if the object is a `MegaDriver`, `false` otherwise.
*/
export declare function isDriver(driver: any): boolean;
/**
* Checks if the given object is a valid `MySQL` instance.
* @param driver The object to validate.
* @returns `true` if the object is a `MySQL` instance, `false` otherwise.
*/
export declare function isMySQL(driver: any): boolean;
/**
* Checks if the given object is a valid `SQLite` instance.
* @param driver The object to validate.
* @returns `true` if the object is a `SQLite` instance, `false` otherwise.
*/
export declare function isSQLite(driver: any): boolean;
/**
* Checks if the given object is a valid `PostgreSQL` instance.
* @param driver The object to validate.
* @returns `true` if the object is a `PostgreSQL` instance, `false` otherwise.
*/
export declare function isPostgreSQL(driver: any): boolean;
/**
* Checks if the given object is a valid `MegaConnection`.
* @param connection - The object to validate as a `MegaConnection`.
* @returns `true` if the object is a `MegaConnection`, `false` otherwise.
*/
export declare function isCon(connection: any): boolean;
/**
* Checks if the given object is a valid `MegaPendingConnection`.
* @param connection - The object to validate as a `MegaPendingConnection`.
* @returns `true` if the object is a `MegaPendingConnection`, `false` otherwise.
*/
export declare function isPendingCon(connection: any): boolean;
/**
* Checks if the given object is a valid `MegaPoolConnection`.
* @param connection - The object to validate as a `MegaPoolConnection`.
* @returns `true` if the object is a `MegaPoolConnection`, `false` otherwise.
*/
export declare function isPoolCon(connection: any): boolean;