6
6
- Array.prototype.find
7
7
*/
8
8
if ( typeof Object . assign !== 'function' ) {
9
- ( function ( ) {
10
- Object . assign = function ( target ) {
9
+ ( function ( ) {
10
+ Object . assign = function ( target ) {
11
11
if ( target === undefined || target === null ) {
12
12
throw new TypeError ( 'Cannot convert undefined or null to object' ) ;
13
13
}
@@ -30,7 +30,7 @@ if (typeof Object.assign !== 'function') {
30
30
31
31
if ( ! Array . prototype . find ) {
32
32
Object . defineProperty ( Array . prototype , 'find' , {
33
- value : function ( predicate ) {
33
+ value : function ( predicate ) {
34
34
if ( this === null ) {
35
35
throw new TypeError ( 'Array.prototype.find called on null or undefined' ) ;
36
36
}
@@ -55,7 +55,7 @@ if (!Array.prototype.find) {
55
55
56
56
if ( ! Array . prototype . findIndex ) {
57
57
Object . defineProperty ( Array . prototype , 'findIndex' , {
58
- value : function ( predicate , thisArg ) {
58
+ value : function ( predicate , thisArg ) {
59
59
if ( this === null ) {
60
60
throw new TypeError ( 'Array.prototype.find called on null or undefined' ) ;
61
61
}
@@ -82,7 +82,7 @@ export function pollyfillElementsFromPoint() {
82
82
if ( document . elementsFromPoint ) return document . elementsFromPoint ;
83
83
if ( document . msElementsFromPoint ) return document . msElementsFromPoint ;
84
84
85
- var usePointer = ( function ( ) {
85
+ var usePointer = ( function ( ) {
86
86
var element = document . createElement ( 'x' ) ;
87
87
element . style . cssText = 'pointer-events:auto' ;
88
88
return element . style . pointerEvents === 'auto' ;
@@ -96,7 +96,7 @@ export function pollyfillElementsFromPoint() {
96
96
? '* { pointer-events: all }'
97
97
: '* { visibility: visible }' ;
98
98
99
- return function ( x , y ) {
99
+ return function ( x , y ) {
100
100
var current , i , d ;
101
101
var elements = [ ] ;
102
102
var previousPointerEvents = [ ] ;
@@ -153,7 +153,7 @@ if (typeof window.addEventListener === 'function') {
153
153
154
154
if ( ! Array . prototype . includes ) {
155
155
Object . defineProperty ( Array . prototype , 'includes' , {
156
- value : function ( searchElement ) {
156
+ value : function ( searchElement ) {
157
157
var O = Object ( this ) ;
158
158
var len = parseInt ( O . length , 10 ) || 0 ;
159
159
if ( len === 0 ) {
@@ -190,7 +190,7 @@ if (!Array.prototype.includes) {
190
190
// Reference: http://es5.github.io/#x15.4.4.17
191
191
if ( ! Array . prototype . some ) {
192
192
Object . defineProperty ( Array . prototype , 'some' , {
193
- value : function ( fun ) {
193
+ value : function ( fun ) {
194
194
if ( this == null ) {
195
195
throw new TypeError ( 'Array.prototype.some called on null or undefined' ) ;
196
196
}
@@ -216,14 +216,14 @@ if (!Array.prototype.some) {
216
216
217
217
if ( ! Array . from ) {
218
218
Object . defineProperty ( Array , 'from' , {
219
- value : ( function ( ) {
219
+ value : ( function ( ) {
220
220
var toStr = Object . prototype . toString ;
221
- var isCallable = function ( fn ) {
221
+ var isCallable = function ( fn ) {
222
222
return (
223
223
typeof fn === 'function' || toStr . call ( fn ) === '[object Function]'
224
224
) ;
225
225
} ;
226
- var toInteger = function ( value ) {
226
+ var toInteger = function ( value ) {
227
227
var number = Number ( value ) ;
228
228
if ( isNaN ( number ) ) {
229
229
return 0 ;
@@ -234,7 +234,7 @@ if (!Array.from) {
234
234
return ( number > 0 ? 1 : - 1 ) * Math . floor ( Math . abs ( number ) ) ;
235
235
} ;
236
236
var maxSafeInteger = Math . pow ( 2 , 53 ) - 1 ;
237
- var toLength = function ( value ) {
237
+ var toLength = function ( value ) {
238
238
var len = toInteger ( value ) ;
239
239
return Math . min ( Math . max ( len , 0 ) , maxSafeInteger ) ;
240
240
} ;
@@ -307,7 +307,7 @@ if (!Array.from) {
307
307
}
308
308
309
309
if ( ! String . prototype . includes ) {
310
- String . prototype . includes = function ( search , start ) {
310
+ String . prototype . includes = function ( search , start ) {
311
311
if ( typeof start !== 'number' ) {
312
312
start = 0 ;
313
313
}
@@ -329,7 +329,7 @@ if (!Array.prototype.flat) {
329
329
return depth
330
330
? Array . prototype . reduce . call (
331
331
this ,
332
- function ( acc , cur ) {
332
+ function ( acc , cur ) {
333
333
if ( Array . isArray ( cur ) ) {
334
334
acc . push . apply ( acc , flat . call ( cur , depth - 1 ) ) ;
335
335
} else {
0 commit comments