typescript migration

This commit is contained in:
realaravinth
2021-05-01 19:22:44 +05:30
parent 90424219f5
commit 9c6398a7c5
55 changed files with 857 additions and 921 deletions

View File

@@ -15,7 +15,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
const genJsonPayload = payload => {
const genJsonPayload = (payload: any) => {
let value = {
method: 'POST',
headers: {

View File

@@ -15,9 +15,12 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
const isBlankString = (event, value, field) => {
const isBlankString = (event: Event|null, value: string|number, field: string) => {
value = value.toString();
if (!value.replace(/\s/g, '').length) {
event.preventDefault();
if (event) {
event.preventDefault();
}
alert(`${field} can't be empty`);
}
};