Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "map/merge"

Index

Functions

Functions

merge

  • merge<T, U, V, Y>(first: Map<T, U>, second: Map<V, Y>): Map<T | V, U | Y>
  • Merges two maps


    Example usage:

    import { merge } from "@thalesrc/js-utils/map";
    
    const first = new Map();
    first.set("a", 1);
    
    const second = new Map();
    second.set("b", 2);
    
    merge(first, second); // [{key: "a", value: 1}, {key: "b", value: 2}]

    Type parameters

    • T

    • U

    • V

    • Y

    Parameters

    • first: Map<T, U>

      First map

    • second: Map<V, Y>

      Second map

    Returns Map<T | V, U | Y>

    A new merged map

Generated using TypeDoc