From d178ffc752516d423b85ad033599cb60b48ff886 Mon Sep 17 00:00:00 2001 From: Siddharth Parmar Date: Sun, 7 Apr 2019 18:33:40 +0200 Subject: [PATCH] Drop Math.trunc polyfill --- src/utils.js | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/src/utils.js b/src/utils.js index 4014ce7..73d3e22 100644 --- a/src/utils.js +++ b/src/utils.js @@ -1,12 +1,3 @@ -const mathTrunc = (() => { - if (Math.trunc) { - return Math.trunc; - } - return function(x) { - return x === 0 ? x : x < 0 ? Math.ceil(x) : Math.floor(x); - }; -})(); - export const handleErrors = options => { const { inputFormat, stops, colorArray } = options; @@ -92,7 +83,7 @@ const bezierInterpolation = colorTypeChars => (colArr, x) => { 3 * y * x ** 2 * colArr[2][char] + x ** 3 * colArr[3][char]; } - colorObject[char] = mathTrunc(v); + colorObject[char] = Math.trunc(v); return colorObject; }, {}); };