| 1038 | } as any |
| 1039 | |
| 1040 | const walk = (node: any, cb: (node: any, path: (string | number)[]) => void, path: (string | number)[] = []) => { |
| 1041 | if (node === null || typeof node !== "object") { |
| 1042 | return |
| 1043 | } |
| 1044 | if (Array.isArray(node)) { |
| 1045 | node.forEach((item, i) => walk(item, cb, [...path, i])) |
| 1046 | return |
| 1047 | } |
| 1048 | cb(node, path) |
| 1049 | Object.entries(node).forEach(([key, value]) => walk(value, cb, [...path, key])) |
| 1050 | } |
| 1051 | |
| 1052 | test("keeps edits.items.anyOf without adding type", () => { |
| 1053 | const schema = { |