MCPcopy
hub / github.com/pocketbase/pocketbase / excludeFiles

Method excludeFiles

core/field_file.go:799–814  ·  view source on GitHub ↗
(base []any, toExclude []any)

Source from the content-addressed store, hash-verified

797}
798
799func (f *FileField) excludeFiles(base []any, toExclude []any) []any {
800 result := make([]any, 0, len(base))
801
802SUBTRACT_LOOP:
803 for _, fv := range base {
804 for _, exclude := range toExclude {
805 if f.getFileName(exclude) == f.getFileName(fv) {
806 continue SUBTRACT_LOOP // skip
807 }
808 }
809
810 result = append(result, fv)
811 }
812
813 return result
814}
815
816func (f *FileField) getFileName(file any) string {
817 switch v := file.(type) {

Callers 4

ValidateValueMethod · 0.95
processFilesToDeleteMethod · 0.95
rememberFilesToDeleteMethod · 0.95
subtractValueMethod · 0.95

Calls 1

getFileNameMethod · 0.95

Tested by

no test coverage detected