sindresorhus/type-fest

`NonEmptyObject` fails for objects with dynamic properties

Open

#821 创建于 2024年2月27日

在 GitHub 查看
 (3 评论) (1 反应) (0 负责人)TypeScript (12,328 star) (471 fork)batch import
buggood first issuehelp wanted

描述

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

贡献者指南

`NonEmptyObject` fails for objects with dynamic properties · sindresorhus/type-fest#821 | Good First Issue