@web3r/flowerkit
Version:
Tree-shakable JavaScript and TypeScript utility library for frontend/browser apps: DOM, events, arrays, objects, strings, date, JSON, and network helpers (ESM/CJS, SSR-friendly).
16 lines (15 loc) • 553 B
text/typescript
export type TIsStrInSnakeCaseArgs = Parameters<typeof isStrInSnakeCase>;
export type TIsStrInSnakeCaseReturn = ReturnType<typeof isStrInSnakeCase>;
/**
* Checks if a string is in snake_case.
* Rules:
* Lowercase letters separated by single underscores
* No leading or trailing underscore
*
* @param {string} str Source string
* @returns {boolean} True if string is snake_case
* @throws {TypeError} If str is not a string
* @example
* isStrInSnakeCase("good_snake"); // true
*/
export declare const isStrInSnakeCase: (str: string) => boolean;