UNPKG

date-and-time

Version:

The simplest, most intuitive date and time library

2 lines (1 loc) 210 B
const e="٠١٢٣٤٥٦٧٨٩",a=e.split(""),c=Object.fromEntries(a.map((e,a)=>[e,""+a]));var p={encode:e=>e.replace(/\d/g,e=>a[+e]),decode:a=>a.replace(new RegExp(`[${e}]`,"g"),e=>c[e])};export{p as default};