(path: QueryNodePath<QueryNode<any>>, callback: TraversalCallback)
| 57 | } |
| 58 | |
| 59 | export function traverseSubTree(path: QueryNodePath<QueryNode<any>>, callback: TraversalCallback) { |
| 60 | const callbackResult = callback(path, $cancelToken) |
| 61 | if (callbackResult === $cancelToken) return |
| 62 | |
| 63 | for (const key of Object.keys((path.node as any)[path.type])) { |
| 64 | const propValue = (path.node as any)[path.type][key] |
| 65 | |
| 66 | if (Array.isArray(propValue)) { |
| 67 | traverseArray(path, propValue, key, callback) |
| 68 | } else if (propValue && typeof propValue === "object") { |
| 69 | const propPath = createQueryNodeSubpath(path, propValue, key) |
| 70 | traverseSubTree(propPath, callback) |
| 71 | } |
| 72 | } |
| 73 | } |
| 74 | |
| 75 | export function getQueryPathParent( |
| 76 | path: QueryNodePath<QueryNode<any>> |
no test coverage detected