import{isObject as l}from"../../../utils/guards/is-object.js";function t(e){const r={};if(!l(e))return{error:"Keywords must be an object",result:null};if("includes"in e){if(!Array.isArray(e.includes))return{error:'Property "includes" must be an array',result:null};e.includes.length>0&&(r.includes=[...new Set(e.includes.map(n=>String(n)))])}if("excludes"in e){if(!Array.isArray(e.excludes))return{error:'Property "excludes" must be an array',result:null};e.excludes.length>0&&(r.excludes=[...new Set(e.excludes.map(n=>String(n)))])}return r.excludes||r.includes?{error:null,result:r}:{error:"Keywords must have at least one non-empty array (includes or excludes)",result:null}}export{t as normalizeFrontmatterKeywords};
