mirror of
https://gitlab.com/PronounsPage/PronounsPage.git
synced 2025-09-22 12:03:25 -04:00
(polyfill) simple polyfill for Object.hasOwn
This commit is contained in:
parent
52b7d2114e
commit
d148b53f3b
@ -166,6 +166,7 @@ const nuxtConfig: NuxtConfig = {
|
||||
'~/assets/style.scss',
|
||||
],
|
||||
plugins: [
|
||||
{ src: '~/plugins/polyfill.ts', mode: 'client' },
|
||||
{ src: '~/plugins/axios.js' },
|
||||
{ src: '~/plugins/globals.ts' },
|
||||
{ src: '~/plugins/auth.ts' },
|
||||
|
9
plugins/polyfill.ts
Normal file
9
plugins/polyfill.ts
Normal file
@ -0,0 +1,9 @@
|
||||
export default (): void => {
|
||||
if (!Object.prototype.hasOwnProperty.call(Object, 'hasOwn')) {
|
||||
Object.defineProperty(Object, 'hasOwn', {
|
||||
value: (object: object, property: PropertyKey) => {
|
||||
return Object.prototype.hasOwnProperty.call(object, property);
|
||||
},
|
||||
});
|
||||
}
|
||||
};
|
Loading…
x
Reference in New Issue
Block a user