Skip to content

Commit e509047

Browse files
committed
mojtaba-proof a few things
- move isNonBlankString in outer scope - add "" around URL in invalid-url error msg
1 parent cb202a8 commit e509047

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

src/plots/mapbox/mapbox.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ proto.fetchMapData = function(calcData) {
142142
if(err) {
143143
delete PlotlyGeoAssets[url];
144144
var msg = err.status === 404 ?
145-
('GeoJSON at URL ' + url + ' does not exist.') :
145+
('GeoJSON at URL "' + url + '" does not exist.') :
146146
('Unexpected error while fetching from ' + url);
147147
return reject(new Error(msg));
148148
}

src/traces/choropleth/calc.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,14 @@ var colorscaleCalc = require('../../components/colorscale/calc');
1515
var arraysToCalcdata = require('../scatter/arrays_to_calcdata');
1616
var calcSelection = require('../scatter/calc_selection');
1717

18+
function isNonBlankString(v) {
19+
return v && typeof v === 'string';
20+
}
21+
1822
module.exports = function calc(gd, trace) {
1923
var len = trace._length;
2024
var calcTrace = new Array(len);
2125

22-
var isNonBlankString = function(v) { return v && typeof v === 'string'; };
2326
var isValidLoc;
2427

2528
if(trace.geojson) {

test/jasmine/tests/mapbox_test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1351,7 +1351,7 @@ describe('@noCI Test mapbox GeoJSON fetching:', function() {
13511351
actual = reason;
13521352
})
13531353
.then(function() {
1354-
expect(actual).toEqual(new Error('GeoJSON at URL invalidUrl does not exist.'));
1354+
expect(actual).toEqual(new Error('GeoJSON at URL "invalidUrl" does not exist.'));
13551355
expect(window.PlotlyGeoAssets.invalidUrl).toBe(undefined);
13561356
})
13571357
.then(done);

0 commit comments

Comments
 (0)