(path: string)
| 550 | * alternative is a persisted secret. `names.0` is untouched, because its |
| 551 | * container names nothing. */ |
| 552 | export const pathNamesASecret = (path: string): boolean => { |
| 553 | const segments = path.split("."); |
| 554 | const named = segments.filter((segment) => !isIndexSegment(segment)); |
| 555 | const leaf = named[named.length - 1] ?? ""; |
| 556 | if (keyNamesASecret(leaf)) return true; |
| 557 | return segments.some( |
| 558 | (segment, index) => |
| 559 | !isIndexSegment(segment) && |
| 560 | isIndexSegment(segments[index + 1] ?? "") && |
| 561 | keyNamesASecret(segment), |
| 562 | ); |
| 563 | }; |
| 564 | |
| 565 | /** |
| 566 | * Walk an actual JSON response body and return its scalar leaves as |
no test coverage detected