//#region components/file-card/utils.ts
function getSize(size) {
	let retSize = size;
	const units = [
		"B",
		"KB",
		"MB",
		"GB",
		"TB",
		"PB",
		"EB"
	];
	let unitIndex = 0;
	while (retSize >= 1024 && unitIndex < units.length - 1) {
		retSize /= 1024;
		unitIndex += 1;
	}
	return `${retSize.toFixed(0)} ${units[unitIndex]}`;
}
function matchExt(suffix, ext) {
	return ext.some((item) => suffix.toLowerCase() === `.${item}`);
}
//#endregion
export { getSize, matchExt };
