MCPcopy
hub / github.com/electron/forge / underscoreCase

Function underscoreCase

packages/api/core/src/util/forge-config.ts:17–21  ·  view source on GitHub ↗
(str: string)

Source from the content-addressed store, hash-verified

15import { readRawPackageJson } from './read-package-json';
16
17const underscoreCase = (str: string) =>
18 str
19 .replace(/(.)([A-Z][a-z]+)/g, '$1_$2')
20 .replace(/([a-z0-9])([A-Z])/g, '$1_$2')
21 .toUpperCase();
22
23// Why: needs access to Object methods and also needs to be able to match any interface.
24type ProxiedObject = object;

Callers 3

proxifyFunction · 0.85
getFunction · 0.85
getOwnPropertyDescriptorFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected