From beceb9d58e7e51562604ad9dfe10746af660218b Mon Sep 17 00:00:00 2001 From: Vincent Ahrend Date: Sun, 19 Sep 2021 10:36:27 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#55724=20[node]=20F?= =?UTF-8?q?ix=20property=20'detail'=20of=20PerformanceEntry=20by=20@cafca?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Fix property 'detail' of PerformanceEntry This spelling mistake in a property name has been fixed in node.js per https://github.com/nodejs/node/pull/40019 * Add missing comma * Fix 'detail' property name in perf_hooks test --- types/node/perf_hooks.d.ts | 2 +- types/node/test/perf_hooks.ts | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/types/node/perf_hooks.d.ts b/types/node/perf_hooks.d.ts index 02f330c7b1d468..5bfb931c19858b 100644 --- a/types/node/perf_hooks.d.ts +++ b/types/node/perf_hooks.d.ts @@ -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._ diff --git a/types/node/test/perf_hooks.ts b/types/node/test/perf_hooks.ts index 41c7de5f978d31..fca32a1516fe61 100644 --- a/types/node/test/perf_hooks.ts +++ b/types/node/test/perf_hooks.ts @@ -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) { @@ -64,7 +64,7 @@ obs.observe({ entryTypes: ['gc'], }); obs.observe({ - type: 'gc' + type: 'gc', }); const monitor: IntervalHistogram = monitorEventLoopDelay({