//#region src/utils/mergeWith.ts
function mergeWith(obj, source, customizer) {
	if (typeof customizer !== "function") throw new Error("Customizer must be a function");
	if (!isObject(obj) || !isObject(source)) return obj;
	for (const key in source) if (Object.prototype.hasOwnProperty.call(source, key)) {
		const objValue = obj[key];
		const srcValue = source[key];
		const customValue = customizer(objValue, srcValue, key, obj, source);
		if (customValue === void 0) if (isObject(objValue) && isObject(srcValue)) obj[key] = mergeWith(objValue, srcValue, customizer);
		else obj[key] = srcValue;
		else obj[key] = customValue;
	}
	return obj;
}
function isObject(value) {
	return value && typeof value === "object" && !Array.isArray(value);
}
//#endregion
exports.mergeWith = mergeWith;
