Added formData helper
All checks were successful
Build / Build NPM Project (push) Successful in 28s
Build / Tag Version (push) Successful in 7s

This commit is contained in:
2024-08-15 12:55:57 -04:00
parent 535fc0271e
commit 2d63db0ebb
3 changed files with 24 additions and 13 deletions

View File

@ -1,17 +1,5 @@
import {md5} from './string';
/**
* Convert data into a form encoded format.
*
* @param {any} data - data to convert
* @returns {string} - Ecodeded form data
*/
export function formEncode(data: any): string {
return Object.entries(data).map(([key, value]) =>
encodeURIComponent(key) + '=' + encodeURIComponent(<any>value)
).join('&');
}
/**
* Get profile image from Gravatar
*