Skip to content

Commit a327579

Browse files
committed
test: fix incorrect fallback
1 parent 1114790 commit a327579

File tree

1 file changed

+1
-20
lines changed

1 file changed

+1
-20
lines changed

test/test-utils.ts

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import type {
88
import type { ESLintProgram, Token } from "../src/ast"
99
import type { ParserOptions } from "../src/common/parser-options"
1010
import * as escope from "eslint-scope"
11+
import { getFallbackKeys } from "../src/ast"
1112

1213
/**
1314
* Remove `parent` properties from the given AST.
@@ -128,24 +129,4 @@ export function analyze(
128129
})
129130

130131
return result
131-
132-
function getFallbackKeys(node: any) {
133-
return Object.keys(node).filter(fallbackKeysFilter, node)
134-
}
135-
136-
function fallbackKeysFilter(key: string) {
137-
const value = null
138-
return (
139-
key !== "comments" &&
140-
key !== "leadingComments" &&
141-
key !== "loc" &&
142-
key !== "parent" &&
143-
key !== "range" &&
144-
key !== "tokens" &&
145-
key !== "trailingComments" &&
146-
typeof value === "object" &&
147-
// @ts-expect-error -- ignore
148-
(typeof value.type === "string" || Array.isArray(value))
149-
)
150-
}
151132
}

0 commit comments

Comments
 (0)