feat: refactoring project
This commit is contained in:
12
node_modules/webpack/lib/util/ArrayHelpers.js
generated
vendored
12
node_modules/webpack/lib/util/ArrayHelpers.js
generated
vendored
@@ -13,7 +13,7 @@
|
||||
* @returns {boolean} returns true if all the elements of passed arrays are strictly equal.
|
||||
*/
|
||||
|
||||
exports.equals = (a, b) => {
|
||||
module.exports.equals = (a, b) => {
|
||||
if (a.length !== b.length) return false;
|
||||
for (let i = 0; i < a.length; i++) {
|
||||
if (a[i] !== b[i]) return false;
|
||||
@@ -28,8 +28,13 @@ exports.equals = (a, b) => {
|
||||
* @param {(value: T) => boolean} fn Partition function which partitions based on truthiness of result.
|
||||
* @returns {[Array<T>, Array<T>]} returns the values of `arr` partitioned into two new arrays based on fn predicate.
|
||||
*/
|
||||
exports.groupBy = (arr = [], fn) => {
|
||||
return arr.reduce(
|
||||
|
||||
module.exports.groupBy = (
|
||||
// eslint-disable-next-line default-param-last
|
||||
arr = [],
|
||||
fn
|
||||
) =>
|
||||
arr.reduce(
|
||||
/**
|
||||
* @param {[Array<T>, Array<T>]} groups An accumulator storing already partitioned values returned from previous call.
|
||||
* @param {T} value The value of the current element
|
||||
@@ -41,4 +46,3 @@ exports.groupBy = (arr = [], fn) => {
|
||||
},
|
||||
[[], []]
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user