(value, path)
| 356 | } |
| 357 | |
| 358 | function getValueByPath(value, path) { |
| 359 | const keys = path.split('.').filter(Boolean); |
| 360 | let current = value; |
| 361 | |
| 362 | for (const key of keys) { |
| 363 | if (current === null || current === undefined) { |
| 364 | return undefined; |
| 365 | } |
| 366 | |
| 367 | if (Array.isArray(current)) { |
| 368 | if (/^\d+$/.test(key)) { |
| 369 | current = current[Number(key)]; |
| 370 | } else { |
| 371 | const values = current |
| 372 | .map(item => getValueByPath(item, key)) |
| 373 | .filter(item => item !== undefined); |
| 374 | current = values.length > 0 ? values : undefined; |
| 375 | } |
| 376 | continue; |
| 377 | } |
| 378 | |
| 379 | current = current[key]; |
| 380 | } |
| 381 | |
| 382 | return current; |
| 383 | } |
| 384 | |
| 385 | function formatDisplayFieldValue(value) { |
| 386 | if (value === null) return 'null'; |
no outgoing calls
no test coverage detected