摘要: declare const tag: unique symbol; export type EmptyObject = { [tag]?: never }; // Record<PropertyKey, never> const acceptOnlyEmptyObject = (input: Emp 阅读全文
posted @ 2024-07-04 02:23 Zhentiw 阅读(8) 评论(0) 推荐(0) 编辑
摘要: const acceptAnythingExceptNullOrUndefined = <T>(input: {}) => {}; acceptAnythingExceptNullOrUndefined('hello'); acceptAnythingExceptNullOrUndefined(42 阅读全文
posted @ 2024-07-04 02:14 Zhentiw 阅读(5) 评论(0) 推荐(0) 编辑