* Split a camelCase or PascalCase string into words.
(str: string)
| 1996 | * Split a camelCase or PascalCase string into words. |
| 1997 | */ |
| 1998 | function 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 |