Skip to content

Commit f9e7f50

Browse files
committed
Adjusting variable names and definitions to resolve jshint task warnings.
1 parent 631ef53 commit f9e7f50

2 files changed

Lines changed: 13 additions & 12 deletions

File tree

geojson.js

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,9 @@
180180

181181
for(var gtype in params.geom) {
182182
var val = params.geom[gtype];
183+
var coordinates = [];
184+
var itemClone;
185+
var paths;
183186

184187
// Geometry parameter specified as: {Point: 'coords'}
185188
if(typeof val === 'string' && item.hasOwnProperty(val)) {
@@ -225,10 +228,9 @@
225228

226229
// Geometry parameter specified as: {Point: ['container.lat', 'container.lng', 'container.alt']}
227230
else if(Array.isArray(val) && isNested(val[0]) && isNested(val[1]) && isNested(val[2])){
228-
var coordinates = [];
229231
for (var i = 0; i < val.length; i++) { // i.e. 0 and 1
230-
var paths = val[i].split('.');
231-
var itemClone = item;
232+
paths = val[i].split('.');
233+
itemClone = item;
232234
for (var j = 0; j < paths.length; j++) {
233235
if (itemClone == undefined || !itemClone.hasOwnProperty(paths[j])) {
234236
return false;
@@ -243,17 +245,16 @@
243245

244246
// Geometry parameter specified as: {Point: ['container.lat', 'container.lng']}
245247
else if(Array.isArray(val) && isNested(val[0]) && isNested(val[1])){
246-
var coordinates = [];
247-
for (var i = 0; i < val.length; i++) { // i.e. 0 and 1
248-
var paths = val[i].split('.');
249-
var itemClone = item;
250-
for (var j = 0; j < paths.length; j++) {
251-
if (itemClone == undefined || !itemClone.hasOwnProperty(paths[j])) {
248+
for (var k = 0; k < val.length; k++) { // i.e. 0 and 1
249+
paths = val[k].split('.');
250+
itemClone = item;
251+
for (var l = 0; l < paths.length; l++) {
252+
if (itemClone == undefined || !itemClone.hasOwnProperty(paths[l])) {
252253
return false;
253254
}
254-
itemClone = itemClone[paths[j]]; // Iterate deeper into the object
255+
itemClone = itemClone[paths[l]]; // Iterate deeper into the object
255256
}
256-
coordinates[i] = itemClone;
257+
coordinates[k] = itemClone;
257258
}
258259
geom.type = gtype;
259260
geom.coordinates = [Number(coordinates[1]), Number(coordinates[0])];

geojson.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)