UNPKG

@progress/kendo-vue-common

Version:

Kendo UI for Vue Common Utilities package

9 lines (8 loc) 1.25 kB
/** * @license *------------------------------------------------------------------------------------------- * Copyright © 2025 Progress Software Corporation. All rights reserved. * Licensed under commercial license. See LICENSE.md in the package root for more information *------------------------------------------------------------------------------------------- */ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function g(e,t,n){return n?{...e,[t]:n.length?[...n]:void 0}:e&&e[t]?[...e[t]]:[]}function s(e,t,n){if(e[t]){const o=g(e,t).map(r=>s(r,t,n));return n(g(e,t,o))}return n(e)}const f=(e,t,n)=>[...e.map(o=>s(o,t,n))],i=(e,t,n,o)=>{let r=e;const c=[];for(let a=0;a<t.length;a++)r=r[t[a]],r=Array.isArray(r)?r:r[n],c.push(r);const h=c.length>1?c[c.length-2]:e,p=t[t.length-1],u=o(h[p]);h.splice(p,1,u)},l=(e,t,n)=>Object.assign({},e,e[t]?{[t]:e[t].slice()}:{},n||{}),T=(e,t,n)=>{const o=[],r=[...t];if(r.length){let c=e[r.shift()||0];for(o.push(c);r.length&&n;)c=c[n][r.shift()||0],o.push(c)}return o};function y(e,t){const n=e.split(".");let o=t;return n.forEach(r=>{o=o?o[r]:void 0}),o}exports.extendDataItem=l;exports.getItemPath=T;exports.getNestedValue=y;exports.mapTree=f;exports.mapTreeItem=i;