-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
30 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
export interface Scope { | ||
erro: boolean; | ||
to: string; | ||
text: string; | ||
} | ||
|
||
function infoType(data: string, type: string) { | ||
return typeof data === type ? true : false; | ||
} | ||
export function checkValuesSender(data: any) { | ||
if (Array.isArray(data)) { | ||
for (let i in data) { | ||
let result = | ||
data[i].type && data[i].value && infoType(data[i].value, data[i].type) | ||
? true | ||
: false; | ||
if (!result) { | ||
return { | ||
erro: true, | ||
param: data[i].param, | ||
function: data[i].function, | ||
text: `Invalid parameter in ${data[i].param}! Pass a variable of type ${data[i].type}!`, | ||
}; | ||
} | ||
} | ||
return true; | ||
} else { | ||
console.error('Error: checkValuesSender is not array'); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.