You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
2 lines
343 B
2 lines
343 B
const i=/^(\d|\.)+$/,n=/(\d|\.)+/;function f(r,{c:u=1,offset:t=0,attachPx:s=!0}={}){if(typeof r=="number"){const e=(r+t)*u;return e===0?"0":`${e}px`}else if(typeof r=="string")if(i.test(r)){const e=(Number(r)+t)*u;return s?e===0?"0":`${e}px`:`${e}`}else{const e=n.exec(r);return e?r.replace(n,String((Number(e[0])+t)*u)):r}return r}export{f};
|