refactor: replace Object.prototype.hasOwnProperty() with Object.hasOwn() (#38929)

This commit is contained in:
Milan Burda 2023-06-27 22:57:33 +02:00 committed by GitHub
parent 09669f9d21
commit 607e71d563
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 13 additions and 17 deletions

View file

@ -81,7 +81,7 @@ let routeFailure = false;
respondNTimes.toRoutes = (routes: Record<string, http.RequestListener>, n: number) => {
return respondNTimes((request, response) => {
if (Object.prototype.hasOwnProperty.call(routes, request.url || '')) {
if (Object.hasOwn(routes, request.url || '')) {
(async () => {
await Promise.resolve(routes[request.url || ''](request, response));
})().catch((err) => {