MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / pathNamesASecret

Function pathNamesASecret

packages/core/sdk/src/health-check.ts:552–563  ·  view source on GitHub ↗
(path: string)

Source from the content-addressed store, hash-verified

550 * alternative is a persisted secret. `names.0` is untouched, because its
551 * container names nothing. */
552export 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

Callers 2

checkHealthOpenApiFunction · 0.90
visitFunction · 0.85

Calls 2

isIndexSegmentFunction · 0.85
keyNamesASecretFunction · 0.85

Tested by

no test coverage detected