UNPKG

typeorm

Version:

Data-Mapper ORM for TypeScript, ES7, ES6, ES5. Supports MySQL, PostgreSQL, MariaDB, SQLite, MS SQL Server, Oracle, MongoDB databases.

16 lines (15 loc) 620 B
import { ObjectLiteral } from "../common/ObjectLiteral"; /** * Make all properties in T optional */ export type QueryPartialEntity<T> = { [P in keyof T]?: T[P] | (() => string); }; /** * Make all properties in T optional. Deep version. */ export type QueryDeepPartialEntity<T> = _QueryDeepPartialEntity<ObjectLiteral extends T ? unknown : T>; type _QueryDeepPartialEntity<T> = { [P in keyof T]?: (T[P] extends Array<infer U> ? Array<_QueryDeepPartialEntity<U>> : T[P] extends ReadonlyArray<infer U> ? ReadonlyArray<_QueryDeepPartialEntity<U>> : _QueryDeepPartialEntity<T[P]>) | (() => string); }; export {};