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

//#region src/eco/manifest/get-package.ts
/**
* @file `getPackage(lockfile, name)` — O(1) lookup of the first matching
*   `PackageRef` by name in a `ParsedLockfile`. Returns `undefined` when no
*   match exists. For multi-version names (where `_index[name]` is an array of
*   indices), returns the first occurrence. Use `getPackageVersions` to get all
*   of them.
*/
function jsGetPackage(lockfile, name) {
	const idx = lockfile._index[name];
	if (idx === void 0) return;
	if (typeof idx === "number") return lockfile.packages[idx];
	return lockfile.packages[idx[0]];
}
const _smol = /* @__PURE__ */ require_smol_manifest.getSmolManifest();
const getPackage = _smol ? _smol.getPackage : jsGetPackage;

//#endregion
exports.getPackage = getPackage;
exports.jsGetPackage = jsGetPackage;