Remove use of goog.isString()

This commit is contained in:
Marc Jansen
2016-02-05 15:12:00 +01:00
parent 057633c2c4
commit efa82dccf9
20 changed files with 43 additions and 43 deletions

View File

@@ -143,7 +143,7 @@ ol.format.GMLBase.prototype.readFeaturesInternal = function(node, objectStack) {
context['featureType'] = featureType;
context['featureNS'] = featureNS;
}
if (goog.isString(featureNS)) {
if (typeof featureNS === 'string') {
var ns = featureNS;
featureNS = {};
featureNS[defaultPrefix] = ns;

View File

@@ -29,7 +29,7 @@ goog.inherits(ol.format.JSONFeature, ol.format.Feature);
ol.format.JSONFeature.prototype.getObject_ = function(source) {
if (goog.isObject(source)) {
return source;
} else if (goog.isString(source)) {
} else if (typeof source === 'string') {
var object = goog.json.parse(source);
return object ? object : null;
} else {

View File

@@ -431,7 +431,7 @@ ol.format.KML.createFeatureStyleFunction_ = function(style, styleUrl,
ol.format.KML.findStyle_ = function(styleValue, defaultStyle, sharedStyles) {
if (goog.isArray(styleValue)) {
return styleValue;
} else if (goog.isString(styleValue)) {
} else if (typeof styleValue === 'string') {
// KML files in the wild occasionally forget the leading `#` on styleUrls
// defined in the same document. Add a leading `#` if it enables to find
// a style.
@@ -1274,7 +1274,7 @@ ol.format.KML.PlacemarkStyleMapParser_ = function(node, objectStack) {
'placemarkObject should be an Object');
if (goog.isArray(styleMapValue)) {
placemarkObject['Style'] = styleMapValue;
} else if (goog.isString(styleMapValue)) {
} else if (typeof styleMapValue === 'string') {
placemarkObject['styleUrl'] = styleMapValue;
} else {
goog.asserts.fail('styleMapValue has an unknown type');
@@ -1973,7 +1973,7 @@ ol.format.KML.prototype.readName = function(source) {
return this.readNameFromDocument(/** @type {Document} */ (source));
} else if (ol.xml.isNode(source)) {
return this.readNameFromNode(/** @type {Node} */ (source));
} else if (goog.isString(source)) {
} else if (typeof source === 'string') {
var doc = ol.xml.parse(source);
return this.readNameFromDocument(doc);
} else {
@@ -2045,7 +2045,7 @@ ol.format.KML.prototype.readNetworkLinks = function(source) {
} else if (ol.xml.isNode(source)) {
ol.array.extend(networkLinks, this.readNetworkLinksFromNode(
/** @type {Node} */ (source)));
} else if (goog.isString(source)) {
} else if (typeof source === 'string') {
var doc = ol.xml.parse(source);
ol.array.extend(networkLinks, this.readNetworkLinksFromDocument(doc));
} else {

View File

@@ -26,7 +26,7 @@ goog.inherits(ol.format.TextFeature, ol.format.Feature);
* @return {string} Text.
*/
ol.format.TextFeature.prototype.getText_ = function(source) {
if (goog.isString(source)) {
if (typeof source === 'string') {
return source;
} else {
goog.asserts.fail();

View File

@@ -151,7 +151,7 @@ ol.format.WFS.prototype.readTransactionResponse = function(source) {
/** @type {Document} */ (source));
} else if (ol.xml.isNode(source)) {
return this.readTransactionResponseFromNode(/** @type {Node} */ (source));
} else if (goog.isString(source)) {
} else if (typeof source === 'string') {
var doc = ol.xml.parse(source);
return this.readTransactionResponseFromDocument(doc);
} else {
@@ -176,7 +176,7 @@ ol.format.WFS.prototype.readFeatureCollectionMetadata = function(source) {
} else if (ol.xml.isNode(source)) {
return this.readFeatureCollectionMetadataFromNode(
/** @type {Node} */ (source));
} else if (goog.isString(source)) {
} else if (typeof source === 'string') {
var doc = ol.xml.parse(source);
return this.readFeatureCollectionMetadataFromDocument(doc);
} else {

View File

@@ -42,7 +42,7 @@ ol.format.XMLFeature.prototype.readFeature = function(source, opt_options) {
/** @type {Document} */ (source), opt_options);
} else if (ol.xml.isNode(source)) {
return this.readFeatureFromNode(/** @type {Node} */ (source), opt_options);
} else if (goog.isString(source)) {
} else if (typeof source === 'string') {
var doc = ol.xml.parse(source);
return this.readFeatureFromDocument(doc, opt_options);
} else {
@@ -85,7 +85,7 @@ ol.format.XMLFeature.prototype.readFeatures = function(source, opt_options) {
/** @type {Document} */ (source), opt_options);
} else if (ol.xml.isNode(source)) {
return this.readFeaturesFromNode(/** @type {Node} */ (source), opt_options);
} else if (goog.isString(source)) {
} else if (typeof source === 'string') {
var doc = ol.xml.parse(source);
return this.readFeaturesFromDocument(doc, opt_options);
} else {
@@ -133,7 +133,7 @@ ol.format.XMLFeature.prototype.readGeometry = function(source, opt_options) {
/** @type {Document} */ (source), opt_options);
} else if (ol.xml.isNode(source)) {
return this.readGeometryFromNode(/** @type {Node} */ (source), opt_options);
} else if (goog.isString(source)) {
} else if (typeof source === 'string') {
var doc = ol.xml.parse(source);
return this.readGeometryFromDocument(doc, opt_options);
} else {
@@ -169,7 +169,7 @@ ol.format.XMLFeature.prototype.readProjection = function(source) {
return this.readProjectionFromDocument(/** @type {Document} */ (source));
} else if (ol.xml.isNode(source)) {
return this.readProjectionFromNode(/** @type {Node} */ (source));
} else if (goog.isString(source)) {
} else if (typeof source === 'string') {
var doc = ol.xml.parse(source);
return this.readProjectionFromDocument(doc);
} else {

View File

@@ -23,7 +23,7 @@ ol.format.XML.prototype.read = function(source) {
return this.readFromDocument(/** @type {Document} */ (source));
} else if (ol.xml.isNode(source)) {
return this.readFromNode(/** @type {Node} */ (source));
} else if (goog.isString(source)) {
} else if (typeof source === 'string') {
var doc = ol.xml.parse(source);
return this.readFromDocument(doc);
} else {