MCPcopy
hub / github.com/vitest-dev/vitest / minIndent

Function minIndent

packages/browser/src/client/tester/expect/utils.ts:117–125  ·  view source on GitHub ↗
(string: string)

Source from the content-addressed store, hash-verified

115}
116
117function minIndent(string: string) {
118 const match = string.match(/^[ \t]*(?=\S)/gm)
119
120 if (!match) {
121 return 0
122 }
123
124 return match.reduce((r, a) => Math.min(r, a.length), Infinity)
125}
126
127function stripIndent(string: string) {
128 const indent = minIndent(string)

Callers 1

stripIndentFunction · 0.85

Calls 1

matchMethod · 0.45

Tested by

no test coverage detected