mirror of
https://github.com/tiennm99/is-a-dev.git
synced 2026-10-13 16:15:07 +00:00
Changes cname, alias and url records to be single items
This commit is contained in:
1 parent
8e8fe46b2f
commit
473add5bd8
4 files changed
+6
-6
No files matched your search
+1
-1
@@ -7,6 +7,6 @@
|
||||
},
|
||||
"forceHttps": true,
|
||||
"record": {
|
||||
"CNAME": ["phenax.github.io"]
|
||||
"CNAME": "phenax.github.io"
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -6,6 +6,6 @@
|
||||
},
|
||||
"forceHttps": true,
|
||||
"record": {
|
||||
"CNAME": ["duckduckgo.com"]
|
||||
"CNAME": "duckduckgo.com"
|
||||
}
|
||||
}
|
||||
@@ -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
@@ -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],
|
||||
]),
|
||||
]),
|
||||
|
||||
Reference in new issue
Block a user