sindresorhus/type-fest

`NonEmptyObject` fails for objects with dynamic properties

Open

#821 aperta il 27 feb 2024

Vedi su GitHub
 (3 commenti) (1 reazione) (0 assegnatari)TypeScript (471 fork)batch import
buggood first issuehelp wanted

Metriche repository

Star
 (12.328 star)
Metriche merge PR
 (Merge medio 4g 18h) (9 PR mergiate in 30 g)

Descrizione

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

Guida contributor