(value: unknown, keys: Set<string>, seen: WeakSet<object>)
| 52 | } |
| 53 | |
| 54 | function collectUserFileKeysInto(value: unknown, keys: Set<string>, seen: WeakSet<object>): void { |
| 55 | if (!value || typeof value !== 'object') { |
| 56 | return |
| 57 | } |
| 58 | |
| 59 | if (seen.has(value)) { |
| 60 | return |
| 61 | } |
| 62 | seen.add(value) |
| 63 | |
| 64 | if (isUserFileWithMetadata(value)) { |
| 65 | keys.add(value.key) |
| 66 | return |
| 67 | } |
| 68 | |
| 69 | if (Array.isArray(value)) { |
| 70 | for (const item of value) { |
| 71 | collectUserFileKeysInto(item, keys, seen) |
| 72 | } |
| 73 | return |
| 74 | } |
| 75 | |
| 76 | for (const item of Object.values(value)) { |
| 77 | collectUserFileKeysInto(item, keys, seen) |
| 78 | } |
| 79 | } |
| 80 | |
| 81 | /** |
| 82 | * Checks if a value matches the display-safe UserFile metadata shape after internal fields are stripped. |
no test coverage detected