sindresorhus/type-fest

`NonEmptyObject` fails for objects with dynamic properties

Open

#821 geöffnet am 27. Feb. 2024

Auf GitHub ansehen
 (3 Kommentare) (1 Reaktion) (0 zugewiesene Personen)TypeScript (12.328 Stars) (471 Forks)batch import
buggood first issuehelp wanted

Beschreibung

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

Contributor Guide