MCPcopy Create free account
hub / github.com/NomicFoundation/hardhat / camelToSnakeCase

Function camelToSnakeCase

packages/hardhat-utils/src/string.ts:60–62  ·  view source on GitHub ↗
(str: string)

Source from the content-addressed store, hash-verified

58 * @returns The snake_case string.
59 */
60export function camelToSnakeCase(str: string): string {
61 return str.replace(/[A-Z0-9]/g, (match) => `_${match.toLowerCase()}`);
62}
63
64/**
65 * Converts a camelCase string to kebab-case.

Callers 2

string.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected