Skip to content

Commit 9a4a966

Browse files
committed
Refactor helper function
1 parent 434017f commit 9a4a966

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/lib/topojson_utils.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,9 @@ topojsonUtils.getTopojsonName = function(geoLayout) {
1313
};
1414

1515
topojsonUtils.getTopojsonPath = function(topojsonURL, topojsonName) {
16-
if (topojsonURL.endsWith('/')) {
17-
return topojsonURL + topojsonName + '.json';
18-
} else {
19-
return topojsonURL + '/' + topojsonName + '.json';
20-
}
16+
topojsonURL += topojsonURL.endsWith('/') ? '' : '/';
17+
18+
return `${topojsonURL}${topojsonName}.json`;
2119
};
2220

2321
topojsonUtils.getTopojsonFeatures = function(trace, topojson) {

0 commit comments

Comments
 (0)