UNPKG

nanolith

Version:

Multi-threading in no time with seamless TypeScript support.

1 lines 344 B
export const createKey=({name:e,start:t,end:a})=>`${e}(${t},${a});`;export const parseKey=e=>{const[t,a]=e.match(/(?<=\()\d+|\d+(?=\))/g),[c]=e.match(/.*(?=\(\d+,\d+\);)/);return{name:c,start:+t,end:+a}};export const createKeyRegex=(e,t="g")=>new RegExp(`${e}\\(\\d+,\\d+\\);`,t);export const matchKey=(e,t)=>e.match(createKeyRegex(t,""))?.[0];