Skip to content

String

Helper functions for string-based operations from files.

function formatWithPrettier(text, language, repoRoot): Promise<string>;

Defined in: functions/string.ts:15

Helper function to format a text string with Prettier.

This is useful to ensure that a file is correctly formatted after modifying it but before writing it back to disk.

Parameter Type
text string
language string
repoRoot string

Promise<string>


function setContentInsideHTMLMarker(original, text, markerName): string;

Defined in: functions/string.ts:36

Helper function to set the content between two HTML comments.

For example, if the string has two lines containing “” and “”, then you would call this function with a marker name of “RULES_TABLE”.

Parameter Type
original string
text string
markerName string

string

The modified string.