import { existsSync, mkdirSync } from "node:fs";
import { normalizePath } from "@intlayer/config";
import fg from "fast-glob";

//#region ../chokidar/dist/esm/createDictionaryEntryPoint/getBuiltFetchDictionariesPath.mjs
/**
* This function generates a list of dictionaries in the main directory
*/
const getBuiltFetchDictionariesPath = async (configuration, format = "esm") => {
	const { fetchDictionariesDir, mainDir } = configuration.content;
	if (!existsSync(mainDir)) mkdirSync(mainDir, { recursive: true });
	const extension = format === "cjs" ? "cjs" : "mjs";
	return await fg(`${normalizePath(fetchDictionariesDir)}/**/*.${extension}`);
};

//#endregion
export { getBuiltFetchDictionariesPath };
//# sourceMappingURL=getBuiltFetchDictionariesPath.mjs.map