const require_writeFileIfChanged = require('./writeFileIfChanged.cjs');

//#region ../@intlayer/chokidar/dist/esm/writeJsonIfChanged.mjs
const writeJsonIfChanged = async (path, data, { pretty = true } = {}) => {
	const space = pretty ? 2 : void 0;
	let json = "{}";
	try {
		json = JSON.stringify(data, null, space);
	} catch (error) {
		console.error(`Error while parsing data to JSON for ${path}:`, error);
	}
	return await require_writeFileIfChanged.writeFileIfChanged(path, json);
};

//#endregion
exports.writeJsonIfChanged = writeJsonIfChanged;
//# sourceMappingURL=writeJsonIfChanged.cjs.map