# atom.io/foundations/entries

Source: docs/source/pages/docs/foundations/entries.mdx
URL: /docs/foundations/entries

# <low-emphasis>atom.io</low-emphasis>/foundations/entries

Typed wrappers for object entry round-trips.

They are most useful when you want to map over an object as entries and rebuild it while
preserving the relationship between each key and its value type.

### typed entries
Source: docs/source/exhibits/foundations/entries/typed-entries.ts

```ts
import { fromEntries, toEntries } from "atom.io/foundations/entries"

const flags = {
	visible: true,
	locked: false,
}

const entries = toEntries(flags)
const rebuilt = fromEntries(entries)
```

## package contents

<table-wrapper>

| Export | Description |
| --- | --- |
| `Entries` | Tuples of `[key, value]` pairs. |
| `KeyOfEntries` | The union of keys in an entries array. |
| `ValueOfEntry` | The value type associated with a particular entry key. |
| `FromEntries` | The object type represented by an entries array. |
| `fromEntries` | Typed form of `Object.fromEntries`. |
| `ToEntries` | The entries type represented by an object. |
| `toEntries` | Typed form of `Object.entries`. |

</table-wrapper>

These helpers do not change runtime behavior. They improve the TypeScript type returned
from the standard object entry operations.

Because TypeScript is duck-typed, `toEntries` can still receive an object with runtime
properties that were not represented in the type you thought you had. Treat the improved
typing as a round-trip helper, not as a runtime validator.
