SupportBot 7.3

This commit is contained in:
ItzEmerald committed 2021-10-04 13:54:30 +01:00
1 parent 19a12f6c8f
commit 09f0873f27
4762 files changed
+504608 -52

No files matched your search

+24
View File
@@ -0,0 +1,24 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/**
Retrieve the missing values in a collection based on an array of items.
@hidden
@param source - Source collection to search through.
@param items - Items to search for.
@param maxValues - Maximum number of values after the search process is stopped. Default: 5.
*/
exports.default = (source, items, maxValues = 5) => {
const missingValues = [];
for (const value of items) {
if (source.has(value)) {
continue;
}
missingValues.push(value);
if (missingValues.length === maxValues) {
return missingValues;
}
}
return missingValues.length === 0 ? true : missingValues;
};