'use strict';

var siteArray = ['community.onclive.com', 'fetchdvm360.com', 'aestheticauthority.com', 'app.onecommunity.com', 'cannapatientcare.com', 'chiefhealthcareexecutive.com', 'genetherapylive.com', 'giantsofcancercare.com', 'medicalworldnews.com', 'pbmi.com', 'pharmacytimes.org', 'gotoper.com', 'education.gotoper.com', 'mjhlifesciences.com', 'ajmc.com', 'appliedclinicaltrialsonline.com', 'biopharminternational.com', 'cancernetwork.com', 'cancerhorizon.com', 'cannabissciencetech.com', 'centerforbiosimilars.com', 'chromatographyonline.com', 'contagionlive.com', 'contemporaryclinic.com', 'contemporaryobgyn.net', 'contemporarypediatrics.com', 'consultantlive.com', 'curetoday.com', 'dentalproductsreport.com', 'dermatologytimes.com', 'diagnosticimaging.com', 'drugtopics.com', 'dvm360.com', 'endocrinologynetwork.com', 'europe.ophthalmologytimes.com', 'formularywatch.com', 'hcplive.com', 'infectioncontroltoday.com', 'lungquest.com', 'managedhealthcareexecutive.com', 'medicaleconomics.com', 'modernretina.com', 'movingmountainsformultiplemyeloma.com', 'naspmeeting.com', 'neurologylive.com', 'nutritionaloutlook.com', 'onclive.com', 'oncliveevents.com', 'oncnursingnews.com', 'ophthalmologytimes.com', 'optometrytimes.com', 'onecommunity.com', 'patientcareonline.com', 'pharmaceuticalcommerce.com', 'pharmacytimes.com', 'pharmacistmomsgroup.com', 'pharmexec.com', 'pharmtech.com', 'physicianspractice.com', 'practicalcardiology.com', 'psychiatrictimes.com', 'rheumatologynetwork.com', 'spectroscopyonline.com', 'studio.mjhassoc.com', 'targetedonc.com', 'turbomachinerymag.com', 'urologytimes.com', 'mdmag.com'];

var checkSisterSite = function checkSisterSite(url) {
  if (url.includes('http://' ) || url.includes('https://' )) {
    url = url.replace('www.', '').split('/').slice(2, 3).join('/');
    var array = url.split('.');
    var length = array.length;
    if (length === 2) {
      url = url;
    } else {
      url = url.split('.').splice(1).join('.');
    }
  }
  return url && url.includes(url.replace('www.', '').split('/').slice(0, 1).join('/')) && siteArray.includes(url.replace('www.', '').split('/').slice(0, 1).join('/')) || url.charAt(0) === '/' ? true : false;
};

exports.checkSisterSite = checkSisterSite;
