@yoyo-org/progressive-json
Version:
Stream and render JSON data as it arrives - perfect for AI responses, large datasets, and real-time updates
10 lines (9 loc) • 493 B
TypeScript
export type PlaceholderPath = Array<string | number>;
export type RefPathMap = Record<number, PlaceholderPath>;
/**
* Recursively finds all placeholders in the value and returns a mapping from refId to their path.
* @param value The object/array to search
* @param currentPath The path so far (for recursion)
* @param result The result map (for recursion)
*/
export declare function findPlaceholders<T = unknown>(value: T, currentPath?: PlaceholderPath, result?: RefPathMap): RefPathMap;