cspell-lib
Version:
A library of useful functions used across various cspell tools.
18 lines • 865 B
TypeScript
import { TextOffset } from '@cspell/cspell-types';
/**
* Try to detect if a string is a random string of characters or is it camel case / snake case words.
* @param s - string to check
* @returns true if the string is considered random;
*/
export declare function isRandomString(s: string, maxNoiseToLengthRatio?: number): boolean;
/**
* Calculate the ratio of noise to the length of the string.
* @param s - string to check
* @returns true if the string is considered random;
*/
export declare function scoreRandomString(s: string): number;
export declare function scoreLongWordRatio(s: string): number;
export declare function categorizeString(s: string): string;
export declare function isHexNumber(s: string): boolean;
export declare function extractHexSequences(s: string, minLength?: number): TextOffset[];
//# sourceMappingURL=isRandomString.d.ts.map