Skip to content

Commit

Permalink
feat: Add Object.hasOwn polyfill
Browse files Browse the repository at this point in the history
  • Loading branch information
theBGuy committed Jan 28, 2025
1 parent f600e1c commit d6af2cb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions d2bs/kolbot/libs/Polyfill.js
Original file line number Diff line number Diff line change
Expand Up @@ -759,6 +759,12 @@ if (!Object.entries) {
};
}

if (!Object.hasOwn) {
Object.hasOwn = function (obj, prop) {
return Object.prototype.hasOwnProperty.call(obj, prop);
};
}

// eslint-disable-next-line no-var
if (typeof global === "undefined") var global = [].filter.constructor("return this")();
// eslint-disable-next-line dot-notation
Expand Down
1 change: 1 addition & 0 deletions d2bs/kolbot/sdk/globals.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ declare global {
values(source: object): any[];
entries(source: object): any[][];
is(o1: any, o2: any): boolean;
hasOwn(obj: object, prop: string): boolean;
}

interface Object {
Expand Down

0 comments on commit d6af2cb

Please sign in to comment.