Use toString instead of asString in asColorLike
To avoid the double `typeof color === 'string'` check
This commit is contained in:
+2
-2
@@ -1,7 +1,7 @@
|
|||||||
/**
|
/**
|
||||||
* @module ol/colorlike
|
* @module ol/colorlike
|
||||||
*/
|
*/
|
||||||
import {asString} from './color.js';
|
import {toString} from './color.js';
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -13,7 +13,7 @@ export function asColorLike(color) {
|
|||||||
if (isColorLike(color)) {
|
if (isColorLike(color)) {
|
||||||
return /** @type {string|CanvasPattern|CanvasGradient} */ (color);
|
return /** @type {string|CanvasPattern|CanvasGradient} */ (color);
|
||||||
} else {
|
} else {
|
||||||
return asString(/** @type {ol.Color} */ (color));
|
return toString(/** @type {ol.Color} */ (color));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user