eve
Version:
Filesystem-first framework for durable backend AI agents that run anywhere.
1 lines • 795 B
JavaScript
function parseExtensionPackageRoots(e){if(typeof e!=`object`||!e||Array.isArray(e))return null;let t=e;if(typeof t.dist!=`string`||t.dist.length===0)return null;let n=parseExternalDependencies(t.externalDependencies);if(n===null)return null;let r={dist:t.dist};return n!==void 0&&(r.externalDependencies=n),t.source===void 0?r:typeof t.source==`string`&&t.source.length>0?{...r,source:t.source}:null}function parseBuiltInExtensionPackageRoots(e,t){return typeof e!=`object`||!e||Array.isArray(e)?null:parseExtensionPackageRoots(e[t])}function parseExternalDependencies(e){if(e===void 0)return;if(!Array.isArray(e))return null;let t=new Set;for(let n of e){if(typeof n!=`string`||n.length===0)return null;t.add(n)}return[...t]}export{parseBuiltInExtensionPackageRoots,parseExtensionPackageRoots};