MCPcopy Index your code
hub / github.com/code-hike/codehike / splitSurroundingWhitespace

Function splitSurroundingWhitespace

packages/codehike/src/code/highlight.ts:167–172  ·  view source on GitHub ↗
(content: string)

Source from the content-addressed store, hash-verified

165// splits " \t foo bar \n" into [" \t ","foo bar"," \n"]
166// "foo bar" -> ["","foo bar",""]
167function splitSurroundingWhitespace(content: string) {
168 const trimmed = content.trim()
169 const before = content.slice(0, content.indexOf(trimmed))
170 const after = content.slice(content.indexOf(trimmed) + trimmed.length)
171 return [before, trimmed, after]
172}

Callers 1

splitWhitespaceFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…