(sub, dom, options = {})
| 43 | // - Else return true |
| 44 | |
| 45 | const subset = (sub, dom, options = {}) => { |
| 46 | if (sub === dom) { |
| 47 | return true |
| 48 | } |
| 49 | |
| 50 | sub = new Range(sub, options) |
| 51 | dom = new Range(dom, options) |
| 52 | let sawNonNull = false |
| 53 | |
| 54 | OUTER: for (const simpleSub of sub.set) { |
| 55 | for (const simpleDom of dom.set) { |
| 56 | const isSub = simpleSubset(simpleSub, simpleDom, options) |
| 57 | sawNonNull = sawNonNull || isSub !== null |
| 58 | if (isSub) { |
| 59 | continue OUTER |
| 60 | } |
| 61 | } |
| 62 | // the null set is a subset of everything, but null simple ranges in |
| 63 | // a complex range should be ignored. so if we saw a non-null range, |
| 64 | // then we know this isn't a subset, but if EVERY simple range was null, |
| 65 | // then it is a subset. |
| 66 | if (sawNonNull) { |
| 67 | return false |
| 68 | } |
| 69 | } |
| 70 | return true |
| 71 | } |
| 72 | |
| 73 | const minimumVersionWithPreRelease = [new Comparator('>=0.0.0-0')] |
| 74 | const minimumVersion = [new Comparator('>=0.0.0')] |
no test coverage detected