ant-design-x-vue-next
Version:
Ant Design X for Vue — community continuation aligned with @ant-design/x
2 lines (1 loc) • 955 B
JavaScript
;Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function u(e,i){return i.replace(/^\//,"").split("/").reduce((t,s)=>t!=null?t[s]:void 0,e)}function l(e,i,o){const t=i.replace(/^\//,"").split("/"),s={...e};let r=s;for(let n=0;n<t.length-1;n++)r[t[n]]=r[t[n]]?{...r[t[n]]}:{},r=r[t[n]];return r[t[t.length-1]]=o,s}function a(e){return typeof e=="string"&&e.startsWith("/")}function f(e){return e!==null&&typeof e=="object"&&typeof e.path=="string"}function p(e,i,o){const t=[];if(!(e!=null&&e.components))return{valid:!0,errors:[]};const s=e.components[i];if(!s)return t.push(`Component "${i}" is not defined in catalog`),{valid:!1,errors:t};const r=s.required||[];for(const n of r)n in o||t.push(`Missing required field "${n}" for component "${i}"`);return{valid:t.length===0,errors:t}}exports.getValueByPath=u;exports.isPathObject=f;exports.isPathValue=a;exports.setValueByPath=l;exports.validateComponentAgainstCatalog=p;