Skip to main content
Module

x/actionify/config/deps.ts>objectKeys

Create and manage your GitHub workflows with TypeScript and Deno.
Latest
variable objectKeys
import { objectKeys } from "https://deno.land/x/actionify@0.3.0/config/deps.ts";

A strongly-typed version of Object.keys().

This is useful since Object.keys() always returns an array of strings. This function returns a strongly-typed array of the keys of the given object.

Examples

Example 1

import {objectKeys} from 'ts-extras';

const stronglyTypedItems = objectKeys({a: 1, b: 2, c: 3}); // => Array<'a' | 'b' | 'c'>
const untypedItems = Object.keys(items); // => Array<string>

type

<Type extends object>(value: Type) => `${Exclude<keyof Type, symbol>}`[]