Azure / ms-rest-nodeauth

node.js based authentication library for Azure with type definitions
MIT License
33 stars 33 forks source link

Line 4959 could be more robust. #116

Closed Packmanager9 closed 3 years ago

Packmanager9 commented 3 years ago

Given that the 'in' operator will throw an error error and fail: 'Cannot use 'in' operator to search for 'top' in 1'

A different method of deriving the key presence could be used.

Compare:

Original:

    if (parent != undefined && parameterPathPart in parent) {
        parent = parent[parameterPathPart];
    }

Proposed:

    if (parent != undefined && Object.keys(parent).includes(parameterPathPart)) {
        parent = parent[parameterPathPart];
    } 
Packmanager9 commented 3 years ago

Wrong repo, sorry.