Skip to content

entriesOf

Size
0.08 kb
View source

Same as Object.entries but with proper types.

import { entriesOf } from 'crustack/utils'
const object = { a: 1, b: '' }
const entries = entriesOf(object)
// Array<['a', number] | ['b', string]>
const entries = Object.entries(object)
// Array<[string, string | number]>