alfhen / vue-cookie

A Vue.js plugin for manipulating cookies
MIT License
821 stars 72 forks source link

isInteger ES6 browser support #8

Closed timmetj closed 7 years ago

timmetj commented 7 years ago

Hi,

I noticed you use the isInteger function on line 13. But this is not supported by all browsers like IE11 and older. Is it maybe possible to adjust to make it browser compatible?

possible solution:

Number.isInteger = Number.isInteger || function(value) {
    return typeof value === "number" && 
           isFinite(value) && 
           Math.floor(value) === value;
};
alfhen commented 7 years ago

@timmetj Great idea, thanks to a PR by @jackie19 it is solved in the latest release 😄