Improve type checking in ol.color
This commit is contained in:
@@ -211,7 +211,8 @@ ol.color.fromStringInternal_ = function(s) {
|
|||||||
|
|
||||||
var isHex = false;
|
var isHex = false;
|
||||||
if (ol.color.ENABLE_NAMED_COLORS && goog.color.names.hasOwnProperty(s)) {
|
if (ol.color.ENABLE_NAMED_COLORS && goog.color.names.hasOwnProperty(s)) {
|
||||||
s = goog.color.names[s];
|
// goog.color.names does not have a type declaration, so add a typecast
|
||||||
|
s = /** @type {string} */ (goog.color.names[s]);
|
||||||
isHex = true;
|
isHex = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user