-
-
Notifications
You must be signed in to change notification settings - Fork 156
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
44 changed files
with
116 additions
and
68 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# esm-npm-polyfills | ||
|
||
Using _native_ APIs instead of importing from NPM. | ||
|
||
- [abort-controller](https://www.npmjs.com/package/abort-controller) → [abort-controller.mjs](./abort-controller.mjs) | ||
- [array-every](https://www.npmjs.com/package/array-every) → [array-every.mjs](./array-every.mjs) | ||
- [array-flatten](https://www.npmjs.com/package/array-flatten) → [array-flatten.mjs](./array-flatten.mjs) | ||
- [array-includes](https://www.npmjs.com/package/array-includes) → [array-includes.mjs](./array-includes.mjs) | ||
- [array.prototype.find](https://www.npmjs.com/package/array.prototype.find) → [array.prototype.find.mjs](./array.prototype.find.mjs) | ||
- [define-properties](https://www.npmjs.com/package/define-properties) → [define-properties.mjs](./define-properties.mjs) | ||
- [define-property](https://www.npmjs.com/package/define-property) → [define-property.mjs](./define-property.mjs) | ||
- [es-define-property](https://www.npmjs.com/package/es-define-property) → [es-define-property.mjs](./es-define-property.mjs) | ||
- [filter-array](https://www.npmjs.com/package/filter-array) → [filter-array.mjs](./filter-array.mjs) | ||
- [for-each](https://www.npmjs.com/package/for-each) → [for-each.mjs](./for-each.mjs) | ||
- [function-bind](https://www.npmjs.com/package/function-bind) → [function-bind.mjs](./function-bind.mjs) | ||
- [has-own-prop](https://www.npmjs.com/package/has-own-prop) → [has-own-prop.mjs](./has-own-prop.mjs) | ||
- [has-own](https://www.npmjs.com/package/has-own) → [has-own.mjs](./has-own.mjs) | ||
- [has-property-descriptors](https://www.npmjs.com/package/has-property-descriptors) → [has-property-descriptors.mjs](./has-property-descriptors.mjs) | ||
- [has-proto](https://www.npmjs.com/package/has-proto) → [has-proto.mjs](./has-proto.mjs) | ||
- [has-symbols](https://www.npmjs.com/package/has-symbols) → [has-symbols.mjs](./has-symbols.mjs) | ||
- [has-tostringtag](https://www.npmjs.com/package/has-tostringtag) → [has-tostringtag.mjs](./has-tostringtag.mjs) | ||
- [hasown](https://www.npmjs.com/package/hasown) → [hasown.mjs](./hasown.mjs) | ||
- [index-of](https://www.npmjs.com/package/index-of) → [index-of.mjs](./index-of.mjs) | ||
- [is-even](https://www.npmjs.com/package/is-even) → [is-even.mjs](./is-even.mjs) | ||
- [is-nan](https://www.npmjs.com/package/is-nan) → [is-nan.mjs](./is-nan.mjs) | ||
- [is-number](https://www.npmjs.com/package/is-number) → [is-number.mjs](./is-number.mjs) | ||
- [is-odd](https://www.npmjs.com/package/is-odd) → [is-odd.mjs](./is-odd.mjs) | ||
- [is-regexp](https://www.npmjs.com/package/is-regexp) → [is-regexp.mjs](./is-regexp.mjs) | ||
- [is-string](https://www.npmjs.com/package/is-string) → [is-string.mjs](./is-string.mjs) | ||
- [left-pad](https://www.npmjs.com/package/left-pad) → [left-pad.mjs](./left-pad.mjs) | ||
- [pad-left](https://www.npmjs.com/package/pad-left) → [pad-left.mjs](./pad-left.mjs) | ||
- [object-assign](https://www.npmjs.com/package/object-assign) → [object-assign.mjs](./object-assign.mjs) | ||
- [object-is](https://www.npmjs.com/package/object-is) → [object-is.mjs](./object-is.mjs) | ||
- [object-keys](https://www.npmjs.com/package/object-keys) → [object-keys.mjs](./object-keys.mjs) | ||
- [object.entries](https://www.npmjs.com/package/object.entries) → [object.entries.mjs](./object.entries.mjs) | ||
- [object.values](https://www.npmjs.com/package/object.values) → [object.values.mjs](./object.values.mjs) | ||
- [regexp.prototype.flags](https://www.npmjs.com/package/regexp.prototype.flags) → [regexp.prototype.flags.mjs](./regexp.prototype.flags.mjs) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export const AbortSignal=globalThis.AbortSignal; | ||
export const AbortController=globalThis.AbortController; | ||
export default AbortController; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export const every=(a,p,t)=>a.every(p,t); | ||
export default every; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export const flatten=(a,d)=>a.flat(typeof d<"u"?d:Infinity); | ||
export default flatten; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export default (a,p,i)=>a.includes(p,i); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export default (a,p,t)=>a.find(p,t); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export default Object.defineProperties; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export default Object.defineProperty; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export default Object.defineProperty; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export default (a,p,t)=>a.filter(p,t); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
export default (v, cb) => { | ||
if (Array.isArray(v)) { | ||
v.forEach(cb); | ||
} else if (v && typeof v === "object") { | ||
for (const k in v) { | ||
cb(v[k], k, v); | ||
} | ||
} | ||
}; |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export default Function.prototype.bind; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export default (obj,prop)=>Object.prototype.hasOwnProperty.call(obj,prop); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export default Object.hasOwn??((o,p)=>Object.prototype.hasOwnProperty.call(o,p)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export default () => true; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
const foo={bar:{}}; | ||
const O=Object; | ||
export default ()=>({__proto__:foo}).bar===foo.bar&&!({__proto__:null}instanceof O); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export default ()=>true; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export default ()=>typeof Symbol.toStringTag==="symbol"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export default Object.hasOwn??((o,p)=>Object.prototype.hasOwnProperty.call(o,p)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export default (a,el,i)=>a.indexOf(el,i); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export default n=>(n%2)===0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export default Number.isNaN; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export default v=>typeof v==="number"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export default n=>(n%2)===1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export default v=>v instanceof RegExp; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export default v=>typeof v==="string"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export default (s,l,c)=>s.padStart(l,c); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export default Object.assign; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export default Object.is; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export default Object.keys; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export default Object.entries; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export default Object.values; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export default (s,l,c)=>s.padStart(l,c); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export default r=>r.flags; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cf60a09
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is incorrect; define-properties simply isn’t a polyfill for Object.defineProperties.
cf60a09
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for the information, going to remove it
cf60a09
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also,
has-proto
can be hardcoded totrue
in modern engines, andhas-tostringtag
can be() => true
.you should really tag me in to these kinds of changes, i can at least make sure they're done properly.