MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / splitCamelCase

Function splitCamelCase

src/resolution/name-matcher.ts:1998–2003  ·  view source on GitHub ↗

* Split a camelCase or PascalCase string into words.

(str: string)

Source from the content-addressed store, hash-verified

1996 * Split a camelCase or PascalCase string into words.
1997 */
1998function splitCamelCase(str: string): string[] {
1999 return str.replace(/([a-z])([A-Z])/g, '$1 $2')
2000 .replace(/([A-Z]+)([A-Z][a-z])/g, '$1 $2')
2001 .split(/[\s._:\/\\]+/)
2002 .filter(w => w.length > 1);
2003}
2004
2005/**
2006 * Compute directory proximity from a pre-split list of directory segments

Callers 1

matchMethodCallFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected