UNPKG

date-and-time

Version:

The simplest, most intuitive date and time library

2 lines (1 loc) 470 B
class S{}const e=(S,e,t)=>{const n=S.exec(e)?.[0]??"";return{value:+n,length:n.length,token:t}};const t=new class extends S{SSSSSSS(S){const t=e(/^\d{1,7}/,S,"S");return t.value=Math.trunc(t.value/1e4),t}SSSSSSSS(S){const t=e(/^\d{1,8}/,S,"S");return t.value=Math.trunc(t.value/1e5),t}SSSSSSSSS(S){const t=e(/^\d{1,9}/,S,"S");return t.value=Math.trunc(t.value/1e6),t}F(S){return e(/^\d/,S)}FF(S){return e(/^\d\d?/,S)}FFF(S){return e(/^\d{1,3}/,S)}};export{t as parser};