Skip to content

Commit 9b6e42a

Browse files
AnastasiiaSvietlovagingerbenw
authored andcommitted
fix tests
1 parent 68d4b6e commit 9b6e42a

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

packages/core/src/lib/derecursify.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,11 @@ const derecursify = (data: unknown): {} => {
5151
}
5252

5353
// handle arrays, and all iterable non-array types (such as Set)
54-
const symbol = Symbol.iterator as keyof object
55-
if (isArray(obj) || obj[symbol]) {
54+
if (isArray(obj) || obj instanceof Set || obj instanceof Map) {
5655
seen.push(obj)
5756
const safeArray = []
5857
try {
59-
for (const value of Object.keys(obj)) {
58+
for (const value of obj) {
6059
safeArray.push(visit(value))
6160
}
6261
} catch (err: any) {

packages/core/tsconfig.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"compilerOptions": {
3+
"target": "es2020",
34
"esModuleInterop": true,
45
"lib": [ "dom", "es2022" ],
56
"strict": true,

0 commit comments

Comments
 (0)