jsonpath icon indicating copy to clipboard operation
jsonpath copied to clipboard

use of instanceof is incorrect

Open elshor opened this issue 8 years ago • 1 comments

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'

elshor avatar May 21 '17 16:05 elshor

You are right, it also started failing for me when I polyfilled browser APIs, while upgrading MSW to V2.

jjoselv avatar Aug 27 '25 13:08 jjoselv