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