Skip to content

Commit

Permalink
fix: Display keystatuseschange.expiration as a Date (#48)
Browse files Browse the repository at this point in the history
The values is the number of milliseconds from epoch which isn't
readable, so display it as a Date if possible.

Fixes #42
  • Loading branch information
jrummell-chromium authored Jun 24, 2022
1 parent 01292c1 commit d5d15f6
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions eme-trace-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,14 @@ function getSerializable(obj) {
if (k.startsWith('__TraceAnything') || typeof obj[k] == 'function') {
continue;
}

// 'keystatuseschange.expiration' is returned as a ECMAScript Time Value,
// so convert it into a Date if specified for better readability.
if (k == 'expiration' && !isNaN(obj[k])) {
clone[k] = getSerializable(new Date(obj[k]));
continue;
}

clone[k] = getSerializable(obj[k]);
}
// Make sure generated IDs get logged. Do this through a synthetic field.
Expand Down

0 comments on commit d5d15f6

Please sign in to comment.