MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / splitWords

Function splitWords

packages/plugins/openapi/src/sdk/definitions.ts:17–24  ·  view source on GitHub ↗
(value: string)

Source from the content-addressed store, hash-verified

15// ---------------------------------------------------------------------------
16
17const splitWords = (value: string): string[] =>
18 value
19 .replace(/([a-z0-9])([A-Z])/g, "$1 $2")
20 .replace(/([A-Z]+)([A-Z][a-z0-9]+)/g, "$1 $2")
21 .replace(/[^a-zA-Z0-9]+/g, " ")
22 .trim()
23 .split(/\s+/)
24 .filter((part) => part.length > 0);
25
26const normalizeWord = (value: string): string => value.toLowerCase();
27

Callers 1

toCamelCaseFunction · 0.85

Calls 1

replaceMethod · 0.65

Tested by

no test coverage detected