feat: add performance user timing APIs (#6421)

This commit is contained in:
Kitson Kelly 2020-07-11 12:38:15 +10:00 committed by GitHub
parent d01eb6d9c5
commit 40d081d3d9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 536 additions and 26 deletions

View file

@ -208,3 +208,11 @@ export function getHeaderValueParams(value: string): Map<string, string> {
export function hasHeaderValueOf(s: string, value: string): boolean {
return new RegExp(`^${value}[\t\s]*;?`).test(s);
}
/** An internal function which provides a function name for some generated
* functions, so stack traces are a bit more readable.
*
* @internal */
export function setFunctionName(fn: Function, value: string): void {
Object.defineProperty(fn, "name", { value, configurable: true });
}