Closed ifiokjr closed 3 years ago
A typed implementation of Object.keys().
Object.keys()
This is useful since Object.keys() returns an array of strings. This function returns an array of the type keys of the given object.
@example
import {objectKeys} from 'ts-extras'; type Item = ['a', 'b', 'c']; declare let: items: Item[]; items = objectKeys({a: 1, b: 2, c: 3}); // This is valid.
Thanks :)
Description
A typed implementation of
Object.keys()
.This is useful since
Object.keys()
returns an array of strings. This function returns an array of the type keys of the given object.@example