Style extraction and reconstruction utilities for MAGIC schema. These functions enable parsing styled text and reconstructing it from MAGIC log entries.
Applies style ranges back to plain text to reconstruct styled output.
Plain text message
Optional
Array of style ranges
Function to apply a style to text
Styled text
const styled = applyStyles( "Error: User john@example.com not found", [[0, 6, "red.bold"], [12, 29, "cyan"]], (text, style) => `<${style}>${text}</>`);// Returns: "<red.bold>Error:</> User <cyan>john@example.com</> not found" Copy
const styled = applyStyles( "Error: User john@example.com not found", [[0, 6, "red.bold"], [12, 29, "cyan"]], (text, style) => `<${style}>${text}</>`);// Returns: "<red.bold>Error:</> User <cyan>john@example.com</> not found"
Style extraction and reconstruction utilities for MAGIC schema. These functions enable parsing styled text and reconstructing it from MAGIC log entries.