"use strict";
/* Socket Lib - Built with rolldown */
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const require_smol_manifest = require('../../smol/manifest.js');
const require_eco_manifest_manifest_error = require('./manifest-error.js');
const require_eco_npm_parse_package_json = require('../npm/parse-package-json.js');

//#region src/eco/manifest/parse-manifest.ts
/**
* @file `parseManifest(content, ecosystem)` — dispatches to the right
*   per-ecosystem manifest parser. On socket-btm's smol Node binary this routes
*   to `node:smol-manifest`'s native `parseManifest`; on stock Node it
*   dispatches to `src/eco/<eco>/parse-manifest.ts` (or `parse-package-json.ts`
*   for npm). Throws `ManifestError(ERR_UNSUPPORTED)` for ecosystems with no
*   parser yet (e.g. `'composer'`).
*/
function jsParseManifest(content, ecosystem) {
	switch (ecosystem) {
		case "npm": return require_eco_npm_parse_package_json.parsePackageJson(content);
		default: throw new require_eco_manifest_manifest_error.ManifestError(`Unsupported ecosystem: ${ecosystem}`, "ERR_UNSUPPORTED");
	}
}
const _smol = /* @__PURE__ */ require_smol_manifest.getSmolManifest();
/* c8 ignore start - smol-fallback branch is smol Node binary only. */
const smolParseManifest = _smol ? (content, ecosystem) => _smol.parseManifest(content, ecosystem) : void 0;
/* c8 ignore stop */
const parseManifest = smolParseManifest ?? jsParseManifest;

//#endregion
exports.jsParseManifest = jsParseManifest;
exports.parseManifest = parseManifest;