(value, sourcePath, results)
| 120 | } |
| 121 | |
| 122 | function collectSnapshots(value, sourcePath, results) { |
| 123 | if (Array.isArray(value)) { |
| 124 | value.forEach((item) => collectSnapshots(item, sourcePath, results)); |
| 125 | return; |
| 126 | } |
| 127 | |
| 128 | if (!value || typeof value !== "object") { |
| 129 | return; |
| 130 | } |
| 131 | |
| 132 | const snapshot = normalizeSnapshot(value, sourcePath, results.length); |
| 133 | if (snapshot) { |
| 134 | results.push(snapshot); |
| 135 | return; |
| 136 | } |
| 137 | |
| 138 | Object.values(value).forEach((nested) => { |
| 139 | if (nested && typeof nested === "object") { |
| 140 | collectSnapshots(nested, sourcePath, results); |
| 141 | } |
| 142 | }); |
| 143 | } |
| 144 | |
| 145 | function parseUsageContent(content) { |
| 146 | const trimmed = content.trim(); |
no test coverage detected