mirror of
https://github.com/tiennm99/is-a-dev.git
synced 2026-09-03 02:20:03 +00:00
Fixes reg script
This commit is contained in:
@@ -9,7 +9,7 @@ const toHostList = R.chain(data => {
|
||||
const rs = getRecords(data.record);
|
||||
|
||||
const records = R.chain(([recordType, urls]) =>
|
||||
urls.map(url => ({
|
||||
(Array.isArray(urls) ? urls : [urls]).map(url => ({
|
||||
HostName: data.name,
|
||||
RecordType: recordType,
|
||||
Address: url,
|
||||
|
||||
@@ -4,8 +4,8 @@ const { NC_DOMAIN, TTL } = require('../utils/constants');
|
||||
describe('toHostList', () => {
|
||||
it('should flatten domain data to list of hosts (without https)', () => {
|
||||
const res = toHostList([
|
||||
{ name: 'akshay', forceHttps: false, record: { CNAME: ['phenax.github.io'] } },
|
||||
{ name: 'foobar', forceHttps: false, record: { CNAME: ['v.io'] } },
|
||||
{ name: 'akshay', forceHttps: false, record: { CNAME: 'phenax.github.io' } },
|
||||
{ name: 'foobar', forceHttps: false, record: { CNAME: 'v.io' } },
|
||||
{ name: 'xx', forceHttps: false, record: { A: ['1.2.3.4', '5.6.3.2', '1.2.31.1'] } },
|
||||
]);
|
||||
|
||||
@@ -20,8 +20,8 @@ describe('toHostList', () => {
|
||||
|
||||
it('should flatten domain data to list of hosts (with https)', () => {
|
||||
const res = toHostList([
|
||||
{ name: 'akshay', forceHttps: true, record: { CNAME: ['phenax.github.io'] } },
|
||||
{ name: 'foobar', forceHttps: false, record: { CNAME: ['v.io'] } },
|
||||
{ name: 'akshay', forceHttps: true, record: { CNAME: 'phenax.github.io' } },
|
||||
{ name: 'foobar', forceHttps: false, record: { CNAME: 'v.io' } },
|
||||
{ name: 'xx', forceHttps: true, record: { A: ['1.2.3.4', '5.6.3.2', '1.2.31.1'] } },
|
||||
]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user