@alanscodelog/utils
    Preparing search index...

    Function override

    • Like a deep spread of all the objects passed.

      Similar to merge but only plain objects are deep merged, everything else (including arrays) aren't. If the key exists in the base object it's overwritten.

      The first object is mutated so clone it first if you don't want it mutated. Passing {} as the first param will also work but only for shallow objects.

      	override(base, config) // mutates base
      const merged = override({}, base, config) // mutates nothing

      The output type can be overriden using the first type parameter. Pass never to it to use the default output type.

      Type Parameters

      • TOutput extends unknown = unknown
      • TBase extends Record<string, any> = Record<string, any>
      • TOthers extends Record<string, any>[] = Record<string, any>[]
      • TOther extends Record<string, any> = TOthers[number]

      Parameters

      Returns TOutput extends Record<any, any> ? TOutput<TOutput> : TBase & TOther