debian-mirror-gitlab/app/assets/javascripts/lib/utils/set.js

10 lines
389 B
JavaScript
Raw Normal View History

2019-12-21 20:55:43 +05:30
/**
* 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}
*/
// eslint-disable-next-line import/prefer-default-export
export const isSubset = (subset, superset) =>
Array.from(subset).every(value => superset.has(value));