Replace instanceof checks with other logic

This commit is contained in:
ahocevar
2018-10-05 16:16:51 +02:00
parent 96e99e481e
commit 9163558511
40 changed files with 232 additions and 268 deletions
+2 -4
View File
@@ -133,7 +133,7 @@ export function asArray(color) {
if (Array.isArray(color)) {
return color;
} else {
return fromString(/** @type {string} */ (color));
return fromString(color);
}
}
@@ -185,9 +185,7 @@ function fromStringInternal_(s) {
} else {
assert(false, 14); // Invalid color
}
return (
/** @type {Color} */ (color)
);
return color;
}