metarhia / metautil

Metarhia utilities 🧰
https://metarhia.com
MIT License
100 stars 25 forks source link

Compose async collection #213

Closed tshemsedinov closed 11 months ago

tshemsedinov commented 11 months ago
const skills = collect(['frontend', 'backend', 'databases', 'testing']);
const specialist = collect(['fullName', 'profession', 'skills']);
specialist.collect({ skills });
// add keys somehow
const profile = await specialist;

Output:

{
  fullName: 'Marcus Aurelius',
  profession: 'Full stack developer',
  skills: {
    frontend: true,
    backend: true,
    databases: false,
    testing: true,
  }
}