Skip to content

webshrine / stdlib/src / symbols

Function: symbols()

symbols<T>(object): { [K in string | number | symbol]: K extends symbol ? K<K> : never }[keyof T][]

Returns an array of symbol keys for the given object.

Type Parameters

T extends AnyObject

Parameters

object

T

Returns

{ [K in string | number | symbol]: K extends symbol ? K<K> : never }[keyof T][]

Example

ts
symbols({ a: 1, b: 2, [Symbol('c')]: 3 }) // [Symbol(c)]

Defined in

packages/stdlib/src/transformers/common.ts:37