(remoteFiles: InsomniaFile[], workspaces: Workspace[])
| 251 | } |
| 252 | |
| 253 | export const getUnsyncedRemoteWorkspaces = (remoteFiles: InsomniaFile[], workspaces: Workspace[]) => { |
| 254 | const seenIds = new Set<string>(); |
| 255 | const uniqueRemoteFiles = remoteFiles.filter(file => { |
| 256 | if (seenIds.has(file.id)) { |
| 257 | console.warn( |
| 258 | `[Duplicate Remote File] Duplicate remote file found with id: ${file.id} and remote id: ${file.remoteId}`, |
| 259 | ); |
| 260 | return false; |
| 261 | } |
| 262 | seenIds.add(file.id); |
| 263 | return true; |
| 264 | }); |
| 265 | |
| 266 | return uniqueRemoteFiles.filter(remoteFile => !workspaces.some(w => w._id === remoteFile.id)); |
| 267 | }; |
| 268 | |
| 269 | /** |
| 270 | * Get all projects for an organization with their associated git repositories |
no test coverage detected