@sparted/shared-library 1.0.24 → 1.0.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ export declare const innerJoin: <T, U>(arr1: T[], arr2: U[], selectKey1: (item: T) => string | number, selectKey2: (item: U) => string | number) => T[];
@@ -3,9 +3,8 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const leftOutterJoin = (arr1, arr2, selectKey1, selectKey2) => {
6
- const arr2Set = arr2.reduce((acc, item) => acc.add(selectKey2(item)), new Set());
7
- const leftOutterJoinedArr = arr1.filter((item) => !arr2Set.has(selectKey1(item)));
8
- return leftOutterJoinedArr;
6
+ const arr2Set = new Set(arr2.map(selectKey2));
7
+ return arr1.filter((item) => !arr2Set.has(selectKey1(item)));
9
8
  };
10
9
 
11
10
  exports.leftOutterJoin = leftOutterJoin;
@@ -1 +1 @@
1
- {"version":3,"file":"left-outter-join.js","sources":["../../src/array/left-outter-join.ts"],"sourcesContent":["export const leftOutterJoin = <T, U>(\n arr1: T[],\n arr2: U[],\n selectKey1: (item: T) => string | number,\n selectKey2: (item: U) => string | number,\n) => {\n const arr2Set = arr2.reduce((acc, item) => acc.add(selectKey2(item)), new Set<string | number>());\n\n const leftOutterJoinedArr = arr1.filter((item) => !arr2Set.has(selectKey1(item)));\n\n return leftOutterJoinedArr;\n};\n"],"names":[],"mappings":";;;;AAAO,MAAM,cAAc,GAAG,CAC5B,IAAS,EACT,IAAS,EACT,UAAwC,EACxC,UAAwC,KACtC;IACF,MAAM,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,IAAI,KAAK,GAAG,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,GAAG,EAAmB,CAAC,CAAC;IAElG,MAAM,mBAAmB,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,IAAI,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAElF,IAAA,OAAO,mBAAmB,CAAC;AAC7B;;;;"}
1
+ {"version":3,"file":"left-outter-join.js","sources":["../../src/array/left-outter-join.ts"],"sourcesContent":["export const leftOutterJoin = <T, U>(\n arr1: T[],\n arr2: U[],\n selectKey1: (item: T) => string | number,\n selectKey2: (item: U) => string | number,\n) => {\n const arr2Set = new Set(arr2.map(selectKey2));\n\n return arr1.filter((item) => !arr2Set.has(selectKey1(item)));\n};\n"],"names":[],"mappings":";;;;AAAO,MAAM,cAAc,GAAG,CAC5B,IAAS,EACT,IAAS,EACT,UAAwC,EACxC,UAAwC,KACtC;AACF,IAAA,MAAM,OAAO,GAAG,IAAI,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC;IAE9C,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,IAAI,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAC/D;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sparted/shared-library",
3
- "version": "1.0.24",
3
+ "version": "1.0.25",
4
4
  "repository": "git@github.com:Sparted/shared-library.git",
5
5
  "author": {
6
6
  "name": "Sparted",