MCPcopy Create free account
hub / github.com/OpenListTeam/OpenList / ExtractFolder

Function ExtractFolder

internal/model/obj.go:117–133  ·  view source on GitHub ↗
(objs []Obj, extractFolder string)

Source from the content-addressed store, hash-verified

115}
116
117func ExtractFolder(objs []Obj, extractFolder string) {
118 if extractFolder == "" {
119 return
120 }
121 front := extractFolder == "front"
122 sort.SliceStable(objs, func(i, j int) bool {
123 if objs[i].IsDir() || objs[j].IsDir() {
124 if !objs[i].IsDir() {
125 return !front
126 }
127 if !objs[j].IsDir() {
128 return front
129 }
130 }
131 return false
132 })
133}
134
135func WrapObjName(objs Obj) Obj {
136 return &ObjWrapName{Name: utils.MappingName(objs.GetName()), Obj: objs}

Callers 5

ListMethod · 0.92
listFunction · 0.92
ListArchiveFunction · 0.92
GetSortedObjectsMethod · 0.92
listFunction · 0.92

Calls 1

IsDirMethod · 0.65

Tested by

no test coverage detected