1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-19 06:38:07 +02:00

Simplify the getAnnotationStorage integration-test helper function

As can be seen [at MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/fromEntries#parameters) the `Object.fromEntries` method accepts a `Map` directly, hence using the `Map.prototype.entries` method is superfluous here.
This commit is contained in:
Jonas Jenwald 2025-04-09 13:42:22 +02:00
parent 22657e2b6e
commit 60bf9b133a

View file

@ -466,8 +466,8 @@ async function getFirstSerialized(page, filter = undefined) {
function getAnnotationStorage(page) {
return page.evaluate(() =>
Object.fromEntries(
window.PDFViewerApplication.pdfDocument.annotationStorage.serializable.map?.entries() ||
[]
window.PDFViewerApplication.pdfDocument.annotationStorage.serializable
.map || []
)
);
}