Skip to content

Commit

Permalink
🤖 Merge PR #55724 [node] Fix property 'detail' of PerformanceEntry by @…
Browse files Browse the repository at this point in the history
…cafca

* Fix property 'detail' of PerformanceEntry

This spelling mistake in a property name has been fixed in node.js per nodejs/node#40019

* Add missing comma

* Fix 'detail' property name in perf_hooks test
  • Loading branch information
cafca committed Sep 19, 2021
1 parent 033ff82 commit beceb9d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion types/node/perf_hooks.d.ts
Expand Up @@ -84,7 +84,7 @@ declare module 'perf_hooks' {
* Additional detail specific to the `entryType`.
* @since v16.0.0
*/
readonly details?: NodeGCPerformanceDetail | unknown | undefined; // TODO: Narrow this based on entry type.
readonly detail?: NodeGCPerformanceDetail | unknown | undefined; // TODO: Narrow this based on entry type.
}
/**
* _This property is an extension by Node.js. It is not available in Web browsers._
Expand Down
8 changes: 4 additions & 4 deletions types/node/test/perf_hooks.ts
Expand Up @@ -48,9 +48,9 @@ const performanceObserverCallback: PerformanceObserverCallback = (list, obs) =>
const name: string = entries[0].name;
const startTime: number = entries[0].startTime;
const entryTypes: EntryType = entries[0].entryType;
const details: NodeGCPerformanceDetail = entries[0].details as NodeGCPerformanceDetail;
const kind: number | undefined = details.kind;
const flags: number | undefined = details.flags;
const detail: NodeGCPerformanceDetail = entries[0].detail as NodeGCPerformanceDetail;
const kind: number | undefined = detail.kind;
const flags: number | undefined = detail.flags;

if (kind === constants.NODE_PERFORMANCE_GC_MAJOR) {
if (flags === constants.NODE_PERFORMANCE_GC_FLAGS_ALL_EXTERNAL_MEMORY) {
Expand All @@ -64,7 +64,7 @@ obs.observe({
entryTypes: ['gc'],
});
obs.observe({
type: 'gc'
type: 'gc',
});

const monitor: IntervalHistogram = monitorEventLoopDelay({
Expand Down

0 comments on commit beceb9d

Please sign in to comment.