Add comprehensive tests for role middleware and fix package dependencies
Some checks are pending
Docker Test / test (push) Waiting to run
Some checks are pending
Docker Test / test (push) Waiting to run
This commit is contained in:
parent
64aa924270
commit
bfd432d094
1884 changed files with 384668 additions and 84 deletions
30
node_modules/@sinonjs/samsam/lib/is-subset.js
generated
vendored
Normal file
30
node_modules/@sinonjs/samsam/lib/is-subset.js
generated
vendored
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
"use strict";
|
||||
|
||||
var forEach = require("@sinonjs/commons").prototypes.set.forEach;
|
||||
|
||||
/**
|
||||
* Returns `true` when `s1` is a subset of `s2`, `false` otherwise
|
||||
*
|
||||
* @private
|
||||
* @param {Array|Set} s1 The target value
|
||||
* @param {Array|Set} s2 The containing value
|
||||
* @param {Function} compare A comparison function, should return `true` when
|
||||
* values are considered equal
|
||||
* @returns {boolean} Returns `true` when `s1` is a subset of `s2`, `false`` otherwise
|
||||
*/
|
||||
function isSubset(s1, s2, compare) {
|
||||
var allContained = true;
|
||||
forEach(s1, function (v1) {
|
||||
var includes = false;
|
||||
forEach(s2, function (v2) {
|
||||
if (compare(v2, v1)) {
|
||||
includes = true;
|
||||
}
|
||||
});
|
||||
allContained = allContained && includes;
|
||||
});
|
||||
|
||||
return allContained;
|
||||
}
|
||||
|
||||
module.exports = isSubset;
|
||||
Loading…
Add table
Add a link
Reference in a new issue