jsonpath
jsonpath copied to clipboard
use of instanceof is incorrect
Hey,
I tried to use the library where the library was created in a different scope than the tested object. This can happen in situation where using different frames for the require of the library and the tested object. In such situations the library fails. I suggest changing "x instanceof Array" to "Array.isArray(x)" and "x instanceof Object" to "typeof x === 'object'
You are right, it also started failing for me when I polyfilled browser APIs, while upgrading MSW to V2.