@scalar/openapi-parser
Version:
modern OpenAPI parser written in TypeScript
21 lines • 747 B
TypeScript
/**
* Deep merges two objects, combining their properties recursively.
*
* ⚠️ Note: This operation assumes there are no key collisions between the objects.
* @param a - Target object to merge into
* @param b - Source object to merge from
* @returns The merged object (mutates and returns a)
*
* @example
* // Simple merge
* const a = { name: 'John' }
* const b = { age: 30 }
* mergeObjects(a, b) // { name: 'John', age: 30 }
*
* // Nested merge
* const a = { user: { name: 'John' } }
* const b = { user: { age: 30 } }
* mergeObjects(a, b) // { user: { name: 'John', age: 30 } }
*/
export declare const mergeObjects: <R>(a: Record<string, unknown>, b: Record<string, unknown>) => R;
//# sourceMappingURL=merge-objects.d.ts.map