Why you have to create property "recaptcha"? Can't you check for it the same way you are checking in the other place: "editApi.captcha.type === 'recaptcha'"?