fix(ext/node): add APIs perf_hook.performance (#21192)

Required for Next.js.
This commit is contained in:
Bartek Iwańczuk 2023-11-14 12:03:09 +01:00 committed by GitHub
parent 886652156e
commit cf6673b23d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 1 deletions

View file

@ -16,7 +16,7 @@ const constants = {};
const performance:
& Omit<
Performance,
"clearMeasures" | "getEntries" | "getEntriesByName" | "getEntriesByType"
"clearMeasures" | "getEntries"
>
& {
// deno-lint-ignore no-explicit-any
@ -58,6 +58,9 @@ const performance:
// deno-lint-ignore no-explicit-any
return (shimPerformance as any).timeOrigin;
},
getEntriesByName: (name, type) =>
shimPerformance.getEntriesByName(name, type),
getEntriesByType: (type) => shimPerformance.getEntriesByType(type),
markResourceTiming: () => {},
// @ts-ignore waiting on update in `deno`, but currently this is
// a circular dependency