Fix type check in ol/math

tsc considers everything in the else block to be of type 'never',
since it thinks that cosh is permanently defined for Math. Casting
back to Math in the else block fixes the error.
This commit is contained in:
William Wall
2018-09-29 16:40:15 -06:00
parent b49f2448c7
commit 831505c425

View File

@@ -35,7 +35,7 @@ export const cosh = (function() {
} else {
// … else, use the reference implementation of MDN:
cosh = function(x) {
const y = Math.exp(x);
const y = /** @type {Math} */ (Math).exp(x);
return (y + 1 / y) / 2;
};
}