Skip to content

Commit

Permalink
Switch to Object.hasOwn for cleaner code.
Browse files Browse the repository at this point in the history
Also finally remembered to update the Readme for the minimum browser/node version a give credit for the last few PRs (sorry folks)
  • Loading branch information
IDisposable committed Aug 26, 2024
1 parent 77d9236 commit 14945a5
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 9 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,8 @@ and render on the server._`

## Dependencies

Uses Object.hasOwn() so needs at least Chrome/Edge 93, Firefox 92, Opera 79. Safari 15.4 or Node 16.9.0

### Source

Only standard lib is currently used, but make sure your browser supports:
Expand Down Expand Up @@ -356,7 +358,9 @@ SNDST00M (optimize), Joseph White (performance CSS), Phani Rithvij (test), David
DOLCIMASCOLO (packaging), Zee (ZM) @zm-cttae (many major updates), Joshua Walsh
@JoshuaWalsh (Firefox issues), Emre Coban @emrecoban (documentation), Nate Stuyvesant
@nstuyvesant (fixes), King Wang @eachmawzw (CORS image proxy), TMM Schmit @tmmschmit
(useCredentialsFilters)
(useCredentialsFilters), Aravind @codesculpture (fix overridden props),
Shi Wenyu @cWenyu (shadow slot fix), David Burns @davidburns573
and Yujia Cheng @YujiaCheng1996 (font copy optional)

## License

Expand Down
2 changes: 1 addition & 1 deletion dist/dom-to-image-more.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/dom-to-image-more.min.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dom-to-image-more",
"version": "3.4.1",
"version": "3.4.2",
"description": "Generates an image from a DOM node using HTML5 canvas and SVG",
"main": "dist/dom-to-image-more.min.js",
"devDependencies": {
Expand Down
6 changes: 3 additions & 3 deletions src/dom-to-image-more.js
Original file line number Diff line number Diff line change
Expand Up @@ -666,7 +666,7 @@
function isInShadowRoot(value) {
return (
value !== null &&
Object.prototype.hasOwnProperty.call(value, 'getRootNode') &&
Object.hasOwn(value, 'getRootNode') &&
isShadowRoot(value.getRootNode())
);
}
Expand Down Expand Up @@ -938,7 +938,7 @@
try {
return JSON.parse(JSON.stringify(data));
} catch (e) {
fail('corsImg.data is missing or invalid', e.toString());
fail('corsImg.data is missing or invalid:' + e.toString());
return;
}
}
Expand Down Expand Up @@ -1125,7 +1125,7 @@
const cssRules = [];
styleSheets.forEach(function (sheet) {
if (
Object.prototype.hasOwnProperty.call(
Object.hasOwn(
Object.getPrototypeOf(sheet),
'cssRules'
)
Expand Down

0 comments on commit 14945a5

Please sign in to comment.