Skip to content

Instantly share code, notes, and snippets.

View BlackyWolf's full-sized avatar
🏠
Working from home

Blacky Wolf BlackyWolf

🏠
Working from home
View GitHub Profile
@BlackyWolf
BlackyWolf / formDataToObject.ts
Created July 8, 2022 01:38
A series of function that help convert the FormData object into a usable model.
// deno-lint-ignore-file no-explicit-any
/**
* Checks if the array value being assigned to the property is for simple value
* types, e.g. `String`, `Number`, `Boolean`, etc. or for complex types like
* `Object`.
*
* @param name The name of the property on the model object.
*
* @returns `True` if the property is a primitive array, otherwise `false`.