debian-mirror-gitlab/app/assets/javascripts/lib/utils/set.js
2020-11-24 15:15:51 +05:30

8 lines
332 B
JavaScript

/**
* Checks if the first argument is a subset of the second argument.
* @param {Set} subset The set to be considered as the subset.
* @param {Set} superset The set to be considered as the superset.
* @returns {boolean}
*/
export const isSubset = (subset, superset) =>
Array.from(subset).every(value => superset.has(value));