Function mergeInto

  • Shallowly merges an object into 'objToMergeInto, overriding the properties of objToMergeInto` in case of conflict.

    Example

    import * as P from "flurp/pojo";

    const mergeIntoXZ = P.mergeInto({ x: 2, z: 4 });
    mergeIntoXZ({ x: 3, y: 5 }); // { x: 3, y: 5, z: 4 }

    Type Parameters

    • T extends Readonly<Record<string, unknown>>

    • U extends Readonly<Record<string, unknown>>

    Parameters

    • objToMergeInto: U

    Returns ((obj: T) => U & T)

      • (obj: T): U & T
      • Parameters

        • obj: T

        Returns U & T