From 831505c42523ebb6d0f8714d7a5cfd31041d0f5f Mon Sep 17 00:00:00 2001 From: William Wall Date: Sat, 29 Sep 2018 16:40:15 -0600 Subject: [PATCH] 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. --- src/ol/math.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ol/math.js b/src/ol/math.js index 236e951f33..372780d7d9 100644 --- a/src/ol/math.js +++ b/src/ol/math.js @@ -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; }; }