mirror of
https://github.com/kingomarnajjar/flex-template-web.git
synced 2026-07-28 12:43:11 +10:00
Add missing polyfills: Number.isNaN and Number.parseInt
This commit is contained in:
parent
f81f01ea3a
commit
63afe46b90
1 changed files with 12 additions and 0 deletions
|
|
@ -21,3 +21,15 @@ require('object.values').shim();
|
|||
if (typeof Number.parseFloat === 'undefined' && typeof window !== 'undefined') {
|
||||
Number.parseFloat = window.parseFloat;
|
||||
}
|
||||
|
||||
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/parseInt
|
||||
if (typeof Number.parseInt === 'undefined' && typeof window !== 'undefined') {
|
||||
Number.parseInt = window.parseInt;
|
||||
}
|
||||
|
||||
// NaN is the only value in javascript which is not equal to itself.
|
||||
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isNaN
|
||||
if (typeof Number.isNaN === 'undefined') {
|
||||
// eslint-disable-next-line no-self-compare
|
||||
Number.isNaN = value => value !== value;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue