nodejs: hasOwnProperty() used instead of hasOwn() for NodeJS v.14

This commit is contained in:
rivexe
2023-05-10 10:33:16 +03:00
parent f7000b51a7
commit 35798a7916
2 changed files with 3 additions and 2 deletions

View File

@ -16,5 +16,6 @@ module.exports = {
'no-continue': 'off',
'no-extend-native': ['error', { exceptions: ['String'] }],
'no-plusplus': ['error', { allowForLoopAfterthoughts: true }],
'no-prototype-builtins': 'off',
},
};

View File

@ -807,7 +807,7 @@ app.post('/track', async (req, res) => { // define a handler for tracking file c
// check jwt token
if (cfgSignatureEnable && cfgSignatureUseForRequest) {
let body = null;
if (Object.hasOwn(req.body, 'token')) { // if request body has its own token
if (req.body.hasOwnProperty('token')) { // if request body has its own token
body = documentService.readToken(req.body.token); // read and verify it
} else {
const checkJwtHeaderRes = documentService.checkJwtHeader(req); // otherwise, check jwt token headers
@ -835,7 +835,7 @@ app.post('/track', async (req, res) => { // define a handler for tracking file c
return;
}
if (Object.hasOwn(req.body, 'status')) { // if the request body has status parameter
if (req.body.hasOwnProperty('status')) { // if the request body has status parameter
await processTrack(res, req.body, fName, uAddress); // track file changes
} else {
await readbody(req, res, fName, uAddress); // otherwise, read request body first