Skip to main content

Built and signed on GitHub Actions

♻️ Iterable and AsyncIterable utilities.

This package works with Cloudflare Workers, Node.js, Deno, Bun, Browsers
This package works with Cloudflare Workers
This package works with Node.js
This package works with Deno
This package works with Bun
This package works with Browsers
JSR Score
100%
Published
2 weeks ago (0.3.2)
function entriesToObject
entriesToObject<Item extends Entry>(iterable: AwaitableIterable<Item>): Promise<ReadonlyRecord<EntryKey<Item>, EntryValue<Item>>>

Takes an entries iterable or asynchronous iterable and returns an object.

Examples

Example 1

entriesToObject([["key", "value"]]); // { key: "value" }
entriesToObject([
	["foo", "bar"],
	["number", 1]
]); // { foo: "bar", number: 1 }

Type Parameters

Item extends Entry

Parameters

iterable: AwaitableIterable<Item>

Return Type

Promise<ReadonlyRecord<EntryKey<Item>, EntryValue<Item>>>

Object constructed from entries.

Add Package

deno add jsr:@coven/iterables

Import symbol

import { entriesToObject } from "@coven/iterables/async";

---- OR ----

Import directly with a jsr specifier

import { entriesToObject } from "jsr:@coven/iterables/async";

Add Package

npx jsr add @coven/iterables

Import symbol

import { entriesToObject } from "@coven/iterables/async";

Add Package

yarn dlx jsr add @coven/iterables

Import symbol

import { entriesToObject } from "@coven/iterables/async";

Add Package

pnpm dlx jsr add @coven/iterables

Import symbol

import { entriesToObject } from "@coven/iterables/async";

Add Package

bunx jsr add @coven/iterables

Import symbol

import { entriesToObject } from "@coven/iterables/async";