|
1 | 1 | import type { |
2 | 2 | AnyNode, |
3 | 3 | AssignmentExpression, |
4 | | - AcornFunction as Function, |
| 4 | + Function, |
5 | 5 | AwaitExpression, |
6 | 6 | Expression, |
7 | 7 | Identifier, |
8 | 8 | MethodDefinition, |
9 | 9 | Property, |
10 | 10 | } from 'acorn'; |
11 | | -import type { FullAncestorWalkerCallbackWithState } from 'acorn-walk'; |
| 11 | +import type { FullAncestorWalkerCallback } from 'acorn-walk'; |
12 | 12 |
|
13 | 13 | export type WalkerState = { |
14 | 14 | isModified: boolean; |
@@ -107,7 +107,7 @@ export function asyncifyScope(ancestors: AnyNode[], state: WalkerState) { |
107 | 107 | state.functionIdentifiers.add(identifier); |
108 | 108 | } |
109 | 109 |
|
110 | | -export function buildFixModifiedFunctionsOperation(functionIdentifiers: Set<string>): FullAncestorWalkerCallbackWithState<WalkerState> { |
| 110 | +export function buildFixModifiedFunctionsOperation(functionIdentifiers: Set<string>): FullAncestorWalkerCallback<WalkerState> { |
111 | 111 | return function _fixModifiedFunctionsOperation(node, state, ancestors) { |
112 | 112 | if (node.type !== 'CallExpression') return; |
113 | 113 |
|
@@ -146,7 +146,7 @@ export function buildFixModifiedFunctionsOperation(functionIdentifiers: Set<stri |
146 | 146 | }; |
147 | 147 | } |
148 | 148 |
|
149 | | -export const checkReassignmentOfModifiedIdentifiers: FullAncestorWalkerCallbackWithState<WalkerState> = ( |
| 149 | +export const checkReassignmentOfModifiedIdentifiers: FullAncestorWalkerCallback<WalkerState> = ( |
150 | 150 | node, |
151 | 151 | { functionIdentifiers }, |
152 | 152 | _ancestors, |
@@ -190,7 +190,7 @@ export const checkReassignmentOfModifiedIdentifiers: FullAncestorWalkerCallbackW |
190 | 190 | } |
191 | 191 | }; |
192 | 192 |
|
193 | | -export const fixLivechatIsOnlineCalls: FullAncestorWalkerCallbackWithState<WalkerState> = (node, state, ancestors) => { |
| 193 | +export const fixLivechatIsOnlineCalls: FullAncestorWalkerCallback<WalkerState> = (node, state, ancestors) => { |
194 | 194 | if (node.type !== 'MemberExpression' || node.computed) return; |
195 | 195 |
|
196 | 196 | if ((node.property as Identifier).name !== 'isOnline') return; |
@@ -222,7 +222,7 @@ export const fixLivechatIsOnlineCalls: FullAncestorWalkerCallbackWithState<Walke |
222 | 222 | state.isModified = true; |
223 | 223 | }; |
224 | 224 |
|
225 | | -export const fixRoomUsernamesCalls: FullAncestorWalkerCallbackWithState<WalkerState> = (node, state, ancestors) => { |
| 225 | +export const fixRoomUsernamesCalls: FullAncestorWalkerCallback<WalkerState> = (node, state, ancestors) => { |
226 | 226 | if (node.type !== 'MemberExpression' || node.computed) return; |
227 | 227 |
|
228 | 228 | if ((node.property as Identifier).name !== 'usernames') return; |
|
0 commit comments