array-reverse-polyfill
Advanced tools
+10
-5
| (function() { | ||
| if (navigator.userAgent.indexOf('; CPU OS 12 ') === -1) return; | ||
| var reverse = Array.prototype.reverse; | ||
| Array.prototype.reverse = function() { | ||
| this.push.apply(this, reverse.call(this.splice(0))); | ||
| return this; | ||
| Array.prototype._reverse = Array.prototype.reverse; | ||
| Array.prototype.reverse = function reverse() { | ||
| this.length = this.length; | ||
| return this._reverse(); | ||
| } | ||
| })(); | ||
| const nonenum = {enumerable: false}; | ||
| Object.defineProperties(Array.prototype, { | ||
| _reverse: nonenum, | ||
| reverse: nonenum, | ||
| }); | ||
| })(); |
+1
-1
| { | ||
| "name": "array-reverse-polyfill", | ||
| "version": "1.0.1", | ||
| "version": "1.0.2", | ||
| "description": "Fix IOS 12 Array Reverse Bug.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
Trivial Package
Supply chain riskPackages less than 10 lines of code are easily copied into your own project and may not warrant the additional supply chain risk of an external dependency.
Found 1 instance in 1 package
3988
3.64%13
85.71%0
-100%