func invokeUserFilter()

in Sources/TSFCASFileTree/FileTreeImport.swift [439:458]


        func invokeUserFilter(_ path: AbsolutePath, _ type: FilesystemObjectType) -> Bool {
            let pathString = path.pathString

            guard pathString.hasPrefix(importDirPrefix) else {
                // The import path itself is automatically admissible.
                // Don't allow users to override it. We should be able to
                // import empty dirs.
                // Everything else (dirs outside `importPath`) can't happen,
                // so prohibit them just in case.
                return path == importPath
            }

            let relative = pathString.suffix(from: pathString.index(pathString.startIndex, offsetBy: importDirPrefixLength - 1))

            guard userFilter(String(relative)) else {
                return false
            }

            return true
        }