Skip to content

Commit

Permalink
Drop Math.trunc polyfill
Browse files Browse the repository at this point in the history
  • Loading branch information
Siddharth Parmar committed Apr 7, 2019
1 parent 1059145 commit d178ffc
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions 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;

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 d178ffc

Please sign in to comment.