Closed ishando closed 4 years ago
using isValidBIC as a validator with vuelidate should not throw error for an empty form
isValidBIC
vuelidate
[Vue warn]: Error in render: "TypeError: bic is undefined"
i created two custom validators for IBAN and BIC:
const validAccountNumber = helpers.withParams({type: 'validValue'}, (value) => isNaN(value) ? isValidIBAN(value) : true) const validBankIdentifier = helpers.withParams({type: 'validValue'}, (value) => isNaN(value) ? isValidBIC(value) : true)
and set them as validators on the form
form: { AccountNumber: { required, alphaNum, validAccountNumber }, BankNumber: { required, alphaNum, validBankIdentifier },
with just the iban validator in place all works fine, but when I add the BIC validator I get the above error when creating a new form
I suspect the difference in behaviour is due to the isValidBIC function not checking for null/undefined values whereas isValidIBAN does
isValidIBAN
@ishando Issue has been fixed and new version (3.2.0) is added into npm registry. Sorry that it took me so long to address this.
Expected behavior
using
isValidBIC
as a validator withvuelidate
should not throw error for an empty formActual behavior
[Vue warn]: Error in render: "TypeError: bic is undefined"
Steps to reproduce the behavior
i created two custom validators for IBAN and BIC:
and set them as validators on the form
with just the iban validator in place all works fine, but when I add the BIC validator I get the above error when creating a new form
I suspect the difference in behaviour is due to the
isValidBIC
function not checking for null/undefined values whereasisValidIBAN
does