MCPcopy Create free account
hub / github.com/MertJSX/folderhost / ReplaceHostPrefix

Function ReplaceHostPrefix

utils/replace_host_prefix.go:11–19  ·  view source on GitHub ↗
(input string, scope string)

Source from the content-addressed store, hash-verified

9)
10
11func ReplaceHostPrefix(input string, scope string) string {
12 input = strings.ReplaceAll(input, "\\", "/")
13 pattern := regexp.MustCompile(fmt.Sprintf(`(^|\/)%s(\/|$)`, config.Config.Folder+scope))
14
15 if pattern.MatchString(input) {
16 return pattern.ReplaceAllString(input, "${1}./")
17 }
18 return input
19}

Callers 1

GetDirectoryItemsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected