We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2a1f1e6 commit 860106bCopy full SHA for 860106b
lib/index.ts
@@ -31,7 +31,8 @@ function convertProxyToRegExp(o: any, depth: number): any {
31
32
function convertRegExpToProxy(o: any, depth: number): any {
33
if (typeof o !== 'object' || !o || depth > 2) return o
34
- if (!(o instanceof RegExp)) {
+ // Support the cross-environment use case where `instanceof` is not sufficient, see https://github.com/testing-library/pptr-testing-library/pull/64
35
+ if (Object.prototype.toString.call(o) !== '[object RegExp]') {
36
const copy = {...o}
37
for (const key of Object.keys(copy)) {
38
copy[key] = convertRegExpToProxy(copy[key], depth + 1)
0 commit comments