{"version":3,"file":"utils.cjs","sourceRoot":"","sources":["../../../src/controllers/user-storage/utils.ts"],"names":[],"mappings":";;;AAAA;;;;;;;GAOG;AACH,SAAgB,aAAa,CAAQ,CAAa,EAAE,CAAa;IAC/D,MAAM,UAAU,GAAG,IAAI,GAAG,EAAS,CAAC;IACpC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IACjD,OAAO,UAAU,CAAC;AACpB,CAAC;AAJD,sCAIC;AAED;;;;;;;GAOG;AACH,SAAgB,eAAe,CAC7B,CAAa,EACb,CAAa;IAEb,MAAM,YAAY,GAAG,IAAI,GAAG,EAAS,CAAC;IACtC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IAClD,OAAO,YAAY,CAAC;AACtB,CAAC;AAPD,0CAOC","sourcesContent":["/**\n * Returns the difference between 2 sets.\n * NOTE - this is temporary until we can support Set().difference method\n *\n * @param a - First Set\n * @param b - Second Set\n * @returns The difference between the first and second set.\n */\nexport function setDifference<TItem>(a: Set<TItem>, b: Set<TItem>): Set<TItem> {\n  const difference = new Set<TItem>();\n  a.forEach((e) => !b.has(e) && difference.add(e));\n  return difference;\n}\n\n/**\n * Returns the intersection between 2 sets.\n * NOTE - this is temporary until we can support Set().intersection method\n *\n * @param a - First Set\n * @param b - Second Set\n * @returns The intersection between the first and second set.\n */\nexport function setIntersection<TItem>(\n  a: Set<TItem>,\n  b: Set<TItem>,\n): Set<TItem> {\n  const intersection = new Set<TItem>();\n  a.forEach((e) => b.has(e) && intersection.add(e));\n  return intersection;\n}\n"]}