Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
geo.contourJsonReader = function (arg) {
'use strict';
if (!(this instanceof geo.contourJsonReader)) {
return new geo.contourJsonReader(arg); // eslint-disable-line new-cap
}
var that = this;
geo.fileReader.call(this, arg);
this.canRead = function (file) {
if (file instanceof File) {
return (file.type === 'application/json' || file.name.match(/\.json$/));
} else if (_.isString(file)) {
try {
JSON.parse(file);
} catch (e) {
return false;
}
return true;
}
try {
if (Array.isArray(that._featureArray(file))) {
return true;
}