@finsweet/ts-utils
Version:
Typescript utils for custom Webflow projects.
9 lines (8 loc) • 326 B
TypeScript
/**
* Finds if a string is suffixed by `-X` and returns the value of `X`.
* @example `click-2` will return `2`.
* @example `click` will return `undefined`.
* @param string The string to extract.
* @returns The number suffix, if found.
*/
export declare const extractNumberSuffix: (string: string) => number | undefined;