"use strict";
/* Socket Lib - Built with esbuild */
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var analyze_lockfile_exports = {};
__export(analyze_lockfile_exports, {
  analyzeLockfile: () => analyzeLockfile,
  jsAnalyzeLockfile: () => jsAnalyzeLockfile
});
module.exports = __toCommonJS(analyze_lockfile_exports);
var import_object = require("../../primordials/object");
var import_manifest = require("../../smol/manifest");
function jsAnalyzeLockfile(lockfile) {
  let prodDeps = 0;
  let devDeps = 0;
  let optionalDeps = 0;
  const pkgs = lockfile.packages;
  for (let i = 0, { length } = pkgs; i < length; i++) {
    switch (pkgs[i].depType) {
      case "prod":
        prodDeps++;
        break;
      case "dev":
        devDeps++;
        break;
      case "optional":
        optionalDeps++;
        break;
    }
  }
  return (0, import_object.ObjectFreeze)({
    __proto__: null,
    totalPackages: pkgs.length,
    prodDeps,
    devDeps,
    optionalDeps,
    byEcosystem: (0, import_object.ObjectFreeze)({
      __proto__: null,
      [lockfile.ecosystem]: pkgs.length
    }),
    maxDepth: 0,
    avgDepth: 0
  });
}
const _smol = (0, import_manifest.getSmolManifest)();
const analyzeLockfile = _smol ? _smol.analyzeLockfile : jsAnalyzeLockfile;
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  analyzeLockfile,
  jsAnalyzeLockfile
});
