sindresorhus/type-fest

`NonEmptyObject` fails for objects with dynamic properties

開放

#821 建立於 2024年2月27日

 (3 則留言) (1 個反應) (0 位負責人)TypeScript (471 個分叉)batch import
buggood first issuehelp wanted

倉庫指標

星標
 (12,328 顆星)
PR 合併指標
 (PR 指標待抓取)

描述

The following code is considered as valid by Typescript, although I was expecting it to complain that the filter foo in commonArguments was empty.

import type { NonEmptyObject } from "type-fest"

interface CommonArguments {
  [filter: string]: NonEmptyObject<{ [argument: string]: string | number | undefined }>
}

export const commonArguments: CommonArguments = {
  foo: {}
}

貢獻者指南