to-typed
Version:
Type-guards, casts and converts unknowns into typed values
13 lines (12 loc) • 461 B
TypeScript
import { Collection } from "./types";
export declare class Utils {
static mapLazy<S, C extends Collection<S> = Collection<S>>(container: C): <T>(map: (value: S, key: string) => T) => {
[I in keyof C]: T;
};
static mapEager<S, T, C extends Collection<S>>(container: C, map: (value: S, key: string) => T): {
[I in keyof C]: T;
};
static fromEntries<T>(entries: [keyof any, T][]): {
[s: string]: T;
};
}