Add iteration support in the PDFObjects
class
This (obviously) only includes "resolved" data, and will be used in an upcoming patch.
This commit is contained in:
parent
7ea0e40e58
commit
b09f238436
@ -3125,7 +3125,7 @@ class PDFObjects {
|
||||
*/
|
||||
has(objId) {
|
||||
const obj = this.#objs[objId];
|
||||
return obj?.capability.settled || false;
|
||||
return obj?.capability.settled ?? false;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -3147,6 +3147,17 @@ class PDFObjects {
|
||||
}
|
||||
this.#objs = Object.create(null);
|
||||
}
|
||||
|
||||
*[Symbol.iterator]() {
|
||||
for (const objId in this.#objs) {
|
||||
const { capability, data } = this.#objs[objId];
|
||||
|
||||
if (!capability.settled) {
|
||||
continue;
|
||||
}
|
||||
yield [objId, data];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user