@eagleoutice/flowr
Version:
Static Dataflow Analyzer and Program Slicer for the R Programming Language
28 lines (27 loc) • 1.15 kB
TypeScript
/**
* Check if the given string starts and ends with the given letter
*/
export declare function startAndEndsWith(str: string, letter: string): boolean;
/**
* Removes all whitespace in the given string
*/
export declare function withoutWhitespace(output: string): string;
/**
* Find the longest common prefix in an array of strings
*/
export declare function longestCommonPrefix(strings: string[]): string;
/**
* Join a list of strings, but with special handling for the last element/scenarios in which the array contains exactly two elements.
* The goal is to create (partial) sentences like `a, b, and c` or `a and b`.
*/
export declare function joinWithLast(strs: readonly string[], { join, last, joinTwo }?: {
join?: string;
last?: string;
joinTwo?: string;
}): string;
/**
* Check if the given path is an absolute path.
*/
export declare function isAbsolutePath(p: string, regex: RegExp | undefined): boolean;
/** collect '-' at the start until '[' or '(' is reached, then drop the same from the end if present otherwise return the value as is */
export declare function dropRawStringSurround(value: string): string;