es-toolkit
Advanced tools
Comparing version 1.1.0-dev.45 to 1.1.0-dev.46
@@ -20,3 +20,3 @@ /** | ||
* @example | ||
* * const array1 = [{ id: 1 }, { id: 2 }, { id: 3 }]; | ||
* const array1 = [{ id: 1 }, { id: 2 }, { id: 3 }]; | ||
* const array2 = [{ id: 2 }, { id: 4 }]; | ||
@@ -23,0 +23,0 @@ * const mapper = item => item.id; |
@@ -27,5 +27,5 @@ "use strict"; | ||
function differenceBy(firstArr, secondArr, mapper) { | ||
const mappedSecondArr = secondArr.map((item) => mapper(item)); | ||
const mappedSecondSet = new Set(secondArr.map((item) => mapper(item))); | ||
return firstArr.filter((item) => { | ||
return !mappedSecondArr.includes(mapper(item)); | ||
return !mappedSecondSet.has(mapper(item)); | ||
}); | ||
@@ -32,0 +32,0 @@ } |
@@ -79,5 +79,5 @@ "use strict"; | ||
function differenceBy(firstArr, secondArr, mapper) { | ||
const mappedSecondArr = secondArr.map((item) => mapper(item)); | ||
const mappedSecondSet = new Set(secondArr.map((item) => mapper(item))); | ||
return firstArr.filter((item) => { | ||
return !mappedSecondArr.includes(mapper(item)); | ||
return !mappedSecondSet.has(mapper(item)); | ||
}); | ||
@@ -84,0 +84,0 @@ } |
@@ -29,5 +29,5 @@ "use strict"; | ||
function differenceBy(firstArr, secondArr, mapper) { | ||
const mappedSecondArr = secondArr.map((item) => mapper(item)); | ||
const mappedSecondSet = new Set(secondArr.map((item) => mapper(item))); | ||
return firstArr.filter((item) => { | ||
return !mappedSecondArr.includes(mapper(item)); | ||
return !mappedSecondSet.has(mapper(item)); | ||
}); | ||
@@ -34,0 +34,0 @@ } |
@@ -108,5 +108,5 @@ "use strict"; | ||
function differenceBy(firstArr, secondArr, mapper) { | ||
const mappedSecondArr = secondArr.map((item) => mapper(item)); | ||
const mappedSecondSet = new Set(secondArr.map((item) => mapper(item))); | ||
return firstArr.filter((item) => { | ||
return !mappedSecondArr.includes(mapper(item)); | ||
return !mappedSecondSet.has(mapper(item)); | ||
}); | ||
@@ -113,0 +113,0 @@ } |
{ | ||
"name": "es-toolkit", | ||
"description": "A state-of-the-art, high-performance JavaScript utility library with a small bundle size and strong type annotations.", | ||
"version": "1.1.0-dev.45+4ec747ea", | ||
"version": "1.1.0-dev.46+fa22ab16", | ||
"workspaces": [ | ||
@@ -6,0 +6,0 @@ "docs" |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
471100