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

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

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