Move software files one directory up, Readme
This commit is contained in:
16
backend/scripts/validateHelper.ts
Normal file
16
backend/scripts/validateHelper.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
/**
|
||||
* Validates a string for undefined and length
|
||||
*
|
||||
* @param string String to prove
|
||||
* @param length Minimal length of string
|
||||
*
|
||||
* @returns True if valid
|
||||
*/
|
||||
export function validateString(string: string, length: number = 0) : boolean {
|
||||
if (string != undefined) {
|
||||
if (string.length >= length)
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
Reference in New Issue
Block a user