( comments: Record<string, any>, path: string[], key: string, hint: string, )
| 288 | } |
| 289 | |
| 290 | function setCommentAtPath( |
| 291 | comments: Record<string, any>, |
| 292 | path: string[], |
| 293 | key: string, |
| 294 | hint: string, |
| 295 | ): void { |
| 296 | let current = comments; |
| 297 | |
| 298 | // Navigate to the correct nested location |
| 299 | for (const pathKey of path) { |
| 300 | if (!current[pathKey]) { |
| 301 | current[pathKey] = {}; |
| 302 | } |
| 303 | current = current[pathKey]; |
| 304 | } |
| 305 | |
| 306 | // Set the hint for the key |
| 307 | if (!current[key]) { |
| 308 | current[key] = {}; |
| 309 | } |
| 310 | |
| 311 | if (typeof current[key] === "object" && current[key] !== null) { |
| 312 | current[key].hint = hint; |
| 313 | } else { |
| 314 | current[key] = { hint }; |
| 315 | } |
| 316 | } |
| 317 | |
| 318 | export default function createJsoncLoader(): ILoader< |
| 319 | string, |
no outgoing calls
no test coverage detected