"use strict";
/* Socket Lib - Built with rolldown */
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const require_primordials_string = require('../primordials/string.js');

//#region src/archives/detect.ts
/**
* @file Format detection by file extension.
*/
/**
* Detect archive format from file path.
*
* @example
*   ;```typescript
*   detectArchiveFormat('package.tar.gz') // 'tar.gz'
*   detectArchiveFormat('archive.zip') // 'zip'
*   detectArchiveFormat('data.csv') // undefined
*   ```
*
* @param filePath - Path to archive file.
*
* @returns Archive format or undefined if unknown
*/
function detectArchiveFormat(filePath) {
	const lower = filePath.toLowerCase();
	if (require_primordials_string.StringPrototypeEndsWith(lower, ".tar.gz")) return "tar.gz";
	if (require_primordials_string.StringPrototypeEndsWith(lower, ".tgz")) return "tgz";
	if (require_primordials_string.StringPrototypeEndsWith(lower, ".tar")) return "tar";
	if (require_primordials_string.StringPrototypeEndsWith(lower, ".zip")) return "zip";
}

//#endregion
exports.detectArchiveFormat = detectArchiveFormat;