Hyperlinkv0.8.0-beta.28

Trie

Trie.toEntriesconsteffect/Trie.ts:290
<V>(self: Trie<V>): Array<[string, V]>

Returns an Array<[string, V]> of the entries within the Trie.

Details

Equivalent to Array.from(Trie.entries(trie)).

Example (Converting entries to an array)

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

const trie = Trie.empty<number>().pipe(
  Trie.insert("call", 0),
  Trie.insert("me", 1)
)
const result = Trie.toEntries(trie)

assert.deepStrictEqual(result, [["call", 0], ["me", 1]])
getters
Source effect/Trie.ts:2901 lines
export const toEntries = <V>(self: Trie<V>): Array<[string, V]> => Array.from(entries(self))