Page Contents

Home > @loopback/repository > flattenMapByKeys

flattenMapByKeys() function

Returns an array of instances from the target map. The order of arrays is based on the order of sourceIds


export declare function flattenMapByKeys<T>(sourceIds: unknown[], targetMap: Map<unknown, T>): (T | undefined)[];


Parameter Type Description
sourceIds unknown[] One value or array of values (of the target key)
targetMap Map<unknown, T> a map that matches sourceIds with instances


(T | undefined)[]