import { FsFilesQuery, FilesQuery } from '../gql'

export function danglingFsFiles(fsFiles: FsFilesQuery | undefined, dbFiles: FilesQuery | undefined) {
  return fsFiles && fsFiles.fsFiles.filter(fsFile => dbFiles && !dbFiles.files.map(dbFile => dbFile && dbFile.path).includes(fsFile && fsFile.path))
}

// export function danglingDbFiles(fsFiles: FsFile[], dbFiles: File[]) {
//   return fsFiles.filter(fsFile => !dbFiles.map(dbFile => dbFile.path).includes(fsFile.path))
// }