sindresorhus/type-fest

`NonEmptyObject` fails for objects with dynamic properties

オープン

#821 opened on 2024/02/27

 (3 件のコメント) (1 件のリアクション) (0 人の担当者)TypeScript (471 件のフォーク)batch import
buggood first issuehelp wanted

Repository metrics

Stars
 (12,328 個のスター)
PR merge metrics
 (平均マージ 3d 5h) (30d で 11 merged PRs)

説明

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: {}
}

コントリビューターガイド