@httpx/assert
Version:
Assertions and typeguards
15 lines (11 loc) • 738 B
TypeScript
import { S as Simplify } from './internal.types-D5VRBw-5.js';
type PlainObjectKey = string | number | symbol;
type BasePlainObject = Record<PlainObjectKey, unknown>;
interface DefaultBasePlainObject extends BasePlainObject {
readonly __tag: 'default-plain-object';
}
type PlainObjectDeepPartialUnknown<T> = {
[P in keyof T]?: NonNullable<T[P]> extends BasePlainObject ? Simplify<PlainObjectDeepPartialUnknown<NonNullable<T[P]>>> : unknown;
};
type PlainObject<TValue extends BasePlainObject = DefaultBasePlainObject> = TValue extends DefaultBasePlainObject ? Record<PlainObjectKey, unknown> : Simplify<PlainObjectDeepPartialUnknown<TValue>>;
export type { BasePlainObject as B, DefaultBasePlainObject as D, PlainObject as P };