1 function objectToUrlEncoded (obj: any) {
2 const str: string[] = []
3 for (const key of Object.keys(obj)) {
4 str.push(encodeURIComponent(key) + '=' + encodeURIComponent(obj[key]))
10 function copyToClipboard (text: string) {
11 const el = document.createElement('textarea')
13 el.setAttribute('readonly', '')
14 el.style.position = 'absolute'
15 el.style.left = '-9999px'
16 document.body.appendChild(el)
18 document.execCommand('copy')
19 document.body.removeChild(el)
22 function wait (ms: number) {
23 return new Promise<void>(res => {
24 setTimeout(() => res(), ms)