Skip to main content
Module

x/nameable/deps.ts>keys

Cross-check whether it can be used as a package name or domain name
Latest
variable keys
import { keys } from "https://deno.land/x/nameable@v1.1.0-beta.4/deps.ts";

Returns the names of the enumerable string properties and methods of an object.

Examples

Example 1

keys({}) // []
keys({ 'a': 'b' }) // ['a']
keys({ 0: 'hello', 1: 'world' }) // ['0', '1']

type

<T extends PropertyKey>(val: Record<T, unknown>) => string[]