feat: FromEntries
This commit is contained in:
parent
d9da7de6d0
commit
84affcbc64
|
@ -19,6 +19,7 @@ export {
|
|||
export {
|
||||
baseClass,
|
||||
map as mapObject,
|
||||
fromEntries as objectFromEntries,
|
||||
} from './object';
|
||||
export {PropertyMixin as Property} from './property';
|
||||
export {TickingPromise} from './ticking-promise';
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
export const baseClass = class {};
|
||||
|
||||
export function fromEntries(entries) {
|
||||
return entries.reduce((r, [k, v]) => ({...r, [k]: v}), {});
|
||||
}
|
||||
|
||||
export function map(O, fn) {
|
||||
const keys = Object.keys(O);
|
||||
const result = {};
|
||||
|
|
Loading…
Reference in New Issue
Block a user