summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/lib/utils/set.js
blob: 541934c4221f63d90a0c606b2d413e40b0a50d89 (plain)
1
2
3
4
5
6
7
8
/**
 * 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));