UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

19 lines (18 loc) • 778 B
//#region scripts/lib/npm-json-output.mts /** * Normalize npm <=11 entry/array JSON and npm 12 name-keyed JSON. * Keep pack consumers on one dependency-contract boundary so a package-manager * upgrade cannot silently bypass release, installer, or security checks. */ function resolveNpmJsonEntries(e) { if (Array.isArray(e)) return e; if (e && typeof e === "object") { if (!("id" in e && typeof e.id === "string" || "name" in e && typeof e.name === "string" || "version" in e && typeof e.version === "string" || "filename" in e && typeof e.filename === "string")) { const t = Object.values(e).filter((e) => Boolean(e) && typeof e === "object" && !Array.isArray(e)); if (t.length > 0) return t; } } return [e]; } //#endregion export { resolveNpmJsonEntries as t };