import { z } from "zod";
//#region src/contracts/validators/shared.ts
const NunjucksFilterMapSchema = z.record(z.string(), z.custom((v) => typeof v === "function"));
/**
* Zod schema accepting a string or a function.
* Used for transform fields that accept inline JS expressions, file:// references,
* or direct functions when using the Node.js package.
*/
const StringOrFunctionSchema = z.union([z.string(), z.custom((val) => typeof val === "function", { message: "Transform must be a string expression, file:// path, or a function (Node.js package)" })]);
//#endregion
//#region src/util/fileExtensions.ts
/**
* Array of supported JavaScript and TypeScript file extensions
*/
const JAVASCRIPT_EXTENSIONS = [
	"js",
	"cjs",
	"mjs",
	"ts",
	"cts",
	"mts"
];
/**
* Checks if a file is a JavaScript or TypeScript file based on its extension.
*
* @param filePath - The path of the file to check.
* @returns True if the file has a JavaScript or TypeScript extension, false otherwise.
*/
function isJavascriptFile(filePath) {
	return new RegExp(`\\.(${JAVASCRIPT_EXTENSIONS.join("|")})$`).test(filePath);
}
/**
* Checks if a file is an image file based on its extension. Non-exhaustive list.
*
* @param filePath - The path of the file to check.
* @returns True if the file has an image extension, false otherwise.
*/
function isImageFile(filePath) {
	const imageExtensions = [
		"jpg",
		"jpeg",
		"png",
		"gif",
		"bmp",
		"webp",
		"svg"
	];
	const fileExtension = filePath.split(".").pop()?.toLowerCase() || "";
	return imageExtensions.includes(fileExtension);
}
/**
* Checks if a file is a video file based on its extension. Non-exhaustive list.
*
* @param filePath - The path of the file to check.
* @returns True if the file has a video extension, false otherwise.
*/
function isVideoFile(filePath) {
	const videoExtensions = [
		"mp4",
		"webm",
		"ogg",
		"mov",
		"avi",
		"wmv",
		"mkv",
		"m4v"
	];
	const fileExtension = filePath.split(".").pop()?.toLowerCase() || "";
	return videoExtensions.includes(fileExtension);
}
/**
* Checks if a file is an audio file based on its extension. Non-exhaustive list.
*
* @param filePath - The path of the file to check.
* @returns True if the file has an audio extension, false otherwise.
*/
function isAudioFile(filePath) {
	const audioExtensions = [
		"wav",
		"mp3",
		"ogg",
		"aac",
		"m4a",
		"flac",
		"wma",
		"aiff",
		"opus"
	];
	const fileExtension = filePath.split(".").pop()?.toLowerCase() || "";
	return audioExtensions.includes(fileExtension);
}
//#endregion
export { isVideoFile as a, isJavascriptFile as i, isAudioFile as n, NunjucksFilterMapSchema as o, isImageFile as r, StringOrFunctionSchema as s, JAVASCRIPT_EXTENSIONS as t };

//# sourceMappingURL=shared-CFydRuD8.js.map