@next/polyfill-module
Advanced tools
Comparing version 0.0.0 to 9.5.4-canary.17
@@ -1,1 +0,1 @@ | ||
"trimStart"in String.prototype||(String.prototype.trimStart=String.prototype.trimLeft),"trimEnd"in String.prototype||(String.prototype.trimEnd=String.prototype.trimRight),"description"in Symbol.prototype||Object.defineProperty(Symbol.prototype,"description",{get:function(){return/\((.+)\)/.exec(this)[1]}}),Array.prototype.flat||(Array.prototype.flat=function(t,r){return r=this.concat.apply([],this),t>1&&r.some(Array.isArray)?r.flat(t-1):r},Array.prototype.flatMap=function(t,r){return this.map(t,r).flat()}),Promise.prototype.finally||(Promise.prototype.finally=function(t){if("function"!=typeof t)return this.then(t,t);var r=this.constructor||Promise;return this.then(function(o){return r.resolve(t()).then(function(){return o})},function(o){return r.resolve(t()).then(function(){throw o})})}); |
{ | ||
"name": "@next/polyfill-module", | ||
"version": "0.0.0", | ||
"version": "9.5.4-canary.17", | ||
"description": "A standard library polyfill for ES Modules supporting browsers (Edge 16+, Firefox 60+, Chrome 61+, Safari 10.1+)", | ||
@@ -17,3 +17,4 @@ "main": "dist/polyfill-module.js", | ||
"microbundle": "0.11.0" | ||
} | ||
}, | ||
"gitHead": "71a01815728303c5dd4dd1a840568a9f251909ce" | ||
} |
@@ -1,1 +0,94 @@ | ||
// noop | ||
/* eslint-disable no-extend-native */ | ||
// Contains polyfills for methods missing after browser version(s): | ||
// Edge 16, Firefox 60, Chrome 61, Safari 10.1 | ||
/** | ||
* Available in: | ||
* Edge: never | ||
* Firefox: 61 | ||
* Chrome: 66 | ||
* Safari: 12 | ||
* | ||
* https://caniuse.com/mdn-javascript_builtins_string_trimstart | ||
* https://caniuse.com/mdn-javascript_builtins_string_trimend | ||
*/ | ||
if (!('trimStart' in String.prototype)) { | ||
String.prototype.trimStart = String.prototype.trimLeft | ||
} | ||
if (!('trimEnd' in String.prototype)) { | ||
String.prototype.trimEnd = String.prototype.trimRight | ||
} | ||
/** | ||
* Available in: | ||
* Edge: never | ||
* Firefox: 63 | ||
* Chrome: 70 | ||
* Safari: 12.1 | ||
* | ||
* https://caniuse.com/mdn-javascript_builtins_symbol_description | ||
*/ | ||
if (!('description' in Symbol.prototype)) { | ||
Object.defineProperty(Symbol.prototype, 'description', { | ||
get: function get() { | ||
return /\((.+)\)/.exec(this)[1] | ||
}, | ||
}) | ||
} | ||
/** | ||
* Available in: | ||
* Edge: never | ||
* Firefox: 62 | ||
* Chrome: 69 | ||
* Safari: 12 | ||
* | ||
* https://caniuse.com/array-flat | ||
*/ | ||
// Copied from https://gist.github.com/developit/50364079cf0390a73e745e513fa912d9 | ||
// Licensed Apache-2.0 | ||
if (!Array.prototype.flat) { | ||
Array.prototype.flat = function flat(d, c) { | ||
return ( | ||
(c = this.concat.apply([], this)), | ||
d > 1 && c.some(Array.isArray) ? c.flat(d - 1) : c | ||
) | ||
} | ||
Array.prototype.flatMap = function (c, a) { | ||
return this.map(c, a).flat() | ||
} | ||
} | ||
/** | ||
* Available in: | ||
* Edge: 18 | ||
* Firefox: 58 | ||
* Chrome: 63 | ||
* Safari: 11.1 | ||
* | ||
* https://caniuse.com/promise-finally | ||
*/ | ||
// Modified from https://gist.github.com/developit/e96097d9b657f2a2f3e588ffde433437 | ||
// Licensed Apache-2.0 | ||
if (!Promise.prototype.finally) { | ||
Promise.prototype.finally = function (callback) { | ||
if (typeof callback !== 'function') { | ||
return this.then(callback, callback) | ||
} | ||
var P = this.constructor || Promise | ||
return this.then( | ||
function (value) { | ||
return P.resolve(callback()).then(function () { | ||
return value | ||
}) | ||
}, | ||
function (err) { | ||
return P.resolve(callback()).then(function () { | ||
throw err | ||
}) | ||
} | ||
) | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
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
4679
4
92