UNPKG

alinea

Version:

[![npm](https://img.shields.io/npm/v/alinea.svg)](https://npmjs.org/package/alinea) [![install size](https://packagephobia.com/badge?p=alinea)](https://packagephobia.com/result?p=alinea)

36 lines (34 loc) 883 B
import "../../chunks/chunk-U5RRZUYZ.js"; // src/core/util/LazyRecord.ts import { Lazy } from "./Lazy.js"; var LazyRecord; ((LazyRecord2) => { function iterate(collection) { return Object.entries(Lazy.get(collection)).map(([key, value]) => [ key, Lazy.get(value) ]); } LazyRecord2.iterate = iterate; function concat(a, b) { return () => { return Object.assign({}, resolve(a), resolve(b)); }; } LazyRecord2.concat = concat; function resolve(collection) { return Object.fromEntries(LazyRecord2.iterate(collection)); } LazyRecord2.resolve = resolve; function keys(collection) { return Object.keys(Lazy.get(collection)); } LazyRecord2.keys = keys; function get(collection, key) { return Lazy.get(Lazy.get(collection)[key]); } LazyRecord2.get = get; })(LazyRecord || (LazyRecord = {})); export { LazyRecord };