llm-json-fix
Version:
Fix malformed JSON outputs from Large Language Models (LLMs)
48 lines • 1.47 kB
TypeScript
/**
* Checks if a character is a whitespace character
*/
export declare function isWhitespace(char: string): boolean;
/**
* Checks if a character is a line terminator
*/
export declare function isLineTerminator(char: string): boolean;
/**
* Checks if a character is a digit
*/
export declare function isDigit(char: string): boolean;
/**
* Checks if a character is a letter
*/
export declare function isAlpha(char: string): boolean;
/**
* Checks if a character can be part of a valid identifier
*/
export declare function isIdentifierChar(char: string): boolean;
/**
* Get the position in the text as line:column
*/
export declare function getPositionDetails(text: string, index: number): {
line: number;
column: number;
};
/**
* Format a position as a string
*/
export declare function formatPosition(text: string, index: number): string;
/**
* Extracts text that is likely markdown-formatted code blocks
*/
export declare function extractMarkdownCodeBlocks(text: string): string[] | null;
/**
* Normalizes different quote styles to standard double quotes
*/
export declare function normalizeQuotes(text: string): string;
/**
* Checks if text contains common markdown indicators
*/
export declare function containsMarkdown(text: string): boolean;
/**
* Checks if the text appears to be LLM formatted output with natural language
*/
export declare function isLLMStyleOutput(text: string): boolean;
//# sourceMappingURL=stringUtils.d.ts.map