remeda
Version:
A utility library for JavaScript and Typescript.
2 lines • 401 B
JavaScript
import{purry as e}from"./purry-DH9cw9sy.js";function t(...t){return e(n,t)}const n=(e,t,n)=>typeof e==`string`?r([...e],t,n).join(``):r(e,t,n);function r(e,t,n){let r=[...e];if(Number.isNaN(t)||Number.isNaN(n))return r;let i=t<0?e.length+t:t,a=n<0?e.length+n:n;return i<0||i>e.length||a<0||a>e.length?r:(r[i]=e[a],r[a]=e[i],r)}export{t as swapIndices};
//# sourceMappingURL=swapIndices-CdiMBHT2.js.map