gooddata
Advanced tools
Comparing version 5.0.0-pavelzgdc-pzb-647-telemetrie-2018-03-01T15-00-53-112Z to 5.0.0-pavelzgdc-pzb-647-telemetrie-2018-03-01T19-58-48-123Z
@@ -28,9 +28,8 @@ 'use strict'; | ||
function sanitizeDomain(domain) { | ||
var sanitizedDomain = domain || ''; | ||
var link = sanitizedDomain.match(URL_REGEXP); | ||
if (domain === null) { | ||
if (domain === null || domain === undefined) { | ||
return undefined; // eslint-disable-line no-param-reassign | ||
} | ||
var sanitizedDomain = domain || ''; | ||
var link = sanitizedDomain.match(URL_REGEXP); | ||
if (!link) { | ||
@@ -40,4 +39,3 @@ throw new Error(domain + ' is not a valid url'); | ||
// ensure https:// prefix | ||
// and strip possible trailing / | ||
// ensure https:// prefix and strip possible trailing / | ||
return 'https://' + link[0].replace(/^https:\/\//, '').replace(/\/$/, ''); | ||
@@ -44,0 +42,0 @@ } |
{ | ||
"name": "gooddata", | ||
"version": "5.0.0-pavelzgdc-pzb-647-telemetrie-2018-03-01T15-00-53-112Z", | ||
"version": "5.0.0-pavelzgdc-pzb-647-telemetrie-2018-03-01T19-58-48-123Z", | ||
"author": "GoodData", | ||
@@ -5,0 +5,0 @@ "description": "GoodData JavaScript SDK", |
@@ -17,9 +17,8 @@ // Copyright (C) 2007-2014, GoodData(R) Corporation. All rights reserved. | ||
export function sanitizeDomain(domain) { | ||
const sanitizedDomain = domain || ''; | ||
const link = sanitizedDomain.match(URL_REGEXP); | ||
if (domain === null) { | ||
if (domain === null || domain === undefined) { | ||
return undefined; // eslint-disable-line no-param-reassign | ||
} | ||
const sanitizedDomain = domain || ''; | ||
const link = sanitizedDomain.match(URL_REGEXP); | ||
if (!link) { | ||
@@ -29,4 +28,3 @@ throw new Error(`${domain} is not a valid url`); | ||
// ensure https:// prefix | ||
// and strip possible trailing / | ||
// ensure https:// prefix and strip possible trailing / | ||
return `https://${link[0].replace(/^https:\/\//, '').replace(/\/$/, '')}`; | ||
@@ -33,0 +31,0 @@ } |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
1168997
27288