meows
Version:
A kittybin of tools.
28 lines (27 loc) • 1.02 kB
TypeScript
export declare const space = " ";
export declare const spaces: RegExp;
export declare const character = "";
export declare const alphabet: string[];
/** Split string by spaces. */
export declare const split_by_spaces: (str: string) => string[];
/** Alphabetical character → prime number. */
export declare const alpha_to_prime: (alphabet: string) => any;
/**
* word anagram → prime product
*
* @description
* An anagram is any rearrangement of a string. Conveniently, the product of
* primes is the same regardless of order, and also allows us to count how many
* of each prime was used, acting as an identity for anagrams.
*
* @example
* anagram_to_id('listen') === anagram_to_id('silent') // => true
* anagram_to_id('admirer') === anagram_to_id('married') // => true
*/
export declare const anagram_to_id: (word: string) => any;
/**
* Strips a string of all normal whitespaces.
* @example
* stripSpaces(' a b c ' ) // => 'abc'
*/
export declare const stripSpaces: (str: string) => string;