Skip to content

Commit beceb9d

Browse files
authored
🤖 Merge PR #55724 [node] Fix property 'detail' of PerformanceEntry by @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
1 parent 033ff82 commit beceb9d

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

‎types/node/perf_hooks.d.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ declare module 'perf_hooks' {
8484
* Additional detail specific to the `entryType`.
8585
* @since v16.0.0
8686
*/
87-
readonly details?: NodeGCPerformanceDetail | unknown | undefined; // TODO: Narrow this based on entry type.
87+
readonly detail?: NodeGCPerformanceDetail | unknown | undefined; // TODO: Narrow this based on entry type.
8888
}
8989
/**
9090
* _This property is an extension by Node.js. It is not available in Web browsers._

‎types/node/test/perf_hooks.ts‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ const performanceObserverCallback: PerformanceObserverCallback = (list, obs) =>
4848
const name: string = entries[0].name;
4949
const startTime: number = entries[0].startTime;
5050
const entryTypes: EntryType = entries[0].entryType;
51-
const details: NodeGCPerformanceDetail = entries[0].details as NodeGCPerformanceDetail;
52-
const kind: number | undefined = details.kind;
53-
const flags: number | undefined = details.flags;
51+
const detail: NodeGCPerformanceDetail = entries[0].detail as NodeGCPerformanceDetail;
52+
const kind: number | undefined = detail.kind;
53+
const flags: number | undefined = detail.flags;
5454

5555
if (kind === constants.NODE_PERFORMANCE_GC_MAJOR) {
5656
if (flags === constants.NODE_PERFORMANCE_GC_FLAGS_ALL_EXTERNAL_MEMORY) {
@@ -64,7 +64,7 @@ obs.observe({
6464
entryTypes: ['gc'],
6565
});
6666
obs.observe({
67-
type: 'gc'
67+
type: 'gc',
6868
});
6969

7070
const monitor: IntervalHistogram = monitorEventLoopDelay({

0 commit comments

Comments
 (0)