keys

Commons
stable

Type-safe wrapper around Object.keys(). Returns the keys of a plain object typed as (keyof O)[] instead of string[], preserving the original key union.

API

Signature

Signature TypeScript complète, extraite du fichier util.

typescript

API

Paramètres

Paramètres d'entrée acceptés par cet util.

o
requis
O
The object whose keys are returned. The generic O is inferred from the argument.

API

Valeur de retour

La valeur retournée par cet util.

An array of the object's own enumerable property keys, typed as (keyof O)[].

Usage

Exemples

Extraits de code prêts à coller.

Type-safe key iteration

typescript