mockttp
Version:
Mock HTTP server for testing HTTP clients and stubbing webservices
13 lines (10 loc) • 434 B
text/typescript
export type Omit<T, K> = Pick<T, Exclude<keyof T, K>>;
// Turns T, making all props K required
export type RequireProps<T, K extends keyof T> =
Omit<T, K> & Required<Pick<T, K>>;
type SubsetKeyOf<T, Ks extends keyof T = keyof T> = Ks;
export type Replace<T, KV extends { [K in SubsetKeyOf<T, any>]: unknown }> =
Omit<T, keyof KV> & { [K in keyof KV]: KV[K] };
export type Mutable<T> = {
-readonly [K in keyof T]: T[K]
}