Skip to content

Commit

Permalink
Merge pull request #13 from Siddharth11/math-polyfill-remove
Browse files Browse the repository at this point in the history
Drop Math.trunc polyfill
  • Loading branch information
Siddharth11 committed Apr 7, 2019
2 parents 1059145 + d178ffc commit c952eca
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions src/utils.js
Original file line number Diff line number Diff line change
@@ -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;

Expand Down Expand Up @@ -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;
}, {});
};
Expand Down

0 comments on commit c952eca

Please sign in to comment.