This repository has been archived on 2024-07-22. You can view files and clone it, but cannot push or open issues or pull requests.
Zaimki/src/helpers.js

16 lines
315 B
JavaScript

export const buildDict = (fn, ...args) => {
const dict = {};
for (let [key, value] of fn(...args)) {
dict[key] = value;
}
return dict;
}
export const buildList = (fn, ...args) => {
const list = [];
for (let value of fn(...args)) {
list.push(value);
}
return list;
}