sindresorhus/type-fest

`NonEmptyObject` fails for objects with dynamic properties

Ouverte

#821 ouverte le 27 févr. 2024

 (3 commentaires) (1 réaction) (0 personne assignée)TypeScript (471 forks)batch import
buggood first issuehelp wanted

Métriques du dépôt

Stars
 (12 328 étoiles)
Métriques de merge PR
 (Métriques PR en attente)

Description

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

Guide contributeur