Skip to content

Commit 14945a5

Browse files
committed
Switch to Object.hasOwn for cleaner code.
Also finally remembered to update the Readme for the minimum browser/node version a give credit for the last few PRs (sorry folks)
1 parent 77d9236 commit 14945a5

6 files changed

+13
-9
lines changed

README.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,8 @@ and render on the server._`
260260

261261
## Dependencies
262262

263+
Uses Object.hasOwn() so needs at least Chrome/Edge 93, Firefox 92, Opera 79. Safari 15.4 or Node 16.9.0
264+
263265
### Source
264266

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

361365
## License
362366

dist/dom-to-image-more.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/dom-to-image-more.min.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package-lock.json

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "dom-to-image-more",
3-
"version": "3.4.1",
3+
"version": "3.4.2",
44
"description": "Generates an image from a DOM node using HTML5 canvas and SVG",
55
"main": "dist/dom-to-image-more.min.js",
66
"devDependencies": {

src/dom-to-image-more.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -666,7 +666,7 @@
666666
function isInShadowRoot(value) {
667667
return (
668668
value !== null &&
669-
Object.prototype.hasOwnProperty.call(value, 'getRootNode') &&
669+
Object.hasOwn(value, 'getRootNode') &&
670670
isShadowRoot(value.getRootNode())
671671
);
672672
}
@@ -938,7 +938,7 @@
938938
try {
939939
return JSON.parse(JSON.stringify(data));
940940
} catch (e) {
941-
fail('corsImg.data is missing or invalid', e.toString());
941+
fail('corsImg.data is missing or invalid:' + e.toString());
942942
return;
943943
}
944944
}
@@ -1125,7 +1125,7 @@
11251125
const cssRules = [];
11261126
styleSheets.forEach(function (sheet) {
11271127
if (
1128-
Object.prototype.hasOwnProperty.call(
1128+
Object.hasOwn(
11291129
Object.getPrototypeOf(sheet),
11301130
'cssRules'
11311131
)

0 commit comments

Comments
 (0)