//#region src/config/diff.ts
/**
* Configuration diff utilities
*/
/**
* Check if value is a plain object
*/
function isPlainObject(value) {
	if (value === null || value === void 0 || typeof value !== "object") return false;
	return Object.getPrototypeOf(value) === Object.prototype;
}
/**
* Deep compare two values and return list of changed paths
*/
function diffConfigPaths(prev, next, prefix = "") {
	if (prev === next) return [];
	if (isPlainObject(prev) && isPlainObject(next)) {
		const keys = new Set([...Object.keys(prev), ...Object.keys(next)]);
		const paths = [];
		for (const key of keys) {
			const prevValue = prev[key];
			const nextValue = next[key];
			if (prevValue === nextValue) continue;
			const childPaths = diffConfigPaths(prevValue, nextValue, prefix ? `${prefix}.${key}` : key);
			paths.push(...childPaths);
		}
		return paths;
	}
	if (Array.isArray(prev) && Array.isArray(next)) {
		if (prev.length !== next.length) return [prefix || "<root>"];
		for (let i = 0; i < prev.length; i++) if (diffConfigPaths(prev[i], next[i], prefix).length > 0) return [prefix || "<root>"];
		return [];
	}
	return [prefix || "<root>"];
}
//#endregion
export { diffConfigPaths };

//# sourceMappingURL=diff.js.map