MCPcopy Create free account
hub / github.com/astercloud/aster / indentCode

Function indentCode

pkg/tools/bridge/runtime.go:333–344  ·  view source on GitHub ↗

indentCode 缩进代码

(code string, indent string)

Source from the content-addressed store, hash-verified

331
332// indentCode 缩进代码
333func indentCode(code string, indent string) string {
334 lines := strings.Split(code, "\n")
335 var indented []string
336 for _, line := range lines {
337 if strings.TrimSpace(line) == "" {
338 indented = append(indented, "")
339 } else {
340 indented = append(indented, indent+line)
341 }
342 }
343 return strings.Join(indented, "\n")
344}
345
346// NodeJSRuntime Node.js 运行时
347type NodeJSRuntime struct {

Callers 1

wrapCodeMethod · 0.85

Calls 1

JoinMethod · 0.45

Tested by

no test coverage detected