refactors validation

This commit is contained in:
Akshay Nair
2020-10-17 22:12:24 +05:30
parent 732f76a557
commit 194e4700c6
+1 -1
View File
@@ -42,7 +42,7 @@ const validateDomainData = validate({
reason: 'Invalid record. CNAME records have to be a host name and A records has to be a list of ips',
fn: and([
R.is(Object),
R.compose(R.isEmpty, R.flip(R.difference)(VALID_RECORD_TYPES), R.keys),
R.compose(R.isEmpty, R.difference(R.__, VALID_RECORD_TYPES), R.keys),
R.cond([
[R.has('CNAME'), validateCnameRecord('CNAME')],
[R.has('A'), validateARecord('A')],