@pengzhanbo/utils - v3.7.3
    Preparing search index...

    Function deepMerge

    • Deep merge

      The first argument is the target object, the rest are the sources. The target object will be mutated and returned.

      深度合并

      第一个参数是目标对象,其余的是源对象。 目标对象将被修改并返回。

      Type Parameters

      Parameters

      • target: T

        The target object / 目标对象

      • ...sources: S[]

        The source objects / 源对象

      Returns MergeInsertions<
          {
              [K in string
              | number
              | symbol]: K extends keyof S & keyof T
                  ? MergeInsertions<
                      {
                          [K in string
                          | number
                          | symbol]: K extends keyof S[K] & keyof T[K]
                              ? MergeInsertions<
                                  {
                                      [K in string
                                      | number
                                      | symbol]: K extends keyof (...) & keyof (...)
                                          ? MergeInsertions<{ [K in (...)]: (...) }>
                                          : K extends keyof (...)
                                              ? (...)[(...)]
                                              : (...) extends (...) ? (...) : (...)
                                  },
                              >
                              : K extends keyof S[K]
                                  ? S[K][K]
                                  : K extends keyof T[K] ? T[K][K] : never
                      },
                  >
                  : K extends keyof S ? S[K] : K extends keyof T ? T[K] : never
          },
      >

      The merged object / 合并后的对象

      This function mutates the target object in place and returns it. Dangerous keys (__proto__, constructor, prototype) are silently filtered out and not merged. Only plain objects (those with Object.prototype or null as prototype) are deep-merged; other types (e.g., arrays, Date, Map, Set) are replaced rather than merged. For array-aware merging, use deepMergeWithArray instead.

      此函数会直接修改目标对象并将其返回。 危险键(__proto__constructorprototype)会被静默过滤,不会参与合并。 只有普通对象(原型为 Object.prototypenull 的对象)会进行深度合并;其他类型(如数组、Date、Map、Set)会被直接替换。 如需合并数组,请使用 deepMergeWithArray