Changes cname, alias and url records to be single items

This commit is contained in:
Akshay Nair committed 2020-10-05 00:47:40 +05:30
1 parent 8e8fe46b2f
commit 473add5bd8
4 files changed
+6 -6

No files matched your search

+1 -1
View File
@@ -7,6 +7,6 @@
},
"forceHttps": true,
"record": {
"CNAME": ["phenax.github.io"]
"CNAME": "phenax.github.io"
}
}
+1 -1
View File
@@ -6,6 +6,6 @@
},
"forceHttps": true,
"record": {
"CNAME": ["duckduckgo.com"]
"CNAME": "duckduckgo.com"
}
}
+2 -2
View File
@@ -32,7 +32,7 @@ describe('validateDomainData', () => {
...defaultDomain,
name,
})),
{ ...defaultDomain, record: { CNAME: ['sd'], A: ['121,3213'] } },
{ ...defaultDomain, record: { CNAME: 'sd', A: ['121,3213'] } },
//{ ...defaultDomain, record: { FOOBAR: ['sd'] } },
{ ...defaultDomain, owner: {}, },
{ ...defaultDomain, owner: { username: 'hwelo', }, },
@@ -49,7 +49,7 @@ describe('validateDomainData', () => {
...defaultDomain,
description: getstroflen(99),
},
{ ...defaultDomain, record: { CNAME: ['sd'], URL: ['121,3213'] } },
{ ...defaultDomain, record: { CNAME: 'sd', URL: '121,3213' } },
];
it('should return false for invalid data', () => {
+2 -2
View File
@@ -27,7 +27,7 @@ const validate = pattern => data => R.compose(
const validateNameRecord = type => R.allPass([
R.compose(R.equals(1), R.length, R.reject(R.equals('URL')), R.keys),
R.propSatisfies(R.is(Array), type),
R.propSatisfies(R.is(String), type),
]);
const validateDomainData = validate({
@@ -64,7 +64,7 @@ const validateDomainData = validate({
[R.prop('CNAME'), validateNameRecord('CNAME')],
[R.prop('ALIAS'), validateNameRecord('ALIAS')],
[R.prop('A'), R.propSatisfies(R.is(Array), 'A')],
[R.prop('URL'), R.propSatisfies(R.is(Array), 'URL')],
[R.prop('URL'), R.propSatisfies(R.is(String), 'URL')],
[R.T, R.T],
]),
]),