MCPcopy Create free account
hub / github.com/Kong/insomnia / getUnsyncedRemoteWorkspaces

Function getUnsyncedRemoteWorkspaces

packages/insomnia/src/common/project.ts:253–267  ·  view source on GitHub ↗
(remoteFiles: InsomniaFile[], workspaces: Workspace[])

Source from the content-addressed store, hash-verified

251}
252
253export 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

Callers 2

project.test.tsFile · 0.90

Calls 3

filterMethod · 0.80
addMethod · 0.80
hasMethod · 0.45

Tested by

no test coverage detected