mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-22 16:18:08 +02:00
Merge pull request #17764 from calixteman/telemetry_null_stats
[Editor] Use a null instead of an empty stats object when sending the telemetry
This commit is contained in:
commit
c451b6d684
1 changed files with 2 additions and 1 deletions
|
@ -214,7 +214,7 @@ class AnnotationStorage {
|
|||
}
|
||||
|
||||
get editorStats() {
|
||||
const stats = Object.create(null);
|
||||
let stats = null;
|
||||
const typeToEditor = new Map();
|
||||
for (const value of this.#storage.values()) {
|
||||
if (!(value instanceof AnnotationEditor)) {
|
||||
|
@ -228,6 +228,7 @@ class AnnotationStorage {
|
|||
if (!typeToEditor.has(type)) {
|
||||
typeToEditor.set(type, Object.getPrototypeOf(value).constructor);
|
||||
}
|
||||
stats ||= Object.create(null);
|
||||
const map = (stats[type] ||= new Map());
|
||||
for (const [key, val] of Object.entries(editorStats)) {
|
||||
if (key === "type") {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue