UNPKG

@eyhn/msgpack-stream

Version:

MessagePack for ECMA-262/JavaScript/TypeScript

15 lines (11 loc) 395 B
/* eslint-disable @typescript-eslint/ban-types */ export type SplitTypes<T, U> = U extends T ? (Exclude<T, U> extends never ? T : Exclude<T, U>) : T; export type SplitUndefined<T> = SplitTypes<T, undefined>; export type ContextOf<ContextType> = ContextType extends undefined ? {} : { /** * Custom user-defined data, read/writable */ context: ContextType; };