mirror of
https://github.com/mCaptcha/mCaptcha.git
synced 2026-02-11 10:05:41 +00:00
typescript migration
This commit is contained in:
@@ -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: {
|
||||
@@ -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`);
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user