MCPcopy Create free account
hub / github.com/freecodexyz/free-code / isPathMetadata

Function isPathMetadata

src/hooks/useTypeahead.tsx:45–49  ·  view source on GitHub ↗
(metadata: unknown)

Source from the content-addressed store, hash-verified

43
44// Type guard for path completion metadata
45function isPathMetadata(metadata: unknown): metadata is {
46 type: 'directory' | 'file';
47} {
48 return typeof metadata === 'object' && metadata !== null && 'type' in metadata && (metadata.type === 'directory' || metadata.type === 'file');
49}
50
51// Helper to determine selectedSuggestion when updating suggestions
52function getPreservedSelection(prevSuggestions: SuggestionItem[], prevSelection: number, newSuggestions: SuggestionItem[]): number {

Callers 1

useTypeaheadFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected