UNPKG

rc-js-util

Version:

A collection of TS and C++ utilities to help writing performant and correct applications, achieved through strict typing and (removable) invariant checking.

92 lines (43 loc) 1.22 kB
<!-- Do not edit this file. It is automatically generated by API Documenter. --> [Home](./index.md) &gt; [rc-js-util](./rc-js-util.md) &gt; [mapRemoveManyFromArray](./rc-js-util.mapremovemanyfromarray.md) ## mapRemoveManyFromArray() function Used with maps that store arrays. Where an array exists for a given key the values will be removed from that array. **Signature:** ```typescript export declare function mapRemoveManyFromArray<TKey, TValue>(map: Map<TKey, TValue[]>, key: TKey, itemsToRemove: TValue[]): number; ``` ## Parameters <table><thead><tr><th> Parameter </th><th> Type </th><th> Description </th></tr></thead> <tbody><tr><td> map </td><td> Map&lt;TKey, TValue\[\]&gt; </td><td> The `Map` to check. May be modified. </td></tr> <tr><td> key </td><td> TKey </td><td> The key to lookup in `map`<!-- -->. </td></tr> <tr><td> itemsToRemove </td><td> TValue\[\] </td><td> The values to remove. </td></tr> </tbody></table> **Returns:** number The number of items that were removed. ## Remarks See [mapRemoveManyFromArray()](./rc-js-util.mapremovemanyfromarray.md)<!-- -->.