Hyperlinkv0.8.0-beta.28

Record

Record.keysconsteffect/Record.ts:1004
<K extends string | symbol, A>(self: ReadonlyRecord<K, A>): Array<
  K & string
>

Retrieves the keys of a given record as an array.

Example (Getting record keys)

import { Record } from "effect"
import * as assert from "node:assert"

assert.deepStrictEqual(Record.keys({ a: 1, b: 2, c: 3 }), ["a", "b", "c"])
getters
Source effect/Record.ts:10042 lines
export const keys = <K extends string | symbol, A>(self: ReadonlyRecord<K, A>): Array<K & string> =>
  Object.keys(self) as Array<K & string>
Referenced by 19 symbols