Use toString instead of asString in asColorLike

To avoid the double `typeof color === 'string'` check
This commit is contained in:
Frederic Junod
2018-02-12 09:10:02 +01:00
parent 951aa927ee
commit 17455c2529
+2 -2
View File
@@ -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));
} }
} }