const hosts = '(island\\.is|devland\\.is|localhost:\\d{4,5})' ; const template = `^https{0,1}:\\/\\/([^\\/]{1,2048}\\.){0,1}${ hosts }(\\/|$)` ; const islandisRe = new RegExp ( template ) ; export const shouldLinkOpenInNewWindow = ( href ) : boolean => { const externalCandidate = typeof href === 'string' && href . indexOf ( '://' ) !== - 1 ; return externalCandidate && ! href . match ( islandisRe ) ; } ;