it-tools/dist/client/assets/chunks/chunk-567e13ca.js

2 lines
601 B
JavaScript
Raw Normal View History

2024-04-28 00:48:29 +08:00
function i(t){return typeof t=="string"?t.endsWith("px")?Number(t.slice(0,t.length-2)):Number(t):t}function f(t){if(t!=null)return typeof t=="number"?`${t}px`:t.endsWith("px")?t:`${t}px`}function o(t,n){const r=t.trim().split(/\s+/g),e={top:r[0]};switch(r.length){case 1:e.right=r[0],e.bottom=r[0],e.left=r[0];break;case 2:e.right=r[1],e.left=r[1],e.bottom=r[0];break;case 3:e.right=r[1],e.bottom=r[2],e.left=r[1];break;case 4:e.right=r[1],e.bottom=r[2],e.left=r[3];break;default:throw new Error("[seemly/getMargin]:"+t+" is not a valid value.")}return n===void 0?e:e[n]}export{i as d,o as g,f as p};